From 33db44c63dec464ef925e7859ba0136dc76359b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sat, 27 Jun 2020 13:00:21 +0200 Subject: [PATCH 01/27] Update bindgen configuration, update bindings Now (optionally) runs bindgen during tcod_sys build; requires (and generates) separate bindings per target --- Cargo.toml | 2 +- README.md | 11 - src/bindings.rs | 5 +- src/bsp.rs | 38 +- src/console.rs | 34 +- src/heightmap.rs | 2 +- src/image.rs | 2 +- src/input.rs | 43 +- src/line.rs | 4 +- src/map.rs | 14 +- src/namegen.rs | 4 +- src/pathfinding.rs | 37 +- tcod_sys/Cargo.toml | 4 +- tcod_sys/README.md | 29 + tcod_sys/bindgen.h | 5 + tcod_sys/build.rs | 51 + tcod_sys/lib.rs | 3635 +-------- tcod_sys/x86_64-pc-windows-msvc_bindings.rs | 7948 +++++++++++++++++++ 18 files changed, 8129 insertions(+), 3739 deletions(-) create mode 100644 tcod_sys/README.md create mode 100644 tcod_sys/bindgen.h create mode 100644 tcod_sys/x86_64-pc-windows-msvc_bindings.rs diff --git a/Cargo.toml b/Cargo.toml index eeecd5295..87f2b73dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ serialization = ["serde", "serde_derive"] [dependencies.tcod-sys] path = "tcod_sys" -version = "5.0.0" +version = "6.0.0" [dev-dependencies] rand = "0.3" diff --git a/README.md b/README.md index a8c1e5ed4..2ef306b1c 100644 --- a/README.md +++ b/README.md @@ -184,11 +184,6 @@ We're not sure exactly why this is so we'd appreciate anyone's help! Contributing ------------ -The raw bindings were generated using -[rust-bindgen](https://github.com/rust-lang/rust-bindgen) and are located at -`src/ffi.rs`. The safe (hopefully?) wrapper was built on top of them at -`src/lib.rs`. - This is far from done, patches to missing functionality wrappers, documentation and examples are very much appreciated. If your patch (any patch -- including typos) gets accepted, you'll get a commit access if you want it. @@ -196,12 +191,6 @@ typos) gets accepted, you'll get a commit access if you want it. We accept GitHub as well as regular pull requests (i.e. emailing or tweeting the URL of your feature branch works). -You can regenerate the raw bindings by running: - -```sh -bindgen -builtins -l tcod include/libtcod.h -o src/ffi.rs -``` - ### Contributors diff --git a/src/bindings.rs b/src/bindings.rs index 91ed614bf..971f7181d 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -6,9 +6,6 @@ pub use std::os::raw::{c_char, c_int, c_float, c_uint, c_void, c_uchar}; use std::mem::transmute; use super::input::KeyCode; -#[allow(non_camel_case_types)] -pub type c_bool = c_uchar; - pub trait AsNative { unsafe fn as_native(&self) -> &T; unsafe fn as_native_mut(&mut self) -> &mut T; @@ -40,7 +37,7 @@ impl + ?Sized> AsNative for Box { pub fn keycode_from_native(input: self::ffi::TCOD_keycode_t) -> Option { match input as u32 { - x @ 0 ... 66 => Some(unsafe { transmute(x) }), + x @ 0 ..= 66 => Some(unsafe { transmute(x) }), _ => None } } diff --git a/src/bsp.rs b/src/bsp.rs index 0b338cb7d..ae0b3938c 100644 --- a/src/bsp.rs +++ b/src/bsp.rs @@ -2,7 +2,7 @@ use bindings::ffi; use bindings::AsNative; -use bindings::{c_void, c_bool}; +use bindings::c_void; use random::Rng; use std::ops::{Deref, DerefMut}; use std::fmt; @@ -64,7 +64,7 @@ impl<'a> fmt::Debug for Bsp<'a> { } -extern "C" fn callback_wrapper(node: *mut ffi::TCOD_bsp_t, user_data: *mut c_void) -> c_bool +extern "C" fn callback_wrapper(node: *mut ffi::TCOD_bsp_t, user_data: *mut c_void) -> bool where T: FnMut(&mut Bsp) -> bool { let callback_ptr = user_data as *mut T; @@ -73,7 +73,7 @@ extern "C" fn callback_wrapper(node: *mut ffi::TCOD_bsp_t, user_data: *mut c_ }; if node.is_null() { panic!("Null node when traversing a BSP.") } let mut bsp = Bsp { bsp: unsafe { &mut *node }, root: false }; - cb(&mut bsp) as c_bool + cb(&mut bsp) } impl<'a> Bsp<'a> { @@ -94,7 +94,7 @@ impl<'a> Bsp<'a> { pub fn split_once(&mut self, horizontal: bool, position: i32) { unsafe { ffi::TCOD_bsp_split_once(self.bsp as *mut ffi::TCOD_bsp_t, - horizontal as u8, + horizontal, position) } } @@ -126,9 +126,9 @@ impl<'a> Bsp<'a> { } /// Returns `Some(Bsp)` with left subtree, or `None` if the BSP has not been split. - pub fn left(&self) -> Option { + pub fn left(&mut self) -> Option { unsafe { - let left = ffi::TCOD_bsp_left(self.bsp as *const ffi::TCOD_bsp_t); + let left = ffi::TCOD_bsp_left(self.bsp as *mut ffi::TCOD_bsp_t); if left.is_null() { None } else { @@ -141,9 +141,9 @@ impl<'a> Bsp<'a> { } /// Returns `Some(Bsp)` with right subtree, or `None` if the BSP has not been split. - pub fn right(&self) -> Option { + pub fn right(&mut self) -> Option { unsafe { - let right = ffi::TCOD_bsp_right(self.bsp as *const ffi::TCOD_bsp_t) ; + let right = ffi::TCOD_bsp_right(self.bsp as *mut ffi::TCOD_bsp_t) ; if right.is_null() { None } else { @@ -156,9 +156,9 @@ impl<'a> Bsp<'a> { } /// Returns `Some(Bsp)` with father, or `None` if the node is root. - pub fn father(&self) -> Option { + pub fn father(&mut self) -> Option { unsafe { - let father = ffi::TCOD_bsp_father(self.bsp as *const ffi::TCOD_bsp_t); + let father = ffi::TCOD_bsp_father(self.bsp as *mut ffi::TCOD_bsp_t); if father.is_null() { None } else { @@ -170,17 +170,17 @@ impl<'a> Bsp<'a> { } } - pub fn is_leaf(&self) -> bool { - unsafe { ffi::TCOD_bsp_is_leaf(self.bsp as *const ffi::TCOD_bsp_t) != 0 } + pub fn is_leaf(&mut self) -> bool { + unsafe { ffi::TCOD_bsp_is_leaf(self.bsp as *mut ffi::TCOD_bsp_t) } } - pub fn contains(&self, cx: i32, cy: i32) -> bool { - unsafe { ffi::TCOD_bsp_contains(self.bsp as *const ffi::TCOD_bsp_t, cx, cy) != 0 } + pub fn contains(&mut self, cx: i32, cy: i32) -> bool { + unsafe { ffi::TCOD_bsp_contains(self.bsp as *mut ffi::TCOD_bsp_t, cx, cy) } } - pub fn find_node(&self, cx: i32, cy: i32) -> Option { + pub fn find_node(&mut self, cx: i32, cy: i32) -> Option { unsafe { - let pointer = ffi::TCOD_bsp_find_node(self.bsp as *const ffi::TCOD_bsp_t, + let pointer = ffi::TCOD_bsp_find_node(self.bsp as *mut ffi::TCOD_bsp_t, cx, cy); if pointer.is_null() { None @@ -194,11 +194,11 @@ impl<'a> Bsp<'a> { } pub fn horizontal(&self) -> bool { - self.horizontal != 0 + self.horizontal } pub fn set_horizontal(&mut self, h: bool) { - self.horizontal = h as u8; + self.horizontal = h; } /// Instead of 5 `traverse*` functions as in original API, Rust binding @@ -246,7 +246,7 @@ impl<'a> Bsp<'a> { cb as *mut _ as *mut c_void), } }; - retval != 0 + retval } } diff --git a/src/console.rs b/src/console.rs index 66b73f2fb..ee223e6da 100644 --- a/src/console.rs +++ b/src/console.rs @@ -61,7 +61,7 @@ use std::mem::transmute; use std::path::Path; use bindings::ffi::{self, TCOD_bkgnd_flag_t, TCOD_renderer_t, TCOD_font_flags_t, TCOD_alignment_t}; -use bindings::{AsNative, FromNative, c_bool, CString}; +use bindings::{AsNative, FromNative, CString}; use colors::Color; use input::{Key, KeyPressFlags}; @@ -224,28 +224,28 @@ impl Root { /// Returns with true when the `Root` console is in fullscreen mode. pub fn is_fullscreen(&self) -> bool { unsafe { - ffi::TCOD_console_is_fullscreen() != 0 + ffi::TCOD_console_is_fullscreen() } } /// Toggles between windowed and fullscreen mode. pub fn set_fullscreen(&mut self, fullscreen: bool) { unsafe { - ffi::TCOD_console_set_fullscreen(fullscreen as u8); + ffi::TCOD_console_set_fullscreen(fullscreen); } } /// Returns true if the `Root` console is currently active. pub fn is_active(&self) -> bool { unsafe { - ffi::TCOD_console_is_active() != 0 + ffi::TCOD_console_is_active() } } /// Returns true if the `Root` console has focus. pub fn has_focus(&self) -> bool { unsafe { - ffi::TCOD_console_has_mouse_focus() != 0 + ffi::TCOD_console_has_mouse_focus() } } @@ -279,7 +279,7 @@ impl Root { /// keyboard buffer. If false, it returns the first element from it. pub fn wait_for_keypress(&mut self, flush: bool) -> Key { let tcod_key = unsafe { - ffi::TCOD_console_wait_for_keypress(flush as c_bool) + ffi::TCOD_console_wait_for_keypress(flush) }; tcod_key.into() } @@ -300,7 +300,7 @@ impl Root { /// Returns with true if the `Root` console has been closed. pub fn window_closed(&self) -> bool { unsafe { - ffi::TCOD_console_is_window_closed() != 0 + ffi::TCOD_console_is_window_closed() } } @@ -324,8 +324,8 @@ impl Root { pub fn render_credits(&self, x : i32, y: i32, alpha: bool) -> bool { unsafe { - let result = ffi::TCOD_console_credits_render(x, y, alpha as c_bool); - result != 0 + let result = ffi::TCOD_console_credits_render(x, y, alpha); + result } } @@ -538,7 +538,7 @@ impl<'a> RootInitializer<'a> { let c_title = CString::new((*self.title).as_ref().as_bytes()).unwrap(); ffi::TCOD_console_init_root(self.width, self.height, c_title.as_ptr(), - self.is_fullscreen as c_bool, + self.is_fullscreen, self.console_renderer.into()); } Root { _blocker: PhantomData } @@ -854,7 +854,7 @@ pub trait Console : AsNative { } else { let c_text = to_wstring(text.as_ref()); unsafe { - ffi::TCOD_console_print_utf(*self.as_native(), x, y, c_text.as_ptr() as *const i32); + ffi::TCOD_console_print_utf(*self.as_native(), x, y, c_text.as_ptr() as *const ffi::wchar_t); } } } @@ -875,7 +875,7 @@ pub trait Console : AsNative { } else { let c_text = to_wstring(text.as_ref()); unsafe { - ffi::TCOD_console_print_rect_utf(*self.as_native(), x, y, width, height, c_text.as_ptr() as *const i32); + ffi::TCOD_console_print_rect_utf(*self.as_native(), x, y, width, height, c_text.as_ptr() as *const ffi::wchar_t); } } } @@ -903,7 +903,7 @@ pub trait Console : AsNative { ffi::TCOD_console_print_ex_utf(*self.as_native(), x, y, background_flag.into(), alignment.into(), - c_text.as_ptr() as *const i32); + c_text.as_ptr() as *const ffi::wchar_t); } } } @@ -928,7 +928,7 @@ pub trait Console : AsNative { unsafe { ffi::TCOD_console_print_rect_ex_utf(*self.as_native(), x, y, width, height, background_flag.into(), alignment.into(), - c_text.as_ptr() as *const i32); + c_text.as_ptr() as *const ffi::wchar_t); } } } @@ -949,7 +949,7 @@ pub trait Console : AsNative { let c_text = to_wstring(text.as_ref()); unsafe { ffi::TCOD_console_get_height_rect_utf(*self.as_native(), x, y, width, height, - c_text.as_ptr() as *const i32) + c_text.as_ptr() as *const ffi::wchar_t) } } } @@ -970,7 +970,7 @@ pub trait Console : AsNative { assert!(x + width <= self.width()); assert!(y + height <= self.height()); unsafe { - ffi::TCOD_console_rect(*self.as_native(), x, y, width, height, clear as c_bool, background_flag.into()); + ffi::TCOD_console_rect(*self.as_native(), x, y, width, height, clear, background_flag.into()); } } @@ -1024,7 +1024,7 @@ pub trait Console : AsNative { let c_title = title.as_ref().map_or(ptr::null(), |s| s.as_ptr()); unsafe { ffi::TCOD_console_print_frame(*self.as_native(), x, y, width, height, - clear as c_bool, background_flag.into(), + clear, background_flag.into(), c_title); } } diff --git a/src/heightmap.rs b/src/heightmap.rs index 3b8ecaff7..cf544ff3c 100644 --- a/src/heightmap.rs +++ b/src/heightmap.rs @@ -77,7 +77,7 @@ impl HeightMap { } pub fn has_land_on_border(&self, water_level: f32) -> bool { - unsafe { ffi::TCOD_heightmap_has_land_on_border(self.height_map, water_level) != 0 } + unsafe { ffi::TCOD_heightmap_has_land_on_border(self.height_map, water_level) } } pub fn get_minmax(&self) -> MinMax { diff --git a/src/image.rs b/src/image.rs index 14d9b0f58..157a2b919 100644 --- a/src/image.rs +++ b/src/image.rs @@ -125,7 +125,7 @@ impl Image { pub fn is_pixel_transparent(&self, x: i32, y: i32) -> bool { assert!(x >= 0 && y >= 0 && x < self.width && y < self.height); unsafe { - ffi::TCOD_image_is_pixel_transparent(self.tcod_image, x, y) != 0 + ffi::TCOD_image_is_pixel_transparent(self.tcod_image, x, y) } } diff --git a/src/input.rs b/src/input.rs index 8c1889ee8..1535c6de2 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1,8 +1,7 @@ -use std::mem; use std::str; use bindings::ffi; -use bindings::{CStr, c_bool, c_char, c_uint, keycode_from_native}; +use bindings::{CStr, c_char, c_uint, keycode_from_native}; /// Deprecated. Use `tcod::input::Mouse` instead. @@ -118,14 +117,14 @@ impl From for Key { code: keycode_from_native(tcod_key.vk).unwrap(), text: tcod_key.text, printable: tcod_key.c as u8 as char, - pressed: tcod_key.pressed != 0, - left_alt: tcod_key.lalt != 0, - left_ctrl: tcod_key.lctrl != 0, - right_alt: tcod_key.ralt != 0, - right_ctrl: tcod_key.rctrl != 0, - shift: tcod_key.shift != 0, - alt: tcod_key.lalt != 0 || tcod_key.ralt != 0, - ctrl: tcod_key.lctrl != 0 || tcod_key.rctrl != 0, + pressed: tcod_key.pressed, + left_alt: tcod_key.lalt, + left_ctrl: tcod_key.lctrl, + right_alt: tcod_key.ralt, + right_ctrl: tcod_key.rctrl, + shift: tcod_key.shift, + alt: tcod_key.lalt || tcod_key.ralt, + ctrl: tcod_key.lctrl || tcod_key.rctrl, } } } @@ -153,13 +152,13 @@ pub struct Mouse { pub fn show_cursor(visible: bool) { unsafe { - ffi::TCOD_mouse_show_cursor(visible as c_bool); + ffi::TCOD_mouse_show_cursor(visible); } } pub fn is_cursor_visible() -> bool { unsafe { - ffi::TCOD_mouse_is_cursor_visible() != 0 + ffi::TCOD_mouse_is_cursor_visible() } } @@ -190,8 +189,8 @@ bitflags! { } pub fn check_for_event(event_mask: EventFlags) -> Option<(EventFlags, Event)> { - let mut c_key_state: ffi::TCOD_key_t = unsafe { mem::uninitialized() }; - let mut c_mouse_state: ffi::TCOD_mouse_t = unsafe { mem::uninitialized() }; + let mut c_key_state: ffi::TCOD_key_t = Default::default(); + let mut c_mouse_state: ffi::TCOD_mouse_t = Default::default(); let event = unsafe { ffi::TCOD_sys_check_for_event(event_mask.bits() as i32, @@ -225,14 +224,14 @@ pub fn check_for_event(event_mask: EventFlags) -> Option<(EventFlags, Event)> { cy: c_mouse_state.cy as isize, dcx: c_mouse_state.dcx as isize, dcy: c_mouse_state.dcy as isize, - lbutton: c_mouse_state.lbutton != 0, - rbutton: c_mouse_state.rbutton != 0, - mbutton: c_mouse_state.mbutton != 0, - lbutton_pressed: c_mouse_state.lbutton_pressed != 0, - rbutton_pressed: c_mouse_state.rbutton_pressed != 0, - mbutton_pressed: c_mouse_state.mbutton_pressed != 0, - wheel_up: c_mouse_state.wheel_up != 0, - wheel_down: c_mouse_state.wheel_down != 0 + lbutton: c_mouse_state.lbutton, + rbutton: c_mouse_state.rbutton, + mbutton: c_mouse_state.mbutton, + lbutton_pressed: c_mouse_state.lbutton_pressed, + rbutton_pressed: c_mouse_state.rbutton_pressed, + mbutton_pressed: c_mouse_state.mbutton_pressed, + wheel_up: c_mouse_state.wheel_up, + wheel_down: c_mouse_state.wheel_down })) } else { None diff --git a/src/line.rs b/src/line.rs index 684a34586..fcc1b3d51 100644 --- a/src/line.rs +++ b/src/line.rs @@ -50,7 +50,7 @@ impl Line { ffi::TCOD_line_step_mt(&mut x, &mut y, &mut self.tcod_line) }; - if end == 0 { + if end { Some((x, y)) } else { None @@ -69,7 +69,7 @@ impl Line { let step = unsafe { ffi::TCOD_line_step_mt(&mut x, &mut y, &mut self.tcod_line) }; - if step != 0 { + if step { break } } diff --git a/src/map.rs b/src/map.rs index a9761c649..207a3898c 100644 --- a/src/map.rs +++ b/src/map.rs @@ -1,5 +1,5 @@ use bindings::ffi::{self, TCOD_fov_algorithm_t}; -use bindings::{AsNative, c_bool}; +use bindings::AsNative; pub struct Map { tcod_map: ffi::TCOD_map_t, @@ -36,8 +36,8 @@ impl Map { assert!(x < width && y < height); unsafe { ffi::TCOD_map_set_properties(self.tcod_map, x, y, - transparent as c_bool, - walkable as c_bool); + transparent, + walkable); } } @@ -46,7 +46,7 @@ impl Map { assert!(origin_x >= 0 && origin_y >= 0); unsafe { ffi::TCOD_map_compute_fov(self.tcod_map, origin_x, origin_y, max_radius, - light_walls as c_bool, + light_walls, algo.into()); } } @@ -56,7 +56,7 @@ impl Map { let (width, height) = self.size(); assert!(x < width && y < height); unsafe { - ffi::TCOD_map_is_in_fov(self.tcod_map, x, y) != 0 + ffi::TCOD_map_is_in_fov(self.tcod_map, x, y) } } @@ -65,13 +65,13 @@ impl Map { let (width, height) = self.size(); assert!(x < width && y < height); unsafe { - ffi::TCOD_map_is_walkable(self.tcod_map, x, y) != 0 + ffi::TCOD_map_is_walkable(self.tcod_map, x, y) } } pub fn clear(&mut self, transparent: bool, walkable: bool) { unsafe { - ffi::TCOD_map_clear(self.tcod_map, transparent as c_bool, walkable as c_bool); + ffi::TCOD_map_clear(self.tcod_map, transparent, walkable ); } } } diff --git a/src/namegen.rs b/src/namegen.rs index 8c8cad856..29178647b 100644 --- a/src/namegen.rs +++ b/src/namegen.rs @@ -63,7 +63,7 @@ impl Namegen { pub fn generate(&self, name: T) -> Option where T: AsRef { unsafe { let name_string = CString::new(name.as_ref()).unwrap(); - let borrowed = ffi::TCOD_namegen_generate(name_string.as_ptr() as *mut _, 0); + let borrowed = ffi::TCOD_namegen_generate(name_string.as_ptr() as *mut _, false); cstr_to_owned(borrowed) } } @@ -74,7 +74,7 @@ impl Namegen { let rule_string = CString::new(rule.as_ref()).unwrap(); let borrowed = ffi::TCOD_namegen_generate_custom(name_string.as_ptr() as *mut _, - rule_string.as_ptr() as *mut _, 0); + rule_string.as_ptr() as *mut _, false); cstr_to_owned(borrowed) } } diff --git a/src/pathfinding.rs b/src/pathfinding.rs index 9a679d192..de169f1fe 100644 --- a/src/pathfinding.rs +++ b/src/pathfinding.rs @@ -1,5 +1,5 @@ use bindings::ffi; -use bindings::{AsNative, c_bool, c_float, c_int, c_void}; +use bindings::{AsNative, c_float, c_int, c_void}; use map::Map; enum PathInnerData<'a> { @@ -88,7 +88,7 @@ impl<'a> AStar<'a> { unsafe { ffi::TCOD_path_compute(self.tcod_path, from_x, from_y, - to_x, to_y) != 0 + to_x, to_y) } } @@ -109,7 +109,7 @@ impl<'a> AStar<'a> { let mut x: c_int = 0; let mut y: c_int = 0; match ffi::TCOD_path_walk(self.tcod_path, &mut x, &mut y, - recalculate_when_needed as c_bool) != 0 { + recalculate_when_needed) { true => Some((x, y)), false => None, } @@ -148,13 +148,13 @@ impl<'a> AStar<'a> { let mut x: c_int = 0; let mut y: c_int = 0; ffi::TCOD_path_get(self.tcod_path, index, &mut x, &mut y); - (Some((x, y))) + Some((x, y)) } } pub fn is_empty(&self) -> bool { unsafe { - ffi::TCOD_path_is_empty(self.tcod_path) != 0 + ffi::TCOD_path_is_empty(self.tcod_path) } } @@ -238,7 +238,7 @@ impl<'a> Dijkstra<'a> { let (x, y) = destination; if x >= 0 && y >= 0 && x < self.width && y < self.height { unsafe { - ffi::TCOD_dijkstra_path_set(self.tcod_path, x, y) != 0 + ffi::TCOD_dijkstra_path_set(self.tcod_path, x, y) } } else { false @@ -257,9 +257,10 @@ impl<'a> Dijkstra<'a> { unsafe { let mut x: c_int = 0; let mut y: c_int = 0; - match ffi::TCOD_dijkstra_path_walk(self.tcod_path, &mut x, &mut y) != 0 { - true => Some((x, y)), - false => None, + if ffi::TCOD_dijkstra_path_walk(self.tcod_path, &mut x, &mut y) { + Some((x,y)) + } else { + None } } } @@ -297,7 +298,7 @@ impl<'a> Dijkstra<'a> { pub fn is_empty(&self) -> bool { unsafe { - ffi::TCOD_dijkstra_is_empty(self.tcod_path) != 0 + ffi::TCOD_dijkstra_is_empty(self.tcod_path) } } @@ -320,10 +321,11 @@ impl Iterator for AStarIterator { unsafe { let mut x: c_int = 0; let mut y: c_int = 0; - match ffi::TCOD_path_walk(self.tcod_path, &mut x, &mut y, - self.recalculate as c_bool) != 0 { - true => Some((x, y)), - false => None, + if ffi::TCOD_path_walk(self.tcod_path, &mut x, &mut y, + self.recalculate) { + Some((x,y)) + } else { + None } } } @@ -340,9 +342,10 @@ impl Iterator for DijkstraIterator { unsafe { let mut x: c_int = 0; let mut y: c_int = 0; - match ffi::TCOD_dijkstra_path_walk(self.tcod_path, &mut x, &mut y) != 0 { - true => Some((x, y)), - false => None, + if ffi::TCOD_dijkstra_path_walk(self.tcod_path, &mut x, &mut y) { + Some((x,y)) + } else { + None } } } diff --git a/tcod_sys/Cargo.toml b/tcod_sys/Cargo.toml index d8290ba96..75239d26c 100644 --- a/tcod_sys/Cargo.toml +++ b/tcod_sys/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tcod-sys" description = "Raw FFI bindings & build script to link against libtcod." -version = "5.0.1" +version = "6.0.0" license = "WTFPL" homepage = "https://github.com/tomassedovic/tcod-rs" repository = "https://github.com/tomassedovic/tcod-rs/tree/master/tcod-sys" @@ -18,7 +18,9 @@ path = "lib.rs" [features] dynlib = [] +generate_bindings = ["bindgen"] [build-dependencies] cc = "1.0" pkg-config = "0.3" +bindgen = {version = "0.54", optional = true} diff --git a/tcod_sys/README.md b/tcod_sys/README.md new file mode 100644 index 000000000..884ed1b82 --- /dev/null +++ b/tcod_sys/README.md @@ -0,0 +1,29 @@ +Bindings +------------ + +Bindings are generated for the given target during build time when the feature +`generate_bindings` is enabled: +```sh +cargo build --features generate_bindings +``` + +This will create or update the file `$TARGET_bindings.rs` in the root of +tcod_sys. This file is included by `lib.rs`. + +If the bindings are up to date, doing a build without the `generate_bindings` +feature will simply use the existing bindings, or if none exist for the given +target, will panic during the build with a message about the bindings missing: +``` +thread 'main' panicked at 'No bindings found for $TARGET', build.rs:148:9 +``` + +The current raw bindings were generated using +[rust-bindgen](https://github.com/rust-lang/rust-bindgen) (v0.54) and are located at +`src/ffi.rs`. The safe (hopefully?) wrapper was built on top of them at +`src/lib.rs`. + +You can regenerate the raw bindings by running: + +```sh +bindgen --builtins --default-enum-style rust --with-derive-default --raw-line "#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]" libtcod/include/libtcod.h -o lib.rs +``` diff --git a/tcod_sys/bindgen.h b/tcod_sys/bindgen.h new file mode 100644 index 000000000..5bdc072c5 --- /dev/null +++ b/tcod_sys/bindgen.h @@ -0,0 +1,5 @@ +#define TCOD_CONSOLE_SUPPORT +#define TCOD_OSUTIL_SUPPORT +#define TCOD_SDL2 + +#include "libtcod/include/libtcod.h" diff --git a/tcod_sys/build.rs b/tcod_sys/build.rs index c9cd5b234..87c5144ba 100644 --- a/tcod_sys/build.rs +++ b/tcod_sys/build.rs @@ -109,6 +109,52 @@ fn build_linux_dynamic(dst: &Path, libtcod_sources: &[& 'static str]) { pkg_config::find_library("x11").unwrap(); } +#[cfg(feature = "generate_bindings")] +fn generate_bindings>(dst_dir: P) { + + // Tell cargo to invalidate the built crate whenever the wrapper changes + println!("cargo:rerun-if-changed=wrapper.h"); + + let bindings = bindgen::Builder::default() + .header("bindgen.h") + .emit_builtins() + .default_enum_style(bindgen::EnumVariation::Rust{non_exhaustive:false}) + .derive_default(true) + // Tell cargo to invalidate the built crate whenever any of the + // included header files changed. + .parse_callbacks(Box::new(bindgen::CargoCallbacks)) + .generate() + .expect("Unable to generate bindings"); + + // Write the bindings to the $OUT_DIR/bindings.rs file. + let bindings_file = dst_dir.as_ref().join("bindings.rs"); + bindings + .write_to_file(&bindings_file) + .expect("Couldn't write bindings!"); + + // Copy bindings to $TARGET_bindings.rs + let target = env::var("TARGET").unwrap(); + let target_bindings_file = format!("{}_bindings.rs", target); + std::fs::copy(bindings_file, &target_bindings_file).unwrap(); + println!("cargo:rustc-env=BINDINGS_TARGET={}", target); + + // Tell cargo to invalidate the built crate whenever the bindings change + println!("cargo:rerun-if-changed={}", target_bindings_file); +} + +#[cfg(not(feature = "generate_bindings"))] +fn validate_bindings_for_target() { + let target = env::var("TARGET").unwrap(); + let target_bindings_file = format!("{}_bindings.rs", target); + let target_bindings_path: &Path = target_bindings_file.as_ref(); + if !target_bindings_path.exists() { + panic!("No bindings found for {}", target); + } + println!("cargo:rustc-env=BINDINGS_TARGET={}", target); + + // Tell cargo to invalidate the built crate whenever the bindings change + println!("cargo:rerun-if-changed={}", target_bindings_file); +} fn main() { let is_crater = option_env!("CRATER_TASK_TYPE"); @@ -121,6 +167,11 @@ fn main() { let dst_dir = env::var("OUT_DIR").unwrap(); let target = env::var("TARGET").unwrap(); + #[cfg(feature = "generate_bindings")] + generate_bindings(&dst_dir); + #[cfg(not(feature = "generate_bindings"))] + validate_bindings_for_target(); + let src = Path::new(&src_dir); let dst = Path::new(&dst_dir); let sdl_lib_dir = src.join("libtcod").join("dependencies").join("SDL2-2.0.7").join("lib").join(&target); diff --git a/tcod_sys/lib.rs b/tcod_sys/lib.rs index 11c66475b..ba20119ef 100644 --- a/tcod_sys/lib.rs +++ b/tcod_sys/lib.rs @@ -1,3636 +1,3 @@ #![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)] -/* automatically generated by rust-bindgen */ -#[repr(C)] -pub struct __BindgenUnionField(::std::marker::PhantomData); -impl __BindgenUnionField { - #[inline] - pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } - #[inline] - pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } -} -impl ::std::default::Default for __BindgenUnionField { - #[inline] - fn default() -> Self { Self::new() } -} -impl ::std::clone::Clone for __BindgenUnionField { - #[inline] - fn clone(&self) -> Self { Self::new() } -} -impl ::std::marker::Copy for __BindgenUnionField { } -impl ::std::fmt::Debug for __BindgenUnionField { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -pub const _WCHAR_H: ::std::os::raw::c_uint = 1; -pub const _FEATURES_H: ::std::os::raw::c_uint = 1; -pub const _DEFAULT_SOURCE: ::std::os::raw::c_uint = 1; -pub const __USE_ISOC11: ::std::os::raw::c_uint = 1; -pub const __USE_ISOC99: ::std::os::raw::c_uint = 1; -pub const __USE_ISOC95: ::std::os::raw::c_uint = 1; -pub const __USE_POSIX_IMPLICITLY: ::std::os::raw::c_uint = 1; -pub const _POSIX_SOURCE: ::std::os::raw::c_uint = 1; -pub const _POSIX_C_SOURCE: ::std::os::raw::c_uint = 200809; -pub const __USE_POSIX: ::std::os::raw::c_uint = 1; -pub const __USE_POSIX2: ::std::os::raw::c_uint = 1; -pub const __USE_POSIX199309: ::std::os::raw::c_uint = 1; -pub const __USE_POSIX199506: ::std::os::raw::c_uint = 1; -pub const __USE_XOPEN2K: ::std::os::raw::c_uint = 1; -pub const __USE_XOPEN2K8: ::std::os::raw::c_uint = 1; -pub const _ATFILE_SOURCE: ::std::os::raw::c_uint = 1; -pub const __USE_MISC: ::std::os::raw::c_uint = 1; -pub const __USE_ATFILE: ::std::os::raw::c_uint = 1; -pub const __USE_FORTIFY_LEVEL: ::std::os::raw::c_uint = 0; -pub const _STDC_PREDEF_H: ::std::os::raw::c_uint = 1; -pub const __STDC_IEC_559__: ::std::os::raw::c_uint = 1; -pub const __STDC_IEC_559_COMPLEX__: ::std::os::raw::c_uint = 1; -pub const __STDC_ISO_10646__: ::std::os::raw::c_uint = 201505; -pub const __STDC_NO_THREADS__: ::std::os::raw::c_uint = 1; -pub const __GNU_LIBRARY__: ::std::os::raw::c_uint = 6; -pub const __GLIBC__: ::std::os::raw::c_uint = 2; -pub const __GLIBC_MINOR__: ::std::os::raw::c_uint = 25; -pub const _SYS_CDEFS_H: ::std::os::raw::c_uint = 1; -pub const __glibc_c99_flexarr_available: ::std::os::raw::c_uint = 1; -pub const __WORDSIZE: ::std::os::raw::c_uint = 64; -pub const __WORDSIZE_TIME64_COMPAT32: ::std::os::raw::c_uint = 1; -pub const __SYSCALL_WORDSIZE: ::std::os::raw::c_uint = 64; -pub const __GLIBC_USE_LIB_EXT2: ::std::os::raw::c_uint = 0; -pub const __GLIBC_USE_IEC_60559_BFP_EXT: ::std::os::raw::c_uint = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: ::std::os::raw::c_uint = 0; -pub const __FILE_defined: ::std::os::raw::c_uint = 1; -pub const ____FILE_defined: ::std::os::raw::c_uint = 1; -pub const __GNUC_VA_LIST: ::std::os::raw::c_uint = 1; -pub const _BITS_WCHAR_H: ::std::os::raw::c_uint = 1; -pub const ____mbstate_t_defined: ::std::os::raw::c_uint = 1; -pub const __mbstate_t_defined: ::std::os::raw::c_uint = 1; -pub const WEOF: ::std::os::raw::c_uint = 4294967295; -pub const _XLOCALE_H: ::std::os::raw::c_uint = 1; -pub const TCOD_HEXVERSION: ::std::os::raw::c_uint = 67075; -pub const TCOD_STRVERSION: &'static [u8; 6usize] = b"1.6.3\x00"; -pub const TCOD_TECHVERSION: ::std::os::raw::c_uint = 17171200; -pub const TCOD_KEY_TEXT_SIZE: ::std::os::raw::c_uint = 32; -pub const TCOD_NOISE_MAX_OCTAVES: ::std::os::raw::c_uint = 128; -pub const TCOD_NOISE_MAX_DIMENSIONS: ::std::os::raw::c_uint = 4; -pub const TCOD_NOISE_DEFAULT_HURST: f64 = 0.5; -pub const TCOD_NOISE_DEFAULT_LACUNARITY: f64 = 2.; -pub const TCOD_LEX_FLAG_NOCASE: ::std::os::raw::c_uint = 1; -pub const TCOD_LEX_FLAG_NESTING_COMMENT: ::std::os::raw::c_uint = 2; -pub const TCOD_LEX_FLAG_TOKENIZE_COMMENTS: ::std::os::raw::c_uint = 4; -pub const TCOD_LEX_ERROR: ::std::os::raw::c_int = -1; -pub const TCOD_LEX_UNKNOWN: ::std::os::raw::c_uint = 0; -pub const TCOD_LEX_SYMBOL: ::std::os::raw::c_uint = 1; -pub const TCOD_LEX_KEYWORD: ::std::os::raw::c_uint = 2; -pub const TCOD_LEX_IDEN: ::std::os::raw::c_uint = 3; -pub const TCOD_LEX_STRING: ::std::os::raw::c_uint = 4; -pub const TCOD_LEX_INTEGER: ::std::os::raw::c_uint = 5; -pub const TCOD_LEX_FLOAT: ::std::os::raw::c_uint = 6; -pub const TCOD_LEX_CHAR: ::std::os::raw::c_uint = 7; -pub const TCOD_LEX_EOF: ::std::os::raw::c_uint = 8; -pub const TCOD_LEX_COMMENT: ::std::os::raw::c_uint = 9; -pub const TCOD_LEX_MAX_SYMBOLS: ::std::os::raw::c_uint = 100; -pub const TCOD_LEX_SYMBOL_SIZE: ::std::os::raw::c_uint = 5; -pub const TCOD_LEX_MAX_KEYWORDS: ::std::os::raw::c_uint = 100; -pub const TCOD_LEX_KEYWORD_SIZE: ::std::os::raw::c_uint = 20; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_FILE { - _unused: [u8; 0], -} -pub type FILE = _IO_FILE; -pub type __FILE = _IO_FILE; -pub type va_list = __builtin_va_list; -pub type __gnuc_va_list = __builtin_va_list; -pub type wchar_t = ::std::os::raw::c_int; -pub type wint_t = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy)] -pub struct __mbstate_t { - pub __count: ::std::os::raw::c_int, - pub __value: __mbstate_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct __mbstate_t__bindgen_ty_1 { - pub __wch: __BindgenUnionField<::std::os::raw::c_uint>, - pub __wchb: __BindgenUnionField<[::std::os::raw::c_char; 4usize]>, - pub bindgen_union_field: u32, -} -impl Clone for __mbstate_t__bindgen_ty_1 { - fn clone(&self) -> Self { *self } -} -impl Clone for __mbstate_t { - fn clone(&self) -> Self { *self } -} -pub type mbstate_t = __mbstate_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct tm { - _unused: [u8; 0], -} -extern "C" { - pub fn wcscpy(__dest: *mut wchar_t, __src: *const wchar_t) - -> *mut wchar_t; -} -extern "C" { - pub fn wcsncpy(__dest: *mut wchar_t, __src: *const wchar_t, __n: usize) - -> *mut wchar_t; -} -extern "C" { - pub fn wcscat(__dest: *mut wchar_t, __src: *const wchar_t) - -> *mut wchar_t; -} -extern "C" { - pub fn wcsncat(__dest: *mut wchar_t, __src: *const wchar_t, __n: usize) - -> *mut wchar_t; -} -extern "C" { - pub fn wcscmp(__s1: *const wchar_t, __s2: *const wchar_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcsncmp(__s1: *const wchar_t, __s2: *const wchar_t, __n: usize) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcscasecmp(__s1: *const wchar_t, __s2: *const wchar_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcsncasecmp(__s1: *const wchar_t, __s2: *const wchar_t, __n: usize) - -> ::std::os::raw::c_int; -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct __locale_struct { - pub __locales: [*mut __locale_data; 13usize], - pub __ctype_b: *const ::std::os::raw::c_ushort, - pub __ctype_tolower: *const ::std::os::raw::c_int, - pub __ctype_toupper: *const ::std::os::raw::c_int, - pub __names: [*const ::std::os::raw::c_char; 13usize], -} -impl Clone for __locale_struct { - fn clone(&self) -> Self { *self } -} -pub type __locale_t = *mut __locale_struct; -pub type locale_t = __locale_t; -extern "C" { - pub fn wcscasecmp_l(__s1: *const wchar_t, __s2: *const wchar_t, - __loc: __locale_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcsncasecmp_l(__s1: *const wchar_t, __s2: *const wchar_t, - __n: usize, __loc: __locale_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcscoll(__s1: *const wchar_t, __s2: *const wchar_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcsxfrm(__s1: *mut wchar_t, __s2: *const wchar_t, __n: usize) - -> usize; -} -extern "C" { - pub fn wcscoll_l(__s1: *const wchar_t, __s2: *const wchar_t, - __loc: __locale_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcsxfrm_l(__s1: *mut wchar_t, __s2: *const wchar_t, __n: usize, - __loc: __locale_t) -> usize; -} -extern "C" { - pub fn wcsdup(__s: *const wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcschr(__wcs: *const wchar_t, __wc: wchar_t) - -> *mut ::std::os::raw::c_int; -} -extern "C" { - pub fn wcsrchr(__wcs: *const wchar_t, __wc: wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcscspn(__wcs: *const wchar_t, __reject: *const wchar_t) -> usize; -} -extern "C" { - pub fn wcsspn(__wcs: *const wchar_t, __accept: *const wchar_t) -> usize; -} -extern "C" { - pub fn wcspbrk(__wcs: *const wchar_t, __accept: *const wchar_t) - -> *mut wchar_t; -} -extern "C" { - pub fn wcsstr(__haystack: *const wchar_t, __needle: *const wchar_t) - -> *mut wchar_t; -} -extern "C" { - pub fn wcstok(__s: *mut wchar_t, __delim: *const wchar_t, - __ptr: *mut *mut wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcslen(__s: *const wchar_t) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn wcsnlen(__s: *const wchar_t, __maxlen: usize) -> usize; -} -extern "C" { - pub fn wmemchr(__s: *const wchar_t, __c: wchar_t, __n: usize) - -> *mut ::std::os::raw::c_int; -} -extern "C" { - pub fn wmemcmp(__s1: *const wchar_t, __s2: *const wchar_t, __n: usize) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wmemcpy(__s1: *mut wchar_t, __s2: *const wchar_t, __n: usize) - -> *mut wchar_t; -} -extern "C" { - pub fn wmemmove(__s1: *mut wchar_t, __s2: *const wchar_t, __n: usize) - -> *mut wchar_t; -} -extern "C" { - pub fn wmemset(__s: *mut wchar_t, __c: wchar_t, __n: usize) - -> *mut wchar_t; -} -extern "C" { - pub fn btowc(__c: ::std::os::raw::c_int) -> wint_t; -} -extern "C" { - pub fn wctob(__c: wint_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mbsinit(__ps: *const mbstate_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mbrtowc(__pwc: *mut wchar_t, __s: *const ::std::os::raw::c_char, - __n: usize, __p: *mut mbstate_t) -> usize; -} -extern "C" { - pub fn wcrtomb(__s: *mut ::std::os::raw::c_char, __wc: wchar_t, - __ps: *mut mbstate_t) -> usize; -} -extern "C" { - pub fn __mbrlen(__s: *const ::std::os::raw::c_char, __n: usize, - __ps: *mut mbstate_t) -> usize; -} -extern "C" { - pub fn mbrlen(__s: *const ::std::os::raw::c_char, __n: usize, - __ps: *mut mbstate_t) -> usize; -} -extern "C" { - pub fn mbsrtowcs(__dst: *mut wchar_t, - __src: *mut *const ::std::os::raw::c_char, __len: usize, - __ps: *mut mbstate_t) -> usize; -} -extern "C" { - pub fn wcsrtombs(__dst: *mut ::std::os::raw::c_char, - __src: *mut *const wchar_t, __len: usize, - __ps: *mut mbstate_t) -> usize; -} -extern "C" { - pub fn mbsnrtowcs(__dst: *mut wchar_t, - __src: *mut *const ::std::os::raw::c_char, __nmc: usize, - __len: usize, __ps: *mut mbstate_t) -> usize; -} -extern "C" { - pub fn wcsnrtombs(__dst: *mut ::std::os::raw::c_char, - __src: *mut *const wchar_t, __nwc: usize, __len: usize, - __ps: *mut mbstate_t) -> usize; -} -extern "C" { - pub fn wcstod(__nptr: *const wchar_t, __endptr: *mut *mut wchar_t) -> f64; -} -extern "C" { - pub fn wcstof(__nptr: *const wchar_t, __endptr: *mut *mut wchar_t) -> f32; -} -extern "C" { - pub fn wcstold(__nptr: *const wchar_t, __endptr: *mut *mut wchar_t) - -> f64; -} -extern "C" { - pub fn wcstol(__nptr: *const wchar_t, __endptr: *mut *mut wchar_t, - __base: ::std::os::raw::c_int) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn wcstoul(__nptr: *const wchar_t, __endptr: *mut *mut wchar_t, - __base: ::std::os::raw::c_int) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn wcstoll(__nptr: *const wchar_t, __endptr: *mut *mut wchar_t, - __base: ::std::os::raw::c_int) - -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn wcstoull(__nptr: *const wchar_t, __endptr: *mut *mut wchar_t, - __base: ::std::os::raw::c_int) - -> ::std::os::raw::c_ulonglong; -} -extern "C" { - pub fn wcpcpy(__dest: *mut wchar_t, __src: *const wchar_t) - -> *mut wchar_t; -} -extern "C" { - pub fn wcpncpy(__dest: *mut wchar_t, __src: *const wchar_t, __n: usize) - -> *mut wchar_t; -} -extern "C" { - pub fn open_wmemstream(__bufloc: *mut *mut wchar_t, __sizeloc: *mut usize) - -> *mut __FILE; -} -extern "C" { - pub fn fwide(__fp: *mut __FILE, __mode: ::std::os::raw::c_int) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fwprintf(__stream: *mut __FILE, __format: *const wchar_t, ...) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wprintf(__format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn swprintf(__s: *mut wchar_t, __n: usize, - __format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfwprintf(__s: *mut __FILE, __format: *const wchar_t, - __arg: *mut __va_list_tag) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vwprintf(__format: *const wchar_t, __arg: *mut __va_list_tag) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vswprintf(__s: *mut wchar_t, __n: usize, __format: *const wchar_t, - __arg: *mut __va_list_tag) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fwscanf(__stream: *mut __FILE, __format: *const wchar_t, ...) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wscanf(__format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn swscanf(__s: *const wchar_t, __format: *const wchar_t, ...) - -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "__isoc99_fwscanf"] - pub fn fwscanf1(__stream: *mut __FILE, __format: *const wchar_t, ...) - -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "__isoc99_wscanf"] - pub fn wscanf1(__format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "__isoc99_swscanf"] - pub fn swscanf1(__s: *const wchar_t, __format: *const wchar_t, ...) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfwscanf(__s: *mut __FILE, __format: *const wchar_t, - __arg: *mut __va_list_tag) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vwscanf(__format: *const wchar_t, __arg: *mut __va_list_tag) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vswscanf(__s: *const wchar_t, __format: *const wchar_t, - __arg: *mut __va_list_tag) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "__isoc99_vfwscanf"] - pub fn vfwscanf1(__s: *mut __FILE, __format: *const wchar_t, - __arg: *mut __va_list_tag) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "__isoc99_vwscanf"] - pub fn vwscanf1(__format: *const wchar_t, __arg: *mut __va_list_tag) - -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "__isoc99_vswscanf"] - pub fn vswscanf1(__s: *const wchar_t, __format: *const wchar_t, - __arg: *mut __va_list_tag) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetwc(__stream: *mut __FILE) -> wint_t; -} -extern "C" { - pub fn getwc(__stream: *mut __FILE) -> wint_t; -} -extern "C" { - pub fn getwchar() -> wint_t; -} -extern "C" { - pub fn fputwc(__wc: wchar_t, __stream: *mut __FILE) -> wint_t; -} -extern "C" { - pub fn putwc(__wc: wchar_t, __stream: *mut __FILE) -> wint_t; -} -extern "C" { - pub fn putwchar(__wc: wchar_t) -> wint_t; -} -extern "C" { - pub fn fgetws(__ws: *mut wchar_t, __n: ::std::os::raw::c_int, - __stream: *mut __FILE) -> *mut wchar_t; -} -extern "C" { - pub fn fputws(__ws: *const wchar_t, __stream: *mut __FILE) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ungetwc(__wc: wint_t, __stream: *mut __FILE) -> wint_t; -} -extern "C" { - pub fn wcsftime(__s: *mut wchar_t, __maxsize: usize, - __format: *const wchar_t, __tp: *const tm) -> usize; -} -pub type uint8 = ::std::os::raw::c_uchar; -pub type int8 = ::std::os::raw::c_char; -pub type uint16 = ::std::os::raw::c_ushort; -pub type int16 = ::std::os::raw::c_short; -pub type uint32 = ::std::os::raw::c_uint; -pub type int32 = ::std::os::raw::c_int; -pub type intptr = ::std::os::raw::c_long; -pub type uintptr = ::std::os::raw::c_ulong; -pub type bool_ = uint8; -extern "C" { - pub fn TCOD_strdup(s: *const ::std::os::raw::c_char) - -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_strcasecmp(s1: *const ::std::os::raw::c_char, - s2: *const ::std::os::raw::c_char) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_strncasecmp(s1: *const ::std::os::raw::c_char, - s2: *const ::std::os::raw::c_char, n: usize) - -> ::std::os::raw::c_int; -} -pub type TCOD_list_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_list_new() -> TCOD_list_t; -} -extern "C" { - pub fn TCOD_list_allocate(nb_elements: ::std::os::raw::c_int) - -> TCOD_list_t; -} -extern "C" { - pub fn TCOD_list_duplicate(l: TCOD_list_t) -> TCOD_list_t; -} -extern "C" { - pub fn TCOD_list_delete(l: TCOD_list_t); -} -extern "C" { - pub fn TCOD_list_push(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); -} -extern "C" { - pub fn TCOD_list_pop(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_peek(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_add_all(l: TCOD_list_t, l2: TCOD_list_t); -} -extern "C" { - pub fn TCOD_list_get(l: TCOD_list_t, idx: ::std::os::raw::c_int) - -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_set(l: TCOD_list_t, elt: *const ::std::os::raw::c_void, - idx: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_list_begin(l: TCOD_list_t) - -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_end(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_reverse(l: TCOD_list_t); -} -extern "C" { - pub fn TCOD_list_remove_iterator(l: TCOD_list_t, - elt: *mut *mut ::std::os::raw::c_void) - -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_remove(l: TCOD_list_t, - elt: *const ::std::os::raw::c_void); -} -extern "C" { - pub fn TCOD_list_remove_iterator_fast(l: TCOD_list_t, - elt: - *mut *mut ::std::os::raw::c_void) - -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_remove_fast(l: TCOD_list_t, - elt: *const ::std::os::raw::c_void); -} -extern "C" { - pub fn TCOD_list_contains(l: TCOD_list_t, - elt: *const ::std::os::raw::c_void) -> bool_; -} -extern "C" { - pub fn TCOD_list_clear(l: TCOD_list_t); -} -extern "C" { - pub fn TCOD_list_clear_and_delete(l: TCOD_list_t); -} -extern "C" { - pub fn TCOD_list_size(l: TCOD_list_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_list_insert_before(l: TCOD_list_t, - elt: *const ::std::os::raw::c_void, - before: ::std::os::raw::c_int) - -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_is_empty(l: TCOD_list_t) -> bool_; -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TCOD_color_t { - pub r: uint8, - pub g: uint8, - pub b: uint8, -} -impl Clone for TCOD_color_t { - fn clone(&self) -> Self { *self } -} -extern "C" { - pub fn TCOD_color_RGB(r: uint8, g: uint8, b: uint8) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_HSV(h: f32, s: f32, v: f32) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_equals(c1: TCOD_color_t, c2: TCOD_color_t) -> bool_; -} -extern "C" { - pub fn TCOD_color_add(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_subtract(c1: TCOD_color_t, c2: TCOD_color_t) - -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_multiply(c1: TCOD_color_t, c2: TCOD_color_t) - -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_multiply_scalar(c1: TCOD_color_t, value: f32) - -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_lerp(c1: TCOD_color_t, c2: TCOD_color_t, coef: f32) - -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_set_HSV(c: *mut TCOD_color_t, h: f32, s: f32, v: f32); -} -extern "C" { - pub fn TCOD_color_get_HSV(c: TCOD_color_t, h: *mut f32, s: *mut f32, - v: *mut f32); -} -extern "C" { - pub fn TCOD_color_get_hue(c: TCOD_color_t) -> f32; -} -extern "C" { - pub fn TCOD_color_set_hue(c: *mut TCOD_color_t, h: f32); -} -extern "C" { - pub fn TCOD_color_get_saturation(c: TCOD_color_t) -> f32; -} -extern "C" { - pub fn TCOD_color_set_saturation(c: *mut TCOD_color_t, s: f32); -} -extern "C" { - pub fn TCOD_color_get_value(c: TCOD_color_t) -> f32; -} -extern "C" { - pub fn TCOD_color_set_value(c: *mut TCOD_color_t, v: f32); -} -extern "C" { - pub fn TCOD_color_shift_hue(c: *mut TCOD_color_t, hshift: f32); -} -extern "C" { - pub fn TCOD_color_scale_HSV(c: *mut TCOD_color_t, scoef: f32, vcoef: f32); -} -extern "C" { - pub fn TCOD_color_gen_map(map: *mut TCOD_color_t, - nb_key: ::std::os::raw::c_int, - key_color: *const TCOD_color_t, - key_index: *const ::std::os::raw::c_int); -} -pub const TCOD_COLOR_RED: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_RED; -pub const TCOD_COLOR_FLAME: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_FLAME; -pub const TCOD_COLOR_ORANGE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_ORANGE; -pub const TCOD_COLOR_AMBER: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_AMBER; -pub const TCOD_COLOR_YELLOW: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_YELLOW; -pub const TCOD_COLOR_LIME: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_LIME; -pub const TCOD_COLOR_CHARTREUSE: _bindgen_ty_1 = - _bindgen_ty_1::TCOD_COLOR_CHARTREUSE; -pub const TCOD_COLOR_GREEN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_GREEN; -pub const TCOD_COLOR_SEA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_SEA; -pub const TCOD_COLOR_TURQUOISE: _bindgen_ty_1 = - _bindgen_ty_1::TCOD_COLOR_TURQUOISE; -pub const TCOD_COLOR_CYAN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CYAN; -pub const TCOD_COLOR_SKY: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_SKY; -pub const TCOD_COLOR_AZURE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_AZURE; -pub const TCOD_COLOR_BLUE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_BLUE; -pub const TCOD_COLOR_HAN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_HAN; -pub const TCOD_COLOR_VIOLET: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_VIOLET; -pub const TCOD_COLOR_PURPLE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_PURPLE; -pub const TCOD_COLOR_FUCHSIA: _bindgen_ty_1 = - _bindgen_ty_1::TCOD_COLOR_FUCHSIA; -pub const TCOD_COLOR_MAGENTA: _bindgen_ty_1 = - _bindgen_ty_1::TCOD_COLOR_MAGENTA; -pub const TCOD_COLOR_PINK: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_PINK; -pub const TCOD_COLOR_CRIMSON: _bindgen_ty_1 = - _bindgen_ty_1::TCOD_COLOR_CRIMSON; -pub const TCOD_COLOR_NB: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_NB; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_1 { - TCOD_COLOR_RED = 0, - TCOD_COLOR_FLAME = 1, - TCOD_COLOR_ORANGE = 2, - TCOD_COLOR_AMBER = 3, - TCOD_COLOR_YELLOW = 4, - TCOD_COLOR_LIME = 5, - TCOD_COLOR_CHARTREUSE = 6, - TCOD_COLOR_GREEN = 7, - TCOD_COLOR_SEA = 8, - TCOD_COLOR_TURQUOISE = 9, - TCOD_COLOR_CYAN = 10, - TCOD_COLOR_SKY = 11, - TCOD_COLOR_AZURE = 12, - TCOD_COLOR_BLUE = 13, - TCOD_COLOR_HAN = 14, - TCOD_COLOR_VIOLET = 15, - TCOD_COLOR_PURPLE = 16, - TCOD_COLOR_FUCHSIA = 17, - TCOD_COLOR_MAGENTA = 18, - TCOD_COLOR_PINK = 19, - TCOD_COLOR_CRIMSON = 20, - TCOD_COLOR_NB = 21, -} -pub const TCOD_COLOR_DESATURATED: _bindgen_ty_2 = - _bindgen_ty_2::TCOD_COLOR_DESATURATED; -pub const TCOD_COLOR_LIGHTEST: _bindgen_ty_2 = - _bindgen_ty_2::TCOD_COLOR_LIGHTEST; -pub const TCOD_COLOR_LIGHTER: _bindgen_ty_2 = - _bindgen_ty_2::TCOD_COLOR_LIGHTER; -pub const TCOD_COLOR_LIGHT: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHT; -pub const TCOD_COLOR_NORMAL: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_NORMAL; -pub const TCOD_COLOR_DARK: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARK; -pub const TCOD_COLOR_DARKER: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARKER; -pub const TCOD_COLOR_DARKEST: _bindgen_ty_2 = - _bindgen_ty_2::TCOD_COLOR_DARKEST; -pub const TCOD_COLOR_LEVELS: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LEVELS; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_2 { - TCOD_COLOR_DESATURATED = 0, - TCOD_COLOR_LIGHTEST = 1, - TCOD_COLOR_LIGHTER = 2, - TCOD_COLOR_LIGHT = 3, - TCOD_COLOR_NORMAL = 4, - TCOD_COLOR_DARK = 5, - TCOD_COLOR_DARKER = 6, - TCOD_COLOR_DARKEST = 7, - TCOD_COLOR_LEVELS = 8, -} -extern "C" { - #[link_name = "TCOD_colors"] - pub static mut TCOD_colors: [[TCOD_color_t; 8usize]; 21usize]; -} -extern "C" { - #[link_name = "TCOD_black"] - pub static TCOD_black: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_grey"] - pub static TCOD_darkest_grey: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_grey"] - pub static TCOD_darker_grey: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_grey"] - pub static TCOD_dark_grey: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_grey"] - pub static TCOD_grey: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_grey"] - pub static TCOD_light_grey: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_grey"] - pub static TCOD_lighter_grey: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_grey"] - pub static TCOD_lightest_grey: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_gray"] - pub static TCOD_darkest_gray: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_gray"] - pub static TCOD_darker_gray: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_gray"] - pub static TCOD_dark_gray: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_gray"] - pub static TCOD_gray: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_gray"] - pub static TCOD_light_gray: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_gray"] - pub static TCOD_lighter_gray: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_gray"] - pub static TCOD_lightest_gray: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_white"] - pub static TCOD_white: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_sepia"] - pub static TCOD_darkest_sepia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_sepia"] - pub static TCOD_darker_sepia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_sepia"] - pub static TCOD_dark_sepia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_sepia"] - pub static TCOD_sepia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_sepia"] - pub static TCOD_light_sepia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_sepia"] - pub static TCOD_lighter_sepia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_sepia"] - pub static TCOD_lightest_sepia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_red"] - pub static TCOD_red: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_flame"] - pub static TCOD_flame: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_orange"] - pub static TCOD_orange: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_amber"] - pub static TCOD_amber: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_yellow"] - pub static TCOD_yellow: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lime"] - pub static TCOD_lime: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_chartreuse"] - pub static TCOD_chartreuse: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_green"] - pub static TCOD_green: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_sea"] - pub static TCOD_sea: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_turquoise"] - pub static TCOD_turquoise: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_cyan"] - pub static TCOD_cyan: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_sky"] - pub static TCOD_sky: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_azure"] - pub static TCOD_azure: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_blue"] - pub static TCOD_blue: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_han"] - pub static TCOD_han: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_violet"] - pub static TCOD_violet: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_purple"] - pub static TCOD_purple: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_fuchsia"] - pub static TCOD_fuchsia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_magenta"] - pub static TCOD_magenta: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_pink"] - pub static TCOD_pink: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_crimson"] - pub static TCOD_crimson: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_red"] - pub static TCOD_dark_red: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_flame"] - pub static TCOD_dark_flame: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_orange"] - pub static TCOD_dark_orange: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_amber"] - pub static TCOD_dark_amber: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_yellow"] - pub static TCOD_dark_yellow: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_lime"] - pub static TCOD_dark_lime: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_chartreuse"] - pub static TCOD_dark_chartreuse: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_green"] - pub static TCOD_dark_green: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_sea"] - pub static TCOD_dark_sea: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_turquoise"] - pub static TCOD_dark_turquoise: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_cyan"] - pub static TCOD_dark_cyan: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_sky"] - pub static TCOD_dark_sky: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_azure"] - pub static TCOD_dark_azure: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_blue"] - pub static TCOD_dark_blue: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_han"] - pub static TCOD_dark_han: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_violet"] - pub static TCOD_dark_violet: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_purple"] - pub static TCOD_dark_purple: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_fuchsia"] - pub static TCOD_dark_fuchsia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_magenta"] - pub static TCOD_dark_magenta: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_pink"] - pub static TCOD_dark_pink: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_dark_crimson"] - pub static TCOD_dark_crimson: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_red"] - pub static TCOD_darker_red: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_flame"] - pub static TCOD_darker_flame: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_orange"] - pub static TCOD_darker_orange: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_amber"] - pub static TCOD_darker_amber: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_yellow"] - pub static TCOD_darker_yellow: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_lime"] - pub static TCOD_darker_lime: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_chartreuse"] - pub static TCOD_darker_chartreuse: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_green"] - pub static TCOD_darker_green: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_sea"] - pub static TCOD_darker_sea: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_turquoise"] - pub static TCOD_darker_turquoise: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_cyan"] - pub static TCOD_darker_cyan: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_sky"] - pub static TCOD_darker_sky: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_azure"] - pub static TCOD_darker_azure: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_blue"] - pub static TCOD_darker_blue: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_han"] - pub static TCOD_darker_han: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_violet"] - pub static TCOD_darker_violet: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_purple"] - pub static TCOD_darker_purple: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_fuchsia"] - pub static TCOD_darker_fuchsia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_magenta"] - pub static TCOD_darker_magenta: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_pink"] - pub static TCOD_darker_pink: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darker_crimson"] - pub static TCOD_darker_crimson: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_red"] - pub static TCOD_darkest_red: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_flame"] - pub static TCOD_darkest_flame: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_orange"] - pub static TCOD_darkest_orange: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_amber"] - pub static TCOD_darkest_amber: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_yellow"] - pub static TCOD_darkest_yellow: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_lime"] - pub static TCOD_darkest_lime: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_chartreuse"] - pub static TCOD_darkest_chartreuse: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_green"] - pub static TCOD_darkest_green: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_sea"] - pub static TCOD_darkest_sea: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_turquoise"] - pub static TCOD_darkest_turquoise: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_cyan"] - pub static TCOD_darkest_cyan: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_sky"] - pub static TCOD_darkest_sky: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_azure"] - pub static TCOD_darkest_azure: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_blue"] - pub static TCOD_darkest_blue: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_han"] - pub static TCOD_darkest_han: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_violet"] - pub static TCOD_darkest_violet: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_purple"] - pub static TCOD_darkest_purple: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_fuchsia"] - pub static TCOD_darkest_fuchsia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_magenta"] - pub static TCOD_darkest_magenta: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_pink"] - pub static TCOD_darkest_pink: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_darkest_crimson"] - pub static TCOD_darkest_crimson: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_red"] - pub static TCOD_light_red: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_flame"] - pub static TCOD_light_flame: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_orange"] - pub static TCOD_light_orange: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_amber"] - pub static TCOD_light_amber: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_yellow"] - pub static TCOD_light_yellow: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_lime"] - pub static TCOD_light_lime: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_chartreuse"] - pub static TCOD_light_chartreuse: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_green"] - pub static TCOD_light_green: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_sea"] - pub static TCOD_light_sea: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_turquoise"] - pub static TCOD_light_turquoise: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_cyan"] - pub static TCOD_light_cyan: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_sky"] - pub static TCOD_light_sky: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_azure"] - pub static TCOD_light_azure: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_blue"] - pub static TCOD_light_blue: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_han"] - pub static TCOD_light_han: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_violet"] - pub static TCOD_light_violet: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_purple"] - pub static TCOD_light_purple: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_fuchsia"] - pub static TCOD_light_fuchsia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_magenta"] - pub static TCOD_light_magenta: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_pink"] - pub static TCOD_light_pink: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_light_crimson"] - pub static TCOD_light_crimson: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_red"] - pub static TCOD_lighter_red: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_flame"] - pub static TCOD_lighter_flame: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_orange"] - pub static TCOD_lighter_orange: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_amber"] - pub static TCOD_lighter_amber: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_yellow"] - pub static TCOD_lighter_yellow: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_lime"] - pub static TCOD_lighter_lime: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_chartreuse"] - pub static TCOD_lighter_chartreuse: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_green"] - pub static TCOD_lighter_green: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_sea"] - pub static TCOD_lighter_sea: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_turquoise"] - pub static TCOD_lighter_turquoise: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_cyan"] - pub static TCOD_lighter_cyan: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_sky"] - pub static TCOD_lighter_sky: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_azure"] - pub static TCOD_lighter_azure: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_blue"] - pub static TCOD_lighter_blue: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_han"] - pub static TCOD_lighter_han: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_violet"] - pub static TCOD_lighter_violet: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_purple"] - pub static TCOD_lighter_purple: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_fuchsia"] - pub static TCOD_lighter_fuchsia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_magenta"] - pub static TCOD_lighter_magenta: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_pink"] - pub static TCOD_lighter_pink: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lighter_crimson"] - pub static TCOD_lighter_crimson: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_red"] - pub static TCOD_lightest_red: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_flame"] - pub static TCOD_lightest_flame: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_orange"] - pub static TCOD_lightest_orange: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_amber"] - pub static TCOD_lightest_amber: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_yellow"] - pub static TCOD_lightest_yellow: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_lime"] - pub static TCOD_lightest_lime: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_chartreuse"] - pub static TCOD_lightest_chartreuse: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_green"] - pub static TCOD_lightest_green: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_sea"] - pub static TCOD_lightest_sea: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_turquoise"] - pub static TCOD_lightest_turquoise: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_cyan"] - pub static TCOD_lightest_cyan: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_sky"] - pub static TCOD_lightest_sky: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_azure"] - pub static TCOD_lightest_azure: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_blue"] - pub static TCOD_lightest_blue: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_han"] - pub static TCOD_lightest_han: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_violet"] - pub static TCOD_lightest_violet: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_purple"] - pub static TCOD_lightest_purple: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_fuchsia"] - pub static TCOD_lightest_fuchsia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_magenta"] - pub static TCOD_lightest_magenta: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_pink"] - pub static TCOD_lightest_pink: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_lightest_crimson"] - pub static TCOD_lightest_crimson: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_red"] - pub static TCOD_desaturated_red: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_flame"] - pub static TCOD_desaturated_flame: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_orange"] - pub static TCOD_desaturated_orange: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_amber"] - pub static TCOD_desaturated_amber: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_yellow"] - pub static TCOD_desaturated_yellow: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_lime"] - pub static TCOD_desaturated_lime: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_chartreuse"] - pub static TCOD_desaturated_chartreuse: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_green"] - pub static TCOD_desaturated_green: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_sea"] - pub static TCOD_desaturated_sea: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_turquoise"] - pub static TCOD_desaturated_turquoise: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_cyan"] - pub static TCOD_desaturated_cyan: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_sky"] - pub static TCOD_desaturated_sky: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_azure"] - pub static TCOD_desaturated_azure: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_blue"] - pub static TCOD_desaturated_blue: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_han"] - pub static TCOD_desaturated_han: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_violet"] - pub static TCOD_desaturated_violet: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_purple"] - pub static TCOD_desaturated_purple: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_fuchsia"] - pub static TCOD_desaturated_fuchsia: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_magenta"] - pub static TCOD_desaturated_magenta: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_pink"] - pub static TCOD_desaturated_pink: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_desaturated_crimson"] - pub static TCOD_desaturated_crimson: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_brass"] - pub static TCOD_brass: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_copper"] - pub static TCOD_copper: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_gold"] - pub static TCOD_gold: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_silver"] - pub static TCOD_silver: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_celadon"] - pub static TCOD_celadon: TCOD_color_t; -} -extern "C" { - #[link_name = "TCOD_peach"] - pub static TCOD_peach: TCOD_color_t; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_keycode_t { - TCODK_NONE = 0, - TCODK_ESCAPE = 1, - TCODK_BACKSPACE = 2, - TCODK_TAB = 3, - TCODK_ENTER = 4, - TCODK_SHIFT = 5, - TCODK_CONTROL = 6, - TCODK_ALT = 7, - TCODK_PAUSE = 8, - TCODK_CAPSLOCK = 9, - TCODK_PAGEUP = 10, - TCODK_PAGEDOWN = 11, - TCODK_END = 12, - TCODK_HOME = 13, - TCODK_UP = 14, - TCODK_LEFT = 15, - TCODK_RIGHT = 16, - TCODK_DOWN = 17, - TCODK_PRINTSCREEN = 18, - TCODK_INSERT = 19, - TCODK_DELETE = 20, - TCODK_LWIN = 21, - TCODK_RWIN = 22, - TCODK_APPS = 23, - TCODK_0 = 24, - TCODK_1 = 25, - TCODK_2 = 26, - TCODK_3 = 27, - TCODK_4 = 28, - TCODK_5 = 29, - TCODK_6 = 30, - TCODK_7 = 31, - TCODK_8 = 32, - TCODK_9 = 33, - TCODK_KP0 = 34, - TCODK_KP1 = 35, - TCODK_KP2 = 36, - TCODK_KP3 = 37, - TCODK_KP4 = 38, - TCODK_KP5 = 39, - TCODK_KP6 = 40, - TCODK_KP7 = 41, - TCODK_KP8 = 42, - TCODK_KP9 = 43, - TCODK_KPADD = 44, - TCODK_KPSUB = 45, - TCODK_KPDIV = 46, - TCODK_KPMUL = 47, - TCODK_KPDEC = 48, - TCODK_KPENTER = 49, - TCODK_F1 = 50, - TCODK_F2 = 51, - TCODK_F3 = 52, - TCODK_F4 = 53, - TCODK_F5 = 54, - TCODK_F6 = 55, - TCODK_F7 = 56, - TCODK_F8 = 57, - TCODK_F9 = 58, - TCODK_F10 = 59, - TCODK_F11 = 60, - TCODK_F12 = 61, - TCODK_NUMLOCK = 62, - TCODK_SCROLLLOCK = 63, - TCODK_SPACE = 64, - TCODK_CHAR = 65, - TCODK_TEXT = 66, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TCOD_key_t { - pub vk: TCOD_keycode_t, - pub c: ::std::os::raw::c_char, - pub text: [::std::os::raw::c_char; 32usize], - pub pressed: bool_, - pub lalt: bool_, - pub lctrl: bool_, - pub lmeta: bool_, - pub ralt: bool_, - pub rctrl: bool_, - pub rmeta: bool_, - pub shift: bool_, -} -impl Clone for TCOD_key_t { - fn clone(&self) -> Self { *self } -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_chars_t { - TCOD_CHAR_HLINE = 196, - TCOD_CHAR_VLINE = 179, - TCOD_CHAR_NE = 191, - TCOD_CHAR_NW = 218, - TCOD_CHAR_SE = 217, - TCOD_CHAR_SW = 192, - TCOD_CHAR_TEEW = 180, - TCOD_CHAR_TEEE = 195, - TCOD_CHAR_TEEN = 193, - TCOD_CHAR_TEES = 194, - TCOD_CHAR_CROSS = 197, - TCOD_CHAR_DHLINE = 205, - TCOD_CHAR_DVLINE = 186, - TCOD_CHAR_DNE = 187, - TCOD_CHAR_DNW = 201, - TCOD_CHAR_DSE = 188, - TCOD_CHAR_DSW = 200, - TCOD_CHAR_DTEEW = 185, - TCOD_CHAR_DTEEE = 204, - TCOD_CHAR_DTEEN = 202, - TCOD_CHAR_DTEES = 203, - TCOD_CHAR_DCROSS = 206, - TCOD_CHAR_BLOCK1 = 176, - TCOD_CHAR_BLOCK2 = 177, - TCOD_CHAR_BLOCK3 = 178, - TCOD_CHAR_ARROW_N = 24, - TCOD_CHAR_ARROW_S = 25, - TCOD_CHAR_ARROW_E = 26, - TCOD_CHAR_ARROW_W = 27, - TCOD_CHAR_ARROW2_N = 30, - TCOD_CHAR_ARROW2_S = 31, - TCOD_CHAR_ARROW2_E = 16, - TCOD_CHAR_ARROW2_W = 17, - TCOD_CHAR_DARROW_H = 29, - TCOD_CHAR_DARROW_V = 18, - TCOD_CHAR_CHECKBOX_UNSET = 224, - TCOD_CHAR_CHECKBOX_SET = 225, - TCOD_CHAR_RADIO_UNSET = 9, - TCOD_CHAR_RADIO_SET = 10, - TCOD_CHAR_SUBP_NW = 226, - TCOD_CHAR_SUBP_NE = 227, - TCOD_CHAR_SUBP_N = 228, - TCOD_CHAR_SUBP_SE = 229, - TCOD_CHAR_SUBP_DIAG = 230, - TCOD_CHAR_SUBP_E = 231, - TCOD_CHAR_SUBP_SW = 232, - TCOD_CHAR_SMILIE = 1, - TCOD_CHAR_SMILIE_INV = 2, - TCOD_CHAR_HEART = 3, - TCOD_CHAR_DIAMOND = 4, - TCOD_CHAR_CLUB = 5, - TCOD_CHAR_SPADE = 6, - TCOD_CHAR_BULLET = 7, - TCOD_CHAR_BULLET_INV = 8, - TCOD_CHAR_MALE = 11, - TCOD_CHAR_FEMALE = 12, - TCOD_CHAR_NOTE = 13, - TCOD_CHAR_NOTE_DOUBLE = 14, - TCOD_CHAR_LIGHT = 15, - TCOD_CHAR_EXCLAM_DOUBLE = 19, - TCOD_CHAR_PILCROW = 20, - TCOD_CHAR_SECTION = 21, - TCOD_CHAR_POUND = 156, - TCOD_CHAR_MULTIPLICATION = 158, - TCOD_CHAR_FUNCTION = 159, - TCOD_CHAR_RESERVED = 169, - TCOD_CHAR_HALF = 171, - TCOD_CHAR_ONE_QUARTER = 172, - TCOD_CHAR_COPYRIGHT = 184, - TCOD_CHAR_CENT = 189, - TCOD_CHAR_YEN = 190, - TCOD_CHAR_CURRENCY = 207, - TCOD_CHAR_THREE_QUARTERS = 243, - TCOD_CHAR_DIVISION = 246, - TCOD_CHAR_GRADE = 248, - TCOD_CHAR_UMLAUT = 249, - TCOD_CHAR_POW1 = 251, - TCOD_CHAR_POW3 = 252, - TCOD_CHAR_POW2 = 253, - TCOD_CHAR_BULLET_SQUARE = 254, -} -pub const TCOD_COLCTRL_NUMBER: TCOD_colctrl_t = - TCOD_colctrl_t::TCOD_COLCTRL_5; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_colctrl_t { - TCOD_COLCTRL_1 = 1, - TCOD_COLCTRL_2 = 2, - TCOD_COLCTRL_3 = 3, - TCOD_COLCTRL_4 = 4, - TCOD_COLCTRL_5 = 5, - TCOD_COLCTRL_FORE_RGB = 6, - TCOD_COLCTRL_BACK_RGB = 7, - TCOD_COLCTRL_STOP = 8, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_bkgnd_flag_t { - TCOD_BKGND_NONE = 0, - TCOD_BKGND_SET = 1, - TCOD_BKGND_MULTIPLY = 2, - TCOD_BKGND_LIGHTEN = 3, - TCOD_BKGND_DARKEN = 4, - TCOD_BKGND_SCREEN = 5, - TCOD_BKGND_COLOR_DODGE = 6, - TCOD_BKGND_COLOR_BURN = 7, - TCOD_BKGND_ADD = 8, - TCOD_BKGND_ADDA = 9, - TCOD_BKGND_BURN = 10, - TCOD_BKGND_OVERLAY = 11, - TCOD_BKGND_ALPH = 12, - TCOD_BKGND_DEFAULT = 13, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_key_status_t { TCOD_KEY_PRESSED = 1, TCOD_KEY_RELEASED = 2, } -pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = - TCOD_font_flags_t::TCOD_FONT_TYPE_GREYSCALE; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_font_flags_t { - TCOD_FONT_LAYOUT_ASCII_INCOL = 1, - TCOD_FONT_LAYOUT_ASCII_INROW = 2, - TCOD_FONT_TYPE_GREYSCALE = 4, - TCOD_FONT_LAYOUT_TCOD = 8, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_renderer_t { - TCOD_RENDERER_GLSL = 0, - TCOD_RENDERER_OPENGL = 1, - TCOD_RENDERER_SDL = 2, - TCOD_NB_RENDERERS = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_alignment_t { TCOD_LEFT = 0, TCOD_RIGHT = 1, TCOD_CENTER = 2, } -pub type TCOD_console_t = *mut ::std::os::raw::c_void; -pub type TCOD_image_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_image_new(width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int) -> TCOD_image_t; -} -extern "C" { - pub fn TCOD_image_from_console(console: TCOD_console_t) -> TCOD_image_t; -} -extern "C" { - pub fn TCOD_image_refresh_console(image: TCOD_image_t, - console: TCOD_console_t); -} -extern "C" { - pub fn TCOD_image_load(filename: *const ::std::os::raw::c_char) - -> TCOD_image_t; -} -extern "C" { - pub fn TCOD_image_clear(image: TCOD_image_t, color: TCOD_color_t); -} -extern "C" { - pub fn TCOD_image_invert(image: TCOD_image_t); -} -extern "C" { - pub fn TCOD_image_hflip(image: TCOD_image_t); -} -extern "C" { - pub fn TCOD_image_rotate90(image: TCOD_image_t, - numRotations: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_image_vflip(image: TCOD_image_t); -} -extern "C" { - pub fn TCOD_image_scale(image: TCOD_image_t, neww: ::std::os::raw::c_int, - newh: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_image_save(image: TCOD_image_t, - filename: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn TCOD_image_get_size(image: TCOD_image_t, - w: *mut ::std::os::raw::c_int, - h: *mut ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_image_get_pixel(image: TCOD_image_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_image_get_alpha(image: TCOD_image_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_image_get_mipmap_pixel(image: TCOD_image_t, x0: f32, y0: f32, - x1: f32, y1: f32) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_image_put_pixel(image: TCOD_image_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, col: TCOD_color_t); -} -extern "C" { - pub fn TCOD_image_blit(image: TCOD_image_t, console: TCOD_console_t, - x: f32, y: f32, bkgnd_flag: TCOD_bkgnd_flag_t, - scalex: f32, scaley: f32, angle: f32); -} -extern "C" { - pub fn TCOD_image_blit_rect(image: TCOD_image_t, console: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - bkgnd_flag: TCOD_bkgnd_flag_t); -} -extern "C" { - pub fn TCOD_image_blit_2x(image: TCOD_image_t, dest: TCOD_console_t, - dx: ::std::os::raw::c_int, - dy: ::std::os::raw::c_int, - sx: ::std::os::raw::c_int, - sy: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_image_delete(image: TCOD_image_t); -} -extern "C" { - pub fn TCOD_image_set_key_color(image: TCOD_image_t, - key_color: TCOD_color_t); -} -extern "C" { - pub fn TCOD_image_is_pixel_transparent(image: TCOD_image_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) -> bool_; -} -extern "C" { - pub fn TCOD_console_init_root(w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - title: *const ::std::os::raw::c_char, - fullscreen: bool_, - renderer: TCOD_renderer_t); -} -extern "C" { - pub fn TCOD_console_set_window_title(title: - *const ::std::os::raw::c_char); -} -extern "C" { - pub fn TCOD_console_set_fullscreen(fullscreen: bool_); -} -extern "C" { - pub fn TCOD_console_is_fullscreen() -> bool_; -} -extern "C" { - pub fn TCOD_console_is_window_closed() -> bool_; -} -extern "C" { - pub fn TCOD_console_has_mouse_focus() -> bool_; -} -extern "C" { - pub fn TCOD_console_is_active() -> bool_; -} -extern "C" { - pub fn TCOD_console_set_custom_font(fontFile: - *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, - nb_char_horiz: ::std::os::raw::c_int, - nb_char_vertic: - ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_console_map_ascii_code_to_font(asciiCode: - ::std::os::raw::c_int, - fontCharX: - ::std::os::raw::c_int, - fontCharY: - ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_console_map_ascii_codes_to_font(asciiCode: - ::std::os::raw::c_int, - nbCodes: - ::std::os::raw::c_int, - fontCharX: - ::std::os::raw::c_int, - fontCharY: - ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_console_map_string_to_font(s: *const ::std::os::raw::c_char, - fontCharX: ::std::os::raw::c_int, - fontCharY: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_console_set_dirty(x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_console_set_default_background(con: TCOD_console_t, - col: TCOD_color_t); -} -extern "C" { - pub fn TCOD_console_set_default_foreground(con: TCOD_console_t, - col: TCOD_color_t); -} -extern "C" { - pub fn TCOD_console_clear(con: TCOD_console_t); -} -extern "C" { - pub fn TCOD_console_set_char_background(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - col: TCOD_color_t, - flag: TCOD_bkgnd_flag_t); -} -extern "C" { - pub fn TCOD_console_set_char_foreground(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - col: TCOD_color_t); -} -extern "C" { - pub fn TCOD_console_set_char(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - c: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_console_put_char(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - c: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t); -} -extern "C" { - pub fn TCOD_console_put_char_ex(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - c: ::std::os::raw::c_int, - fore: TCOD_color_t, back: TCOD_color_t); -} -extern "C" { - pub fn TCOD_console_set_background_flag(con: TCOD_console_t, - flag: TCOD_bkgnd_flag_t); -} -extern "C" { - pub fn TCOD_console_get_background_flag(con: TCOD_console_t) - -> TCOD_bkgnd_flag_t; -} -extern "C" { - pub fn TCOD_console_set_alignment(con: TCOD_console_t, - alignment: TCOD_alignment_t); -} -extern "C" { - pub fn TCOD_console_get_alignment(con: TCOD_console_t) - -> TCOD_alignment_t; -} -extern "C" { - pub fn TCOD_console_print(con: TCOD_console_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - fmt: *const ::std::os::raw::c_char, ...); -} -extern "C" { - pub fn TCOD_console_print_ex(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - alignment: TCOD_alignment_t, - fmt: *const ::std::os::raw::c_char, ...); -} -extern "C" { - pub fn TCOD_console_print_rect(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - fmt: *const ::std::os::raw::c_char, ...) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_print_rect_ex(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - alignment: TCOD_alignment_t, - fmt: *const ::std::os::raw::c_char, ...) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_get_height_rect(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - fmt: - *const ::std::os::raw::c_char, ...) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_rect(con: TCOD_console_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, clear: bool_, - flag: TCOD_bkgnd_flag_t); -} -extern "C" { - pub fn TCOD_console_hline(con: TCOD_console_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - l: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t); -} -extern "C" { - pub fn TCOD_console_vline(con: TCOD_console_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - l: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t); -} -extern "C" { - pub fn TCOD_console_print_frame(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, empty: bool_, - flag: TCOD_bkgnd_flag_t, - fmt: *const ::std::os::raw::c_char, ...); -} -extern "C" { - pub fn TCOD_console_map_string_to_font_utf(s: *const wchar_t, - fontCharX: - ::std::os::raw::c_int, - fontCharY: - ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_console_print_utf(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - fmt: *const wchar_t, ...); -} -extern "C" { - pub fn TCOD_console_print_ex_utf(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - alignment: TCOD_alignment_t, - fmt: *const wchar_t, ...); -} -extern "C" { - pub fn TCOD_console_print_rect_utf(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - fmt: *const wchar_t, ...) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_print_rect_ex_utf(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - alignment: TCOD_alignment_t, - fmt: *const wchar_t, ...) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_get_height_rect_utf(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - fmt: *const wchar_t, ...) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_get_default_background(con: TCOD_console_t) - -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_console_get_default_foreground(con: TCOD_console_t) - -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_console_get_char_background(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) - -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_console_get_char_foreground(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) - -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_console_get_char(con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_get_background_color_image(con: TCOD_console_t) - -> TCOD_image_t; -} -extern "C" { - pub fn TCOD_console_get_foreground_color_image(con: TCOD_console_t) - -> TCOD_image_t; -} -extern "C" { - pub fn TCOD_console_set_fade(val: uint8, fade: TCOD_color_t); -} -extern "C" { - pub fn TCOD_console_get_fade() -> uint8; -} -extern "C" { - pub fn TCOD_console_get_fading_color() -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_console_flush(); -} -extern "C" { - pub fn TCOD_console_set_color_control(con: TCOD_colctrl_t, - fore: TCOD_color_t, - back: TCOD_color_t); -} -extern "C" { - pub fn TCOD_console_check_for_keypress(flags: ::std::os::raw::c_int) - -> TCOD_key_t; -} -extern "C" { - pub fn TCOD_console_wait_for_keypress(flush: bool_) -> TCOD_key_t; -} -extern "C" { - pub fn TCOD_console_is_key_pressed(key: TCOD_keycode_t) -> bool_; -} -extern "C" { - pub fn TCOD_console_from_file(filename: *const ::std::os::raw::c_char) - -> TCOD_console_t; -} -extern "C" { - pub fn TCOD_console_load_asc(con: TCOD_console_t, - filename: *const ::std::os::raw::c_char) - -> bool_; -} -extern "C" { - pub fn TCOD_console_load_apf(con: TCOD_console_t, - filename: *const ::std::os::raw::c_char) - -> bool_; -} -extern "C" { - pub fn TCOD_console_save_asc(con: TCOD_console_t, - filename: *const ::std::os::raw::c_char) - -> bool_; -} -extern "C" { - pub fn TCOD_console_save_apf(con: TCOD_console_t, - filename: *const ::std::os::raw::c_char) - -> bool_; -} -extern "C" { - pub fn TCOD_console_new(w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int) -> TCOD_console_t; -} -extern "C" { - pub fn TCOD_console_get_width(con: TCOD_console_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_get_height(con: TCOD_console_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_set_key_color(con: TCOD_console_t, col: TCOD_color_t); -} -extern "C" { - pub fn TCOD_console_blit(src: TCOD_console_t, xSrc: ::std::os::raw::c_int, - ySrc: ::std::os::raw::c_int, - wSrc: ::std::os::raw::c_int, - hSrc: ::std::os::raw::c_int, dst: TCOD_console_t, - xDst: ::std::os::raw::c_int, - yDst: ::std::os::raw::c_int, - foreground_alpha: f32, background_alpha: f32); -} -extern "C" { - pub fn TCOD_console_delete(console: TCOD_console_t); -} -extern "C" { - pub fn TCOD_console_credits(); -} -extern "C" { - pub fn TCOD_console_credits_reset(); -} -extern "C" { - pub fn TCOD_console_credits_render(x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, alpha: bool_) - -> bool_; -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TCOD_mouse_t { - pub x: ::std::os::raw::c_int, - pub y: ::std::os::raw::c_int, - pub dx: ::std::os::raw::c_int, - pub dy: ::std::os::raw::c_int, - pub cx: ::std::os::raw::c_int, - pub cy: ::std::os::raw::c_int, - pub dcx: ::std::os::raw::c_int, - pub dcy: ::std::os::raw::c_int, - pub lbutton: bool_, - pub rbutton: bool_, - pub mbutton: bool_, - pub lbutton_pressed: bool_, - pub rbutton_pressed: bool_, - pub mbutton_pressed: bool_, - pub wheel_up: bool_, - pub wheel_down: bool_, -} -impl Clone for TCOD_mouse_t { - fn clone(&self) -> Self { *self } -} -extern "C" { - pub fn TCOD_mouse_show_cursor(visible: bool_); -} -extern "C" { - pub fn TCOD_mouse_get_status() -> TCOD_mouse_t; -} -extern "C" { - pub fn TCOD_mouse_is_cursor_visible() -> bool_; -} -extern "C" { - pub fn TCOD_mouse_move(x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_mouse_includes_touch(enable: bool_); -} -extern "C" { - pub fn TCOD_sys_startup(); -} -extern "C" { - pub fn TCOD_sys_shutdown(); -} -extern "C" { - pub fn TCOD_sys_elapsed_milli() -> uint32; -} -extern "C" { - pub fn TCOD_sys_elapsed_seconds() -> f32; -} -extern "C" { - pub fn TCOD_sys_sleep_milli(val: uint32); -} -extern "C" { - pub fn TCOD_sys_save_screenshot(filename: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn TCOD_sys_force_fullscreen_resolution(width: ::std::os::raw::c_int, - height: - ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_sys_set_renderer(renderer: TCOD_renderer_t); -} -extern "C" { - pub fn TCOD_sys_get_renderer() -> TCOD_renderer_t; -} -extern "C" { - pub fn TCOD_sys_set_fps(val: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_sys_get_fps() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_sys_get_last_frame_length() -> f32; -} -extern "C" { - pub fn TCOD_sys_get_current_resolution(w: *mut ::std::os::raw::c_int, - h: *mut ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_sys_get_fullscreen_offsets(offx: *mut ::std::os::raw::c_int, - offy: *mut ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_sys_update_char(asciiCode: ::std::os::raw::c_int, - fontx: ::std::os::raw::c_int, - fonty: ::std::os::raw::c_int, - img: TCOD_image_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_sys_get_char_size(w: *mut ::std::os::raw::c_int, - h: *mut ::std::os::raw::c_int); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_event_t { - TCOD_EVENT_NONE = 0, - TCOD_EVENT_KEY_PRESS = 1, - TCOD_EVENT_KEY_RELEASE = 2, - TCOD_EVENT_KEY = 3, - TCOD_EVENT_MOUSE_MOVE = 4, - TCOD_EVENT_MOUSE_PRESS = 8, - TCOD_EVENT_MOUSE_RELEASE = 16, - TCOD_EVENT_MOUSE = 28, - TCOD_EVENT_FINGER_MOVE = 32, - TCOD_EVENT_FINGER_PRESS = 64, - TCOD_EVENT_FINGER_RELEASE = 128, - TCOD_EVENT_FINGER = 224, - TCOD_EVENT_ANY = 255, -} -extern "C" { - pub fn TCOD_sys_wait_for_event(eventMask: ::std::os::raw::c_int, - key: *mut TCOD_key_t, - mouse: *mut TCOD_mouse_t, flush: bool_) - -> TCOD_event_t; -} -extern "C" { - pub fn TCOD_sys_check_for_event(eventMask: ::std::os::raw::c_int, - key: *mut TCOD_key_t, - mouse: *mut TCOD_mouse_t) -> TCOD_event_t; -} -extern "C" { - pub fn TCOD_sys_create_directory(path: *const ::std::os::raw::c_char) - -> bool_; -} -extern "C" { - pub fn TCOD_sys_delete_file(path: *const ::std::os::raw::c_char) -> bool_; -} -extern "C" { - pub fn TCOD_sys_delete_directory(path: *const ::std::os::raw::c_char) - -> bool_; -} -extern "C" { - pub fn TCOD_sys_is_directory(path: *const ::std::os::raw::c_char) - -> bool_; -} -extern "C" { - pub fn TCOD_sys_get_directory_content(path: *const ::std::os::raw::c_char, - pattern: - *const ::std::os::raw::c_char) - -> TCOD_list_t; -} -extern "C" { - pub fn TCOD_sys_file_exists(filename: *const ::std::os::raw::c_char, ...) - -> bool_; -} -extern "C" { - pub fn TCOD_sys_read_file(filename: *const ::std::os::raw::c_char, - buf: *mut *mut ::std::os::raw::c_uchar, - size: *mut usize) -> bool_; -} -extern "C" { - pub fn TCOD_sys_write_file(filename: *const ::std::os::raw::c_char, - buf: *mut ::std::os::raw::c_uchar, - size: uint32) -> bool_; -} -extern "C" { - pub fn TCOD_sys_clipboard_set(value: *const ::std::os::raw::c_char) - -> bool_; -} -extern "C" { - pub fn TCOD_sys_clipboard_get() -> *mut ::std::os::raw::c_char; -} -pub type TCOD_thread_t = *mut ::std::os::raw::c_void; -pub type TCOD_semaphore_t = *mut ::std::os::raw::c_void; -pub type TCOD_mutex_t = *mut ::std::os::raw::c_void; -pub type TCOD_cond_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_thread_new(func: - ::std::option::Option - ::std::os::raw::c_int>, - data: *mut ::std::os::raw::c_void) - -> TCOD_thread_t; -} -extern "C" { - pub fn TCOD_thread_delete(th: TCOD_thread_t); -} -extern "C" { - pub fn TCOD_sys_get_num_cores() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_thread_wait(th: TCOD_thread_t); -} -extern "C" { - pub fn TCOD_mutex_new() -> TCOD_mutex_t; -} -extern "C" { - pub fn TCOD_mutex_in(mut_: TCOD_mutex_t); -} -extern "C" { - pub fn TCOD_mutex_out(mut_: TCOD_mutex_t); -} -extern "C" { - pub fn TCOD_mutex_delete(mut_: TCOD_mutex_t); -} -extern "C" { - pub fn TCOD_semaphore_new(initVal: ::std::os::raw::c_int) - -> TCOD_semaphore_t; -} -extern "C" { - pub fn TCOD_semaphore_lock(sem: TCOD_semaphore_t); -} -extern "C" { - pub fn TCOD_semaphore_unlock(sem: TCOD_semaphore_t); -} -extern "C" { - pub fn TCOD_semaphore_delete(sem: TCOD_semaphore_t); -} -extern "C" { - pub fn TCOD_condition_new() -> TCOD_cond_t; -} -extern "C" { - pub fn TCOD_condition_signal(sem: TCOD_cond_t); -} -extern "C" { - pub fn TCOD_condition_broadcast(sem: TCOD_cond_t); -} -extern "C" { - pub fn TCOD_condition_wait(sem: TCOD_cond_t, mut_: TCOD_mutex_t); -} -extern "C" { - pub fn TCOD_condition_delete(sem: TCOD_cond_t); -} -pub type TCOD_library_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_load_library(path: *const ::std::os::raw::c_char) - -> TCOD_library_t; -} -extern "C" { - pub fn TCOD_get_function_address(library: TCOD_library_t, - function_name: - *const ::std::os::raw::c_char) - -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_close_library(arg1: TCOD_library_t); -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TCOD_dice_t { - pub nb_rolls: ::std::os::raw::c_int, - pub nb_faces: ::std::os::raw::c_int, - pub multiplier: f32, - pub addsub: f32, -} -impl Clone for TCOD_dice_t { - fn clone(&self) -> Self { *self } -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_random_algo_t { TCOD_RNG_MT = 0, TCOD_RNG_CMWC = 1, } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_distribution_t { - TCOD_DISTRIBUTION_LINEAR = 0, - TCOD_DISTRIBUTION_GAUSSIAN = 1, - TCOD_DISTRIBUTION_GAUSSIAN_RANGE = 2, - TCOD_DISTRIBUTION_GAUSSIAN_INVERSE = 3, - TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE = 4, -} -pub type TCOD_random_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_random_get_instance() -> TCOD_random_t; -} -extern "C" { - pub fn TCOD_random_new(algo: TCOD_random_algo_t) -> TCOD_random_t; -} -extern "C" { - pub fn TCOD_random_save(mersenne: TCOD_random_t) -> TCOD_random_t; -} -extern "C" { - pub fn TCOD_random_restore(mersenne: TCOD_random_t, - backup: TCOD_random_t); -} -extern "C" { - pub fn TCOD_random_new_from_seed(algo: TCOD_random_algo_t, seed: uint32) - -> TCOD_random_t; -} -extern "C" { - pub fn TCOD_random_delete(mersenne: TCOD_random_t); -} -extern "C" { - pub fn TCOD_random_set_distribution(mersenne: TCOD_random_t, - distribution: TCOD_distribution_t); -} -extern "C" { - pub fn TCOD_random_get_int(mersenne: TCOD_random_t, - min: ::std::os::raw::c_int, - max: ::std::os::raw::c_int) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_random_get_float(mersenne: TCOD_random_t, min: f32, max: f32) - -> f32; -} -extern "C" { - pub fn TCOD_random_get_double(mersenne: TCOD_random_t, min: f64, max: f64) - -> f64; -} -extern "C" { - pub fn TCOD_random_get_int_mean(mersenne: TCOD_random_t, - min: ::std::os::raw::c_int, - max: ::std::os::raw::c_int, - mean: ::std::os::raw::c_int) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_random_get_float_mean(mersenne: TCOD_random_t, min: f32, - max: f32, mean: f32) -> f32; -} -extern "C" { - pub fn TCOD_random_get_double_mean(mersenne: TCOD_random_t, min: f64, - max: f64, mean: f64) -> f64; -} -extern "C" { - pub fn TCOD_random_dice_new(s: *const ::std::os::raw::c_char) - -> TCOD_dice_t; -} -extern "C" { - pub fn TCOD_random_dice_roll(mersenne: TCOD_random_t, dice: TCOD_dice_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_random_dice_roll_s(mersenne: TCOD_random_t, - s: *const ::std::os::raw::c_char) - -> ::std::os::raw::c_int; -} -pub type TCOD_line_listener_t = - ::std::option::Option bool_>; -extern "C" { - pub fn TCOD_line_init(xFrom: ::std::os::raw::c_int, - yFrom: ::std::os::raw::c_int, - xTo: ::std::os::raw::c_int, - yTo: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_line_step(xCur: *mut ::std::os::raw::c_int, - yCur: *mut ::std::os::raw::c_int) -> bool_; -} -extern "C" { - pub fn TCOD_line(xFrom: ::std::os::raw::c_int, - yFrom: ::std::os::raw::c_int, xTo: ::std::os::raw::c_int, - yTo: ::std::os::raw::c_int, - listener: TCOD_line_listener_t) -> bool_; -} -#[repr(C)] -#[derive(Debug, Default, Copy)] -pub struct TCOD_bresenham_data_t { - pub stepx: ::std::os::raw::c_int, - pub stepy: ::std::os::raw::c_int, - pub e: ::std::os::raw::c_int, - pub deltax: ::std::os::raw::c_int, - pub deltay: ::std::os::raw::c_int, - pub origx: ::std::os::raw::c_int, - pub origy: ::std::os::raw::c_int, - pub destx: ::std::os::raw::c_int, - pub desty: ::std::os::raw::c_int, -} -impl Clone for TCOD_bresenham_data_t { - fn clone(&self) -> Self { *self } -} -extern "C" { - pub fn TCOD_line_init_mt(xFrom: ::std::os::raw::c_int, - yFrom: ::std::os::raw::c_int, - xTo: ::std::os::raw::c_int, - yTo: ::std::os::raw::c_int, - data: *mut TCOD_bresenham_data_t); -} -extern "C" { - pub fn TCOD_line_step_mt(xCur: *mut ::std::os::raw::c_int, - yCur: *mut ::std::os::raw::c_int, - data: *mut TCOD_bresenham_data_t) -> bool_; -} -extern "C" { - pub fn TCOD_line_mt(xFrom: ::std::os::raw::c_int, - yFrom: ::std::os::raw::c_int, - xTo: ::std::os::raw::c_int, - yTo: ::std::os::raw::c_int, - listener: TCOD_line_listener_t, - data: *mut TCOD_bresenham_data_t) -> bool_; -} -pub type TCOD_noise_t = *mut ::std::os::raw::c_void; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_noise_type_t { - TCOD_NOISE_PERLIN = 1, - TCOD_NOISE_SIMPLEX = 2, - TCOD_NOISE_WAVELET = 4, - TCOD_NOISE_DEFAULT = 0, -} -extern "C" { - pub fn TCOD_noise_new(dimensions: ::std::os::raw::c_int, hurst: f32, - lacunarity: f32, random: TCOD_random_t) - -> TCOD_noise_t; -} -extern "C" { - pub fn TCOD_noise_set_type(noise: TCOD_noise_t, type_: TCOD_noise_type_t); -} -extern "C" { - pub fn TCOD_noise_get_ex(noise: TCOD_noise_t, f: *mut f32, - type_: TCOD_noise_type_t) -> f32; -} -extern "C" { - pub fn TCOD_noise_get_fbm_ex(noise: TCOD_noise_t, f: *mut f32, - octaves: f32, type_: TCOD_noise_type_t) - -> f32; -} -extern "C" { - pub fn TCOD_noise_get_turbulence_ex(noise: TCOD_noise_t, f: *mut f32, - octaves: f32, - type_: TCOD_noise_type_t) -> f32; -} -extern "C" { - pub fn TCOD_noise_get(noise: TCOD_noise_t, f: *mut f32) -> f32; -} -extern "C" { - pub fn TCOD_noise_get_fbm(noise: TCOD_noise_t, f: *mut f32, octaves: f32) - -> f32; -} -extern "C" { - pub fn TCOD_noise_get_turbulence(noise: TCOD_noise_t, f: *mut f32, - octaves: f32) -> f32; -} -extern "C" { - pub fn TCOD_noise_delete(noise: TCOD_noise_t); -} -pub type TCOD_map_t = *mut ::std::os::raw::c_void; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_fov_algorithm_t { - FOV_BASIC = 0, - FOV_DIAMOND = 1, - FOV_SHADOW = 2, - FOV_PERMISSIVE_0 = 3, - FOV_PERMISSIVE_1 = 4, - FOV_PERMISSIVE_2 = 5, - FOV_PERMISSIVE_3 = 6, - FOV_PERMISSIVE_4 = 7, - FOV_PERMISSIVE_5 = 8, - FOV_PERMISSIVE_6 = 9, - FOV_PERMISSIVE_7 = 10, - FOV_PERMISSIVE_8 = 11, - FOV_RESTRICTIVE = 12, - NB_FOV_ALGORITHMS = 13, -} -extern "C" { - pub fn TCOD_map_new(width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int) -> TCOD_map_t; -} -extern "C" { - pub fn TCOD_map_clear(map: TCOD_map_t, transparent: bool_, - walkable: bool_); -} -extern "C" { - pub fn TCOD_map_copy(source: TCOD_map_t, dest: TCOD_map_t); -} -extern "C" { - pub fn TCOD_map_set_properties(map: TCOD_map_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - is_transparent: bool_, is_walkable: bool_); -} -extern "C" { - pub fn TCOD_map_delete(map: TCOD_map_t); -} -extern "C" { - pub fn TCOD_map_compute_fov(map: TCOD_map_t, - player_x: ::std::os::raw::c_int, - player_y: ::std::os::raw::c_int, - max_radius: ::std::os::raw::c_int, - light_walls: bool_, - algo: TCOD_fov_algorithm_t); -} -extern "C" { - pub fn TCOD_map_is_in_fov(map: TCOD_map_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) -> bool_; -} -extern "C" { - pub fn TCOD_map_set_in_fov(map: TCOD_map_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, fov: bool_); -} -extern "C" { - pub fn TCOD_map_is_transparent(map: TCOD_map_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) -> bool_; -} -extern "C" { - pub fn TCOD_map_is_walkable(map: TCOD_map_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) -> bool_; -} -extern "C" { - pub fn TCOD_map_get_width(map: TCOD_map_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_map_get_height(map: TCOD_map_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_map_get_nb_cells(map: TCOD_map_t) -> ::std::os::raw::c_int; -} -pub type TCOD_path_func_t = - ::std::option::Option f32>; -pub type TCOD_path_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_path_new_using_map(map: TCOD_map_t, diagonalCost: f32) - -> TCOD_path_t; -} -extern "C" { - pub fn TCOD_path_new_using_function(map_width: ::std::os::raw::c_int, - map_height: ::std::os::raw::c_int, - func: TCOD_path_func_t, - user_data: - *mut ::std::os::raw::c_void, - diagonalCost: f32) -> TCOD_path_t; -} -extern "C" { - pub fn TCOD_path_compute(path: TCOD_path_t, ox: ::std::os::raw::c_int, - oy: ::std::os::raw::c_int, - dx: ::std::os::raw::c_int, - dy: ::std::os::raw::c_int) -> bool_; -} -extern "C" { - pub fn TCOD_path_walk(path: TCOD_path_t, x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int, - recalculate_when_needed: bool_) -> bool_; -} -extern "C" { - pub fn TCOD_path_is_empty(path: TCOD_path_t) -> bool_; -} -extern "C" { - pub fn TCOD_path_size(path: TCOD_path_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_path_reverse(path: TCOD_path_t); -} -extern "C" { - pub fn TCOD_path_get(path: TCOD_path_t, index: ::std::os::raw::c_int, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_path_get_origin(path: TCOD_path_t, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_path_get_destination(path: TCOD_path_t, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_path_delete(path: TCOD_path_t); -} -pub type TCOD_dijkstra_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_dijkstra_new(map: TCOD_map_t, diagonalCost: f32) - -> TCOD_dijkstra_t; -} -extern "C" { - pub fn TCOD_dijkstra_new_using_function(map_width: ::std::os::raw::c_int, - map_height: ::std::os::raw::c_int, - func: TCOD_path_func_t, - user_data: - *mut ::std::os::raw::c_void, - diagonalCost: f32) - -> TCOD_dijkstra_t; -} -extern "C" { - pub fn TCOD_dijkstra_compute(dijkstra: TCOD_dijkstra_t, - root_x: ::std::os::raw::c_int, - root_y: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_dijkstra_get_distance(dijkstra: TCOD_dijkstra_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn TCOD_dijkstra_path_set(dijkstra: TCOD_dijkstra_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) -> bool_; -} -extern "C" { - pub fn TCOD_dijkstra_is_empty(path: TCOD_dijkstra_t) -> bool_; -} -extern "C" { - pub fn TCOD_dijkstra_size(path: TCOD_dijkstra_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_dijkstra_reverse(path: TCOD_dijkstra_t); -} -extern "C" { - pub fn TCOD_dijkstra_get(path: TCOD_dijkstra_t, - index: ::std::os::raw::c_int, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_dijkstra_path_walk(dijkstra: TCOD_dijkstra_t, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int) -> bool_; -} -extern "C" { - pub fn TCOD_dijkstra_delete(dijkstra: TCOD_dijkstra_t); -} -#[repr(C)] -pub struct TCOD_lex_t { - pub file_line: ::std::os::raw::c_int, - pub token_type: ::std::os::raw::c_int, - pub token_int_val: ::std::os::raw::c_int, - pub token_idx: ::std::os::raw::c_int, - pub token_float_val: f32, - pub tok: *mut ::std::os::raw::c_char, - pub toklen: ::std::os::raw::c_int, - pub lastStringDelim: ::std::os::raw::c_char, - pub pos: *mut ::std::os::raw::c_char, - pub buf: *mut ::std::os::raw::c_char, - pub filename: *mut ::std::os::raw::c_char, - pub last_javadoc_comment: *mut ::std::os::raw::c_char, - pub nb_symbols: ::std::os::raw::c_int, - pub nb_keywords: ::std::os::raw::c_int, - pub flags: ::std::os::raw::c_int, - pub symbols: [[::std::os::raw::c_char; 5usize]; 100usize], - pub keywords: [[::std::os::raw::c_char; 20usize]; 100usize], - pub simpleCmt: *const ::std::os::raw::c_char, - pub cmtStart: *const ::std::os::raw::c_char, - pub cmtStop: *const ::std::os::raw::c_char, - pub javadocCmtStart: *const ::std::os::raw::c_char, - pub stringDelim: *const ::std::os::raw::c_char, - pub javadoc_read: bool_, - pub allocBuf: bool_, - pub savept: bool_, -} -extern "C" { - pub fn TCOD_lex_new_intern() -> *mut TCOD_lex_t; -} -extern "C" { - pub fn TCOD_lex_new(symbols: *mut *const ::std::os::raw::c_char, - keywords: *mut *const ::std::os::raw::c_char, - simpleComment: *const ::std::os::raw::c_char, - commentStart: *const ::std::os::raw::c_char, - commentStop: *const ::std::os::raw::c_char, - javadocCommentStart: *const ::std::os::raw::c_char, - stringDelim: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int) -> *mut TCOD_lex_t; -} -extern "C" { - pub fn TCOD_lex_delete(lex: *mut TCOD_lex_t); -} -extern "C" { - pub fn TCOD_lex_set_data_buffer(lex: *mut TCOD_lex_t, - dat: *mut ::std::os::raw::c_char); -} -extern "C" { - pub fn TCOD_lex_set_data_file(lex: *mut TCOD_lex_t, - filename: *const ::std::os::raw::c_char) - -> bool_; -} -extern "C" { - pub fn TCOD_lex_parse(lex: *mut TCOD_lex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_lex_parse_until_token_type(lex: *mut TCOD_lex_t, - token_type: ::std::os::raw::c_int) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_lex_parse_until_token_value(lex: *mut TCOD_lex_t, - token_value: - *const ::std::os::raw::c_char) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_lex_expect_token_type(lex: *mut TCOD_lex_t, - token_type: ::std::os::raw::c_int) - -> bool_; -} -extern "C" { - pub fn TCOD_lex_expect_token_value(lex: *mut TCOD_lex_t, - token_type: ::std::os::raw::c_int, - token_value: - *const ::std::os::raw::c_char) - -> bool_; -} -extern "C" { - pub fn TCOD_lex_savepoint(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); -} -extern "C" { - pub fn TCOD_lex_restore(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); -} -extern "C" { - pub fn TCOD_lex_get_last_javadoc(lex: *mut TCOD_lex_t) - -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_lex_get_token_name(token_type: ::std::os::raw::c_int) - -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_lex_get_last_error() -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_lex_hextoint(c: ::std::os::raw::c_char) - -> ::std::os::raw::c_int; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_value_type_t { - TCOD_TYPE_NONE = 0, - TCOD_TYPE_BOOL = 1, - TCOD_TYPE_CHAR = 2, - TCOD_TYPE_INT = 3, - TCOD_TYPE_FLOAT = 4, - TCOD_TYPE_STRING = 5, - TCOD_TYPE_COLOR = 6, - TCOD_TYPE_DICE = 7, - TCOD_TYPE_VALUELIST00 = 8, - TCOD_TYPE_VALUELIST01 = 9, - TCOD_TYPE_VALUELIST02 = 10, - TCOD_TYPE_VALUELIST03 = 11, - TCOD_TYPE_VALUELIST04 = 12, - TCOD_TYPE_VALUELIST05 = 13, - TCOD_TYPE_VALUELIST06 = 14, - TCOD_TYPE_VALUELIST07 = 15, - TCOD_TYPE_VALUELIST08 = 16, - TCOD_TYPE_VALUELIST09 = 17, - TCOD_TYPE_VALUELIST10 = 18, - TCOD_TYPE_VALUELIST11 = 19, - TCOD_TYPE_VALUELIST12 = 20, - TCOD_TYPE_VALUELIST13 = 21, - TCOD_TYPE_VALUELIST14 = 22, - TCOD_TYPE_VALUELIST15 = 23, - TCOD_TYPE_CUSTOM00 = 24, - TCOD_TYPE_CUSTOM01 = 25, - TCOD_TYPE_CUSTOM02 = 26, - TCOD_TYPE_CUSTOM03 = 27, - TCOD_TYPE_CUSTOM04 = 28, - TCOD_TYPE_CUSTOM05 = 29, - TCOD_TYPE_CUSTOM06 = 30, - TCOD_TYPE_CUSTOM07 = 31, - TCOD_TYPE_CUSTOM08 = 32, - TCOD_TYPE_CUSTOM09 = 33, - TCOD_TYPE_CUSTOM10 = 34, - TCOD_TYPE_CUSTOM11 = 35, - TCOD_TYPE_CUSTOM12 = 36, - TCOD_TYPE_CUSTOM13 = 37, - TCOD_TYPE_CUSTOM14 = 38, - TCOD_TYPE_CUSTOM15 = 39, - TCOD_TYPE_LIST = 1024, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TCOD_value_t { - pub b: __BindgenUnionField, - pub c: __BindgenUnionField<::std::os::raw::c_char>, - pub i: __BindgenUnionField, - pub f: __BindgenUnionField, - pub s: __BindgenUnionField<*mut ::std::os::raw::c_char>, - pub col: __BindgenUnionField, - pub dice: __BindgenUnionField, - pub list: __BindgenUnionField, - pub custom: __BindgenUnionField<*mut ::std::os::raw::c_void>, - pub bindgen_union_field: [u64; 2usize], -} -impl Clone for TCOD_value_t { - fn clone(&self) -> Self { *self } -} -pub type TCOD_parser_struct_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_struct_get_name(def: TCOD_parser_struct_t) - -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_struct_add_property(def: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - type_: TCOD_value_type_t, - mandatory: bool_); -} -extern "C" { - pub fn TCOD_struct_add_list_property(def: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - type_: TCOD_value_type_t, - mandatory: bool_); -} -extern "C" { - pub fn TCOD_struct_add_value_list(def: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - value_list: - *mut *const ::std::os::raw::c_char, - mandatory: bool_); -} -extern "C" { - pub fn TCOD_struct_add_value_list_sized(def: TCOD_parser_struct_t, - name: - *const ::std::os::raw::c_char, - value_list: - *mut *const ::std::os::raw::c_char, - size: ::std::os::raw::c_int, - mandatory: bool_); -} -extern "C" { - pub fn TCOD_struct_add_flag(def: TCOD_parser_struct_t, - propname: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn TCOD_struct_add_structure(def: TCOD_parser_struct_t, - sub_structure: TCOD_parser_struct_t); -} -extern "C" { - pub fn TCOD_struct_is_mandatory(def: TCOD_parser_struct_t, - propname: *const ::std::os::raw::c_char) - -> bool_; -} -extern "C" { - pub fn TCOD_struct_get_type(def: TCOD_parser_struct_t, - propname: *const ::std::os::raw::c_char) - -> TCOD_value_type_t; -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TCOD_parser_listener_t { - pub new_struct: ::std::option::Option bool_>, - pub new_flag: ::std::option::Option bool_>, - pub new_property: ::std::option::Option bool_>, - pub end_struct: ::std::option::Option bool_>, - pub error: ::std::option::Option, -} -impl Clone for TCOD_parser_listener_t { - fn clone(&self) -> Self { *self } -} -pub type TCOD_parser_custom_t = - ::std::option::Option TCOD_value_t>; -pub type TCOD_parser_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_parser_new() -> TCOD_parser_t; -} -extern "C" { - pub fn TCOD_parser_new_struct(parser: TCOD_parser_t, - name: *mut ::std::os::raw::c_char) - -> TCOD_parser_struct_t; -} -extern "C" { - pub fn TCOD_parser_new_custom_type(parser: TCOD_parser_t, - custom_type_parser: - TCOD_parser_custom_t) - -> TCOD_value_type_t; -} -extern "C" { - pub fn TCOD_parser_run(parser: TCOD_parser_t, - filename: *const ::std::os::raw::c_char, - listener: *mut TCOD_parser_listener_t); -} -extern "C" { - pub fn TCOD_parser_delete(parser: TCOD_parser_t); -} -extern "C" { - pub fn TCOD_parser_error(msg: *const ::std::os::raw::c_char, ...); -} -extern "C" { - pub fn TCOD_parser_has_property(parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char) - -> bool_; -} -extern "C" { - pub fn TCOD_parser_get_bool_property(parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char) - -> bool_; -} -extern "C" { - pub fn TCOD_parser_get_char_property(parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_parser_get_int_property(parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_parser_get_float_property(parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char) - -> f32; -} -extern "C" { - pub fn TCOD_parser_get_string_property(parser: TCOD_parser_t, - name: - *const ::std::os::raw::c_char) - -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_parser_get_color_property(parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char) - -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_parser_get_dice_property(parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char) - -> TCOD_dice_t; -} -extern "C" { - pub fn TCOD_parser_get_dice_property_py(parser: TCOD_parser_t, - name: - *const ::std::os::raw::c_char, - dice: *mut TCOD_dice_t); -} -extern "C" { - pub fn TCOD_parser_get_custom_property(parser: TCOD_parser_t, - name: - *const ::std::os::raw::c_char) - -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_parser_get_list_property(parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - type_: TCOD_value_type_t) - -> TCOD_list_t; -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TCOD_struct_int_t { - pub name: *mut ::std::os::raw::c_char, - pub flags: TCOD_list_t, - pub props: TCOD_list_t, - pub lists: TCOD_list_t, - pub structs: TCOD_list_t, -} -impl Clone for TCOD_struct_int_t { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TCOD_parser_int_t { - pub structs: TCOD_list_t, - pub customs: [TCOD_parser_custom_t; 16usize], - pub fatal: bool_, - pub props: TCOD_list_t, -} -impl Clone for TCOD_parser_int_t { - fn clone(&self) -> Self { *self } -} -extern "C" { - pub fn TCOD_parse_bool_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_char_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_integer_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_float_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_string_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_color_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_dice_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_value_list_value(def: *mut TCOD_struct_int_t, - listnum: ::std::os::raw::c_int) - -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_property_value(parser: *mut TCOD_parser_int_t, - def: TCOD_parser_struct_t, - propname: *mut ::std::os::raw::c_char, - list: bool_) -> TCOD_value_t; -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct _TCOD_tree_t { - pub next: *mut _TCOD_tree_t, - pub father: *mut _TCOD_tree_t, - pub sons: *mut _TCOD_tree_t, -} -impl Clone for _TCOD_tree_t { - fn clone(&self) -> Self { *self } -} -pub type TCOD_tree_t = _TCOD_tree_t; -extern "C" { - pub fn TCOD_tree_new() -> *mut TCOD_tree_t; -} -extern "C" { - pub fn TCOD_tree_add_son(node: *mut TCOD_tree_t, son: *mut TCOD_tree_t); -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TCOD_bsp_t { - pub tree: TCOD_tree_t, - pub x: ::std::os::raw::c_int, - pub y: ::std::os::raw::c_int, - pub w: ::std::os::raw::c_int, - pub h: ::std::os::raw::c_int, - pub position: ::std::os::raw::c_int, - pub level: uint8, - pub horizontal: bool_, -} -impl Clone for TCOD_bsp_t { - fn clone(&self) -> Self { *self } -} -pub type TCOD_bsp_callback_t = - ::std::option::Option bool_>; -extern "C" { - pub fn TCOD_bsp_new() -> *mut TCOD_bsp_t; -} -extern "C" { - pub fn TCOD_bsp_new_with_size(x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int) - -> *mut TCOD_bsp_t; -} -extern "C" { - pub fn TCOD_bsp_delete(node: *mut TCOD_bsp_t); -} -extern "C" { - pub fn TCOD_bsp_left(node: *const TCOD_bsp_t) -> *mut TCOD_bsp_t; -} -extern "C" { - pub fn TCOD_bsp_right(node: *const TCOD_bsp_t) -> *mut TCOD_bsp_t; -} -extern "C" { - pub fn TCOD_bsp_father(node: *const TCOD_bsp_t) -> *mut TCOD_bsp_t; -} -extern "C" { - pub fn TCOD_bsp_is_leaf(node: *const TCOD_bsp_t) -> bool_; -} -extern "C" { - pub fn TCOD_bsp_traverse_pre_order(node: *mut TCOD_bsp_t, - listener: TCOD_bsp_callback_t, - userData: *mut ::std::os::raw::c_void) - -> bool_; -} -extern "C" { - pub fn TCOD_bsp_traverse_in_order(node: *mut TCOD_bsp_t, - listener: TCOD_bsp_callback_t, - userData: *mut ::std::os::raw::c_void) - -> bool_; -} -extern "C" { - pub fn TCOD_bsp_traverse_post_order(node: *mut TCOD_bsp_t, - listener: TCOD_bsp_callback_t, - userData: *mut ::std::os::raw::c_void) - -> bool_; -} -extern "C" { - pub fn TCOD_bsp_traverse_level_order(node: *mut TCOD_bsp_t, - listener: TCOD_bsp_callback_t, - userData: - *mut ::std::os::raw::c_void) - -> bool_; -} -extern "C" { - pub fn TCOD_bsp_traverse_inverted_level_order(node: *mut TCOD_bsp_t, - listener: - TCOD_bsp_callback_t, - userData: - *mut ::std::os::raw::c_void) - -> bool_; -} -extern "C" { - pub fn TCOD_bsp_contains(node: *const TCOD_bsp_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) -> bool_; -} -extern "C" { - pub fn TCOD_bsp_find_node(node: *const TCOD_bsp_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) -> *mut TCOD_bsp_t; -} -extern "C" { - pub fn TCOD_bsp_resize(node: *mut TCOD_bsp_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_bsp_split_once(node: *mut TCOD_bsp_t, horizontal: bool_, - position: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_bsp_split_recursive(node: *mut TCOD_bsp_t, - randomizer: TCOD_random_t, - nb: ::std::os::raw::c_int, - minHSize: ::std::os::raw::c_int, - minVSize: ::std::os::raw::c_int, - maxHRatio: f32, maxVRatio: f32); -} -extern "C" { - pub fn TCOD_bsp_remove_sons(node: *mut TCOD_bsp_t); -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct TCOD_heightmap_t { - pub w: ::std::os::raw::c_int, - pub h: ::std::os::raw::c_int, - pub values: *mut f32, -} -impl Clone for TCOD_heightmap_t { - fn clone(&self) -> Self { *self } -} -extern "C" { - pub fn TCOD_heightmap_new(w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int) - -> *mut TCOD_heightmap_t; -} -extern "C" { - pub fn TCOD_heightmap_delete(hm: *mut TCOD_heightmap_t); -} -extern "C" { - pub fn TCOD_heightmap_get_value(hm: *const TCOD_heightmap_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn TCOD_heightmap_get_interpolated_value(hm: *const TCOD_heightmap_t, - x: f32, y: f32) -> f32; -} -extern "C" { - pub fn TCOD_heightmap_set_value(hm: *mut TCOD_heightmap_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, value: f32); -} -extern "C" { - pub fn TCOD_heightmap_get_slope(hm: *const TCOD_heightmap_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn TCOD_heightmap_get_normal(hm: *const TCOD_heightmap_t, x: f32, - y: f32, n: *mut f32, waterLevel: f32); -} -extern "C" { - pub fn TCOD_heightmap_count_cells(hm: *const TCOD_heightmap_t, min: f32, - max: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_heightmap_has_land_on_border(hm: *const TCOD_heightmap_t, - waterLevel: f32) -> bool_; -} -extern "C" { - pub fn TCOD_heightmap_get_minmax(hm: *const TCOD_heightmap_t, - min: *mut f32, max: *mut f32); -} -extern "C" { - pub fn TCOD_heightmap_copy(hm_source: *const TCOD_heightmap_t, - hm_dest: *mut TCOD_heightmap_t); -} -extern "C" { - pub fn TCOD_heightmap_add(hm: *mut TCOD_heightmap_t, value: f32); -} -extern "C" { - pub fn TCOD_heightmap_scale(hm: *mut TCOD_heightmap_t, value: f32); -} -extern "C" { - pub fn TCOD_heightmap_clamp(hm: *mut TCOD_heightmap_t, min: f32, - max: f32); -} -extern "C" { - pub fn TCOD_heightmap_normalize(hm: *mut TCOD_heightmap_t, min: f32, - max: f32); -} -extern "C" { - pub fn TCOD_heightmap_clear(hm: *mut TCOD_heightmap_t); -} -extern "C" { - pub fn TCOD_heightmap_lerp_hm(hm1: *const TCOD_heightmap_t, - hm2: *const TCOD_heightmap_t, - hmres: *mut TCOD_heightmap_t, coef: f32); -} -extern "C" { - pub fn TCOD_heightmap_add_hm(hm1: *const TCOD_heightmap_t, - hm2: *const TCOD_heightmap_t, - hmres: *mut TCOD_heightmap_t); -} -extern "C" { - pub fn TCOD_heightmap_multiply_hm(hm1: *const TCOD_heightmap_t, - hm2: *const TCOD_heightmap_t, - hmres: *mut TCOD_heightmap_t); -} -extern "C" { - pub fn TCOD_heightmap_add_hill(hm: *mut TCOD_heightmap_t, hx: f32, - hy: f32, hradius: f32, hheight: f32); -} -extern "C" { - pub fn TCOD_heightmap_dig_hill(hm: *mut TCOD_heightmap_t, hx: f32, - hy: f32, hradius: f32, hheight: f32); -} -extern "C" { - pub fn TCOD_heightmap_dig_bezier(hm: *mut TCOD_heightmap_t, - px: *mut ::std::os::raw::c_int, - py: *mut ::std::os::raw::c_int, - startRadius: f32, startDepth: f32, - endRadius: f32, endDepth: f32); -} -extern "C" { - pub fn TCOD_heightmap_rain_erosion(hm: *mut TCOD_heightmap_t, - nbDrops: ::std::os::raw::c_int, - erosionCoef: f32, - sedimentationCoef: f32, - rnd: TCOD_random_t); -} -extern "C" { - pub fn TCOD_heightmap_kernel_transform(hm: *mut TCOD_heightmap_t, - kernelsize: ::std::os::raw::c_int, - dx: *const ::std::os::raw::c_int, - dy: *const ::std::os::raw::c_int, - weight: *const f32, minLevel: f32, - maxLevel: f32); -} -extern "C" { - pub fn TCOD_heightmap_add_voronoi(hm: *mut TCOD_heightmap_t, - nbPoints: ::std::os::raw::c_int, - nbCoef: ::std::os::raw::c_int, - coef: *const f32, rnd: TCOD_random_t); -} -extern "C" { - pub fn TCOD_heightmap_mid_point_displacement(hm: *mut TCOD_heightmap_t, - rnd: TCOD_random_t, - roughness: f32); -} -extern "C" { - pub fn TCOD_heightmap_add_fbm(hm: *mut TCOD_heightmap_t, - noise: TCOD_noise_t, mulx: f32, muly: f32, - addx: f32, addy: f32, octaves: f32, - delta: f32, scale: f32); -} -extern "C" { - pub fn TCOD_heightmap_scale_fbm(hm: *mut TCOD_heightmap_t, - noise: TCOD_noise_t, mulx: f32, muly: f32, - addx: f32, addy: f32, octaves: f32, - delta: f32, scale: f32); -} -extern "C" { - pub fn TCOD_heightmap_islandify(hm: *mut TCOD_heightmap_t, seaLevel: f32, - rnd: TCOD_random_t); -} -pub type TCOD_zip_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_zip_new() -> TCOD_zip_t; -} -extern "C" { - pub fn TCOD_zip_delete(zip: TCOD_zip_t); -} -extern "C" { - pub fn TCOD_zip_put_char(zip: TCOD_zip_t, val: ::std::os::raw::c_char); -} -extern "C" { - pub fn TCOD_zip_put_int(zip: TCOD_zip_t, val: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_zip_put_float(zip: TCOD_zip_t, val: f32); -} -extern "C" { - pub fn TCOD_zip_put_string(zip: TCOD_zip_t, - val: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn TCOD_zip_put_color(zip: TCOD_zip_t, val: TCOD_color_t); -} -extern "C" { - pub fn TCOD_zip_put_image(zip: TCOD_zip_t, val: TCOD_image_t); -} -extern "C" { - pub fn TCOD_zip_put_console(zip: TCOD_zip_t, val: TCOD_console_t); -} -extern "C" { - pub fn TCOD_zip_put_data(zip: TCOD_zip_t, nbBytes: ::std::os::raw::c_int, - data: *const ::std::os::raw::c_void); -} -extern "C" { - pub fn TCOD_zip_get_current_bytes(zip: TCOD_zip_t) -> uint32; -} -extern "C" { - pub fn TCOD_zip_save_to_file(zip: TCOD_zip_t, - filename: *const ::std::os::raw::c_char) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_zip_load_from_file(zip: TCOD_zip_t, - filename: *const ::std::os::raw::c_char) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_zip_get_char(zip: TCOD_zip_t) -> ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_zip_get_int(zip: TCOD_zip_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_zip_get_float(zip: TCOD_zip_t) -> f32; -} -extern "C" { - pub fn TCOD_zip_get_string(zip: TCOD_zip_t) - -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_zip_get_color(zip: TCOD_zip_t) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_zip_get_image(zip: TCOD_zip_t) -> TCOD_image_t; -} -extern "C" { - pub fn TCOD_zip_get_console(zip: TCOD_zip_t) -> TCOD_console_t; -} -extern "C" { - pub fn TCOD_zip_get_data(zip: TCOD_zip_t, nbBytes: ::std::os::raw::c_int, - data: *mut ::std::os::raw::c_void) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_zip_get_remaining_bytes(zip: TCOD_zip_t) -> uint32; -} -extern "C" { - pub fn TCOD_zip_skip_bytes(zip: TCOD_zip_t, nbBytes: uint32); -} -pub type TCOD_namegen_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_namegen_parse(filename: *const ::std::os::raw::c_char, - random: TCOD_random_t); -} -extern "C" { - pub fn TCOD_namegen_generate(name: *mut ::std::os::raw::c_char, - allocate: bool_) - -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_namegen_generate_custom(name: *mut ::std::os::raw::c_char, - rule: *mut ::std::os::raw::c_char, - allocate: bool_) - -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_namegen_get_sets() -> TCOD_list_t; -} -extern "C" { - pub fn TCOD_namegen_destroy(); -} -pub type TCOD_text_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_text_init(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, h: ::std::os::raw::c_int, - max_chars: ::std::os::raw::c_int) -> TCOD_text_t; -} -extern "C" { - pub fn TCOD_text_init2(w: ::std::os::raw::c_int, h: ::std::os::raw::c_int, - max_chars: ::std::os::raw::c_int) -> TCOD_text_t; -} -extern "C" { - pub fn TCOD_text_set_pos(txt: TCOD_text_t, x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_text_set_properties(txt: TCOD_text_t, - cursor_char: ::std::os::raw::c_int, - blink_interval: ::std::os::raw::c_int, - prompt: *const ::std::os::raw::c_char, - tab_size: ::std::os::raw::c_int); -} -extern "C" { - pub fn TCOD_text_set_colors(txt: TCOD_text_t, fore: TCOD_color_t, - back: TCOD_color_t, back_transparency: f32); -} -extern "C" { - pub fn TCOD_text_update(txt: TCOD_text_t, key: TCOD_key_t) -> bool_; -} -extern "C" { - pub fn TCOD_text_render(txt: TCOD_text_t, con: TCOD_console_t); -} -extern "C" { - pub fn TCOD_text_get(txt: TCOD_text_t) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_text_reset(txt: TCOD_text_t); -} -extern "C" { - pub fn TCOD_text_delete(txt: TCOD_text_t); -} -pub type __builtin_va_list = [__va_list_tag; 1usize]; -#[repr(C)] -#[derive(Debug, Copy)] -pub struct __va_list_tag { - pub gp_offset: ::std::os::raw::c_uint, - pub fp_offset: ::std::os::raw::c_uint, - pub overflow_arg_area: *mut ::std::os::raw::c_void, - pub reg_save_area: *mut ::std::os::raw::c_void, -} -impl Clone for __va_list_tag { - fn clone(&self) -> Self { *self } -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct __locale_data { - pub _address: u8, -} -impl Clone for __locale_data { - fn clone(&self) -> Self { *self } -} +include!(concat!("./", env!("BINDINGS_TARGET"), "_bindings.rs")); diff --git a/tcod_sys/x86_64-pc-windows-msvc_bindings.rs b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs new file mode 100644 index 000000000..ed6f103cc --- /dev/null +++ b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs @@ -0,0 +1,7948 @@ +/* automatically generated by rust-bindgen */ + +pub const __llvm__: u32 = 1; +pub const __clang__: u32 = 1; +pub const __clang_major__: u32 = 10; +pub const __clang_minor__: u32 = 0; +pub const __clang_patchlevel__: u32 = 0; +pub const __clang_version__: &'static [u8; 8usize] = b"10.0.0 \0"; +pub const __ATOMIC_RELAXED: u32 = 0; +pub const __ATOMIC_CONSUME: u32 = 1; +pub const __ATOMIC_ACQUIRE: u32 = 2; +pub const __ATOMIC_RELEASE: u32 = 3; +pub const __ATOMIC_ACQ_REL: u32 = 4; +pub const __ATOMIC_SEQ_CST: u32 = 5; +pub const __OPENCL_MEMORY_SCOPE_WORK_ITEM: u32 = 0; +pub const __OPENCL_MEMORY_SCOPE_WORK_GROUP: u32 = 1; +pub const __OPENCL_MEMORY_SCOPE_DEVICE: u32 = 2; +pub const __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES: u32 = 3; +pub const __OPENCL_MEMORY_SCOPE_SUB_GROUP: u32 = 4; +pub const __PRAGMA_REDEFINE_EXTNAME: u32 = 1; +pub const __VERSION__: &'static [u8; 14usize] = b"Clang 10.0.0 \0"; +pub const __OBJC_BOOL_IS_BOOL: u32 = 0; +pub const __CONSTANT_CFSTRINGS__: u32 = 1; +pub const __ORDER_LITTLE_ENDIAN__: u32 = 1234; +pub const __ORDER_BIG_ENDIAN__: u32 = 4321; +pub const __ORDER_PDP_ENDIAN__: u32 = 3412; +pub const __BYTE_ORDER__: u32 = 1234; +pub const __LITTLE_ENDIAN__: u32 = 1; +pub const __CHAR_BIT__: u32 = 8; +pub const __SCHAR_MAX__: u32 = 127; +pub const __SHRT_MAX__: u32 = 32767; +pub const __INT_MAX__: u32 = 2147483647; +pub const __LONG_MAX__: u32 = 2147483647; +pub const __LONG_LONG_MAX__: u64 = 9223372036854775807; +pub const __WCHAR_MAX__: u32 = 65535; +pub const __WINT_MAX__: u32 = 65535; +pub const __INTMAX_MAX__: u64 = 9223372036854775807; +pub const __SIZE_MAX__: i32 = -1; +pub const __UINTMAX_MAX__: i32 = -1; +pub const __PTRDIFF_MAX__: u64 = 9223372036854775807; +pub const __INTPTR_MAX__: u64 = 9223372036854775807; +pub const __UINTPTR_MAX__: i32 = -1; +pub const __SIZEOF_DOUBLE__: u32 = 8; +pub const __SIZEOF_FLOAT__: u32 = 4; +pub const __SIZEOF_INT__: u32 = 4; +pub const __SIZEOF_LONG__: u32 = 4; +pub const __SIZEOF_LONG_DOUBLE__: u32 = 8; +pub const __SIZEOF_LONG_LONG__: u32 = 8; +pub const __SIZEOF_POINTER__: u32 = 8; +pub const __SIZEOF_SHORT__: u32 = 2; +pub const __SIZEOF_PTRDIFF_T__: u32 = 8; +pub const __SIZEOF_SIZE_T__: u32 = 8; +pub const __SIZEOF_WCHAR_T__: u32 = 2; +pub const __SIZEOF_WINT_T__: u32 = 2; +pub const __SIZEOF_INT128__: u32 = 16; +pub const __INTMAX_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INTMAX_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINTMAX_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINTMAX_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINTMAX_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINTMAX_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __INTMAX_WIDTH__: u32 = 64; +pub const __PTRDIFF_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __PTRDIFF_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __PTRDIFF_WIDTH__: u32 = 64; +pub const __INTPTR_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INTPTR_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __INTPTR_WIDTH__: u32 = 64; +pub const __SIZE_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __SIZE_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __SIZE_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __SIZE_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __SIZE_WIDTH__: u32 = 64; +pub const __WCHAR_WIDTH__: u32 = 16; +pub const __WINT_WIDTH__: u32 = 16; +pub const __SIG_ATOMIC_WIDTH__: u32 = 32; +pub const __SIG_ATOMIC_MAX__: u32 = 2147483647; +pub const __UINTMAX_WIDTH__: u32 = 64; +pub const __UINTPTR_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINTPTR_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINTPTR_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINTPTR_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __UINTPTR_WIDTH__: u32 = 64; +pub const __FLT_HAS_DENORM__: u32 = 1; +pub const __FLT_DIG__: u32 = 6; +pub const __FLT_DECIMAL_DIG__: u32 = 9; +pub const __FLT_HAS_INFINITY__: u32 = 1; +pub const __FLT_HAS_QUIET_NAN__: u32 = 1; +pub const __FLT_MANT_DIG__: u32 = 24; +pub const __FLT_MAX_10_EXP__: u32 = 38; +pub const __FLT_MAX_EXP__: u32 = 128; +pub const __FLT_MIN_10_EXP__: i32 = -37; +pub const __FLT_MIN_EXP__: i32 = -125; +pub const __DBL_HAS_DENORM__: u32 = 1; +pub const __DBL_DIG__: u32 = 15; +pub const __DBL_DECIMAL_DIG__: u32 = 17; +pub const __DBL_HAS_INFINITY__: u32 = 1; +pub const __DBL_HAS_QUIET_NAN__: u32 = 1; +pub const __DBL_MANT_DIG__: u32 = 53; +pub const __DBL_MAX_10_EXP__: u32 = 308; +pub const __DBL_MAX_EXP__: u32 = 1024; +pub const __DBL_MIN_10_EXP__: i32 = -307; +pub const __DBL_MIN_EXP__: i32 = -1021; +pub const __LDBL_HAS_DENORM__: u32 = 1; +pub const __LDBL_DIG__: u32 = 15; +pub const __LDBL_DECIMAL_DIG__: u32 = 17; +pub const __LDBL_HAS_INFINITY__: u32 = 1; +pub const __LDBL_HAS_QUIET_NAN__: u32 = 1; +pub const __LDBL_MANT_DIG__: u32 = 53; +pub const __LDBL_MAX_10_EXP__: u32 = 308; +pub const __LDBL_MAX_EXP__: u32 = 1024; +pub const __LDBL_MIN_10_EXP__: i32 = -307; +pub const __LDBL_MIN_EXP__: i32 = -1021; +pub const __POINTER_WIDTH__: u32 = 64; +pub const __BIGGEST_ALIGNMENT__: u32 = 16; +pub const __WCHAR_UNSIGNED__: u32 = 1; +pub const __WINT_UNSIGNED__: u32 = 1; +pub const __INT8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __INT16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __INT32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __INT64_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INT64_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINT8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __UINT8_MAX__: u32 = 255; +pub const __INT8_MAX__: u32 = 127; +pub const __UINT16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __UINT16_MAX__: u32 = 65535; +pub const __INT16_MAX__: u32 = 32767; +pub const __UINT32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __UINT32_MAX__: u32 = 4294967295; +pub const __INT32_MAX__: u32 = 2147483647; +pub const __UINT64_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINT64_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINT64_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINT64_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __UINT64_MAX__: i32 = -1; +pub const __INT64_MAX__: u64 = 9223372036854775807; +pub const __INT_LEAST8_MAX__: u32 = 127; +pub const __INT_LEAST8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT_LEAST8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __UINT_LEAST8_MAX__: u32 = 255; +pub const __UINT_LEAST8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT_LEAST8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT_LEAST8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT_LEAST8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __INT_LEAST16_MAX__: u32 = 32767; +pub const __INT_LEAST16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT_LEAST16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __UINT_LEAST16_MAX__: u32 = 65535; +pub const __UINT_LEAST16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT_LEAST16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT_LEAST16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT_LEAST16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __INT_LEAST32_MAX__: u32 = 2147483647; +pub const __INT_LEAST32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT_LEAST32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __UINT_LEAST32_MAX__: u32 = 4294967295; +pub const __UINT_LEAST32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT_LEAST32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT_LEAST32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT_LEAST32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __INT_LEAST64_MAX__: u64 = 9223372036854775807; +pub const __INT_LEAST64_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INT_LEAST64_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINT_LEAST64_MAX__: i32 = -1; +pub const __UINT_LEAST64_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINT_LEAST64_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINT_LEAST64_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINT_LEAST64_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __INT_FAST8_MAX__: u32 = 127; +pub const __INT_FAST8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT_FAST8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __UINT_FAST8_MAX__: u32 = 255; +pub const __UINT_FAST8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT_FAST8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT_FAST8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT_FAST8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __INT_FAST16_MAX__: u32 = 32767; +pub const __INT_FAST16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT_FAST16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __UINT_FAST16_MAX__: u32 = 65535; +pub const __UINT_FAST16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT_FAST16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT_FAST16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT_FAST16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __INT_FAST32_MAX__: u32 = 2147483647; +pub const __INT_FAST32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT_FAST32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __UINT_FAST32_MAX__: u32 = 4294967295; +pub const __UINT_FAST32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT_FAST32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT_FAST32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT_FAST32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __INT_FAST64_MAX__: u64 = 9223372036854775807; +pub const __INT_FAST64_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INT_FAST64_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINT_FAST64_MAX__: i32 = -1; +pub const __UINT_FAST64_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINT_FAST64_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINT_FAST64_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINT_FAST64_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __FINITE_MATH_ONLY__: u32 = 0; +pub const __CLANG_ATOMIC_BOOL_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR16_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR32_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_WCHAR_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_SHORT_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_INT_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_LONG_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_LLONG_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_POINTER_LOCK_FREE: u32 = 2; +pub const __NO_INLINE__: u32 = 1; +pub const __PIC__: u32 = 2; +pub const __pic__: u32 = 2; +pub const __FLT_EVAL_METHOD__: u32 = 0; +pub const __FLT_RADIX__: u32 = 2; +pub const __DECIMAL_DIG__: u32 = 17; +pub const __GCC_ASM_FLAG_OUTPUTS__: u32 = 1; +pub const __code_model_small_: u32 = 1; +pub const __amd64__: u32 = 1; +pub const __amd64: u32 = 1; +pub const __x86_64: u32 = 1; +pub const __x86_64__: u32 = 1; +pub const __SEG_GS: u32 = 1; +pub const __SEG_FS: u32 = 1; +pub const __k8: u32 = 1; +pub const __k8__: u32 = 1; +pub const __tune_k8__: u32 = 1; +pub const __NO_MATH_INLINES: u32 = 1; +pub const __FXSR__: u32 = 1; +pub const __SSE2__: u32 = 1; +pub const __SSE2_MATH__: u32 = 1; +pub const __SSE__: u32 = 1; +pub const __SSE_MATH__: u32 = 1; +pub const __MMX__: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8: u32 = 1; +pub const _WIN32: u32 = 1; +pub const _WIN64: u32 = 1; +pub const _MSC_VER: u32 = 1921; +pub const _MSC_FULL_VER: u32 = 192127702; +pub const _MSC_BUILD: u32 = 1; +pub const _MSC_EXTENSIONS: u32 = 1; +pub const _INTEGRAL_MAX_BITS: u32 = 64; +pub const _M_X64: u32 = 100; +pub const _M_AMD64: u32 = 100; +pub const __STDC_HOSTED__: u32 = 1; +pub const __STDC_VERSION__: u32 = 201112; +pub const __STDC_UTF_16__: u32 = 1; +pub const __STDC_UTF_32__: u32 = 1; +pub const _SAL_VERSION: u32 = 20; +pub const __SAL_H_VERSION: u32 = 180000000; +pub const _USE_DECLSPECS_FOR_SAL: u32 = 0; +pub const _USE_ATTRIBUTES_FOR_SAL: u32 = 0; +pub const _CRT_PACKING: u32 = 8; +pub const _HAS_EXCEPTIONS: u32 = 1; +pub const _ARGMAX: u32 = 100; +pub const _CRT_INT_MAX: u32 = 2147483647; +pub const _CRT_FUNCTIONS_REQUIRED: u32 = 1; +pub const _CRT_HAS_CXX17: u32 = 0; +pub const _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE: u32 = 1; +pub const _CRT_BUILD_DESKTOP_APP: u32 = 1; +pub const __STDC_SECURE_LIB__: u32 = 200411; +pub const __GOT_SECURE_LIB__: u32 = 200411; +pub const __STDC_WANT_SECURE_LIB__: u32 = 1; +pub const _SECURECRT_FILL_BUFFER_PATTERN: u32 = 254; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES: u32 = 1; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY: u32 = 0; +pub const EPERM: u32 = 1; +pub const ENOENT: u32 = 2; +pub const ESRCH: u32 = 3; +pub const EINTR: u32 = 4; +pub const EIO: u32 = 5; +pub const ENXIO: u32 = 6; +pub const E2BIG: u32 = 7; +pub const ENOEXEC: u32 = 8; +pub const EBADF: u32 = 9; +pub const ECHILD: u32 = 10; +pub const EAGAIN: u32 = 11; +pub const ENOMEM: u32 = 12; +pub const EACCES: u32 = 13; +pub const EFAULT: u32 = 14; +pub const EBUSY: u32 = 16; +pub const EEXIST: u32 = 17; +pub const EXDEV: u32 = 18; +pub const ENODEV: u32 = 19; +pub const ENOTDIR: u32 = 20; +pub const EISDIR: u32 = 21; +pub const ENFILE: u32 = 23; +pub const EMFILE: u32 = 24; +pub const ENOTTY: u32 = 25; +pub const EFBIG: u32 = 27; +pub const ENOSPC: u32 = 28; +pub const ESPIPE: u32 = 29; +pub const EROFS: u32 = 30; +pub const EMLINK: u32 = 31; +pub const EPIPE: u32 = 32; +pub const EDOM: u32 = 33; +pub const EDEADLK: u32 = 36; +pub const ENAMETOOLONG: u32 = 38; +pub const ENOLCK: u32 = 39; +pub const ENOSYS: u32 = 40; +pub const ENOTEMPTY: u32 = 41; +pub const EINVAL: u32 = 22; +pub const ERANGE: u32 = 34; +pub const EILSEQ: u32 = 42; +pub const STRUNCATE: u32 = 80; +pub const EDEADLOCK: u32 = 36; +pub const EADDRINUSE: u32 = 100; +pub const EADDRNOTAVAIL: u32 = 101; +pub const EAFNOSUPPORT: u32 = 102; +pub const EALREADY: u32 = 103; +pub const EBADMSG: u32 = 104; +pub const ECANCELED: u32 = 105; +pub const ECONNABORTED: u32 = 106; +pub const ECONNREFUSED: u32 = 107; +pub const ECONNRESET: u32 = 108; +pub const EDESTADDRREQ: u32 = 109; +pub const EHOSTUNREACH: u32 = 110; +pub const EIDRM: u32 = 111; +pub const EINPROGRESS: u32 = 112; +pub const EISCONN: u32 = 113; +pub const ELOOP: u32 = 114; +pub const EMSGSIZE: u32 = 115; +pub const ENETDOWN: u32 = 116; +pub const ENETRESET: u32 = 117; +pub const ENETUNREACH: u32 = 118; +pub const ENOBUFS: u32 = 119; +pub const ENODATA: u32 = 120; +pub const ENOLINK: u32 = 121; +pub const ENOMSG: u32 = 122; +pub const ENOPROTOOPT: u32 = 123; +pub const ENOSR: u32 = 124; +pub const ENOSTR: u32 = 125; +pub const ENOTCONN: u32 = 126; +pub const ENOTRECOVERABLE: u32 = 127; +pub const ENOTSOCK: u32 = 128; +pub const ENOTSUP: u32 = 129; +pub const EOPNOTSUPP: u32 = 130; +pub const EOTHER: u32 = 131; +pub const EOVERFLOW: u32 = 132; +pub const EOWNERDEAD: u32 = 133; +pub const EPROTO: u32 = 134; +pub const EPROTONOSUPPORT: u32 = 135; +pub const EPROTOTYPE: u32 = 136; +pub const ETIME: u32 = 137; +pub const ETIMEDOUT: u32 = 138; +pub const ETXTBSY: u32 = 139; +pub const EWOULDBLOCK: u32 = 140; +pub const _CRT_INTERNAL_STDIO_SYMBOL_PREFIX: &'static [u8; 1usize] = b"\0"; +pub const _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION: u32 = 1; +pub const _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR: u32 = 2; +pub const _CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS: u32 = 4; +pub const _CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY: u32 = 8; +pub const _CRT_INTERNAL_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS: u32 = 16; +pub const _CRT_INTERNAL_SCANF_SECURECRT: u32 = 1; +pub const _CRT_INTERNAL_SCANF_LEGACY_WIDE_SPECIFIERS: u32 = 2; +pub const _CRT_INTERNAL_SCANF_LEGACY_MSVCRT_COMPATIBILITY: u32 = 4; +pub const _UPPER: u32 = 1; +pub const _LOWER: u32 = 2; +pub const _DIGIT: u32 = 4; +pub const _SPACE: u32 = 8; +pub const _PUNCT: u32 = 16; +pub const _CONTROL: u32 = 32; +pub const _BLANK: u32 = 64; +pub const _HEX: u32 = 128; +pub const _LEADBYTE: u32 = 32768; +pub const _ALPHA: u32 = 259; +pub const _SH_DENYRW: u32 = 16; +pub const _SH_DENYWR: u32 = 32; +pub const _SH_DENYRD: u32 = 48; +pub const _SH_DENYNO: u32 = 64; +pub const _SH_SECURE: u32 = 128; +pub const SH_DENYRW: u32 = 16; +pub const SH_DENYWR: u32 = 32; +pub const SH_DENYRD: u32 = 48; +pub const SH_DENYNO: u32 = 64; +pub const _MAX_ITOSTR_BASE16_COUNT: u32 = 9; +pub const _MAX_ITOSTR_BASE10_COUNT: u32 = 12; +pub const _MAX_ITOSTR_BASE8_COUNT: u32 = 12; +pub const _MAX_ITOSTR_BASE2_COUNT: u32 = 33; +pub const _MAX_LTOSTR_BASE16_COUNT: u32 = 9; +pub const _MAX_LTOSTR_BASE10_COUNT: u32 = 12; +pub const _MAX_LTOSTR_BASE8_COUNT: u32 = 12; +pub const _MAX_LTOSTR_BASE2_COUNT: u32 = 33; +pub const _MAX_ULTOSTR_BASE16_COUNT: u32 = 9; +pub const _MAX_ULTOSTR_BASE10_COUNT: u32 = 11; +pub const _MAX_ULTOSTR_BASE8_COUNT: u32 = 12; +pub const _MAX_ULTOSTR_BASE2_COUNT: u32 = 33; +pub const _MAX_I64TOSTR_BASE16_COUNT: u32 = 17; +pub const _MAX_I64TOSTR_BASE10_COUNT: u32 = 21; +pub const _MAX_I64TOSTR_BASE8_COUNT: u32 = 23; +pub const _MAX_I64TOSTR_BASE2_COUNT: u32 = 65; +pub const _MAX_U64TOSTR_BASE16_COUNT: u32 = 17; +pub const _MAX_U64TOSTR_BASE10_COUNT: u32 = 21; +pub const _MAX_U64TOSTR_BASE8_COUNT: u32 = 23; +pub const _MAX_U64TOSTR_BASE2_COUNT: u32 = 65; +pub const _S_IFMT: u32 = 61440; +pub const _S_IFDIR: u32 = 16384; +pub const _S_IFCHR: u32 = 8192; +pub const _S_IFIFO: u32 = 4096; +pub const _S_IFREG: u32 = 32768; +pub const _S_IREAD: u32 = 256; +pub const _S_IWRITE: u32 = 128; +pub const _S_IEXEC: u32 = 64; +pub const S_IFMT: u32 = 61440; +pub const S_IFDIR: u32 = 16384; +pub const S_IFCHR: u32 = 8192; +pub const S_IFREG: u32 = 32768; +pub const S_IREAD: u32 = 256; +pub const S_IWRITE: u32 = 128; +pub const S_IEXEC: u32 = 64; +pub const WCHAR_MIN: u32 = 0; +pub const WCHAR_MAX: u32 = 65535; +pub const CHAR_BIT: u32 = 8; +pub const SCHAR_MIN: i32 = -128; +pub const SCHAR_MAX: u32 = 127; +pub const UCHAR_MAX: u32 = 255; +pub const CHAR_MIN: i32 = -128; +pub const CHAR_MAX: u32 = 127; +pub const MB_LEN_MAX: u32 = 5; +pub const SHRT_MIN: i32 = -32768; +pub const SHRT_MAX: u32 = 32767; +pub const USHRT_MAX: u32 = 65535; +pub const INT_MIN: i32 = -2147483648; +pub const INT_MAX: u32 = 2147483647; +pub const UINT_MAX: u32 = 4294967295; +pub const LONG_MIN: i32 = -2147483648; +pub const LONG_MAX: u32 = 2147483647; +pub const ULONG_MAX: u32 = 4294967295; +pub const LLONG_MAX: u64 = 9223372036854775807; +pub const LLONG_MIN: i64 = -9223372036854775808; +pub const ULLONG_MAX: i32 = -1; +pub const LONG_LONG_MAX: u64 = 9223372036854775807; +pub const LONG_LONG_MIN: i64 = -9223372036854775808; +pub const ULONG_LONG_MAX: i32 = -1; +pub const NSIG: u32 = 23; +pub const SIGINT: u32 = 2; +pub const SIGILL: u32 = 4; +pub const SIGFPE: u32 = 8; +pub const SIGSEGV: u32 = 11; +pub const SIGTERM: u32 = 15; +pub const SIGBREAK: u32 = 21; +pub const SIGABRT: u32 = 22; +pub const SIGABRT_COMPAT: u32 = 6; +pub const WINT_MIN: u32 = 0; +pub const WINT_MAX: u32 = 65535; +pub const PRINTF_INT64_MODIFIER: &'static [u8; 3usize] = b"ll\0"; +pub const PRINTF_INT32_MODIFIER: &'static [u8; 1usize] = b"\0"; +pub const PRINTF_INT16_MODIFIER: &'static [u8; 2usize] = b"h\0"; +pub const PRINTF_INTMAX_MODIFIER: &'static [u8; 3usize] = b"ll\0"; +pub const PRINTF_INT64_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; +pub const PRINTF_UINT64_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; +pub const PRINTF_INT32_HEX_WIDTH: &'static [u8; 2usize] = b"8\0"; +pub const PRINTF_UINT32_HEX_WIDTH: &'static [u8; 2usize] = b"8\0"; +pub const PRINTF_INT16_HEX_WIDTH: &'static [u8; 2usize] = b"4\0"; +pub const PRINTF_UINT16_HEX_WIDTH: &'static [u8; 2usize] = b"4\0"; +pub const PRINTF_INT8_HEX_WIDTH: &'static [u8; 2usize] = b"2\0"; +pub const PRINTF_UINT8_HEX_WIDTH: &'static [u8; 2usize] = b"2\0"; +pub const PRINTF_INT64_DEC_WIDTH: &'static [u8; 3usize] = b"19\0"; +pub const PRINTF_UINT64_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; +pub const PRINTF_INT32_DEC_WIDTH: &'static [u8; 3usize] = b"10\0"; +pub const PRINTF_UINT32_DEC_WIDTH: &'static [u8; 3usize] = b"10\0"; +pub const PRINTF_INT16_DEC_WIDTH: &'static [u8; 2usize] = b"5\0"; +pub const PRINTF_UINT16_DEC_WIDTH: &'static [u8; 2usize] = b"5\0"; +pub const PRINTF_INT8_DEC_WIDTH: &'static [u8; 2usize] = b"3\0"; +pub const PRINTF_UINT8_DEC_WIDTH: &'static [u8; 2usize] = b"3\0"; +pub const PRINTF_INTMAX_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; +pub const PRINTF_UINTMAX_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; +pub const PRINTF_INTMAX_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; +pub const PRINTF_UINTMAX_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; +pub const true_: u32 = 1; +pub const false_: u32 = 0; +pub const __bool_true_false_are_defined: u32 = 1; +pub const TCOD_HEXVERSION: u32 = 67075; +pub const TCOD_STRVERSION: &'static [u8; 6usize] = b"1.6.3\0"; +pub const TCOD_TECHVERSION: u32 = 17171200; +pub const TCOD_STRVERSIONNAME: &'static [u8; 14usize] = b"libtcod 1.6.3\0"; +pub const TCOD_KEY_TEXT_SIZE: u32 = 32; +pub const TCOD_NOISE_MAX_OCTAVES: u32 = 128; +pub const TCOD_NOISE_MAX_DIMENSIONS: u32 = 4; +pub const TCOD_NOISE_DEFAULT_HURST: f64 = 0.5; +pub const TCOD_NOISE_DEFAULT_LACUNARITY: f64 = 2.0; +pub const TCOD_LEX_FLAG_NOCASE: u32 = 1; +pub const TCOD_LEX_FLAG_NESTING_COMMENT: u32 = 2; +pub const TCOD_LEX_FLAG_TOKENIZE_COMMENTS: u32 = 4; +pub const TCOD_LEX_ERROR: i32 = -1; +pub const TCOD_LEX_UNKNOWN: u32 = 0; +pub const TCOD_LEX_SYMBOL: u32 = 1; +pub const TCOD_LEX_KEYWORD: u32 = 2; +pub const TCOD_LEX_IDEN: u32 = 3; +pub const TCOD_LEX_STRING: u32 = 4; +pub const TCOD_LEX_INTEGER: u32 = 5; +pub const TCOD_LEX_FLOAT: u32 = 6; +pub const TCOD_LEX_CHAR: u32 = 7; +pub const TCOD_LEX_EOF: u32 = 8; +pub const TCOD_LEX_COMMENT: u32 = 9; +pub const TCOD_LEX_MAX_SYMBOLS: u32 = 100; +pub const TCOD_LEX_SYMBOL_SIZE: u32 = 5; +pub const TCOD_LEX_MAX_KEYWORDS: u32 = 100; +pub const TCOD_LEX_KEYWORD_SIZE: u32 = 20; +pub type va_list = *mut ::std::os::raw::c_char; +extern "C" { + pub fn __va_start(arg1: *mut *mut ::std::os::raw::c_char, ...); +} +pub type size_t = ::std::os::raw::c_ulonglong; +pub type __vcrt_bool = bool; +pub type wchar_t = ::std::os::raw::c_ushort; +extern "C" { + pub fn __security_init_cookie(); +} +extern "C" { + pub fn __security_check_cookie(_StackCookie: usize); +} +extern "C" { + pub fn __report_gsfailure(_StackCookie: usize); +} +extern "C" { + pub static mut __security_cookie: usize; +} +pub type __crt_bool = bool; +extern "C" { + pub fn _invalid_parameter_noinfo(); +} +extern "C" { + pub fn _invalid_parameter_noinfo_noreturn(); +} +extern "C" { + pub fn _invoke_watson( + _Expression: *const wchar_t, + _FunctionName: *const wchar_t, + _FileName: *const wchar_t, + _LineNo: ::std::os::raw::c_uint, + _Reserved: usize, + ); +} +pub type errno_t = ::std::os::raw::c_int; +pub type wint_t = ::std::os::raw::c_ushort; +pub type wctype_t = ::std::os::raw::c_ushort; +pub type __time32_t = ::std::os::raw::c_long; +pub type __time64_t = ::std::os::raw::c_longlong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __crt_locale_data_public { + pub _locale_pctype: *const ::std::os::raw::c_ushort, + pub _locale_mb_cur_max: ::std::os::raw::c_int, + pub _locale_lc_codepage: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout___crt_locale_data_public() { + assert_eq!( + ::std::mem::size_of::<__crt_locale_data_public>(), + 16usize, + concat!("Size of: ", stringify!(__crt_locale_data_public)) + ); + assert_eq!( + ::std::mem::align_of::<__crt_locale_data_public>(), + 8usize, + concat!("Alignment of ", stringify!(__crt_locale_data_public)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__crt_locale_data_public>()))._locale_pctype as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_data_public), + "::", + stringify!(_locale_pctype) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__crt_locale_data_public>()))._locale_mb_cur_max as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_data_public), + "::", + stringify!(_locale_mb_cur_max) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__crt_locale_data_public>()))._locale_lc_codepage as *const _ + as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_data_public), + "::", + stringify!(_locale_lc_codepage) + ) + ); +} +impl Default for __crt_locale_data_public { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __crt_locale_pointers { + pub locinfo: *mut __crt_locale_data, + pub mbcinfo: *mut __crt_multibyte_data, +} +#[test] +fn bindgen_test_layout___crt_locale_pointers() { + assert_eq!( + ::std::mem::size_of::<__crt_locale_pointers>(), + 16usize, + concat!("Size of: ", stringify!(__crt_locale_pointers)) + ); + assert_eq!( + ::std::mem::align_of::<__crt_locale_pointers>(), + 8usize, + concat!("Alignment of ", stringify!(__crt_locale_pointers)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__crt_locale_pointers>())).locinfo as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_pointers), + "::", + stringify!(locinfo) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__crt_locale_pointers>())).mbcinfo as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_pointers), + "::", + stringify!(mbcinfo) + ) + ); +} +impl Default for __crt_locale_pointers { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type _locale_t = *mut __crt_locale_pointers; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _Mbstatet { + pub _Wchar: ::std::os::raw::c_ulong, + pub _Byte: ::std::os::raw::c_ushort, + pub _State: ::std::os::raw::c_ushort, +} +#[test] +fn bindgen_test_layout__Mbstatet() { + assert_eq!( + ::std::mem::size_of::<_Mbstatet>(), + 8usize, + concat!("Size of: ", stringify!(_Mbstatet)) + ); + assert_eq!( + ::std::mem::align_of::<_Mbstatet>(), + 4usize, + concat!("Alignment of ", stringify!(_Mbstatet)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_Mbstatet>()))._Wchar as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_Mbstatet), + "::", + stringify!(_Wchar) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_Mbstatet>()))._Byte as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_Mbstatet), + "::", + stringify!(_Byte) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_Mbstatet>()))._State as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_Mbstatet), + "::", + stringify!(_State) + ) + ); +} +pub type mbstate_t = _Mbstatet; +pub type time_t = __time64_t; +pub type rsize_t = size_t; +extern "C" { + pub fn _errno() -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn _set_errno(_Value: ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn _get_errno(_Value: *mut ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn __doserrno() -> *mut ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _set_doserrno(_Value: ::std::os::raw::c_ulong) -> errno_t; +} +extern "C" { + pub fn _get_doserrno(_Value: *mut ::std::os::raw::c_ulong) -> errno_t; +} +extern "C" { + pub fn memchr( + _Buf: *const ::std::os::raw::c_void, + _Val: ::std::os::raw::c_int, + _MaxCount: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memcmp( + _Buf1: *const ::std::os::raw::c_void, + _Buf2: *const ::std::os::raw::c_void, + _Size: ::std::os::raw::c_ulonglong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn memcpy( + _Dst: *mut ::std::os::raw::c_void, + _Src: *const ::std::os::raw::c_void, + _Size: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memmove( + _Dst: *mut ::std::os::raw::c_void, + _Src: *const ::std::os::raw::c_void, + _Size: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memset( + _Dst: *mut ::std::os::raw::c_void, + _Val: ::std::os::raw::c_int, + _Size: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn strchr( + _Str: *const ::std::os::raw::c_char, + _Val: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strrchr( + _Str: *const ::std::os::raw::c_char, + _Ch: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strstr( + _Str: *const ::std::os::raw::c_char, + _SubStr: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn wcschr( + _Str: *const ::std::os::raw::c_ushort, + _Ch: ::std::os::raw::c_ushort, + ) -> *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub fn wcsrchr(_Str: *const wchar_t, _Ch: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsstr(_Str: *const wchar_t, _SubStr: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _cgetws_s( + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _SizeRead: *mut size_t, + ) -> errno_t; +} +extern "C" { + pub fn _cputws(_Buffer: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _getwch() -> wint_t; +} +extern "C" { + pub fn _getwche() -> wint_t; +} +extern "C" { + pub fn _putwch(_Character: wchar_t) -> wint_t; +} +extern "C" { + pub fn _ungetwch(_Character: wint_t) -> wint_t; +} +extern "C" { + pub fn _getwch_nolock() -> wint_t; +} +extern "C" { + pub fn _getwche_nolock() -> wint_t; +} +extern "C" { + pub fn _putwch_nolock(_Character: wchar_t) -> wint_t; +} +extern "C" { + pub fn _ungetwch_nolock(_Character: wint_t) -> wint_t; +} +extern "C" { + pub fn __conio_common_vcwprintf( + _Options: ::std::os::raw::c_ulonglong, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __conio_common_vcwprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __conio_common_vcwprintf_p( + _Options: ::std::os::raw::c_ulonglong, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __conio_common_vcwscanf( + _Options: ::std::os::raw::c_ulonglong, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __pctype_func() -> *const ::std::os::raw::c_ushort; +} +extern "C" { + pub fn __pwctype_func() -> *const wctype_t; +} +extern "C" { + pub fn iswalnum(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswalpha(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswascii(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswblank(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswcntrl(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswdigit(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswgraph(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswlower(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswprint(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswpunct(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswspace(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswupper(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswxdigit(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __iswcsymf(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __iswcsym(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswalnum_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswalpha_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswblank_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswcntrl_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswdigit_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswgraph_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswlower_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswprint_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswpunct_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswspace_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswupper_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswxdigit_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswcsymf_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswcsym_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn towupper(_C: wint_t) -> wint_t; +} +extern "C" { + pub fn towlower(_C: wint_t) -> wint_t; +} +extern "C" { + pub fn iswctype(_C: wint_t, _Type: wctype_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _towupper_l(_C: wint_t, _Locale: _locale_t) -> wint_t; +} +extern "C" { + pub fn _towlower_l(_C: wint_t, _Locale: _locale_t) -> wint_t; +} +extern "C" { + pub fn _iswctype_l(_C: wint_t, _Type: wctype_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn isleadbyte(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _isleadbyte_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn is_wctype(_C: wint_t, _Type: wctype_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wgetcwd(_DstBuf: *mut wchar_t, _SizeInWords: ::std::os::raw::c_int) -> *mut wchar_t; +} +extern "C" { + pub fn _wgetdcwd( + _Drive: ::std::os::raw::c_int, + _DstBuf: *mut wchar_t, + _SizeInWords: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wchdir(_Path: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wmkdir(_Path: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wrmdir(_Path: *const wchar_t) -> ::std::os::raw::c_int; +} +pub type _fsize_t = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _wfinddata32_t { + pub attrib: ::std::os::raw::c_uint, + pub time_create: __time32_t, + pub time_access: __time32_t, + pub time_write: __time32_t, + pub size: _fsize_t, + pub name: [wchar_t; 260usize], +} +#[test] +fn bindgen_test_layout__wfinddata32_t() { + assert_eq!( + ::std::mem::size_of::<_wfinddata32_t>(), + 540usize, + concat!("Size of: ", stringify!(_wfinddata32_t)) + ); + assert_eq!( + ::std::mem::align_of::<_wfinddata32_t>(), + 4usize, + concat!("Alignment of ", stringify!(_wfinddata32_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).attrib as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(attrib) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).time_create as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(time_create) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).time_access as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(time_access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).time_write as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(time_write) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).size as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).name as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(name) + ) + ); +} +impl Default for _wfinddata32_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _wfinddata32i64_t { + pub attrib: ::std::os::raw::c_uint, + pub time_create: __time32_t, + pub time_access: __time32_t, + pub time_write: __time32_t, + pub size: ::std::os::raw::c_longlong, + pub name: [wchar_t; 260usize], +} +#[test] +fn bindgen_test_layout__wfinddata32i64_t() { + assert_eq!( + ::std::mem::size_of::<_wfinddata32i64_t>(), + 544usize, + concat!("Size of: ", stringify!(_wfinddata32i64_t)) + ); + assert_eq!( + ::std::mem::align_of::<_wfinddata32i64_t>(), + 8usize, + concat!("Alignment of ", stringify!(_wfinddata32i64_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).attrib as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(attrib) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).time_create as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(time_create) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).time_access as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(time_access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).time_write as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(time_write) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).size as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).name as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(name) + ) + ); +} +impl Default for _wfinddata32i64_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _wfinddata64i32_t { + pub attrib: ::std::os::raw::c_uint, + pub time_create: __time64_t, + pub time_access: __time64_t, + pub time_write: __time64_t, + pub size: _fsize_t, + pub name: [wchar_t; 260usize], +} +#[test] +fn bindgen_test_layout__wfinddata64i32_t() { + assert_eq!( + ::std::mem::size_of::<_wfinddata64i32_t>(), + 560usize, + concat!("Size of: ", stringify!(_wfinddata64i32_t)) + ); + assert_eq!( + ::std::mem::align_of::<_wfinddata64i32_t>(), + 8usize, + concat!("Alignment of ", stringify!(_wfinddata64i32_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).attrib as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(attrib) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).time_create as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(time_create) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).time_access as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(time_access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).time_write as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(time_write) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).size as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).name as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(name) + ) + ); +} +impl Default for _wfinddata64i32_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _wfinddata64_t { + pub attrib: ::std::os::raw::c_uint, + pub time_create: __time64_t, + pub time_access: __time64_t, + pub time_write: __time64_t, + pub size: ::std::os::raw::c_longlong, + pub name: [wchar_t; 260usize], +} +#[test] +fn bindgen_test_layout__wfinddata64_t() { + assert_eq!( + ::std::mem::size_of::<_wfinddata64_t>(), + 560usize, + concat!("Size of: ", stringify!(_wfinddata64_t)) + ); + assert_eq!( + ::std::mem::align_of::<_wfinddata64_t>(), + 8usize, + concat!("Alignment of ", stringify!(_wfinddata64_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).attrib as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(attrib) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).time_create as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(time_create) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).time_access as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(time_access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).time_write as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(time_write) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).size as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).name as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(name) + ) + ); +} +impl Default for _wfinddata64_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn _waccess( + _FileName: *const wchar_t, + _AccessMode: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _waccess_s(_FileName: *const wchar_t, _AccessMode: ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn _wchmod( + _FileName: *const wchar_t, + _Mode: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcreat( + _FileName: *const wchar_t, + _PermissionMode: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfindfirst32(_FileName: *const wchar_t, _FindData: *mut _wfinddata32_t) -> isize; +} +extern "C" { + pub fn _wfindnext32( + _FindHandle: isize, + _FindData: *mut _wfinddata32_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wunlink(_FileName: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wrename( + _OldFileName: *const wchar_t, + _NewFileName: *const wchar_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wmktemp_s(_TemplateName: *mut wchar_t, _SizeInWords: size_t) -> errno_t; +} +extern "C" { + pub fn _wmktemp(_TemplateName: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wfindfirst32i64(_FileName: *const wchar_t, _FindData: *mut _wfinddata32i64_t) -> isize; +} +extern "C" { + pub fn _wfindfirst64i32(_FileName: *const wchar_t, _FindData: *mut _wfinddata64i32_t) -> isize; +} +extern "C" { + pub fn _wfindfirst64(_FileName: *const wchar_t, _FindData: *mut _wfinddata64_t) -> isize; +} +extern "C" { + pub fn _wfindnext32i64( + _FindHandle: isize, + _FindData: *mut _wfinddata32i64_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfindnext64i32( + _FindHandle: isize, + _FindData: *mut _wfinddata64i32_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfindnext64( + _FindHandle: isize, + _FindData: *mut _wfinddata64_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wsopen_s( + _FileHandle: *mut ::std::os::raw::c_int, + _FileName: *const wchar_t, + _OpenFlag: ::std::os::raw::c_int, + _ShareFlag: ::std::os::raw::c_int, + _PermissionFlag: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _wsopen_dispatch( + _FileName: *const wchar_t, + _OFlag: ::std::os::raw::c_int, + _ShFlag: ::std::os::raw::c_int, + _PMode: ::std::os::raw::c_int, + _PFileHandle: *mut ::std::os::raw::c_int, + _BSecure: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _wopen( + _FileName: *const wchar_t, + _OpenFlag: ::std::os::raw::c_int, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wsopen( + _FileName: *const wchar_t, + _OpenFlag: ::std::os::raw::c_int, + _ShareFlag: ::std::os::raw::c_int, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wexecl(_FileName: *const wchar_t, _ArgList: *const wchar_t, ...) -> isize; +} +extern "C" { + pub fn _wexecle(_FileName: *const wchar_t, _ArgList: *const wchar_t, ...) -> isize; +} +extern "C" { + pub fn _wexeclp(_FileName: *const wchar_t, _ArgList: *const wchar_t, ...) -> isize; +} +extern "C" { + pub fn _wexeclpe(_FileName: *const wchar_t, _ArgList: *const wchar_t, ...) -> isize; +} +extern "C" { + pub fn _wexecv(_FileName: *const wchar_t, _ArgList: *const *const wchar_t) -> isize; +} +extern "C" { + pub fn _wexecve( + _FileName: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wexecvp(_FileName: *const wchar_t, _ArgList: *const *const wchar_t) -> isize; +} +extern "C" { + pub fn _wexecvpe( + _FileName: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnl( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnle( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnlp( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnlpe( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnv( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnve( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnvp( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnvpe( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wsystem(_Command: *const wchar_t) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _iobuf { + pub _Placeholder: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout__iobuf() { + assert_eq!( + ::std::mem::size_of::<_iobuf>(), + 8usize, + concat!("Size of: ", stringify!(_iobuf)) + ); + assert_eq!( + ::std::mem::align_of::<_iobuf>(), + 8usize, + concat!("Alignment of ", stringify!(_iobuf)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iobuf>()))._Placeholder as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_iobuf), + "::", + stringify!(_Placeholder) + ) + ); +} +impl Default for _iobuf { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type FILE = _iobuf; +extern "C" { + pub fn __acrt_iob_func(_Ix: ::std::os::raw::c_uint) -> *mut FILE; +} +extern "C" { + pub fn fgetwc(_Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fgetwchar() -> wint_t; +} +extern "C" { + pub fn fputwc(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fputwchar(_Character: wchar_t) -> wint_t; +} +extern "C" { + pub fn getwc(_Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn getwchar() -> wint_t; +} +extern "C" { + pub fn fgetws( + _Buffer: *mut wchar_t, + _BufferCount: ::std::os::raw::c_int, + _Stream: *mut FILE, + ) -> *mut wchar_t; +} +extern "C" { + pub fn fputws(_Buffer: *const wchar_t, _Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _getws_s(_Buffer: *mut wchar_t, _BufferCount: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn putwc(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn putwchar(_Character: wchar_t) -> wint_t; +} +extern "C" { + pub fn _putws(_Buffer: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ungetwc(_Character: wint_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _wfdopen(_FileHandle: ::std::os::raw::c_int, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wfopen(_FileName: *const wchar_t, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wfopen_s( + _Stream: *mut *mut FILE, + _FileName: *const wchar_t, + _Mode: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wfreopen( + _FileName: *const wchar_t, + _Mode: *const wchar_t, + _OldStream: *mut FILE, + ) -> *mut FILE; +} +extern "C" { + pub fn _wfreopen_s( + _Stream: *mut *mut FILE, + _FileName: *const wchar_t, + _Mode: *const wchar_t, + _OldStream: *mut FILE, + ) -> errno_t; +} +extern "C" { + pub fn _wfsopen( + _FileName: *const wchar_t, + _Mode: *const wchar_t, + _ShFlag: ::std::os::raw::c_int, + ) -> *mut FILE; +} +extern "C" { + pub fn _wperror(_ErrorMessage: *const wchar_t); +} +extern "C" { + pub fn _wpopen(_Command: *const wchar_t, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wremove(_FileName: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtempnam(_Directory: *const wchar_t, _FilePrefix: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wtmpnam_s(_Buffer: *mut wchar_t, _BufferCount: size_t) -> errno_t; +} +extern "C" { + pub fn _wtmpnam(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _fgetwc_nolock(_Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fputwc_nolock(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _getwc_nolock(_Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _putwc_nolock(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _ungetwc_nolock(_Character: wint_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn __stdio_common_vfwprintf( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vfwprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vfwprintf_p( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vfwscanf( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vswprintf( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vswprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vsnwprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vswprintf_p( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vswscanf( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *const wchar_t, + _BufferCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _itow_s( + _Value: ::std::os::raw::c_int, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _itow( + _Value: ::std::os::raw::c_int, + _Buffer: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _ltow_s( + _Value: ::std::os::raw::c_long, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ltow( + _Value: ::std::os::raw::c_long, + _Buffer: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _ultow_s( + _Value: ::std::os::raw::c_ulong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ultow( + _Value: ::std::os::raw::c_ulong, + _Buffer: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn wcstod(_String: *const wchar_t, _EndPtr: *mut *mut wchar_t) -> f64; +} +extern "C" { + pub fn _wcstod_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Locale: _locale_t, + ) -> f64; +} +extern "C" { + pub fn wcstol( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _wcstol_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn wcstoll( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoll_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn wcstoul( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _wcstoul_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn wcstoull( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _wcstoull_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn wcstold(_String: *const wchar_t, _EndPtr: *mut *mut wchar_t) -> f64; +} +extern "C" { + pub fn _wcstold_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Locale: _locale_t, + ) -> f64; +} +extern "C" { + pub fn wcstof(_String: *const wchar_t, _EndPtr: *mut *mut wchar_t) -> f32; +} +extern "C" { + pub fn _wcstof_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Locale: _locale_t, + ) -> f32; +} +extern "C" { + pub fn _wtof(_String: *const wchar_t) -> f64; +} +extern "C" { + pub fn _wtof_l(_String: *const wchar_t, _Locale: _locale_t) -> f64; +} +extern "C" { + pub fn _wtoi(_String: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtoi_l(_String: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtol(_String: *const wchar_t) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _wtol_l(_String: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _wtoll(_String: *const wchar_t) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wtoll_l(_String: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _i64tow_s( + _Value: ::std::os::raw::c_longlong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _i64tow( + _Value: ::std::os::raw::c_longlong, + _Buffer: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _ui64tow_s( + _Value: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ui64tow( + _Value: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wtoi64(_String: *const wchar_t) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wtoi64_l(_String: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoi64( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoi64_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoui64( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _wcstoui64_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _wfullpath( + _Buffer: *mut wchar_t, + _Path: *const wchar_t, + _BufferCount: size_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wmakepath_s( + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Drive: *const wchar_t, + _Dir: *const wchar_t, + _Filename: *const wchar_t, + _Ext: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wmakepath( + _Buffer: *mut wchar_t, + _Drive: *const wchar_t, + _Dir: *const wchar_t, + _Filename: *const wchar_t, + _Ext: *const wchar_t, + ); +} +extern "C" { + pub fn _wsplitpath( + _FullPath: *const wchar_t, + _Drive: *mut wchar_t, + _Dir: *mut wchar_t, + _Filename: *mut wchar_t, + _Ext: *mut wchar_t, + ); +} +extern "C" { + pub fn _wsplitpath_s( + _FullPath: *const wchar_t, + _Drive: *mut wchar_t, + _DriveCount: size_t, + _Dir: *mut wchar_t, + _DirCount: size_t, + _Filename: *mut wchar_t, + _FilenameCount: size_t, + _Ext: *mut wchar_t, + _ExtCount: size_t, + ) -> errno_t; +} +extern "C" { + pub fn _wdupenv_s( + _Buffer: *mut *mut wchar_t, + _BufferCount: *mut size_t, + _VarName: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wgetenv(_VarName: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wgetenv_s( + _RequiredCount: *mut size_t, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _VarName: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wputenv(_EnvString: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wputenv_s(_Name: *const wchar_t, _Value: *const wchar_t) -> errno_t; +} +extern "C" { + pub fn _wsearchenv_s( + _Filename: *const wchar_t, + _VarName: *const wchar_t, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + ) -> errno_t; +} +extern "C" { + pub fn _wsearchenv( + _Filename: *const wchar_t, + _VarName: *const wchar_t, + _ResultPath: *mut wchar_t, + ); +} +extern "C" { + pub fn wcscat_s( + _Destination: *mut wchar_t, + _SizeInWords: rsize_t, + _Source: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn wcscpy_s( + _Destination: *mut wchar_t, + _SizeInWords: rsize_t, + _Source: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn wcsncat_s( + _Destination: *mut wchar_t, + _SizeInWords: rsize_t, + _Source: *const wchar_t, + _MaxCount: rsize_t, + ) -> errno_t; +} +extern "C" { + pub fn wcsncpy_s( + _Destination: *mut wchar_t, + _SizeInWords: rsize_t, + _Source: *const wchar_t, + _MaxCount: rsize_t, + ) -> errno_t; +} +extern "C" { + pub fn wcstok_s( + _String: *mut wchar_t, + _Delimiter: *const wchar_t, + _Context: *mut *mut wchar_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsdup(_String: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscat(_Destination: *mut wchar_t, _Source: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscmp( + _String1: *const ::std::os::raw::c_ushort, + _String2: *const ::std::os::raw::c_ushort, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcscpy(_Destination: *mut wchar_t, _Source: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscspn(_String: *const wchar_t, _Control: *const wchar_t) -> size_t; +} +extern "C" { + pub fn wcslen(_String: *const ::std::os::raw::c_ushort) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn wcsnlen(_Source: *const wchar_t, _MaxCount: size_t) -> size_t; +} +extern "C" { + pub fn wcsncat( + _Destination: *mut wchar_t, + _Source: *const wchar_t, + _Count: size_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn wcsncmp( + _String1: *const ::std::os::raw::c_ushort, + _String2: *const ::std::os::raw::c_ushort, + _MaxCount: ::std::os::raw::c_ulonglong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsncpy( + _Destination: *mut wchar_t, + _Source: *const wchar_t, + _Count: size_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn wcspbrk(_String: *const wchar_t, _Control: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsspn(_String: *const wchar_t, _Control: *const wchar_t) -> size_t; +} +extern "C" { + pub fn wcstok( + _String: *mut wchar_t, + _Delimiter: *const wchar_t, + _Context: *mut *mut wchar_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wcserror(_ErrorNumber: ::std::os::raw::c_int) -> *mut wchar_t; +} +extern "C" { + pub fn _wcserror_s( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _ErrorNumber: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn __wcserror(_String: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn __wcserror_s( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _ErrorMessage: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wcsicmp(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsicmp_l( + _String1: *const wchar_t, + _String2: *const wchar_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicmp( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicmp_l( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnset_s( + _Destination: *mut wchar_t, + _SizeInWords: size_t, + _Value: wchar_t, + _MaxCount: size_t, + ) -> errno_t; +} +extern "C" { + pub fn _wcsnset(_String: *mut wchar_t, _Value: wchar_t, _MaxCount: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsrev(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsset_s(_Destination: *mut wchar_t, _SizeInWords: size_t, _Value: wchar_t) -> errno_t; +} +extern "C" { + pub fn _wcsset(_String: *mut wchar_t, _Value: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcslwr_s(_String: *mut wchar_t, _SizeInWords: size_t) -> errno_t; +} +extern "C" { + pub fn _wcslwr(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcslwr_s_l(_String: *mut wchar_t, _SizeInWords: size_t, _Locale: _locale_t) -> errno_t; +} +extern "C" { + pub fn _wcslwr_l(_String: *mut wchar_t, _Locale: _locale_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsupr_s(_String: *mut wchar_t, _Size: size_t) -> errno_t; +} +extern "C" { + pub fn _wcsupr(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsupr_s_l(_String: *mut wchar_t, _Size: size_t, _Locale: _locale_t) -> errno_t; +} +extern "C" { + pub fn _wcsupr_l(_String: *mut wchar_t, _Locale: _locale_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsxfrm( + _Destination: *mut wchar_t, + _Source: *const wchar_t, + _MaxCount: size_t, + ) -> size_t; +} +extern "C" { + pub fn _wcsxfrm_l( + _Destination: *mut wchar_t, + _Source: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> size_t; +} +extern "C" { + pub fn wcscoll(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcscoll_l( + _String1: *const wchar_t, + _String2: *const wchar_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsicoll(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsicoll_l( + _String1: *const wchar_t, + _String2: *const wchar_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsncoll( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsncoll_l( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicoll( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicoll_l( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsdup(_String: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsicmp(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsnicmp( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsnset(_String: *mut wchar_t, _Value: wchar_t, _MaxCount: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsrev(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsset(_String: *mut wchar_t, _Value: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcslwr(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsupr(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsicoll(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct tm { + pub tm_sec: ::std::os::raw::c_int, + pub tm_min: ::std::os::raw::c_int, + pub tm_hour: ::std::os::raw::c_int, + pub tm_mday: ::std::os::raw::c_int, + pub tm_mon: ::std::os::raw::c_int, + pub tm_year: ::std::os::raw::c_int, + pub tm_wday: ::std::os::raw::c_int, + pub tm_yday: ::std::os::raw::c_int, + pub tm_isdst: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_tm() { + assert_eq!( + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(tm)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(tm)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_sec as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_sec) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_min as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_min) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_hour as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_hour) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_mday as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mday) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_mon as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mon) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_year as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_year) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_wday as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_wday) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_yday as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_yday) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_isdst as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_isdst) + ) + ); +} +extern "C" { + pub fn _wasctime(_Tm: *const tm) -> *mut wchar_t; +} +extern "C" { + pub fn _wasctime_s(_Buffer: *mut wchar_t, _SizeInWords: size_t, _Tm: *const tm) -> errno_t; +} +extern "C" { + pub fn wcsftime( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _Format: *const wchar_t, + _Tm: *const tm, + ) -> size_t; +} +extern "C" { + pub fn _wcsftime_l( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _Format: *const wchar_t, + _Tm: *const tm, + _Locale: _locale_t, + ) -> size_t; +} +extern "C" { + pub fn _wctime32(_Time: *const __time32_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wctime32_s( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _Time: *const __time32_t, + ) -> errno_t; +} +extern "C" { + pub fn _wctime64(_Time: *const __time64_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wctime64_s( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _Time: *const __time64_t, + ) -> errno_t; +} +extern "C" { + pub fn _wstrdate_s(_Buffer: *mut wchar_t, _SizeInWords: size_t) -> errno_t; +} +extern "C" { + pub fn _wstrdate(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wstrtime_s(_Buffer: *mut wchar_t, _SizeInWords: size_t) -> errno_t; +} +extern "C" { + pub fn _wstrtime(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +pub type _ino_t = ::std::os::raw::c_ushort; +pub type ino_t = _ino_t; +pub type _dev_t = ::std::os::raw::c_uint; +pub type dev_t = _dev_t; +pub type _off_t = ::std::os::raw::c_long; +pub type off_t = _off_t; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _stat32 { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: _off_t, + pub st_atime: __time32_t, + pub st_mtime: __time32_t, + pub st_ctime: __time32_t, +} +#[test] +fn bindgen_test_layout__stat32() { + assert_eq!( + ::std::mem::size_of::<_stat32>(), + 36usize, + concat!("Size of: ", stringify!(_stat32)) + ); + assert_eq!( + ::std::mem::align_of::<_stat32>(), + 4usize, + concat!("Alignment of ", stringify!(_stat32)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_size as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_atime as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_mtime as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_ctime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_ctime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _stat32i64 { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: ::std::os::raw::c_longlong, + pub st_atime: __time32_t, + pub st_mtime: __time32_t, + pub st_ctime: __time32_t, +} +#[test] +fn bindgen_test_layout__stat32i64() { + assert_eq!( + ::std::mem::size_of::<_stat32i64>(), + 48usize, + concat!("Size of: ", stringify!(_stat32i64)) + ); + assert_eq!( + ::std::mem::align_of::<_stat32i64>(), + 8usize, + concat!("Alignment of ", stringify!(_stat32i64)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_size as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_atime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_mtime as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_ctime as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_ctime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _stat64i32 { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: _off_t, + pub st_atime: __time64_t, + pub st_mtime: __time64_t, + pub st_ctime: __time64_t, +} +#[test] +fn bindgen_test_layout__stat64i32() { + assert_eq!( + ::std::mem::size_of::<_stat64i32>(), + 48usize, + concat!("Size of: ", stringify!(_stat64i32)) + ); + assert_eq!( + ::std::mem::align_of::<_stat64i32>(), + 8usize, + concat!("Alignment of ", stringify!(_stat64i32)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_size as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_atime as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_mtime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_ctime as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_ctime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _stat64 { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: ::std::os::raw::c_longlong, + pub st_atime: __time64_t, + pub st_mtime: __time64_t, + pub st_ctime: __time64_t, +} +#[test] +fn bindgen_test_layout__stat64() { + assert_eq!( + ::std::mem::size_of::<_stat64>(), + 56usize, + concat!("Size of: ", stringify!(_stat64)) + ); + assert_eq!( + ::std::mem::align_of::<_stat64>(), + 8usize, + concat!("Alignment of ", stringify!(_stat64)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_size as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_atime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_mtime as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_ctime as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_ctime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct stat { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: _off_t, + pub st_atime: time_t, + pub st_mtime: time_t, + pub st_ctime: time_t, +} +#[test] +fn bindgen_test_layout_stat() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(stat)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(stat)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_size as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_atime as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_mtime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_ctime as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_ctime) + ) + ); +} +extern "C" { + pub fn _fstat32( + _FileHandle: ::std::os::raw::c_int, + _Stat: *mut _stat32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fstat32i64( + _FileHandle: ::std::os::raw::c_int, + _Stat: *mut _stat32i64, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fstat64i32( + _FileHandle: ::std::os::raw::c_int, + _Stat: *mut _stat64i32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fstat64( + _FileHandle: ::std::os::raw::c_int, + _Stat: *mut _stat64, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _stat32( + _FileName: *const ::std::os::raw::c_char, + _Stat: *mut _stat32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _stat32i64( + _FileName: *const ::std::os::raw::c_char, + _Stat: *mut _stat32i64, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _stat64i32( + _FileName: *const ::std::os::raw::c_char, + _Stat: *mut _stat64i32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _stat64( + _FileName: *const ::std::os::raw::c_char, + _Stat: *mut _stat64, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wstat32(_FileName: *const wchar_t, _Stat: *mut _stat32) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wstat32i64(_FileName: *const wchar_t, _Stat: *mut _stat32i64) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wstat64i32(_FileName: *const wchar_t, _Stat: *mut _stat64i32) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wstat64(_FileName: *const wchar_t, _Stat: *mut _stat64) -> ::std::os::raw::c_int; +} +pub type _Wint_t = wchar_t; +extern "C" { + pub fn _wsetlocale(_Category: ::std::os::raw::c_int, _Locale: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcreate_locale(_Category: ::std::os::raw::c_int, _Locale: *const wchar_t) -> _locale_t; +} +extern "C" { + pub fn btowc(_Ch: ::std::os::raw::c_int) -> wint_t; +} +extern "C" { + pub fn mbrlen( + _Ch: *const ::std::os::raw::c_char, + _SizeInBytes: size_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn mbrtowc( + _DstCh: *mut wchar_t, + _SrcCh: *const ::std::os::raw::c_char, + _SizeInBytes: size_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn mbsrtowcs_s( + _Retval: *mut size_t, + _Dst: *mut wchar_t, + _Size: size_t, + _PSrc: *mut *const ::std::os::raw::c_char, + _N: size_t, + _State: *mut mbstate_t, + ) -> errno_t; +} +extern "C" { + pub fn mbsrtowcs( + _Dest: *mut wchar_t, + _PSrc: *mut *const ::std::os::raw::c_char, + _Count: size_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wcrtomb_s( + _Retval: *mut size_t, + _Dst: *mut ::std::os::raw::c_char, + _SizeInBytes: size_t, + _Ch: wchar_t, + _State: *mut mbstate_t, + ) -> errno_t; +} +extern "C" { + pub fn wcrtomb( + _Dest: *mut ::std::os::raw::c_char, + _Source: wchar_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wcsrtombs_s( + _Retval: *mut size_t, + _Dst: *mut ::std::os::raw::c_char, + _SizeInBytes: size_t, + _Src: *mut *const wchar_t, + _Size: size_t, + _State: *mut mbstate_t, + ) -> errno_t; +} +extern "C" { + pub fn wcsrtombs( + _Dest: *mut ::std::os::raw::c_char, + _PSource: *mut *const wchar_t, + _Count: size_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wctob(_WCh: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wmemcpy_s(_S1: *mut wchar_t, _N1: rsize_t, _S2: *const wchar_t, _N: rsize_t) -> errno_t; +} +extern "C" { + pub fn wmemmove_s(_S1: *mut wchar_t, _N1: rsize_t, _S2: *const wchar_t, _N: rsize_t) + -> errno_t; +} +pub type max_align_t = f64; +pub type sig_atomic_t = ::std::os::raw::c_int; +pub type _crt_signal_t = ::std::option::Option; +extern "C" { + pub fn __pxcptinfoptrs() -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn signal(_Signal: ::std::os::raw::c_int, _Function: _crt_signal_t) -> _crt_signal_t; +} +extern "C" { + pub fn raise(_Signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +pub type int_least8_t = ::std::os::raw::c_schar; +pub type int_least16_t = ::std::os::raw::c_short; +pub type int_least32_t = ::std::os::raw::c_int; +pub type int_least64_t = ::std::os::raw::c_longlong; +pub type uint_least8_t = ::std::os::raw::c_uchar; +pub type uint_least16_t = ::std::os::raw::c_ushort; +pub type uint_least32_t = ::std::os::raw::c_uint; +pub type uint_least64_t = ::std::os::raw::c_ulonglong; +pub type int_fast8_t = ::std::os::raw::c_schar; +pub type int_fast16_t = ::std::os::raw::c_int; +pub type int_fast32_t = ::std::os::raw::c_int; +pub type int_fast64_t = ::std::os::raw::c_longlong; +pub type uint_fast8_t = ::std::os::raw::c_uchar; +pub type uint_fast16_t = ::std::os::raw::c_uint; +pub type uint_fast32_t = ::std::os::raw::c_uint; +pub type uint_fast64_t = ::std::os::raw::c_ulonglong; +pub type intmax_t = ::std::os::raw::c_longlong; +pub type uintmax_t = ::std::os::raw::c_ulonglong; +extern "C" { + pub fn TCOD_strdup(s: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_strcasecmp( + s1: *const ::std::os::raw::c_char, + s2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_strncasecmp( + s1: *const ::std::os::raw::c_char, + s2: *const ::std::os::raw::c_char, + n: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strcasestr( + haystack: *const ::std::os::raw::c_char, + needle: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +pub type TCOD_line_listener_t = ::std::option::Option< + unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> bool, +>; +extern "C" { + pub fn TCOD_line_init( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_line_step( + xCur: *mut ::std::os::raw::c_int, + yCur: *mut ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_line( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + listener: TCOD_line_listener_t, + ) -> bool; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_bresenham_data_t { + pub stepx: ::std::os::raw::c_int, + pub stepy: ::std::os::raw::c_int, + pub e: ::std::os::raw::c_int, + pub deltax: ::std::os::raw::c_int, + pub deltay: ::std::os::raw::c_int, + pub origx: ::std::os::raw::c_int, + pub origy: ::std::os::raw::c_int, + pub destx: ::std::os::raw::c_int, + pub desty: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_bresenham_data_t() { + assert_eq!( + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(TCOD_bresenham_data_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_bresenham_data_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stepx as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(stepx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stepy as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(stepy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).e as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(e) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).deltax as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(deltax) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).deltay as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(deltay) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).origx as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(origx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).origy as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(origy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).destx as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(destx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).desty as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(desty) + ) + ); +} +extern "C" { + pub fn TCOD_line_init_mt( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + data: *mut TCOD_bresenham_data_t, + ); +} +extern "C" { + pub fn TCOD_line_step_mt( + xCur: *mut ::std::os::raw::c_int, + yCur: *mut ::std::os::raw::c_int, + data: *mut TCOD_bresenham_data_t, + ) -> bool; +} +extern "C" { + pub fn TCOD_line_mt( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + listener: TCOD_line_listener_t, + data: *mut TCOD_bresenham_data_t, + ) -> bool; +} +pub type TCOD_random_t = *mut ::std::os::raw::c_void; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_dice_t { + pub nb_rolls: ::std::os::raw::c_int, + pub nb_faces: ::std::os::raw::c_int, + pub multiplier: f32, + pub addsub: f32, +} +#[test] +fn bindgen_test_layout_TCOD_dice_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_dice_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_dice_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_rolls as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(nb_rolls) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_faces as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(nb_faces) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).multiplier as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(multiplier) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).addsub as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(addsub) + ) + ); +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_random_algo_t { + TCOD_RNG_MT = 0, + TCOD_RNG_CMWC = 1, +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_distribution_t { + TCOD_DISTRIBUTION_LINEAR = 0, + TCOD_DISTRIBUTION_GAUSSIAN = 1, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE = 2, + TCOD_DISTRIBUTION_GAUSSIAN_INVERSE = 3, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE = 4, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TCOD_tree_t { + pub next: *mut _TCOD_tree_t, + pub father: *mut _TCOD_tree_t, + pub sons: *mut _TCOD_tree_t, +} +#[test] +fn bindgen_test_layout__TCOD_tree_t() { + assert_eq!( + ::std::mem::size_of::<_TCOD_tree_t>(), + 24usize, + concat!("Size of: ", stringify!(_TCOD_tree_t)) + ); + assert_eq!( + ::std::mem::align_of::<_TCOD_tree_t>(), + 8usize, + concat!("Alignment of ", stringify!(_TCOD_tree_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).next as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).father as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(father) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).sons as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(sons) + ) + ); +} +impl Default for _TCOD_tree_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_tree_t = _TCOD_tree_t; +extern "C" { + pub fn TCOD_tree_new() -> *mut TCOD_tree_t; +} +extern "C" { + pub fn TCOD_tree_add_son(node: *mut TCOD_tree_t, son: *mut TCOD_tree_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_bsp_t { + pub tree: TCOD_tree_t, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub w: ::std::os::raw::c_int, + pub h: ::std::os::raw::c_int, + pub position: ::std::os::raw::c_int, + pub level: u8, + pub horizontal: bool, +} +#[test] +fn bindgen_test_layout_TCOD_bsp_t() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(TCOD_bsp_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_bsp_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tree as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(tree) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(position) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).level as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(level) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).horizontal as *const _ as usize }, + 45usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(horizontal) + ) + ); +} +impl Default for TCOD_bsp_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_bsp_callback_t = ::std::option::Option< + unsafe extern "C" fn(node: *mut TCOD_bsp_t, userData: *mut ::std::os::raw::c_void) -> bool, +>; +extern "C" { + pub fn TCOD_bsp_new() -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_new_with_size( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_delete(node: *mut TCOD_bsp_t); +} +extern "C" { + pub fn TCOD_bsp_left(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_right(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_father(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_is_leaf(node: *mut TCOD_bsp_t) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_pre_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_in_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_post_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_level_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_inverted_level_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_contains( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_find_node( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_resize( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_bsp_split_once( + node: *mut TCOD_bsp_t, + horizontal: bool, + position: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_bsp_split_recursive( + node: *mut TCOD_bsp_t, + randomizer: TCOD_random_t, + nb: ::std::os::raw::c_int, + minHSize: ::std::os::raw::c_int, + minVSize: ::std::os::raw::c_int, + maxHRatio: f32, + maxVRatio: f32, + ); +} +extern "C" { + pub fn TCOD_bsp_remove_sons(node: *mut TCOD_bsp_t); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_color_t { + pub r: u8, + pub g: u8, + pub b: u8, +} +#[test] +fn bindgen_test_layout_TCOD_color_t() { + assert_eq!( + ::std::mem::size_of::(), + 3usize, + concat!("Size of: ", stringify!(TCOD_color_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_color_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_color_t), + "::", + stringify!(r) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_color_t), + "::", + stringify!(g) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_color_t), + "::", + stringify!(b) + ) + ); +} +extern "C" { + pub fn TCOD_color_RGB(r: u8, g: u8, b: u8) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_HSV(h: f32, s: f32, v: f32) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_equals(c1: TCOD_color_t, c2: TCOD_color_t) -> bool; +} +extern "C" { + pub fn TCOD_color_add(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_subtract(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_multiply(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_multiply_scalar(c1: TCOD_color_t, value: f32) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_lerp(c1: TCOD_color_t, c2: TCOD_color_t, coef: f32) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_set_HSV(c: *mut TCOD_color_t, h: f32, s: f32, v: f32); +} +extern "C" { + pub fn TCOD_color_get_HSV(c: TCOD_color_t, h: *mut f32, s: *mut f32, v: *mut f32); +} +extern "C" { + pub fn TCOD_color_get_hue(c: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_hue(c: *mut TCOD_color_t, h: f32); +} +extern "C" { + pub fn TCOD_color_get_saturation(c: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_saturation(c: *mut TCOD_color_t, s: f32); +} +extern "C" { + pub fn TCOD_color_get_value(c: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_value(c: *mut TCOD_color_t, v: f32); +} +extern "C" { + pub fn TCOD_color_shift_hue(c: *mut TCOD_color_t, hshift: f32); +} +extern "C" { + pub fn TCOD_color_scale_HSV(c: *mut TCOD_color_t, scoef: f32, vcoef: f32); +} +extern "C" { + pub fn TCOD_color_gen_map( + map: *mut TCOD_color_t, + nb_key: ::std::os::raw::c_int, + key_color: *const TCOD_color_t, + key_index: *const ::std::os::raw::c_int, + ); +} +pub const TCOD_COLOR_RED: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_RED; +pub const TCOD_COLOR_FLAME: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_FLAME; +pub const TCOD_COLOR_ORANGE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_ORANGE; +pub const TCOD_COLOR_AMBER: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_AMBER; +pub const TCOD_COLOR_YELLOW: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_YELLOW; +pub const TCOD_COLOR_LIME: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_LIME; +pub const TCOD_COLOR_CHARTREUSE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CHARTREUSE; +pub const TCOD_COLOR_GREEN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_GREEN; +pub const TCOD_COLOR_SEA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_SEA; +pub const TCOD_COLOR_TURQUOISE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_TURQUOISE; +pub const TCOD_COLOR_CYAN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CYAN; +pub const TCOD_COLOR_SKY: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_SKY; +pub const TCOD_COLOR_AZURE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_AZURE; +pub const TCOD_COLOR_BLUE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_BLUE; +pub const TCOD_COLOR_HAN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_HAN; +pub const TCOD_COLOR_VIOLET: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_VIOLET; +pub const TCOD_COLOR_PURPLE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_PURPLE; +pub const TCOD_COLOR_FUCHSIA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_FUCHSIA; +pub const TCOD_COLOR_MAGENTA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_MAGENTA; +pub const TCOD_COLOR_PINK: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_PINK; +pub const TCOD_COLOR_CRIMSON: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CRIMSON; +pub const TCOD_COLOR_NB: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_NB; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_1 { + TCOD_COLOR_RED = 0, + TCOD_COLOR_FLAME = 1, + TCOD_COLOR_ORANGE = 2, + TCOD_COLOR_AMBER = 3, + TCOD_COLOR_YELLOW = 4, + TCOD_COLOR_LIME = 5, + TCOD_COLOR_CHARTREUSE = 6, + TCOD_COLOR_GREEN = 7, + TCOD_COLOR_SEA = 8, + TCOD_COLOR_TURQUOISE = 9, + TCOD_COLOR_CYAN = 10, + TCOD_COLOR_SKY = 11, + TCOD_COLOR_AZURE = 12, + TCOD_COLOR_BLUE = 13, + TCOD_COLOR_HAN = 14, + TCOD_COLOR_VIOLET = 15, + TCOD_COLOR_PURPLE = 16, + TCOD_COLOR_FUCHSIA = 17, + TCOD_COLOR_MAGENTA = 18, + TCOD_COLOR_PINK = 19, + TCOD_COLOR_CRIMSON = 20, + TCOD_COLOR_NB = 21, +} +pub const TCOD_COLOR_DESATURATED: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DESATURATED; +pub const TCOD_COLOR_LIGHTEST: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHTEST; +pub const TCOD_COLOR_LIGHTER: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHTER; +pub const TCOD_COLOR_LIGHT: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHT; +pub const TCOD_COLOR_NORMAL: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_NORMAL; +pub const TCOD_COLOR_DARK: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARK; +pub const TCOD_COLOR_DARKER: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARKER; +pub const TCOD_COLOR_DARKEST: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARKEST; +pub const TCOD_COLOR_LEVELS: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LEVELS; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_2 { + TCOD_COLOR_DESATURATED = 0, + TCOD_COLOR_LIGHTEST = 1, + TCOD_COLOR_LIGHTER = 2, + TCOD_COLOR_LIGHT = 3, + TCOD_COLOR_NORMAL = 4, + TCOD_COLOR_DARK = 5, + TCOD_COLOR_DARKER = 6, + TCOD_COLOR_DARKEST = 7, + TCOD_COLOR_LEVELS = 8, +} +extern "C" { + pub static mut TCOD_colors: [[TCOD_color_t; 8usize]; 21usize]; +} +extern "C" { + pub static TCOD_black: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_white: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_brass: TCOD_color_t; +} +extern "C" { + pub static TCOD_copper: TCOD_color_t; +} +extern "C" { + pub static TCOD_gold: TCOD_color_t; +} +extern "C" { + pub static TCOD_silver: TCOD_color_t; +} +extern "C" { + pub static TCOD_celadon: TCOD_color_t; +} +extern "C" { + pub static TCOD_peach: TCOD_color_t; +} +pub type TCOD_console_t = *mut ::std::os::raw::c_void; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_keycode_t { + TCODK_NONE = 0, + TCODK_ESCAPE = 1, + TCODK_BACKSPACE = 2, + TCODK_TAB = 3, + TCODK_ENTER = 4, + TCODK_SHIFT = 5, + TCODK_CONTROL = 6, + TCODK_ALT = 7, + TCODK_PAUSE = 8, + TCODK_CAPSLOCK = 9, + TCODK_PAGEUP = 10, + TCODK_PAGEDOWN = 11, + TCODK_END = 12, + TCODK_HOME = 13, + TCODK_UP = 14, + TCODK_LEFT = 15, + TCODK_RIGHT = 16, + TCODK_DOWN = 17, + TCODK_PRINTSCREEN = 18, + TCODK_INSERT = 19, + TCODK_DELETE = 20, + TCODK_LWIN = 21, + TCODK_RWIN = 22, + TCODK_APPS = 23, + TCODK_0 = 24, + TCODK_1 = 25, + TCODK_2 = 26, + TCODK_3 = 27, + TCODK_4 = 28, + TCODK_5 = 29, + TCODK_6 = 30, + TCODK_7 = 31, + TCODK_8 = 32, + TCODK_9 = 33, + TCODK_KP0 = 34, + TCODK_KP1 = 35, + TCODK_KP2 = 36, + TCODK_KP3 = 37, + TCODK_KP4 = 38, + TCODK_KP5 = 39, + TCODK_KP6 = 40, + TCODK_KP7 = 41, + TCODK_KP8 = 42, + TCODK_KP9 = 43, + TCODK_KPADD = 44, + TCODK_KPSUB = 45, + TCODK_KPDIV = 46, + TCODK_KPMUL = 47, + TCODK_KPDEC = 48, + TCODK_KPENTER = 49, + TCODK_F1 = 50, + TCODK_F2 = 51, + TCODK_F3 = 52, + TCODK_F4 = 53, + TCODK_F5 = 54, + TCODK_F6 = 55, + TCODK_F7 = 56, + TCODK_F8 = 57, + TCODK_F9 = 58, + TCODK_F10 = 59, + TCODK_F11 = 60, + TCODK_F12 = 61, + TCODK_NUMLOCK = 62, + TCODK_SCROLLLOCK = 63, + TCODK_SPACE = 64, + TCODK_CHAR = 65, + TCODK_TEXT = 66, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_key_t { + pub vk: TCOD_keycode_t, + pub c: ::std::os::raw::c_char, + pub text: [::std::os::raw::c_char; 32usize], + pub pressed: bool, + pub lalt: bool, + pub lctrl: bool, + pub lmeta: bool, + pub ralt: bool, + pub rctrl: bool, + pub rmeta: bool, + pub shift: bool, +} +#[test] +fn bindgen_test_layout_TCOD_key_t() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(TCOD_key_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_key_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vk as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(vk) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(c) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).text as *const _ as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(text) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pressed as *const _ as usize }, + 37usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lalt as *const _ as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lalt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lctrl as *const _ as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lctrl) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lmeta as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lmeta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ralt as *const _ as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(ralt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rctrl as *const _ as usize }, + 42usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(rctrl) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rmeta as *const _ as usize }, + 43usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(rmeta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).shift as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(shift) + ) + ); +} +impl Default for TCOD_key_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_chars_t { + TCOD_CHAR_HLINE = 196, + TCOD_CHAR_VLINE = 179, + TCOD_CHAR_NE = 191, + TCOD_CHAR_NW = 218, + TCOD_CHAR_SE = 217, + TCOD_CHAR_SW = 192, + TCOD_CHAR_TEEW = 180, + TCOD_CHAR_TEEE = 195, + TCOD_CHAR_TEEN = 193, + TCOD_CHAR_TEES = 194, + TCOD_CHAR_CROSS = 197, + TCOD_CHAR_DHLINE = 205, + TCOD_CHAR_DVLINE = 186, + TCOD_CHAR_DNE = 187, + TCOD_CHAR_DNW = 201, + TCOD_CHAR_DSE = 188, + TCOD_CHAR_DSW = 200, + TCOD_CHAR_DTEEW = 185, + TCOD_CHAR_DTEEE = 204, + TCOD_CHAR_DTEEN = 202, + TCOD_CHAR_DTEES = 203, + TCOD_CHAR_DCROSS = 206, + TCOD_CHAR_BLOCK1 = 176, + TCOD_CHAR_BLOCK2 = 177, + TCOD_CHAR_BLOCK3 = 178, + TCOD_CHAR_ARROW_N = 24, + TCOD_CHAR_ARROW_S = 25, + TCOD_CHAR_ARROW_E = 26, + TCOD_CHAR_ARROW_W = 27, + TCOD_CHAR_ARROW2_N = 30, + TCOD_CHAR_ARROW2_S = 31, + TCOD_CHAR_ARROW2_E = 16, + TCOD_CHAR_ARROW2_W = 17, + TCOD_CHAR_DARROW_H = 29, + TCOD_CHAR_DARROW_V = 18, + TCOD_CHAR_CHECKBOX_UNSET = 224, + TCOD_CHAR_CHECKBOX_SET = 225, + TCOD_CHAR_RADIO_UNSET = 9, + TCOD_CHAR_RADIO_SET = 10, + TCOD_CHAR_SUBP_NW = 226, + TCOD_CHAR_SUBP_NE = 227, + TCOD_CHAR_SUBP_N = 228, + TCOD_CHAR_SUBP_SE = 229, + TCOD_CHAR_SUBP_DIAG = 230, + TCOD_CHAR_SUBP_E = 231, + TCOD_CHAR_SUBP_SW = 232, + TCOD_CHAR_SMILIE = 1, + TCOD_CHAR_SMILIE_INV = 2, + TCOD_CHAR_HEART = 3, + TCOD_CHAR_DIAMOND = 4, + TCOD_CHAR_CLUB = 5, + TCOD_CHAR_SPADE = 6, + TCOD_CHAR_BULLET = 7, + TCOD_CHAR_BULLET_INV = 8, + TCOD_CHAR_MALE = 11, + TCOD_CHAR_FEMALE = 12, + TCOD_CHAR_NOTE = 13, + TCOD_CHAR_NOTE_DOUBLE = 14, + TCOD_CHAR_LIGHT = 15, + TCOD_CHAR_EXCLAM_DOUBLE = 19, + TCOD_CHAR_PILCROW = 20, + TCOD_CHAR_SECTION = 21, + TCOD_CHAR_POUND = 156, + TCOD_CHAR_MULTIPLICATION = 158, + TCOD_CHAR_FUNCTION = 159, + TCOD_CHAR_RESERVED = 169, + TCOD_CHAR_HALF = 171, + TCOD_CHAR_ONE_QUARTER = 172, + TCOD_CHAR_COPYRIGHT = 184, + TCOD_CHAR_CENT = 189, + TCOD_CHAR_YEN = 190, + TCOD_CHAR_CURRENCY = 207, + TCOD_CHAR_THREE_QUARTERS = 243, + TCOD_CHAR_DIVISION = 246, + TCOD_CHAR_GRADE = 248, + TCOD_CHAR_UMLAUT = 249, + TCOD_CHAR_POW1 = 251, + TCOD_CHAR_POW3 = 252, + TCOD_CHAR_POW2 = 253, + TCOD_CHAR_BULLET_SQUARE = 254, +} +impl TCOD_colctrl_t { + pub const TCOD_COLCTRL_NUMBER: TCOD_colctrl_t = TCOD_colctrl_t::TCOD_COLCTRL_5; +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_colctrl_t { + TCOD_COLCTRL_1 = 1, + TCOD_COLCTRL_2 = 2, + TCOD_COLCTRL_3 = 3, + TCOD_COLCTRL_4 = 4, + TCOD_COLCTRL_5 = 5, + TCOD_COLCTRL_FORE_RGB = 6, + TCOD_COLCTRL_BACK_RGB = 7, + TCOD_COLCTRL_STOP = 8, +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_bkgnd_flag_t { + TCOD_BKGND_NONE = 0, + TCOD_BKGND_SET = 1, + TCOD_BKGND_MULTIPLY = 2, + TCOD_BKGND_LIGHTEN = 3, + TCOD_BKGND_DARKEN = 4, + TCOD_BKGND_SCREEN = 5, + TCOD_BKGND_COLOR_DODGE = 6, + TCOD_BKGND_COLOR_BURN = 7, + TCOD_BKGND_ADD = 8, + TCOD_BKGND_ADDA = 9, + TCOD_BKGND_BURN = 10, + TCOD_BKGND_OVERLAY = 11, + TCOD_BKGND_ALPH = 12, + TCOD_BKGND_DEFAULT = 13, +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_key_status_t { + TCOD_KEY_PRESSED = 1, + TCOD_KEY_RELEASED = 2, +} +impl TCOD_font_flags_t { + pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = + TCOD_font_flags_t::TCOD_FONT_TYPE_GREYSCALE; +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_font_flags_t { + TCOD_FONT_LAYOUT_ASCII_INCOL = 1, + TCOD_FONT_LAYOUT_ASCII_INROW = 2, + TCOD_FONT_TYPE_GREYSCALE = 4, + TCOD_FONT_LAYOUT_TCOD = 8, +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_renderer_t { + TCOD_RENDERER_GLSL = 0, + TCOD_RENDERER_OPENGL = 1, + TCOD_RENDERER_SDL = 2, + TCOD_NB_RENDERERS = 3, +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_alignment_t { + TCOD_LEFT = 0, + TCOD_RIGHT = 1, + TCOD_CENTER = 2, +} +pub type TCOD_image_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_image_new( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_image_from_console(console: TCOD_console_t) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_image_refresh_console(image: TCOD_image_t, console: TCOD_console_t); +} +extern "C" { + pub fn TCOD_image_load(filename: *const ::std::os::raw::c_char) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_image_clear(image: TCOD_image_t, color: TCOD_color_t); +} +extern "C" { + pub fn TCOD_image_invert(image: TCOD_image_t); +} +extern "C" { + pub fn TCOD_image_hflip(image: TCOD_image_t); +} +extern "C" { + pub fn TCOD_image_rotate90(image: TCOD_image_t, numRotations: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_image_vflip(image: TCOD_image_t); +} +extern "C" { + pub fn TCOD_image_scale( + image: TCOD_image_t, + neww: ::std::os::raw::c_int, + newh: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_save(image: TCOD_image_t, filename: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_image_get_size( + image: TCOD_image_t, + w: *mut ::std::os::raw::c_int, + h: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_get_pixel( + image: TCOD_image_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_image_get_alpha( + image: TCOD_image_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_image_get_mipmap_pixel( + image: TCOD_image_t, + x0: f32, + y0: f32, + x1: f32, + y1: f32, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_image_put_pixel( + image: TCOD_image_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); +} +extern "C" { + pub fn TCOD_image_blit( + image: TCOD_image_t, + console: TCOD_console_t, + x: f32, + y: f32, + bkgnd_flag: TCOD_bkgnd_flag_t, + scalex: f32, + scaley: f32, + angle: f32, + ); +} +extern "C" { + pub fn TCOD_image_blit_rect( + image: TCOD_image_t, + console: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + bkgnd_flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_image_blit_2x( + image: TCOD_image_t, + dest: TCOD_console_t, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + sx: ::std::os::raw::c_int, + sy: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_delete(image: TCOD_image_t); +} +extern "C" { + pub fn TCOD_image_set_key_color(image: TCOD_image_t, key_color: TCOD_color_t); +} +extern "C" { + pub fn TCOD_image_is_pixel_transparent( + image: TCOD_image_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +pub type TCOD_list_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_list_new() -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_allocate(nb_elements: ::std::os::raw::c_int) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_duplicate(l: TCOD_list_t) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_delete(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_push(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_pop(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_peek(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_add_all(l: TCOD_list_t, l2: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_get(l: TCOD_list_t, idx: ::std::os::raw::c_int) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_set( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + idx: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_list_begin(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_end(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_reverse(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_remove_iterator( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_remove(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_remove_iterator_fast( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_remove_fast(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_contains(l: TCOD_list_t, elt: *const ::std::os::raw::c_void) -> bool; +} +extern "C" { + pub fn TCOD_list_clear(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_clear_and_delete(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_size(l: TCOD_list_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_list_insert_before( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + before: ::std::os::raw::c_int, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_is_empty(l: TCOD_list_t) -> bool; +} +extern "C" { + pub fn TCOD_console_init_root( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fullscreen: bool, + renderer: TCOD_renderer_t, + ); +} +extern "C" { + pub fn TCOD_console_set_window_title(title: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_console_set_fullscreen(fullscreen: bool); +} +extern "C" { + pub fn TCOD_console_is_fullscreen() -> bool; +} +extern "C" { + pub fn TCOD_console_is_window_closed() -> bool; +} +extern "C" { + pub fn TCOD_console_has_mouse_focus() -> bool; +} +extern "C" { + pub fn TCOD_console_is_active() -> bool; +} +extern "C" { + pub fn TCOD_console_set_custom_font( + fontFile: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + nb_char_horiz: ::std::os::raw::c_int, + nb_char_vertic: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_ascii_code_to_font( + asciiCode: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_ascii_codes_to_font( + asciiCode: ::std::os::raw::c_int, + nbCodes: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_string_to_font( + s: *const ::std::os::raw::c_char, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_set_dirty( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_set_default_background(con: TCOD_console_t, col: TCOD_color_t); +} +extern "C" { + pub fn TCOD_console_set_default_foreground(con: TCOD_console_t, col: TCOD_color_t); +} +extern "C" { + pub fn TCOD_console_clear(con: TCOD_console_t); +} +extern "C" { + pub fn TCOD_console_set_char_background( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_console_set_char_foreground( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); +} +extern "C" { + pub fn TCOD_console_set_char( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_put_char( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_console_put_char_ex( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + fore: TCOD_color_t, + back: TCOD_color_t, + ); +} +extern "C" { + pub fn TCOD_console_set_background_flag(con: TCOD_console_t, flag: TCOD_bkgnd_flag_t); +} +extern "C" { + pub fn TCOD_console_get_background_flag(con: TCOD_console_t) -> TCOD_bkgnd_flag_t; +} +extern "C" { + pub fn TCOD_console_set_alignment(con: TCOD_console_t, alignment: TCOD_alignment_t); +} +extern "C" { + pub fn TCOD_console_get_alignment(con: TCOD_console_t) -> TCOD_alignment_t; +} +extern "C" { + pub fn TCOD_console_print( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_ex( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_rect( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_rect_ex( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_rect( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + clear: bool, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_console_hline( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_console_vline( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_console_print_frame( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + empty: bool, + flag: TCOD_bkgnd_flag_t, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_map_string_to_font_utf( + s: *const wchar_t, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_print_utf( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_ex_utf( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_rect_utf( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_rect_ex_utf( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_utf( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_default_background(con: TCOD_console_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_get_default_foreground(con: TCOD_console_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_get_char_background( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_get_char_foreground( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_get_char( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_background_color_image(con: TCOD_console_t) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_console_get_foreground_color_image(con: TCOD_console_t) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_console_set_fade(val: u8, fade: TCOD_color_t); +} +extern "C" { + pub fn TCOD_console_get_fade() -> u8; +} +extern "C" { + pub fn TCOD_console_get_fading_color() -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_flush(); +} +extern "C" { + pub fn TCOD_console_set_color_control( + con: TCOD_colctrl_t, + fore: TCOD_color_t, + back: TCOD_color_t, + ); +} +extern "C" { + pub fn TCOD_console_check_for_keypress(flags: ::std::os::raw::c_int) -> TCOD_key_t; +} +extern "C" { + pub fn TCOD_console_wait_for_keypress(flush: bool) -> TCOD_key_t; +} +extern "C" { + pub fn TCOD_console_is_key_pressed(key: TCOD_keycode_t) -> bool; +} +extern "C" { + pub fn TCOD_console_from_file(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_load_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_load_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_new(w: ::std::os::raw::c_int, h: ::std::os::raw::c_int) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_get_width(con: TCOD_console_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height(con: TCOD_console_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_set_key_color(con: TCOD_console_t, col: TCOD_color_t); +} +extern "C" { + pub fn TCOD_console_blit( + src: TCOD_console_t, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + dst: TCOD_console_t, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + foreground_alpha: f32, + background_alpha: f32, + ); +} +extern "C" { + pub fn TCOD_console_delete(console: TCOD_console_t); +} +extern "C" { + pub fn TCOD_console_credits(); +} +extern "C" { + pub fn TCOD_console_credits_reset(); +} +extern "C" { + pub fn TCOD_console_credits_render( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + alpha: bool, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_load_xp( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_xp( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_list_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_console_list_save_xp( + console_list: TCOD_list_t, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; +} +pub type TCOD_map_t = *mut ::std::os::raw::c_void; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_fov_algorithm_t { + FOV_BASIC = 0, + FOV_DIAMOND = 1, + FOV_SHADOW = 2, + FOV_PERMISSIVE_0 = 3, + FOV_PERMISSIVE_1 = 4, + FOV_PERMISSIVE_2 = 5, + FOV_PERMISSIVE_3 = 6, + FOV_PERMISSIVE_4 = 7, + FOV_PERMISSIVE_5 = 8, + FOV_PERMISSIVE_6 = 9, + FOV_PERMISSIVE_7 = 10, + FOV_PERMISSIVE_8 = 11, + FOV_RESTRICTIVE = 12, + NB_FOV_ALGORITHMS = 13, +} +extern "C" { + pub fn TCOD_map_new(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int) -> TCOD_map_t; +} +extern "C" { + pub fn TCOD_map_clear(map: TCOD_map_t, transparent: bool, walkable: bool); +} +extern "C" { + pub fn TCOD_map_copy(source: TCOD_map_t, dest: TCOD_map_t); +} +extern "C" { + pub fn TCOD_map_set_properties( + map: TCOD_map_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + is_transparent: bool, + is_walkable: bool, + ); +} +extern "C" { + pub fn TCOD_map_delete(map: TCOD_map_t); +} +extern "C" { + pub fn TCOD_map_compute_fov( + map: TCOD_map_t, + player_x: ::std::os::raw::c_int, + player_y: ::std::os::raw::c_int, + max_radius: ::std::os::raw::c_int, + light_walls: bool, + algo: TCOD_fov_algorithm_t, + ); +} +extern "C" { + pub fn TCOD_map_is_in_fov( + map: TCOD_map_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_set_in_fov( + map: TCOD_map_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fov: bool, + ); +} +extern "C" { + pub fn TCOD_map_is_transparent( + map: TCOD_map_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_is_walkable( + map: TCOD_map_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_get_width(map: TCOD_map_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_map_get_height(map: TCOD_map_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_map_get_nb_cells(map: TCOD_map_t) -> ::std::os::raw::c_int; +} +pub type TCOD_noise_t = *mut ::std::os::raw::c_void; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_noise_type_t { + TCOD_NOISE_PERLIN = 1, + TCOD_NOISE_SIMPLEX = 2, + TCOD_NOISE_WAVELET = 4, + TCOD_NOISE_DEFAULT = 0, +} +extern "C" { + pub fn TCOD_noise_new( + dimensions: ::std::os::raw::c_int, + hurst: f32, + lacunarity: f32, + random: TCOD_random_t, + ) -> TCOD_noise_t; +} +extern "C" { + pub fn TCOD_noise_set_type(noise: TCOD_noise_t, type_: TCOD_noise_type_t); +} +extern "C" { + pub fn TCOD_noise_get_ex(noise: TCOD_noise_t, f: *mut f32, type_: TCOD_noise_type_t) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_fbm_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_turbulence_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; +} +extern "C" { + pub fn TCOD_noise_get(noise: TCOD_noise_t, f: *mut f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_fbm(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_turbulence(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_delete(noise: TCOD_noise_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_heightmap_t { + pub w: ::std::os::raw::c_int, + pub h: ::std::os::raw::c_int, + pub values: *mut f32, +} +#[test] +fn bindgen_test_layout_TCOD_heightmap_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).values as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(values) + ) + ); +} +impl Default for TCOD_heightmap_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_heightmap_new( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_heightmap_t; +} +extern "C" { + pub fn TCOD_heightmap_delete(hm: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_get_value( + hm: *const TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_get_interpolated_value( + hm: *const TCOD_heightmap_t, + x: f32, + y: f32, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_set_value( + hm: *mut TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + value: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_get_slope( + hm: *const TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_get_normal( + hm: *const TCOD_heightmap_t, + x: f32, + y: f32, + n: *mut f32, + waterLevel: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_count_cells( + hm: *const TCOD_heightmap_t, + min: f32, + max: f32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_heightmap_has_land_on_border(hm: *const TCOD_heightmap_t, waterLevel: f32) -> bool; +} +extern "C" { + pub fn TCOD_heightmap_get_minmax(hm: *const TCOD_heightmap_t, min: *mut f32, max: *mut f32); +} +extern "C" { + pub fn TCOD_heightmap_copy(hm_source: *const TCOD_heightmap_t, hm_dest: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_add(hm: *mut TCOD_heightmap_t, value: f32); +} +extern "C" { + pub fn TCOD_heightmap_scale(hm: *mut TCOD_heightmap_t, value: f32); +} +extern "C" { + pub fn TCOD_heightmap_clamp(hm: *mut TCOD_heightmap_t, min: f32, max: f32); +} +extern "C" { + pub fn TCOD_heightmap_normalize(hm: *mut TCOD_heightmap_t, min: f32, max: f32); +} +extern "C" { + pub fn TCOD_heightmap_clear(hm: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_lerp_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + coef: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_multiply_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_dig_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_dig_bezier( + hm: *mut TCOD_heightmap_t, + px: *mut ::std::os::raw::c_int, + py: *mut ::std::os::raw::c_int, + startRadius: f32, + startDepth: f32, + endRadius: f32, + endDepth: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_rain_erosion( + hm: *mut TCOD_heightmap_t, + nbDrops: ::std::os::raw::c_int, + erosionCoef: f32, + sedimentationCoef: f32, + rnd: TCOD_random_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_kernel_transform( + hm: *mut TCOD_heightmap_t, + kernelsize: ::std::os::raw::c_int, + dx: *const ::std::os::raw::c_int, + dy: *const ::std::os::raw::c_int, + weight: *const f32, + minLevel: f32, + maxLevel: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_voronoi( + hm: *mut TCOD_heightmap_t, + nbPoints: ::std::os::raw::c_int, + nbCoef: ::std::os::raw::c_int, + coef: *const f32, + rnd: TCOD_random_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_mid_point_displacement( + hm: *mut TCOD_heightmap_t, + rnd: TCOD_random_t, + roughness: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_scale_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_islandify(hm: *mut TCOD_heightmap_t, seaLevel: f32, rnd: TCOD_random_t); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct TCOD_lex_t { + pub file_line: ::std::os::raw::c_int, + pub token_type: ::std::os::raw::c_int, + pub token_int_val: ::std::os::raw::c_int, + pub token_idx: ::std::os::raw::c_int, + pub token_float_val: f32, + pub tok: *mut ::std::os::raw::c_char, + pub toklen: ::std::os::raw::c_int, + pub lastStringDelim: ::std::os::raw::c_char, + pub pos: *mut ::std::os::raw::c_char, + pub buf: *mut ::std::os::raw::c_char, + pub filename: *mut ::std::os::raw::c_char, + pub last_javadoc_comment: *mut ::std::os::raw::c_char, + pub nb_symbols: ::std::os::raw::c_int, + pub nb_keywords: ::std::os::raw::c_int, + pub flags: ::std::os::raw::c_int, + pub symbols: [[::std::os::raw::c_char; 5usize]; 100usize], + pub keywords: [[::std::os::raw::c_char; 20usize]; 100usize], + pub simpleCmt: *const ::std::os::raw::c_char, + pub cmtStart: *const ::std::os::raw::c_char, + pub cmtStop: *const ::std::os::raw::c_char, + pub javadocCmtStart: *const ::std::os::raw::c_char, + pub stringDelim: *const ::std::os::raw::c_char, + pub javadoc_read: bool, + pub allocBuf: bool, + pub savept: bool, +} +#[test] +fn bindgen_test_layout_TCOD_lex_t() { + assert_eq!( + ::std::mem::size_of::(), + 2632usize, + concat!("Size of: ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).file_line as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(file_line) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_type as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_type) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_int_val as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_int_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_idx as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_idx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_float_val as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_float_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tok as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(tok) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).toklen as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(toklen) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lastStringDelim as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(lastStringDelim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pos as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(pos) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).filename as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(filename) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_javadoc_comment as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(last_javadoc_comment) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_symbols as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_symbols) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_keywords as *const _ as usize }, + 76usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_keywords) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).symbols as *const _ as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(symbols) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).keywords as *const _ as usize }, + 584usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(keywords) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).simpleCmt as *const _ as usize }, + 2584usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(simpleCmt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStart as *const _ as usize }, + 2592usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStop as *const _ as usize }, + 2600usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStop) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadocCmtStart as *const _ as usize }, + 2608usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadocCmtStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stringDelim as *const _ as usize }, + 2616usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(stringDelim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadoc_read as *const _ as usize }, + 2624usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadoc_read) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).allocBuf as *const _ as usize }, + 2625usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(allocBuf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).savept as *const _ as usize }, + 2626usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(savept) + ) + ); +} +impl Default for TCOD_lex_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_lex_new_intern() -> *mut TCOD_lex_t; +} +extern "C" { + pub fn TCOD_lex_new( + symbols: *mut *const ::std::os::raw::c_char, + keywords: *mut *const ::std::os::raw::c_char, + simpleComment: *const ::std::os::raw::c_char, + commentStart: *const ::std::os::raw::c_char, + commentStop: *const ::std::os::raw::c_char, + javadocCommentStart: *const ::std::os::raw::c_char, + stringDelim: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + ) -> *mut TCOD_lex_t; +} +extern "C" { + pub fn TCOD_lex_delete(lex: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_set_data_buffer(lex: *mut TCOD_lex_t, dat: *mut ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_lex_set_data_file( + lex: *mut TCOD_lex_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_parse(lex: *mut TCOD_lex_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_parse_until_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_parse_until_token_value( + lex: *mut TCOD_lex_t, + token_value: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_expect_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_expect_token_value( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + token_value: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_savepoint(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_restore(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_get_last_javadoc(lex: *mut TCOD_lex_t) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_get_token_name( + token_type: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_get_last_error() -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_hextoint(c: ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_instance() -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_new(algo: TCOD_random_algo_t) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_save(mersenne: TCOD_random_t) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_restore(mersenne: TCOD_random_t, backup: TCOD_random_t); +} +extern "C" { + pub fn TCOD_random_new_from_seed(algo: TCOD_random_algo_t, seed: u32) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_delete(mersenne: TCOD_random_t); +} +extern "C" { + pub fn TCOD_random_set_distribution(mersenne: TCOD_random_t, distribution: TCOD_distribution_t); +} +extern "C" { + pub fn TCOD_random_get_int( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_float(mersenne: TCOD_random_t, min: f32, max: f32) -> f32; +} +extern "C" { + pub fn TCOD_random_get_double(mersenne: TCOD_random_t, min: f64, max: f64) -> f64; +} +extern "C" { + pub fn TCOD_random_get_int_mean( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + mean: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_float_mean( + mersenne: TCOD_random_t, + min: f32, + max: f32, + mean: f32, + ) -> f32; +} +extern "C" { + pub fn TCOD_random_get_double_mean( + mersenne: TCOD_random_t, + min: f64, + max: f64, + mean: f64, + ) -> f64; +} +extern "C" { + pub fn TCOD_random_dice_new(s: *const ::std::os::raw::c_char) -> TCOD_dice_t; +} +extern "C" { + pub fn TCOD_random_dice_roll( + mersenne: TCOD_random_t, + dice: TCOD_dice_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_dice_roll_s( + mersenne: TCOD_random_t, + s: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_mouse_t { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub dx: ::std::os::raw::c_int, + pub dy: ::std::os::raw::c_int, + pub cx: ::std::os::raw::c_int, + pub cy: ::std::os::raw::c_int, + pub dcx: ::std::os::raw::c_int, + pub dcy: ::std::os::raw::c_int, + pub lbutton: bool, + pub rbutton: bool, + pub mbutton: bool, + pub lbutton_pressed: bool, + pub rbutton_pressed: bool, + pub mbutton_pressed: bool, + pub wheel_up: bool, + pub wheel_down: bool, +} +#[test] +fn bindgen_test_layout_TCOD_mouse_t() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_mouse_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_mouse_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dx as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dy as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cx as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cy as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcx as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcy as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton as *const _ as usize }, + 33usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton as *const _ as usize }, + 34usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(mbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton_pressed as *const _ as usize }, + 35usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton_pressed as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton_pressed as *const _ as usize }, + 37usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(mbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wheel_up as *const _ as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(wheel_up) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wheel_down as *const _ as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(wheel_down) + ) + ); +} +extern "C" { + pub fn TCOD_mouse_show_cursor(visible: bool); +} +extern "C" { + pub fn TCOD_mouse_get_status() -> TCOD_mouse_t; +} +extern "C" { + pub fn TCOD_mouse_is_cursor_visible() -> bool; +} +extern "C" { + pub fn TCOD_mouse_move(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_mouse_includes_touch(enable: bool); +} +pub type TCOD_namegen_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_namegen_parse(filename: *const ::std::os::raw::c_char, random: TCOD_random_t); +} +extern "C" { + pub fn TCOD_namegen_generate( + name: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_namegen_generate_custom( + name: *mut ::std::os::raw::c_char, + rule: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_namegen_get_sets() -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_namegen_destroy(); +} +pub type TCOD_path_func_t = ::std::option::Option< + unsafe extern "C" fn( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + user_data: *mut ::std::os::raw::c_void, + ) -> f32, +>; +pub type TCOD_path_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_path_new_using_map(map: TCOD_map_t, diagonalCost: f32) -> TCOD_path_t; +} +extern "C" { + pub fn TCOD_path_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_path_t; +} +extern "C" { + pub fn TCOD_path_compute( + path: TCOD_path_t, + ox: ::std::os::raw::c_int, + oy: ::std::os::raw::c_int, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_path_walk( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + recalculate_when_needed: bool, + ) -> bool; +} +extern "C" { + pub fn TCOD_path_is_empty(path: TCOD_path_t) -> bool; +} +extern "C" { + pub fn TCOD_path_size(path: TCOD_path_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_path_reverse(path: TCOD_path_t); +} +extern "C" { + pub fn TCOD_path_get( + path: TCOD_path_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_get_origin( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_get_destination( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_delete(path: TCOD_path_t); +} +pub type TCOD_dijkstra_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_dijkstra_new(map: TCOD_map_t, diagonalCost: f32) -> TCOD_dijkstra_t; +} +extern "C" { + pub fn TCOD_dijkstra_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_dijkstra_t; +} +extern "C" { + pub fn TCOD_dijkstra_compute( + dijkstra: TCOD_dijkstra_t, + root_x: ::std::os::raw::c_int, + root_y: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_dijkstra_get_distance( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_dijkstra_path_set( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_is_empty(path: TCOD_dijkstra_t) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_size(path: TCOD_dijkstra_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_dijkstra_reverse(path: TCOD_dijkstra_t); +} +extern "C" { + pub fn TCOD_dijkstra_get( + path: TCOD_dijkstra_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_dijkstra_path_walk( + dijkstra: TCOD_dijkstra_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_delete(dijkstra: TCOD_dijkstra_t); +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_value_type_t { + TCOD_TYPE_NONE = 0, + TCOD_TYPE_BOOL = 1, + TCOD_TYPE_CHAR = 2, + TCOD_TYPE_INT = 3, + TCOD_TYPE_FLOAT = 4, + TCOD_TYPE_STRING = 5, + TCOD_TYPE_COLOR = 6, + TCOD_TYPE_DICE = 7, + TCOD_TYPE_VALUELIST00 = 8, + TCOD_TYPE_VALUELIST01 = 9, + TCOD_TYPE_VALUELIST02 = 10, + TCOD_TYPE_VALUELIST03 = 11, + TCOD_TYPE_VALUELIST04 = 12, + TCOD_TYPE_VALUELIST05 = 13, + TCOD_TYPE_VALUELIST06 = 14, + TCOD_TYPE_VALUELIST07 = 15, + TCOD_TYPE_VALUELIST08 = 16, + TCOD_TYPE_VALUELIST09 = 17, + TCOD_TYPE_VALUELIST10 = 18, + TCOD_TYPE_VALUELIST11 = 19, + TCOD_TYPE_VALUELIST12 = 20, + TCOD_TYPE_VALUELIST13 = 21, + TCOD_TYPE_VALUELIST14 = 22, + TCOD_TYPE_VALUELIST15 = 23, + TCOD_TYPE_CUSTOM00 = 24, + TCOD_TYPE_CUSTOM01 = 25, + TCOD_TYPE_CUSTOM02 = 26, + TCOD_TYPE_CUSTOM03 = 27, + TCOD_TYPE_CUSTOM04 = 28, + TCOD_TYPE_CUSTOM05 = 29, + TCOD_TYPE_CUSTOM06 = 30, + TCOD_TYPE_CUSTOM07 = 31, + TCOD_TYPE_CUSTOM08 = 32, + TCOD_TYPE_CUSTOM09 = 33, + TCOD_TYPE_CUSTOM10 = 34, + TCOD_TYPE_CUSTOM11 = 35, + TCOD_TYPE_CUSTOM12 = 36, + TCOD_TYPE_CUSTOM13 = 37, + TCOD_TYPE_CUSTOM14 = 38, + TCOD_TYPE_CUSTOM15 = 39, + TCOD_TYPE_LIST = 1024, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union TCOD_value_t { + pub b: bool, + pub c: ::std::os::raw::c_char, + pub i: i32, + pub f: f32, + pub s: *mut ::std::os::raw::c_char, + pub col: TCOD_color_t, + pub dice: TCOD_dice_t, + pub list: TCOD_list_t, + pub custom: *mut ::std::os::raw::c_void, + _bindgen_union_align: [u64; 2usize], +} +#[test] +fn bindgen_test_layout_TCOD_value_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_value_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_value_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(b) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(c) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).i as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(i) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).f as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(f) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).s as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(s) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).col as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(col) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dice as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(dice) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).list as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(list) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).custom as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(custom) + ) + ); +} +impl Default for TCOD_value_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_parser_struct_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_struct_get_name(def: TCOD_parser_struct_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_struct_add_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_list_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list_sized( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + size: ::std::os::raw::c_int, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_flag(def: TCOD_parser_struct_t, propname: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_struct_add_structure( + def: TCOD_parser_struct_t, + sub_structure: TCOD_parser_struct_t, + ); +} +extern "C" { + pub fn TCOD_struct_is_mandatory( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_struct_get_type( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> TCOD_value_type_t; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_parser_listener_t { + pub new_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub new_flag: + ::std::option::Option bool>, + pub new_property: ::std::option::Option< + unsafe extern "C" fn( + propname: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + value: TCOD_value_t, + ) -> bool, + >, + pub end_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub error: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_TCOD_parser_listener_t() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_parser_listener_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_parser_listener_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).new_struct as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_struct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).new_flag as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_flag) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).new_property as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_property) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).end_struct as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(end_struct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).error as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(error) + ) + ); +} +pub type TCOD_parser_custom_t = ::std::option::Option< + unsafe extern "C" fn( + lex: *mut TCOD_lex_t, + listener: *mut TCOD_parser_listener_t, + str: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + ) -> TCOD_value_t, +>; +pub type TCOD_parser_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_parser_new() -> TCOD_parser_t; +} +extern "C" { + pub fn TCOD_parser_new_struct( + parser: TCOD_parser_t, + name: *mut ::std::os::raw::c_char, + ) -> TCOD_parser_struct_t; +} +extern "C" { + pub fn TCOD_parser_new_custom_type( + parser: TCOD_parser_t, + custom_type_parser: TCOD_parser_custom_t, + ) -> TCOD_value_type_t; +} +extern "C" { + pub fn TCOD_parser_run( + parser: TCOD_parser_t, + filename: *const ::std::os::raw::c_char, + listener: *mut TCOD_parser_listener_t, + ); +} +extern "C" { + pub fn TCOD_parser_delete(parser: TCOD_parser_t); +} +extern "C" { + pub fn TCOD_parser_error(msg: *const ::std::os::raw::c_char, ...); +} +extern "C" { + pub fn TCOD_parser_has_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_parser_get_bool_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_parser_get_char_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_parser_get_int_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_parser_get_float_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> f32; +} +extern "C" { + pub fn TCOD_parser_get_string_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_parser_get_color_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_parser_get_dice_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_dice_t; +} +extern "C" { + pub fn TCOD_parser_get_dice_property_py( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + dice: *mut TCOD_dice_t, + ); +} +extern "C" { + pub fn TCOD_parser_get_custom_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_parser_get_list_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + ) -> TCOD_list_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_struct_int_t { + pub name: *mut ::std::os::raw::c_char, + pub flags: TCOD_list_t, + pub props: TCOD_list_t, + pub lists: TCOD_list_t, + pub structs: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_struct_int_t() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_struct_int_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_struct_int_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_struct_int_t), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_struct_int_t), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_struct_int_t), + "::", + stringify!(props) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lists as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_struct_int_t), + "::", + stringify!(lists) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_struct_int_t), + "::", + stringify!(structs) + ) + ); +} +impl Default for TCOD_struct_int_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_parser_int_t { + pub structs: TCOD_list_t, + pub customs: [TCOD_parser_custom_t; 16usize], + pub fatal: bool, + pub props: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_parser_int_t() { + assert_eq!( + ::std::mem::size_of::(), + 152usize, + concat!("Size of: ", stringify!(TCOD_parser_int_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_parser_int_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_int_t), + "::", + stringify!(structs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).customs as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_int_t), + "::", + stringify!(customs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fatal as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_int_t), + "::", + stringify!(fatal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_int_t), + "::", + stringify!(props) + ) + ); +} +impl Default for TCOD_parser_int_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_parse_bool_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_char_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_integer_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_float_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_string_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_color_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_dice_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_value_list_value( + def: *mut TCOD_struct_int_t, + listnum: ::std::os::raw::c_int, + ) -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_property_value( + parser: *mut TCOD_parser_int_t, + def: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + list: bool, + ) -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_sys_startup(); +} +extern "C" { + pub fn TCOD_sys_shutdown(); +} +extern "C" { + pub fn TCOD_sys_elapsed_milli() -> u32; +} +extern "C" { + pub fn TCOD_sys_elapsed_seconds() -> f32; +} +extern "C" { + pub fn TCOD_sys_sleep_milli(val: u32); +} +extern "C" { + pub fn TCOD_sys_set_fps(val: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_sys_get_fps() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_sys_get_last_frame_length() -> f32; +} +extern "C" { + pub fn TCOD_sys_save_screenshot(filename: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_sys_force_fullscreen_resolution( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_set_renderer(renderer: TCOD_renderer_t); +} +extern "C" { + pub fn TCOD_sys_get_renderer() -> TCOD_renderer_t; +} +extern "C" { + pub fn TCOD_sys_get_current_resolution( + w: *mut ::std::os::raw::c_int, + h: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_fullscreen_offsets( + offx: *mut ::std::os::raw::c_int, + offy: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_char_size(w: *mut ::std::os::raw::c_int, h: *mut ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_sys_update_char( + asciiCode: ::std::os::raw::c_int, + fontx: ::std::os::raw::c_int, + fonty: ::std::os::raw::c_int, + img: TCOD_image_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_SDL_window() -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_sys_get_SDL_renderer() -> *mut ::std::os::raw::c_void; +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_event_t { + TCOD_EVENT_NONE = 0, + TCOD_EVENT_KEY_PRESS = 1, + TCOD_EVENT_KEY_RELEASE = 2, + TCOD_EVENT_KEY = 3, + TCOD_EVENT_MOUSE_MOVE = 4, + TCOD_EVENT_MOUSE_PRESS = 8, + TCOD_EVENT_MOUSE_RELEASE = 16, + TCOD_EVENT_MOUSE = 28, + TCOD_EVENT_FINGER_MOVE = 32, + TCOD_EVENT_FINGER_PRESS = 64, + TCOD_EVENT_FINGER_RELEASE = 128, + TCOD_EVENT_FINGER = 224, + TCOD_EVENT_ANY = 255, +} +extern "C" { + pub fn TCOD_sys_wait_for_event( + eventMask: ::std::os::raw::c_int, + key: *mut TCOD_key_t, + mouse: *mut TCOD_mouse_t, + flush: bool, + ) -> TCOD_event_t; +} +extern "C" { + pub fn TCOD_sys_check_for_event( + eventMask: ::std::os::raw::c_int, + key: *mut TCOD_key_t, + mouse: *mut TCOD_mouse_t, + ) -> TCOD_event_t; +} +extern "C" { + pub fn TCOD_sys_create_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_delete_file(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_delete_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_is_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_get_directory_content( + path: *const ::std::os::raw::c_char, + pattern: *const ::std::os::raw::c_char, + ) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_sys_file_exists(filename: *const ::std::os::raw::c_char, ...) -> bool; +} +extern "C" { + pub fn TCOD_sys_read_file( + filename: *const ::std::os::raw::c_char, + buf: *mut *mut ::std::os::raw::c_uchar, + size: *mut size_t, + ) -> bool; +} +extern "C" { + pub fn TCOD_sys_write_file( + filename: *const ::std::os::raw::c_char, + buf: *mut ::std::os::raw::c_uchar, + size: u32, + ) -> bool; +} +extern "C" { + pub fn TCOD_sys_clipboard_set(value: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_clipboard_get() -> *mut ::std::os::raw::c_char; +} +pub type TCOD_thread_t = *mut ::std::os::raw::c_void; +pub type TCOD_semaphore_t = *mut ::std::os::raw::c_void; +pub type TCOD_mutex_t = *mut ::std::os::raw::c_void; +pub type TCOD_cond_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_thread_new( + func: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, + >, + data: *mut ::std::os::raw::c_void, + ) -> TCOD_thread_t; +} +extern "C" { + pub fn TCOD_thread_delete(th: TCOD_thread_t); +} +extern "C" { + pub fn TCOD_sys_get_num_cores() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_thread_wait(th: TCOD_thread_t); +} +extern "C" { + pub fn TCOD_mutex_new() -> TCOD_mutex_t; +} +extern "C" { + pub fn TCOD_mutex_in(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_mutex_out(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_mutex_delete(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_semaphore_new(initVal: ::std::os::raw::c_int) -> TCOD_semaphore_t; +} +extern "C" { + pub fn TCOD_semaphore_lock(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_semaphore_unlock(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_semaphore_delete(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_condition_new() -> TCOD_cond_t; +} +extern "C" { + pub fn TCOD_condition_signal(sem: TCOD_cond_t); +} +extern "C" { + pub fn TCOD_condition_broadcast(sem: TCOD_cond_t); +} +extern "C" { + pub fn TCOD_condition_wait(sem: TCOD_cond_t, mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_condition_delete(sem: TCOD_cond_t); +} +pub type TCOD_library_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_load_library(path: *const ::std::os::raw::c_char) -> TCOD_library_t; +} +extern "C" { + pub fn TCOD_get_function_address( + library: TCOD_library_t, + function_name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_close_library(arg1: TCOD_library_t); +} +pub type SDL_renderer_t = + ::std::option::Option; +extern "C" { + pub fn TCOD_sys_register_SDL_renderer(renderer: SDL_renderer_t); +} +pub type TCOD_text_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_text_init( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + max_chars: ::std::os::raw::c_int, + ) -> TCOD_text_t; +} +extern "C" { + pub fn TCOD_text_init2( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + max_chars: ::std::os::raw::c_int, + ) -> TCOD_text_t; +} +extern "C" { + pub fn TCOD_text_set_pos(txt: TCOD_text_t, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_text_set_properties( + txt: TCOD_text_t, + cursor_char: ::std::os::raw::c_int, + blink_interval: ::std::os::raw::c_int, + prompt: *const ::std::os::raw::c_char, + tab_size: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_text_set_colors( + txt: TCOD_text_t, + fore: TCOD_color_t, + back: TCOD_color_t, + back_transparency: f32, + ); +} +extern "C" { + pub fn TCOD_text_update(txt: TCOD_text_t, key: TCOD_key_t) -> bool; +} +extern "C" { + pub fn TCOD_text_render(txt: TCOD_text_t, con: TCOD_console_t); +} +extern "C" { + pub fn TCOD_text_get(txt: TCOD_text_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_text_reset(txt: TCOD_text_t); +} +extern "C" { + pub fn TCOD_text_delete(txt: TCOD_text_t); +} +pub type TCOD_zip_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_zip_new() -> TCOD_zip_t; +} +extern "C" { + pub fn TCOD_zip_delete(zip: TCOD_zip_t); +} +extern "C" { + pub fn TCOD_zip_put_char(zip: TCOD_zip_t, val: ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_zip_put_int(zip: TCOD_zip_t, val: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_zip_put_float(zip: TCOD_zip_t, val: f32); +} +extern "C" { + pub fn TCOD_zip_put_string(zip: TCOD_zip_t, val: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_zip_put_color(zip: TCOD_zip_t, val: TCOD_color_t); +} +extern "C" { + pub fn TCOD_zip_put_image(zip: TCOD_zip_t, val: TCOD_image_t); +} +extern "C" { + pub fn TCOD_zip_put_console(zip: TCOD_zip_t, val: TCOD_console_t); +} +extern "C" { + pub fn TCOD_zip_put_data( + zip: TCOD_zip_t, + nbBytes: ::std::os::raw::c_int, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn TCOD_zip_get_current_bytes(zip: TCOD_zip_t) -> u32; +} +extern "C" { + pub fn TCOD_zip_save_to_file( + zip: TCOD_zip_t, + filename: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_load_from_file( + zip: TCOD_zip_t, + filename: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_char(zip: TCOD_zip_t) -> ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_zip_get_int(zip: TCOD_zip_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_float(zip: TCOD_zip_t) -> f32; +} +extern "C" { + pub fn TCOD_zip_get_string(zip: TCOD_zip_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_zip_get_color(zip: TCOD_zip_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_zip_get_image(zip: TCOD_zip_t) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_zip_get_console(zip: TCOD_zip_t) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_zip_get_data( + zip: TCOD_zip_t, + nbBytes: ::std::os::raw::c_int, + data: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_remaining_bytes(zip: TCOD_zip_t) -> u32; +} +extern "C" { + pub fn TCOD_zip_skip_bytes(zip: TCOD_zip_t, nbBytes: u32); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __crt_locale_data { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __crt_multibyte_data { + pub _address: u8, +} From 899cd6a70103db5906e47df8bf5a5c195f58243d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sat, 27 Jun 2020 13:10:56 +0200 Subject: [PATCH 02/27] Update outdated dependencies --- Cargo.toml | 4 ++-- src/input.rs | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 87f2b73dc..409cbabca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,8 +31,8 @@ name = "tcod" path = "src/lib.rs" [dependencies] -bitflags = "0.1" -lazy_static = "0.1" +bitflags = "1.2" +lazy_static = "1.4" rustc-serialize = { optional = true, version = "0.3" } serde = { optional = true, version = "1.0" } serde_derive = { optional = true, version = "1.0" } diff --git a/src/input.rs b/src/input.rs index 1535c6de2..d80b1cee4 100644 --- a/src/input.rs +++ b/src/input.rs @@ -169,22 +169,22 @@ pub fn move_cursor(x: i32, y: i32) { } bitflags! { - flags KeyPressFlags: c_uint { - const KEY_PRESSED = ffi::TCOD_key_status_t::TCOD_KEY_PRESSED as c_uint, - const KEY_RELEASED = ffi::TCOD_key_status_t::TCOD_KEY_RELEASED as c_uint, + pub struct KeyPressFlags: c_uint { + const KEY_PRESSED = ffi::TCOD_key_status_t::TCOD_KEY_PRESSED as c_uint; + const KEY_RELEASED = ffi::TCOD_key_status_t::TCOD_KEY_RELEASED as c_uint; } } bitflags! { - flags EventFlags: c_uint { - const KEY_PRESS = ffi::TCOD_event_t::TCOD_EVENT_KEY_PRESS as c_uint, - const KEY_RELEASE = ffi::TCOD_event_t::TCOD_EVENT_KEY_RELEASE as c_uint, - const KEY = ffi::TCOD_event_t::TCOD_EVENT_KEY as c_uint, - const MOUSE_MOVE = ffi::TCOD_event_t::TCOD_EVENT_MOUSE_MOVE as c_uint, - const MOUSE_PRESS = ffi::TCOD_event_t::TCOD_EVENT_MOUSE_PRESS as c_uint, - const MOUSE_RELEASE = ffi::TCOD_event_t::TCOD_EVENT_MOUSE_RELEASE as c_uint, - const MOUSE = ffi::TCOD_event_t::TCOD_EVENT_MOUSE as c_uint, - const ANY = ffi::TCOD_event_t::TCOD_EVENT_ANY as c_uint, + pub struct EventFlags: c_uint { + const KEY_PRESS = ffi::TCOD_event_t::TCOD_EVENT_KEY_PRESS as c_uint; + const KEY_RELEASE = ffi::TCOD_event_t::TCOD_EVENT_KEY_RELEASE as c_uint; + const KEY = ffi::TCOD_event_t::TCOD_EVENT_KEY as c_uint; + const MOUSE_MOVE = ffi::TCOD_event_t::TCOD_EVENT_MOUSE_MOVE as c_uint; + const MOUSE_PRESS = ffi::TCOD_event_t::TCOD_EVENT_MOUSE_PRESS as c_uint; + const MOUSE_RELEASE = ffi::TCOD_event_t::TCOD_EVENT_MOUSE_RELEASE as c_uint; + const MOUSE = ffi::TCOD_event_t::TCOD_EVENT_MOUSE as c_uint; + const ANY = ffi::TCOD_event_t::TCOD_EVENT_ANY as c_uint; } } @@ -198,23 +198,23 @@ pub fn check_for_event(event_mask: EventFlags) -> Option<(EventFlags, Event)> { }; let ret_flag = match event { - ffi::TCOD_event_t::TCOD_EVENT_KEY_PRESS => KEY_PRESS, - ffi::TCOD_event_t::TCOD_EVENT_KEY_RELEASE => KEY_RELEASE, - ffi::TCOD_event_t::TCOD_EVENT_KEY => KEY, - ffi::TCOD_event_t::TCOD_EVENT_MOUSE => MOUSE, - ffi::TCOD_event_t::TCOD_EVENT_MOUSE_MOVE => MOUSE_MOVE, - ffi::TCOD_event_t::TCOD_EVENT_MOUSE_PRESS => MOUSE_PRESS, - ffi::TCOD_event_t::TCOD_EVENT_MOUSE_RELEASE => MOUSE_RELEASE, - _ => ANY + ffi::TCOD_event_t::TCOD_EVENT_KEY_PRESS => EventFlags::KEY_PRESS, + ffi::TCOD_event_t::TCOD_EVENT_KEY_RELEASE => EventFlags::KEY_RELEASE, + ffi::TCOD_event_t::TCOD_EVENT_KEY => EventFlags::KEY, + ffi::TCOD_event_t::TCOD_EVENT_MOUSE => EventFlags::MOUSE, + ffi::TCOD_event_t::TCOD_EVENT_MOUSE_MOVE => EventFlags::MOUSE_MOVE, + ffi::TCOD_event_t::TCOD_EVENT_MOUSE_PRESS => EventFlags::MOUSE_PRESS, + ffi::TCOD_event_t::TCOD_EVENT_MOUSE_RELEASE => EventFlags::MOUSE_RELEASE, + _ => EventFlags::ANY }; - if ret_flag == ANY { + if ret_flag == EventFlags::ANY { return None } - let ret_event = if ret_flag.intersects(KEY_PRESS|KEY_RELEASE|KEY) { + let ret_event = if ret_flag.intersects(EventFlags::KEY_PRESS|EventFlags::KEY_RELEASE|EventFlags::KEY) { Some(Event::Key(c_key_state.into())) - } else if ret_flag.intersects(MOUSE_MOVE|MOUSE_PRESS|MOUSE_RELEASE|MOUSE) { + } else if ret_flag.intersects(EventFlags::MOUSE_MOVE|EventFlags::MOUSE_PRESS|EventFlags::MOUSE_RELEASE|EventFlags::MOUSE) { Some(Event::Mouse(Mouse { x: c_mouse_state.x as isize, y: c_mouse_state.y as isize, @@ -262,6 +262,6 @@ impl Iterator for EventIterator { type Item = (EventFlags, Event); fn next(&mut self) -> Option<(EventFlags, Event)> { - check_for_event(KEY | MOUSE) + check_for_event(EventFlags::KEY | EventFlags::MOUSE) } } From da3557fa4bb7563d721d0297f27c3a0744f7ad42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sat, 27 Jun 2020 13:22:13 +0200 Subject: [PATCH 03/27] Left some junk behind in README.md --- tcod_sys/README.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tcod_sys/README.md b/tcod_sys/README.md index 884ed1b82..32a25ae8a 100644 --- a/tcod_sys/README.md +++ b/tcod_sys/README.md @@ -16,14 +16,3 @@ target, will panic during the build with a message about the bindings missing: ``` thread 'main' panicked at 'No bindings found for $TARGET', build.rs:148:9 ``` - -The current raw bindings were generated using -[rust-bindgen](https://github.com/rust-lang/rust-bindgen) (v0.54) and are located at -`src/ffi.rs`. The safe (hopefully?) wrapper was built on top of them at -`src/lib.rs`. - -You can regenerate the raw bindings by running: - -```sh -bindgen --builtins --default-enum-style rust --with-derive-default --raw-line "#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]" libtcod/include/libtcod.h -o lib.rs -``` From 137fbb72f8d3143575f62ab44b9d9dcf8467f6e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sat, 27 Jun 2020 13:32:32 +0200 Subject: [PATCH 04/27] Add bindings for x86_64 Linux --- tcod_sys/x86_64-unknown-linux-gnu_bindings.rs | 9835 +++++++++++++++++ 1 file changed, 9835 insertions(+) create mode 100644 tcod_sys/x86_64-unknown-linux-gnu_bindings.rs diff --git a/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs b/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs new file mode 100644 index 000000000..b0e03c6dc --- /dev/null +++ b/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs @@ -0,0 +1,9835 @@ +/* automatically generated by rust-bindgen */ + +pub const __llvm__: u32 = 1; +pub const __clang__: u32 = 1; +pub const __clang_major__: u32 = 10; +pub const __clang_minor__: u32 = 0; +pub const __clang_patchlevel__: u32 = 0; +pub const __clang_version__: &'static [u8; 8usize] = b"10.0.0 \0"; +pub const __GNUC__: u32 = 4; +pub const __GNUC_MINOR__: u32 = 2; +pub const __GNUC_PATCHLEVEL__: u32 = 1; +pub const __GXX_ABI_VERSION: u32 = 1002; +pub const __ATOMIC_RELAXED: u32 = 0; +pub const __ATOMIC_CONSUME: u32 = 1; +pub const __ATOMIC_ACQUIRE: u32 = 2; +pub const __ATOMIC_RELEASE: u32 = 3; +pub const __ATOMIC_ACQ_REL: u32 = 4; +pub const __ATOMIC_SEQ_CST: u32 = 5; +pub const __OPENCL_MEMORY_SCOPE_WORK_ITEM: u32 = 0; +pub const __OPENCL_MEMORY_SCOPE_WORK_GROUP: u32 = 1; +pub const __OPENCL_MEMORY_SCOPE_DEVICE: u32 = 2; +pub const __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES: u32 = 3; +pub const __OPENCL_MEMORY_SCOPE_SUB_GROUP: u32 = 4; +pub const __PRAGMA_REDEFINE_EXTNAME: u32 = 1; +pub const __VERSION__: &'static [u8; 14usize] = b"Clang 10.0.0 \0"; +pub const __OBJC_BOOL_IS_BOOL: u32 = 0; +pub const __CONSTANT_CFSTRINGS__: u32 = 1; +pub const __ORDER_LITTLE_ENDIAN__: u32 = 1234; +pub const __ORDER_BIG_ENDIAN__: u32 = 4321; +pub const __ORDER_PDP_ENDIAN__: u32 = 3412; +pub const __BYTE_ORDER__: u32 = 1234; +pub const __LITTLE_ENDIAN__: u32 = 1; +pub const _LP64: u32 = 1; +pub const __LP64__: u32 = 1; +pub const __CHAR_BIT__: u32 = 8; +pub const __SCHAR_MAX__: u32 = 127; +pub const __SHRT_MAX__: u32 = 32767; +pub const __INT_MAX__: u32 = 2147483647; +pub const __LONG_MAX__: u64 = 9223372036854775807; +pub const __LONG_LONG_MAX__: u64 = 9223372036854775807; +pub const __WCHAR_MAX__: u32 = 2147483647; +pub const __WINT_MAX__: u32 = 4294967295; +pub const __INTMAX_MAX__: u64 = 9223372036854775807; +pub const __SIZE_MAX__: i32 = -1; +pub const __UINTMAX_MAX__: i32 = -1; +pub const __PTRDIFF_MAX__: u64 = 9223372036854775807; +pub const __INTPTR_MAX__: u64 = 9223372036854775807; +pub const __UINTPTR_MAX__: i32 = -1; +pub const __SIZEOF_DOUBLE__: u32 = 8; +pub const __SIZEOF_FLOAT__: u32 = 4; +pub const __SIZEOF_INT__: u32 = 4; +pub const __SIZEOF_LONG__: u32 = 8; +pub const __SIZEOF_LONG_DOUBLE__: u32 = 16; +pub const __SIZEOF_LONG_LONG__: u32 = 8; +pub const __SIZEOF_POINTER__: u32 = 8; +pub const __SIZEOF_SHORT__: u32 = 2; +pub const __SIZEOF_PTRDIFF_T__: u32 = 8; +pub const __SIZEOF_SIZE_T__: u32 = 8; +pub const __SIZEOF_WCHAR_T__: u32 = 4; +pub const __SIZEOF_WINT_T__: u32 = 4; +pub const __SIZEOF_INT128__: u32 = 16; +pub const __INTMAX_FMTd__: &'static [u8; 3usize] = b"ld\0"; +pub const __INTMAX_FMTi__: &'static [u8; 3usize] = b"li\0"; +pub const __UINTMAX_FMTo__: &'static [u8; 3usize] = b"lo\0"; +pub const __UINTMAX_FMTu__: &'static [u8; 3usize] = b"lu\0"; +pub const __UINTMAX_FMTx__: &'static [u8; 3usize] = b"lx\0"; +pub const __UINTMAX_FMTX__: &'static [u8; 3usize] = b"lX\0"; +pub const __INTMAX_WIDTH__: u32 = 64; +pub const __PTRDIFF_FMTd__: &'static [u8; 3usize] = b"ld\0"; +pub const __PTRDIFF_FMTi__: &'static [u8; 3usize] = b"li\0"; +pub const __PTRDIFF_WIDTH__: u32 = 64; +pub const __INTPTR_FMTd__: &'static [u8; 3usize] = b"ld\0"; +pub const __INTPTR_FMTi__: &'static [u8; 3usize] = b"li\0"; +pub const __INTPTR_WIDTH__: u32 = 64; +pub const __SIZE_FMTo__: &'static [u8; 3usize] = b"lo\0"; +pub const __SIZE_FMTu__: &'static [u8; 3usize] = b"lu\0"; +pub const __SIZE_FMTx__: &'static [u8; 3usize] = b"lx\0"; +pub const __SIZE_FMTX__: &'static [u8; 3usize] = b"lX\0"; +pub const __SIZE_WIDTH__: u32 = 64; +pub const __WCHAR_WIDTH__: u32 = 32; +pub const __WINT_WIDTH__: u32 = 32; +pub const __SIG_ATOMIC_WIDTH__: u32 = 32; +pub const __SIG_ATOMIC_MAX__: u32 = 2147483647; +pub const __UINTMAX_WIDTH__: u32 = 64; +pub const __UINTPTR_FMTo__: &'static [u8; 3usize] = b"lo\0"; +pub const __UINTPTR_FMTu__: &'static [u8; 3usize] = b"lu\0"; +pub const __UINTPTR_FMTx__: &'static [u8; 3usize] = b"lx\0"; +pub const __UINTPTR_FMTX__: &'static [u8; 3usize] = b"lX\0"; +pub const __UINTPTR_WIDTH__: u32 = 64; +pub const __FLT_HAS_DENORM__: u32 = 1; +pub const __FLT_DIG__: u32 = 6; +pub const __FLT_DECIMAL_DIG__: u32 = 9; +pub const __FLT_HAS_INFINITY__: u32 = 1; +pub const __FLT_HAS_QUIET_NAN__: u32 = 1; +pub const __FLT_MANT_DIG__: u32 = 24; +pub const __FLT_MAX_10_EXP__: u32 = 38; +pub const __FLT_MAX_EXP__: u32 = 128; +pub const __FLT_MIN_10_EXP__: i32 = -37; +pub const __FLT_MIN_EXP__: i32 = -125; +pub const __DBL_HAS_DENORM__: u32 = 1; +pub const __DBL_DIG__: u32 = 15; +pub const __DBL_DECIMAL_DIG__: u32 = 17; +pub const __DBL_HAS_INFINITY__: u32 = 1; +pub const __DBL_HAS_QUIET_NAN__: u32 = 1; +pub const __DBL_MANT_DIG__: u32 = 53; +pub const __DBL_MAX_10_EXP__: u32 = 308; +pub const __DBL_MAX_EXP__: u32 = 1024; +pub const __DBL_MIN_10_EXP__: i32 = -307; +pub const __DBL_MIN_EXP__: i32 = -1021; +pub const __LDBL_HAS_DENORM__: u32 = 1; +pub const __LDBL_DIG__: u32 = 18; +pub const __LDBL_DECIMAL_DIG__: u32 = 21; +pub const __LDBL_HAS_INFINITY__: u32 = 1; +pub const __LDBL_HAS_QUIET_NAN__: u32 = 1; +pub const __LDBL_MANT_DIG__: u32 = 64; +pub const __LDBL_MAX_10_EXP__: u32 = 4932; +pub const __LDBL_MAX_EXP__: u32 = 16384; +pub const __LDBL_MIN_10_EXP__: i32 = -4931; +pub const __LDBL_MIN_EXP__: i32 = -16381; +pub const __POINTER_WIDTH__: u32 = 64; +pub const __BIGGEST_ALIGNMENT__: u32 = 16; +pub const __WINT_UNSIGNED__: u32 = 1; +pub const __INT8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __INT16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __INT32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __INT64_FMTd__: &'static [u8; 3usize] = b"ld\0"; +pub const __INT64_FMTi__: &'static [u8; 3usize] = b"li\0"; +pub const __UINT8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __UINT8_MAX__: u32 = 255; +pub const __INT8_MAX__: u32 = 127; +pub const __UINT16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __UINT16_MAX__: u32 = 65535; +pub const __INT16_MAX__: u32 = 32767; +pub const __UINT32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __UINT32_MAX__: u32 = 4294967295; +pub const __INT32_MAX__: u32 = 2147483647; +pub const __UINT64_FMTo__: &'static [u8; 3usize] = b"lo\0"; +pub const __UINT64_FMTu__: &'static [u8; 3usize] = b"lu\0"; +pub const __UINT64_FMTx__: &'static [u8; 3usize] = b"lx\0"; +pub const __UINT64_FMTX__: &'static [u8; 3usize] = b"lX\0"; +pub const __UINT64_MAX__: i32 = -1; +pub const __INT64_MAX__: u64 = 9223372036854775807; +pub const __INT_LEAST8_MAX__: u32 = 127; +pub const __INT_LEAST8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT_LEAST8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __UINT_LEAST8_MAX__: u32 = 255; +pub const __UINT_LEAST8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT_LEAST8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT_LEAST8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT_LEAST8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __INT_LEAST16_MAX__: u32 = 32767; +pub const __INT_LEAST16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT_LEAST16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __UINT_LEAST16_MAX__: u32 = 65535; +pub const __UINT_LEAST16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT_LEAST16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT_LEAST16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT_LEAST16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __INT_LEAST32_MAX__: u32 = 2147483647; +pub const __INT_LEAST32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT_LEAST32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __UINT_LEAST32_MAX__: u32 = 4294967295; +pub const __UINT_LEAST32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT_LEAST32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT_LEAST32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT_LEAST32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __INT_LEAST64_MAX__: u64 = 9223372036854775807; +pub const __INT_LEAST64_FMTd__: &'static [u8; 3usize] = b"ld\0"; +pub const __INT_LEAST64_FMTi__: &'static [u8; 3usize] = b"li\0"; +pub const __UINT_LEAST64_MAX__: i32 = -1; +pub const __UINT_LEAST64_FMTo__: &'static [u8; 3usize] = b"lo\0"; +pub const __UINT_LEAST64_FMTu__: &'static [u8; 3usize] = b"lu\0"; +pub const __UINT_LEAST64_FMTx__: &'static [u8; 3usize] = b"lx\0"; +pub const __UINT_LEAST64_FMTX__: &'static [u8; 3usize] = b"lX\0"; +pub const __INT_FAST8_MAX__: u32 = 127; +pub const __INT_FAST8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT_FAST8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __UINT_FAST8_MAX__: u32 = 255; +pub const __UINT_FAST8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT_FAST8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT_FAST8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT_FAST8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __INT_FAST16_MAX__: u32 = 32767; +pub const __INT_FAST16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT_FAST16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __UINT_FAST16_MAX__: u32 = 65535; +pub const __UINT_FAST16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT_FAST16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT_FAST16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT_FAST16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __INT_FAST32_MAX__: u32 = 2147483647; +pub const __INT_FAST32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT_FAST32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __UINT_FAST32_MAX__: u32 = 4294967295; +pub const __UINT_FAST32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT_FAST32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT_FAST32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT_FAST32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __INT_FAST64_MAX__: u64 = 9223372036854775807; +pub const __INT_FAST64_FMTd__: &'static [u8; 3usize] = b"ld\0"; +pub const __INT_FAST64_FMTi__: &'static [u8; 3usize] = b"li\0"; +pub const __UINT_FAST64_MAX__: i32 = -1; +pub const __UINT_FAST64_FMTo__: &'static [u8; 3usize] = b"lo\0"; +pub const __UINT_FAST64_FMTu__: &'static [u8; 3usize] = b"lu\0"; +pub const __UINT_FAST64_FMTx__: &'static [u8; 3usize] = b"lx\0"; +pub const __UINT_FAST64_FMTX__: &'static [u8; 3usize] = b"lX\0"; +pub const __FINITE_MATH_ONLY__: u32 = 0; +pub const __GNUC_STDC_INLINE__: u32 = 1; +pub const __GCC_ATOMIC_TEST_AND_SET_TRUEVAL: u32 = 1; +pub const __CLANG_ATOMIC_BOOL_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR16_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR32_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_WCHAR_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_SHORT_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_INT_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_LONG_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_LLONG_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_POINTER_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_BOOL_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_CHAR_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_CHAR16_T_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_CHAR32_T_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_WCHAR_T_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_SHORT_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_INT_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_LONG_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_LLONG_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_POINTER_LOCK_FREE: u32 = 2; +pub const __NO_INLINE__: u32 = 1; +pub const __FLT_EVAL_METHOD__: u32 = 0; +pub const __FLT_RADIX__: u32 = 2; +pub const __DECIMAL_DIG__: u32 = 21; +pub const __GCC_ASM_FLAG_OUTPUTS__: u32 = 1; +pub const __code_model_small_: u32 = 1; +pub const __amd64__: u32 = 1; +pub const __amd64: u32 = 1; +pub const __x86_64: u32 = 1; +pub const __x86_64__: u32 = 1; +pub const __SEG_GS: u32 = 1; +pub const __SEG_FS: u32 = 1; +pub const __k8: u32 = 1; +pub const __k8__: u32 = 1; +pub const __tune_k8__: u32 = 1; +pub const __NO_MATH_INLINES: u32 = 1; +pub const __FXSR__: u32 = 1; +pub const __SSE2__: u32 = 1; +pub const __SSE2_MATH__: u32 = 1; +pub const __SSE__: u32 = 1; +pub const __SSE_MATH__: u32 = 1; +pub const __MMX__: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8: u32 = 1; +pub const __SIZEOF_FLOAT128__: u32 = 16; +pub const unix: u32 = 1; +pub const __unix: u32 = 1; +pub const __unix__: u32 = 1; +pub const linux: u32 = 1; +pub const __linux: u32 = 1; +pub const __linux__: u32 = 1; +pub const __ELF__: u32 = 1; +pub const __gnu_linux__: u32 = 1; +pub const __FLOAT128__: u32 = 1; +pub const __STDC__: u32 = 1; +pub const __STDC_HOSTED__: u32 = 1; +pub const __STDC_VERSION__: u32 = 201112; +pub const __STDC_UTF_16__: u32 = 1; +pub const __STDC_UTF_32__: u32 = 1; +pub const _WCHAR_H: u32 = 1; +pub const _FEATURES_H: u32 = 1; +pub const _DEFAULT_SOURCE: u32 = 1; +pub const __GLIBC_USE_ISOC2X: u32 = 0; +pub const __USE_ISOC11: u32 = 1; +pub const __USE_ISOC99: u32 = 1; +pub const __USE_ISOC95: u32 = 1; +pub const __USE_POSIX_IMPLICITLY: u32 = 1; +pub const _POSIX_SOURCE: u32 = 1; +pub const _POSIX_C_SOURCE: u32 = 200809; +pub const __USE_POSIX: u32 = 1; +pub const __USE_POSIX2: u32 = 1; +pub const __USE_POSIX199309: u32 = 1; +pub const __USE_POSIX199506: u32 = 1; +pub const __USE_XOPEN2K: u32 = 1; +pub const __USE_XOPEN2K8: u32 = 1; +pub const _ATFILE_SOURCE: u32 = 1; +pub const __USE_MISC: u32 = 1; +pub const __USE_ATFILE: u32 = 1; +pub const __USE_FORTIFY_LEVEL: u32 = 0; +pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; +pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; +pub const _STDC_PREDEF_H: u32 = 1; +pub const __STDC_IEC_559__: u32 = 1; +pub const __STDC_IEC_559_COMPLEX__: u32 = 1; +pub const __STDC_ISO_10646__: u32 = 201706; +pub const __GNU_LIBRARY__: u32 = 6; +pub const __GLIBC__: u32 = 2; +pub const __GLIBC_MINOR__: u32 = 31; +pub const _SYS_CDEFS_H: u32 = 1; +pub const __glibc_c99_flexarr_available: u32 = 1; +pub const __WORDSIZE: u32 = 64; +pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; +pub const __SYSCALL_WORDSIZE: u32 = 64; +pub const __LONG_DOUBLE_USES_FLOAT128: u32 = 0; +pub const __HAVE_GENERIC_SELECTION: u32 = 1; +pub const __GLIBC_USE_LIB_EXT2: u32 = 0; +pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; +pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0; +pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; +pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0; +pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; +pub const __HAVE_FLOAT128: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT128: u32 = 0; +pub const __HAVE_FLOAT64X: u32 = 1; +pub const __HAVE_FLOAT64X_LONG_DOUBLE: u32 = 1; +pub const __HAVE_FLOAT16: u32 = 0; +pub const __HAVE_FLOAT32: u32 = 1; +pub const __HAVE_FLOAT64: u32 = 1; +pub const __HAVE_FLOAT32X: u32 = 1; +pub const __HAVE_FLOAT128X: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT16: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT32: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT64: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT32X: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT64X: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT128X: u32 = 0; +pub const __HAVE_FLOATN_NOT_TYPEDEF: u32 = 0; +pub const __GNUC_VA_LIST: u32 = 1; +pub const _BITS_WCHAR_H: u32 = 1; +pub const __WCHAR_MAX: u32 = 2147483647; +pub const __WCHAR_MIN: i32 = -2147483648; +pub const __wint_t_defined: u32 = 1; +pub const _WINT_T: u32 = 1; +pub const __mbstate_t_defined: u32 = 1; +pub const ____mbstate_t_defined: u32 = 1; +pub const ____FILE_defined: u32 = 1; +pub const __FILE_defined: u32 = 1; +pub const _BITS_TYPES_LOCALE_T_H: u32 = 1; +pub const _BITS_TYPES___LOCALE_T_H: u32 = 1; +pub const WCHAR_MIN: i32 = -2147483648; +pub const WCHAR_MAX: u32 = 2147483647; +pub const WEOF: u32 = 4294967295; +pub const _LIBC_LIMITS_H_: u32 = 1; +pub const MB_LEN_MAX: u32 = 16; +pub const LLONG_MAX: u64 = 9223372036854775807; +pub const ULLONG_MAX: i32 = -1; +pub const _BITS_POSIX1_LIM_H: u32 = 1; +pub const _POSIX_AIO_LISTIO_MAX: u32 = 2; +pub const _POSIX_AIO_MAX: u32 = 1; +pub const _POSIX_ARG_MAX: u32 = 4096; +pub const _POSIX_CHILD_MAX: u32 = 25; +pub const _POSIX_DELAYTIMER_MAX: u32 = 32; +pub const _POSIX_HOST_NAME_MAX: u32 = 255; +pub const _POSIX_LINK_MAX: u32 = 8; +pub const _POSIX_LOGIN_NAME_MAX: u32 = 9; +pub const _POSIX_MAX_CANON: u32 = 255; +pub const _POSIX_MAX_INPUT: u32 = 255; +pub const _POSIX_MQ_OPEN_MAX: u32 = 8; +pub const _POSIX_MQ_PRIO_MAX: u32 = 32; +pub const _POSIX_NAME_MAX: u32 = 14; +pub const _POSIX_NGROUPS_MAX: u32 = 8; +pub const _POSIX_OPEN_MAX: u32 = 20; +pub const _POSIX_PATH_MAX: u32 = 256; +pub const _POSIX_PIPE_BUF: u32 = 512; +pub const _POSIX_RE_DUP_MAX: u32 = 255; +pub const _POSIX_RTSIG_MAX: u32 = 8; +pub const _POSIX_SEM_NSEMS_MAX: u32 = 256; +pub const _POSIX_SEM_VALUE_MAX: u32 = 32767; +pub const _POSIX_SIGQUEUE_MAX: u32 = 32; +pub const _POSIX_SSIZE_MAX: u32 = 32767; +pub const _POSIX_STREAM_MAX: u32 = 8; +pub const _POSIX_SYMLINK_MAX: u32 = 255; +pub const _POSIX_SYMLOOP_MAX: u32 = 8; +pub const _POSIX_TIMER_MAX: u32 = 32; +pub const _POSIX_TTY_NAME_MAX: u32 = 9; +pub const _POSIX_TZNAME_MAX: u32 = 6; +pub const _POSIX_CLOCKRES_MIN: u32 = 20000000; +pub const NR_OPEN: u32 = 1024; +pub const NGROUPS_MAX: u32 = 65536; +pub const ARG_MAX: u32 = 131072; +pub const LINK_MAX: u32 = 127; +pub const MAX_CANON: u32 = 255; +pub const MAX_INPUT: u32 = 255; +pub const NAME_MAX: u32 = 255; +pub const PATH_MAX: u32 = 4096; +pub const PIPE_BUF: u32 = 4096; +pub const XATTR_NAME_MAX: u32 = 255; +pub const XATTR_SIZE_MAX: u32 = 65536; +pub const XATTR_LIST_MAX: u32 = 65536; +pub const RTSIG_MAX: u32 = 32; +pub const _POSIX_THREAD_KEYS_MAX: u32 = 128; +pub const PTHREAD_KEYS_MAX: u32 = 1024; +pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: u32 = 4; +pub const PTHREAD_DESTRUCTOR_ITERATIONS: u32 = 4; +pub const _POSIX_THREAD_THREADS_MAX: u32 = 64; +pub const AIO_PRIO_DELTA_MAX: u32 = 20; +pub const PTHREAD_STACK_MIN: u32 = 16384; +pub const DELAYTIMER_MAX: u32 = 2147483647; +pub const TTY_NAME_MAX: u32 = 32; +pub const LOGIN_NAME_MAX: u32 = 256; +pub const HOST_NAME_MAX: u32 = 64; +pub const MQ_PRIO_MAX: u32 = 32768; +pub const SEM_VALUE_MAX: u32 = 2147483647; +pub const _BITS_POSIX2_LIM_H: u32 = 1; +pub const _POSIX2_BC_BASE_MAX: u32 = 99; +pub const _POSIX2_BC_DIM_MAX: u32 = 2048; +pub const _POSIX2_BC_SCALE_MAX: u32 = 99; +pub const _POSIX2_BC_STRING_MAX: u32 = 1000; +pub const _POSIX2_COLL_WEIGHTS_MAX: u32 = 2; +pub const _POSIX2_EXPR_NEST_MAX: u32 = 32; +pub const _POSIX2_LINE_MAX: u32 = 2048; +pub const _POSIX2_RE_DUP_MAX: u32 = 255; +pub const _POSIX2_CHARCLASS_NAME_MAX: u32 = 14; +pub const BC_BASE_MAX: u32 = 99; +pub const BC_DIM_MAX: u32 = 2048; +pub const BC_SCALE_MAX: u32 = 99; +pub const BC_STRING_MAX: u32 = 1000; +pub const COLL_WEIGHTS_MAX: u32 = 255; +pub const EXPR_NEST_MAX: u32 = 32; +pub const LINE_MAX: u32 = 2048; +pub const CHARCLASS_NAME_MAX: u32 = 2048; +pub const RE_DUP_MAX: u32 = 32767; +pub const SCHAR_MAX: u32 = 127; +pub const SHRT_MAX: u32 = 32767; +pub const INT_MAX: u32 = 2147483647; +pub const LONG_MAX: u64 = 9223372036854775807; +pub const SCHAR_MIN: i32 = -128; +pub const SHRT_MIN: i32 = -32768; +pub const INT_MIN: i32 = -2147483648; +pub const LONG_MIN: i64 = -9223372036854775808; +pub const UCHAR_MAX: u32 = 255; +pub const USHRT_MAX: u32 = 65535; +pub const UINT_MAX: u32 = 4294967295; +pub const ULONG_MAX: i32 = -1; +pub const CHAR_BIT: u32 = 8; +pub const CHAR_MIN: i32 = -128; +pub const CHAR_MAX: u32 = 127; +pub const LLONG_MIN: i64 = -9223372036854775808; +pub const _BITS_TYPES_H: u32 = 1; +pub const __TIMESIZE: u32 = 64; +pub const _BITS_TYPESIZES_H: u32 = 1; +pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; +pub const __INO_T_MATCHES_INO64_T: u32 = 1; +pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; +pub const __STATFS_MATCHES_STATFS64: u32 = 1; +pub const __FD_SETSIZE: u32 = 1024; +pub const _BITS_TIME64_H: u32 = 1; +pub const _BITS_SIGNUM_H: u32 = 1; +pub const _BITS_SIGNUM_GENERIC_H: u32 = 1; +pub const SIGINT: u32 = 2; +pub const SIGILL: u32 = 4; +pub const SIGABRT: u32 = 6; +pub const SIGFPE: u32 = 8; +pub const SIGSEGV: u32 = 11; +pub const SIGTERM: u32 = 15; +pub const SIGHUP: u32 = 1; +pub const SIGQUIT: u32 = 3; +pub const SIGTRAP: u32 = 5; +pub const SIGKILL: u32 = 9; +pub const SIGBUS: u32 = 10; +pub const SIGSYS: u32 = 12; +pub const SIGPIPE: u32 = 13; +pub const SIGALRM: u32 = 14; +pub const SIGURG: u32 = 16; +pub const SIGSTOP: u32 = 17; +pub const SIGTSTP: u32 = 18; +pub const SIGCONT: u32 = 19; +pub const SIGCHLD: u32 = 20; +pub const SIGTTIN: u32 = 21; +pub const SIGTTOU: u32 = 22; +pub const SIGPOLL: u32 = 23; +pub const SIGXCPU: u32 = 24; +pub const SIGXFSZ: u32 = 25; +pub const SIGVTALRM: u32 = 26; +pub const SIGPROF: u32 = 27; +pub const SIGUSR1: u32 = 30; +pub const SIGUSR2: u32 = 31; +pub const SIGWINCH: u32 = 28; +pub const SIGIO: u32 = 23; +pub const SIGIOT: u32 = 6; +pub const SIGCLD: u32 = 20; +pub const __SIGRTMIN: u32 = 32; +pub const __SIGRTMAX: u32 = 32; +pub const _NSIG: u32 = 33; +pub const SIGSTKFLT: u32 = 16; +pub const SIGPWR: u32 = 30; +pub const __sig_atomic_t_defined: u32 = 1; +pub const __sigset_t_defined: u32 = 1; +pub const _STRUCT_TIMESPEC: u32 = 1; +pub const _BITS_ENDIAN_H: u32 = 1; +pub const __LITTLE_ENDIAN: u32 = 1234; +pub const __BIG_ENDIAN: u32 = 4321; +pub const __PDP_ENDIAN: u32 = 3412; +pub const _BITS_ENDIANNESS_H: u32 = 1; +pub const __BYTE_ORDER: u32 = 1234; +pub const __FLOAT_WORD_ORDER: u32 = 1234; +pub const __siginfo_t_defined: u32 = 1; +pub const __SI_MAX_SIZE: u32 = 128; +pub const _BITS_SIGINFO_ARCH_H: u32 = 1; +pub const __SI_ERRNO_THEN_CODE: u32 = 1; +pub const __SI_HAVE_SIGSYS: u32 = 1; +pub const _BITS_SIGINFO_CONSTS_H: u32 = 1; +pub const __SI_ASYNCIO_AFTER_SIGIO: u32 = 1; +pub const __sigevent_t_defined: u32 = 1; +pub const __SIGEV_MAX_SIZE: u32 = 64; +pub const __have_pthread_attr_t: u32 = 1; +pub const _BITS_SIGEVENT_CONSTS_H: u32 = 1; +pub const NSIG: u32 = 33; +pub const _BITS_SIGACTION_H: u32 = 1; +pub const SA_NOCLDSTOP: u32 = 1; +pub const SA_NOCLDWAIT: u32 = 2; +pub const SA_SIGINFO: u32 = 4; +pub const SA_ONSTACK: u32 = 134217728; +pub const SA_RESTART: u32 = 268435456; +pub const SA_NODEFER: u32 = 1073741824; +pub const SA_RESETHAND: u32 = 2147483648; +pub const SA_INTERRUPT: u32 = 536870912; +pub const SA_NOMASK: u32 = 1073741824; +pub const SA_ONESHOT: u32 = 2147483648; +pub const SA_STACK: u32 = 134217728; +pub const SIG_BLOCK: u32 = 0; +pub const SIG_UNBLOCK: u32 = 1; +pub const SIG_SETMASK: u32 = 2; +pub const _BITS_SIGCONTEXT_H: u32 = 1; +pub const FP_XSTATE_MAGIC1: u32 = 1179670611; +pub const FP_XSTATE_MAGIC2: u32 = 1179670597; +pub const __stack_t_defined: u32 = 1; +pub const _SYS_UCONTEXT_H: u32 = 1; +pub const __NGREG: u32 = 23; +pub const NGREG: u32 = 23; +pub const _BITS_SIGSTACK_H: u32 = 1; +pub const MINSIGSTKSZ: u32 = 2048; +pub const SIGSTKSZ: u32 = 8192; +pub const _BITS_SS_FLAGS_H: u32 = 1; +pub const __sigstack_defined: u32 = 1; +pub const _BITS_PTHREADTYPES_COMMON_H: u32 = 1; +pub const _THREAD_SHARED_TYPES_H: u32 = 1; +pub const _BITS_PTHREADTYPES_ARCH_H: u32 = 1; +pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40; +pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56; +pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56; +pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4; +pub const __SIZEOF_PTHREAD_COND_T: u32 = 48; +pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4; +pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8; +pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4; +pub const _THREAD_MUTEX_INTERNAL_H: u32 = 1; +pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1; +pub const _BITS_SIGTHREAD_H: u32 = 1; +pub const _STDINT_H: u32 = 1; +pub const _BITS_STDINT_INTN_H: u32 = 1; +pub const _BITS_STDINT_UINTN_H: u32 = 1; +pub const INT8_MIN: i32 = -128; +pub const INT16_MIN: i32 = -32768; +pub const INT32_MIN: i32 = -2147483648; +pub const INT8_MAX: u32 = 127; +pub const INT16_MAX: u32 = 32767; +pub const INT32_MAX: u32 = 2147483647; +pub const UINT8_MAX: u32 = 255; +pub const UINT16_MAX: u32 = 65535; +pub const UINT32_MAX: u32 = 4294967295; +pub const INT_LEAST8_MIN: i32 = -128; +pub const INT_LEAST16_MIN: i32 = -32768; +pub const INT_LEAST32_MIN: i32 = -2147483648; +pub const INT_LEAST8_MAX: u32 = 127; +pub const INT_LEAST16_MAX: u32 = 32767; +pub const INT_LEAST32_MAX: u32 = 2147483647; +pub const UINT_LEAST8_MAX: u32 = 255; +pub const UINT_LEAST16_MAX: u32 = 65535; +pub const UINT_LEAST32_MAX: u32 = 4294967295; +pub const INT_FAST8_MIN: i32 = -128; +pub const INT_FAST16_MIN: i64 = -9223372036854775808; +pub const INT_FAST32_MIN: i64 = -9223372036854775808; +pub const INT_FAST8_MAX: u32 = 127; +pub const INT_FAST16_MAX: u64 = 9223372036854775807; +pub const INT_FAST32_MAX: u64 = 9223372036854775807; +pub const UINT_FAST8_MAX: u32 = 255; +pub const UINT_FAST16_MAX: i32 = -1; +pub const UINT_FAST32_MAX: i32 = -1; +pub const INTPTR_MIN: i64 = -9223372036854775808; +pub const INTPTR_MAX: u64 = 9223372036854775807; +pub const UINTPTR_MAX: i32 = -1; +pub const PTRDIFF_MIN: i64 = -9223372036854775808; +pub const PTRDIFF_MAX: u64 = 9223372036854775807; +pub const SIG_ATOMIC_MIN: i32 = -2147483648; +pub const SIG_ATOMIC_MAX: u32 = 2147483647; +pub const SIZE_MAX: i32 = -1; +pub const WINT_MIN: u32 = 0; +pub const WINT_MAX: u32 = 4294967295; +pub const PRINTF_INT64_MODIFIER: &'static [u8; 2usize] = b"l\0"; +pub const PRINTF_INT32_MODIFIER: &'static [u8; 1usize] = b"\0"; +pub const PRINTF_INT16_MODIFIER: &'static [u8; 2usize] = b"h\0"; +pub const PRINTF_INTMAX_MODIFIER: &'static [u8; 2usize] = b"l\0"; +pub const PRINTF_INT64_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; +pub const PRINTF_UINT64_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; +pub const PRINTF_INT32_HEX_WIDTH: &'static [u8; 2usize] = b"8\0"; +pub const PRINTF_UINT32_HEX_WIDTH: &'static [u8; 2usize] = b"8\0"; +pub const PRINTF_INT16_HEX_WIDTH: &'static [u8; 2usize] = b"4\0"; +pub const PRINTF_UINT16_HEX_WIDTH: &'static [u8; 2usize] = b"4\0"; +pub const PRINTF_INT8_HEX_WIDTH: &'static [u8; 2usize] = b"2\0"; +pub const PRINTF_UINT8_HEX_WIDTH: &'static [u8; 2usize] = b"2\0"; +pub const PRINTF_INT64_DEC_WIDTH: &'static [u8; 3usize] = b"19\0"; +pub const PRINTF_UINT64_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; +pub const PRINTF_INT32_DEC_WIDTH: &'static [u8; 3usize] = b"10\0"; +pub const PRINTF_UINT32_DEC_WIDTH: &'static [u8; 3usize] = b"10\0"; +pub const PRINTF_INT16_DEC_WIDTH: &'static [u8; 2usize] = b"5\0"; +pub const PRINTF_UINT16_DEC_WIDTH: &'static [u8; 2usize] = b"5\0"; +pub const PRINTF_INT8_DEC_WIDTH: &'static [u8; 2usize] = b"3\0"; +pub const PRINTF_UINT8_DEC_WIDTH: &'static [u8; 2usize] = b"3\0"; +pub const PRINTF_INTMAX_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; +pub const PRINTF_UINTMAX_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; +pub const PRINTF_INTMAX_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; +pub const PRINTF_UINTMAX_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; +pub const true_: u32 = 1; +pub const false_: u32 = 0; +pub const __bool_true_false_are_defined: u32 = 1; +pub const TCOD_HEXVERSION: u32 = 67075; +pub const TCOD_STRVERSION: &'static [u8; 6usize] = b"1.6.3\0"; +pub const TCOD_TECHVERSION: u32 = 17171200; +pub const TCOD_STRVERSIONNAME: &'static [u8; 14usize] = b"libtcod 1.6.3\0"; +pub const TCOD_KEY_TEXT_SIZE: u32 = 32; +pub const TCOD_NOISE_MAX_OCTAVES: u32 = 128; +pub const TCOD_NOISE_MAX_DIMENSIONS: u32 = 4; +pub const TCOD_NOISE_DEFAULT_HURST: f64 = 0.5; +pub const TCOD_NOISE_DEFAULT_LACUNARITY: f64 = 2.0; +pub const TCOD_LEX_FLAG_NOCASE: u32 = 1; +pub const TCOD_LEX_FLAG_NESTING_COMMENT: u32 = 2; +pub const TCOD_LEX_FLAG_TOKENIZE_COMMENTS: u32 = 4; +pub const TCOD_LEX_ERROR: i32 = -1; +pub const TCOD_LEX_UNKNOWN: u32 = 0; +pub const TCOD_LEX_SYMBOL: u32 = 1; +pub const TCOD_LEX_KEYWORD: u32 = 2; +pub const TCOD_LEX_IDEN: u32 = 3; +pub const TCOD_LEX_STRING: u32 = 4; +pub const TCOD_LEX_INTEGER: u32 = 5; +pub const TCOD_LEX_FLOAT: u32 = 6; +pub const TCOD_LEX_CHAR: u32 = 7; +pub const TCOD_LEX_EOF: u32 = 8; +pub const TCOD_LEX_COMMENT: u32 = 9; +pub const TCOD_LEX_MAX_SYMBOLS: u32 = 100; +pub const TCOD_LEX_SYMBOL_SIZE: u32 = 5; +pub const TCOD_LEX_MAX_KEYWORDS: u32 = 100; +pub const TCOD_LEX_KEYWORD_SIZE: u32 = 20; +pub type _Float32 = f32; +pub type _Float64 = f64; +pub type _Float32x = f64; +pub type _Float64x = u128; +pub type size_t = ::std::os::raw::c_ulong; +pub type wchar_t = ::std::os::raw::c_int; +pub type va_list = __builtin_va_list; +pub type __gnuc_va_list = __builtin_va_list; +pub type wint_t = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct __mbstate_t { + pub __count: ::std::os::raw::c_int, + pub __value: __mbstate_t__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union __mbstate_t__bindgen_ty_1 { + pub __wch: ::std::os::raw::c_uint, + pub __wchb: [::std::os::raw::c_char; 4usize], + _bindgen_union_align: u32, +} +#[test] +fn bindgen_test_layout___mbstate_t__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::<__mbstate_t__bindgen_ty_1>(), + 4usize, + concat!("Size of: ", stringify!(__mbstate_t__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::<__mbstate_t__bindgen_ty_1>(), + 4usize, + concat!("Alignment of ", stringify!(__mbstate_t__bindgen_ty_1)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__mbstate_t__bindgen_ty_1>())).__wch as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__mbstate_t__bindgen_ty_1), + "::", + stringify!(__wch) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__mbstate_t__bindgen_ty_1>())).__wchb as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__mbstate_t__bindgen_ty_1), + "::", + stringify!(__wchb) + ) + ); +} +impl Default for __mbstate_t__bindgen_ty_1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[test] +fn bindgen_test_layout___mbstate_t() { + assert_eq!( + ::std::mem::size_of::<__mbstate_t>(), + 8usize, + concat!("Size of: ", stringify!(__mbstate_t)) + ); + assert_eq!( + ::std::mem::align_of::<__mbstate_t>(), + 4usize, + concat!("Alignment of ", stringify!(__mbstate_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__mbstate_t>())).__count as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__mbstate_t), + "::", + stringify!(__count) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__mbstate_t>())).__value as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__mbstate_t), + "::", + stringify!(__value) + ) + ); +} +impl Default for __mbstate_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type mbstate_t = __mbstate_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IO_FILE { + _unused: [u8; 0], +} +pub type __FILE = _IO_FILE; +pub type FILE = _IO_FILE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __locale_struct { + pub __locales: [*mut __locale_data; 13usize], + pub __ctype_b: *const ::std::os::raw::c_ushort, + pub __ctype_tolower: *const ::std::os::raw::c_int, + pub __ctype_toupper: *const ::std::os::raw::c_int, + pub __names: [*const ::std::os::raw::c_char; 13usize], +} +#[test] +fn bindgen_test_layout___locale_struct() { + assert_eq!( + ::std::mem::size_of::<__locale_struct>(), + 232usize, + concat!("Size of: ", stringify!(__locale_struct)) + ); + assert_eq!( + ::std::mem::align_of::<__locale_struct>(), + 8usize, + concat!("Alignment of ", stringify!(__locale_struct)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__locale_struct>())).__locales as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__locale_struct), + "::", + stringify!(__locales) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__locale_struct>())).__ctype_b as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(__locale_struct), + "::", + stringify!(__ctype_b) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__locale_struct>())).__ctype_tolower as *const _ as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(__locale_struct), + "::", + stringify!(__ctype_tolower) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__locale_struct>())).__ctype_toupper as *const _ as usize }, + 120usize, + concat!( + "Offset of field: ", + stringify!(__locale_struct), + "::", + stringify!(__ctype_toupper) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__locale_struct>())).__names as *const _ as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(__locale_struct), + "::", + stringify!(__names) + ) + ); +} +impl Default for __locale_struct { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type __locale_t = *mut __locale_struct; +pub type locale_t = __locale_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tm { + _unused: [u8; 0], +} +extern "C" { + pub fn wcscpy(__dest: *mut wchar_t, __src: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsncpy(__dest: *mut wchar_t, __src: *const wchar_t, __n: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscat(__dest: *mut wchar_t, __src: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsncat(__dest: *mut wchar_t, __src: *const wchar_t, __n: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscmp( + __s1: *const ::std::os::raw::c_int, + __s2: *const ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsncmp( + __s1: *const ::std::os::raw::c_int, + __s2: *const ::std::os::raw::c_int, + __n: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcscasecmp(__s1: *const wchar_t, __s2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsncasecmp( + __s1: *const wchar_t, + __s2: *const wchar_t, + __n: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcscasecmp_l( + __s1: *const wchar_t, + __s2: *const wchar_t, + __loc: locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsncasecmp_l( + __s1: *const wchar_t, + __s2: *const wchar_t, + __n: size_t, + __loc: locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcscoll(__s1: *const wchar_t, __s2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsxfrm(__s1: *mut wchar_t, __s2: *const wchar_t, __n: size_t) -> size_t; +} +extern "C" { + pub fn wcscoll_l( + __s1: *const wchar_t, + __s2: *const wchar_t, + __loc: locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsxfrm_l( + __s1: *mut wchar_t, + __s2: *const wchar_t, + __n: size_t, + __loc: locale_t, + ) -> size_t; +} +extern "C" { + pub fn wcsdup(__s: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcschr( + __wcs: *const ::std::os::raw::c_int, + __wc: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsrchr(__wcs: *const wchar_t, __wc: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscspn(__wcs: *const wchar_t, __reject: *const wchar_t) -> size_t; +} +extern "C" { + pub fn wcsspn(__wcs: *const wchar_t, __accept: *const wchar_t) -> size_t; +} +extern "C" { + pub fn wcspbrk(__wcs: *const wchar_t, __accept: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsstr(__haystack: *const wchar_t, __needle: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcstok( + __s: *mut wchar_t, + __delim: *const wchar_t, + __ptr: *mut *mut wchar_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn wcslen(__s: *const ::std::os::raw::c_int) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn wcsnlen(__s: *const wchar_t, __maxlen: size_t) -> size_t; +} +extern "C" { + pub fn wmemchr( + __s: *const ::std::os::raw::c_int, + __c: ::std::os::raw::c_int, + __n: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn wmemcmp( + __s1: *const ::std::os::raw::c_int, + __s2: *const ::std::os::raw::c_int, + __n: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wmemcpy( + __s1: *mut ::std::os::raw::c_int, + __s2: *const ::std::os::raw::c_int, + __n: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn wmemmove( + __s1: *mut ::std::os::raw::c_int, + __s2: *const ::std::os::raw::c_int, + __n: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn wmemset(__s: *mut wchar_t, __c: wchar_t, __n: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn btowc(__c: ::std::os::raw::c_int) -> wint_t; +} +extern "C" { + pub fn wctob(__c: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mbsinit(__ps: *const mbstate_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mbrtowc( + __pwc: *mut wchar_t, + __s: *const ::std::os::raw::c_char, + __n: size_t, + __p: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wcrtomb(__s: *mut ::std::os::raw::c_char, __wc: wchar_t, __ps: *mut mbstate_t) + -> size_t; +} +extern "C" { + pub fn __mbrlen( + __s: *const ::std::os::raw::c_char, + __n: size_t, + __ps: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn mbrlen(__s: *const ::std::os::raw::c_char, __n: size_t, __ps: *mut mbstate_t) -> size_t; +} +extern "C" { + pub fn mbsrtowcs( + __dst: *mut wchar_t, + __src: *mut *const ::std::os::raw::c_char, + __len: size_t, + __ps: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wcsrtombs( + __dst: *mut ::std::os::raw::c_char, + __src: *mut *const wchar_t, + __len: size_t, + __ps: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn mbsnrtowcs( + __dst: *mut wchar_t, + __src: *mut *const ::std::os::raw::c_char, + __nmc: size_t, + __len: size_t, + __ps: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wcsnrtombs( + __dst: *mut ::std::os::raw::c_char, + __src: *mut *const wchar_t, + __nwc: size_t, + __len: size_t, + __ps: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wcstod(__nptr: *const wchar_t, __endptr: *mut *mut wchar_t) -> f64; +} +extern "C" { + pub fn wcstof(__nptr: *const wchar_t, __endptr: *mut *mut wchar_t) -> f32; +} +extern "C" { + pub fn wcstold(__nptr: *const wchar_t, __endptr: *mut *mut wchar_t) -> u128; +} +extern "C" { + pub fn wcstol( + __nptr: *const wchar_t, + __endptr: *mut *mut wchar_t, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn wcstoul( + __nptr: *const wchar_t, + __endptr: *mut *mut wchar_t, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn wcstoll( + __nptr: *const wchar_t, + __endptr: *mut *mut wchar_t, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn wcstoull( + __nptr: *const wchar_t, + __endptr: *mut *mut wchar_t, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn wcpcpy(__dest: *mut wchar_t, __src: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcpncpy(__dest: *mut wchar_t, __src: *const wchar_t, __n: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn open_wmemstream(__bufloc: *mut *mut wchar_t, __sizeloc: *mut size_t) -> *mut __FILE; +} +extern "C" { + pub fn fwide(__fp: *mut __FILE, __mode: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fwprintf(__stream: *mut __FILE, __format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wprintf(__format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn swprintf( + __s: *mut wchar_t, + __n: size_t, + __format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vfwprintf( + __s: *mut __FILE, + __format: *const wchar_t, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vwprintf(__format: *const wchar_t, __arg: *mut __va_list_tag) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vswprintf( + __s: *mut wchar_t, + __n: size_t, + __format: *const wchar_t, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fwscanf(__stream: *mut __FILE, __format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wscanf(__format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn swscanf(__s: *const wchar_t, __format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "\u{1}__isoc99_fwscanf"] + pub fn fwscanf1(__stream: *mut __FILE, __format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "\u{1}__isoc99_wscanf"] + pub fn wscanf1(__format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "\u{1}__isoc99_swscanf"] + pub fn swscanf1(__s: *const wchar_t, __format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vfwscanf( + __s: *mut __FILE, + __format: *const wchar_t, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vwscanf(__format: *const wchar_t, __arg: *mut __va_list_tag) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vswscanf( + __s: *const wchar_t, + __format: *const wchar_t, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "\u{1}__isoc99_vfwscanf"] + pub fn vfwscanf1( + __s: *mut __FILE, + __format: *const wchar_t, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "\u{1}__isoc99_vwscanf"] + pub fn vwscanf1(__format: *const wchar_t, __arg: *mut __va_list_tag) -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "\u{1}__isoc99_vswscanf"] + pub fn vswscanf1( + __s: *const wchar_t, + __format: *const wchar_t, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgetwc(__stream: *mut __FILE) -> wint_t; +} +extern "C" { + pub fn getwc(__stream: *mut __FILE) -> wint_t; +} +extern "C" { + pub fn getwchar() -> wint_t; +} +extern "C" { + pub fn fputwc(__wc: wchar_t, __stream: *mut __FILE) -> wint_t; +} +extern "C" { + pub fn putwc(__wc: wchar_t, __stream: *mut __FILE) -> wint_t; +} +extern "C" { + pub fn putwchar(__wc: wchar_t) -> wint_t; +} +extern "C" { + pub fn fgetws( + __ws: *mut wchar_t, + __n: ::std::os::raw::c_int, + __stream: *mut __FILE, + ) -> *mut wchar_t; +} +extern "C" { + pub fn fputws(__ws: *const wchar_t, __stream: *mut __FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ungetwc(__wc: wint_t, __stream: *mut __FILE) -> wint_t; +} +extern "C" { + pub fn wcsftime( + __s: *mut wchar_t, + __maxsize: size_t, + __format: *const wchar_t, + __tp: *const tm, + ) -> size_t; +} +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Default, Copy, Clone)] +pub struct max_align_t { + pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, + pub __bindgen_padding_0: u64, + pub __clang_max_align_nonce2: u128, +} +#[test] +fn bindgen_test_layout_max_align_t() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(max_align_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 16usize, + concat!("Alignment of ", stringify!(max_align_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).__clang_max_align_nonce1 as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(max_align_t), + "::", + stringify!(__clang_max_align_nonce1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).__clang_max_align_nonce2 as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(max_align_t), + "::", + stringify!(__clang_max_align_nonce2) + ) + ); +} +pub type __u_char = ::std::os::raw::c_uchar; +pub type __u_short = ::std::os::raw::c_ushort; +pub type __u_int = ::std::os::raw::c_uint; +pub type __u_long = ::std::os::raw::c_ulong; +pub type __int8_t = ::std::os::raw::c_schar; +pub type __uint8_t = ::std::os::raw::c_uchar; +pub type __int16_t = ::std::os::raw::c_short; +pub type __uint16_t = ::std::os::raw::c_ushort; +pub type __int32_t = ::std::os::raw::c_int; +pub type __uint32_t = ::std::os::raw::c_uint; +pub type __int64_t = ::std::os::raw::c_long; +pub type __uint64_t = ::std::os::raw::c_ulong; +pub type __int_least8_t = __int8_t; +pub type __uint_least8_t = __uint8_t; +pub type __int_least16_t = __int16_t; +pub type __uint_least16_t = __uint16_t; +pub type __int_least32_t = __int32_t; +pub type __uint_least32_t = __uint32_t; +pub type __int_least64_t = __int64_t; +pub type __uint_least64_t = __uint64_t; +pub type __quad_t = ::std::os::raw::c_long; +pub type __u_quad_t = ::std::os::raw::c_ulong; +pub type __intmax_t = ::std::os::raw::c_long; +pub type __uintmax_t = ::std::os::raw::c_ulong; +pub type __dev_t = ::std::os::raw::c_ulong; +pub type __uid_t = ::std::os::raw::c_uint; +pub type __gid_t = ::std::os::raw::c_uint; +pub type __ino_t = ::std::os::raw::c_ulong; +pub type __ino64_t = ::std::os::raw::c_ulong; +pub type __mode_t = ::std::os::raw::c_uint; +pub type __nlink_t = ::std::os::raw::c_ulong; +pub type __off_t = ::std::os::raw::c_long; +pub type __off64_t = ::std::os::raw::c_long; +pub type __pid_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __fsid_t { + pub __val: [::std::os::raw::c_int; 2usize], +} +#[test] +fn bindgen_test_layout___fsid_t() { + assert_eq!( + ::std::mem::size_of::<__fsid_t>(), + 8usize, + concat!("Size of: ", stringify!(__fsid_t)) + ); + assert_eq!( + ::std::mem::align_of::<__fsid_t>(), + 4usize, + concat!("Alignment of ", stringify!(__fsid_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__fsid_t>())).__val as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__fsid_t), + "::", + stringify!(__val) + ) + ); +} +pub type __clock_t = ::std::os::raw::c_long; +pub type __rlim_t = ::std::os::raw::c_ulong; +pub type __rlim64_t = ::std::os::raw::c_ulong; +pub type __id_t = ::std::os::raw::c_uint; +pub type __time_t = ::std::os::raw::c_long; +pub type __useconds_t = ::std::os::raw::c_uint; +pub type __suseconds_t = ::std::os::raw::c_long; +pub type __daddr_t = ::std::os::raw::c_int; +pub type __key_t = ::std::os::raw::c_int; +pub type __clockid_t = ::std::os::raw::c_int; +pub type __timer_t = *mut ::std::os::raw::c_void; +pub type __blksize_t = ::std::os::raw::c_long; +pub type __blkcnt_t = ::std::os::raw::c_long; +pub type __blkcnt64_t = ::std::os::raw::c_long; +pub type __fsblkcnt_t = ::std::os::raw::c_ulong; +pub type __fsblkcnt64_t = ::std::os::raw::c_ulong; +pub type __fsfilcnt_t = ::std::os::raw::c_ulong; +pub type __fsfilcnt64_t = ::std::os::raw::c_ulong; +pub type __fsword_t = ::std::os::raw::c_long; +pub type __ssize_t = ::std::os::raw::c_long; +pub type __syscall_slong_t = ::std::os::raw::c_long; +pub type __syscall_ulong_t = ::std::os::raw::c_ulong; +pub type __loff_t = __off64_t; +pub type __caddr_t = *mut ::std::os::raw::c_char; +pub type __intptr_t = ::std::os::raw::c_long; +pub type __socklen_t = ::std::os::raw::c_uint; +pub type __sig_atomic_t = ::std::os::raw::c_int; +pub type sig_atomic_t = __sig_atomic_t; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __sigset_t { + pub __val: [::std::os::raw::c_ulong; 16usize], +} +#[test] +fn bindgen_test_layout___sigset_t() { + assert_eq!( + ::std::mem::size_of::<__sigset_t>(), + 128usize, + concat!("Size of: ", stringify!(__sigset_t)) + ); + assert_eq!( + ::std::mem::align_of::<__sigset_t>(), + 8usize, + concat!("Alignment of ", stringify!(__sigset_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sigset_t>())).__val as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__sigset_t), + "::", + stringify!(__val) + ) + ); +} +pub type sigset_t = __sigset_t; +pub type pid_t = __pid_t; +pub type uid_t = __uid_t; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct timespec { + pub tv_sec: __time_t, + pub tv_nsec: __syscall_slong_t, +} +#[test] +fn bindgen_test_layout_timespec() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(timespec)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(timespec)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timespec), + "::", + stringify!(tv_sec) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tv_nsec as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(timespec), + "::", + stringify!(tv_nsec) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union sigval { + pub sival_int: ::std::os::raw::c_int, + pub sival_ptr: *mut ::std::os::raw::c_void, + _bindgen_union_align: u64, +} +#[test] +fn bindgen_test_layout_sigval() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(sigval)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(sigval)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sival_int as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigval), + "::", + stringify!(sival_int) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sival_ptr as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigval), + "::", + stringify!(sival_ptr) + ) + ); +} +impl Default for sigval { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type __sigval_t = sigval; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct siginfo_t { + pub si_signo: ::std::os::raw::c_int, + pub si_errno: ::std::os::raw::c_int, + pub si_code: ::std::os::raw::c_int, + pub __pad0: ::std::os::raw::c_int, + pub _sifields: siginfo_t__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union siginfo_t__bindgen_ty_1 { + pub _pad: [::std::os::raw::c_int; 28usize], + pub _kill: siginfo_t__bindgen_ty_1__bindgen_ty_1, + pub _timer: siginfo_t__bindgen_ty_1__bindgen_ty_2, + pub _rt: siginfo_t__bindgen_ty_1__bindgen_ty_3, + pub _sigchld: siginfo_t__bindgen_ty_1__bindgen_ty_4, + pub _sigfault: siginfo_t__bindgen_ty_1__bindgen_ty_5, + pub _sigpoll: siginfo_t__bindgen_ty_1__bindgen_ty_6, + pub _sigsys: siginfo_t__bindgen_ty_1__bindgen_ty_7, + _bindgen_union_align: [u64; 14usize], +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_1 { + pub si_pid: __pid_t, + pub si_uid: __uid_t, +} +#[test] +fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_pid as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(si_pid) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_uid as *const _ + as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(si_uid) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_2 { + pub si_tid: ::std::os::raw::c_int, + pub si_overrun: ::std::os::raw::c_int, + pub si_sigval: __sigval_t, +} +#[test] +fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_2() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_tid as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(si_tid) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_overrun as *const _ + as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(si_overrun) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_sigval as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(si_sigval) + ) + ); +} +impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_3 { + pub si_pid: __pid_t, + pub si_uid: __uid_t, + pub si_sigval: __sigval_t, +} +#[test] +fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_3() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_pid as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3), + "::", + stringify!(si_pid) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_uid as *const _ + as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3), + "::", + stringify!(si_uid) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_sigval as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3), + "::", + stringify!(si_sigval) + ) + ); +} +impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_3 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_4 { + pub si_pid: __pid_t, + pub si_uid: __uid_t, + pub si_status: ::std::os::raw::c_int, + pub si_utime: __clock_t, + pub si_stime: __clock_t, +} +#[test] +fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_4() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!( + "Size of: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_pid as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), + "::", + stringify!(si_pid) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_uid as *const _ + as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), + "::", + stringify!(si_uid) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_status as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), + "::", + stringify!(si_status) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_utime as *const _ + as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), + "::", + stringify!(si_utime) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_stime as *const _ + as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), + "::", + stringify!(si_stime) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_5 { + pub si_addr: *mut ::std::os::raw::c_void, + pub si_addr_lsb: ::std::os::raw::c_short, + pub _bounds: siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1 { + pub _addr_bnd: siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + pub _pkey: __uint32_t, + _bindgen_union_align: [u64; 2usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { + pub _lower: *mut ::std::os::raw::c_void, + pub _upper: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::< + siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + >())) + ._lower as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(_lower) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::< + siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + >())) + ._upper as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(_upper) + ) + ); +} +impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[test] +fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())) + ._addr_bnd as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1), + "::", + stringify!(_addr_bnd) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::()))._pkey + as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1), + "::", + stringify!(_pkey) + ) + ); +} +impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[test] +fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_5() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!( + "Size of: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_addr as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5), + "::", + stringify!(si_addr) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_addr_lsb + as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5), + "::", + stringify!(si_addr_lsb) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::()))._bounds as *const _ + as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5), + "::", + stringify!(_bounds) + ) + ); +} +impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_5 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_6 { + pub si_band: ::std::os::raw::c_long, + pub si_fd: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_6() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_6) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_6) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_band as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_6), + "::", + stringify!(si_band) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).si_fd as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_6), + "::", + stringify!(si_fd) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_7 { + pub _call_addr: *mut ::std::os::raw::c_void, + pub _syscall: ::std::os::raw::c_int, + pub _arch: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_7() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::()))._call_addr as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7), + "::", + stringify!(_call_addr) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::()))._syscall as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7), + "::", + stringify!(_syscall) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::()))._arch as *const _ + as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7), + "::", + stringify!(_arch) + ) + ); +} +impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_7 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[test] +fn bindgen_test_layout_siginfo_t__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 112usize, + concat!("Size of: ", stringify!(siginfo_t__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(siginfo_t__bindgen_ty_1)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::()))._pad as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1), + "::", + stringify!(_pad) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::()))._kill as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1), + "::", + stringify!(_kill) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::()))._timer as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1), + "::", + stringify!(_timer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::()))._rt as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1), + "::", + stringify!(_rt) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::()))._sigchld as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1), + "::", + stringify!(_sigchld) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::()))._sigfault as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1), + "::", + stringify!(_sigfault) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::()))._sigpoll as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1), + "::", + stringify!(_sigpoll) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::()))._sigsys as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t__bindgen_ty_1), + "::", + stringify!(_sigsys) + ) + ); +} +impl Default for siginfo_t__bindgen_ty_1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[test] +fn bindgen_test_layout_siginfo_t() { + assert_eq!( + ::std::mem::size_of::(), + 128usize, + concat!("Size of: ", stringify!(siginfo_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(siginfo_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).si_signo as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t), + "::", + stringify!(si_signo) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).si_errno as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t), + "::", + stringify!(si_errno) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).si_code as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t), + "::", + stringify!(si_code) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__pad0 as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t), + "::", + stringify!(__pad0) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::()))._sifields as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(siginfo_t), + "::", + stringify!(_sifields) + ) + ); +} +impl Default for siginfo_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub const SI_ASYNCNL: _bindgen_ty_1 = _bindgen_ty_1::SI_ASYNCNL; +pub const SI_DETHREAD: _bindgen_ty_1 = _bindgen_ty_1::SI_DETHREAD; +pub const SI_TKILL: _bindgen_ty_1 = _bindgen_ty_1::SI_TKILL; +pub const SI_SIGIO: _bindgen_ty_1 = _bindgen_ty_1::SI_SIGIO; +pub const SI_ASYNCIO: _bindgen_ty_1 = _bindgen_ty_1::SI_ASYNCIO; +pub const SI_MESGQ: _bindgen_ty_1 = _bindgen_ty_1::SI_MESGQ; +pub const SI_TIMER: _bindgen_ty_1 = _bindgen_ty_1::SI_TIMER; +pub const SI_QUEUE: _bindgen_ty_1 = _bindgen_ty_1::SI_QUEUE; +pub const SI_USER: _bindgen_ty_1 = _bindgen_ty_1::SI_USER; +pub const SI_KERNEL: _bindgen_ty_1 = _bindgen_ty_1::SI_KERNEL; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_1 { + SI_ASYNCNL = -60, + SI_DETHREAD = -7, + SI_TKILL = -6, + SI_SIGIO = -5, + SI_ASYNCIO = -4, + SI_MESGQ = -3, + SI_TIMER = -2, + SI_QUEUE = -1, + SI_USER = 0, + SI_KERNEL = 128, +} +pub const ILL_ILLOPC: _bindgen_ty_2 = _bindgen_ty_2::ILL_ILLOPC; +pub const ILL_ILLOPN: _bindgen_ty_2 = _bindgen_ty_2::ILL_ILLOPN; +pub const ILL_ILLADR: _bindgen_ty_2 = _bindgen_ty_2::ILL_ILLADR; +pub const ILL_ILLTRP: _bindgen_ty_2 = _bindgen_ty_2::ILL_ILLTRP; +pub const ILL_PRVOPC: _bindgen_ty_2 = _bindgen_ty_2::ILL_PRVOPC; +pub const ILL_PRVREG: _bindgen_ty_2 = _bindgen_ty_2::ILL_PRVREG; +pub const ILL_COPROC: _bindgen_ty_2 = _bindgen_ty_2::ILL_COPROC; +pub const ILL_BADSTK: _bindgen_ty_2 = _bindgen_ty_2::ILL_BADSTK; +pub const ILL_BADIADDR: _bindgen_ty_2 = _bindgen_ty_2::ILL_BADIADDR; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_2 { + ILL_ILLOPC = 1, + ILL_ILLOPN = 2, + ILL_ILLADR = 3, + ILL_ILLTRP = 4, + ILL_PRVOPC = 5, + ILL_PRVREG = 6, + ILL_COPROC = 7, + ILL_BADSTK = 8, + ILL_BADIADDR = 9, +} +pub const FPE_INTDIV: _bindgen_ty_3 = _bindgen_ty_3::FPE_INTDIV; +pub const FPE_INTOVF: _bindgen_ty_3 = _bindgen_ty_3::FPE_INTOVF; +pub const FPE_FLTDIV: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTDIV; +pub const FPE_FLTOVF: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTOVF; +pub const FPE_FLTUND: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTUND; +pub const FPE_FLTRES: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTRES; +pub const FPE_FLTINV: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTINV; +pub const FPE_FLTSUB: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTSUB; +pub const FPE_FLTUNK: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTUNK; +pub const FPE_CONDTRAP: _bindgen_ty_3 = _bindgen_ty_3::FPE_CONDTRAP; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_3 { + FPE_INTDIV = 1, + FPE_INTOVF = 2, + FPE_FLTDIV = 3, + FPE_FLTOVF = 4, + FPE_FLTUND = 5, + FPE_FLTRES = 6, + FPE_FLTINV = 7, + FPE_FLTSUB = 8, + FPE_FLTUNK = 14, + FPE_CONDTRAP = 15, +} +pub const SEGV_MAPERR: _bindgen_ty_4 = _bindgen_ty_4::SEGV_MAPERR; +pub const SEGV_ACCERR: _bindgen_ty_4 = _bindgen_ty_4::SEGV_ACCERR; +pub const SEGV_BNDERR: _bindgen_ty_4 = _bindgen_ty_4::SEGV_BNDERR; +pub const SEGV_PKUERR: _bindgen_ty_4 = _bindgen_ty_4::SEGV_PKUERR; +pub const SEGV_ACCADI: _bindgen_ty_4 = _bindgen_ty_4::SEGV_ACCADI; +pub const SEGV_ADIDERR: _bindgen_ty_4 = _bindgen_ty_4::SEGV_ADIDERR; +pub const SEGV_ADIPERR: _bindgen_ty_4 = _bindgen_ty_4::SEGV_ADIPERR; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_4 { + SEGV_MAPERR = 1, + SEGV_ACCERR = 2, + SEGV_BNDERR = 3, + SEGV_PKUERR = 4, + SEGV_ACCADI = 5, + SEGV_ADIDERR = 6, + SEGV_ADIPERR = 7, +} +pub const BUS_ADRALN: _bindgen_ty_5 = _bindgen_ty_5::BUS_ADRALN; +pub const BUS_ADRERR: _bindgen_ty_5 = _bindgen_ty_5::BUS_ADRERR; +pub const BUS_OBJERR: _bindgen_ty_5 = _bindgen_ty_5::BUS_OBJERR; +pub const BUS_MCEERR_AR: _bindgen_ty_5 = _bindgen_ty_5::BUS_MCEERR_AR; +pub const BUS_MCEERR_AO: _bindgen_ty_5 = _bindgen_ty_5::BUS_MCEERR_AO; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_5 { + BUS_ADRALN = 1, + BUS_ADRERR = 2, + BUS_OBJERR = 3, + BUS_MCEERR_AR = 4, + BUS_MCEERR_AO = 5, +} +pub const CLD_EXITED: _bindgen_ty_6 = _bindgen_ty_6::CLD_EXITED; +pub const CLD_KILLED: _bindgen_ty_6 = _bindgen_ty_6::CLD_KILLED; +pub const CLD_DUMPED: _bindgen_ty_6 = _bindgen_ty_6::CLD_DUMPED; +pub const CLD_TRAPPED: _bindgen_ty_6 = _bindgen_ty_6::CLD_TRAPPED; +pub const CLD_STOPPED: _bindgen_ty_6 = _bindgen_ty_6::CLD_STOPPED; +pub const CLD_CONTINUED: _bindgen_ty_6 = _bindgen_ty_6::CLD_CONTINUED; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_6 { + CLD_EXITED = 1, + CLD_KILLED = 2, + CLD_DUMPED = 3, + CLD_TRAPPED = 4, + CLD_STOPPED = 5, + CLD_CONTINUED = 6, +} +pub const POLL_IN: _bindgen_ty_7 = _bindgen_ty_7::POLL_IN; +pub const POLL_OUT: _bindgen_ty_7 = _bindgen_ty_7::POLL_OUT; +pub const POLL_MSG: _bindgen_ty_7 = _bindgen_ty_7::POLL_MSG; +pub const POLL_ERR: _bindgen_ty_7 = _bindgen_ty_7::POLL_ERR; +pub const POLL_PRI: _bindgen_ty_7 = _bindgen_ty_7::POLL_PRI; +pub const POLL_HUP: _bindgen_ty_7 = _bindgen_ty_7::POLL_HUP; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_7 { + POLL_IN = 1, + POLL_OUT = 2, + POLL_MSG = 3, + POLL_ERR = 4, + POLL_PRI = 5, + POLL_HUP = 6, +} +pub type sigval_t = __sigval_t; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct sigevent { + pub sigev_value: __sigval_t, + pub sigev_signo: ::std::os::raw::c_int, + pub sigev_notify: ::std::os::raw::c_int, + pub _sigev_un: sigevent__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union sigevent__bindgen_ty_1 { + pub _pad: [::std::os::raw::c_int; 12usize], + pub _tid: __pid_t, + pub _sigev_thread: sigevent__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: [u64; 6usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sigevent__bindgen_ty_1__bindgen_ty_1 { + pub _function: ::std::option::Option, + pub _attribute: *mut pthread_attr_t, +} +#[test] +fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(sigevent__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(sigevent__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::()))._function as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigevent__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(_function) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::()))._attribute as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(sigevent__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(_attribute) + ) + ); +} +impl Default for sigevent__bindgen_ty_1__bindgen_ty_1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[test] +fn bindgen_test_layout_sigevent__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(sigevent__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(sigevent__bindgen_ty_1)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::()))._pad as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigevent__bindgen_ty_1), + "::", + stringify!(_pad) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::()))._tid as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigevent__bindgen_ty_1), + "::", + stringify!(_tid) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::()))._sigev_thread as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigevent__bindgen_ty_1), + "::", + stringify!(_sigev_thread) + ) + ); +} +impl Default for sigevent__bindgen_ty_1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[test] +fn bindgen_test_layout_sigevent() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(sigevent)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(sigevent)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sigev_value as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigevent), + "::", + stringify!(sigev_value) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sigev_signo as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(sigevent), + "::", + stringify!(sigev_signo) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sigev_notify as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(sigevent), + "::", + stringify!(sigev_notify) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::()))._sigev_un as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(sigevent), + "::", + stringify!(_sigev_un) + ) + ); +} +impl Default for sigevent { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type sigevent_t = sigevent; +pub const SIGEV_SIGNAL: _bindgen_ty_8 = _bindgen_ty_8::SIGEV_SIGNAL; +pub const SIGEV_NONE: _bindgen_ty_8 = _bindgen_ty_8::SIGEV_NONE; +pub const SIGEV_THREAD: _bindgen_ty_8 = _bindgen_ty_8::SIGEV_THREAD; +pub const SIGEV_THREAD_ID: _bindgen_ty_8 = _bindgen_ty_8::SIGEV_THREAD_ID; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_8 { + SIGEV_SIGNAL = 0, + SIGEV_NONE = 1, + SIGEV_THREAD = 2, + SIGEV_THREAD_ID = 4, +} +pub type __sighandler_t = ::std::option::Option; +extern "C" { + pub fn __sysv_signal(__sig: ::std::os::raw::c_int, __handler: __sighandler_t) + -> __sighandler_t; +} +extern "C" { + pub fn signal(__sig: ::std::os::raw::c_int, __handler: __sighandler_t) -> __sighandler_t; +} +extern "C" { + pub fn kill(__pid: __pid_t, __sig: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn killpg(__pgrp: __pid_t, __sig: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn raise(__sig: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ssignal(__sig: ::std::os::raw::c_int, __handler: __sighandler_t) -> __sighandler_t; +} +extern "C" { + pub fn gsignal(__sig: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn psignal(__sig: ::std::os::raw::c_int, __s: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn psiginfo(__pinfo: *const siginfo_t, __s: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn sigblock(__mask: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sigsetmask(__mask: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn siggetmask() -> ::std::os::raw::c_int; +} +pub type sig_t = __sighandler_t; +extern "C" { + pub fn sigemptyset(__set: *mut sigset_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sigfillset(__set: *mut sigset_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sigaddset(__set: *mut sigset_t, __signo: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sigdelset(__set: *mut sigset_t, __signo: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sigismember( + __set: *const sigset_t, + __signo: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct sigaction { + pub __sigaction_handler: sigaction__bindgen_ty_1, + pub sa_mask: __sigset_t, + pub sa_flags: ::std::os::raw::c_int, + pub sa_restorer: ::std::option::Option, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union sigaction__bindgen_ty_1 { + pub sa_handler: __sighandler_t, + pub sa_sigaction: ::std::option::Option< + unsafe extern "C" fn( + arg1: ::std::os::raw::c_int, + arg2: *mut siginfo_t, + arg3: *mut ::std::os::raw::c_void, + ), + >, + _bindgen_union_align: u64, +} +#[test] +fn bindgen_test_layout_sigaction__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(sigaction__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(sigaction__bindgen_ty_1)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).sa_handler as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigaction__bindgen_ty_1), + "::", + stringify!(sa_handler) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).sa_sigaction as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigaction__bindgen_ty_1), + "::", + stringify!(sa_sigaction) + ) + ); +} +impl Default for sigaction__bindgen_ty_1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[test] +fn bindgen_test_layout_sigaction() { + assert_eq!( + ::std::mem::size_of::(), + 152usize, + concat!("Size of: ", stringify!(sigaction)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(sigaction)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__sigaction_handler as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigaction), + "::", + stringify!(__sigaction_handler) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sa_mask as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(sigaction), + "::", + stringify!(sa_mask) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sa_flags as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(sigaction), + "::", + stringify!(sa_flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sa_restorer as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(sigaction), + "::", + stringify!(sa_restorer) + ) + ); +} +impl Default for sigaction { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn sigprocmask( + __how: ::std::os::raw::c_int, + __set: *const sigset_t, + __oset: *mut sigset_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sigsuspend(__set: *const sigset_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sigaction( + __sig: ::std::os::raw::c_int, + __act: *const sigaction, + __oact: *mut sigaction, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sigpending(__set: *mut sigset_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sigwait( + __set: *const sigset_t, + __sig: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sigwaitinfo(__set: *const sigset_t, __info: *mut siginfo_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sigtimedwait( + __set: *const sigset_t, + __info: *mut siginfo_t, + __timeout: *const timespec, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sigqueue( + __pid: __pid_t, + __sig: ::std::os::raw::c_int, + __val: sigval, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub static _sys_siglist: [*const ::std::os::raw::c_char; 65usize]; +} +extern "C" { + pub static sys_siglist: [*const ::std::os::raw::c_char; 65usize]; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _fpx_sw_bytes { + pub magic1: __uint32_t, + pub extended_size: __uint32_t, + pub xstate_bv: __uint64_t, + pub xstate_size: __uint32_t, + pub __glibc_reserved1: [__uint32_t; 7usize], +} +#[test] +fn bindgen_test_layout__fpx_sw_bytes() { + assert_eq!( + ::std::mem::size_of::<_fpx_sw_bytes>(), + 48usize, + concat!("Size of: ", stringify!(_fpx_sw_bytes)) + ); + assert_eq!( + ::std::mem::align_of::<_fpx_sw_bytes>(), + 8usize, + concat!("Alignment of ", stringify!(_fpx_sw_bytes)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).magic1 as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_fpx_sw_bytes), + "::", + stringify!(magic1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).extended_size as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_fpx_sw_bytes), + "::", + stringify!(extended_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).xstate_bv as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_fpx_sw_bytes), + "::", + stringify!(xstate_bv) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).xstate_size as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_fpx_sw_bytes), + "::", + stringify!(xstate_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).__glibc_reserved1 as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(_fpx_sw_bytes), + "::", + stringify!(__glibc_reserved1) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _fpreg { + pub significand: [::std::os::raw::c_ushort; 4usize], + pub exponent: ::std::os::raw::c_ushort, +} +#[test] +fn bindgen_test_layout__fpreg() { + assert_eq!( + ::std::mem::size_of::<_fpreg>(), + 10usize, + concat!("Size of: ", stringify!(_fpreg)) + ); + assert_eq!( + ::std::mem::align_of::<_fpreg>(), + 2usize, + concat!("Alignment of ", stringify!(_fpreg)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpreg>())).significand as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_fpreg), + "::", + stringify!(significand) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpreg>())).exponent as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_fpreg), + "::", + stringify!(exponent) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _fpxreg { + pub significand: [::std::os::raw::c_ushort; 4usize], + pub exponent: ::std::os::raw::c_ushort, + pub __glibc_reserved1: [::std::os::raw::c_ushort; 3usize], +} +#[test] +fn bindgen_test_layout__fpxreg() { + assert_eq!( + ::std::mem::size_of::<_fpxreg>(), + 16usize, + concat!("Size of: ", stringify!(_fpxreg)) + ); + assert_eq!( + ::std::mem::align_of::<_fpxreg>(), + 2usize, + concat!("Alignment of ", stringify!(_fpxreg)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpxreg>())).significand as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_fpxreg), + "::", + stringify!(significand) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpxreg>())).exponent as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_fpxreg), + "::", + stringify!(exponent) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpxreg>())).__glibc_reserved1 as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_fpxreg), + "::", + stringify!(__glibc_reserved1) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _xmmreg { + pub element: [__uint32_t; 4usize], +} +#[test] +fn bindgen_test_layout__xmmreg() { + assert_eq!( + ::std::mem::size_of::<_xmmreg>(), + 16usize, + concat!("Size of: ", stringify!(_xmmreg)) + ); + assert_eq!( + ::std::mem::align_of::<_xmmreg>(), + 4usize, + concat!("Alignment of ", stringify!(_xmmreg)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_xmmreg>())).element as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_xmmreg), + "::", + stringify!(element) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _fpstate { + pub cwd: __uint16_t, + pub swd: __uint16_t, + pub ftw: __uint16_t, + pub fop: __uint16_t, + pub rip: __uint64_t, + pub rdp: __uint64_t, + pub mxcsr: __uint32_t, + pub mxcr_mask: __uint32_t, + pub _st: [_fpxreg; 8usize], + pub _xmm: [_xmmreg; 16usize], + pub __glibc_reserved1: [__uint32_t; 24usize], +} +#[test] +fn bindgen_test_layout__fpstate() { + assert_eq!( + ::std::mem::size_of::<_fpstate>(), + 512usize, + concat!("Size of: ", stringify!(_fpstate)) + ); + assert_eq!( + ::std::mem::align_of::<_fpstate>(), + 8usize, + concat!("Alignment of ", stringify!(_fpstate)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpstate>())).cwd as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_fpstate), + "::", + stringify!(cwd) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpstate>())).swd as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(_fpstate), + "::", + stringify!(swd) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpstate>())).ftw as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_fpstate), + "::", + stringify!(ftw) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpstate>())).fop as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_fpstate), + "::", + stringify!(fop) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpstate>())).rip as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_fpstate), + "::", + stringify!(rip) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpstate>())).rdp as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_fpstate), + "::", + stringify!(rdp) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpstate>())).mxcsr as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_fpstate), + "::", + stringify!(mxcsr) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpstate>())).mxcr_mask as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(_fpstate), + "::", + stringify!(mxcr_mask) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpstate>()))._st as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_fpstate), + "::", + stringify!(_st) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpstate>()))._xmm as *const _ as usize }, + 160usize, + concat!( + "Offset of field: ", + stringify!(_fpstate), + "::", + stringify!(_xmm) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_fpstate>())).__glibc_reserved1 as *const _ as usize }, + 416usize, + concat!( + "Offset of field: ", + stringify!(_fpstate), + "::", + stringify!(__glibc_reserved1) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct sigcontext { + pub r8: __uint64_t, + pub r9: __uint64_t, + pub r10: __uint64_t, + pub r11: __uint64_t, + pub r12: __uint64_t, + pub r13: __uint64_t, + pub r14: __uint64_t, + pub r15: __uint64_t, + pub rdi: __uint64_t, + pub rsi: __uint64_t, + pub rbp: __uint64_t, + pub rbx: __uint64_t, + pub rdx: __uint64_t, + pub rax: __uint64_t, + pub rcx: __uint64_t, + pub rsp: __uint64_t, + pub rip: __uint64_t, + pub eflags: __uint64_t, + pub cs: ::std::os::raw::c_ushort, + pub gs: ::std::os::raw::c_ushort, + pub fs: ::std::os::raw::c_ushort, + pub __pad0: ::std::os::raw::c_ushort, + pub err: __uint64_t, + pub trapno: __uint64_t, + pub oldmask: __uint64_t, + pub cr2: __uint64_t, + pub __bindgen_anon_1: sigcontext__bindgen_ty_1, + pub __reserved1: [__uint64_t; 8usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union sigcontext__bindgen_ty_1 { + pub fpstate: *mut _fpstate, + pub __fpstate_word: __uint64_t, + _bindgen_union_align: u64, +} +#[test] +fn bindgen_test_layout_sigcontext__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(sigcontext__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(sigcontext__bindgen_ty_1)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).fpstate as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigcontext__bindgen_ty_1), + "::", + stringify!(fpstate) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).__fpstate_word as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigcontext__bindgen_ty_1), + "::", + stringify!(__fpstate_word) + ) + ); +} +impl Default for sigcontext__bindgen_ty_1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[test] +fn bindgen_test_layout_sigcontext() { + assert_eq!( + ::std::mem::size_of::(), + 256usize, + concat!("Size of: ", stringify!(sigcontext)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(sigcontext)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r8 as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(r8) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r9 as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(r9) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r10 as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(r10) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r11 as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(r11) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r12 as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(r12) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r13 as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(r13) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r14 as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(r14) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r15 as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(r15) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rdi as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(rdi) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rsi as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(rsi) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbp as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(rbp) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbx as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(rbx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rdx as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(rdx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rax as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(rax) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rcx as *const _ as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(rcx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rsp as *const _ as usize }, + 120usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(rsp) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rip as *const _ as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(rip) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).eflags as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(eflags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cs as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(cs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).gs as *const _ as usize }, + 146usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(gs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fs as *const _ as usize }, + 148usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(fs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__pad0 as *const _ as usize }, + 150usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(__pad0) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).err as *const _ as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(err) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).trapno as *const _ as usize }, + 160usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(trapno) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).oldmask as *const _ as usize }, + 168usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(oldmask) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cr2 as *const _ as usize }, + 176usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(cr2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__reserved1 as *const _ as usize }, + 192usize, + concat!( + "Offset of field: ", + stringify!(sigcontext), + "::", + stringify!(__reserved1) + ) + ); +} +impl Default for sigcontext { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _xsave_hdr { + pub xstate_bv: __uint64_t, + pub __glibc_reserved1: [__uint64_t; 2usize], + pub __glibc_reserved2: [__uint64_t; 5usize], +} +#[test] +fn bindgen_test_layout__xsave_hdr() { + assert_eq!( + ::std::mem::size_of::<_xsave_hdr>(), + 64usize, + concat!("Size of: ", stringify!(_xsave_hdr)) + ); + assert_eq!( + ::std::mem::align_of::<_xsave_hdr>(), + 8usize, + concat!("Alignment of ", stringify!(_xsave_hdr)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_xsave_hdr>())).xstate_bv as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_xsave_hdr), + "::", + stringify!(xstate_bv) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_xsave_hdr>())).__glibc_reserved1 as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_xsave_hdr), + "::", + stringify!(__glibc_reserved1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_xsave_hdr>())).__glibc_reserved2 as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_xsave_hdr), + "::", + stringify!(__glibc_reserved2) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _ymmh_state { + pub ymmh_space: [__uint32_t; 64usize], +} +#[test] +fn bindgen_test_layout__ymmh_state() { + assert_eq!( + ::std::mem::size_of::<_ymmh_state>(), + 256usize, + concat!("Size of: ", stringify!(_ymmh_state)) + ); + assert_eq!( + ::std::mem::align_of::<_ymmh_state>(), + 4usize, + concat!("Alignment of ", stringify!(_ymmh_state)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ymmh_state>())).ymmh_space as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_ymmh_state), + "::", + stringify!(ymmh_space) + ) + ); +} +impl Default for _ymmh_state { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _xstate { + pub fpstate: _fpstate, + pub xstate_hdr: _xsave_hdr, + pub ymmh: _ymmh_state, +} +#[test] +fn bindgen_test_layout__xstate() { + assert_eq!( + ::std::mem::size_of::<_xstate>(), + 832usize, + concat!("Size of: ", stringify!(_xstate)) + ); + assert_eq!( + ::std::mem::align_of::<_xstate>(), + 8usize, + concat!("Alignment of ", stringify!(_xstate)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_xstate>())).fpstate as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_xstate), + "::", + stringify!(fpstate) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_xstate>())).xstate_hdr as *const _ as usize }, + 512usize, + concat!( + "Offset of field: ", + stringify!(_xstate), + "::", + stringify!(xstate_hdr) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_xstate>())).ymmh as *const _ as usize }, + 576usize, + concat!( + "Offset of field: ", + stringify!(_xstate), + "::", + stringify!(ymmh) + ) + ); +} +impl Default for _xstate { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn sigreturn(__scp: *mut sigcontext) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct stack_t { + pub ss_sp: *mut ::std::os::raw::c_void, + pub ss_flags: ::std::os::raw::c_int, + pub ss_size: size_t, +} +#[test] +fn bindgen_test_layout_stack_t() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(stack_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(stack_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ss_sp as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(stack_t), + "::", + stringify!(ss_sp) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ss_flags as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(stack_t), + "::", + stringify!(ss_flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ss_size as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(stack_t), + "::", + stringify!(ss_size) + ) + ); +} +impl Default for stack_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type greg_t = ::std::os::raw::c_longlong; +pub type gregset_t = [greg_t; 23usize]; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _libc_fpxreg { + pub significand: [::std::os::raw::c_ushort; 4usize], + pub exponent: ::std::os::raw::c_ushort, + pub __glibc_reserved1: [::std::os::raw::c_ushort; 3usize], +} +#[test] +fn bindgen_test_layout__libc_fpxreg() { + assert_eq!( + ::std::mem::size_of::<_libc_fpxreg>(), + 16usize, + concat!("Size of: ", stringify!(_libc_fpxreg)) + ); + assert_eq!( + ::std::mem::align_of::<_libc_fpxreg>(), + 2usize, + concat!("Alignment of ", stringify!(_libc_fpxreg)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpxreg>())).significand as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpxreg), + "::", + stringify!(significand) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpxreg>())).exponent as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpxreg), + "::", + stringify!(exponent) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpxreg>())).__glibc_reserved1 as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpxreg), + "::", + stringify!(__glibc_reserved1) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _libc_xmmreg { + pub element: [__uint32_t; 4usize], +} +#[test] +fn bindgen_test_layout__libc_xmmreg() { + assert_eq!( + ::std::mem::size_of::<_libc_xmmreg>(), + 16usize, + concat!("Size of: ", stringify!(_libc_xmmreg)) + ); + assert_eq!( + ::std::mem::align_of::<_libc_xmmreg>(), + 4usize, + concat!("Alignment of ", stringify!(_libc_xmmreg)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_xmmreg>())).element as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_libc_xmmreg), + "::", + stringify!(element) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _libc_fpstate { + pub cwd: __uint16_t, + pub swd: __uint16_t, + pub ftw: __uint16_t, + pub fop: __uint16_t, + pub rip: __uint64_t, + pub rdp: __uint64_t, + pub mxcsr: __uint32_t, + pub mxcr_mask: __uint32_t, + pub _st: [_libc_fpxreg; 8usize], + pub _xmm: [_libc_xmmreg; 16usize], + pub __glibc_reserved1: [__uint32_t; 24usize], +} +#[test] +fn bindgen_test_layout__libc_fpstate() { + assert_eq!( + ::std::mem::size_of::<_libc_fpstate>(), + 512usize, + concat!("Size of: ", stringify!(_libc_fpstate)) + ); + assert_eq!( + ::std::mem::align_of::<_libc_fpstate>(), + 8usize, + concat!("Alignment of ", stringify!(_libc_fpstate)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).cwd as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpstate), + "::", + stringify!(cwd) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).swd as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpstate), + "::", + stringify!(swd) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).ftw as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpstate), + "::", + stringify!(ftw) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).fop as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpstate), + "::", + stringify!(fop) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).rip as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpstate), + "::", + stringify!(rip) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).rdp as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpstate), + "::", + stringify!(rdp) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).mxcsr as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpstate), + "::", + stringify!(mxcsr) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).mxcr_mask as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpstate), + "::", + stringify!(mxcr_mask) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpstate>()))._st as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpstate), + "::", + stringify!(_st) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpstate>()))._xmm as *const _ as usize }, + 160usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpstate), + "::", + stringify!(_xmm) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).__glibc_reserved1 as *const _ as usize }, + 416usize, + concat!( + "Offset of field: ", + stringify!(_libc_fpstate), + "::", + stringify!(__glibc_reserved1) + ) + ); +} +pub type fpregset_t = *mut _libc_fpstate; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mcontext_t { + pub gregs: gregset_t, + pub fpregs: fpregset_t, + pub __reserved1: [::std::os::raw::c_ulonglong; 8usize], +} +#[test] +fn bindgen_test_layout_mcontext_t() { + assert_eq!( + ::std::mem::size_of::(), + 256usize, + concat!("Size of: ", stringify!(mcontext_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(mcontext_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).gregs as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(mcontext_t), + "::", + stringify!(gregs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fpregs as *const _ as usize }, + 184usize, + concat!( + "Offset of field: ", + stringify!(mcontext_t), + "::", + stringify!(fpregs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__reserved1 as *const _ as usize }, + 192usize, + concat!( + "Offset of field: ", + stringify!(mcontext_t), + "::", + stringify!(__reserved1) + ) + ); +} +impl Default for mcontext_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ucontext_t { + pub uc_flags: ::std::os::raw::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: stack_t, + pub uc_mcontext: mcontext_t, + pub uc_sigmask: sigset_t, + pub __fpregs_mem: _libc_fpstate, + pub __ssp: [::std::os::raw::c_ulonglong; 4usize], +} +#[test] +fn bindgen_test_layout_ucontext_t() { + assert_eq!( + ::std::mem::size_of::(), + 968usize, + concat!("Size of: ", stringify!(ucontext_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ucontext_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).uc_flags as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ucontext_t), + "::", + stringify!(uc_flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).uc_link as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ucontext_t), + "::", + stringify!(uc_link) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).uc_stack as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ucontext_t), + "::", + stringify!(uc_stack) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).uc_mcontext as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(ucontext_t), + "::", + stringify!(uc_mcontext) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).uc_sigmask as *const _ as usize }, + 296usize, + concat!( + "Offset of field: ", + stringify!(ucontext_t), + "::", + stringify!(uc_sigmask) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__fpregs_mem as *const _ as usize }, + 424usize, + concat!( + "Offset of field: ", + stringify!(ucontext_t), + "::", + stringify!(__fpregs_mem) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__ssp as *const _ as usize }, + 936usize, + concat!( + "Offset of field: ", + stringify!(ucontext_t), + "::", + stringify!(__ssp) + ) + ); +} +impl Default for ucontext_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn siginterrupt( + __sig: ::std::os::raw::c_int, + __interrupt: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +pub const SS_ONSTACK: _bindgen_ty_9 = _bindgen_ty_9::SS_ONSTACK; +pub const SS_DISABLE: _bindgen_ty_9 = _bindgen_ty_9::SS_DISABLE; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_9 { + SS_ONSTACK = 1, + SS_DISABLE = 2, +} +extern "C" { + pub fn sigaltstack(__ss: *const stack_t, __oss: *mut stack_t) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sigstack { + pub ss_sp: *mut ::std::os::raw::c_void, + pub ss_onstack: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_sigstack() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(sigstack)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(sigstack)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ss_sp as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(sigstack), + "::", + stringify!(ss_sp) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ss_onstack as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(sigstack), + "::", + stringify!(ss_onstack) + ) + ); +} +impl Default for sigstack { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn sigstack(__ss: *mut sigstack, __oss: *mut sigstack) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_internal_list { + pub __prev: *mut __pthread_internal_list, + pub __next: *mut __pthread_internal_list, +} +#[test] +fn bindgen_test_layout___pthread_internal_list() { + assert_eq!( + ::std::mem::size_of::<__pthread_internal_list>(), + 16usize, + concat!("Size of: ", stringify!(__pthread_internal_list)) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_internal_list>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_internal_list)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_internal_list>())).__prev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_internal_list), + "::", + stringify!(__prev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_internal_list>())).__next as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__pthread_internal_list), + "::", + stringify!(__next) + ) + ); +} +impl Default for __pthread_internal_list { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type __pthread_list_t = __pthread_internal_list; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_internal_slist { + pub __next: *mut __pthread_internal_slist, +} +#[test] +fn bindgen_test_layout___pthread_internal_slist() { + assert_eq!( + ::std::mem::size_of::<__pthread_internal_slist>(), + 8usize, + concat!("Size of: ", stringify!(__pthread_internal_slist)) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_internal_slist>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_internal_slist)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_internal_slist>())).__next as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_internal_slist), + "::", + stringify!(__next) + ) + ); +} +impl Default for __pthread_internal_slist { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type __pthread_slist_t = __pthread_internal_slist; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_mutex_s { + pub __lock: ::std::os::raw::c_int, + pub __count: ::std::os::raw::c_uint, + pub __owner: ::std::os::raw::c_int, + pub __nusers: ::std::os::raw::c_uint, + pub __kind: ::std::os::raw::c_int, + pub __spins: ::std::os::raw::c_short, + pub __elision: ::std::os::raw::c_short, + pub __list: __pthread_list_t, +} +#[test] +fn bindgen_test_layout___pthread_mutex_s() { + assert_eq!( + ::std::mem::size_of::<__pthread_mutex_s>(), + 40usize, + concat!("Size of: ", stringify!(__pthread_mutex_s)) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_mutex_s>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_mutex_s)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__lock as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__lock) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__count as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__count) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__owner as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__owner) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__nusers as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__nusers) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__kind as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__kind) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__spins as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__spins) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__elision as *const _ as usize }, + 22usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__elision) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__list as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(__pthread_mutex_s), + "::", + stringify!(__list) + ) + ); +} +impl Default for __pthread_mutex_s { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __pthread_rwlock_arch_t { + pub __readers: ::std::os::raw::c_uint, + pub __writers: ::std::os::raw::c_uint, + pub __wrphase_futex: ::std::os::raw::c_uint, + pub __writers_futex: ::std::os::raw::c_uint, + pub __pad3: ::std::os::raw::c_uint, + pub __pad4: ::std::os::raw::c_uint, + pub __cur_writer: ::std::os::raw::c_int, + pub __shared: ::std::os::raw::c_int, + pub __rwelision: ::std::os::raw::c_schar, + pub __pad1: [::std::os::raw::c_uchar; 7usize], + pub __pad2: ::std::os::raw::c_ulong, + pub __flags: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout___pthread_rwlock_arch_t() { + assert_eq!( + ::std::mem::size_of::<__pthread_rwlock_arch_t>(), + 56usize, + concat!("Size of: ", stringify!(__pthread_rwlock_arch_t)) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_rwlock_arch_t>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_rwlock_arch_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__readers as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__readers) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__writers as *const _ as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__writers) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__wrphase_futex as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__wrphase_futex) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__writers_futex as *const _ as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__writers_futex) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__pad3 as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__pad3) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__pad4 as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__pad4) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__cur_writer as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__cur_writer) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__shared as *const _ as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__shared) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__rwelision as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__rwelision) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__pad1 as *const _ as usize }, + 33usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__pad1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__pad2 as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__pad2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__flags as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(__pthread_rwlock_arch_t), + "::", + stringify!(__flags) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct __pthread_cond_s { + pub __bindgen_anon_1: __pthread_cond_s__bindgen_ty_1, + pub __bindgen_anon_2: __pthread_cond_s__bindgen_ty_2, + pub __g_refs: [::std::os::raw::c_uint; 2usize], + pub __g_size: [::std::os::raw::c_uint; 2usize], + pub __g1_orig_size: ::std::os::raw::c_uint, + pub __wrefs: ::std::os::raw::c_uint, + pub __g_signals: [::std::os::raw::c_uint; 2usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union __pthread_cond_s__bindgen_ty_1 { + pub __wseq: ::std::os::raw::c_ulonglong, + pub __wseq32: __pthread_cond_s__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u64, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __pthread_cond_s__bindgen_ty_1__bindgen_ty_1 { + pub __low: ::std::os::raw::c_uint, + pub __high: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout___pthread_cond_s__bindgen_ty_1__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>(), + 8usize, + concat!( + "Size of: ", + stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>(), + 4usize, + concat!( + "Alignment of ", + stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>())).__low + as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(__low) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>())).__high + as *const _ as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(__high) + ) + ); +} +#[test] +fn bindgen_test_layout___pthread_cond_s__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_1>(), + 8usize, + concat!("Size of: ", stringify!(__pthread_cond_s__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_1>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_cond_s__bindgen_ty_1)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_1>())).__wseq as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s__bindgen_ty_1), + "::", + stringify!(__wseq) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_1>())).__wseq32 as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s__bindgen_ty_1), + "::", + stringify!(__wseq32) + ) + ); +} +impl Default for __pthread_cond_s__bindgen_ty_1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union __pthread_cond_s__bindgen_ty_2 { + pub __g1_start: ::std::os::raw::c_ulonglong, + pub __g1_start32: __pthread_cond_s__bindgen_ty_2__bindgen_ty_1, + _bindgen_union_align: u64, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __pthread_cond_s__bindgen_ty_2__bindgen_ty_1 { + pub __low: ::std::os::raw::c_uint, + pub __high: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout___pthread_cond_s__bindgen_ty_2__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>(), + 8usize, + concat!( + "Size of: ", + stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>(), + 4usize, + concat!( + "Alignment of ", + stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>())).__low + as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(__low) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>())).__high + as *const _ as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(__high) + ) + ); +} +#[test] +fn bindgen_test_layout___pthread_cond_s__bindgen_ty_2() { + assert_eq!( + ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_2>(), + 8usize, + concat!("Size of: ", stringify!(__pthread_cond_s__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_2>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_cond_s__bindgen_ty_2)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_2>())).__g1_start as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s__bindgen_ty_2), + "::", + stringify!(__g1_start) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_2>())).__g1_start32 as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s__bindgen_ty_2), + "::", + stringify!(__g1_start32) + ) + ); +} +impl Default for __pthread_cond_s__bindgen_ty_2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[test] +fn bindgen_test_layout___pthread_cond_s() { + assert_eq!( + ::std::mem::size_of::<__pthread_cond_s>(), + 48usize, + concat!("Size of: ", stringify!(__pthread_cond_s)) + ); + assert_eq!( + ::std::mem::align_of::<__pthread_cond_s>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_cond_s)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_cond_s>())).__g_refs as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s), + "::", + stringify!(__g_refs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_cond_s>())).__g_size as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s), + "::", + stringify!(__g_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_cond_s>())).__g1_orig_size as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s), + "::", + stringify!(__g1_orig_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_cond_s>())).__wrefs as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s), + "::", + stringify!(__wrefs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__pthread_cond_s>())).__g_signals as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cond_s), + "::", + stringify!(__g_signals) + ) + ); +} +impl Default for __pthread_cond_s { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type pthread_t = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_mutexattr_t { + pub __size: [::std::os::raw::c_char; 4usize], + pub __align: ::std::os::raw::c_int, + _bindgen_union_align: u32, +} +#[test] +fn bindgen_test_layout_pthread_mutexattr_t() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(pthread_mutexattr_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pthread_mutexattr_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_mutexattr_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_mutexattr_t), + "::", + stringify!(__align) + ) + ); +} +impl Default for pthread_mutexattr_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_condattr_t { + pub __size: [::std::os::raw::c_char; 4usize], + pub __align: ::std::os::raw::c_int, + _bindgen_union_align: u32, +} +#[test] +fn bindgen_test_layout_pthread_condattr_t() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(pthread_condattr_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pthread_condattr_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_condattr_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_condattr_t), + "::", + stringify!(__align) + ) + ); +} +impl Default for pthread_condattr_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type pthread_key_t = ::std::os::raw::c_uint; +pub type pthread_once_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_attr_t { + pub __size: [::std::os::raw::c_char; 56usize], + pub __align: ::std::os::raw::c_long, + _bindgen_union_align: [u64; 7usize], +} +#[test] +fn bindgen_test_layout_pthread_attr_t() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(pthread_attr_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pthread_attr_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_attr_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_attr_t), + "::", + stringify!(__align) + ) + ); +} +impl Default for pthread_attr_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_mutex_t { + pub __data: __pthread_mutex_s, + pub __size: [::std::os::raw::c_char; 40usize], + pub __align: ::std::os::raw::c_long, + _bindgen_union_align: [u64; 5usize], +} +#[test] +fn bindgen_test_layout_pthread_mutex_t() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(pthread_mutex_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pthread_mutex_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__data as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_mutex_t), + "::", + stringify!(__data) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_mutex_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_mutex_t), + "::", + stringify!(__align) + ) + ); +} +impl Default for pthread_mutex_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_cond_t { + pub __data: __pthread_cond_s, + pub __size: [::std::os::raw::c_char; 48usize], + pub __align: ::std::os::raw::c_longlong, + _bindgen_union_align: [u64; 6usize], +} +#[test] +fn bindgen_test_layout_pthread_cond_t() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(pthread_cond_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pthread_cond_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__data as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_cond_t), + "::", + stringify!(__data) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_cond_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_cond_t), + "::", + stringify!(__align) + ) + ); +} +impl Default for pthread_cond_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_rwlock_t { + pub __data: __pthread_rwlock_arch_t, + pub __size: [::std::os::raw::c_char; 56usize], + pub __align: ::std::os::raw::c_long, + _bindgen_union_align: [u64; 7usize], +} +#[test] +fn bindgen_test_layout_pthread_rwlock_t() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(pthread_rwlock_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pthread_rwlock_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__data as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_rwlock_t), + "::", + stringify!(__data) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_rwlock_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_rwlock_t), + "::", + stringify!(__align) + ) + ); +} +impl Default for pthread_rwlock_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_rwlockattr_t { + pub __size: [::std::os::raw::c_char; 8usize], + pub __align: ::std::os::raw::c_long, + _bindgen_union_align: u64, +} +#[test] +fn bindgen_test_layout_pthread_rwlockattr_t() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(pthread_rwlockattr_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pthread_rwlockattr_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_rwlockattr_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_rwlockattr_t), + "::", + stringify!(__align) + ) + ); +} +impl Default for pthread_rwlockattr_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type pthread_spinlock_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_barrier_t { + pub __size: [::std::os::raw::c_char; 32usize], + pub __align: ::std::os::raw::c_long, + _bindgen_union_align: [u64; 4usize], +} +#[test] +fn bindgen_test_layout_pthread_barrier_t() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(pthread_barrier_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(pthread_barrier_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_barrier_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_barrier_t), + "::", + stringify!(__align) + ) + ); +} +impl Default for pthread_barrier_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_barrierattr_t { + pub __size: [::std::os::raw::c_char; 4usize], + pub __align: ::std::os::raw::c_int, + _bindgen_union_align: u32, +} +#[test] +fn bindgen_test_layout_pthread_barrierattr_t() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(pthread_barrierattr_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(pthread_barrierattr_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_barrierattr_t), + "::", + stringify!(__size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(pthread_barrierattr_t), + "::", + stringify!(__align) + ) + ); +} +impl Default for pthread_barrierattr_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn pthread_sigmask( + __how: ::std::os::raw::c_int, + __newmask: *const __sigset_t, + __oldmask: *mut __sigset_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn pthread_kill( + __threadid: pthread_t, + __signo: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __libc_current_sigrtmin() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __libc_current_sigrtmax() -> ::std::os::raw::c_int; +} +pub type int_least8_t = __int_least8_t; +pub type int_least16_t = __int_least16_t; +pub type int_least32_t = __int_least32_t; +pub type int_least64_t = __int_least64_t; +pub type uint_least8_t = __uint_least8_t; +pub type uint_least16_t = __uint_least16_t; +pub type uint_least32_t = __uint_least32_t; +pub type uint_least64_t = __uint_least64_t; +pub type int_fast8_t = ::std::os::raw::c_schar; +pub type int_fast16_t = ::std::os::raw::c_long; +pub type int_fast32_t = ::std::os::raw::c_long; +pub type int_fast64_t = ::std::os::raw::c_long; +pub type uint_fast8_t = ::std::os::raw::c_uchar; +pub type uint_fast16_t = ::std::os::raw::c_ulong; +pub type uint_fast32_t = ::std::os::raw::c_ulong; +pub type uint_fast64_t = ::std::os::raw::c_ulong; +pub type intmax_t = __intmax_t; +pub type uintmax_t = __uintmax_t; +extern "C" { + pub fn TCOD_strdup(s: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_strcasecmp( + s1: *const ::std::os::raw::c_char, + s2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_strncasecmp( + s1: *const ::std::os::raw::c_char, + s2: *const ::std::os::raw::c_char, + n: size_t, + ) -> ::std::os::raw::c_int; +} +pub type TCOD_line_listener_t = ::std::option::Option< + unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> bool, +>; +extern "C" { + pub fn TCOD_line_init( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_line_step( + xCur: *mut ::std::os::raw::c_int, + yCur: *mut ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_line( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + listener: TCOD_line_listener_t, + ) -> bool; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_bresenham_data_t { + pub stepx: ::std::os::raw::c_int, + pub stepy: ::std::os::raw::c_int, + pub e: ::std::os::raw::c_int, + pub deltax: ::std::os::raw::c_int, + pub deltay: ::std::os::raw::c_int, + pub origx: ::std::os::raw::c_int, + pub origy: ::std::os::raw::c_int, + pub destx: ::std::os::raw::c_int, + pub desty: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_bresenham_data_t() { + assert_eq!( + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(TCOD_bresenham_data_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_bresenham_data_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stepx as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(stepx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stepy as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(stepy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).e as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(e) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).deltax as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(deltax) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).deltay as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(deltay) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).origx as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(origx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).origy as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(origy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).destx as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(destx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).desty as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(desty) + ) + ); +} +extern "C" { + pub fn TCOD_line_init_mt( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + data: *mut TCOD_bresenham_data_t, + ); +} +extern "C" { + pub fn TCOD_line_step_mt( + xCur: *mut ::std::os::raw::c_int, + yCur: *mut ::std::os::raw::c_int, + data: *mut TCOD_bresenham_data_t, + ) -> bool; +} +extern "C" { + pub fn TCOD_line_mt( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + listener: TCOD_line_listener_t, + data: *mut TCOD_bresenham_data_t, + ) -> bool; +} +pub type TCOD_random_t = *mut ::std::os::raw::c_void; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_dice_t { + pub nb_rolls: ::std::os::raw::c_int, + pub nb_faces: ::std::os::raw::c_int, + pub multiplier: f32, + pub addsub: f32, +} +#[test] +fn bindgen_test_layout_TCOD_dice_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_dice_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_dice_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_rolls as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(nb_rolls) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_faces as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(nb_faces) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).multiplier as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(multiplier) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).addsub as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(addsub) + ) + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_random_algo_t { + TCOD_RNG_MT = 0, + TCOD_RNG_CMWC = 1, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_distribution_t { + TCOD_DISTRIBUTION_LINEAR = 0, + TCOD_DISTRIBUTION_GAUSSIAN = 1, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE = 2, + TCOD_DISTRIBUTION_GAUSSIAN_INVERSE = 3, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE = 4, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TCOD_tree_t { + pub next: *mut _TCOD_tree_t, + pub father: *mut _TCOD_tree_t, + pub sons: *mut _TCOD_tree_t, +} +#[test] +fn bindgen_test_layout__TCOD_tree_t() { + assert_eq!( + ::std::mem::size_of::<_TCOD_tree_t>(), + 24usize, + concat!("Size of: ", stringify!(_TCOD_tree_t)) + ); + assert_eq!( + ::std::mem::align_of::<_TCOD_tree_t>(), + 8usize, + concat!("Alignment of ", stringify!(_TCOD_tree_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).next as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).father as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(father) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).sons as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(sons) + ) + ); +} +impl Default for _TCOD_tree_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_tree_t = _TCOD_tree_t; +extern "C" { + pub fn TCOD_tree_new() -> *mut TCOD_tree_t; +} +extern "C" { + pub fn TCOD_tree_add_son(node: *mut TCOD_tree_t, son: *mut TCOD_tree_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_bsp_t { + pub tree: TCOD_tree_t, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub w: ::std::os::raw::c_int, + pub h: ::std::os::raw::c_int, + pub position: ::std::os::raw::c_int, + pub level: u8, + pub horizontal: bool, +} +#[test] +fn bindgen_test_layout_TCOD_bsp_t() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(TCOD_bsp_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_bsp_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tree as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(tree) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(position) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).level as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(level) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).horizontal as *const _ as usize }, + 45usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(horizontal) + ) + ); +} +impl Default for TCOD_bsp_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_bsp_callback_t = ::std::option::Option< + unsafe extern "C" fn(node: *mut TCOD_bsp_t, userData: *mut ::std::os::raw::c_void) -> bool, +>; +extern "C" { + pub fn TCOD_bsp_new() -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_new_with_size( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_delete(node: *mut TCOD_bsp_t); +} +extern "C" { + pub fn TCOD_bsp_left(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_right(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_father(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_is_leaf(node: *mut TCOD_bsp_t) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_pre_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_in_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_post_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_level_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_inverted_level_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_contains( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_find_node( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_resize( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_bsp_split_once( + node: *mut TCOD_bsp_t, + horizontal: bool, + position: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_bsp_split_recursive( + node: *mut TCOD_bsp_t, + randomizer: TCOD_random_t, + nb: ::std::os::raw::c_int, + minHSize: ::std::os::raw::c_int, + minVSize: ::std::os::raw::c_int, + maxHRatio: f32, + maxVRatio: f32, + ); +} +extern "C" { + pub fn TCOD_bsp_remove_sons(node: *mut TCOD_bsp_t); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_color_t { + pub r: u8, + pub g: u8, + pub b: u8, +} +#[test] +fn bindgen_test_layout_TCOD_color_t() { + assert_eq!( + ::std::mem::size_of::(), + 3usize, + concat!("Size of: ", stringify!(TCOD_color_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_color_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_color_t), + "::", + stringify!(r) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_color_t), + "::", + stringify!(g) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_color_t), + "::", + stringify!(b) + ) + ); +} +extern "C" { + pub fn TCOD_color_RGB(r: u8, g: u8, b: u8) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_HSV(h: f32, s: f32, v: f32) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_equals(c1: TCOD_color_t, c2: TCOD_color_t) -> bool; +} +extern "C" { + pub fn TCOD_color_add(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_subtract(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_multiply(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_multiply_scalar(c1: TCOD_color_t, value: f32) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_lerp(c1: TCOD_color_t, c2: TCOD_color_t, coef: f32) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_set_HSV(c: *mut TCOD_color_t, h: f32, s: f32, v: f32); +} +extern "C" { + pub fn TCOD_color_get_HSV(c: TCOD_color_t, h: *mut f32, s: *mut f32, v: *mut f32); +} +extern "C" { + pub fn TCOD_color_get_hue(c: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_hue(c: *mut TCOD_color_t, h: f32); +} +extern "C" { + pub fn TCOD_color_get_saturation(c: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_saturation(c: *mut TCOD_color_t, s: f32); +} +extern "C" { + pub fn TCOD_color_get_value(c: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_value(c: *mut TCOD_color_t, v: f32); +} +extern "C" { + pub fn TCOD_color_shift_hue(c: *mut TCOD_color_t, hshift: f32); +} +extern "C" { + pub fn TCOD_color_scale_HSV(c: *mut TCOD_color_t, scoef: f32, vcoef: f32); +} +extern "C" { + pub fn TCOD_color_gen_map( + map: *mut TCOD_color_t, + nb_key: ::std::os::raw::c_int, + key_color: *const TCOD_color_t, + key_index: *const ::std::os::raw::c_int, + ); +} +pub const TCOD_COLOR_RED: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_RED; +pub const TCOD_COLOR_FLAME: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_FLAME; +pub const TCOD_COLOR_ORANGE: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_ORANGE; +pub const TCOD_COLOR_AMBER: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_AMBER; +pub const TCOD_COLOR_YELLOW: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_YELLOW; +pub const TCOD_COLOR_LIME: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_LIME; +pub const TCOD_COLOR_CHARTREUSE: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_CHARTREUSE; +pub const TCOD_COLOR_GREEN: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_GREEN; +pub const TCOD_COLOR_SEA: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_SEA; +pub const TCOD_COLOR_TURQUOISE: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_TURQUOISE; +pub const TCOD_COLOR_CYAN: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_CYAN; +pub const TCOD_COLOR_SKY: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_SKY; +pub const TCOD_COLOR_AZURE: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_AZURE; +pub const TCOD_COLOR_BLUE: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_BLUE; +pub const TCOD_COLOR_HAN: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_HAN; +pub const TCOD_COLOR_VIOLET: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_VIOLET; +pub const TCOD_COLOR_PURPLE: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_PURPLE; +pub const TCOD_COLOR_FUCHSIA: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_FUCHSIA; +pub const TCOD_COLOR_MAGENTA: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_MAGENTA; +pub const TCOD_COLOR_PINK: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_PINK; +pub const TCOD_COLOR_CRIMSON: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_CRIMSON; +pub const TCOD_COLOR_NB: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_NB; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_10 { + TCOD_COLOR_RED = 0, + TCOD_COLOR_FLAME = 1, + TCOD_COLOR_ORANGE = 2, + TCOD_COLOR_AMBER = 3, + TCOD_COLOR_YELLOW = 4, + TCOD_COLOR_LIME = 5, + TCOD_COLOR_CHARTREUSE = 6, + TCOD_COLOR_GREEN = 7, + TCOD_COLOR_SEA = 8, + TCOD_COLOR_TURQUOISE = 9, + TCOD_COLOR_CYAN = 10, + TCOD_COLOR_SKY = 11, + TCOD_COLOR_AZURE = 12, + TCOD_COLOR_BLUE = 13, + TCOD_COLOR_HAN = 14, + TCOD_COLOR_VIOLET = 15, + TCOD_COLOR_PURPLE = 16, + TCOD_COLOR_FUCHSIA = 17, + TCOD_COLOR_MAGENTA = 18, + TCOD_COLOR_PINK = 19, + TCOD_COLOR_CRIMSON = 20, + TCOD_COLOR_NB = 21, +} +pub const TCOD_COLOR_DESATURATED: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_DESATURATED; +pub const TCOD_COLOR_LIGHTEST: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_LIGHTEST; +pub const TCOD_COLOR_LIGHTER: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_LIGHTER; +pub const TCOD_COLOR_LIGHT: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_LIGHT; +pub const TCOD_COLOR_NORMAL: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_NORMAL; +pub const TCOD_COLOR_DARK: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_DARK; +pub const TCOD_COLOR_DARKER: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_DARKER; +pub const TCOD_COLOR_DARKEST: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_DARKEST; +pub const TCOD_COLOR_LEVELS: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_LEVELS; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_11 { + TCOD_COLOR_DESATURATED = 0, + TCOD_COLOR_LIGHTEST = 1, + TCOD_COLOR_LIGHTER = 2, + TCOD_COLOR_LIGHT = 3, + TCOD_COLOR_NORMAL = 4, + TCOD_COLOR_DARK = 5, + TCOD_COLOR_DARKER = 6, + TCOD_COLOR_DARKEST = 7, + TCOD_COLOR_LEVELS = 8, +} +extern "C" { + pub static mut TCOD_colors: [[TCOD_color_t; 8usize]; 21usize]; +} +extern "C" { + pub static TCOD_black: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_white: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_brass: TCOD_color_t; +} +extern "C" { + pub static TCOD_copper: TCOD_color_t; +} +extern "C" { + pub static TCOD_gold: TCOD_color_t; +} +extern "C" { + pub static TCOD_silver: TCOD_color_t; +} +extern "C" { + pub static TCOD_celadon: TCOD_color_t; +} +extern "C" { + pub static TCOD_peach: TCOD_color_t; +} +pub type TCOD_console_t = *mut ::std::os::raw::c_void; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_keycode_t { + TCODK_NONE = 0, + TCODK_ESCAPE = 1, + TCODK_BACKSPACE = 2, + TCODK_TAB = 3, + TCODK_ENTER = 4, + TCODK_SHIFT = 5, + TCODK_CONTROL = 6, + TCODK_ALT = 7, + TCODK_PAUSE = 8, + TCODK_CAPSLOCK = 9, + TCODK_PAGEUP = 10, + TCODK_PAGEDOWN = 11, + TCODK_END = 12, + TCODK_HOME = 13, + TCODK_UP = 14, + TCODK_LEFT = 15, + TCODK_RIGHT = 16, + TCODK_DOWN = 17, + TCODK_PRINTSCREEN = 18, + TCODK_INSERT = 19, + TCODK_DELETE = 20, + TCODK_LWIN = 21, + TCODK_RWIN = 22, + TCODK_APPS = 23, + TCODK_0 = 24, + TCODK_1 = 25, + TCODK_2 = 26, + TCODK_3 = 27, + TCODK_4 = 28, + TCODK_5 = 29, + TCODK_6 = 30, + TCODK_7 = 31, + TCODK_8 = 32, + TCODK_9 = 33, + TCODK_KP0 = 34, + TCODK_KP1 = 35, + TCODK_KP2 = 36, + TCODK_KP3 = 37, + TCODK_KP4 = 38, + TCODK_KP5 = 39, + TCODK_KP6 = 40, + TCODK_KP7 = 41, + TCODK_KP8 = 42, + TCODK_KP9 = 43, + TCODK_KPADD = 44, + TCODK_KPSUB = 45, + TCODK_KPDIV = 46, + TCODK_KPMUL = 47, + TCODK_KPDEC = 48, + TCODK_KPENTER = 49, + TCODK_F1 = 50, + TCODK_F2 = 51, + TCODK_F3 = 52, + TCODK_F4 = 53, + TCODK_F5 = 54, + TCODK_F6 = 55, + TCODK_F7 = 56, + TCODK_F8 = 57, + TCODK_F9 = 58, + TCODK_F10 = 59, + TCODK_F11 = 60, + TCODK_F12 = 61, + TCODK_NUMLOCK = 62, + TCODK_SCROLLLOCK = 63, + TCODK_SPACE = 64, + TCODK_CHAR = 65, + TCODK_TEXT = 66, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_key_t { + pub vk: TCOD_keycode_t, + pub c: ::std::os::raw::c_char, + pub text: [::std::os::raw::c_char; 32usize], + pub pressed: bool, + pub lalt: bool, + pub lctrl: bool, + pub lmeta: bool, + pub ralt: bool, + pub rctrl: bool, + pub rmeta: bool, + pub shift: bool, +} +#[test] +fn bindgen_test_layout_TCOD_key_t() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(TCOD_key_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_key_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vk as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(vk) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(c) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).text as *const _ as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(text) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pressed as *const _ as usize }, + 37usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lalt as *const _ as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lalt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lctrl as *const _ as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lctrl) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lmeta as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lmeta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ralt as *const _ as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(ralt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rctrl as *const _ as usize }, + 42usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(rctrl) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rmeta as *const _ as usize }, + 43usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(rmeta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).shift as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(shift) + ) + ); +} +impl Default for TCOD_key_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_chars_t { + TCOD_CHAR_HLINE = 196, + TCOD_CHAR_VLINE = 179, + TCOD_CHAR_NE = 191, + TCOD_CHAR_NW = 218, + TCOD_CHAR_SE = 217, + TCOD_CHAR_SW = 192, + TCOD_CHAR_TEEW = 180, + TCOD_CHAR_TEEE = 195, + TCOD_CHAR_TEEN = 193, + TCOD_CHAR_TEES = 194, + TCOD_CHAR_CROSS = 197, + TCOD_CHAR_DHLINE = 205, + TCOD_CHAR_DVLINE = 186, + TCOD_CHAR_DNE = 187, + TCOD_CHAR_DNW = 201, + TCOD_CHAR_DSE = 188, + TCOD_CHAR_DSW = 200, + TCOD_CHAR_DTEEW = 185, + TCOD_CHAR_DTEEE = 204, + TCOD_CHAR_DTEEN = 202, + TCOD_CHAR_DTEES = 203, + TCOD_CHAR_DCROSS = 206, + TCOD_CHAR_BLOCK1 = 176, + TCOD_CHAR_BLOCK2 = 177, + TCOD_CHAR_BLOCK3 = 178, + TCOD_CHAR_ARROW_N = 24, + TCOD_CHAR_ARROW_S = 25, + TCOD_CHAR_ARROW_E = 26, + TCOD_CHAR_ARROW_W = 27, + TCOD_CHAR_ARROW2_N = 30, + TCOD_CHAR_ARROW2_S = 31, + TCOD_CHAR_ARROW2_E = 16, + TCOD_CHAR_ARROW2_W = 17, + TCOD_CHAR_DARROW_H = 29, + TCOD_CHAR_DARROW_V = 18, + TCOD_CHAR_CHECKBOX_UNSET = 224, + TCOD_CHAR_CHECKBOX_SET = 225, + TCOD_CHAR_RADIO_UNSET = 9, + TCOD_CHAR_RADIO_SET = 10, + TCOD_CHAR_SUBP_NW = 226, + TCOD_CHAR_SUBP_NE = 227, + TCOD_CHAR_SUBP_N = 228, + TCOD_CHAR_SUBP_SE = 229, + TCOD_CHAR_SUBP_DIAG = 230, + TCOD_CHAR_SUBP_E = 231, + TCOD_CHAR_SUBP_SW = 232, + TCOD_CHAR_SMILIE = 1, + TCOD_CHAR_SMILIE_INV = 2, + TCOD_CHAR_HEART = 3, + TCOD_CHAR_DIAMOND = 4, + TCOD_CHAR_CLUB = 5, + TCOD_CHAR_SPADE = 6, + TCOD_CHAR_BULLET = 7, + TCOD_CHAR_BULLET_INV = 8, + TCOD_CHAR_MALE = 11, + TCOD_CHAR_FEMALE = 12, + TCOD_CHAR_NOTE = 13, + TCOD_CHAR_NOTE_DOUBLE = 14, + TCOD_CHAR_LIGHT = 15, + TCOD_CHAR_EXCLAM_DOUBLE = 19, + TCOD_CHAR_PILCROW = 20, + TCOD_CHAR_SECTION = 21, + TCOD_CHAR_POUND = 156, + TCOD_CHAR_MULTIPLICATION = 158, + TCOD_CHAR_FUNCTION = 159, + TCOD_CHAR_RESERVED = 169, + TCOD_CHAR_HALF = 171, + TCOD_CHAR_ONE_QUARTER = 172, + TCOD_CHAR_COPYRIGHT = 184, + TCOD_CHAR_CENT = 189, + TCOD_CHAR_YEN = 190, + TCOD_CHAR_CURRENCY = 207, + TCOD_CHAR_THREE_QUARTERS = 243, + TCOD_CHAR_DIVISION = 246, + TCOD_CHAR_GRADE = 248, + TCOD_CHAR_UMLAUT = 249, + TCOD_CHAR_POW1 = 251, + TCOD_CHAR_POW3 = 252, + TCOD_CHAR_POW2 = 253, + TCOD_CHAR_BULLET_SQUARE = 254, +} +impl TCOD_colctrl_t { + pub const TCOD_COLCTRL_NUMBER: TCOD_colctrl_t = TCOD_colctrl_t::TCOD_COLCTRL_5; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_colctrl_t { + TCOD_COLCTRL_1 = 1, + TCOD_COLCTRL_2 = 2, + TCOD_COLCTRL_3 = 3, + TCOD_COLCTRL_4 = 4, + TCOD_COLCTRL_5 = 5, + TCOD_COLCTRL_FORE_RGB = 6, + TCOD_COLCTRL_BACK_RGB = 7, + TCOD_COLCTRL_STOP = 8, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_bkgnd_flag_t { + TCOD_BKGND_NONE = 0, + TCOD_BKGND_SET = 1, + TCOD_BKGND_MULTIPLY = 2, + TCOD_BKGND_LIGHTEN = 3, + TCOD_BKGND_DARKEN = 4, + TCOD_BKGND_SCREEN = 5, + TCOD_BKGND_COLOR_DODGE = 6, + TCOD_BKGND_COLOR_BURN = 7, + TCOD_BKGND_ADD = 8, + TCOD_BKGND_ADDA = 9, + TCOD_BKGND_BURN = 10, + TCOD_BKGND_OVERLAY = 11, + TCOD_BKGND_ALPH = 12, + TCOD_BKGND_DEFAULT = 13, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_key_status_t { + TCOD_KEY_PRESSED = 1, + TCOD_KEY_RELEASED = 2, +} +impl TCOD_font_flags_t { + pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = + TCOD_font_flags_t::TCOD_FONT_TYPE_GREYSCALE; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_font_flags_t { + TCOD_FONT_LAYOUT_ASCII_INCOL = 1, + TCOD_FONT_LAYOUT_ASCII_INROW = 2, + TCOD_FONT_TYPE_GREYSCALE = 4, + TCOD_FONT_LAYOUT_TCOD = 8, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_renderer_t { + TCOD_RENDERER_GLSL = 0, + TCOD_RENDERER_OPENGL = 1, + TCOD_RENDERER_SDL = 2, + TCOD_NB_RENDERERS = 3, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_alignment_t { + TCOD_LEFT = 0, + TCOD_RIGHT = 1, + TCOD_CENTER = 2, +} +pub type TCOD_image_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_image_new( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_image_from_console(console: TCOD_console_t) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_image_refresh_console(image: TCOD_image_t, console: TCOD_console_t); +} +extern "C" { + pub fn TCOD_image_load(filename: *const ::std::os::raw::c_char) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_image_clear(image: TCOD_image_t, color: TCOD_color_t); +} +extern "C" { + pub fn TCOD_image_invert(image: TCOD_image_t); +} +extern "C" { + pub fn TCOD_image_hflip(image: TCOD_image_t); +} +extern "C" { + pub fn TCOD_image_rotate90(image: TCOD_image_t, numRotations: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_image_vflip(image: TCOD_image_t); +} +extern "C" { + pub fn TCOD_image_scale( + image: TCOD_image_t, + neww: ::std::os::raw::c_int, + newh: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_save(image: TCOD_image_t, filename: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_image_get_size( + image: TCOD_image_t, + w: *mut ::std::os::raw::c_int, + h: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_get_pixel( + image: TCOD_image_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_image_get_alpha( + image: TCOD_image_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_image_get_mipmap_pixel( + image: TCOD_image_t, + x0: f32, + y0: f32, + x1: f32, + y1: f32, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_image_put_pixel( + image: TCOD_image_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); +} +extern "C" { + pub fn TCOD_image_blit( + image: TCOD_image_t, + console: TCOD_console_t, + x: f32, + y: f32, + bkgnd_flag: TCOD_bkgnd_flag_t, + scalex: f32, + scaley: f32, + angle: f32, + ); +} +extern "C" { + pub fn TCOD_image_blit_rect( + image: TCOD_image_t, + console: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + bkgnd_flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_image_blit_2x( + image: TCOD_image_t, + dest: TCOD_console_t, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + sx: ::std::os::raw::c_int, + sy: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_delete(image: TCOD_image_t); +} +extern "C" { + pub fn TCOD_image_set_key_color(image: TCOD_image_t, key_color: TCOD_color_t); +} +extern "C" { + pub fn TCOD_image_is_pixel_transparent( + image: TCOD_image_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +pub type TCOD_list_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_list_new() -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_allocate(nb_elements: ::std::os::raw::c_int) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_duplicate(l: TCOD_list_t) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_delete(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_push(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_pop(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_peek(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_add_all(l: TCOD_list_t, l2: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_get(l: TCOD_list_t, idx: ::std::os::raw::c_int) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_set( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + idx: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_list_begin(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_end(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_reverse(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_remove_iterator( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_remove(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_remove_iterator_fast( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_remove_fast(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_contains(l: TCOD_list_t, elt: *const ::std::os::raw::c_void) -> bool; +} +extern "C" { + pub fn TCOD_list_clear(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_clear_and_delete(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_size(l: TCOD_list_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_list_insert_before( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + before: ::std::os::raw::c_int, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_is_empty(l: TCOD_list_t) -> bool; +} +extern "C" { + pub fn TCOD_console_init_root( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fullscreen: bool, + renderer: TCOD_renderer_t, + ); +} +extern "C" { + pub fn TCOD_console_set_window_title(title: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_console_set_fullscreen(fullscreen: bool); +} +extern "C" { + pub fn TCOD_console_is_fullscreen() -> bool; +} +extern "C" { + pub fn TCOD_console_is_window_closed() -> bool; +} +extern "C" { + pub fn TCOD_console_has_mouse_focus() -> bool; +} +extern "C" { + pub fn TCOD_console_is_active() -> bool; +} +extern "C" { + pub fn TCOD_console_set_custom_font( + fontFile: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + nb_char_horiz: ::std::os::raw::c_int, + nb_char_vertic: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_ascii_code_to_font( + asciiCode: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_ascii_codes_to_font( + asciiCode: ::std::os::raw::c_int, + nbCodes: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_string_to_font( + s: *const ::std::os::raw::c_char, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_set_dirty( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_set_default_background(con: TCOD_console_t, col: TCOD_color_t); +} +extern "C" { + pub fn TCOD_console_set_default_foreground(con: TCOD_console_t, col: TCOD_color_t); +} +extern "C" { + pub fn TCOD_console_clear(con: TCOD_console_t); +} +extern "C" { + pub fn TCOD_console_set_char_background( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_console_set_char_foreground( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); +} +extern "C" { + pub fn TCOD_console_set_char( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_put_char( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_console_put_char_ex( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + fore: TCOD_color_t, + back: TCOD_color_t, + ); +} +extern "C" { + pub fn TCOD_console_set_background_flag(con: TCOD_console_t, flag: TCOD_bkgnd_flag_t); +} +extern "C" { + pub fn TCOD_console_get_background_flag(con: TCOD_console_t) -> TCOD_bkgnd_flag_t; +} +extern "C" { + pub fn TCOD_console_set_alignment(con: TCOD_console_t, alignment: TCOD_alignment_t); +} +extern "C" { + pub fn TCOD_console_get_alignment(con: TCOD_console_t) -> TCOD_alignment_t; +} +extern "C" { + pub fn TCOD_console_print( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_ex( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_rect( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_rect_ex( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_rect( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + clear: bool, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_console_hline( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_console_vline( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_console_print_frame( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + empty: bool, + flag: TCOD_bkgnd_flag_t, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_map_string_to_font_utf( + s: *const wchar_t, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_print_utf( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_ex_utf( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_rect_utf( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_rect_ex_utf( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_utf( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_default_background(con: TCOD_console_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_get_default_foreground(con: TCOD_console_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_get_char_background( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_get_char_foreground( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_get_char( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_background_color_image(con: TCOD_console_t) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_console_get_foreground_color_image(con: TCOD_console_t) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_console_set_fade(val: u8, fade: TCOD_color_t); +} +extern "C" { + pub fn TCOD_console_get_fade() -> u8; +} +extern "C" { + pub fn TCOD_console_get_fading_color() -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_flush(); +} +extern "C" { + pub fn TCOD_console_set_color_control( + con: TCOD_colctrl_t, + fore: TCOD_color_t, + back: TCOD_color_t, + ); +} +extern "C" { + pub fn TCOD_console_check_for_keypress(flags: ::std::os::raw::c_int) -> TCOD_key_t; +} +extern "C" { + pub fn TCOD_console_wait_for_keypress(flush: bool) -> TCOD_key_t; +} +extern "C" { + pub fn TCOD_console_is_key_pressed(key: TCOD_keycode_t) -> bool; +} +extern "C" { + pub fn TCOD_console_from_file(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_load_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_load_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_new(w: ::std::os::raw::c_int, h: ::std::os::raw::c_int) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_get_width(con: TCOD_console_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height(con: TCOD_console_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_set_key_color(con: TCOD_console_t, col: TCOD_color_t); +} +extern "C" { + pub fn TCOD_console_blit( + src: TCOD_console_t, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + dst: TCOD_console_t, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + foreground_alpha: f32, + background_alpha: f32, + ); +} +extern "C" { + pub fn TCOD_console_delete(console: TCOD_console_t); +} +extern "C" { + pub fn TCOD_console_credits(); +} +extern "C" { + pub fn TCOD_console_credits_reset(); +} +extern "C" { + pub fn TCOD_console_credits_render( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + alpha: bool, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_load_xp( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_xp( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_list_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_console_list_save_xp( + console_list: TCOD_list_t, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; +} +pub type TCOD_map_t = *mut ::std::os::raw::c_void; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_fov_algorithm_t { + FOV_BASIC = 0, + FOV_DIAMOND = 1, + FOV_SHADOW = 2, + FOV_PERMISSIVE_0 = 3, + FOV_PERMISSIVE_1 = 4, + FOV_PERMISSIVE_2 = 5, + FOV_PERMISSIVE_3 = 6, + FOV_PERMISSIVE_4 = 7, + FOV_PERMISSIVE_5 = 8, + FOV_PERMISSIVE_6 = 9, + FOV_PERMISSIVE_7 = 10, + FOV_PERMISSIVE_8 = 11, + FOV_RESTRICTIVE = 12, + NB_FOV_ALGORITHMS = 13, +} +extern "C" { + pub fn TCOD_map_new(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int) -> TCOD_map_t; +} +extern "C" { + pub fn TCOD_map_clear(map: TCOD_map_t, transparent: bool, walkable: bool); +} +extern "C" { + pub fn TCOD_map_copy(source: TCOD_map_t, dest: TCOD_map_t); +} +extern "C" { + pub fn TCOD_map_set_properties( + map: TCOD_map_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + is_transparent: bool, + is_walkable: bool, + ); +} +extern "C" { + pub fn TCOD_map_delete(map: TCOD_map_t); +} +extern "C" { + pub fn TCOD_map_compute_fov( + map: TCOD_map_t, + player_x: ::std::os::raw::c_int, + player_y: ::std::os::raw::c_int, + max_radius: ::std::os::raw::c_int, + light_walls: bool, + algo: TCOD_fov_algorithm_t, + ); +} +extern "C" { + pub fn TCOD_map_is_in_fov( + map: TCOD_map_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_set_in_fov( + map: TCOD_map_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fov: bool, + ); +} +extern "C" { + pub fn TCOD_map_is_transparent( + map: TCOD_map_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_is_walkable( + map: TCOD_map_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_get_width(map: TCOD_map_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_map_get_height(map: TCOD_map_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_map_get_nb_cells(map: TCOD_map_t) -> ::std::os::raw::c_int; +} +pub type TCOD_noise_t = *mut ::std::os::raw::c_void; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_noise_type_t { + TCOD_NOISE_PERLIN = 1, + TCOD_NOISE_SIMPLEX = 2, + TCOD_NOISE_WAVELET = 4, + TCOD_NOISE_DEFAULT = 0, +} +extern "C" { + pub fn TCOD_noise_new( + dimensions: ::std::os::raw::c_int, + hurst: f32, + lacunarity: f32, + random: TCOD_random_t, + ) -> TCOD_noise_t; +} +extern "C" { + pub fn TCOD_noise_set_type(noise: TCOD_noise_t, type_: TCOD_noise_type_t); +} +extern "C" { + pub fn TCOD_noise_get_ex(noise: TCOD_noise_t, f: *mut f32, type_: TCOD_noise_type_t) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_fbm_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_turbulence_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; +} +extern "C" { + pub fn TCOD_noise_get(noise: TCOD_noise_t, f: *mut f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_fbm(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_turbulence(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_delete(noise: TCOD_noise_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_heightmap_t { + pub w: ::std::os::raw::c_int, + pub h: ::std::os::raw::c_int, + pub values: *mut f32, +} +#[test] +fn bindgen_test_layout_TCOD_heightmap_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).values as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(values) + ) + ); +} +impl Default for TCOD_heightmap_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_heightmap_new( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_heightmap_t; +} +extern "C" { + pub fn TCOD_heightmap_delete(hm: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_get_value( + hm: *const TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_get_interpolated_value( + hm: *const TCOD_heightmap_t, + x: f32, + y: f32, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_set_value( + hm: *mut TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + value: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_get_slope( + hm: *const TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_get_normal( + hm: *const TCOD_heightmap_t, + x: f32, + y: f32, + n: *mut f32, + waterLevel: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_count_cells( + hm: *const TCOD_heightmap_t, + min: f32, + max: f32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_heightmap_has_land_on_border(hm: *const TCOD_heightmap_t, waterLevel: f32) -> bool; +} +extern "C" { + pub fn TCOD_heightmap_get_minmax(hm: *const TCOD_heightmap_t, min: *mut f32, max: *mut f32); +} +extern "C" { + pub fn TCOD_heightmap_copy(hm_source: *const TCOD_heightmap_t, hm_dest: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_add(hm: *mut TCOD_heightmap_t, value: f32); +} +extern "C" { + pub fn TCOD_heightmap_scale(hm: *mut TCOD_heightmap_t, value: f32); +} +extern "C" { + pub fn TCOD_heightmap_clamp(hm: *mut TCOD_heightmap_t, min: f32, max: f32); +} +extern "C" { + pub fn TCOD_heightmap_normalize(hm: *mut TCOD_heightmap_t, min: f32, max: f32); +} +extern "C" { + pub fn TCOD_heightmap_clear(hm: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_lerp_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + coef: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_multiply_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_dig_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_dig_bezier( + hm: *mut TCOD_heightmap_t, + px: *mut ::std::os::raw::c_int, + py: *mut ::std::os::raw::c_int, + startRadius: f32, + startDepth: f32, + endRadius: f32, + endDepth: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_rain_erosion( + hm: *mut TCOD_heightmap_t, + nbDrops: ::std::os::raw::c_int, + erosionCoef: f32, + sedimentationCoef: f32, + rnd: TCOD_random_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_kernel_transform( + hm: *mut TCOD_heightmap_t, + kernelsize: ::std::os::raw::c_int, + dx: *const ::std::os::raw::c_int, + dy: *const ::std::os::raw::c_int, + weight: *const f32, + minLevel: f32, + maxLevel: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_voronoi( + hm: *mut TCOD_heightmap_t, + nbPoints: ::std::os::raw::c_int, + nbCoef: ::std::os::raw::c_int, + coef: *const f32, + rnd: TCOD_random_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_mid_point_displacement( + hm: *mut TCOD_heightmap_t, + rnd: TCOD_random_t, + roughness: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_scale_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_islandify(hm: *mut TCOD_heightmap_t, seaLevel: f32, rnd: TCOD_random_t); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct TCOD_lex_t { + pub file_line: ::std::os::raw::c_int, + pub token_type: ::std::os::raw::c_int, + pub token_int_val: ::std::os::raw::c_int, + pub token_idx: ::std::os::raw::c_int, + pub token_float_val: f32, + pub tok: *mut ::std::os::raw::c_char, + pub toklen: ::std::os::raw::c_int, + pub lastStringDelim: ::std::os::raw::c_char, + pub pos: *mut ::std::os::raw::c_char, + pub buf: *mut ::std::os::raw::c_char, + pub filename: *mut ::std::os::raw::c_char, + pub last_javadoc_comment: *mut ::std::os::raw::c_char, + pub nb_symbols: ::std::os::raw::c_int, + pub nb_keywords: ::std::os::raw::c_int, + pub flags: ::std::os::raw::c_int, + pub symbols: [[::std::os::raw::c_char; 5usize]; 100usize], + pub keywords: [[::std::os::raw::c_char; 20usize]; 100usize], + pub simpleCmt: *const ::std::os::raw::c_char, + pub cmtStart: *const ::std::os::raw::c_char, + pub cmtStop: *const ::std::os::raw::c_char, + pub javadocCmtStart: *const ::std::os::raw::c_char, + pub stringDelim: *const ::std::os::raw::c_char, + pub javadoc_read: bool, + pub allocBuf: bool, + pub savept: bool, +} +#[test] +fn bindgen_test_layout_TCOD_lex_t() { + assert_eq!( + ::std::mem::size_of::(), + 2632usize, + concat!("Size of: ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).file_line as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(file_line) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_type as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_type) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_int_val as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_int_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_idx as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_idx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_float_val as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_float_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tok as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(tok) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).toklen as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(toklen) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lastStringDelim as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(lastStringDelim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pos as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(pos) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).filename as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(filename) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_javadoc_comment as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(last_javadoc_comment) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_symbols as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_symbols) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_keywords as *const _ as usize }, + 76usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_keywords) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).symbols as *const _ as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(symbols) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).keywords as *const _ as usize }, + 584usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(keywords) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).simpleCmt as *const _ as usize }, + 2584usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(simpleCmt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStart as *const _ as usize }, + 2592usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStop as *const _ as usize }, + 2600usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStop) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadocCmtStart as *const _ as usize }, + 2608usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadocCmtStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stringDelim as *const _ as usize }, + 2616usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(stringDelim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadoc_read as *const _ as usize }, + 2624usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadoc_read) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).allocBuf as *const _ as usize }, + 2625usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(allocBuf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).savept as *const _ as usize }, + 2626usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(savept) + ) + ); +} +impl Default for TCOD_lex_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_lex_new_intern() -> *mut TCOD_lex_t; +} +extern "C" { + pub fn TCOD_lex_new( + symbols: *mut *const ::std::os::raw::c_char, + keywords: *mut *const ::std::os::raw::c_char, + simpleComment: *const ::std::os::raw::c_char, + commentStart: *const ::std::os::raw::c_char, + commentStop: *const ::std::os::raw::c_char, + javadocCommentStart: *const ::std::os::raw::c_char, + stringDelim: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + ) -> *mut TCOD_lex_t; +} +extern "C" { + pub fn TCOD_lex_delete(lex: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_set_data_buffer(lex: *mut TCOD_lex_t, dat: *mut ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_lex_set_data_file( + lex: *mut TCOD_lex_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_parse(lex: *mut TCOD_lex_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_parse_until_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_parse_until_token_value( + lex: *mut TCOD_lex_t, + token_value: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_expect_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_expect_token_value( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + token_value: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_savepoint(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_restore(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_get_last_javadoc(lex: *mut TCOD_lex_t) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_get_token_name( + token_type: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_get_last_error() -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_hextoint(c: ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_instance() -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_new(algo: TCOD_random_algo_t) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_save(mersenne: TCOD_random_t) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_restore(mersenne: TCOD_random_t, backup: TCOD_random_t); +} +extern "C" { + pub fn TCOD_random_new_from_seed(algo: TCOD_random_algo_t, seed: u32) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_delete(mersenne: TCOD_random_t); +} +extern "C" { + pub fn TCOD_random_set_distribution(mersenne: TCOD_random_t, distribution: TCOD_distribution_t); +} +extern "C" { + pub fn TCOD_random_get_int( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_float(mersenne: TCOD_random_t, min: f32, max: f32) -> f32; +} +extern "C" { + pub fn TCOD_random_get_double(mersenne: TCOD_random_t, min: f64, max: f64) -> f64; +} +extern "C" { + pub fn TCOD_random_get_int_mean( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + mean: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_float_mean( + mersenne: TCOD_random_t, + min: f32, + max: f32, + mean: f32, + ) -> f32; +} +extern "C" { + pub fn TCOD_random_get_double_mean( + mersenne: TCOD_random_t, + min: f64, + max: f64, + mean: f64, + ) -> f64; +} +extern "C" { + pub fn TCOD_random_dice_new(s: *const ::std::os::raw::c_char) -> TCOD_dice_t; +} +extern "C" { + pub fn TCOD_random_dice_roll( + mersenne: TCOD_random_t, + dice: TCOD_dice_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_dice_roll_s( + mersenne: TCOD_random_t, + s: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_mouse_t { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub dx: ::std::os::raw::c_int, + pub dy: ::std::os::raw::c_int, + pub cx: ::std::os::raw::c_int, + pub cy: ::std::os::raw::c_int, + pub dcx: ::std::os::raw::c_int, + pub dcy: ::std::os::raw::c_int, + pub lbutton: bool, + pub rbutton: bool, + pub mbutton: bool, + pub lbutton_pressed: bool, + pub rbutton_pressed: bool, + pub mbutton_pressed: bool, + pub wheel_up: bool, + pub wheel_down: bool, +} +#[test] +fn bindgen_test_layout_TCOD_mouse_t() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_mouse_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_mouse_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dx as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dy as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cx as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cy as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcx as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcy as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton as *const _ as usize }, + 33usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton as *const _ as usize }, + 34usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(mbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton_pressed as *const _ as usize }, + 35usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton_pressed as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton_pressed as *const _ as usize }, + 37usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(mbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wheel_up as *const _ as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(wheel_up) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wheel_down as *const _ as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(wheel_down) + ) + ); +} +extern "C" { + pub fn TCOD_mouse_show_cursor(visible: bool); +} +extern "C" { + pub fn TCOD_mouse_get_status() -> TCOD_mouse_t; +} +extern "C" { + pub fn TCOD_mouse_is_cursor_visible() -> bool; +} +extern "C" { + pub fn TCOD_mouse_move(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_mouse_includes_touch(enable: bool); +} +pub type TCOD_namegen_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_namegen_parse(filename: *const ::std::os::raw::c_char, random: TCOD_random_t); +} +extern "C" { + pub fn TCOD_namegen_generate( + name: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_namegen_generate_custom( + name: *mut ::std::os::raw::c_char, + rule: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_namegen_get_sets() -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_namegen_destroy(); +} +pub type TCOD_path_func_t = ::std::option::Option< + unsafe extern "C" fn( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + user_data: *mut ::std::os::raw::c_void, + ) -> f32, +>; +pub type TCOD_path_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_path_new_using_map(map: TCOD_map_t, diagonalCost: f32) -> TCOD_path_t; +} +extern "C" { + pub fn TCOD_path_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_path_t; +} +extern "C" { + pub fn TCOD_path_compute( + path: TCOD_path_t, + ox: ::std::os::raw::c_int, + oy: ::std::os::raw::c_int, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_path_walk( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + recalculate_when_needed: bool, + ) -> bool; +} +extern "C" { + pub fn TCOD_path_is_empty(path: TCOD_path_t) -> bool; +} +extern "C" { + pub fn TCOD_path_size(path: TCOD_path_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_path_reverse(path: TCOD_path_t); +} +extern "C" { + pub fn TCOD_path_get( + path: TCOD_path_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_get_origin( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_get_destination( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_delete(path: TCOD_path_t); +} +pub type TCOD_dijkstra_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_dijkstra_new(map: TCOD_map_t, diagonalCost: f32) -> TCOD_dijkstra_t; +} +extern "C" { + pub fn TCOD_dijkstra_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_dijkstra_t; +} +extern "C" { + pub fn TCOD_dijkstra_compute( + dijkstra: TCOD_dijkstra_t, + root_x: ::std::os::raw::c_int, + root_y: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_dijkstra_get_distance( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_dijkstra_path_set( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_is_empty(path: TCOD_dijkstra_t) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_size(path: TCOD_dijkstra_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_dijkstra_reverse(path: TCOD_dijkstra_t); +} +extern "C" { + pub fn TCOD_dijkstra_get( + path: TCOD_dijkstra_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_dijkstra_path_walk( + dijkstra: TCOD_dijkstra_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_delete(dijkstra: TCOD_dijkstra_t); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_value_type_t { + TCOD_TYPE_NONE = 0, + TCOD_TYPE_BOOL = 1, + TCOD_TYPE_CHAR = 2, + TCOD_TYPE_INT = 3, + TCOD_TYPE_FLOAT = 4, + TCOD_TYPE_STRING = 5, + TCOD_TYPE_COLOR = 6, + TCOD_TYPE_DICE = 7, + TCOD_TYPE_VALUELIST00 = 8, + TCOD_TYPE_VALUELIST01 = 9, + TCOD_TYPE_VALUELIST02 = 10, + TCOD_TYPE_VALUELIST03 = 11, + TCOD_TYPE_VALUELIST04 = 12, + TCOD_TYPE_VALUELIST05 = 13, + TCOD_TYPE_VALUELIST06 = 14, + TCOD_TYPE_VALUELIST07 = 15, + TCOD_TYPE_VALUELIST08 = 16, + TCOD_TYPE_VALUELIST09 = 17, + TCOD_TYPE_VALUELIST10 = 18, + TCOD_TYPE_VALUELIST11 = 19, + TCOD_TYPE_VALUELIST12 = 20, + TCOD_TYPE_VALUELIST13 = 21, + TCOD_TYPE_VALUELIST14 = 22, + TCOD_TYPE_VALUELIST15 = 23, + TCOD_TYPE_CUSTOM00 = 24, + TCOD_TYPE_CUSTOM01 = 25, + TCOD_TYPE_CUSTOM02 = 26, + TCOD_TYPE_CUSTOM03 = 27, + TCOD_TYPE_CUSTOM04 = 28, + TCOD_TYPE_CUSTOM05 = 29, + TCOD_TYPE_CUSTOM06 = 30, + TCOD_TYPE_CUSTOM07 = 31, + TCOD_TYPE_CUSTOM08 = 32, + TCOD_TYPE_CUSTOM09 = 33, + TCOD_TYPE_CUSTOM10 = 34, + TCOD_TYPE_CUSTOM11 = 35, + TCOD_TYPE_CUSTOM12 = 36, + TCOD_TYPE_CUSTOM13 = 37, + TCOD_TYPE_CUSTOM14 = 38, + TCOD_TYPE_CUSTOM15 = 39, + TCOD_TYPE_LIST = 1024, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union TCOD_value_t { + pub b: bool, + pub c: ::std::os::raw::c_char, + pub i: i32, + pub f: f32, + pub s: *mut ::std::os::raw::c_char, + pub col: TCOD_color_t, + pub dice: TCOD_dice_t, + pub list: TCOD_list_t, + pub custom: *mut ::std::os::raw::c_void, + _bindgen_union_align: [u64; 2usize], +} +#[test] +fn bindgen_test_layout_TCOD_value_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_value_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_value_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(b) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(c) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).i as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(i) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).f as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(f) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).s as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(s) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).col as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(col) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dice as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(dice) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).list as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(list) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).custom as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(custom) + ) + ); +} +impl Default for TCOD_value_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_parser_struct_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_struct_get_name(def: TCOD_parser_struct_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_struct_add_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_list_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list_sized( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + size: ::std::os::raw::c_int, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_flag(def: TCOD_parser_struct_t, propname: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_struct_add_structure( + def: TCOD_parser_struct_t, + sub_structure: TCOD_parser_struct_t, + ); +} +extern "C" { + pub fn TCOD_struct_is_mandatory( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_struct_get_type( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> TCOD_value_type_t; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_parser_listener_t { + pub new_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub new_flag: + ::std::option::Option bool>, + pub new_property: ::std::option::Option< + unsafe extern "C" fn( + propname: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + value: TCOD_value_t, + ) -> bool, + >, + pub end_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub error: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_TCOD_parser_listener_t() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_parser_listener_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_parser_listener_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).new_struct as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_struct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).new_flag as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_flag) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).new_property as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_property) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).end_struct as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(end_struct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).error as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(error) + ) + ); +} +pub type TCOD_parser_custom_t = ::std::option::Option< + unsafe extern "C" fn( + lex: *mut TCOD_lex_t, + listener: *mut TCOD_parser_listener_t, + str: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + ) -> TCOD_value_t, +>; +pub type TCOD_parser_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_parser_new() -> TCOD_parser_t; +} +extern "C" { + pub fn TCOD_parser_new_struct( + parser: TCOD_parser_t, + name: *mut ::std::os::raw::c_char, + ) -> TCOD_parser_struct_t; +} +extern "C" { + pub fn TCOD_parser_new_custom_type( + parser: TCOD_parser_t, + custom_type_parser: TCOD_parser_custom_t, + ) -> TCOD_value_type_t; +} +extern "C" { + pub fn TCOD_parser_run( + parser: TCOD_parser_t, + filename: *const ::std::os::raw::c_char, + listener: *mut TCOD_parser_listener_t, + ); +} +extern "C" { + pub fn TCOD_parser_delete(parser: TCOD_parser_t); +} +extern "C" { + pub fn TCOD_parser_error(msg: *const ::std::os::raw::c_char, ...); +} +extern "C" { + pub fn TCOD_parser_has_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_parser_get_bool_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_parser_get_char_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_parser_get_int_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_parser_get_float_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> f32; +} +extern "C" { + pub fn TCOD_parser_get_string_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_parser_get_color_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_parser_get_dice_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_dice_t; +} +extern "C" { + pub fn TCOD_parser_get_dice_property_py( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + dice: *mut TCOD_dice_t, + ); +} +extern "C" { + pub fn TCOD_parser_get_custom_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_parser_get_list_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + ) -> TCOD_list_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_struct_int_t { + pub name: *mut ::std::os::raw::c_char, + pub flags: TCOD_list_t, + pub props: TCOD_list_t, + pub lists: TCOD_list_t, + pub structs: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_struct_int_t() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_struct_int_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_struct_int_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_struct_int_t), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_struct_int_t), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_struct_int_t), + "::", + stringify!(props) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lists as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_struct_int_t), + "::", + stringify!(lists) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_struct_int_t), + "::", + stringify!(structs) + ) + ); +} +impl Default for TCOD_struct_int_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_parser_int_t { + pub structs: TCOD_list_t, + pub customs: [TCOD_parser_custom_t; 16usize], + pub fatal: bool, + pub props: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_parser_int_t() { + assert_eq!( + ::std::mem::size_of::(), + 152usize, + concat!("Size of: ", stringify!(TCOD_parser_int_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_parser_int_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_int_t), + "::", + stringify!(structs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).customs as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_int_t), + "::", + stringify!(customs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fatal as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_int_t), + "::", + stringify!(fatal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_int_t), + "::", + stringify!(props) + ) + ); +} +impl Default for TCOD_parser_int_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_parse_bool_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_char_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_integer_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_float_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_string_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_color_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_dice_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_value_list_value( + def: *mut TCOD_struct_int_t, + listnum: ::std::os::raw::c_int, + ) -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_property_value( + parser: *mut TCOD_parser_int_t, + def: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + list: bool, + ) -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_sys_startup(); +} +extern "C" { + pub fn TCOD_sys_shutdown(); +} +extern "C" { + pub fn TCOD_sys_elapsed_milli() -> u32; +} +extern "C" { + pub fn TCOD_sys_elapsed_seconds() -> f32; +} +extern "C" { + pub fn TCOD_sys_sleep_milli(val: u32); +} +extern "C" { + pub fn TCOD_sys_set_fps(val: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_sys_get_fps() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_sys_get_last_frame_length() -> f32; +} +extern "C" { + pub fn TCOD_sys_save_screenshot(filename: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_sys_force_fullscreen_resolution( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_set_renderer(renderer: TCOD_renderer_t); +} +extern "C" { + pub fn TCOD_sys_get_renderer() -> TCOD_renderer_t; +} +extern "C" { + pub fn TCOD_sys_get_current_resolution( + w: *mut ::std::os::raw::c_int, + h: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_fullscreen_offsets( + offx: *mut ::std::os::raw::c_int, + offy: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_char_size(w: *mut ::std::os::raw::c_int, h: *mut ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_sys_update_char( + asciiCode: ::std::os::raw::c_int, + fontx: ::std::os::raw::c_int, + fonty: ::std::os::raw::c_int, + img: TCOD_image_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_SDL_window() -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_sys_get_SDL_renderer() -> *mut ::std::os::raw::c_void; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_event_t { + TCOD_EVENT_NONE = 0, + TCOD_EVENT_KEY_PRESS = 1, + TCOD_EVENT_KEY_RELEASE = 2, + TCOD_EVENT_KEY = 3, + TCOD_EVENT_MOUSE_MOVE = 4, + TCOD_EVENT_MOUSE_PRESS = 8, + TCOD_EVENT_MOUSE_RELEASE = 16, + TCOD_EVENT_MOUSE = 28, + TCOD_EVENT_FINGER_MOVE = 32, + TCOD_EVENT_FINGER_PRESS = 64, + TCOD_EVENT_FINGER_RELEASE = 128, + TCOD_EVENT_FINGER = 224, + TCOD_EVENT_ANY = 255, +} +extern "C" { + pub fn TCOD_sys_wait_for_event( + eventMask: ::std::os::raw::c_int, + key: *mut TCOD_key_t, + mouse: *mut TCOD_mouse_t, + flush: bool, + ) -> TCOD_event_t; +} +extern "C" { + pub fn TCOD_sys_check_for_event( + eventMask: ::std::os::raw::c_int, + key: *mut TCOD_key_t, + mouse: *mut TCOD_mouse_t, + ) -> TCOD_event_t; +} +extern "C" { + pub fn TCOD_sys_create_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_delete_file(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_delete_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_is_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_get_directory_content( + path: *const ::std::os::raw::c_char, + pattern: *const ::std::os::raw::c_char, + ) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_sys_file_exists(filename: *const ::std::os::raw::c_char, ...) -> bool; +} +extern "C" { + pub fn TCOD_sys_read_file( + filename: *const ::std::os::raw::c_char, + buf: *mut *mut ::std::os::raw::c_uchar, + size: *mut size_t, + ) -> bool; +} +extern "C" { + pub fn TCOD_sys_write_file( + filename: *const ::std::os::raw::c_char, + buf: *mut ::std::os::raw::c_uchar, + size: u32, + ) -> bool; +} +extern "C" { + pub fn TCOD_sys_clipboard_set(value: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_clipboard_get() -> *mut ::std::os::raw::c_char; +} +pub type TCOD_thread_t = *mut ::std::os::raw::c_void; +pub type TCOD_semaphore_t = *mut ::std::os::raw::c_void; +pub type TCOD_mutex_t = *mut ::std::os::raw::c_void; +pub type TCOD_cond_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_thread_new( + func: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, + >, + data: *mut ::std::os::raw::c_void, + ) -> TCOD_thread_t; +} +extern "C" { + pub fn TCOD_thread_delete(th: TCOD_thread_t); +} +extern "C" { + pub fn TCOD_sys_get_num_cores() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_thread_wait(th: TCOD_thread_t); +} +extern "C" { + pub fn TCOD_mutex_new() -> TCOD_mutex_t; +} +extern "C" { + pub fn TCOD_mutex_in(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_mutex_out(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_mutex_delete(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_semaphore_new(initVal: ::std::os::raw::c_int) -> TCOD_semaphore_t; +} +extern "C" { + pub fn TCOD_semaphore_lock(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_semaphore_unlock(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_semaphore_delete(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_condition_new() -> TCOD_cond_t; +} +extern "C" { + pub fn TCOD_condition_signal(sem: TCOD_cond_t); +} +extern "C" { + pub fn TCOD_condition_broadcast(sem: TCOD_cond_t); +} +extern "C" { + pub fn TCOD_condition_wait(sem: TCOD_cond_t, mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_condition_delete(sem: TCOD_cond_t); +} +pub type TCOD_library_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_load_library(path: *const ::std::os::raw::c_char) -> TCOD_library_t; +} +extern "C" { + pub fn TCOD_get_function_address( + library: TCOD_library_t, + function_name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_close_library(arg1: TCOD_library_t); +} +pub type SDL_renderer_t = + ::std::option::Option; +extern "C" { + pub fn TCOD_sys_register_SDL_renderer(renderer: SDL_renderer_t); +} +pub type TCOD_text_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_text_init( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + max_chars: ::std::os::raw::c_int, + ) -> TCOD_text_t; +} +extern "C" { + pub fn TCOD_text_init2( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + max_chars: ::std::os::raw::c_int, + ) -> TCOD_text_t; +} +extern "C" { + pub fn TCOD_text_set_pos(txt: TCOD_text_t, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_text_set_properties( + txt: TCOD_text_t, + cursor_char: ::std::os::raw::c_int, + blink_interval: ::std::os::raw::c_int, + prompt: *const ::std::os::raw::c_char, + tab_size: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_text_set_colors( + txt: TCOD_text_t, + fore: TCOD_color_t, + back: TCOD_color_t, + back_transparency: f32, + ); +} +extern "C" { + pub fn TCOD_text_update(txt: TCOD_text_t, key: TCOD_key_t) -> bool; +} +extern "C" { + pub fn TCOD_text_render(txt: TCOD_text_t, con: TCOD_console_t); +} +extern "C" { + pub fn TCOD_text_get(txt: TCOD_text_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_text_reset(txt: TCOD_text_t); +} +extern "C" { + pub fn TCOD_text_delete(txt: TCOD_text_t); +} +pub type TCOD_zip_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_zip_new() -> TCOD_zip_t; +} +extern "C" { + pub fn TCOD_zip_delete(zip: TCOD_zip_t); +} +extern "C" { + pub fn TCOD_zip_put_char(zip: TCOD_zip_t, val: ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_zip_put_int(zip: TCOD_zip_t, val: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_zip_put_float(zip: TCOD_zip_t, val: f32); +} +extern "C" { + pub fn TCOD_zip_put_string(zip: TCOD_zip_t, val: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_zip_put_color(zip: TCOD_zip_t, val: TCOD_color_t); +} +extern "C" { + pub fn TCOD_zip_put_image(zip: TCOD_zip_t, val: TCOD_image_t); +} +extern "C" { + pub fn TCOD_zip_put_console(zip: TCOD_zip_t, val: TCOD_console_t); +} +extern "C" { + pub fn TCOD_zip_put_data( + zip: TCOD_zip_t, + nbBytes: ::std::os::raw::c_int, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn TCOD_zip_get_current_bytes(zip: TCOD_zip_t) -> u32; +} +extern "C" { + pub fn TCOD_zip_save_to_file( + zip: TCOD_zip_t, + filename: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_load_from_file( + zip: TCOD_zip_t, + filename: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_char(zip: TCOD_zip_t) -> ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_zip_get_int(zip: TCOD_zip_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_float(zip: TCOD_zip_t) -> f32; +} +extern "C" { + pub fn TCOD_zip_get_string(zip: TCOD_zip_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_zip_get_color(zip: TCOD_zip_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_zip_get_image(zip: TCOD_zip_t) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_zip_get_console(zip: TCOD_zip_t) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_zip_get_data( + zip: TCOD_zip_t, + nbBytes: ::std::os::raw::c_int, + data: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_remaining_bytes(zip: TCOD_zip_t) -> u32; +} +extern "C" { + pub fn TCOD_zip_skip_bytes(zip: TCOD_zip_t, nbBytes: u32); +} +pub type __builtin_va_list = [__va_list_tag; 1usize]; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __va_list_tag { + pub gp_offset: ::std::os::raw::c_uint, + pub fp_offset: ::std::os::raw::c_uint, + pub overflow_arg_area: *mut ::std::os::raw::c_void, + pub reg_save_area: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout___va_list_tag() { + assert_eq!( + ::std::mem::size_of::<__va_list_tag>(), + 24usize, + concat!("Size of: ", stringify!(__va_list_tag)) + ); + assert_eq!( + ::std::mem::align_of::<__va_list_tag>(), + 8usize, + concat!("Alignment of ", stringify!(__va_list_tag)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__va_list_tag>())).gp_offset as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(gp_offset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__va_list_tag>())).fp_offset as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(fp_offset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__va_list_tag>())).overflow_arg_area as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(overflow_arg_area) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__va_list_tag>())).reg_save_area as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(reg_save_area) + ) + ); +} +impl Default for __va_list_tag { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __locale_data { + pub _address: u8, +} From 1aaf421a2bfa1889c85a9542469fa66cb0a1d771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sat, 27 Jun 2020 13:45:09 +0200 Subject: [PATCH 05/27] Fix a few overlooked issues --- examples/mouse.rs | 2 +- examples/samples.rs | 6 +++--- src/bsp.rs | 6 +++--- src/line.rs | 2 +- tcod_sys/build.rs | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/mouse.rs b/examples/mouse.rs index 56ec2ffac..fe1e63973 100644 --- a/examples/mouse.rs +++ b/examples/mouse.rs @@ -15,7 +15,7 @@ fn main() { while !con.window_closed() { loop { - match input::check_for_event(input::KEY | input::MOUSE) { + match input::check_for_event(input::EventFlags::KEY | input::EventFlags::MOUSE) { None => { break; } diff --git a/examples/samples.rs b/examples/samples.rs index 4eca678d5..0a94a0bf5 100644 --- a/examples/samples.rs +++ b/examples/samples.rs @@ -546,7 +546,7 @@ impl Render for NoiseSample { if let Some((_, Event::Key(key))) = event { match key.printable { - '1'...'9' => + '1'..='9' => self.func = { let number = key.printable.to_digit(10).unwrap() as u8; NoiseFunction::from_value(number - 1) @@ -778,7 +778,7 @@ struct PathSample<'a> { } const TORCH_RADIUS : f32 = 10.0; -const SQUARED_TORCH_RADIUS : f32 = (TORCH_RADIUS*TORCH_RADIUS); +const SQUARED_TORCH_RADIUS : f32 = TORCH_RADIUS*TORCH_RADIUS; static SMAP : [&'static str; 20] = [ "##############################################", @@ -1622,7 +1622,7 @@ fn main() { print_samples(&mut root, cur_sample, &samples); print_help_message(&mut root); - let event = check_for_event(KEY_PRESS | MOUSE); + let event = check_for_event(EventFlags::KEY_PRESS | EventFlags::MOUSE); samples[cur_sample].render(&mut console, &root, event); blit(&console, (0, 0), (SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT), diff --git a/src/bsp.rs b/src/bsp.rs index ae0b3938c..1eae2098c 100644 --- a/src/bsp.rs +++ b/src/bsp.rs @@ -267,7 +267,7 @@ mod test { #[test] #[allow(unused_variables)] fn created_destroyed_no_panic() { - let bsp = Bsp::new_with_size(0, 0, 50, 50); + let mut bsp = Bsp::new_with_size(0, 0, 50, 50); let left = bsp.left(); // left has null .bsp } @@ -377,8 +377,8 @@ mod test { root.split_recursive(None, 2, 5, 5, 1.5, 1.5); - let middle_left = root.left().unwrap(); - let middle_right = root.right().unwrap(); + let mut middle_left = root.left().unwrap(); + let mut middle_right = root.right().unwrap(); let leaf1 = middle_left.left().unwrap(); let leaf2 = middle_left.right().unwrap(); let leaf3 = middle_right.left().unwrap(); diff --git a/src/line.rs b/src/line.rs index fcc1b3d51..7b83d1674 100644 --- a/src/line.rs +++ b/src/line.rs @@ -50,7 +50,7 @@ impl Line { ffi::TCOD_line_step_mt(&mut x, &mut y, &mut self.tcod_line) }; - if end { + if !end { Some((x, y)) } else { None diff --git a/tcod_sys/build.rs b/tcod_sys/build.rs index 87c5144ba..b9da5a8d5 100644 --- a/tcod_sys/build.rs +++ b/tcod_sys/build.rs @@ -317,7 +317,7 @@ fn main() { compile_config(config); assert!(dst.join("libtcod.dll").is_file()); - println!("cargo:rustc-link-lib=dylib={}", "SDL2"); + println!("cargo:rustc-link-lib=dylib=SDL2"); println!("cargo:rustc-link-search=native={}", sdl_lib_dir.display()); println!("cargo:rustc-link-search=native={}", dst.display()); From e6fa3dcb56b7e6f63c9915b7bf8ccb86a1af94df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sat, 27 Jun 2020 13:48:26 +0200 Subject: [PATCH 06/27] Run `cargo fmt` --- examples/astar-path-finding.rs | 1 - examples/blit.rs | 35 +- examples/chars.rs | 3 +- examples/colors.rs | 15 +- examples/custom_character_mapping.rs | 4 +- examples/dijkstra-path-finding.rs | 1 - examples/fov.rs | 31 +- examples/keyboard.rs | 4 +- examples/minimal.rs | 5 +- examples/mouse.rs | 25 +- examples/namegen.rs | 4 +- examples/print_macros.rs | 50 +- examples/samples.rs | 1094 +++++++++++++++++--------- examples/shapes.rs | 18 +- examples/text.rs | 51 +- src/bindings.rs | 14 +- src/bsp.rs | 150 ++-- src/colors.rs | 1065 ++++++++++++++++++++----- src/console.rs | 553 +++++++------ src/heightmap.rs | 4 +- src/image.rs | 141 +++- src/input.rs | 79 +- src/lib.rs | 22 +- src/line.rs | 30 +- src/macros.rs | 6 +- src/map.rs | 59 +- src/namegen.rs | 48 +- src/noise.rs | 101 +-- src/pathfinding.rs | 151 ++-- src/random.rs | 65 +- src/rustc_serialize_impls.rs | 20 +- src/system.rs | 30 +- 32 files changed, 2592 insertions(+), 1287 deletions(-) diff --git a/examples/astar-path-finding.rs b/examples/astar-path-finding.rs index 4b2c91252..f993e1b34 100644 --- a/examples/astar-path-finding.rs +++ b/examples/astar-path-finding.rs @@ -53,7 +53,6 @@ fn main() { assert_eq!(path.get(6), None); assert_eq!(path.get(7), None); - // Walk the path (consuming it): for pos in path.walk() { println!("Walking to {:?}", pos); diff --git a/examples/blit.rs b/examples/blit.rs index b3235fafa..01876f827 100644 --- a/examples/blit.rs +++ b/examples/blit.rs @@ -1,8 +1,7 @@ extern crate tcod; use tcod::console; -use tcod::{Console, RootConsole, OffscreenConsole, Color}; - +use tcod::{Color, Console, OffscreenConsole, RootConsole}; fn main() { let mut root = RootConsole::initializer() @@ -15,7 +14,6 @@ fn main() { let mut trait_object: &dyn Console = &OffscreenConsole::new(20, 20); let mut boxed_trait: Box = Box::new(OffscreenConsole::new(20, 20)); - root.set_default_background(Color::DARKEST_GREEN); direct.set_default_background(Color::RED); @@ -30,11 +28,34 @@ fn main() { trait_object.clear(); boxed_trait.clear(); - console::blit(&direct, (0, 0), (20, 20), &mut root, (0, 0), 1.0, 1.0); - console::blit(&boxed_direct, (0, 0), (20, 20), &mut root, (20, 0), 1.0, 1.0); - console::blit(&trait_object, (0, 0), (20, 20), &mut root, (0, 20), 1.0, 1.0); - console::blit(&boxed_trait, (0, 0), (20, 20), &mut root, (20, 20), 1.0, 1.0); + console::blit( + &boxed_direct, + (0, 0), + (20, 20), + &mut root, + (20, 0), + 1.0, + 1.0, + ); + console::blit( + &trait_object, + (0, 0), + (20, 20), + &mut root, + (0, 20), + 1.0, + 1.0, + ); + console::blit( + &boxed_trait, + (0, 0), + (20, 20), + &mut root, + (20, 20), + 1.0, + 1.0, + ); root.flush(); root.wait_for_keypress(true); diff --git a/examples/chars.rs b/examples/chars.rs index cc5c32390..8aa09887b 100644 --- a/examples/chars.rs +++ b/examples/chars.rs @@ -1,7 +1,7 @@ extern crate tcod; -use tcod::{Console, RootConsole}; use tcod::chars; +use tcod::{Console, RootConsole}; fn main() { let mut root = RootConsole::initializer() @@ -29,4 +29,3 @@ fn main() { root.flush(); root.wait_for_keypress(true); } - diff --git a/examples/colors.rs b/examples/colors.rs index 6b449647c..563f3e38c 100644 --- a/examples/colors.rs +++ b/examples/colors.rs @@ -1,8 +1,7 @@ extern crate tcod; -use tcod::{Console, RootConsole, Color, BackgroundFlag}; use tcod::colors; - +use tcod::{BackgroundFlag, Color, Console, RootConsole}; fn main() { let mut con = RootConsole::initializer() @@ -16,7 +15,17 @@ fn main() { // Uses the default foreground and background: con.put_char(40, 25, '@', BackgroundFlag::Set); // Custom foreground and background: - con.put_char_ex(42, 25, '!', Color{r: 240, g: 13, b: 20}, Color{r: 0, g: 0, b: 0}); + con.put_char_ex( + 42, + 25, + '!', + Color { + r: 240, + g: 13, + b: 20, + }, + Color { r: 0, g: 0, b: 0 }, + ); let black = Color::new(0, 0, 0); let red = Color::new(200, 0, 0); diff --git a/examples/custom_character_mapping.rs b/examples/custom_character_mapping.rs index c8c6fd96a..fe52c8cdb 100644 --- a/examples/custom_character_mapping.rs +++ b/examples/custom_character_mapping.rs @@ -1,6 +1,6 @@ extern crate tcod; -use tcod::{Console, RootConsole, FontLayout, FontType}; +use tcod::{Console, FontLayout, FontType, RootConsole}; const FLOOR_TILE: char = 1 as char; const WALL_TILE: char = 2 as char; @@ -20,7 +20,7 @@ fn main() { .font("angband16x16.bmp", FontLayout::Tcod) .font_type(FontType::Greyscale) .font_dimensions(32, 60) // angband16x16.bmp has 32 columns & 60 rows of - // characters + // characters .size(MAP_WIDTH, MAP_HEIGHT) .title("Using custom character mapping with libtcod") .init(); diff --git a/examples/dijkstra-path-finding.rs b/examples/dijkstra-path-finding.rs index 00bad2cc7..98eaa6765 100644 --- a/examples/dijkstra-path-finding.rs +++ b/examples/dijkstra-path-finding.rs @@ -36,7 +36,6 @@ fn walk_from(path: &mut Dijkstra, origin: (i32, i32)) { println!("Arrived at the destination!\n"); } - fn main() { let mut path = create_path(); let destination = (0, 0); diff --git a/examples/fov.rs b/examples/fov.rs index 0572c1439..949e4a532 100644 --- a/examples/fov.rs +++ b/examples/fov.rs @@ -1,8 +1,8 @@ extern crate rand; extern crate tcod; -use tcod::{Console, RootConsole, BackgroundFlag, Map}; use tcod::map::FovAlgorithm; +use tcod::{BackgroundFlag, Console, Map, RootConsole}; // We'll use a basic structure to define our tiles. #[derive(Copy, Clone)] @@ -13,9 +13,12 @@ pub struct Tile { } fn main() { - let mut root = RootConsole::initializer().size(40, 40) .title("FOV example").init(); + let mut root = RootConsole::initializer() + .size(40, 40) + .title("FOV example") + .init(); - let mut map = Map::new(40,40); + let mut map = Map::new(40, 40); let mut tiles = Vec::new(); root.clear(); @@ -25,28 +28,36 @@ fn main() { for y in 0..40 { // Place some walls randomly. if rand::random() { - tiles.push(Tile{x:x, y:y, ch: '#' }); + tiles.push(Tile { + x: x, + y: y, + ch: '#', + }); // Mark this place as non transparent, and non walkable. - map.set(x,y,false,false); + map.set(x, y, false, false); } else { - tiles.push(Tile{x:x, y:y, ch: '.'}); + tiles.push(Tile { + x: x, + y: y, + ch: '.', + }); // Mark this place as transparent and walkable. - map.set(x,y,true,true); + map.set(x, y, true, true); } } } // Compute the FOV starting from the coordinates 20,20. Where we'll put the '@' // Use a max_radius of 10 and light the walls. - map.compute_fov(20,20, 10, true, FovAlgorithm::Basic); + map.compute_fov(20, 20, 10, true, FovAlgorithm::Basic); for tile in tiles.iter() { if map.is_in_fov(tile.x, tile.y) { - root.put_char(tile.x,tile.y,tile.ch, BackgroundFlag::Set); + root.put_char(tile.x, tile.y, tile.ch, BackgroundFlag::Set); } } - root.put_char(20,20, '@', BackgroundFlag::Set); + root.put_char(20, 20, '@', BackgroundFlag::Set); root.flush(); //Press any key to exit. diff --git a/examples/keyboard.rs b/examples/keyboard.rs index 2599a5f22..34e7edb14 100644 --- a/examples/keyboard.rs +++ b/examples/keyboard.rs @@ -1,8 +1,8 @@ extern crate tcod; -use tcod::{Console, RootConsole, BackgroundFlag}; use tcod::input::Key; -use tcod::input::KeyCode::{Up, Down, Left, Right, Escape}; +use tcod::input::KeyCode::{Down, Escape, Left, Right, Up}; +use tcod::{BackgroundFlag, Console, RootConsole}; fn main() { let mut con = RootConsole::initializer() diff --git a/examples/minimal.rs b/examples/minimal.rs index 59613ca82..544244f88 100644 --- a/examples/minimal.rs +++ b/examples/minimal.rs @@ -3,7 +3,10 @@ extern crate tcod; use tcod::RootConsole; fn main() { - let mut root = RootConsole::initializer().size(80, 50).title("Minimal libtcod loop").init(); + let mut root = RootConsole::initializer() + .size(80, 50) + .title("Minimal libtcod loop") + .init(); while !root.window_closed() { root.flush(); diff --git a/examples/mouse.rs b/examples/mouse.rs index fe1e63973..db78eaea5 100644 --- a/examples/mouse.rs +++ b/examples/mouse.rs @@ -1,7 +1,7 @@ extern crate tcod; -use tcod::input as input; -use tcod::{Console, RootConsole, BackgroundFlag}; +use tcod::input; +use tcod::{BackgroundFlag, Console, RootConsole}; fn main() { let mut con = RootConsole::initializer() @@ -13,24 +13,21 @@ fn main() { let mut y = 25; while !con.window_closed() { - loop { match input::check_for_event(input::EventFlags::KEY | input::EventFlags::MOUSE) { None => { break; } - Some((_, event)) => { - match event { - input::Event::Key(ref key_state) => { - println!("{:?}", key_state); - }, - input::Event::Mouse(ref mouse_state) => { - x = mouse_state.cx as i32; - y = mouse_state.cy as i32; - println!("{:?}", mouse_state); - } + Some((_, event)) => match event { + input::Event::Key(ref key_state) => { + println!("{:?}", key_state); } - } + input::Event::Mouse(ref mouse_state) => { + x = mouse_state.cx as i32; + y = mouse_state.cy as i32; + println!("{:?}", mouse_state); + } + }, } } diff --git a/examples/namegen.rs b/examples/namegen.rs index 0f3f110c9..c6eb5a2dd 100644 --- a/examples/namegen.rs +++ b/examples/namegen.rs @@ -1,7 +1,7 @@ - extern crate tcod; +extern crate tcod; use tcod::namegen::Namegen; -use tcod::random::{Rng, Algo}; +use tcod::random::{Algo, Rng}; fn setup_namegen() -> Namegen { let rng = Rng::new(Algo::MT); diff --git a/examples/print_macros.rs b/examples/print_macros.rs index 08a6e0253..3e4d9212b 100644 --- a/examples/print_macros.rs +++ b/examples/print_macros.rs @@ -1,27 +1,59 @@ #[macro_use] extern crate tcod; -use tcod::{Console, RootConsole, BackgroundFlag, TextAlignment}; +use tcod::{BackgroundFlag, Console, RootConsole, TextAlignment}; fn main() { - let mut root = RootConsole::initializer().size(80, 50).title("Displaying text").init(); + let mut root = RootConsole::initializer() + .size(80, 50) + .title("Displaying text") + .init(); // No optional parameters - tcod_print!(root, At(1, 1), "Any text params may be {}", "formatted with println! formatting"); + tcod_print!( + root, + At(1, 1), + "Any text params may be {}", + "formatted with println! formatting" + ); // One optional parameter tcod_print!(root, At(1, 3), Wrap(6, 2), "Simple wrap"); - tcod_print!(root, At(1, 6), Bg(BackgroundFlag::None), "No background flag"); + tcod_print!( + root, + At(1, 6), + Bg(BackgroundFlag::None), + "No background flag" + ); tcod_print!(root, At(75, 8), Align(TextAlignment::Right), "Right align"); - // Two optional parameters. The optional parameters may be given in any order - tcod_print!(root, At(1, 10), Wrap(6, 2), Bg(BackgroundFlag::None), "Bg and wrap"); - tcod_print!(root, At(70, 12), Align(TextAlignment::Right), Wrap(6, 3), "Align and wrap"); + tcod_print!( + root, + At(1, 10), + Wrap(6, 2), + Bg(BackgroundFlag::None), + "Bg and wrap" + ); + tcod_print!( + root, + At(70, 12), + Align(TextAlignment::Right), + Wrap(6, 3), + "Align and wrap" + ); // Three optional parameters - tcod_print!(root, At(40, 25), Wrap(10, 10), Bg(BackgroundFlag::None), Align(TextAlignment::Center), - "This text is printed with every optional parameter, format: {} {}", "string", 1); + tcod_print!( + root, + At(40, 25), + Wrap(10, 10), + Bg(BackgroundFlag::None), + Align(TextAlignment::Center), + "This text is printed with every optional parameter, format: {} {}", + "string", + 1 + ); root.flush(); root.wait_for_keypress(true); diff --git a/examples/samples.rs b/examples/samples.rs index 0a94a0bf5..e23a0e0ef 100644 --- a/examples/samples.rs +++ b/examples/samples.rs @@ -1,38 +1,37 @@ -extern crate tcod; extern crate rand; +extern crate tcod; -use tcod::console::*; -use tcod::input::*; -use tcod::system; -use tcod::colors; -use tcod::colors::Color; -use tcod::chars; -use tcod::pathfinding::{Dijkstra, AStar}; -use tcod::map::{Map, FovAlgorithm}; -use tcod::image; -use tcod::namegen::Namegen; -use tcod::line::Line; -use tcod::noise::{Noise, NoiseType, DEFAULT_HURST, DEFAULT_LACUNARITY, MAX_OCTAVES}; -use tcod::image::{Image, blit_2x}; -use tcod::bsp::{Bsp, TraverseOrder}; use rand::Rng; use rand::ThreadRng; use std::char::from_u32; +use std::cmp::{max, min}; use std::fs::read_dir; -use std::cmp::{min, max}; use std::time::Duration; +use tcod::bsp::{Bsp, TraverseOrder}; +use tcod::chars; +use tcod::colors; +use tcod::colors::Color; +use tcod::console::*; +use tcod::image; +use tcod::image::{blit_2x, Image}; +use tcod::input::*; +use tcod::line::Line; +use tcod::map::{FovAlgorithm, Map}; +use tcod::namegen::Namegen; +use tcod::noise::{Noise, NoiseType, DEFAULT_HURST, DEFAULT_LACUNARITY, MAX_OCTAVES}; +use tcod::pathfinding::{AStar, Dijkstra}; +use tcod::system; -const SAMPLE_SCREEN_WIDTH : i32 = 46; -const SAMPLE_SCREEN_HEIGHT : i32 = 20; +const SAMPLE_SCREEN_WIDTH: i32 = 46; +const SAMPLE_SCREEN_HEIGHT: i32 = 20; -const SAMPLE_SCREEN_X : i32 = 20; -const SAMPLE_SCREEN_Y : i32 = 10; +const SAMPLE_SCREEN_X: i32 = 20; +const SAMPLE_SCREEN_Y: i32 = 10; trait Render { fn initialize(&mut self, console: &mut Offscreen); - fn render(&mut self, console: &mut Offscreen, root: &Root, - event: Option<(EventFlags, Event)>); + fn render(&mut self, console: &mut Offscreen, root: &Root, event: Option<(EventFlags, Event)>); } struct ColorsSample { @@ -46,10 +45,12 @@ struct ColorsSample { impl ColorsSample { fn new() -> Self { ColorsSample { - cols: [Color::new(50, 40, 150), - Color::new(240, 85, 5), - Color::new(50, 35, 240), - Color::new(10, 200, 130)], + cols: [ + Color::new(50, 40, 150), + Color::new(240, 85, 5), + Color::new(50, 35, 240), + Color::new(10, 200, 130), + ], dirr: [1, -1, 1, 1], dirg: [1, -1, -1, 1], dirb: [1, 1, 1, -1], @@ -58,12 +59,16 @@ impl ColorsSample { } fn cycle_color_component(&self, color_component: u8, dir: i8) -> (u8, i8) { - let delta : i16 = (5 * dir) as i16; + let delta: i16 = (5 * dir) as i16; let new_component = (color_component as i16 + delta) as u8; - let new_dir = if new_component == 255 { -1 } - else if new_component == 0 { 1 } - else { dir }; + let new_dir = if new_component == 255 { + -1 + } else if new_component == 0 { + 1 + } else { + dir + }; (new_component, new_dir) } @@ -75,21 +80,20 @@ impl ColorsSample { let (n_c, n_d) = self.cycle_color_component(self.cols[c].r, self.dirr[c]); self.cols[c].r = n_c; self.dirr[c] = n_d; - }, + } 1 => { let (n_c, n_d) = self.cycle_color_component(self.cols[c].g, self.dirg[c]); self.cols[c].g = n_c; self.dirg[c] = n_d; - }, + } 2 => { let (n_c, n_d) = self.cycle_color_component(self.cols[c].b, self.dirb[c]); self.cols[c].b = n_c; self.dirb[c] = n_d; - }, - _ => panic!("Random number generator is broken!") + } + _ => panic!("Random number generator is broken!"), } } - } fn set_colors(&self, console: &mut dyn Console) { @@ -102,17 +106,21 @@ impl ColorsSample { // ==== scan the whole screen, interpolating corner colors ==== for x in 0..SAMPLE_SCREEN_WIDTH { - let xcoef = (x as f32) / ((SAMPLE_SCREEN_WIDTH-1) as f32); + let xcoef = (x as f32) / ((SAMPLE_SCREEN_WIDTH - 1) as f32); // get the current column top and bottom colors - let top = colors::lerp(self.cols[Dir::TopLeft as usize], - self.cols[Dir::TopRight as usize], - xcoef); - let bottom = colors::lerp(self.cols[Dir::BottomLeft as usize], - self.cols[Dir::BottomRight as usize], - xcoef); + let top = colors::lerp( + self.cols[Dir::TopLeft as usize], + self.cols[Dir::TopRight as usize], + xcoef, + ); + let bottom = colors::lerp( + self.cols[Dir::BottomLeft as usize], + self.cols[Dir::BottomRight as usize], + xcoef, + ); for y in 0..SAMPLE_SCREEN_HEIGHT { - let ycoef = (y as f32) / ((SAMPLE_SCREEN_HEIGHT-1) as f32); + let ycoef = (y as f32) / ((SAMPLE_SCREEN_HEIGHT - 1) as f32); // get the current cell color let cur_color = colors::lerp(top, bottom, ycoef); @@ -124,7 +132,7 @@ impl ColorsSample { fn print_random_chars(&mut self, console: &mut dyn Console) -> colors::Color { // ==== print the text with a random color ==== // get the background color at the text position - let mut text_color = console.get_char_background(SAMPLE_SCREEN_WIDTH/2, 5); + let mut text_color = console.get_char_background(SAMPLE_SCREEN_WIDTH / 2, 5); // and invert it text_color.r = 255 - text_color.r; text_color.g = 255 - text_color.g; @@ -135,7 +143,7 @@ impl ColorsSample { let mut col = console.get_char_background(x, y); col = colors::lerp(col, Color::BLACK, 0.5); // use colored character 255 on first and last lines - let c = if y == 0 || y == SAMPLE_SCREEN_HEIGHT-1 { + let c = if y == 0 || y == SAMPLE_SCREEN_HEIGHT - 1 { '\u{00ff}' } else { let r = self.rng.gen_range('a' as u32, 'z' as u32); @@ -157,10 +165,12 @@ impl Render for ColorsSample { console.clear() } - fn render(&mut self, - console: &mut Offscreen, - _root: &Root, - _event: Option<(EventFlags, Event)>) { + fn render( + &mut self, + console: &mut Offscreen, + _root: &Root, + _event: Option<(EventFlags, Event)>, + ) { self.cycle_colors(); self.set_colors(console); let text_color = self.print_random_chars(console); @@ -168,34 +178,40 @@ impl Render for ColorsSample { console.set_default_foreground(text_color); // the background behind the text is slightly darkened using the Multiply flag console.set_default_background(Color::GREY); - console.print_rect_ex(SAMPLE_SCREEN_WIDTH/2, 5, SAMPLE_SCREEN_WIDTH-2, SAMPLE_SCREEN_HEIGHT-1, - BackgroundFlag::Multiply, TextAlignment::Center, - "The Doryen library uses 24 bits colors, for both background and foreground."); + console.print_rect_ex( + SAMPLE_SCREEN_WIDTH / 2, + 5, + SAMPLE_SCREEN_WIDTH - 2, + SAMPLE_SCREEN_HEIGHT - 1, + BackgroundFlag::Multiply, + TextAlignment::Center, + "The Doryen library uses 24 bits colors, for both background and foreground.", + ); } } struct OffscreenSample { - secondary : Offscreen, - screenshot : Offscreen, - init : bool, - counter : i32, - x : i32, - y : i32, - xdir : i32, - ydir : i32 + secondary: Offscreen, + screenshot: Offscreen, + init: bool, + counter: i32, + x: i32, + y: i32, + xdir: i32, + ydir: i32, } impl OffscreenSample { fn new() -> OffscreenSample { OffscreenSample { - secondary : Offscreen::new(SAMPLE_SCREEN_WIDTH/2, SAMPLE_SCREEN_HEIGHT/2), - screenshot : Offscreen::new(SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT), - init : false, - counter : 0, - x : 0, - y : 0, - xdir : 1, - ydir : 1 + secondary: Offscreen::new(SAMPLE_SCREEN_WIDTH / 2, SAMPLE_SCREEN_HEIGHT / 2), + screenshot: Offscreen::new(SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT), + init: false, + counter: 0, + x: 0, + y: 0, + xdir: 1, + ydir: 1, } } } @@ -204,38 +220,80 @@ impl Render for OffscreenSample { fn initialize(&mut self, console: &mut Offscreen) { if !self.init { self.init = true; - self.secondary.print_frame(0, 0, SAMPLE_SCREEN_WIDTH/2, SAMPLE_SCREEN_HEIGHT/2, - false, BackgroundFlag::Set, Some("Offscreen console")); - self.secondary.print_rect_ex(SAMPLE_SCREEN_WIDTH/4, 2, SAMPLE_SCREEN_WIDTH/2-2, - SAMPLE_SCREEN_HEIGHT/2, BackgroundFlag::None, TextAlignment::Center, - "You can render to an offscreen console\ + self.secondary.print_frame( + 0, + 0, + SAMPLE_SCREEN_WIDTH / 2, + SAMPLE_SCREEN_HEIGHT / 2, + false, + BackgroundFlag::Set, + Some("Offscreen console"), + ); + self.secondary.print_rect_ex( + SAMPLE_SCREEN_WIDTH / 4, + 2, + SAMPLE_SCREEN_WIDTH / 2 - 2, + SAMPLE_SCREEN_HEIGHT / 2, + BackgroundFlag::None, + TextAlignment::Center, + "You can render to an offscreen console\ and blit in on another one, simulating\ - alpha transparency."); + alpha transparency.", + ); } system::set_fps(30); - blit(console, (0, 0), (SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT), - &mut self.screenshot, (0, 0), 1.0, 1.0); - } - - fn render(&mut self, - console: &mut Offscreen, - _root: &Root, - _event: Option<(EventFlags, Event)>) { + blit( + console, + (0, 0), + (SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT), + &mut self.screenshot, + (0, 0), + 1.0, + 1.0, + ); + } + + fn render( + &mut self, + console: &mut Offscreen, + _root: &Root, + _event: Option<(EventFlags, Event)>, + ) { self.counter += 1; if self.counter % 20 == 0 { self.x += self.xdir; self.y += self.ydir; - if self.x == (SAMPLE_SCREEN_WIDTH/2 + 5) { self.xdir = -1 } - else if self.x == -5 { self.xdir = 1 } - if self.y == (SAMPLE_SCREEN_HEIGHT/2 + 5) { self.ydir = -1 } - else if self.y == -5 { self.ydir = 1 } + if self.x == (SAMPLE_SCREEN_WIDTH / 2 + 5) { + self.xdir = -1 + } else if self.x == -5 { + self.xdir = 1 + } + if self.y == (SAMPLE_SCREEN_HEIGHT / 2 + 5) { + self.ydir = -1 + } else if self.y == -5 { + self.ydir = 1 + } } - blit(&self.screenshot, (0, 0), (SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT), - console, (0, 0), 1.0, 1.0); - blit(&self.secondary, (0, 0), (SAMPLE_SCREEN_WIDTH/2, SAMPLE_SCREEN_HEIGHT/2), - console, (self.x, self.y), 1.0, 0.75); + blit( + &self.screenshot, + (0, 0), + (SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT), + console, + (0, 0), + 1.0, + 1.0, + ); + blit( + &self.secondary, + (0, 0), + (SAMPLE_SCREEN_WIDTH / 2, SAMPLE_SCREEN_HEIGHT / 2), + console, + (self.x, self.y), + 1.0, + 0.75, + ); } } @@ -255,11 +313,12 @@ impl LineSample { for y in 0..SAMPLE_SCREEN_HEIGHT { let col = colors::Color::new( (x * 255 / (SAMPLE_SCREEN_WIDTH - 1)) as u8, - ((x+y) * 255 / (SAMPLE_SCREEN_WIDTH + SAMPLE_SCREEN_HEIGHT - 2)) as u8, - (y * 255 / (SAMPLE_SCREEN_HEIGHT - 1)) as u8); + ((x + y) * 255 / (SAMPLE_SCREEN_WIDTH + SAMPLE_SCREEN_HEIGHT - 2)) as u8, + (y * 255 / (SAMPLE_SCREEN_HEIGHT - 1)) as u8, + ); line.bk.set_char_background(x, y, col, BackgroundFlag::Set); } - }; + } line } @@ -268,16 +327,14 @@ impl LineSample { if flag_byte >= max - 1 { self.bk_flag = BackgroundFlag::None; } else { - self.bk_flag = unsafe { - std::mem::transmute(flag_byte + 1) - } + self.bk_flag = unsafe { std::mem::transmute(flag_byte + 1) } } } fn set_alpha(&mut self, elapsed_seconds: f32, flag: BackgroundFlag) { - let alpha = (1.0 + (elapsed_seconds*2.0).cos()) / 2.0; + let alpha = (1.0 + (elapsed_seconds * 2.0).cos()) / 2.0; self.bk_flag = unsafe { - let alpha_value = ((alpha*255.0) as u32) <<8; + let alpha_value = ((alpha * 255.0) as u32) << 8; let new_flag = flag as u32 | alpha_value; std::mem::transmute(new_flag) }; @@ -294,10 +351,12 @@ impl Render for LineSample { console.set_default_foreground(Color::WHITE); } - fn render(&mut self, - console: &mut Offscreen, - _root: &Root, - event: Option<(EventFlags, Event)>) { + fn render( + &mut self, + console: &mut Offscreen, + _root: &Root, + event: Option<(EventFlags, Event)>, + ) { let elapsed_seconds = seconds_from_duration(system::get_elapsed_time()); let flag_byte = self.bk_flag as i32 & 0xff; if flag_byte == BackgroundFlag::Alph as i32 { @@ -307,37 +366,43 @@ impl Render for LineSample { self.set_alpha(elapsed_seconds, BackgroundFlag::AddA); } - blit(&self.bk, (0, 0), (SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT), - console, (0, 0), 1.0, 1.0); - let rect_y = ((SAMPLE_SCREEN_HEIGHT - 2) as f32 * ((1.0 + elapsed_seconds.cos()) / 2.0)) as i32; + blit( + &self.bk, + (0, 0), + (SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT), + console, + (0, 0), + 1.0, + 1.0, + ); + let rect_y = + ((SAMPLE_SCREEN_HEIGHT - 2) as f32 * ((1.0 + elapsed_seconds.cos()) / 2.0)) as i32; for x in 0..SAMPLE_SCREEN_WIDTH { let component = (x * 255 / SAMPLE_SCREEN_WIDTH) as u8; let col = colors::Color::new(component, component, component); - console.set_char_background(x, rect_y, col, self.bk_flag); - console.set_char_background(x, rect_y+1, col, self.bk_flag); - console.set_char_background(x, rect_y+2, col, self.bk_flag); + console.set_char_background(x, rect_y, col, self.bk_flag); + console.set_char_background(x, rect_y + 1, col, self.bk_flag); + console.set_char_background(x, rect_y + 2, col, self.bk_flag); } let angle = elapsed_seconds * 2.0; let cos_angle = angle.cos(); let sin_angle = angle.sin(); let xo = ((SAMPLE_SCREEN_WIDTH / 2) as f32 * (1.0 + cos_angle)) as i32; - let yo = ((SAMPLE_SCREEN_HEIGHT / 2) as f32 + - sin_angle * (SAMPLE_SCREEN_WIDTH / 2) as f32) as i32; + let yo = ((SAMPLE_SCREEN_HEIGHT / 2) as f32 + sin_angle * (SAMPLE_SCREEN_WIDTH / 2) as f32) + as i32; let xd = ((SAMPLE_SCREEN_WIDTH / 2) as f32 * (1.0 - cos_angle)) as i32; - let yd = ((SAMPLE_SCREEN_HEIGHT / 2) as f32 - - sin_angle * (SAMPLE_SCREEN_WIDTH / 2) as f32) as i32; + let yd = ((SAMPLE_SCREEN_HEIGHT / 2) as f32 - sin_angle * (SAMPLE_SCREEN_WIDTH / 2) as f32) + as i32; let line = Line::new((xo, yo), (xd, yd)); for (x, y) in line { - if x >= 0 && y >=0 && x < SAMPLE_SCREEN_WIDTH && y < SAMPLE_SCREEN_HEIGHT { + if x >= 0 && y >= 0 && x < SAMPLE_SCREEN_WIDTH && y < SAMPLE_SCREEN_HEIGHT { console.set_char_background(x, y, Color::LIGHT_BLUE, self.bk_flag); } } - let display_flag : BackgroundFlag = unsafe { - std::mem::transmute(flag_byte) - }; + let display_flag: BackgroundFlag = unsafe { std::mem::transmute(flag_byte) }; console.print(2, 2, format!("{:?} (ENTER to change)", display_flag)); if let Some((_, Event::Key(key))) = event { @@ -371,10 +436,11 @@ static VALUES: &'static [NoiseFunction] = &[ NoiseFunction::FbmSimplex, NoiseFunction::TurbulenceSimplex, NoiseFunction::FbmWavelet, - NoiseFunction::TurbulenceWavelet]; + NoiseFunction::TurbulenceWavelet, +]; struct NoiseFunctionIterator { - val: usize + val: usize, } impl NoiseFunction { @@ -385,7 +451,7 @@ impl NoiseFunction { fn from_value(val: u8) -> Self { match val as usize { x if x < VALUES.len() => VALUES[x], - _ => panic!("Wrong value to convert to NoiseFunction") + _ => panic!("Wrong value to convert to NoiseFunction"), } } } @@ -399,7 +465,7 @@ impl Iterator for NoiseFunctionIterator { let retval = VALUES[self.val]; self.val += 1; Some(retval) - }, + } _ => None, } } @@ -426,7 +492,7 @@ struct NoiseSample { hurst: f32, lacunarity: f32, img: Image, - zoom: f32 + zoom: f32, } impl NoiseSample { @@ -444,7 +510,7 @@ impl NoiseSample { hurst: DEFAULT_HURST, lacunarity: DEFAULT_LACUNARITY, img: Image::new(SAMPLE_SCREEN_WIDTH * 2, SAMPLE_SCREEN_HEIGHT * 2), - zoom: 3.0 + zoom: 3.0, } } @@ -456,34 +522,43 @@ impl NoiseSample { } fn draw_noise(&mut self) { - for y in 0..2*SAMPLE_SCREEN_HEIGHT { - for x in 0..2*SAMPLE_SCREEN_WIDTH { + for y in 0..2 * SAMPLE_SCREEN_HEIGHT { + for x in 0..2 * SAMPLE_SCREEN_WIDTH { let x0 = self.zoom * x as f32 / (2 * SAMPLE_SCREEN_WIDTH) as f32 + self.dx; let y0 = self.zoom * y as f32 / (2 * SAMPLE_SCREEN_HEIGHT) as f32 + self.dy; let mut coords = [x0, y0]; let value = match self.func { - NoiseFunction::Perlin => - self.noise.get_ex(&mut coords, NoiseType::Perlin), - NoiseFunction::Simplex => - self.noise.get_ex(&mut coords, NoiseType::Simplex), - NoiseFunction::Wavelet => - self.noise.get_ex(&mut coords, NoiseType::Wavelet), - NoiseFunction::FbmPerlin => - self.noise.get_fbm_ex(&mut coords, self.octaves, NoiseType::Perlin), - NoiseFunction::TurbulencePerlin => - self.noise.get_turbulence_ex(&mut coords, self.octaves, NoiseType::Perlin), - NoiseFunction::FbmSimplex => - self.noise.get_fbm_ex(&mut coords, self.octaves, NoiseType::Simplex), - NoiseFunction::TurbulenceSimplex => - self.noise.get_turbulence_ex(&mut coords, self.octaves, NoiseType::Simplex), - NoiseFunction::FbmWavelet => - self.noise.get_fbm_ex(&mut coords, self.octaves, NoiseType::Wavelet), - NoiseFunction::TurbulenceWavelet => - self.noise.get_turbulence_ex(&mut coords, self.octaves, NoiseType::Wavelet), + NoiseFunction::Perlin => self.noise.get_ex(&mut coords, NoiseType::Perlin), + NoiseFunction::Simplex => self.noise.get_ex(&mut coords, NoiseType::Simplex), + NoiseFunction::Wavelet => self.noise.get_ex(&mut coords, NoiseType::Wavelet), + NoiseFunction::FbmPerlin => { + self.noise + .get_fbm_ex(&mut coords, self.octaves, NoiseType::Perlin) + } + NoiseFunction::TurbulencePerlin => { + self.noise + .get_turbulence_ex(&mut coords, self.octaves, NoiseType::Perlin) + } + NoiseFunction::FbmSimplex => { + self.noise + .get_fbm_ex(&mut coords, self.octaves, NoiseType::Simplex) + } + NoiseFunction::TurbulenceSimplex => { + self.noise + .get_turbulence_ex(&mut coords, self.octaves, NoiseType::Simplex) + } + NoiseFunction::FbmWavelet => { + self.noise + .get_fbm_ex(&mut coords, self.octaves, NoiseType::Wavelet) + } + NoiseFunction::TurbulenceWavelet => { + self.noise + .get_turbulence_ex(&mut coords, self.octaves, NoiseType::Wavelet) + } }; let c: u8 = ((value + 1.0) / 2.0 * 255.0) as u8; - let color = colors::Color::new(c/2, c/2, c); + let color = colors::Color::new(c / 2, c / 2, c); self.img.put_pixel(x, y, color); } } @@ -491,9 +566,13 @@ impl NoiseSample { fn draw_rectangle(&self, console: &mut Offscreen) { console.set_default_background(Color::GREY); - let height = if self.func as u32 <= NoiseType::Wavelet as u32 {10} else {13}; + let height = if self.func as u32 <= NoiseType::Wavelet as u32 { + 10 + } else { + 13 + }; console.rect(2, 2, 23, height, false, BackgroundFlag::Multiply); - for y in 2..(2+height) { + for y in 2..(2 + height) { for x in 2..25 { let old_col = console.get_char_foreground(x, y); let color = old_col * Color::GREY; @@ -507,8 +586,13 @@ impl NoiseSample { if self.func == cur_func { console.set_default_foreground(Color::WHITE); console.set_default_background(Color::LIGHT_BLUE); - console.print_ex(2, 2 + cur_func as i32, BackgroundFlag::Set, TextAlignment::Left, - FUNC_NAMES[cur_func as usize]); + console.print_ex( + 2, + 2 + cur_func as i32, + BackgroundFlag::Set, + TextAlignment::Left, + FUNC_NAMES[cur_func as usize], + ); } else { console.set_default_foreground(Color::GREY); console.print(2, 2 + cur_func as i32, FUNC_NAMES[cur_func as usize]); @@ -522,7 +606,6 @@ impl NoiseSample { console.print(2, 13, format!("R/F : lacunarity ({:2.1})", self.lacunarity)); console.print(2, 14, format!("T/G : octaves ({})", self.octaves)); } - } } @@ -531,10 +614,12 @@ impl Render for NoiseSample { system::set_fps(30); } - fn render(&mut self, - console: &mut Offscreen, - _root: &Root, - event: Option<(EventFlags, Event)>) { + fn render( + &mut self, + console: &mut Offscreen, + _root: &Root, + event: Option<(EventFlags, Event)>, + ) { self.dx += 0.01; self.dy += 0.01; @@ -546,33 +631,38 @@ impl Render for NoiseSample { if let Some((_, Event::Key(key))) = event { match key.printable { - '1'..='9' => + '1'..='9' => { self.func = { let number = key.printable.to_digit(10).unwrap() as u8; NoiseFunction::from_value(number - 1) - }, + } + } 'e' | 'E' => { self.hurst += 0.1; self.noise = self.new_noise(); - }, + } 'd' | 'D' => { self.hurst -= 0.1; self.noise = self.new_noise(); - }, + } 'r' | 'R' => { self.lacunarity += 0.5; self.noise = self.new_noise(); - }, + } 'f' | 'F' => { self.lacunarity -= 0.5; self.noise = self.new_noise(); - }, - 't' | 'T' => if self.octaves < MAX_OCTAVES - 1 { - self.octaves += 1; - }, - 'g' | 'G' => if self.octaves > 1 { - self.octaves -= 1 - }, + } + 't' | 'T' => { + if self.octaves < MAX_OCTAVES - 1 { + self.octaves += 1; + } + } + 'g' | 'G' => { + if self.octaves > 1 { + self.octaves -= 1 + } + } 'y' | 'Y' => self.zoom += 0.2, 'h' | 'H' => self.zoom -= 0.2, _ => {} @@ -598,13 +688,20 @@ struct FovSample { } fn clamp(a: f32, b: f32, x: f32) -> f32 { - if x < a { a } else if x > b { b } else { x } + if x < a { + a + } else if x > b { + b + } else { + x + } } impl FovSample { fn new() -> Self { FovSample { - px: 20, py: 10, + px: 20, + py: 10, recompute_fov: true, torch: false, map: create_map(), @@ -621,11 +718,16 @@ impl FovSample { fn display_help(&self, console: &mut Offscreen) { console.set_default_foreground(Color::WHITE); - console.print(1, 0, - format!("IJKL : move around\nT : torch fx {}\nW : light walls {}\n+-: algo {:11?}", - if self.torch { "on " } else { "off" }, - if self.light_walls { "on " } else { "off" }, - self.algorithm)); + console.print( + 1, + 0, + format!( + "IJKL : move around\nT : torch fx {}\nW : light walls {}\n+-: algo {:11?}", + if self.torch { "on " } else { "off" }, + if self.light_walls { "on " } else { "off" }, + self.algorithm + ), + ); console.set_default_foreground(Color::BLACK); } @@ -634,19 +736,33 @@ impl FovSample { let visible = self.map.is_in_fov(x, y); let is_wall = c == '#'; if !visible { - let color = if is_wall { self.dark_wall } else { self.dark_ground }; + let color = if is_wall { + self.dark_wall + } else { + self.dark_ground + }; console.set_char_background(x, y, color, BackgroundFlag::Set); } else { let mut light: colors::Color; if !self.torch { - light = if is_wall { self.light_wall } else { self.light_ground }; + light = if is_wall { + self.light_wall + } else { + self.light_ground + }; } else { - let mut base = if is_wall { self.dark_wall } else { self.dark_ground }; - light = if is_wall { self.light_wall } else { self.light_ground }; - let r = (x as f32 - self.px as f32 + dx) * - (x as f32 - self.px as f32 + dx) + - (y as f32 - self.py as f32 + dy) * - (y as f32 - self.py as f32 + dy); + let mut base = if is_wall { + self.dark_wall + } else { + self.dark_ground + }; + light = if is_wall { + self.light_wall + } else { + self.light_ground + }; + let r = (x as f32 - self.px as f32 + dx) * (x as f32 - self.px as f32 + dx) + + (y as f32 - self.py as f32 + dy) * (y as f32 - self.py as f32 + dy); if r < SQUARED_TORCH_RADIUS { let mut l = (SQUARED_TORCH_RADIUS - r) / SQUARED_TORCH_RADIUS + di; l = clamp(0.0, 1.0, l); @@ -660,7 +776,8 @@ impl FovSample { } fn handle_event(&mut self, console: &mut Offscreen, clo: &mut F) - where F: Fn(&mut FovSample) -> () + where + F: Fn(&mut FovSample) -> (), { console.put_char(self.px, self.py, ' ', BackgroundFlag::None); clo(self); @@ -671,14 +788,14 @@ impl FovSample { fn next_algorithm(&mut self) { match self.algorithm { FovAlgorithm::Restrictive => return, - _ => self.algorithm = unsafe { std::mem::transmute(self.algorithm as i32 + 1) } + _ => self.algorithm = unsafe { std::mem::transmute(self.algorithm as i32 + 1) }, }; } fn previous_algorithm(&mut self) { match self.algorithm { FovAlgorithm::Basic => return, - _ => self.algorithm = unsafe { std::mem::transmute(self.algorithm as i32 - 1) } + _ => self.algorithm = unsafe { std::mem::transmute(self.algorithm as i32 - 1) }, }; } } @@ -696,14 +813,17 @@ impl Render for FovSample { }); } - fn render(&mut self, - console: &mut Offscreen, - _root: &Root, - event: Option<(EventFlags, Event)>) { + fn render( + &mut self, + console: &mut Offscreen, + _root: &Root, + event: Option<(EventFlags, Event)>, + ) { if self.recompute_fov { self.recompute_fov = false; let radius = if self.torch { TORCH_RADIUS as i32 } else { 0 }; - self.map.compute_fov(self.px, self.py, radius, self.light_walls, self.algorithm); + self.map + .compute_fov(self.px, self.py, radius, self.light_walls, self.algorithm); } let mut dx = 0.0; @@ -724,42 +844,41 @@ impl Render for FovSample { match key.printable { 'i' | 'I' if self.map.is_walkable(self.px, self.py - 1) => { self.handle_event(console, &mut |s| s.py -= 1); - }, + } 'k' | 'K' if self.map.is_walkable(self.px, self.py + 1) => { self.handle_event(console, &mut |s| s.py += 1); - }, + } 'j' | 'J' if self.map.is_walkable(self.px - 1, self.py) => { self.handle_event(console, &mut |s| s.px -= 1); - }, + } 'l' | 'L' if self.map.is_walkable(self.px + 1, self.py) => { self.handle_event(console, &mut |s| s.px += 1); - }, + } 't' | 'T' => { self.torch = !self.torch; self.display_help(console); - }, + } 'w' | 'W' => { self.light_walls = !self.light_walls; self.display_help(console); self.recompute_fov = true; - }, + } '+' => { self.next_algorithm(); self.display_help(console); self.recompute_fov = true; - }, + } '-' => { self.previous_algorithm(); self.display_help(console); self.recompute_fov = true; - }, + } _ => {} } } } } - struct PathSample<'a> { px: i32, py: i32, @@ -777,10 +896,10 @@ struct PathSample<'a> { old_char: char, } -const TORCH_RADIUS : f32 = 10.0; -const SQUARED_TORCH_RADIUS : f32 = TORCH_RADIUS*TORCH_RADIUS; +const TORCH_RADIUS: f32 = 10.0; +const SQUARED_TORCH_RADIUS: f32 = TORCH_RADIUS * TORCH_RADIUS; -static SMAP : [&'static str; 20] = [ +static SMAP: [&'static str; 20] = [ "##############################################", "####################### #################", "##################### # ###############", @@ -801,9 +920,12 @@ static SMAP : [&'static str; 20] = [ "######## # #### ##### #####", "######## ##### ####################", "##############################################", - ]; +]; -fn iterate_map(closure: &mut F) where F: FnMut(i32, i32, char) -> () { +fn iterate_map(closure: &mut F) +where + F: FnMut(i32, i32, char) -> (), +{ for (y, line) in SMAP.iter().enumerate() { for (x, c) in line.chars().enumerate() { closure(x as i32, y as i32, c) @@ -814,18 +936,24 @@ fn iterate_map(closure: &mut F) where F: FnMut(i32, i32, char) -> () { fn create_map() -> Map { let mut map = Map::new(SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT); iterate_map(&mut |x, y, c| { - if c == ' ' { map.set(x, y, true, true) } // ground - else if c == '=' { map.set(x, y, true, false) } // window + if c == ' ' { + map.set(x, y, true, true) + } + // ground + else if c == '=' { + map.set(x, y, true, false) + } // window }); map } - impl<'a> PathSample<'a> { fn new() -> Self { PathSample { - px: 20, py: 10, - dx: 24, dy: 1, + px: 20, + py: 10, + dx: 24, + dy: 1, dark_wall: colors::Color::new(0, 0, 100), dark_ground: colors::Color::new(50, 50, 150), light_ground: colors::Color::new(200, 180, 50), @@ -842,7 +970,11 @@ impl<'a> PathSample<'a> { fn display_map(&mut self, console: &mut Offscreen) { iterate_map(&mut |x, y, c| { let wall = c == '#'; - let color = if wall { self.dark_wall } else { self.dark_ground }; + let color = if wall { + self.dark_wall + } else { + self.dark_ground + }; console.set_char_background(x, y, color, BackgroundFlag::Set); }); } @@ -857,7 +989,7 @@ impl<'a> PathSample<'a> { let d = self.dijkstra.distance_from_root((x, y)); match d { Some(d) if d > self.dijkstra_dist => self.dijkstra_dist = d, - _ => {}, + _ => {} } }); self.dijkstra.find((self.dx, self.dy)); @@ -877,9 +1009,11 @@ impl<'a> PathSample<'a> { if !wall { let d = self.dijkstra.distance_from_root((x, y)); if let Some(d) = d { - let color = colors::lerp(self.light_ground, - self.dark_ground, - 0.9 * d / self.dijkstra_dist); + let color = colors::lerp( + self.light_ground, + self.dark_ground, + 0.9 * d / self.dijkstra_dist, + ); console.set_char_background(x, y, color, BackgroundFlag::Set); } } @@ -913,13 +1047,19 @@ impl<'a> PathSample<'a> { } fn handle_event(&mut self, console: &mut Offscreen, clo: &mut F) - where F: Fn(&mut PathSample) -> () + where + F: Fn(&mut PathSample) -> (), { console.put_char(self.dx, self.dy, self.old_char, BackgroundFlag::None); clo(self); self.old_char = console.get_char(self.dx, self.dy); console.put_char(self.dx, self.dy, '+', BackgroundFlag::None); - if SMAP[self.dy as usize].chars().nth(self.dx as usize).unwrap() == ' ' { + if SMAP[self.dy as usize] + .chars() + .nth(self.dx as usize) + .unwrap() + == ' ' + { self.recalculate_path = true; } } @@ -948,11 +1088,15 @@ impl<'a> Render for PathSample<'a> { self.recalculate_path = true; } - fn render(&mut self, - console: &mut Offscreen, - _root: &Root, - event: Option<(EventFlags, Event)>) { - if self.recalculate_path { self.recalculate() } + fn render( + &mut self, + console: &mut Offscreen, + _root: &Root, + event: Option<(EventFlags, Event)>, + ) { + if self.recalculate_path { + self.recalculate() + } self.display_map(console); self.draw_path(console); @@ -964,16 +1108,26 @@ impl<'a> Render for PathSample<'a> { if let Some((_, Event::Key(key))) = event { match key { - Key { printable: 'i', .. } | Key { printable: 'I', .. } if self.dy > 0 => - self.handle_event(console, &mut |s| s.dy -= 1), - Key { printable: 'k', .. } | Key { printable: 'K', .. } if self.dy < SAMPLE_SCREEN_HEIGHT-1 => - self.handle_event(console, &mut |s| s.dy += 1), - Key { printable: 'j', .. } | Key { printable: 'J', .. } if self.dx > 0 => - self.handle_event(console, &mut |s| s.dx -= 1), - Key { printable: 'l', .. } | Key { printable: 'L', .. } if self.dx < SAMPLE_SCREEN_WIDTH-1 => - self.handle_event(console, &mut |s| s.dx += 1), - Key { code: KeyCode::Tab, .. } => { - self.using_astar = ! self.using_astar; + Key { printable: 'i', .. } | Key { printable: 'I', .. } if self.dy > 0 => { + self.handle_event(console, &mut |s| s.dy -= 1) + } + Key { printable: 'k', .. } | Key { printable: 'K', .. } + if self.dy < SAMPLE_SCREEN_HEIGHT - 1 => + { + self.handle_event(console, &mut |s| s.dy += 1) + } + Key { printable: 'j', .. } | Key { printable: 'J', .. } if self.dx > 0 => { + self.handle_event(console, &mut |s| s.dx -= 1) + } + Key { printable: 'l', .. } | Key { printable: 'L', .. } + if self.dx < SAMPLE_SCREEN_WIDTH - 1 => + { + self.handle_event(console, &mut |s| s.dx += 1) + } + Key { + code: KeyCode::Tab, .. + } => { + self.using_astar = !self.using_astar; if self.using_astar { console.print(1, 4, "Using : A* "); } else { @@ -987,9 +1141,11 @@ impl<'a> Render for PathSample<'a> { if let Some((_, Event::Mouse(state))) = event { let mx: i32 = state.cx as i32 - SAMPLE_SCREEN_X; let my: i32 = state.cy as i32 - SAMPLE_SCREEN_Y; - if mx >= 0 && mx < SAMPLE_SCREEN_WIDTH && - my >= 0 && my < SAMPLE_SCREEN_HEIGHT && - (self.dx != mx || self.dy != my) + if mx >= 0 + && mx < SAMPLE_SCREEN_WIDTH + && my >= 0 + && my < SAMPLE_SCREEN_HEIGHT + && (self.dx != mx || self.dy != my) { self.handle_event(console, &mut |s| { s.dx = mx; @@ -1018,7 +1174,9 @@ struct BspSample<'a> { fn random_val(mut low: i32, high: i32) -> i32 { let mut rnd = rand::thread_rng(); - if low >= high { low -= 1 } + if low >= high { + low -= 1 + } rnd.gen_range(low, high) } @@ -1039,7 +1197,8 @@ impl<'a> BspSample<'a> { } fn rebuild(&mut self) { - self.bsp.resize(0, 0, SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT); + self.bsp + .resize(0, 0, SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT); for row in &mut self.map { for item in &mut row.iter_mut() { *item = '#'; @@ -1048,18 +1207,23 @@ impl<'a> BspSample<'a> { if self.generate { self.bsp.remove_sons(); let rw = if self.room_walls { 1 } else { 0 }; - self.bsp.split_recursive(None, - self.bsp_depth, - self.min_room_size + rw, - self.min_room_size + rw, - 1.5, 1.5); + self.bsp.split_recursive( + None, + self.bsp_depth, + self.min_room_size + rw, + self.min_room_size + rw, + 1.5, + 1.5, + ); } let mut map = self.map; - self.bsp.traverse(TraverseOrder::InvertedLevelOrder, - |mut node| self.visit(&mut node, &mut map)); + self.bsp + .traverse(TraverseOrder::InvertedLevelOrder, |mut node| { + self.visit(&mut node, &mut map) + }); self.map = map; self.generate = false; - self.refresh = false; + self.refresh = false; } fn visit(&self, node: &mut Bsp, map: &mut CharMap) -> bool { @@ -1078,11 +1242,19 @@ impl<'a> BspSample<'a> { let mut max_y = node.y + node.h - 1; if !self.room_walls { - if min_x > 1 { min_x -= 1 } - if min_y > 1 { min_y -= 1 } + if min_x > 1 { + min_x -= 1 + } + if min_y > 1 { + min_y -= 1 + } + } + if max_x == SAMPLE_SCREEN_WIDTH - 1 { + max_x -= 1 + } + if max_y == SAMPLE_SCREEN_HEIGHT - 1 { + max_y -= 1 } - if max_x == SAMPLE_SCREEN_WIDTH - 1 { max_x -= 1} - if max_y == SAMPLE_SCREEN_HEIGHT - 1 { max_y -= 1} if self.random_room { min_x = random_val(min_x, max_x - self.min_room_size + 2); min_y = random_val(min_y, max_y - self.min_room_size + 2); @@ -1095,8 +1267,8 @@ impl<'a> BspSample<'a> { node.w = max_x - min_x + 1; node.h = max_y - min_y + 1; - for x in min_x..(max_x+1) { - for y in min_y..(max_y+1) { + for x in min_x..(max_x + 1) { + for y in min_y..(max_y + 1) { map[y as usize][x as usize] = ' '; } } @@ -1117,7 +1289,7 @@ impl<'a> BspSample<'a> { // no overlap let x1 = random_val(left.x, left.x + left.w); let x2 = random_val(right.x, right.x + right.w); - let y = random_val(left.y + left.h, right.y + 1); + let y = random_val(left.y + left.h, right.y + 1); self.vline_up(map, x1, y - 1); self.hline(map, x1, y, x2); self.vline_down(map, x2, y + 1); @@ -1134,10 +1306,10 @@ impl<'a> BspSample<'a> { if left.y + left.h - 1 < right.y || right.y + right.h - 1 < left.y { let y1 = random_val(left.y, left.y + left.h); let y2 = random_val(right.y, right.y + right.h); - let x = random_val(left.x + left.w, right.x + 1); - self.hline_left(map, x-1, y1); + let x = random_val(left.x + left.w, right.x + 1); + self.hline_left(map, x - 1, y1); self.vline(map, x, y1, y2); - self.hline_right(map, x+1, y2); + self.hline_right(map, x + 1, y2); } else { let min_y = max(left.y, right.y); let max_y = min(left.y + left.h - 1, right.y + right.h - 1); @@ -1166,11 +1338,15 @@ impl<'a> BspSample<'a> { let mut y = y1; let dy = if y1 > y2 { -1 } else { 1 }; map[y as usize][x as usize] = ' '; - if y1 == y2 { return } + if y1 == y2 { + return; + } loop { y += dy; map[y as usize][x as usize] = ' '; - if y as i32 == y2 { break } + if y as i32 == y2 { + break; + } } } @@ -1178,11 +1354,15 @@ impl<'a> BspSample<'a> { let mut x = x1; let dx = if x1 > x2 { -1 } else { 1 }; map[y as usize][x as usize] = ' '; - if x1 == x2 { return }; + if x1 == x2 { + return; + }; loop { x += dx; map[y as usize][x as usize] = ' '; - if x as i32 == x2 { break } + if x as i32 == x2 { + break; + } } } @@ -1202,11 +1382,14 @@ impl<'a> BspSample<'a> { } impl<'a> Render for BspSample<'a> { - fn initialize(&mut self, _console: &mut Offscreen) { - } - - fn render(&mut self, console: &mut Offscreen, _root: &Root, - event: Option<(EventFlags, Event)>) { + fn initialize(&mut self, _console: &mut Offscreen) {} + + fn render( + &mut self, + console: &mut Offscreen, + _root: &Root, + event: Option<(EventFlags, Event)>, + ) { if self.generate || self.refresh { self.rebuild() } @@ -1218,52 +1401,89 @@ impl<'a> Render for BspSample<'a> { self.min_room_size, if self.random_room { "ON" } else { "OFF" })); if self.random_room { - console.print(1, 6, format!("2 : room walls {}", - if self.room_walls { "ON" } else { "OFF" })); + console.print( + 1, + 6, + format!( + "2 : room walls {}", + if self.room_walls { "ON" } else { "OFF" } + ), + ); } for x in 0..SAMPLE_SCREEN_WIDTH { for y in 0..SAMPLE_SCREEN_HEIGHT { let wall = self.map[y as usize][x as usize] == '#'; - console.set_char_background(x, y, - if wall { self.dark_wall } else {self.dark_ground }, - BackgroundFlag::Set); + console.set_char_background( + x, + y, + if wall { + self.dark_wall + } else { + self.dark_ground + }, + BackgroundFlag::Set, + ); } } if let Some((_, Event::Key(key))) = event { match key { - Key { code: KeyCode::Enter, .. } | Key { code: KeyCode::NumPadEnter, ..} => - self.generate = true, - Key { code: KeyCode::Spacebar, .. } => - self.refresh = true, + Key { + code: KeyCode::Enter, + .. + } + | Key { + code: KeyCode::NumPadEnter, + .. + } => self.generate = true, + Key { + code: KeyCode::Spacebar, + .. + } => self.refresh = true, Key { printable: '+', .. } => { self.bsp_depth += 1; self.generate = true - }, + } Key { printable: '-', .. } if self.bsp_depth > 1 => { self.bsp_depth -= 1; self.generate = true - }, + } Key { printable: '*', .. } => { self.min_room_size += 1; self.generate = true - }, + } Key { printable: '/', .. } if self.min_room_size > 2 => { self.min_room_size -= 1; self.generate = true - }, - Key { printable: '1', .. } | Key { code: KeyCode::Number1, .. } | - Key { code: KeyCode::NumPad1, .. } => { + } + Key { printable: '1', .. } + | Key { + code: KeyCode::Number1, + .. + } + | Key { + code: KeyCode::NumPad1, + .. + } => { self.random_room = !self.random_room; - if !self.random_room { self.room_walls = true } + if !self.random_room { + self.room_walls = true + } self.refresh = true - }, - Key { printable: '2', .. } | Key { code: KeyCode::Number2, .. } | - Key { code: KeyCode::NumPad2, .. } => { + } + Key { printable: '2', .. } + | Key { + code: KeyCode::Number2, + .. + } + | Key { + code: KeyCode::NumPad2, + .. + } => { self.room_walls = !self.room_walls; self.refresh = true - }, + } _ => { /* ignore */ } } } @@ -1299,21 +1519,24 @@ impl Render for ImageSample { system::set_fps(30) } - fn render(&mut self, - console: &mut Offscreen, - _root: &Root, - _event: Option<(EventFlags, Event)>) { + fn render( + &mut self, + console: &mut Offscreen, + _root: &Root, + _event: Option<(EventFlags, Event)>, + ) { console.set_default_background(Color::BLACK); console.clear(); let elapsed_seconds = seconds_from_duration(system::get_elapsed_time()); - let x = (SAMPLE_SCREEN_WIDTH/2) as f32 + (elapsed_seconds as f32).cos() * 10.0; - let y = (SAMPLE_SCREEN_HEIGHT/2) as f32; + let x = (SAMPLE_SCREEN_WIDTH / 2) as f32 + (elapsed_seconds as f32).cos() * 10.0; + let y = (SAMPLE_SCREEN_HEIGHT / 2) as f32; let scale_x = 0.2 + 1.8 * (1.0 + (elapsed_seconds / 2.0).cos()) / 2.0; let scale_y = scale_x; let angle = elapsed_seconds; let duration = system::get_elapsed_time(); - let elapsed_milliseconds = duration.as_secs() as u32 * 1000 + duration.subsec_nanos() / 1_000_000; + let elapsed_milliseconds = + duration.as_secs() as u32 * 1000 + duration.subsec_nanos() / 1_000_000; let elapsed = elapsed_milliseconds / 2000; if elapsed % 2 != 0 { @@ -1321,30 +1544,66 @@ impl Render for ImageSample { // the red channel console.set_default_background(Color::RED); console.rect(0, 3, 15, 15, false, BackgroundFlag::Set); - image::blit_rect(&self.circle, (-1, -1), console, (0, 3), BackgroundFlag::Multiply); + image::blit_rect( + &self.circle, + (-1, -1), + console, + (0, 3), + BackgroundFlag::Multiply, + ); // the green channel console.set_default_background(self.green); console.rect(15, 3, 15, 15, false, BackgroundFlag::Set); - image::blit_rect(&self.circle, (-1, -1), console, (15, 3), BackgroundFlag::Multiply); + image::blit_rect( + &self.circle, + (-1, -1), + console, + (15, 3), + BackgroundFlag::Multiply, + ); // the blue channel console.set_default_background(self.blue); console.rect(30, 3, 15, 15, false, BackgroundFlag::Set); - image::blit_rect(&self.circle, (-1, -1), console, (30, 3), BackgroundFlag::Multiply); + image::blit_rect( + &self.circle, + (-1, -1), + console, + (30, 3), + BackgroundFlag::Multiply, + ); } else { - image::blit_rect(&self.circle, (-1, -1), console, ( 0, 3), BackgroundFlag::Set); - image::blit_rect(&self.circle, (-1, -1), console, (15, 3), BackgroundFlag::Set); - image::blit_rect(&self.circle, (-1, -1), console, (30, 3), BackgroundFlag::Set); - } - - image::blit(&self.img, (scale_x, scale_y), angle, console, (x, y), BackgroundFlag::Set); + image::blit_rect(&self.circle, (-1, -1), console, (0, 3), BackgroundFlag::Set); + image::blit_rect( + &self.circle, + (-1, -1), + console, + (15, 3), + BackgroundFlag::Set, + ); + image::blit_rect( + &self.circle, + (-1, -1), + console, + (30, 3), + BackgroundFlag::Set, + ); + } + + image::blit( + &self.img, + (scale_x, scale_y), + angle, + console, + (x, y), + BackgroundFlag::Set, + ); } } - struct MouseSample { - left_button: bool, + left_button: bool, middle_button: bool, - right_button: bool, + right_button: bool, mouse_state: Option, } @@ -1359,7 +1618,8 @@ impl MouseSample { } fn format(&self, mouse: &Mouse, root: &Root) -> String { - format!("{}\n \ + format!( + "{}\n \ Mouse position : {:4}x{:4} {}\n \ Mouse cell : {:4}x{:4}\n \ Mouse movement : {:4}x{:4}\n \ @@ -1367,18 +1627,32 @@ impl MouseSample { Right button : {} (toggle {})\n \ Middle button : {} (toggle {})\n \ Wheel : {}\n", - if root.is_active() {""} else {"APPLICATION INACTIVE"}, - mouse.x, mouse.y, - if root.has_focus() {""} else {"OUT OF FOCUS"}, - mouse.cx, mouse.cy, - mouse.dx, mouse.dy, - if mouse.lbutton { " ON" } else { "OFF" }, - if self.left_button { " ON" } else { "OFF" }, - if mouse.rbutton { " ON" } else { "OFF" }, - if self.right_button { " ON" } else { "OFF" }, - if mouse.mbutton { " ON" } else { "OFF" }, - if self.middle_button { " ON" } else { "OFF" }, - if mouse.wheel_up { "UP" } else if mouse.wheel_down { "DOWN" } else { "" }) + if root.is_active() { + "" + } else { + "APPLICATION INACTIVE" + }, + mouse.x, + mouse.y, + if root.has_focus() { "" } else { "OUT OF FOCUS" }, + mouse.cx, + mouse.cy, + mouse.dx, + mouse.dy, + if mouse.lbutton { " ON" } else { "OFF" }, + if self.left_button { " ON" } else { "OFF" }, + if mouse.rbutton { " ON" } else { "OFF" }, + if self.right_button { " ON" } else { "OFF" }, + if mouse.mbutton { " ON" } else { "OFF" }, + if self.middle_button { " ON" } else { "OFF" }, + if mouse.wheel_up { + "UP" + } else if mouse.wheel_down { + "DOWN" + } else { + "" + } + ) } } @@ -1391,26 +1665,39 @@ impl Render for MouseSample { show_cursor(true) } - fn render(&mut self, - console: &mut Offscreen, - root: &Root, - event: Option<(EventFlags, Event)>) { + fn render(&mut self, console: &mut Offscreen, root: &Root, event: Option<(EventFlags, Event)>) { console.clear(); match event { Some((_, Event::Mouse(mouse))) => { - if mouse.lbutton_pressed {self.left_button = !self.left_button;} - if mouse.mbutton_pressed {self.middle_button = !self.middle_button;} - if mouse.rbutton_pressed {self.right_button = !self.right_button;} + if mouse.lbutton_pressed { + self.left_button = !self.left_button; + } + if mouse.mbutton_pressed { + self.middle_button = !self.middle_button; + } + if mouse.rbutton_pressed { + self.right_button = !self.right_button; + } self.mouse_state = Some(mouse); - }, - Some((_, Event::Key(Key {code: KeyCode::Number1, ..}))) => { + } + Some(( + _, + Event::Key(Key { + code: KeyCode::Number1, + .. + }), + )) => { show_cursor(false); - }, - Some((_, Event::Key(Key {code: KeyCode::Number2, ..}))) => { - show_cursor(true) - }, + } + Some(( + _, + Event::Key(Key { + code: KeyCode::Number2, + .. + }), + )) => show_cursor(true), _ => {} // Ignore other events } @@ -1434,7 +1721,9 @@ impl NameSample { fn new() -> Self { let mut n = Namegen::new().unwrap(); - let entries = read_dir("data/namegen").ok().expect("Could not read data/namegen"); + let entries = read_dir("data/namegen") + .ok() + .expect("Could not read data/namegen"); for entry in entries { match entry { Ok(e) => { @@ -1443,10 +1732,10 @@ impl NameSample { if extension.ends_with("cfg") { n.parse(&path); } - }, + } _ => {} } - }; + } NameSample { sets: n.get_sets(), @@ -1461,12 +1750,23 @@ impl NameSample { console.set_default_background(Color::LIGHT_BLUE); console.clear(); console.set_default_foreground(Color::WHITE); - console.print(1, 1, format!("{}\n\n+ : next generator\n- : prev generator", - self.sets[self.cur_set])); + console.print( + 1, + 1, + format!( + "{}\n\n+ : next generator\n- : prev generator", + self.sets[self.cur_set] + ), + ); for (i, name) in self.names.iter().enumerate() { if (name.len() as i32) < SAMPLE_SCREEN_WIDTH { - console.print_ex(SAMPLE_SCREEN_WIDTH - 2, 2 + i as i32, - BackgroundFlag::None, TextAlignment::Right, name) + console.print_ex( + SAMPLE_SCREEN_WIDTH - 2, + 2 + i as i32, + BackgroundFlag::None, + TextAlignment::Right, + name, + ) } } } @@ -1483,10 +1783,12 @@ impl Render for NameSample { system::set_fps(30); } - fn render(&mut self, - console: &mut Offscreen, - _root: &Root, - event: Option<(EventFlags, Event)>) { + fn render( + &mut self, + console: &mut Offscreen, + _root: &Root, + event: Option<(EventFlags, Event)>, + ) { self.limit_names(); self.display_names(console); @@ -1502,7 +1804,7 @@ impl Render for NameSample { '+' => { self.cur_set = (self.cur_set + 1) % self.sets.len(); self.names.push("======".to_owned()); - }, + } '-' => { if self.cur_set == 0 { self.cur_set = self.sets.len() - 1 @@ -1510,8 +1812,8 @@ impl Render for NameSample { self.cur_set -= 1; } self.names.push("======".to_owned()); - }, - _ => {}, + } + _ => {} } } } @@ -1519,12 +1821,15 @@ impl Render for NameSample { struct MenuItem<'a> { name: String, - render: &'a mut dyn Render + render: &'a mut dyn Render, } impl<'a> MenuItem<'a> { fn new(name: &str, render: &'a mut dyn Render) -> Self { - MenuItem { name: name.to_owned(), render: render } + MenuItem { + name: name.to_owned(), + render: render, + } } } @@ -1533,10 +1838,12 @@ impl<'a> Render for MenuItem<'a> { self.render.initialize(console); } - fn render(&mut self, - console: &mut Offscreen, - _root: &Root, - event: Option<(EventFlags, Event)>) { + fn render( + &mut self, + console: &mut Offscreen, + _root: &Root, + event: Option<(EventFlags, Event)>, + ) { self.render.render(console, _root, event); } } @@ -1580,18 +1887,19 @@ fn main() { let mut line = LineSample::new(); let mut noise = NoiseSample::new(); let mut bsp = BspSample::new(); - let mut samples = vec![MenuItem::new(" True colors ", &mut colors), - MenuItem::new(" Offscreen console", &mut offscreen), - MenuItem::new(" Line drawing ", &mut line), - MenuItem::new(" Noise ", &mut noise), - MenuItem::new(" Field of view ", &mut fov), - MenuItem::new(" Path finding ", &mut path_sample), - MenuItem::new(" Bsp toolkit ", &mut bsp), - MenuItem::new(" Image toolkit ", &mut image_sample), - MenuItem::new(" Mouse support ", &mut mouse), - MenuItem::new(" Name generator ", &mut names), - // MenuItem::new(" SDL callback ", &mut ), - ]; + let mut samples = vec![ + MenuItem::new(" True colors ", &mut colors), + MenuItem::new(" Offscreen console", &mut offscreen), + MenuItem::new(" Line drawing ", &mut line), + MenuItem::new(" Noise ", &mut noise), + MenuItem::new(" Field of view ", &mut fov), + MenuItem::new(" Path finding ", &mut path_sample), + MenuItem::new(" Bsp toolkit ", &mut bsp), + MenuItem::new(" Image toolkit ", &mut image_sample), + MenuItem::new(" Mouse support ", &mut mouse), + MenuItem::new(" Name generator ", &mut names), + // MenuItem::new(" SDL callback ", &mut ), + ]; let mut cur_sample = 0; let mut options = Options::new(); let mut console = Offscreen::new(SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT); @@ -1599,8 +1907,7 @@ fn main() { parse_args(&mut options); if options.fullscreen_width > 0 { - system::force_fullscreen_resolution(options.fullscreen_width, - options.fullscreen_height); + system::force_fullscreen_resolution(options.fullscreen_width, options.fullscreen_height); } let mut root = Root::initializer() @@ -1625,8 +1932,15 @@ fn main() { let event = check_for_event(EventFlags::KEY_PRESS | EventFlags::MOUSE); samples[cur_sample].render(&mut console, &root, event); - blit(&console, (0, 0), (SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT), - &mut root, (SAMPLE_SCREEN_X, SAMPLE_SCREEN_Y), 1.0, 1.0); + blit( + &console, + (0, 0), + (SAMPLE_SCREEN_WIDTH, SAMPLE_SCREEN_HEIGHT), + &mut root, + (SAMPLE_SCREEN_X, SAMPLE_SCREEN_Y), + 1.0, + 1.0, + ); // erase the renderer in debug mode (needed because the root // console is not cleared each frame) @@ -1638,7 +1952,7 @@ fn main() { KeyCode::Down => { cur_sample = (cur_sample + 1) % samples.len(); samples[cur_sample].initialize(&mut console); - }, + } KeyCode::Up => { if cur_sample == 0 { cur_sample = samples.len() - 1; @@ -1646,16 +1960,16 @@ fn main() { cur_sample -= 1; } samples[cur_sample].initialize(&mut console); - }, + } KeyCode::Enter if key.left_alt => { let fullscreen = root.is_fullscreen(); root.set_fullscreen(!fullscreen); - }, + } KeyCode::PrintScreen => { // TODO - }, + } KeyCode::Escape => break, - _ => {}, + _ => {} } } } @@ -1674,25 +1988,37 @@ fn print_samples(root: &mut Root, cur_sample: usize, samples: &[MenuItem]) { let fun = &sample.name; root.print_ex(2, y as i32, BackgroundFlag::Set, TextAlignment::Left, fun); } - } fn print_help_message(root: &mut Root) { root.set_default_foreground(Color::GREY); - root.print_ex(79, 46, BackgroundFlag::None, TextAlignment::Right, - format!("last frame : {:3.0} ms ({:3} fps)", - system::get_last_frame_length() * 1000.0, - system::get_fps())); + root.print_ex( + 79, + 46, + BackgroundFlag::None, + TextAlignment::Right, + format!( + "last frame : {:3.0} ms ({:3} fps)", + system::get_last_frame_length() * 1000.0, + system::get_fps() + ), + ); let time = system::get_elapsed_time(); let millis = time.as_secs() as u32 * 1000 + time.subsec_nanos() / 1_000_000; - root.print_ex(79, 47, BackgroundFlag::None, TextAlignment::Right, - format!("elapsed {:8}ms {:4.2}s", - millis, - millis as f32/ 1000.0)); - - root.print(2, 47, format!("{}{} : select a sample", - chars::ARROW_N, chars::ARROW_S)); + root.print_ex( + 79, + 47, + BackgroundFlag::None, + TextAlignment::Right, + format!("elapsed {:8}ms {:4.2}s", millis, millis as f32 / 1000.0), + ); + + root.print( + 2, + 47, + format!("{}{} : select a sample", chars::ARROW_N, chars::ARROW_S), + ); let fullscreen_text = if root.is_fullscreen() { "windowed mode" @@ -1712,19 +2038,19 @@ fn parse_args(options: &mut Options) { if let Some(font) = args.next() { options.font = font; } - }, + } "-font-nb-char" => { if let (Some(h), Some(v)) = (args.next(), args.next()) { options.nb_char_horiz = h.parse().ok().unwrap(); options.nb_char_vertic = v.parse().ok().unwrap(); } - }, + } "-fullscreen-resolution" => { if let (Some(w), Some(h)) = (args.next(), args.next()) { options.fullscreen_width = w.parse().ok().unwrap(); options.fullscreen_height = h.parse().ok().unwrap(); } - }, + } "-fullscreen" => options.fullscreen = true, "-font-in-row" => options.font_layout = FontLayout::AsciiInRow, "-font-greyscale" => options.font_type = FontType::Greyscale, @@ -1741,7 +2067,7 @@ fn parse_args(options: &mut Options) { } } } - }, + } "-help" | "-?" => { println!("options :"); println!("-font : use a custom font"); @@ -1753,8 +2079,8 @@ fn parse_args(options: &mut Options) { println!("-fullscreen-resolution : force fullscreen resolution"); println!("-renderer : set renderer. 0 : GLSL 1 : OPENGL 2 : SDL"); std::process::exit(0) - }, - _ => {}, + } + _ => {} } } } diff --git a/examples/shapes.rs b/examples/shapes.rs index c7b5d5c9a..308a18c9d 100644 --- a/examples/shapes.rs +++ b/examples/shapes.rs @@ -1,6 +1,6 @@ extern crate tcod; -use tcod::{Console, RootConsole, Color, BackgroundFlag}; +use tcod::{BackgroundFlag, Color, Console, RootConsole}; fn main() { let mut root = RootConsole::initializer() @@ -13,7 +13,11 @@ fn main() { root.clear(); - root.set_default_background(Color{r: 255, g: 0, b: 255}); + root.set_default_background(Color { + r: 255, + g: 0, + b: 255, + }); root.rect(5, 5, 10, 5, false, BackgroundFlag::Set); @@ -22,7 +26,15 @@ fn main() { root.horizontal_line(30, 14, 15, BackgroundFlag::Set); root.vertical_line(46, 4, 9, BackgroundFlag::Set); - root.print_frame(15, 25, 35, 10, false, BackgroundFlag::Set, Some("Hello World!")); + root.print_frame( + 15, + 25, + 35, + 10, + false, + BackgroundFlag::Set, + Some("Hello World!"), + ); root.flush(); root.wait_for_keypress(true); diff --git a/examples/text.rs b/examples/text.rs index 169cf90cf..8a2472dd5 100644 --- a/examples/text.rs +++ b/examples/text.rs @@ -1,22 +1,51 @@ extern crate tcod; -use tcod::{Console, RootConsole, BackgroundFlag, TextAlignment}; +use tcod::{BackgroundFlag, Console, RootConsole, TextAlignment}; fn main() { - let mut root = RootConsole::initializer().size(80, 50).title("Displaying text").init(); + let mut root = RootConsole::initializer() + .size(80, 50) + .title("Displaying text") + .init(); - root.print_ex(1, 1, BackgroundFlag::None, TextAlignment::Left, - b"Ascii text aligned to left.\xf8"); - root.print_ex(78, 1, BackgroundFlag::None, TextAlignment::Right, - "Unicode text aligned to right.\u{f8}"); - root.print_ex(40, 15, BackgroundFlag::None, TextAlignment::Center, - "And this bit of text is centered."); - root.print_ex(40, 19, BackgroundFlag::None, TextAlignment::Center, - "Press any key to quit."); + root.print_ex( + 1, + 1, + BackgroundFlag::None, + TextAlignment::Left, + b"Ascii text aligned to left.\xf8", + ); + root.print_ex( + 78, + 1, + BackgroundFlag::None, + TextAlignment::Right, + "Unicode text aligned to right.\u{f8}", + ); + root.print_ex( + 40, + 15, + BackgroundFlag::None, + TextAlignment::Center, + "And this bit of text is centered.", + ); + root.print_ex( + 40, + 19, + BackgroundFlag::None, + TextAlignment::Center, + "Press any key to quit.", + ); let wrapped_text = "This text is wrapped to form X lines: https://xkcd.com/688/"; let lines = root.get_height_rect(10, 25, 22, 10, wrapped_text); - root.print_rect(10, 25, 22, 10, wrapped_text.replace("X", &lines.to_string())); + root.print_rect( + 10, + 25, + 22, + 10, + wrapped_text.replace("X", &lines.to_string()), + ); root.flush(); root.wait_for_keypress(true); } diff --git a/src/bindings.rs b/src/bindings.rs index 971f7181d..828679980 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -1,10 +1,10 @@ pub extern crate tcod_sys as ffi; pub use std::ffi::{CStr, CString}; -pub use std::os::raw::{c_char, c_int, c_float, c_uint, c_void, c_uchar}; +pub use std::os::raw::{c_char, c_float, c_int, c_uchar, c_uint, c_void}; -use std::mem::transmute; use super::input::KeyCode; +use std::mem::transmute; pub trait AsNative { unsafe fn as_native(&self) -> &T; @@ -19,17 +19,17 @@ impl<'a, T, U: AsNative + ?Sized> AsNative for &'a U { unsafe fn as_native(&self) -> &T { (**self).as_native() } - + unsafe fn as_native_mut(&mut self) -> &mut T { unimplemented!(); } } -impl + ?Sized> AsNative for Box { +impl + ?Sized> AsNative for Box { unsafe fn as_native(&self) -> &T { (**self).as_native() } - + unsafe fn as_native_mut(&mut self) -> &mut T { (**self).as_native_mut() } @@ -37,8 +37,8 @@ impl + ?Sized> AsNative for Box { pub fn keycode_from_native(input: self::ffi::TCOD_keycode_t) -> Option { match input as u32 { - x @ 0 ..= 66 => Some(unsafe { transmute(x) }), - _ => None + x @ 0..=66 => Some(unsafe { transmute(x) }), + _ => None, } } diff --git a/src/bsp.rs b/src/bsp.rs index 1eae2098c..87ac80fb3 100644 --- a/src/bsp.rs +++ b/src/bsp.rs @@ -1,12 +1,12 @@ //! Port of BSP toolkit. +use bindings::c_void; use bindings::ffi; use bindings::AsNative; -use bindings::c_void; use random::Rng; -use std::ops::{Deref, DerefMut}; use std::fmt; use std::mem; +use std::ops::{Deref, DerefMut}; use std::ptr; #[derive(Copy, Clone, Debug)] @@ -39,7 +39,7 @@ pub enum TraverseOrder { /// ``` pub struct Bsp<'a> { bsp: &'a mut ffi::TCOD_bsp_t, - root: bool + root: bool, } impl<'a> Deref for Bsp<'a> { @@ -58,21 +58,27 @@ impl<'a> DerefMut for Bsp<'a> { impl<'a> fmt::Debug for Bsp<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { - write!(f, "Bsp{{x: {}, y:{}, w: {}, h: {}, position: {}, level: {}, horizontal: {} }}", - self.x, self.y, self.w, self.h, self.position, self.level, self.horizontal) + write!( + f, + "Bsp{{x: {}, y:{}, w: {}, h: {}, position: {}, level: {}, horizontal: {} }}", + self.x, self.y, self.w, self.h, self.position, self.level, self.horizontal + ) } } - extern "C" fn callback_wrapper(node: *mut ffi::TCOD_bsp_t, user_data: *mut c_void) -> bool - where T: FnMut(&mut Bsp) -> bool +where + T: FnMut(&mut Bsp) -> bool, { let callback_ptr = user_data as *mut T; - let cb: &mut T = unsafe { - &mut *callback_ptr + let cb: &mut T = unsafe { &mut *callback_ptr }; + if node.is_null() { + panic!("Null node when traversing a BSP.") + } + let mut bsp = Bsp { + bsp: unsafe { &mut *node }, + root: false, }; - if node.is_null() { panic!("Null node when traversing a BSP.") } - let mut bsp = Bsp { bsp: unsafe { &mut *node }, root: false }; cb(&mut bsp) } @@ -85,7 +91,10 @@ impl<'a> Bsp<'a> { } &mut *pointer }; - Bsp { bsp: bsp, root: true } + Bsp { + bsp: bsp, + root: true, + } } pub fn remove_sons(&mut self) { @@ -93,31 +102,35 @@ impl<'a> Bsp<'a> { } pub fn split_once(&mut self, horizontal: bool, position: i32) { - unsafe { ffi::TCOD_bsp_split_once(self.bsp as *mut ffi::TCOD_bsp_t, - horizontal, - position) } + unsafe { ffi::TCOD_bsp_split_once(self.bsp as *mut ffi::TCOD_bsp_t, horizontal, position) } } - pub fn split_recursive(&mut self, - mut randomizer: Option<&mut Rng>, - nb: i32, - min_h_size: i32, - min_v_size: i32, - max_h_ratio: f32, - max_v_ratio: f32) { - let rnd = unsafe { if let Some(ref mut r) = randomizer { - *r.as_native_mut() - } else { - ptr::null() - } }; + pub fn split_recursive( + &mut self, + mut randomizer: Option<&mut Rng>, + nb: i32, + min_h_size: i32, + min_v_size: i32, + max_h_ratio: f32, + max_v_ratio: f32, + ) { + let rnd = unsafe { + if let Some(ref mut r) = randomizer { + *r.as_native_mut() + } else { + ptr::null() + } + }; unsafe { - ffi::TCOD_bsp_split_recursive(self.bsp as *mut ffi::TCOD_bsp_t, - rnd as *mut _, - nb, - min_h_size, - min_v_size, - max_h_ratio, - max_v_ratio) + ffi::TCOD_bsp_split_recursive( + self.bsp as *mut ffi::TCOD_bsp_t, + rnd as *mut _, + nb, + min_h_size, + min_v_size, + max_h_ratio, + max_v_ratio, + ) } } @@ -134,7 +147,7 @@ impl<'a> Bsp<'a> { } else { Some(Bsp { bsp: &mut *left, - root: false + root: false, }) } } @@ -143,13 +156,13 @@ impl<'a> Bsp<'a> { /// Returns `Some(Bsp)` with right subtree, or `None` if the BSP has not been split. pub fn right(&mut self) -> Option { unsafe { - let right = ffi::TCOD_bsp_right(self.bsp as *mut ffi::TCOD_bsp_t) ; + let right = ffi::TCOD_bsp_right(self.bsp as *mut ffi::TCOD_bsp_t); if right.is_null() { None } else { Some(Bsp { bsp: &mut *right, - root:false + root: false, }) } } @@ -180,14 +193,13 @@ impl<'a> Bsp<'a> { pub fn find_node(&mut self, cx: i32, cy: i32) -> Option { unsafe { - let pointer = ffi::TCOD_bsp_find_node(self.bsp as *mut ffi::TCOD_bsp_t, - cx, cy); + let pointer = ffi::TCOD_bsp_find_node(self.bsp as *mut ffi::TCOD_bsp_t, cx, cy); if pointer.is_null() { None } else { Some(Bsp { bsp: &mut *pointer, - root: false + root: false, }) } } @@ -218,32 +230,38 @@ impl<'a> Bsp<'a> { /// assert_eq!(counter, 1); /// ``` pub fn traverse(&self, order: TraverseOrder, mut callback: F) -> bool - where F: FnMut(&mut Bsp) -> bool + where + F: FnMut(&mut Bsp) -> bool, { let cb: &mut dyn FnMut(&mut Bsp) -> bool = &mut callback; let retval = unsafe { let bsp = mem::transmute(self.bsp as *const ffi::TCOD_bsp_t); match order { - TraverseOrder::PreOrder => - ffi::TCOD_bsp_traverse_pre_order(bsp, - Some(callback_wrapper::), - cb as *mut _ as *mut c_void), - TraverseOrder::InOrder => - ffi::TCOD_bsp_traverse_in_order(bsp, - Some(callback_wrapper::), - cb as *mut _ as *mut c_void), - TraverseOrder::PostOrder => - ffi::TCOD_bsp_traverse_post_order(bsp, - Some(callback_wrapper::), - cb as *mut _ as *mut c_void), - TraverseOrder::LevelOrder => - ffi::TCOD_bsp_traverse_level_order(bsp, - Some(callback_wrapper::), - cb as *mut _ as *mut c_void), - TraverseOrder::InvertedLevelOrder => - ffi::TCOD_bsp_traverse_inverted_level_order(bsp, - Some(callback_wrapper::), - cb as *mut _ as *mut c_void), + TraverseOrder::PreOrder => ffi::TCOD_bsp_traverse_pre_order( + bsp, + Some(callback_wrapper::), + cb as *mut _ as *mut c_void, + ), + TraverseOrder::InOrder => ffi::TCOD_bsp_traverse_in_order( + bsp, + Some(callback_wrapper::), + cb as *mut _ as *mut c_void, + ), + TraverseOrder::PostOrder => ffi::TCOD_bsp_traverse_post_order( + bsp, + Some(callback_wrapper::), + cb as *mut _ as *mut c_void, + ), + TraverseOrder::LevelOrder => ffi::TCOD_bsp_traverse_level_order( + bsp, + Some(callback_wrapper::), + cb as *mut _ as *mut c_void, + ), + TraverseOrder::InvertedLevelOrder => ffi::TCOD_bsp_traverse_inverted_level_order( + bsp, + Some(callback_wrapper::), + cb as *mut _ as *mut c_void, + ), } }; retval @@ -302,7 +320,7 @@ mod test { #[test] fn split_recursive() { - let mut bsp = Bsp::new_with_size(0, 0, 100,100); + let mut bsp = Bsp::new_with_size(0, 0, 100, 100); let mut counter = 0; bsp.split_recursive(None, 2, 5, 5, 1.5, 1.5); @@ -372,7 +390,7 @@ mod test { #[test] fn traverse_orders() { - let mut root = Bsp::new_with_size(0, 0, 100,100); + let mut root = Bsp::new_with_size(0, 0, 100, 100); let mut counter = 0; root.split_recursive(None, 2, 5, 5, 1.5, 1.5); @@ -466,7 +484,7 @@ mod test { #[test] fn break_traverse() { - let mut bsp = Bsp::new_with_size(0, 0, 100,100); + let mut bsp = Bsp::new_with_size(0, 0, 100, 100); let mut counter = 0; bsp.split_recursive(None, 2, 5, 5, 1.5, 1.5); @@ -479,9 +497,9 @@ mod test { #[test] fn safe_tree_pointer() { - let mut bsp1 = Bsp::new_with_size(0, 0, 100,100); + let mut bsp1 = Bsp::new_with_size(0, 0, 100, 100); bsp1.split_recursive(None, 2, 5, 5, 1.5, 1.5); - let mut bsp2 = Bsp::new_with_size(0, 0, 100,100); + let mut bsp2 = Bsp::new_with_size(0, 0, 100, 100); bsp2.split_recursive(None, 2, 5, 5, 1.5, 1.5); assert!(bsp1.left().unwrap().tree.father != bsp2.left().unwrap().tree.father); assert!(bsp1.left().unwrap().tree.father == bsp1.right().unwrap().tree.father); diff --git a/src/colors.rs b/src/colors.rs index 581e5b7ff..3cbb682e6 100644 --- a/src/colors.rs +++ b/src/colors.rs @@ -1,5 +1,5 @@ -use std::ops::{Add, Sub, Div, Mul}; -use bindings::{AsNative, FromNative, ffi}; +use bindings::{ffi, AsNative, FromNative}; +use std::ops::{Add, Div, Mul, Sub}; #[repr(C)] #[derive(Copy, Clone, Debug, Default, PartialEq)] @@ -14,7 +14,7 @@ impl AsNative for Color { unsafe fn as_native(&self) -> &ffi::TCOD_color_t { ::std::mem::transmute(self) } - + unsafe fn as_native_mut(&mut self) -> &mut ffi::TCOD_color_t { ::std::mem::transmute(self) } @@ -33,214 +33,846 @@ impl Color { // We cannot return statics exported by the DLL here because they have a // different type (TCOD_color_t) and we cannot call `transmute` to convert // them to `Color`. - pub const BLACK: Color = Color{r: 0, g: 0, b: 0}; - pub const DARKEST_GREY: Color = Color{r: 31, g: 31, b: 31}; - pub const DARKER_GREY: Color = Color{r: 63, g: 63, b: 63}; - pub const DARK_GREY: Color = Color{r: 95, g: 95, b: 95}; - pub const GREY: Color = Color{r: 127, g: 127, b: 127}; - pub const LIGHT_GREY: Color = Color{r: 159, g: 159, b: 159}; - pub const LIGHTER_GREY: Color = Color{r: 191, g: 191, b: 191}; - pub const LIGHTEST_GREY: Color = Color{r: 223, g: 223, b: 223}; - pub const WHITE: Color = Color{r: 255, g: 255, b: 255}; - pub const DARKEST_SEPIA: Color = Color{r: 31, g: 24, b: 15}; - pub const DARKER_SEPIA: Color = Color{r: 63, g: 50, b: 31}; - pub const DARK_SEPIA: Color = Color{r: 94, g: 75, b: 47}; - pub const SEPIA: Color = Color{r: 127, g: 101, b: 63}; - pub const LIGHT_SEPIA: Color = Color{r: 158, g: 134, b: 100}; - pub const LIGHTER_SEPIA: Color = Color{r: 191, g: 171, b: 143}; - pub const LIGHTEST_SEPIA: Color = Color{r: 222, g: 211, b: 195}; - pub const DESATURATED_RED: Color = Color{r: 127, g: 63, b: 63}; - pub const DESATURATED_FLAME: Color = Color{r: 127, g: 79, b: 63}; - pub const DESATURATED_ORANGE: Color = Color{r: 127, g: 95, b: 63}; - pub const DESATURATED_AMBER: Color = Color{r: 127, g: 111, b: 63}; - pub const DESATURATED_YELLOW: Color = Color{r: 127, g: 127, b: 63}; - pub const DESATURATED_LIME: Color = Color{r: 111, g: 127, b: 63}; - pub const DESATURATED_CHARTREUSE: Color = Color{r: 95, g: 127, b: 63}; - pub const DESATURATED_GREEN: Color = Color{r: 63, g: 127, b: 63}; - pub const DESATURATED_SEA: Color = Color{r: 63, g: 127, b: 95}; - pub const DESATURATED_TURQUOISE: Color = Color{r: 63, g: 127, b: 111}; - pub const DESATURATED_CYAN: Color = Color{r: 63, g: 127, b: 127}; - pub const DESATURATED_SKY: Color = Color{r: 63, g: 111, b: 127}; - pub const DESATURATED_AZURE: Color = Color{r: 63, g: 95, b: 127}; - pub const DESATURATED_BLUE: Color = Color{r: 63, g: 63, b: 127}; - pub const DESATURATED_HAN: Color = Color{r: 79, g: 63, b: 127}; - pub const DESATURATED_VIOLET: Color = Color{r: 95, g: 63, b: 127}; - pub const DESATURATED_PURPLE: Color = Color{r: 111, g: 63, b: 127}; - pub const DESATURATED_FUCHSIA: Color = Color{r: 127, g: 63, b: 127}; - pub const DESATURATED_MAGENTA: Color = Color{r: 127, g: 63, b: 111}; - pub const DESATURATED_PINK: Color = Color{r: 127, g: 63, b: 95}; - pub const DESATURATED_CRIMSON: Color = Color{r: 127, g: 63, b: 79}; - pub const LIGHTEST_RED: Color = Color{r: 255, g: 191, b: 191}; - pub const LIGHTEST_FLAME: Color = Color{r: 255, g: 207, b: 191}; - pub const LIGHTEST_ORANGE: Color = Color{r: 255, g: 223, b: 191}; - pub const LIGHTEST_AMBER: Color = Color{r: 255, g: 239, b: 191}; - pub const LIGHTEST_YELLOW: Color = Color{r: 255, g: 255, b: 191}; - pub const LIGHTEST_LIME: Color = Color{r: 239, g: 255, b: 191}; - pub const LIGHTEST_CHARTREUSE: Color = Color{r: 223, g: 255, b: 191}; - pub const LIGHTEST_GREEN: Color = Color{r: 191, g: 255, b: 191}; - pub const LIGHTEST_SEA: Color = Color{r: 191, g: 255, b: 223}; - pub const LIGHTEST_TURQUOISE: Color = Color{r: 191, g: 255, b: 239}; - pub const LIGHTEST_CYAN: Color = Color{r: 191, g: 255, b: 255}; - pub const LIGHTEST_SKY: Color = Color{r: 191, g: 239, b: 255}; - pub const LIGHTEST_AZURE: Color = Color{r: 191, g: 223, b: 255}; - pub const LIGHTEST_BLUE: Color = Color{r: 191, g: 191, b: 255}; - pub const LIGHTEST_HAN: Color = Color{r: 207, g: 191, b: 255}; - pub const LIGHTEST_VIOLET: Color = Color{r: 223, g: 191, b: 255}; - pub const LIGHTEST_PURPLE: Color = Color{r: 239, g: 191, b: 255}; - pub const LIGHTEST_FUCHSIA: Color = Color{r: 255, g: 191, b: 255}; - pub const LIGHTEST_MAGENTA: Color = Color{r: 255, g: 191, b: 239}; - pub const LIGHTEST_PINK: Color = Color{r: 255, g: 191, b: 223}; - pub const LIGHTEST_CRIMSON: Color = Color{r: 255, g: 191, b: 207}; - pub const LIGHTER_RED: Color = Color{r: 255, g: 127, b: 127}; - pub const LIGHTER_FLAME: Color = Color{r: 255, g: 159, b: 127}; - pub const LIGHTER_ORANGE: Color = Color{r: 255, g: 191, b: 127}; - pub const LIGHTER_AMBER: Color = Color{r: 255, g: 223, b: 127}; - pub const LIGHTER_YELLOW: Color = Color{r: 255, g: 255, b: 127}; - pub const LIGHTER_LIME: Color = Color{r: 223, g: 255, b: 127}; - pub const LIGHTER_CHARTREUSE: Color = Color{r: 191, g: 255, b: 127}; - pub const LIGHTER_GREEN: Color = Color{r: 127, g: 255, b: 127}; - pub const LIGHTER_SEA: Color = Color{r: 127, g: 255, b: 191}; - pub const LIGHTER_TURQUOISE: Color = Color{r: 127, g: 255, b: 223}; - pub const LIGHTER_CYAN: Color = Color{r: 127, g: 255, b: 255}; - pub const LIGHTER_SKY: Color = Color{r: 127, g: 223, b: 255}; - pub const LIGHTER_AZURE: Color = Color{r: 127, g: 191, b: 255}; - pub const LIGHTER_BLUE: Color = Color{r: 127, g: 127, b: 255}; - pub const LIGHTER_HAN: Color = Color{r: 159, g: 127, b: 255}; - pub const LIGHTER_VIOLET: Color = Color{r: 191, g: 127, b: 255}; - pub const LIGHTER_PURPLE: Color = Color{r: 223, g: 127, b: 255}; - pub const LIGHTER_FUCHSIA: Color = Color{r: 255, g: 127, b: 255}; - pub const LIGHTER_MAGENTA: Color = Color{r: 255, g: 127, b: 223}; - pub const LIGHTER_PINK: Color = Color{r: 255, g: 127, b: 191}; - pub const LIGHTER_CRIMSON: Color = Color{r: 255, g: 127, b: 159}; - pub const LIGHT_RED: Color = Color{r: 255, g: 63, b: 63}; - pub const LIGHT_FLAME: Color = Color{r: 255, g: 111, b: 63}; - pub const LIGHT_ORANGE: Color = Color{r: 255, g: 159, b: 63}; - pub const LIGHT_AMBER: Color = Color{r: 255, g: 207, b: 63}; - pub const LIGHT_YELLOW: Color = Color{r: 255, g: 255, b: 63}; - pub const LIGHT_LIME: Color = Color{r: 207, g: 255, b: 63}; - pub const LIGHT_CHARTREUSE: Color = Color{r: 159, g: 255, b: 63}; - pub const LIGHT_GREEN: Color = Color{r: 63, g: 255, b: 63}; - pub const LIGHT_SEA: Color = Color{r: 63, g: 255, b: 159}; - pub const LIGHT_TURQUOISE: Color = Color{r: 63, g: 255, b: 207}; - pub const LIGHT_CYAN: Color = Color{r: 63, g: 255, b: 255}; - pub const LIGHT_SKY: Color = Color{r: 63, g: 207, b: 255}; - pub const LIGHT_AZURE: Color = Color{r: 63, g: 159, b: 255}; - pub const LIGHT_BLUE: Color = Color{r: 63, g: 63, b: 255}; - pub const LIGHT_HAN: Color = Color{r: 111, g: 63, b: 255}; - pub const LIGHT_VIOLET: Color = Color{r: 159, g: 63, b: 255}; - pub const LIGHT_PURPLE: Color = Color{r: 207, g: 63, b: 255}; - pub const LIGHT_FUCHSIA: Color = Color{r: 255, g: 63, b: 255}; - pub const LIGHT_MAGENTA: Color = Color{r: 255, g: 63, b: 207}; - pub const LIGHT_PINK: Color = Color{r: 255, g: 63, b: 159}; - pub const LIGHT_CRIMSON: Color = Color{r: 255, g: 63, b: 111}; - pub const RED: Color = Color{r: 255, g: 0, b: 0}; - pub const FLAME: Color = Color{r: 255, g: 63, b: 0}; - pub const ORANGE: Color = Color{r: 255, g: 127, b: 0}; - pub const AMBER: Color = Color{r: 255, g: 191, b: 0}; - pub const YELLOW: Color = Color{r: 255, g: 255, b: 0}; - pub const LIME: Color = Color{r: 191, g: 255, b: 0}; - pub const CHARTREUSE: Color = Color{r: 127, g: 255, b: 0}; - pub const GREEN: Color = Color{r: 0, g: 255, b: 0}; - pub const SEA: Color = Color{r: 0, g: 255, b: 127}; - pub const TURQUOISE: Color = Color{r: 0, g: 255, b: 191}; - pub const CYAN: Color = Color{r: 0, g: 255, b: 255}; - pub const SKY: Color = Color{r: 0, g: 191, b: 255}; - pub const AZURE: Color = Color{r: 0, g: 127, b: 255}; - pub const BLUE: Color = Color{r: 0, g: 0, b: 255}; - pub const HAN: Color = Color{r: 63, g: 0, b: 255}; - pub const VIOLET: Color = Color{r: 127, g: 0, b: 255}; - pub const PURPLE: Color = Color{r: 191, g: 0, b: 255}; - pub const FUCHSIA: Color = Color{r: 255, g: 0, b: 255}; - pub const MAGENTA: Color = Color{r: 255, g: 0, b: 191}; - pub const PINK: Color = Color{r: 255, g: 0, b: 127}; - pub const CRIMSON: Color = Color{r: 255, g: 0, b: 63}; - pub const DARK_RED: Color = Color{r: 191, g: 0, b: 0}; - pub const DARK_FLAME: Color = Color{r: 191, g: 47, b: 0}; - pub const DARK_ORANGE: Color = Color{r: 191, g: 95, b: 0}; - pub const DARK_AMBER: Color = Color{r: 191, g: 143, b: 0}; - pub const DARK_YELLOW: Color = Color{r: 191, g: 191, b: 0}; - pub const DARK_LIME: Color = Color{r: 143, g: 191, b: 0}; - pub const DARK_CHARTREUSE: Color = Color{r: 95, g: 191, b: 0}; - pub const DARK_GREEN: Color = Color{r: 0, g: 191, b: 0}; - pub const DARK_SEA: Color = Color{r: 0, g: 191, b: 95}; - pub const DARK_TURQUOISE: Color = Color{r: 0, g: 191, b: 143}; - pub const DARK_CYAN: Color = Color{r: 0, g: 191, b: 191}; - pub const DARK_SKY: Color = Color{r: 0, g: 143, b: 191}; - pub const DARK_AZURE: Color = Color{r: 0, g: 95, b: 191}; - pub const DARK_BLUE: Color = Color{r: 0, g: 0, b: 191}; - pub const DARK_HAN: Color = Color{r: 47, g: 0, b: 191}; - pub const DARK_VIOLET: Color = Color{r: 95, g: 0, b: 191}; - pub const DARK_PURPLE: Color = Color{r: 143, g: 0, b: 191}; - pub const DARK_FUCHSIA: Color = Color{r: 191, g: 0, b: 191}; - pub const DARK_MAGENTA: Color = Color{r: 191, g: 0, b: 143}; - pub const DARK_PINK: Color = Color{r: 191, g: 0, b: 95}; - pub const DARK_CRIMSON: Color = Color{r: 191, g: 0, b: 47}; - pub const DARKER_RED: Color = Color{r: 127, g: 0, b: 0}; - pub const DARKER_FLAME: Color = Color{r: 127, g: 31, b: 0}; - pub const DARKER_ORANGE: Color = Color{r: 127, g: 63, b: 0}; - pub const DARKER_AMBER: Color = Color{r: 127, g: 95, b: 0}; - pub const DARKER_YELLOW: Color = Color{r: 127, g: 127, b: 0}; - pub const DARKER_LIME: Color = Color{r: 95, g: 127, b: 0}; - pub const DARKER_CHARTREUSE: Color = Color{r: 63, g: 127, b: 0}; - pub const DARKER_GREEN: Color = Color{r: 0, g: 127, b: 0}; - pub const DARKER_SEA: Color = Color{r: 0, g: 127, b: 63}; - pub const DARKER_TURQUOISE: Color = Color{r: 0, g: 127, b: 95}; - pub const DARKER_CYAN: Color = Color{r: 0, g: 127, b: 127}; - pub const DARKER_SKY: Color = Color{r: 0, g: 95, b: 127}; - pub const DARKER_AZURE: Color = Color{r: 0, g: 63, b: 127}; - pub const DARKER_BLUE: Color = Color{r: 0, g: 0, b: 127}; - pub const DARKER_HAN: Color = Color{r: 31, g: 0, b: 127}; - pub const DARKER_VIOLET: Color = Color{r: 63, g: 0, b: 127}; - pub const DARKER_PURPLE: Color = Color{r: 95, g: 0, b: 127}; - pub const DARKER_FUCHSIA: Color = Color{r: 127, g: 0, b: 127}; - pub const DARKER_MAGENTA: Color = Color{r: 127, g: 0, b: 95}; - pub const DARKER_PINK: Color = Color{r: 127, g: 0, b: 63}; - pub const DARKER_CRIMSON: Color = Color{r: 127, g: 0, b: 31}; - pub const DARKEST_RED: Color = Color{r: 63, g: 0, b: 0}; - pub const DARKEST_FLAME: Color = Color{r: 63, g: 15, b: 0}; - pub const DARKEST_ORANGE: Color = Color{r: 63, g: 31, b: 0}; - pub const DARKEST_AMBER: Color = Color{r: 63, g: 47, b: 0}; - pub const DARKEST_YELLOW: Color = Color{r: 63, g: 63, b: 0}; - pub const DARKEST_LIME: Color = Color{r: 47, g: 63, b: 0}; - pub const DARKEST_CHARTREUSE: Color = Color{r: 31, g: 63, b: 0}; - pub const DARKEST_GREEN: Color = Color{r: 0, g: 63, b: 0}; - pub const DARKEST_SEA: Color = Color{r: 0, g: 63, b: 31}; - pub const DARKEST_TURQUOISE: Color = Color{r: 0, g: 63, b: 47}; - pub const DARKEST_CYAN: Color = Color{r: 0, g: 63, b: 63}; - pub const DARKEST_SKY: Color = Color{r: 0, g: 47, b: 63}; - pub const DARKEST_AZURE: Color = Color{r: 0, g: 31, b: 63}; - pub const DARKEST_BLUE: Color = Color{r: 0, g: 0, b: 63}; - pub const DARKEST_HAN: Color = Color{r: 15, g: 0, b: 63}; - pub const DARKEST_VIOLET: Color = Color{r: 31, g: 0, b: 63}; - pub const DARKEST_PURPLE: Color = Color{r: 47, g: 0, b: 63}; - pub const DARKEST_FUCHSIA: Color = Color{r: 63, g: 0, b: 63}; - pub const DARKEST_MAGENTA: Color = Color{r: 63, g: 0, b: 47}; - pub const DARKEST_PINK: Color = Color{r: 63, g: 0, b: 31}; - pub const DARKEST_CRIMSON: Color = Color{r: 63, g: 0, b: 15}; - pub const BRASS: Color = Color{r: 191, g: 151, b: 96}; - pub const COPPER: Color = Color{r: 197, g: 136, b: 124}; - pub const GOLD: Color = Color{r: 229, g: 191, b: 0}; - pub const SILVER: Color = Color{r: 203, g: 203, b: 203}; - pub const CELADON: Color = Color{r: 172, g: 255, b: 175}; - pub const PEACH: Color = Color{r: 255, g: 159, b: 127}; + pub const BLACK: Color = Color { r: 0, g: 0, b: 0 }; + pub const DARKEST_GREY: Color = Color { + r: 31, + g: 31, + b: 31, + }; + pub const DARKER_GREY: Color = Color { + r: 63, + g: 63, + b: 63, + }; + pub const DARK_GREY: Color = Color { + r: 95, + g: 95, + b: 95, + }; + pub const GREY: Color = Color { + r: 127, + g: 127, + b: 127, + }; + pub const LIGHT_GREY: Color = Color { + r: 159, + g: 159, + b: 159, + }; + pub const LIGHTER_GREY: Color = Color { + r: 191, + g: 191, + b: 191, + }; + pub const LIGHTEST_GREY: Color = Color { + r: 223, + g: 223, + b: 223, + }; + pub const WHITE: Color = Color { + r: 255, + g: 255, + b: 255, + }; + pub const DARKEST_SEPIA: Color = Color { + r: 31, + g: 24, + b: 15, + }; + pub const DARKER_SEPIA: Color = Color { + r: 63, + g: 50, + b: 31, + }; + pub const DARK_SEPIA: Color = Color { + r: 94, + g: 75, + b: 47, + }; + pub const SEPIA: Color = Color { + r: 127, + g: 101, + b: 63, + }; + pub const LIGHT_SEPIA: Color = Color { + r: 158, + g: 134, + b: 100, + }; + pub const LIGHTER_SEPIA: Color = Color { + r: 191, + g: 171, + b: 143, + }; + pub const LIGHTEST_SEPIA: Color = Color { + r: 222, + g: 211, + b: 195, + }; + pub const DESATURATED_RED: Color = Color { + r: 127, + g: 63, + b: 63, + }; + pub const DESATURATED_FLAME: Color = Color { + r: 127, + g: 79, + b: 63, + }; + pub const DESATURATED_ORANGE: Color = Color { + r: 127, + g: 95, + b: 63, + }; + pub const DESATURATED_AMBER: Color = Color { + r: 127, + g: 111, + b: 63, + }; + pub const DESATURATED_YELLOW: Color = Color { + r: 127, + g: 127, + b: 63, + }; + pub const DESATURATED_LIME: Color = Color { + r: 111, + g: 127, + b: 63, + }; + pub const DESATURATED_CHARTREUSE: Color = Color { + r: 95, + g: 127, + b: 63, + }; + pub const DESATURATED_GREEN: Color = Color { + r: 63, + g: 127, + b: 63, + }; + pub const DESATURATED_SEA: Color = Color { + r: 63, + g: 127, + b: 95, + }; + pub const DESATURATED_TURQUOISE: Color = Color { + r: 63, + g: 127, + b: 111, + }; + pub const DESATURATED_CYAN: Color = Color { + r: 63, + g: 127, + b: 127, + }; + pub const DESATURATED_SKY: Color = Color { + r: 63, + g: 111, + b: 127, + }; + pub const DESATURATED_AZURE: Color = Color { + r: 63, + g: 95, + b: 127, + }; + pub const DESATURATED_BLUE: Color = Color { + r: 63, + g: 63, + b: 127, + }; + pub const DESATURATED_HAN: Color = Color { + r: 79, + g: 63, + b: 127, + }; + pub const DESATURATED_VIOLET: Color = Color { + r: 95, + g: 63, + b: 127, + }; + pub const DESATURATED_PURPLE: Color = Color { + r: 111, + g: 63, + b: 127, + }; + pub const DESATURATED_FUCHSIA: Color = Color { + r: 127, + g: 63, + b: 127, + }; + pub const DESATURATED_MAGENTA: Color = Color { + r: 127, + g: 63, + b: 111, + }; + pub const DESATURATED_PINK: Color = Color { + r: 127, + g: 63, + b: 95, + }; + pub const DESATURATED_CRIMSON: Color = Color { + r: 127, + g: 63, + b: 79, + }; + pub const LIGHTEST_RED: Color = Color { + r: 255, + g: 191, + b: 191, + }; + pub const LIGHTEST_FLAME: Color = Color { + r: 255, + g: 207, + b: 191, + }; + pub const LIGHTEST_ORANGE: Color = Color { + r: 255, + g: 223, + b: 191, + }; + pub const LIGHTEST_AMBER: Color = Color { + r: 255, + g: 239, + b: 191, + }; + pub const LIGHTEST_YELLOW: Color = Color { + r: 255, + g: 255, + b: 191, + }; + pub const LIGHTEST_LIME: Color = Color { + r: 239, + g: 255, + b: 191, + }; + pub const LIGHTEST_CHARTREUSE: Color = Color { + r: 223, + g: 255, + b: 191, + }; + pub const LIGHTEST_GREEN: Color = Color { + r: 191, + g: 255, + b: 191, + }; + pub const LIGHTEST_SEA: Color = Color { + r: 191, + g: 255, + b: 223, + }; + pub const LIGHTEST_TURQUOISE: Color = Color { + r: 191, + g: 255, + b: 239, + }; + pub const LIGHTEST_CYAN: Color = Color { + r: 191, + g: 255, + b: 255, + }; + pub const LIGHTEST_SKY: Color = Color { + r: 191, + g: 239, + b: 255, + }; + pub const LIGHTEST_AZURE: Color = Color { + r: 191, + g: 223, + b: 255, + }; + pub const LIGHTEST_BLUE: Color = Color { + r: 191, + g: 191, + b: 255, + }; + pub const LIGHTEST_HAN: Color = Color { + r: 207, + g: 191, + b: 255, + }; + pub const LIGHTEST_VIOLET: Color = Color { + r: 223, + g: 191, + b: 255, + }; + pub const LIGHTEST_PURPLE: Color = Color { + r: 239, + g: 191, + b: 255, + }; + pub const LIGHTEST_FUCHSIA: Color = Color { + r: 255, + g: 191, + b: 255, + }; + pub const LIGHTEST_MAGENTA: Color = Color { + r: 255, + g: 191, + b: 239, + }; + pub const LIGHTEST_PINK: Color = Color { + r: 255, + g: 191, + b: 223, + }; + pub const LIGHTEST_CRIMSON: Color = Color { + r: 255, + g: 191, + b: 207, + }; + pub const LIGHTER_RED: Color = Color { + r: 255, + g: 127, + b: 127, + }; + pub const LIGHTER_FLAME: Color = Color { + r: 255, + g: 159, + b: 127, + }; + pub const LIGHTER_ORANGE: Color = Color { + r: 255, + g: 191, + b: 127, + }; + pub const LIGHTER_AMBER: Color = Color { + r: 255, + g: 223, + b: 127, + }; + pub const LIGHTER_YELLOW: Color = Color { + r: 255, + g: 255, + b: 127, + }; + pub const LIGHTER_LIME: Color = Color { + r: 223, + g: 255, + b: 127, + }; + pub const LIGHTER_CHARTREUSE: Color = Color { + r: 191, + g: 255, + b: 127, + }; + pub const LIGHTER_GREEN: Color = Color { + r: 127, + g: 255, + b: 127, + }; + pub const LIGHTER_SEA: Color = Color { + r: 127, + g: 255, + b: 191, + }; + pub const LIGHTER_TURQUOISE: Color = Color { + r: 127, + g: 255, + b: 223, + }; + pub const LIGHTER_CYAN: Color = Color { + r: 127, + g: 255, + b: 255, + }; + pub const LIGHTER_SKY: Color = Color { + r: 127, + g: 223, + b: 255, + }; + pub const LIGHTER_AZURE: Color = Color { + r: 127, + g: 191, + b: 255, + }; + pub const LIGHTER_BLUE: Color = Color { + r: 127, + g: 127, + b: 255, + }; + pub const LIGHTER_HAN: Color = Color { + r: 159, + g: 127, + b: 255, + }; + pub const LIGHTER_VIOLET: Color = Color { + r: 191, + g: 127, + b: 255, + }; + pub const LIGHTER_PURPLE: Color = Color { + r: 223, + g: 127, + b: 255, + }; + pub const LIGHTER_FUCHSIA: Color = Color { + r: 255, + g: 127, + b: 255, + }; + pub const LIGHTER_MAGENTA: Color = Color { + r: 255, + g: 127, + b: 223, + }; + pub const LIGHTER_PINK: Color = Color { + r: 255, + g: 127, + b: 191, + }; + pub const LIGHTER_CRIMSON: Color = Color { + r: 255, + g: 127, + b: 159, + }; + pub const LIGHT_RED: Color = Color { + r: 255, + g: 63, + b: 63, + }; + pub const LIGHT_FLAME: Color = Color { + r: 255, + g: 111, + b: 63, + }; + pub const LIGHT_ORANGE: Color = Color { + r: 255, + g: 159, + b: 63, + }; + pub const LIGHT_AMBER: Color = Color { + r: 255, + g: 207, + b: 63, + }; + pub const LIGHT_YELLOW: Color = Color { + r: 255, + g: 255, + b: 63, + }; + pub const LIGHT_LIME: Color = Color { + r: 207, + g: 255, + b: 63, + }; + pub const LIGHT_CHARTREUSE: Color = Color { + r: 159, + g: 255, + b: 63, + }; + pub const LIGHT_GREEN: Color = Color { + r: 63, + g: 255, + b: 63, + }; + pub const LIGHT_SEA: Color = Color { + r: 63, + g: 255, + b: 159, + }; + pub const LIGHT_TURQUOISE: Color = Color { + r: 63, + g: 255, + b: 207, + }; + pub const LIGHT_CYAN: Color = Color { + r: 63, + g: 255, + b: 255, + }; + pub const LIGHT_SKY: Color = Color { + r: 63, + g: 207, + b: 255, + }; + pub const LIGHT_AZURE: Color = Color { + r: 63, + g: 159, + b: 255, + }; + pub const LIGHT_BLUE: Color = Color { + r: 63, + g: 63, + b: 255, + }; + pub const LIGHT_HAN: Color = Color { + r: 111, + g: 63, + b: 255, + }; + pub const LIGHT_VIOLET: Color = Color { + r: 159, + g: 63, + b: 255, + }; + pub const LIGHT_PURPLE: Color = Color { + r: 207, + g: 63, + b: 255, + }; + pub const LIGHT_FUCHSIA: Color = Color { + r: 255, + g: 63, + b: 255, + }; + pub const LIGHT_MAGENTA: Color = Color { + r: 255, + g: 63, + b: 207, + }; + pub const LIGHT_PINK: Color = Color { + r: 255, + g: 63, + b: 159, + }; + pub const LIGHT_CRIMSON: Color = Color { + r: 255, + g: 63, + b: 111, + }; + pub const RED: Color = Color { r: 255, g: 0, b: 0 }; + pub const FLAME: Color = Color { + r: 255, + g: 63, + b: 0, + }; + pub const ORANGE: Color = Color { + r: 255, + g: 127, + b: 0, + }; + pub const AMBER: Color = Color { + r: 255, + g: 191, + b: 0, + }; + pub const YELLOW: Color = Color { + r: 255, + g: 255, + b: 0, + }; + pub const LIME: Color = Color { + r: 191, + g: 255, + b: 0, + }; + pub const CHARTREUSE: Color = Color { + r: 127, + g: 255, + b: 0, + }; + pub const GREEN: Color = Color { r: 0, g: 255, b: 0 }; + pub const SEA: Color = Color { + r: 0, + g: 255, + b: 127, + }; + pub const TURQUOISE: Color = Color { + r: 0, + g: 255, + b: 191, + }; + pub const CYAN: Color = Color { + r: 0, + g: 255, + b: 255, + }; + pub const SKY: Color = Color { + r: 0, + g: 191, + b: 255, + }; + pub const AZURE: Color = Color { + r: 0, + g: 127, + b: 255, + }; + pub const BLUE: Color = Color { r: 0, g: 0, b: 255 }; + pub const HAN: Color = Color { + r: 63, + g: 0, + b: 255, + }; + pub const VIOLET: Color = Color { + r: 127, + g: 0, + b: 255, + }; + pub const PURPLE: Color = Color { + r: 191, + g: 0, + b: 255, + }; + pub const FUCHSIA: Color = Color { + r: 255, + g: 0, + b: 255, + }; + pub const MAGENTA: Color = Color { + r: 255, + g: 0, + b: 191, + }; + pub const PINK: Color = Color { + r: 255, + g: 0, + b: 127, + }; + pub const CRIMSON: Color = Color { + r: 255, + g: 0, + b: 63, + }; + pub const DARK_RED: Color = Color { r: 191, g: 0, b: 0 }; + pub const DARK_FLAME: Color = Color { + r: 191, + g: 47, + b: 0, + }; + pub const DARK_ORANGE: Color = Color { + r: 191, + g: 95, + b: 0, + }; + pub const DARK_AMBER: Color = Color { + r: 191, + g: 143, + b: 0, + }; + pub const DARK_YELLOW: Color = Color { + r: 191, + g: 191, + b: 0, + }; + pub const DARK_LIME: Color = Color { + r: 143, + g: 191, + b: 0, + }; + pub const DARK_CHARTREUSE: Color = Color { + r: 95, + g: 191, + b: 0, + }; + pub const DARK_GREEN: Color = Color { r: 0, g: 191, b: 0 }; + pub const DARK_SEA: Color = Color { + r: 0, + g: 191, + b: 95, + }; + pub const DARK_TURQUOISE: Color = Color { + r: 0, + g: 191, + b: 143, + }; + pub const DARK_CYAN: Color = Color { + r: 0, + g: 191, + b: 191, + }; + pub const DARK_SKY: Color = Color { + r: 0, + g: 143, + b: 191, + }; + pub const DARK_AZURE: Color = Color { + r: 0, + g: 95, + b: 191, + }; + pub const DARK_BLUE: Color = Color { r: 0, g: 0, b: 191 }; + pub const DARK_HAN: Color = Color { + r: 47, + g: 0, + b: 191, + }; + pub const DARK_VIOLET: Color = Color { + r: 95, + g: 0, + b: 191, + }; + pub const DARK_PURPLE: Color = Color { + r: 143, + g: 0, + b: 191, + }; + pub const DARK_FUCHSIA: Color = Color { + r: 191, + g: 0, + b: 191, + }; + pub const DARK_MAGENTA: Color = Color { + r: 191, + g: 0, + b: 143, + }; + pub const DARK_PINK: Color = Color { + r: 191, + g: 0, + b: 95, + }; + pub const DARK_CRIMSON: Color = Color { + r: 191, + g: 0, + b: 47, + }; + pub const DARKER_RED: Color = Color { r: 127, g: 0, b: 0 }; + pub const DARKER_FLAME: Color = Color { + r: 127, + g: 31, + b: 0, + }; + pub const DARKER_ORANGE: Color = Color { + r: 127, + g: 63, + b: 0, + }; + pub const DARKER_AMBER: Color = Color { + r: 127, + g: 95, + b: 0, + }; + pub const DARKER_YELLOW: Color = Color { + r: 127, + g: 127, + b: 0, + }; + pub const DARKER_LIME: Color = Color { + r: 95, + g: 127, + b: 0, + }; + pub const DARKER_CHARTREUSE: Color = Color { + r: 63, + g: 127, + b: 0, + }; + pub const DARKER_GREEN: Color = Color { r: 0, g: 127, b: 0 }; + pub const DARKER_SEA: Color = Color { + r: 0, + g: 127, + b: 63, + }; + pub const DARKER_TURQUOISE: Color = Color { + r: 0, + g: 127, + b: 95, + }; + pub const DARKER_CYAN: Color = Color { + r: 0, + g: 127, + b: 127, + }; + pub const DARKER_SKY: Color = Color { + r: 0, + g: 95, + b: 127, + }; + pub const DARKER_AZURE: Color = Color { + r: 0, + g: 63, + b: 127, + }; + pub const DARKER_BLUE: Color = Color { r: 0, g: 0, b: 127 }; + pub const DARKER_HAN: Color = Color { + r: 31, + g: 0, + b: 127, + }; + pub const DARKER_VIOLET: Color = Color { + r: 63, + g: 0, + b: 127, + }; + pub const DARKER_PURPLE: Color = Color { + r: 95, + g: 0, + b: 127, + }; + pub const DARKER_FUCHSIA: Color = Color { + r: 127, + g: 0, + b: 127, + }; + pub const DARKER_MAGENTA: Color = Color { + r: 127, + g: 0, + b: 95, + }; + pub const DARKER_PINK: Color = Color { + r: 127, + g: 0, + b: 63, + }; + pub const DARKER_CRIMSON: Color = Color { + r: 127, + g: 0, + b: 31, + }; + pub const DARKEST_RED: Color = Color { r: 63, g: 0, b: 0 }; + pub const DARKEST_FLAME: Color = Color { r: 63, g: 15, b: 0 }; + pub const DARKEST_ORANGE: Color = Color { r: 63, g: 31, b: 0 }; + pub const DARKEST_AMBER: Color = Color { r: 63, g: 47, b: 0 }; + pub const DARKEST_YELLOW: Color = Color { r: 63, g: 63, b: 0 }; + pub const DARKEST_LIME: Color = Color { r: 47, g: 63, b: 0 }; + pub const DARKEST_CHARTREUSE: Color = Color { r: 31, g: 63, b: 0 }; + pub const DARKEST_GREEN: Color = Color { r: 0, g: 63, b: 0 }; + pub const DARKEST_SEA: Color = Color { r: 0, g: 63, b: 31 }; + pub const DARKEST_TURQUOISE: Color = Color { r: 0, g: 63, b: 47 }; + pub const DARKEST_CYAN: Color = Color { r: 0, g: 63, b: 63 }; + pub const DARKEST_SKY: Color = Color { r: 0, g: 47, b: 63 }; + pub const DARKEST_AZURE: Color = Color { r: 0, g: 31, b: 63 }; + pub const DARKEST_BLUE: Color = Color { r: 0, g: 0, b: 63 }; + pub const DARKEST_HAN: Color = Color { r: 15, g: 0, b: 63 }; + pub const DARKEST_VIOLET: Color = Color { r: 31, g: 0, b: 63 }; + pub const DARKEST_PURPLE: Color = Color { r: 47, g: 0, b: 63 }; + pub const DARKEST_FUCHSIA: Color = Color { r: 63, g: 0, b: 63 }; + pub const DARKEST_MAGENTA: Color = Color { r: 63, g: 0, b: 47 }; + pub const DARKEST_PINK: Color = Color { r: 63, g: 0, b: 31 }; + pub const DARKEST_CRIMSON: Color = Color { r: 63, g: 0, b: 15 }; + pub const BRASS: Color = Color { + r: 191, + g: 151, + b: 96, + }; + pub const COPPER: Color = Color { + r: 197, + g: 136, + b: 124, + }; + pub const GOLD: Color = Color { + r: 229, + g: 191, + b: 0, + }; + pub const SILVER: Color = Color { + r: 203, + g: 203, + b: 203, + }; + pub const CELADON: Color = Color { + r: 172, + g: 255, + b: 175, + }; + pub const PEACH: Color = Color { + r: 255, + g: 159, + b: 127, + }; pub const fn new(r: u8, g: u8, b: u8) -> Color { Color { r, g, b } } pub fn new_from_hsv(h: f32, s: f32, v: f32) -> Color { - unsafe { - FromNative::from_native(ffi::TCOD_color_HSV(h, s, v)) - } + unsafe { FromNative::from_native(ffi::TCOD_color_HSV(h, s, v)) } } pub fn hsv(self) -> (f32, f32, f32) { let mut h: f32 = 0.0; let mut s: f32 = 0.0; let mut v: f32 = 0.0; - unsafe { - ffi::TCOD_color_get_HSV(*self.as_native(), &mut h, &mut s, &mut v) - } + unsafe { ffi::TCOD_color_get_HSV(*self.as_native(), &mut h, &mut s, &mut v) } (h, s, v) } @@ -263,9 +895,11 @@ impl Color { pub fn lerp(from: Color, to: Color, coefficient: f32) -> Color { unsafe { - FromNative::from_native(ffi::TCOD_color_lerp(*from.as_native(), - *to.as_native(), - coefficient)) + FromNative::from_native(ffi::TCOD_color_lerp( + *from.as_native(), + *to.as_native(), + coefficient, + )) } } @@ -274,10 +908,7 @@ impl Add for Color { #[inline] fn add(self, rhs: Color) -> Color { - unsafe { - FromNative::from_native( - ffi::TCOD_color_add(*self.as_native(), *rhs.as_native())) - } + unsafe { FromNative::from_native(ffi::TCOD_color_add(*self.as_native(), *rhs.as_native())) } } } @@ -287,8 +918,10 @@ impl Sub for Color { #[inline] fn sub(self, rhs: Color) -> Color { unsafe { - FromNative::from_native( - ffi::TCOD_color_subtract(*self.as_native(), *rhs.as_native())) + FromNative::from_native(ffi::TCOD_color_subtract( + *self.as_native(), + *rhs.as_native(), + )) } } } @@ -299,8 +932,10 @@ impl Mul for Color { #[inline] fn mul(self, rhs: Color) -> Color { unsafe { - FromNative::from_native( - ffi::TCOD_color_multiply(*self.as_native(), *rhs.as_native())) + FromNative::from_native(ffi::TCOD_color_multiply( + *self.as_native(), + *rhs.as_native(), + )) } } } @@ -310,10 +945,7 @@ impl Mul for Color { #[inline] fn mul(self, rhs: f32) -> Color { - unsafe { - FromNative::from_native( - ffi::TCOD_color_multiply_scalar(*self.as_native(), rhs)) - } + unsafe { FromNative::from_native(ffi::TCOD_color_multiply_scalar(*self.as_native(), rhs)) } } } @@ -532,7 +1164,6 @@ pub const SILVER: Color = Color::SILVER; pub const CELADON: Color = Color::CELADON; pub const PEACH: Color = Color::PEACH; - #[cfg(all(feature = "serialization", test))] mod test_serialization { use colors::Color; @@ -540,13 +1171,13 @@ mod test_serialization { #[test] fn color_encode() { - let encoded = serde_json::to_string(&Color{r: 1, g: 2, b: 3}).unwrap(); + let encoded = serde_json::to_string(&Color { r: 1, g: 2, b: 3 }).unwrap(); assert_eq!("{\"r\":1,\"g\":2,\"b\":3}", encoded); } #[test] fn color_decode() { let decoded: Color = serde_json::from_str("{\"r\":1,\"g\":2,\"b\":3}").unwrap(); - assert_eq!(Color{r: 1, g: 2, b: 3}, decoded); + assert_eq!(Color { r: 1, g: 2, b: 3 }, decoded); } } diff --git a/src/console.rs b/src/console.rs index ee223e6da..e0aa72de8 100644 --- a/src/console.rs +++ b/src/console.rs @@ -60,8 +60,10 @@ use std::marker::PhantomData; use std::mem::transmute; use std::path::Path; -use bindings::ffi::{self, TCOD_bkgnd_flag_t, TCOD_renderer_t, TCOD_font_flags_t, TCOD_alignment_t}; -use bindings::{AsNative, FromNative, CString}; +use bindings::ffi::{ + self, TCOD_alignment_t, TCOD_bkgnd_flag_t, TCOD_font_flags_t, TCOD_renderer_t, +}; +use bindings::{AsNative, CString, FromNative}; use colors::Color; use input::{Key, KeyPressFlags}; @@ -122,10 +124,11 @@ impl Offscreen { pub fn new(width: i32, height: i32) -> Offscreen { assert!(width > 0 && height > 0); unsafe { - Offscreen { con: ffi::TCOD_console_new(width, height) } + Offscreen { + con: ffi::TCOD_console_new(width, height), + } } } - } // ! libtcod is not thread-safe, this may have some side effects but none have been seen yet @@ -186,16 +189,18 @@ unsafe impl Send for Offscreen {} /// ``` struct RootId { - id: ffi::TCOD_console_t + id: ffi::TCOD_console_t, } unsafe impl Sync for RootId {} -static ROOT_ID: RootId = RootId { id: 0 as ffi::TCOD_console_t }; +static ROOT_ID: RootId = RootId { + id: 0 as ffi::TCOD_console_t, +}; pub struct Root { // This is here to prevent the explicit creation of Root consoles. - _blocker: PhantomData + _blocker: PhantomData, } impl Root { @@ -217,15 +222,13 @@ impl Root { /// .init(); /// ``` /// - pub fn initializer<'a>() -> RootInitializer<'a> { + pub fn initializer<'a>() -> RootInitializer<'a> { RootInitializer::new() } /// Returns with true when the `Root` console is in fullscreen mode. pub fn is_fullscreen(&self) -> bool { - unsafe { - ffi::TCOD_console_is_fullscreen() - } + unsafe { ffi::TCOD_console_is_fullscreen() } } /// Toggles between windowed and fullscreen mode. @@ -237,32 +240,22 @@ impl Root { /// Returns true if the `Root` console is currently active. pub fn is_active(&self) -> bool { - unsafe { - ffi::TCOD_console_is_active() - } + unsafe { ffi::TCOD_console_is_active() } } /// Returns true if the `Root` console has focus. pub fn has_focus(&self) -> bool { - unsafe { - ffi::TCOD_console_has_mouse_focus() - } + unsafe { ffi::TCOD_console_has_mouse_focus() } } - /// Returns the current fade amount (previously set by `set_fade`). pub fn get_fade(&self) -> u8 { - unsafe { - ffi::TCOD_console_get_fade() - } + unsafe { ffi::TCOD_console_get_fade() } } /// Returns the current fade color (previously set by `set_fade`). pub fn get_fading_color(&self) -> Color { - unsafe { - FromNative::from_native( - ffi::TCOD_console_get_fading_color()) - } + unsafe { FromNative::from_native(ffi::TCOD_console_get_fading_color()) } } /// This function defines the fading parameters, allowing to easily fade the game screen to/from a color. @@ -278,9 +271,7 @@ impl Root { /// that represents the event. If `flush` is true, all pending keypresses are flushed from the /// keyboard buffer. If false, it returns the first element from it. pub fn wait_for_keypress(&mut self, flush: bool) -> Key { - let tcod_key = unsafe { - ffi::TCOD_console_wait_for_keypress(flush) - }; + let tcod_key = unsafe { ffi::TCOD_console_wait_for_keypress(flush) }; tcod_key.into() } @@ -288,9 +279,7 @@ impl Root { /// [KeyState](../input/struct.KeyState.html) representing the /// event if they have, or `None` if they have not. pub fn check_for_keypress(&self, status: KeyPressFlags) -> Option { - let tcod_key = unsafe { - ffi::TCOD_console_check_for_keypress(status.bits() as i32) - }; + let tcod_key = unsafe { ffi::TCOD_console_check_for_keypress(status.bits() as i32) }; if tcod_key.vk == ffi::TCOD_keycode_t::TCODK_NONE { return None; } @@ -299,9 +288,7 @@ impl Root { /// Returns with true if the `Root` console has been closed. pub fn window_closed(&self) -> bool { - unsafe { - ffi::TCOD_console_is_window_closed() - } + unsafe { ffi::TCOD_console_is_window_closed() } } /// Flushes the contents of the `Root` console onto the screen. @@ -312,7 +299,10 @@ impl Root { } /// Sets the main window's title to the string specified in the argument. - pub fn set_window_title(&mut self, title: T) where T: AsRef { + pub fn set_window_title(&mut self, title: T) + where + T: AsRef, + { unsafe { let c_title = CString::new(title.as_ref().as_bytes()).unwrap(); ffi::TCOD_console_set_window_title(c_title.as_ptr()); @@ -322,12 +312,11 @@ impl Root { /// Embeds libtcod credits in a console. /// Returns true when the credits screen is finished. - pub fn render_credits(&self, x : i32, y: i32, alpha: bool) -> bool { + pub fn render_credits(&self, x: i32, y: i32, alpha: bool) -> bool { unsafe { let result = ffi::TCOD_console_credits_render(x, y, alpha); result } - } /// Maps a single ASCII code to a character in a bitmap font. @@ -337,16 +326,9 @@ impl Root { /// * `ascii_code`: The ASCII code to map /// * `font_char_x/font_char_y`: The coordinate of the character in the /// bitmap font (in characters, not pixels) - pub fn map_ascii_code_to_font(&mut self, - ascii_code: i32, - font_char_x: i32, - font_char_y: i32) { + pub fn map_ascii_code_to_font(&mut self, ascii_code: i32, font_char_x: i32, font_char_y: i32) { unsafe { - ffi::TCOD_console_map_ascii_code_to_font( - ascii_code, - font_char_x, - font_char_y - ); + ffi::TCOD_console_map_ascii_code_to_font(ascii_code, font_char_x, font_char_y); } } @@ -359,17 +341,19 @@ impl Root { /// * `font_char_x/font_char_y`: The coordinate of the character in the /// bitmap font (in characters, not pixels) corresponding to the first ASCII /// code - pub fn map_ascii_codes_to_font(&mut self, - ascii_code: i32, - nb_codes: i32, - font_char_x: i32, - font_char_y: i32) { + pub fn map_ascii_codes_to_font( + &mut self, + ascii_code: i32, + nb_codes: i32, + font_char_x: i32, + font_char_y: i32, + ) { unsafe { ffi::TCOD_console_map_ascii_codes_to_font( ascii_code, nb_codes, font_char_x, - font_char_y + font_char_y, ); } } @@ -382,36 +366,37 @@ impl Root { /// * `font_char_x/font_char_y`: The coordinate of the character in the /// bitmap font (in characters, not pixels) corresponding to the first ASCII /// code in the string - pub fn map_string_to_font(&mut self, - s: &str, - font_char_x: i32, - font_char_y: i32) { + pub fn map_string_to_font(&mut self, s: &str, font_char_x: i32, font_char_y: i32) { unsafe { - let string = CString::new(s).ok().expect("Could not convert the given \ - string to a C string."); - ffi::TCOD_console_map_string_to_font( - string.as_ptr(), - font_char_x, - font_char_y + let string = CString::new(s).ok().expect( + "Could not convert the given \ + string to a C string.", ); + ffi::TCOD_console_map_string_to_font(string.as_ptr(), font_char_x, font_char_y); } } - fn set_custom_font(font_path: &Path, - font_layout: FontLayout, - font_type: FontType, - nb_char_horizontal: i32, - nb_char_vertical: i32) { + fn set_custom_font( + font_path: &Path, + font_layout: FontLayout, + font_type: FontType, + nb_char_horizontal: i32, + nb_char_vertical: i32, + ) { unsafe { let filename = font_path.to_str().expect("Invalid font path"); - let path = CString::new(filename).ok().expect("Font path could not be converted \ - to a C string"); + let path = CString::new(filename).ok().expect( + "Font path could not be converted \ + to a C string", + ); ffi::TCOD_console_set_custom_font( - path.as_ptr(), (font_layout as i32) | (font_type as i32), - nb_char_horizontal, nb_char_vertical); + path.as_ptr(), + (font_layout as i32) | (font_type as i32), + nb_char_horizontal, + nb_char_vertical, + ); } } - } /// Helper struct for the `Root` console initialization @@ -467,7 +452,7 @@ pub struct RootInitializer<'a> { font_layout: FontLayout, font_type: FontType, font_dimensions: (i32, i32), - console_renderer: Renderer + console_renderer: Renderer, } impl<'a> RootInitializer<'a> { @@ -481,7 +466,7 @@ impl<'a> RootInitializer<'a> { font_layout: FontLayout::AsciiInCol, font_type: FontType::Default, font_dimensions: (0, 0), - console_renderer: Renderer::SDL + console_renderer: Renderer::SDL, } } @@ -491,7 +476,10 @@ impl<'a> RootInitializer<'a> { self } - pub fn title(&mut self, title: T) -> &mut RootInitializer<'a> where T: AsRef + 'a { + pub fn title(&mut self, title: T) -> &mut RootInitializer<'a> + where + T: AsRef + 'a, + { assert!(title.as_ref().is_ascii()); self.title = Box::new(title); self @@ -502,7 +490,10 @@ impl<'a> RootInitializer<'a> { self } - pub fn font

(&mut self, path: P, font_layout: FontLayout) -> &mut RootInitializer<'a> where P: AsRef + 'a { + pub fn font

(&mut self, path: P, font_layout: FontLayout) -> &mut RootInitializer<'a> + where + P: AsRef + 'a, + { self.font_path = Box::new(path); self.font_layout = font_layout; self @@ -527,21 +518,28 @@ impl<'a> RootInitializer<'a> { assert!(self.width > 0 && self.height > 0); match self.font_dimensions { - (horizontal, vertical) => { - Root::set_custom_font((*self.font_path).as_ref(), - self.font_layout, self.font_type, - horizontal, vertical) - } + (horizontal, vertical) => Root::set_custom_font( + (*self.font_path).as_ref(), + self.font_layout, + self.font_type, + horizontal, + vertical, + ), } unsafe { let c_title = CString::new((*self.title).as_ref().as_bytes()).unwrap(); - ffi::TCOD_console_init_root(self.width, self.height, - c_title.as_ptr(), - self.is_fullscreen, - self.console_renderer.into()); + ffi::TCOD_console_init_root( + self.width, + self.height, + c_title.as_ptr(), + self.is_fullscreen, + self.console_renderer.into(), + ); + } + Root { + _blocker: PhantomData, } - Root { _blocker: PhantomData } } } @@ -617,7 +615,10 @@ impl AsciiLiteral for [u8; 32] {} impl<'a, T> AsciiLiteral for &'a T where T: AsciiLiteral {} -impl TcodString for T where T: AsRef<[u8]> + AsciiLiteral { +impl TcodString for T +where + T: AsRef<[u8]> + AsciiLiteral, +{ fn as_ascii(&self) -> Option<&[u8]> { Some(self.as_ref()) } @@ -652,14 +653,12 @@ fn to_wstring(text: &[u8]) -> Vec { /// root.print_ex(40, 19, BackgroundFlag::None, TextAlignment::Center, /// "Press any key to quit."); /// ``` -pub trait Console : AsNative { +pub trait Console: AsNative { /// Returns the default text alignment for the `Console` instance. For all the possible /// text alignment options, see the documentation for /// [TextAlignment](./enum.TextAlignment.html). fn get_alignment(&self) -> TextAlignment { - let alignment = unsafe { - ffi::TCOD_console_get_alignment(*self.as_native()) - }; + let alignment = unsafe { ffi::TCOD_console_get_alignment(*self.as_native()) }; unsafe { transmute(alignment) } } @@ -682,32 +681,26 @@ pub trait Console : AsNative { /// Returns the width of the console in characters. fn width(&self) -> i32 { - unsafe { - ffi::TCOD_console_get_width(*self.as_native()) - } + unsafe { ffi::TCOD_console_get_width(*self.as_native()) } } /// Returns the height of the console in characters. fn height(&self) -> i32 { - unsafe { - ffi::TCOD_console_get_height(*self.as_native()) - } + unsafe { ffi::TCOD_console_get_height(*self.as_native()) } } /// Return the console's default background color. This is used in /// several other methods, like: `clear`, `put_char`, etc. fn get_default_background(&mut self) -> Color { unsafe { - FromNative::from_native( - ffi::TCOD_console_get_default_background(*self.as_native())) + FromNative::from_native(ffi::TCOD_console_get_default_background(*self.as_native())) } } /// Return the console's default foreground color. fn get_default_foreground(&mut self) -> Color { unsafe { - FromNative::from_native( - ffi::TCOD_console_get_default_foreground(*self.as_native())) + FromNative::from_native(ffi::TCOD_console_get_default_foreground(*self.as_native())) } } @@ -729,25 +722,29 @@ pub trait Console : AsNative { /// Returns the background color of the cell at the specified coordinates. fn get_char_background(&self, x: i32, y: i32) -> Color { unsafe { - FromNative::from_native( - ffi::TCOD_console_get_char_background(*self.as_native(), x, y)) + FromNative::from_native(ffi::TCOD_console_get_char_background( + *self.as_native(), + x, + y, + )) } } /// Returns the foreground color of the cell at the specified coordinates. fn get_char_foreground(&self, x: i32, y: i32) -> Color { unsafe { - FromNative::from_native( - ffi::TCOD_console_get_char_foreground(*self.as_native(), x, y)) + FromNative::from_native(ffi::TCOD_console_get_char_foreground( + *self.as_native(), + x, + y, + )) } } /// Returns the console's current background flag. For a detailed explanation /// of the possible values, see [BackgroundFlag](./enum.BackgroundFlag.html). fn get_background_flag(&self) -> BackgroundFlag { - let flag = unsafe { - ffi::TCOD_console_get_background_flag(*self.as_native()) - }; + let flag = unsafe { ffi::TCOD_console_get_background_flag(*self.as_native()) }; unsafe { transmute(flag) } } @@ -755,16 +752,13 @@ pub trait Console : AsNative { /// of the possible values, see [BackgroundFlag](./enum.BackgroundFlag.html). fn set_background_flag(&mut self, background_flag: BackgroundFlag) { unsafe { - ffi::TCOD_console_set_background_flag(*self.as_native(), - background_flag.into()); + ffi::TCOD_console_set_background_flag(*self.as_native(), background_flag.into()); } } /// Returns the ASCII value of the cell located at `x, y` fn get_char(&self, x: i32, y: i32) -> char { - let ffi_char = unsafe { - ffi::TCOD_console_get_char(*self.as_native(), x, y) - }; + let ffi_char = unsafe { ffi::TCOD_console_get_char(*self.as_native(), x, y) }; assert!(ffi_char >= 0 && ffi_char < 256); ffi_char as u8 as char } @@ -772,21 +766,26 @@ pub trait Console : AsNative { /// Modifies the ASCII value of the cell located at `x, y`. fn set_char(&mut self, x: i32, y: i32, c: char) { assert!(x >= 0 && y >= 0); - unsafe { - ffi::TCOD_console_set_char(*self.as_native(), x, y, c as i32) - } + unsafe { ffi::TCOD_console_set_char(*self.as_native(), x, y, c as i32) } } /// Changes the background color of the specified cell - fn set_char_background(&mut self, x: i32, y: i32, - color: Color, - background_flag: BackgroundFlag) { + fn set_char_background( + &mut self, + x: i32, + y: i32, + color: Color, + background_flag: BackgroundFlag, + ) { assert!(x >= 0 && y >= 0); unsafe { - ffi::TCOD_console_set_char_background(*self.as_native(), - x, y, - *color.as_native(), - background_flag.into()) + ffi::TCOD_console_set_char_background( + *self.as_native(), + x, + y, + *color.as_native(), + background_flag.into(), + ) } } @@ -794,9 +793,7 @@ pub trait Console : AsNative { fn set_char_foreground(&mut self, x: i32, y: i32, color: Color) { assert!(x >= 0 && y >= 0); unsafe { - ffi::TCOD_console_set_char_foreground(*self.as_native(), - x, y, - *color.as_native()); + ffi::TCOD_console_set_char_foreground(*self.as_native(), x, y, *color.as_native()); } } @@ -806,28 +803,32 @@ pub trait Console : AsNative { /// see [BackgroundFlag](./enum.BackgroundFlag.html). /// 2. Updates its foreground color based on the default color set in the console /// 3. Sets its ASCII value to `glyph` - fn put_char(&mut self, - x: i32, y: i32, glyph: char, - background_flag: BackgroundFlag) { + fn put_char(&mut self, x: i32, y: i32, glyph: char, background_flag: BackgroundFlag) { assert!(x >= 0 && y >= 0); unsafe { - ffi::TCOD_console_put_char(*self.as_native(), - x, y, glyph as i32, - background_flag.into()); + ffi::TCOD_console_put_char( + *self.as_native(), + x, + y, + glyph as i32, + background_flag.into(), + ); } } /// Updates every propert of the given cell using explicit colors for the /// background and foreground. - fn put_char_ex(&mut self, - x: i32, y: i32, glyph: char, - foreground: Color, background: Color) { + fn put_char_ex(&mut self, x: i32, y: i32, glyph: char, foreground: Color, background: Color) { assert!(x >= 0 && y >= 0); unsafe { - ffi::TCOD_console_put_char_ex(*self.as_native(), - x, y, glyph as i32, - *foreground.as_native(), - *background.as_native()); + ffi::TCOD_console_put_char_ex( + *self.as_native(), + x, + y, + glyph as i32, + *foreground.as_native(), + *background.as_native(), + ); } } @@ -844,7 +845,11 @@ pub trait Console : AsNative { /// * `TextAlignment::Left`: leftmost character of the string /// * `TextAlignment::Center`: center character of the sting /// * `TextAlignment::Right`: rightmost character of the string - fn print(&mut self, x: i32, y: i32, text: T) where Self: Sized, T: AsRef<[u8]> + TcodString { + fn print(&mut self, x: i32, y: i32, text: T) + where + Self: Sized, + T: AsRef<[u8]> + TcodString, + { assert!(x >= 0 && y >= 0); if let Some(text) = text.as_ascii() { let c_text = CString::new(text).unwrap(); @@ -854,7 +859,12 @@ pub trait Console : AsNative { } else { let c_text = to_wstring(text.as_ref()); unsafe { - ffi::TCOD_console_print_utf(*self.as_native(), x, y, c_text.as_ptr() as *const ffi::wchar_t); + ffi::TCOD_console_print_utf( + *self.as_native(), + x, + y, + c_text.as_ptr() as *const ffi::wchar_t, + ); } } } @@ -862,20 +872,35 @@ pub trait Console : AsNative { /// Prints the text at the specified location in a rectangular area with /// the dimensions: (width; height). If the text is longer than the width the /// newlines will be inserted. - fn print_rect(&mut self, - x: i32, y: i32, - width: i32, height: i32, - text: T) where Self: Sized, T: AsRef<[u8]> + TcodString { + fn print_rect(&mut self, x: i32, y: i32, width: i32, height: i32, text: T) + where + Self: Sized, + T: AsRef<[u8]> + TcodString, + { assert!(x >= 0 && y >= 0); if let Some(text) = text.as_ascii() { let c_text = CString::new(text).unwrap(); unsafe { - ffi::TCOD_console_print_rect(*self.as_native(), x, y, width, height, c_text.as_ptr()); + ffi::TCOD_console_print_rect( + *self.as_native(), + x, + y, + width, + height, + c_text.as_ptr(), + ); } } else { let c_text = to_wstring(text.as_ref()); unsafe { - ffi::TCOD_console_print_rect_utf(*self.as_native(), x, y, width, height, c_text.as_ptr() as *const ffi::wchar_t); + ffi::TCOD_console_print_rect_utf( + *self.as_native(), + x, + y, + width, + height, + c_text.as_ptr() as *const ffi::wchar_t, + ); } } } @@ -883,86 +908,137 @@ pub trait Console : AsNative { /// Prints the text at the specified location with an explicit /// [BackgroundFlag](./enum.BackgroundFlag.html) and /// [TextAlignment](./enum.TextAlignment.html). - fn print_ex(&mut self, - x: i32, y: i32, - background_flag: BackgroundFlag, - alignment: TextAlignment, - text: T) where Self: Sized, T: AsRef<[u8]> + TcodString { + fn print_ex( + &mut self, + x: i32, + y: i32, + background_flag: BackgroundFlag, + alignment: TextAlignment, + text: T, + ) where + Self: Sized, + T: AsRef<[u8]> + TcodString, + { assert!(x >= 0 && y >= 0); if let Some(text) = text.as_ascii() { let c_text = CString::new(text).unwrap(); unsafe { - ffi::TCOD_console_print_ex(*self.as_native(), x, y, - background_flag.into(), - alignment.into(), - c_text.as_ptr()); + ffi::TCOD_console_print_ex( + *self.as_native(), + x, + y, + background_flag.into(), + alignment.into(), + c_text.as_ptr(), + ); } } else { let c_text = to_wstring(text.as_ref()); unsafe { - ffi::TCOD_console_print_ex_utf(*self.as_native(), x, y, - background_flag.into(), - alignment.into(), - c_text.as_ptr() as *const ffi::wchar_t); + ffi::TCOD_console_print_ex_utf( + *self.as_native(), + x, + y, + background_flag.into(), + alignment.into(), + c_text.as_ptr() as *const ffi::wchar_t, + ); } } } /// Combines the functions of `print_ex` and `print_rect` - fn print_rect_ex(&mut self, - x: i32, y: i32, - width: i32, height: i32, - background_flag: BackgroundFlag, - alignment: TextAlignment, - text: T) where Self: Sized, T: AsRef<[u8]> + TcodString { + fn print_rect_ex( + &mut self, + x: i32, + y: i32, + width: i32, + height: i32, + background_flag: BackgroundFlag, + alignment: TextAlignment, + text: T, + ) where + Self: Sized, + T: AsRef<[u8]> + TcodString, + { assert!(x >= 0 && y >= 0); if let Some(text) = text.as_ascii() { let c_text = CString::new(text).unwrap(); unsafe { - ffi::TCOD_console_print_rect_ex(*self.as_native(), x, y, width, height, - background_flag.into(), alignment.into(), - c_text.as_ptr()); + ffi::TCOD_console_print_rect_ex( + *self.as_native(), + x, + y, + width, + height, + background_flag.into(), + alignment.into(), + c_text.as_ptr(), + ); } } else { let c_text = to_wstring(text.as_ref()); unsafe { - ffi::TCOD_console_print_rect_ex_utf(*self.as_native(), x, y, width, height, - background_flag.into(), alignment.into(), - c_text.as_ptr() as *const ffi::wchar_t); + ffi::TCOD_console_print_rect_ex_utf( + *self.as_native(), + x, + y, + width, + height, + background_flag.into(), + alignment.into(), + c_text.as_ptr() as *const ffi::wchar_t, + ); } } } /// Compute the height of a wrapped text printed using `print_rect` or `print_rect_ex`. - fn get_height_rect(&self, - x: i32, y: i32, - width: i32, height: i32, - text: T) -> i32 where Self: Sized, T: AsRef<[u8]> + TcodString { + fn get_height_rect(&self, x: i32, y: i32, width: i32, height: i32, text: T) -> i32 + where + Self: Sized, + T: AsRef<[u8]> + TcodString, + { assert!(x >= 0 && y >= 0); if let Some(text) = text.as_ascii() { let c_text = CString::new(text).unwrap(); unsafe { - ffi::TCOD_console_get_height_rect(*self.as_native(), x, y, width, height, - c_text.as_ptr()) + ffi::TCOD_console_get_height_rect( + *self.as_native(), + x, + y, + width, + height, + c_text.as_ptr(), + ) } } else { let c_text = to_wstring(text.as_ref()); unsafe { - ffi::TCOD_console_get_height_rect_utf(*self.as_native(), x, y, width, height, - c_text.as_ptr() as *const ffi::wchar_t) + ffi::TCOD_console_get_height_rect_utf( + *self.as_native(), + x, + y, + width, + height, + c_text.as_ptr() as *const ffi::wchar_t, + ) } } } - /// Fill a rectangle with the default background colour. /// /// If `clear` is true, set each cell's character to space (ASCII 32). - fn rect(&mut self, - x: i32, y: i32, - width: i32, height: i32, - clear: bool, - background_flag: BackgroundFlag) { + fn rect( + &mut self, + x: i32, + y: i32, + width: i32, + height: i32, + clear: bool, + background_flag: BackgroundFlag, + ) { assert!(x >= 0); assert!(y >= 0); assert!(width >= 0); @@ -970,7 +1046,15 @@ pub trait Console : AsNative { assert!(x + width <= self.width()); assert!(y + height <= self.height()); unsafe { - ffi::TCOD_console_rect(*self.as_native(), x, y, width, height, clear, background_flag.into()); + ffi::TCOD_console_rect( + *self.as_native(), + x, + y, + width, + height, + clear, + background_flag.into(), + ); } } @@ -1006,8 +1090,19 @@ pub trait Console : AsNative { /// /// If the `title` is specified, it will be printed on top of the rectangle /// using inverted colours. - fn print_frame(&mut self, x: i32, y: i32, width: i32, height: i32, - clear: bool, background_flag: BackgroundFlag, title: Option) where Self: Sized, T: AsRef { + fn print_frame( + &mut self, + x: i32, + y: i32, + width: i32, + height: i32, + clear: bool, + background_flag: BackgroundFlag, + title: Option, + ) where + Self: Sized, + T: AsRef, + { assert!(x >= 0 && y >= 0 && width >= 0 && height >= 0); assert!(x + width <= self.width() && y + height <= self.height()); // NOTE: we need to run `CString::new` and `as_ptr` in two @@ -1015,17 +1110,24 @@ pub trait Console : AsNative { // would get dropped too early and we'd get a dangling // pointer. let title = title.map(|s| { - assert!(s.as_ref().is_ascii()); - CString::new(s.as_ref().as_bytes()).unwrap() + assert!(s.as_ref().is_ascii()); + CString::new(s.as_ref().as_bytes()).unwrap() }); // NOTE: `map_or` takes the option by value, which would cause // a premature drop again. The `as_ref` here prevents that // from happening. let c_title = title.as_ref().map_or(ptr::null(), |s| s.as_ptr()); unsafe { - ffi::TCOD_console_print_frame(*self.as_native(), x, y, width, height, - clear, background_flag.into(), - c_title); + ffi::TCOD_console_print_frame( + *self.as_native(), + x, + y, + width, + height, + clear, + background_flag.into(), + c_title, + ); } } } @@ -1074,23 +1176,33 @@ pub trait Console : AsNative { /// } /// /// ``` -pub fn blit(source_console: &T, - (source_x, source_y): (i32, i32), - (source_width, source_height): (i32, i32), - destination_console: &mut U, - (destination_x, destination_y): (i32, i32), - foreground_alpha: f32, background_alpha: f32) - where T: Console, - U: Console { - assert!(source_x >= 0 && source_y >= 0 && - source_width >= 0 && source_height >= 0); // If width or height is 0, the source width/height is used. +pub fn blit( + source_console: &T, + (source_x, source_y): (i32, i32), + (source_width, source_height): (i32, i32), + destination_console: &mut U, + (destination_x, destination_y): (i32, i32), + foreground_alpha: f32, + background_alpha: f32, +) where + T: Console, + U: Console, +{ + assert!(source_x >= 0 && source_y >= 0 && source_width >= 0 && source_height >= 0); // If width or height is 0, the source width/height is used. unsafe { - ffi::TCOD_console_blit(*source_console.as_native(), - source_x, source_y, source_width, source_height, - *destination_console.as_native(), - destination_x, destination_y, - foreground_alpha, background_alpha); + ffi::TCOD_console_blit( + *source_console.as_native(), + source_x, + source_y, + source_width, + source_height, + *destination_console.as_native(), + destination_x, + destination_y, + foreground_alpha, + background_alpha, + ); } } @@ -1102,7 +1214,7 @@ impl AsNative for Root { unsafe fn as_native(&self) -> &ffi::TCOD_console_t { &ROOT_ID.id } - + unsafe fn as_native_mut(&mut self) -> &mut ffi::TCOD_console_t { unimplemented!(); } @@ -1112,7 +1224,7 @@ impl AsNative for Offscreen { unsafe fn as_native(&self) -> &ffi::TCOD_console_t { &self.con } - + unsafe fn as_native_mut(&mut self) -> &mut ffi::TCOD_console_t { &mut self.con } @@ -1125,8 +1237,8 @@ impl Console for Offscreen {} #[repr(u32)] #[derive(Copy, Clone)] pub enum TextAlignment { - Left = ffi::TCOD_alignment_t::TCOD_LEFT as u32, - Right = ffi::TCOD_alignment_t::TCOD_RIGHT as u32, + Left = ffi::TCOD_alignment_t::TCOD_LEFT as u32, + Right = ffi::TCOD_alignment_t::TCOD_RIGHT as u32, Center = ffi::TCOD_alignment_t::TCOD_CENTER as u32, } native_enum_convert!(TextAlignment, TCOD_alignment_t); @@ -1151,7 +1263,7 @@ pub enum BackgroundFlag { Burn = ffi::TCOD_bkgnd_flag_t::TCOD_BKGND_BURN as u32, Overlay = ffi::TCOD_bkgnd_flag_t::TCOD_BKGND_OVERLAY as u32, Alph = ffi::TCOD_bkgnd_flag_t::TCOD_BKGND_ALPH as u32, - Default = ffi::TCOD_bkgnd_flag_t::TCOD_BKGND_DEFAULT as u32 + Default = ffi::TCOD_bkgnd_flag_t::TCOD_BKGND_DEFAULT as u32, } native_enum_convert!(BackgroundFlag, TCOD_bkgnd_flag_t); @@ -1159,9 +1271,9 @@ native_enum_convert!(BackgroundFlag, TCOD_bkgnd_flag_t); #[repr(u32)] #[derive(Copy, Clone)] pub enum Renderer { - GLSL = ffi::TCOD_renderer_t::TCOD_RENDERER_GLSL as u32, + GLSL = ffi::TCOD_renderer_t::TCOD_RENDERER_GLSL as u32, OpenGL = ffi::TCOD_renderer_t::TCOD_RENDERER_OPENGL as u32, - SDL = ffi::TCOD_renderer_t::TCOD_RENDERER_SDL as u32, + SDL = ffi::TCOD_renderer_t::TCOD_RENDERER_SDL as u32, } native_enum_convert!(Renderer, TCOD_renderer_t); @@ -1171,7 +1283,7 @@ native_enum_convert!(Renderer, TCOD_renderer_t); pub enum FontLayout { AsciiInCol = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_ASCII_INCOL as u32, AsciiInRow = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_ASCII_INROW as u32, - Tcod = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_TCOD as u32, + Tcod = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_TCOD as u32, } native_enum_convert!(FontLayout, TCOD_font_flags_t); @@ -1183,13 +1295,11 @@ pub enum FontType { } native_enum_convert!(FontType, TCOD_font_flags_t); - - #[cfg(test)] mod test { - use std::path::Path; - use super::Root; use super::FontLayout::AsciiInCol; + use super::Root; + use std::path::Path; #[test] fn test_custom_font_as_static_str() { @@ -1199,7 +1309,6 @@ mod test { #[test] fn test_custom_font_as_path() { Root::initializer().font(Path::new("terminal.png"), AsciiInCol); - } #[test] diff --git a/src/heightmap.rs b/src/heightmap.rs index cf544ff3c..92af16f2a 100644 --- a/src/heightmap.rs +++ b/src/heightmap.rs @@ -1,5 +1,5 @@ -use bindings::{ffi, c_int}; -use bindings::{AsNative}; +use bindings::AsNative; +use bindings::{c_int, ffi}; use noise::Noise; use random::Rng; use std::slice; diff --git a/src/image.rs b/src/image.rs index 157a2b919..9e6a47369 100644 --- a/src/image.rs +++ b/src/image.rs @@ -2,7 +2,7 @@ use std::io::{Error, ErrorKind}; use std::path::Path; use bindings::ffi; -use bindings::{AsNative, FromNative, CString}; +use bindings::{AsNative, CString, FromNative}; use colors::Color; use console::{BackgroundFlag, Console}; @@ -16,7 +16,7 @@ impl AsNative for Image { unsafe fn as_native(&self) -> &ffi::TCOD_image_t { &self.tcod_image } - + unsafe fn as_native_mut(&mut self) -> &mut ffi::TCOD_image_t { &mut self.tcod_image } @@ -26,7 +26,11 @@ impl FromNative for Image { unsafe fn from_native(image: ffi::TCOD_image_t) -> Image { let (width, height) = get_image_size(image); assert!(width != 0); - Image { tcod_image: image, width: width, height: height } + Image { + tcod_image: image, + width: width, + height: height, + } } } @@ -48,39 +52,54 @@ impl Image { } } - pub fn from_file(path: T) -> Result where T: AsRef { + pub fn from_file(path: T) -> Result + where + T: AsRef, + { let path_string = CString::new(path.as_ref().to_str().unwrap()).unwrap(); unsafe { let tcod_image = ffi::TCOD_image_load(path_string.as_ptr()); let (width, height) = get_image_size(tcod_image); if width == 0 { - Err(Error::new(ErrorKind::InvalidInput, "The provided image format is not supported by libtcod")) + Err(Error::new( + ErrorKind::InvalidInput, + "The provided image format is not supported by libtcod", + )) } else { - Ok(Image { tcod_image: tcod_image, width: width, height: height }) + Ok(Image { + tcod_image: tcod_image, + width: width, + height: height, + }) } } } - pub fn from_console(console: &T) -> Image where T: Console { + pub fn from_console(console: &T) -> Image + where + T: Console, + { unsafe { let tcod_image = ffi::TCOD_image_from_console(*console.as_native()); let (width, height) = get_image_size(tcod_image); Image { tcod_image: tcod_image, width: width, - height: height + height: height, } } } - pub fn refresh_console(&mut self, console: &T) where T: Console { + pub fn refresh_console(&mut self, console: &T) + where + T: Console, + { assert!( { let img = Image::from_console(console); self.width == img.width && self.height == img.height }, - "libtcod only supports console refreshing with consoles of equivalent sizes" ); @@ -89,7 +108,10 @@ impl Image { } } - pub fn save(&self, path: T) where T: AsRef { + pub fn save(&self, path: T) + where + T: AsRef, + { let path_string = CString::new(path.as_ref().to_str().unwrap()).unwrap(); unsafe { ffi::TCOD_image_save(self.tcod_image, path_string.as_ptr()); @@ -110,31 +132,36 @@ impl Image { pub fn get_pixel(&self, x: i32, y: i32) -> Color { assert!(x >= 0 && y >= 0 && x < self.width && y < self.height); - unsafe { - FromNative::from_native(ffi::TCOD_image_get_pixel(self.tcod_image, x, y)) - } + unsafe { FromNative::from_native(ffi::TCOD_image_get_pixel(self.tcod_image, x, y)) } } pub fn get_alpha(&self, x: i32, y: i32) -> i32 { assert!(x >= 0 && y >= 0 && x < self.width && y < self.height); - unsafe { - ffi::TCOD_image_get_alpha(self.tcod_image, x, y) - } + unsafe { ffi::TCOD_image_get_alpha(self.tcod_image, x, y) } } pub fn is_pixel_transparent(&self, x: i32, y: i32) -> bool { assert!(x >= 0 && y >= 0 && x < self.width && y < self.height); - unsafe { - ffi::TCOD_image_is_pixel_transparent(self.tcod_image, x, y) - } + unsafe { ffi::TCOD_image_is_pixel_transparent(self.tcod_image, x, y) } } pub fn get_mipmap_pixel(&self, (x0, y0): (f32, f32), (x1, y1): (f32, f32)) -> Color { - assert!(x0 >= 0.0 && y0 >= 0.0 && - x0 < x1 && y0 < y1 && - x1 < self.width as f32 && y1 < self.height as f32); + assert!( + x0 >= 0.0 + && y0 >= 0.0 + && x0 < x1 + && y0 < y1 + && x1 < self.width as f32 + && y1 < self.height as f32 + ); unsafe { - FromNative::from_native(ffi::TCOD_image_get_mipmap_pixel(self.tcod_image, x0, y0, x1, y1)) + FromNative::from_native(ffi::TCOD_image_get_mipmap_pixel( + self.tcod_image, + x0, + y0, + x1, + y1, + )) } } @@ -193,30 +220,78 @@ impl Image { } } -pub fn blit_rect(src: &Image, (width, height): (i32, i32), - dst: &mut T, (x, y): (i32, i32), flag: BackgroundFlag) where T: Console { +pub fn blit_rect( + src: &Image, + (width, height): (i32, i32), + dst: &mut T, + (x, y): (i32, i32), + flag: BackgroundFlag, +) where + T: Console, +{ assert!(width >= -1 && height >= -1 && width <= src.width && height <= src.height); assert!(x >= 0 && y >= 0 && x < dst.width() && y < dst.height()); unsafe { - ffi::TCOD_image_blit_rect(src.tcod_image, *dst.as_native(), x, y, width, height, flag.into()); + ffi::TCOD_image_blit_rect( + src.tcod_image, + *dst.as_native(), + x, + y, + width, + height, + flag.into(), + ); } } -pub fn blit(src: &Image, (scale_x, scale_y): (f32, f32), angle: f32, - dst: &mut T, (x, y): (f32, f32), flag: BackgroundFlag) where T: Console { +pub fn blit( + src: &Image, + (scale_x, scale_y): (f32, f32), + angle: f32, + dst: &mut T, + (x, y): (f32, f32), + flag: BackgroundFlag, +) where + T: Console, +{ assert!(scale_x > 0.0 && scale_y > 0.0); assert!(x >= 0.0 && y >= 0.0 && x < dst.width() as f32 && y < dst.height() as f32); unsafe { - ffi::TCOD_image_blit(src.tcod_image, *dst.as_native(), x, y, flag.into(), scale_x, scale_y, angle); + ffi::TCOD_image_blit( + src.tcod_image, + *dst.as_native(), + x, + y, + flag.into(), + scale_x, + scale_y, + angle, + ); } } -pub fn blit_2x(src: &Image, (src_x, src_y): (i32, i32), (width, height): (i32, i32), - dst: &mut T, (dst_x, dst_y): (i32, i32)) where T: Console { +pub fn blit_2x( + src: &Image, + (src_x, src_y): (i32, i32), + (width, height): (i32, i32), + dst: &mut T, + (dst_x, dst_y): (i32, i32), +) where + T: Console, +{ assert!(width >= -1 && height >= -1 && width <= src.width && height <= src.height); assert!(src_x >= 0 && src_y >= 0 && src_x < src.width && src_y < src.height); assert!(dst_x >= 0 && dst_y >= 0 && dst_x < dst.width() && dst_y < dst.height()); unsafe { - ffi::TCOD_image_blit_2x(src.tcod_image, *dst.as_native(), dst_x, dst_y, src_x, src_y, width, height); + ffi::TCOD_image_blit_2x( + src.tcod_image, + *dst.as_native(), + dst_x, + dst_y, + src_x, + src_y, + width, + height, + ); } } diff --git a/src/input.rs b/src/input.rs index d80b1cee4..20c4f7807 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1,8 +1,7 @@ use std::str; use bindings::ffi; -use bindings::{CStr, c_char, c_uint, keycode_from_native}; - +use bindings::{c_char, c_uint, keycode_from_native, CStr}; /// Deprecated. Use `tcod::input::Mouse` instead. pub type MouseState = Mouse; @@ -106,7 +105,9 @@ pub struct Key { impl Key { pub fn text(&self) -> &str { unsafe { - CStr::from_ptr(&self.text[0] as *const c_char).to_str().unwrap() + CStr::from_ptr(&self.text[0] as *const c_char) + .to_str() + .unwrap() } } } @@ -149,7 +150,6 @@ pub struct Mouse { pub wheel_down: bool, } - pub fn show_cursor(visible: bool) { unsafe { ffi::TCOD_mouse_show_cursor(visible); @@ -157,9 +157,7 @@ pub fn show_cursor(visible: bool) { } pub fn is_cursor_visible() -> bool { - unsafe { - ffi::TCOD_mouse_is_cursor_visible() - } + unsafe { ffi::TCOD_mouse_is_cursor_visible() } } pub fn move_cursor(x: i32, y: i32) { @@ -193,8 +191,11 @@ pub fn check_for_event(event_mask: EventFlags) -> Option<(EventFlags, Event)> { let mut c_mouse_state: ffi::TCOD_mouse_t = Default::default(); let event = unsafe { - ffi::TCOD_sys_check_for_event(event_mask.bits() as i32, - &mut c_key_state, &mut c_mouse_state) + ffi::TCOD_sys_check_for_event( + event_mask.bits() as i32, + &mut c_key_state, + &mut c_mouse_state, + ) }; let ret_flag = match event { @@ -205,37 +206,43 @@ pub fn check_for_event(event_mask: EventFlags) -> Option<(EventFlags, Event)> { ffi::TCOD_event_t::TCOD_EVENT_MOUSE_MOVE => EventFlags::MOUSE_MOVE, ffi::TCOD_event_t::TCOD_EVENT_MOUSE_PRESS => EventFlags::MOUSE_PRESS, ffi::TCOD_event_t::TCOD_EVENT_MOUSE_RELEASE => EventFlags::MOUSE_RELEASE, - _ => EventFlags::ANY + _ => EventFlags::ANY, }; if ret_flag == EventFlags::ANY { - return None + return None; } - let ret_event = if ret_flag.intersects(EventFlags::KEY_PRESS|EventFlags::KEY_RELEASE|EventFlags::KEY) { - Some(Event::Key(c_key_state.into())) - } else if ret_flag.intersects(EventFlags::MOUSE_MOVE|EventFlags::MOUSE_PRESS|EventFlags::MOUSE_RELEASE|EventFlags::MOUSE) { - Some(Event::Mouse(Mouse { - x: c_mouse_state.x as isize, - y: c_mouse_state.y as isize, - dx: c_mouse_state.dx as isize, - dy: c_mouse_state.dy as isize, - cx: c_mouse_state.cx as isize, - cy: c_mouse_state.cy as isize, - dcx: c_mouse_state.dcx as isize, - dcy: c_mouse_state.dcy as isize, - lbutton: c_mouse_state.lbutton, - rbutton: c_mouse_state.rbutton, - mbutton: c_mouse_state.mbutton, - lbutton_pressed: c_mouse_state.lbutton_pressed, - rbutton_pressed: c_mouse_state.rbutton_pressed, - mbutton_pressed: c_mouse_state.mbutton_pressed, - wheel_up: c_mouse_state.wheel_up, - wheel_down: c_mouse_state.wheel_down - })) - } else { - None - }; + let ret_event = + if ret_flag.intersects(EventFlags::KEY_PRESS | EventFlags::KEY_RELEASE | EventFlags::KEY) { + Some(Event::Key(c_key_state.into())) + } else if ret_flag.intersects( + EventFlags::MOUSE_MOVE + | EventFlags::MOUSE_PRESS + | EventFlags::MOUSE_RELEASE + | EventFlags::MOUSE, + ) { + Some(Event::Mouse(Mouse { + x: c_mouse_state.x as isize, + y: c_mouse_state.y as isize, + dx: c_mouse_state.dx as isize, + dy: c_mouse_state.dy as isize, + cx: c_mouse_state.cx as isize, + cy: c_mouse_state.cy as isize, + dcx: c_mouse_state.dcx as isize, + dcy: c_mouse_state.dcy as isize, + lbutton: c_mouse_state.lbutton, + rbutton: c_mouse_state.rbutton, + mbutton: c_mouse_state.mbutton, + lbutton_pressed: c_mouse_state.lbutton_pressed, + rbutton_pressed: c_mouse_state.rbutton_pressed, + mbutton_pressed: c_mouse_state.mbutton_pressed, + wheel_up: c_mouse_state.wheel_up, + wheel_down: c_mouse_state.wheel_down, + })) + } else { + None + }; ret_event.map(|event| (ret_flag, event)) } @@ -247,7 +254,7 @@ pub fn events() -> EventIterator { #[derive(Copy, Clone, Debug)] pub enum Event { Key(Key), - Mouse(Mouse) + Mouse(Mouse), } pub struct EventIterator; diff --git a/src/lib.rs b/src/lib.rs index 123ee50b2..d07d6c5a2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -40,21 +40,29 @@ //! * Compression utilities //! -#[macro_use] extern crate bitflags; -#[macro_use] extern crate lazy_static; -#[cfg(feature = "rustc-serialize")] extern crate rustc_serialize; -#[cfg(feature = "serialization")] extern crate serde; #[macro_use] -#[cfg(feature = "serialization")] extern crate serde_derive; +extern crate bitflags; +#[macro_use] +extern crate lazy_static; +#[cfg(feature = "rustc-serialize")] +extern crate rustc_serialize; +#[cfg(feature = "serialization")] +extern crate serde; +#[macro_use] +#[cfg(feature = "serialization")] +extern crate serde_derive; -#[cfg(test)] extern crate serde_json; +#[cfg(test)] +extern crate serde_json; #[macro_use] mod macros; pub use bindings::{AsNative, FromNative}; pub use colors::Color; -pub use console::{Console, RootInitializer, BackgroundFlag, Renderer, FontLayout, FontType, TextAlignment}; +pub use console::{ + BackgroundFlag, Console, FontLayout, FontType, Renderer, RootInitializer, TextAlignment, +}; pub use map::Map; pub mod bsp; diff --git a/src/line.rs b/src/line.rs index 7b83d1674..526412210 100644 --- a/src/line.rs +++ b/src/line.rs @@ -1,7 +1,7 @@ //! Port of line drawing toolkit. -use bindings::ffi; use bindings::c_int; +use bindings::ffi; /// tcod-rs uses libtcod's multithreaded line API, therefore more then one line /// can be created and drawn. The `Line` struct represents a line. @@ -14,9 +14,7 @@ impl Line { /// Creates a line from `start` to `end` (inclusive). pub fn new(start: (i32, i32), end: (i32, i32)) -> Self { let mut line: Line = Default::default(); - unsafe { - ffi::TCOD_line_init_mt(start.0, start.1, end.0, end.1, &mut line.tcod_line) - }; + unsafe { ffi::TCOD_line_init_mt(start.0, start.1, end.0, end.1, &mut line.tcod_line) }; line } @@ -34,7 +32,8 @@ impl Line { /// assert_eq!(Some((5, 5)), line.next()); /// ``` pub fn new_with_callback(start: (i32, i32), end: (i32, i32), callback: F) -> Self - where F: FnMut(i32, i32) -> bool + where + F: FnMut(i32, i32) -> bool, { let mut line: Line = Line::new(start, end); line.step_with_callback(callback); @@ -46,9 +45,7 @@ impl Line { pub fn step(&mut self) -> Option<(i32, i32)> { let mut x: c_int = 0; let mut y: c_int = 0; - let end = unsafe { - ffi::TCOD_line_step_mt(&mut x, &mut y, &mut self.tcod_line) - }; + let end = unsafe { ffi::TCOD_line_step_mt(&mut x, &mut y, &mut self.tcod_line) }; if !end { Some((x, y)) @@ -58,22 +55,21 @@ impl Line { } fn step_with_callback(&mut self, mut callback: F) -> bool - where F: FnMut(i32, i32) -> bool + where + F: FnMut(i32, i32) -> bool, { let mut x: c_int = self.tcod_line.origx; let mut y: c_int = self.tcod_line.origy; loop { - if !callback(x, y) { - return false + if !callback(x, y) { + return false; } - let step = unsafe { - ffi::TCOD_line_step_mt(&mut x, &mut y, &mut self.tcod_line) - }; + let step = unsafe { ffi::TCOD_line_step_mt(&mut x, &mut y, &mut self.tcod_line) }; if step { - break + break; } - } - true + } + true } } diff --git a/src/macros.rs b/src/macros.rs index e088b2f31..cb044df2e 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -2,10 +2,8 @@ macro_rules! native_enum_convert { ($From: ident, $To: ident) => { impl From<$From> for $To { fn from(other: $From) -> $To { - unsafe { - ::std::mem::transmute::<$From, $To>(other) - } + unsafe { ::std::mem::transmute::<$From, $To>(other) } } } }; -} \ No newline at end of file +} diff --git a/src/map.rs b/src/map.rs index 207a3898c..02d7c2378 100644 --- a/src/map.rs +++ b/src/map.rs @@ -9,7 +9,7 @@ impl AsNative for Map { unsafe fn as_native(&self) -> &ffi::TCOD_map_t { &self.tcod_map } - + unsafe fn as_native_mut(&mut self) -> &mut ffi::TCOD_map_t { &mut self.tcod_map } @@ -19,14 +19,18 @@ impl Map { pub fn new(width: i32, height: i32) -> Map { assert!(width > 0 && height > 0); unsafe { - Map{tcod_map: ffi::TCOD_map_new(width, height)} + Map { + tcod_map: ffi::TCOD_map_new(width, height), + } } } pub fn size(&self) -> (i32, i32) { unsafe { - (ffi::TCOD_map_get_width(self.tcod_map), - ffi::TCOD_map_get_height(self.tcod_map)) + ( + ffi::TCOD_map_get_width(self.tcod_map), + ffi::TCOD_map_get_height(self.tcod_map), + ) } } @@ -35,19 +39,28 @@ impl Map { let (width, height) = self.size(); assert!(x < width && y < height); unsafe { - ffi::TCOD_map_set_properties(self.tcod_map, x, y, - transparent, - walkable); + ffi::TCOD_map_set_properties(self.tcod_map, x, y, transparent, walkable); } } - pub fn compute_fov(&mut self, origin_x: i32, origin_y: i32, max_radius: i32, - light_walls: bool, algo: FovAlgorithm) { + pub fn compute_fov( + &mut self, + origin_x: i32, + origin_y: i32, + max_radius: i32, + light_walls: bool, + algo: FovAlgorithm, + ) { assert!(origin_x >= 0 && origin_y >= 0); unsafe { - ffi::TCOD_map_compute_fov(self.tcod_map, origin_x, origin_y, max_radius, - light_walls, - algo.into()); + ffi::TCOD_map_compute_fov( + self.tcod_map, + origin_x, + origin_y, + max_radius, + light_walls, + algo.into(), + ); } } @@ -55,23 +68,19 @@ impl Map { assert!(x >= 0 && y >= 0); let (width, height) = self.size(); assert!(x < width && y < height); - unsafe { - ffi::TCOD_map_is_in_fov(self.tcod_map, x, y) - } + unsafe { ffi::TCOD_map_is_in_fov(self.tcod_map, x, y) } } pub fn is_walkable(&self, x: i32, y: i32) -> bool { assert!(x >= 0 && y >= 0); let (width, height) = self.size(); assert!(x < width && y < height); - unsafe { - ffi::TCOD_map_is_walkable(self.tcod_map, x, y) - } + unsafe { ffi::TCOD_map_is_walkable(self.tcod_map, x, y) } } - + pub fn clear(&mut self, transparent: bool, walkable: bool) { unsafe { - ffi::TCOD_map_clear(self.tcod_map, transparent, walkable ); + ffi::TCOD_map_clear(self.tcod_map, transparent, walkable); } } } @@ -91,9 +100,7 @@ impl Clone for Map { impl Drop for Map { fn drop(&mut self) { - unsafe { - ffi::TCOD_map_delete(self.tcod_map) - } + unsafe { ffi::TCOD_map_delete(self.tcod_map) } } } @@ -104,9 +111,9 @@ unsafe impl Send for Map {} #[repr(u32)] #[derive(Copy, Clone, Debug)] pub enum FovAlgorithm { - Basic = ffi::TCOD_fov_algorithm_t::FOV_BASIC as u32, - Diamond = ffi::TCOD_fov_algorithm_t::FOV_DIAMOND as u32, - Shadow = ffi::TCOD_fov_algorithm_t::FOV_SHADOW as u32, + Basic = ffi::TCOD_fov_algorithm_t::FOV_BASIC as u32, + Diamond = ffi::TCOD_fov_algorithm_t::FOV_DIAMOND as u32, + Shadow = ffi::TCOD_fov_algorithm_t::FOV_SHADOW as u32, Permissive0 = ffi::TCOD_fov_algorithm_t::FOV_PERMISSIVE_0 as u32, Permissive1 = ffi::TCOD_fov_algorithm_t::FOV_PERMISSIVE_1 as u32, Permissive2 = ffi::TCOD_fov_algorithm_t::FOV_PERMISSIVE_2 as u32, diff --git a/src/namegen.rs b/src/namegen.rs index 29178647b..94042ac68 100644 --- a/src/namegen.rs +++ b/src/namegen.rs @@ -1,11 +1,11 @@ -use std::ptr; -use std::str; use std::ffi::{CStr, CString}; use std::path::Path; +use std::ptr; +use std::str; use std::sync::Mutex; use bindings::ffi; -use bindings::{AsNative, c_char}; +use bindings::{c_char, AsNative}; use random::Rng; static mut NAMEGEN_FREE: bool = true; @@ -20,7 +20,8 @@ pub struct Namegen { impl Drop for Namegen { fn drop(&mut self) { unsafe { - let _lock = NAMEGEN_MUTEX.lock() + let _lock = NAMEGEN_MUTEX + .lock() .ok() .expect("Namegen mutex could not be locked"); if self.rng.is_empty() { @@ -36,22 +37,29 @@ impl Namegen { unsafe { match NAMEGEN_FREE { true => { - let _lock = NAMEGEN_MUTEX.lock() + let _lock = NAMEGEN_MUTEX + .lock() .ok() .expect("Namegen mutex could not be locked"); NAMEGEN_FREE = false; Some(Namegen { rng: Vec::new() }) - }, - false => None + } + false => None, } } } - pub fn parse(&mut self, path: T) where T: AsRef { + pub fn parse(&mut self, path: T) + where + T: AsRef, + { self.parse_with_rng(path, &Rng::get_instance()) } - pub fn parse_with_rng(&mut self, path: T, rng: &Rng) where T: AsRef { + pub fn parse_with_rng(&mut self, path: T, rng: &Rng) + where + T: AsRef, + { self.rng.push(rng.save()); let path_string = CString::new(path.as_ref().to_str().unwrap()).unwrap(); @@ -60,7 +68,10 @@ impl Namegen { } } - pub fn generate(&self, name: T) -> Option where T: AsRef { + pub fn generate(&self, name: T) -> Option + where + T: AsRef, + { unsafe { let name_string = CString::new(name.as_ref()).unwrap(); let borrowed = ffi::TCOD_namegen_generate(name_string.as_ptr() as *mut _, false); @@ -68,13 +79,20 @@ impl Namegen { } } - pub fn generate_custom(&self, name: T, rule: U) -> Option where T: AsRef, U: AsRef { + pub fn generate_custom(&self, name: T, rule: U) -> Option + where + T: AsRef, + U: AsRef, + { unsafe { let name_string = CString::new(name.as_ref()).unwrap(); let rule_string = CString::new(rule.as_ref()).unwrap(); - let borrowed = ffi::TCOD_namegen_generate_custom(name_string.as_ptr() as *mut _, - rule_string.as_ptr() as *mut _, false); + let borrowed = ffi::TCOD_namegen_generate_custom( + name_string.as_ptr() as *mut _, + rule_string.as_ptr() as *mut _, + false, + ); cstr_to_owned(borrowed) } } @@ -100,8 +118,6 @@ fn cstr_to_owned(string: *mut c_char) -> Option { unsafe { let string = CStr::from_ptr(string); - str::from_utf8(string.to_bytes()) - .map(|x| x.to_owned()) - .ok() + str::from_utf8(string.to_bytes()).map(|x| x.to_owned()).ok() } } diff --git a/src/noise.rs b/src/noise.rs index 828169df5..1f369819f 100644 --- a/src/noise.rs +++ b/src/noise.rs @@ -12,18 +12,17 @@ use random::Rng; #[derive(Copy, Clone, PartialEq, Eq, Debug)] pub enum NoiseType { Default = ffi::TCOD_noise_type_t::TCOD_NOISE_DEFAULT as u32, - Perlin = ffi::TCOD_noise_type_t::TCOD_NOISE_PERLIN as u32, + Perlin = ffi::TCOD_noise_type_t::TCOD_NOISE_PERLIN as u32, Simplex = ffi::TCOD_noise_type_t::TCOD_NOISE_SIMPLEX as u32, Wavelet = ffi::TCOD_noise_type_t::TCOD_NOISE_WAVELET as u32, } native_enum_convert!(NoiseType, TCOD_noise_type_t); - /// Noise object encapsulates a noise generator. #[derive(Debug)] pub struct Noise { noise: ffi::TCOD_noise_t, - dimensions: u32 + dimensions: u32, } impl AsNative for Noise { @@ -53,24 +52,18 @@ impl Noise { } pub fn set_type(&self, noise_type: NoiseType) { - unsafe { - ffi::TCOD_noise_set_type(self.noise, noise_type.into()) - } + unsafe { ffi::TCOD_noise_set_type(self.noise, noise_type.into()) } } pub fn get>(&self, mut coords: T) -> f32 { assert!(self.dimensions as usize == coords.as_mut().len()); - unsafe { - ffi::TCOD_noise_get(self.noise, coords.as_mut().as_mut_ptr()) - } + unsafe { ffi::TCOD_noise_get(self.noise, coords.as_mut().as_mut_ptr()) } } pub fn get_ex>(&self, mut coords: T, noise_type: NoiseType) -> f32 { assert!(self.dimensions as usize == coords.as_mut().len()); unsafe { - ffi::TCOD_noise_get_ex(self.noise, - coords.as_mut().as_mut_ptr(), - noise_type.into()) + ffi::TCOD_noise_get_ex(self.noise, coords.as_mut().as_mut_ptr(), noise_type.into()) } } @@ -78,20 +71,25 @@ impl Noise { assert!(self.dimensions as usize == coords.as_mut().len()); assert!(octaves > 0); assert!(octaves < MAX_OCTAVES); - unsafe { - ffi::TCOD_noise_get_fbm(self.noise, coords.as_mut().as_mut_ptr(), octaves as f32) - } + unsafe { ffi::TCOD_noise_get_fbm(self.noise, coords.as_mut().as_mut_ptr(), octaves as f32) } } - pub fn get_fbm_ex>(&self, mut coords: T, octaves: u32, noise_type: NoiseType) -> f32 { + pub fn get_fbm_ex>( + &self, + mut coords: T, + octaves: u32, + noise_type: NoiseType, + ) -> f32 { assert!(self.dimensions as usize == coords.as_mut().len()); assert!(octaves > 0); assert!(octaves < MAX_OCTAVES); unsafe { - ffi::TCOD_noise_get_fbm_ex(self.noise, - coords.as_mut().as_mut_ptr(), - octaves as f32, - noise_type.into()) + ffi::TCOD_noise_get_fbm_ex( + self.noise, + coords.as_mut().as_mut_ptr(), + octaves as f32, + noise_type.into(), + ) } } @@ -100,21 +98,26 @@ impl Noise { assert!(octaves > 0); assert!(octaves < MAX_OCTAVES); unsafe { - ffi::TCOD_noise_get_turbulence(self.noise, - coords.as_mut().as_mut_ptr(), - octaves as f32) + ffi::TCOD_noise_get_turbulence(self.noise, coords.as_mut().as_mut_ptr(), octaves as f32) } } - pub fn get_turbulence_ex>(&self, mut coords: T, octaves: u32, noise_type: NoiseType) -> f32 { + pub fn get_turbulence_ex>( + &self, + mut coords: T, + octaves: u32, + noise_type: NoiseType, + ) -> f32 { assert!(self.dimensions as usize == coords.as_mut().len()); assert!(octaves > 0); assert!(octaves < MAX_OCTAVES); unsafe { - ffi::TCOD_noise_get_turbulence_ex(self.noise, - coords.as_mut().as_mut_ptr(), - octaves as f32, - noise_type.into()) + ffi::TCOD_noise_get_turbulence_ex( + self.noise, + coords.as_mut().as_mut_ptr(), + octaves as f32, + noise_type.into(), + ) } } } @@ -131,7 +134,7 @@ pub struct NoiseInitializer { hurst: f32, lacunarity: f32, noise_type: NoiseType, - random: Rng + random: Rng, } impl NoiseInitializer { @@ -142,7 +145,7 @@ impl NoiseInitializer { hurst: DEFAULT_HURST, lacunarity: DEFAULT_LACUNARITY, noise_type: NoiseType::Default, - random: Rng::get_instance() + random: Rng::get_instance(), } } @@ -175,8 +178,12 @@ impl NoiseInitializer { pub fn init(&self) -> Noise { unsafe { let noise = Noise { - noise: ffi::TCOD_noise_new(self.dimensions as i32, self.hurst, - self.lacunarity, *self.random.as_native()), + noise: ffi::TCOD_noise_new( + self.dimensions as i32, + self.hurst, + self.lacunarity, + *self.random.as_native(), + ), dimensions: self.dimensions, }; ffi::TCOD_noise_set_type(noise.noise, self.noise_type.into()); @@ -196,17 +203,17 @@ mod test { let noise2d = Noise::init_with_dimensions(2).init(); let noise3d = Noise::init_with_dimensions(3).init(); - let val1 = noise1d.get([1.0]); + let val1 = noise1d.get([1.0]); let val1a = noise1d.get([1.0]); assert!(val1 >= -1.0 && val1 <= 1.0); assert_eq!(val1, val1a); - let val2 = noise2d.get([1.0, 2.0]); + let val2 = noise2d.get([1.0, 2.0]); let val2a = noise2d.get([1.0, 2.0]); assert!(val2 >= -1.0 && val2 <= 1.0); assert_eq!(val2, val2a); - let val3 = noise3d.get([1.0, 2.0, 3.0]); + let val3 = noise3d.get([1.0, 2.0, 3.0]); let val3a = noise3d.get([1.0, 2.0, 3.0]); assert!(val3 >= -1.0 && val3 <= 1.0); assert_eq!(val3, val3a); @@ -242,12 +249,12 @@ mod test { fn get_ex() { let noise2d = Noise::init_with_dimensions(2).init(); - let val1 = noise2d.get_ex([1.0, 2.0], NoiseType::Perlin); + let val1 = noise2d.get_ex([1.0, 2.0], NoiseType::Perlin); let val1a = noise2d.get_ex([1.0, 2.0], NoiseType::Perlin); assert!(val1 >= -1.0 && val1 <= 1.0); assert_eq!(val1, val1a); - let val2 = noise2d.get_ex([1.0, 2.0], NoiseType::Wavelet); + let val2 = noise2d.get_ex([1.0, 2.0], NoiseType::Wavelet); let val2a = noise2d.get_ex([1.0, 2.0], NoiseType::Wavelet); assert!(val2 >= -1.0 && val2 <= 1.0); assert_eq!(val2, val2a); @@ -273,21 +280,21 @@ mod test { let noise2d = Noise::init_with_dimensions(2).init(); let noise3d = Noise::init_with_dimensions(3).init(); - let val1 = noise1d.get_fbm([1.0], 32); + let val1 = noise1d.get_fbm([1.0], 32); let val1a = noise1d.get_fbm([1.0], 32); assert!(val1.is_nan() || val1 >= -1.0 && val1 <= 1.0); if !val1.is_nan() { assert_eq!(val1, val1a); } - let val2 = noise2d.get_fbm([1.0, 2.0], 32); + let val2 = noise2d.get_fbm([1.0, 2.0], 32); let val2a = noise2d.get_fbm([1.0, 2.0], 32); assert!(val2.is_nan() || val2 >= -1.0 && val2 <= 1.0); if !val2.is_nan() { assert_eq!(val2, val2a); } - let val3 = noise3d.get_fbm([1.0, 2.0, 3.0], 32); + let val3 = noise3d.get_fbm([1.0, 2.0, 3.0], 32); let val3a = noise3d.get_fbm([1.0, 2.0, 3.0], 32); assert!(val3.is_nan() || val3 >= -1.0 && val3 <= 1.0); if !val3.is_nan() { @@ -327,14 +334,14 @@ mod test { fn get_fbm_ex() { let noise2d = Noise::init_with_dimensions(2).init(); - let val1 = noise2d.get_fbm_ex([1.0, 2.0], 32, NoiseType::Perlin); + let val1 = noise2d.get_fbm_ex([1.0, 2.0], 32, NoiseType::Perlin); let val1a = noise2d.get_fbm_ex([1.0, 2.0], 32, NoiseType::Perlin); assert!(val1.is_nan() || val1 >= -1.0 && val1 <= 1.0); if !val1.is_nan() { assert_eq!(val1, val1a); } - let val2 = noise2d.get_fbm_ex([1.0, 2.0], 64, NoiseType::Wavelet); + let val2 = noise2d.get_fbm_ex([1.0, 2.0], 64, NoiseType::Wavelet); let val2a = noise2d.get_fbm_ex([1.0, 2.0], 64, NoiseType::Wavelet); assert!(val2.is_nan() || val2 >= -1.0 && val2 <= 1.0); if !val2.is_nan() { @@ -376,21 +383,21 @@ mod test { let noise2d = Noise::init_with_dimensions(2).init(); let noise3d = Noise::init_with_dimensions(3).init(); - let val1 = noise1d.get_turbulence([1.0], 32); + let val1 = noise1d.get_turbulence([1.0], 32); let val1a = noise1d.get_turbulence([1.0], 32); assert!(val1.is_nan() || val1 >= -1.0 && val1 <= 1.0); if !val1.is_nan() { assert_eq!(val1, val1a); } - let val2 = noise2d.get_turbulence([1.0, 2.0], 32); + let val2 = noise2d.get_turbulence([1.0, 2.0], 32); let val2a = noise2d.get_turbulence([1.0, 2.0], 32); assert!(val2.is_nan() || val2 >= -1.0 && val2 <= 1.0); if !val2.is_nan() { assert_eq!(val2, val2a); } - let val3 = noise3d.get_turbulence([1.0, 2.0, 3.0], 32); + let val3 = noise3d.get_turbulence([1.0, 2.0, 3.0], 32); let val3a = noise3d.get_turbulence([1.0, 2.0, 3.0], 32); assert!(val3.is_nan() || val3 >= -1.0 && val3 <= 1.0); if !val3.is_nan() { @@ -430,14 +437,14 @@ mod test { fn get_turbulence_ex() { let noise2d = Noise::init_with_dimensions(2).init(); - let val1 = noise2d.get_turbulence_ex([1.0, 2.0], 32, NoiseType::Perlin); + let val1 = noise2d.get_turbulence_ex([1.0, 2.0], 32, NoiseType::Perlin); let val1a = noise2d.get_turbulence_ex([1.0, 2.0], 32, NoiseType::Perlin); assert!(val1.is_nan() || val1 >= -1.0 && val1 <= 1.0); if !val1.is_nan() { assert_eq!(val1, val1a); } - let val2 = noise2d.get_turbulence_ex([1.0, 2.0], 64, NoiseType::Wavelet); + let val2 = noise2d.get_turbulence_ex([1.0, 2.0], 64, NoiseType::Wavelet); let val2a = noise2d.get_turbulence_ex([1.0, 2.0], 64, NoiseType::Wavelet); assert!(val2.is_nan() || val2 >= -1.0 && val2 <= 1.0); if !val2.is_nan() { diff --git a/src/pathfinding.rs b/src/pathfinding.rs index de169f1fe..ed8fa454a 100644 --- a/src/pathfinding.rs +++ b/src/pathfinding.rs @@ -1,13 +1,13 @@ use bindings::ffi; -use bindings::{AsNative, c_float, c_int, c_void}; +use bindings::{c_float, c_int, c_void, AsNative}; use map::Map; enum PathInnerData<'a> { Map(Map), - Callback(Box f32+'a>), + Callback(Box f32 + 'a>), } -pub struct AStar<'a>{ +pub struct AStar<'a> { tcod_path: ffi::TCOD_path_t, #[allow(dead_code)] inner: PathInnerData<'a>, @@ -19,7 +19,7 @@ impl<'a> AsNative for AStar<'a> { unsafe fn as_native(&self) -> &ffi::TCOD_path_t { &self.tcod_path } - + unsafe fn as_native_mut(&mut self) -> &mut ffi::TCOD_path_t { &mut self.tcod_path } @@ -33,27 +33,35 @@ impl<'a> Drop for AStar<'a> { } } -extern "C" fn c_path_callback f32>(xf: c_int, yf: c_int, - xt: c_int, yt: c_int, - user_data: *mut c_void) -> c_float { +extern "C" fn c_path_callback f32>( + xf: c_int, + yf: c_int, + xt: c_int, + yt: c_int, + user_data: *mut c_void, +) -> c_float { let callback_ptr = user_data as *mut T; - let cb: &mut T = unsafe { - &mut *callback_ptr - }; + let cb: &mut T = unsafe { &mut *callback_ptr }; cb((xf, yf), (xt, yt)) } impl<'a> AStar<'a> { - pub fn new_from_callback f32>( - width: i32, height: i32, path_callback: T, - diagonal_cost: f32) -> AStar<'a> { + pub fn new_from_callback f32>( + width: i32, + height: i32, + path_callback: T, + diagonal_cost: f32, + ) -> AStar<'a> { let callback = Box::new(path_callback); let user_data = &*callback as *const T as *mut c_void; unsafe { - let tcod_path = ffi::TCOD_path_new_using_function(width, height, - Some(c_path_callback::), - user_data, - diagonal_cost); + let tcod_path = ffi::TCOD_path_new_using_function( + width, + height, + Some(c_path_callback::), + user_data, + diagonal_cost, + ); AStar { tcod_path: tcod_path, // We need to keep user_closure around, otherwise it @@ -66,9 +74,7 @@ impl<'a> AStar<'a> { } pub fn new_from_map(map: Map, diagonal_cost: f32) -> AStar<'static> { - let tcod_path = unsafe { - ffi::TCOD_path_new_using_map(*map.as_native(), diagonal_cost) - }; + let tcod_path = unsafe { ffi::TCOD_path_new_using_map(*map.as_native(), diagonal_cost) }; let (w, h) = map.size(); AStar { tcod_path: tcod_path, @@ -78,38 +84,42 @@ impl<'a> AStar<'a> { } } - pub fn find(&mut self, - from: (i32, i32), - to: (i32, i32)) -> bool { + pub fn find(&mut self, from: (i32, i32), to: (i32, i32)) -> bool { let (from_x, from_y) = from; let (to_x, to_y) = to; assert!(from_x >= 0 && from_y >= 0 && to_x >= 0 && to_y >= 0); - assert!(from_x < self.width && from_y < self.height && to_x < self.width && to_y < self.height); - unsafe { - ffi::TCOD_path_compute(self.tcod_path, - from_x, from_y, - to_x, to_y) - } + assert!( + from_x < self.width && from_y < self.height && to_x < self.width && to_y < self.height + ); + unsafe { ffi::TCOD_path_compute(self.tcod_path, from_x, from_y, to_x, to_y) } } pub fn iter(&'a self) -> AStarPathIter<'a> { - AStarPathIter { current: -1, path: self } + AStarPathIter { + current: -1, + path: self, + } } pub fn walk(&mut self) -> AStarIterator { - AStarIterator{tcod_path: self.tcod_path, recalculate: false} + AStarIterator { + tcod_path: self.tcod_path, + recalculate: false, + } } pub fn walk_recalculate(&mut self) -> AStarIterator { - AStarIterator{tcod_path: self.tcod_path, recalculate: true} + AStarIterator { + tcod_path: self.tcod_path, + recalculate: true, + } } pub fn walk_one_step(&mut self, recalculate_when_needed: bool) -> Option<(i32, i32)> { unsafe { let mut x: c_int = 0; let mut y: c_int = 0; - match ffi::TCOD_path_walk(self.tcod_path, &mut x, &mut y, - recalculate_when_needed) { + match ffi::TCOD_path_walk(self.tcod_path, &mut x, &mut y, recalculate_when_needed) { true => Some((x, y)), false => None, } @@ -117,9 +127,7 @@ impl<'a> AStar<'a> { } pub fn reverse(&mut self) { - unsafe { - ffi::TCOD_path_reverse(self.tcod_path) - } + unsafe { ffi::TCOD_path_reverse(self.tcod_path) } } pub fn origin(&self) -> (isize, isize) { @@ -153,15 +161,11 @@ impl<'a> AStar<'a> { } pub fn is_empty(&self) -> bool { - unsafe { - ffi::TCOD_path_is_empty(self.tcod_path) - } + unsafe { ffi::TCOD_path_is_empty(self.tcod_path) } } pub fn len(&self) -> i32 { - unsafe { - ffi::TCOD_path_size(self.tcod_path) - } + unsafe { ffi::TCOD_path_size(self.tcod_path) } } } @@ -177,7 +181,7 @@ impl<'a> AsNative for Dijkstra<'a> { unsafe fn as_native(&self) -> &ffi::TCOD_dijkstra_t { &self.tcod_path } - + unsafe fn as_native_mut(&mut self) -> &mut ffi::TCOD_dijkstra_t { &mut self.tcod_path } @@ -192,18 +196,22 @@ impl<'a> Drop for Dijkstra<'a> { } impl<'a> Dijkstra<'a> { - pub fn new_from_callback f32>( - width: i32, height: i32, + pub fn new_from_callback f32>( + width: i32, + height: i32, path_callback: T, - diagonal_cost: f32) -> Dijkstra<'a> { + diagonal_cost: f32, + ) -> Dijkstra<'a> { let callback = Box::new(path_callback); let user_data = &*callback as *const T as *mut c_void; unsafe { - let tcod_path = ffi::TCOD_dijkstra_new_using_function(width, - height, - Some(c_path_callback::), - user_data, - diagonal_cost); + let tcod_path = ffi::TCOD_dijkstra_new_using_function( + width, + height, + Some(c_path_callback::), + user_data, + diagonal_cost, + ); Dijkstra { tcod_path: tcod_path, inner: PathInnerData::Callback(callback), @@ -214,9 +222,7 @@ impl<'a> Dijkstra<'a> { } pub fn new_from_map(map: Map, diagonal_cost: f32) -> Dijkstra<'static> { - let tcod_path = unsafe { - ffi::TCOD_dijkstra_new(*map.as_native(), diagonal_cost) - }; + let tcod_path = unsafe { ffi::TCOD_dijkstra_new(*map.as_native(), diagonal_cost) }; let (w, h) = map.size(); Dijkstra { tcod_path: tcod_path, @@ -237,20 +243,23 @@ impl<'a> Dijkstra<'a> { pub fn find(&mut self, destination: (i32, i32)) -> bool { let (x, y) = destination; if x >= 0 && y >= 0 && x < self.width && y < self.height { - unsafe { - ffi::TCOD_dijkstra_path_set(self.tcod_path, x, y) - } + unsafe { ffi::TCOD_dijkstra_path_set(self.tcod_path, x, y) } } else { false } } pub fn iter(&'a self) -> DijkstraPathIter<'a> { - DijkstraPathIter { current: -1, path: self } + DijkstraPathIter { + current: -1, + path: self, + } } pub fn walk(&mut self) -> DijkstraIterator { - DijkstraIterator{tcod_path: self.tcod_path} + DijkstraIterator { + tcod_path: self.tcod_path, + } } pub fn walk_one_step(&mut self) -> Option<(i32, i32)> { @@ -258,19 +267,16 @@ impl<'a> Dijkstra<'a> { let mut x: c_int = 0; let mut y: c_int = 0; if ffi::TCOD_dijkstra_path_walk(self.tcod_path, &mut x, &mut y) { - Some((x,y)) + Some((x, y)) } else { None } } } - pub fn distance_from_root(&self, point: (i32, i32)) -> Option { let (x, y) = point; - let result = unsafe { - ffi::TCOD_dijkstra_get_distance(self.tcod_path, x, y) - }; + let result = unsafe { ffi::TCOD_dijkstra_get_distance(self.tcod_path, x, y) }; if result == -1.0 { None } else { @@ -297,15 +303,11 @@ impl<'a> Dijkstra<'a> { } pub fn is_empty(&self) -> bool { - unsafe { - ffi::TCOD_dijkstra_is_empty(self.tcod_path) - } + unsafe { ffi::TCOD_dijkstra_is_empty(self.tcod_path) } } pub fn len(&self) -> i32 { - unsafe { - ffi::TCOD_dijkstra_size(self.tcod_path) - } + unsafe { ffi::TCOD_dijkstra_size(self.tcod_path) } } } @@ -321,9 +323,8 @@ impl Iterator for AStarIterator { unsafe { let mut x: c_int = 0; let mut y: c_int = 0; - if ffi::TCOD_path_walk(self.tcod_path, &mut x, &mut y, - self.recalculate) { - Some((x,y)) + if ffi::TCOD_path_walk(self.tcod_path, &mut x, &mut y, self.recalculate) { + Some((x, y)) } else { None } @@ -343,7 +344,7 @@ impl Iterator for DijkstraIterator { let mut x: c_int = 0; let mut y: c_int = 0; if ffi::TCOD_dijkstra_path_walk(self.tcod_path, &mut x, &mut y) { - Some((x,y)) + Some((x, y)) } else { None } diff --git a/src/random.rs b/src/random.rs index 358f1b977..bcc980419 100644 --- a/src/random.rs +++ b/src/random.rs @@ -4,49 +4,62 @@ use bindings::AsNative; #[repr(u32)] #[derive(Copy, Clone)] pub enum Distribution { - Linear = ffi::TCOD_distribution_t::TCOD_DISTRIBUTION_LINEAR as u32, - Gaussian = ffi::TCOD_distribution_t::TCOD_DISTRIBUTION_GAUSSIAN as u32, - GaussianRange = ffi::TCOD_distribution_t::TCOD_DISTRIBUTION_GAUSSIAN_RANGE as u32, - GaussianInverse = ffi::TCOD_distribution_t::TCOD_DISTRIBUTION_GAUSSIAN_INVERSE as u32, - GaussianRangeInverse = ffi::TCOD_distribution_t::TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE as u32, + Linear = ffi::TCOD_distribution_t::TCOD_DISTRIBUTION_LINEAR as u32, + Gaussian = ffi::TCOD_distribution_t::TCOD_DISTRIBUTION_GAUSSIAN as u32, + GaussianRange = ffi::TCOD_distribution_t::TCOD_DISTRIBUTION_GAUSSIAN_RANGE as u32, + GaussianInverse = ffi::TCOD_distribution_t::TCOD_DISTRIBUTION_GAUSSIAN_INVERSE as u32, + GaussianRangeInverse = + ffi::TCOD_distribution_t::TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE as u32, } native_enum_convert!(Distribution, TCOD_distribution_t); #[repr(C)] #[derive(Copy, Clone)] pub enum Algo { - MT = ffi::TCOD_random_algo_t::TCOD_RNG_MT as isize, - CMWC = ffi::TCOD_random_algo_t::TCOD_RNG_CMWC as isize + MT = ffi::TCOD_random_algo_t::TCOD_RNG_MT as isize, + CMWC = ffi::TCOD_random_algo_t::TCOD_RNG_CMWC as isize, } native_enum_convert!(Algo, TCOD_random_algo_t); pub struct Rng { tcod_random: ffi::TCOD_random_t, - default: bool + default: bool, } impl Rng { pub fn get_instance() -> Rng { unsafe { - Rng { tcod_random: ffi::TCOD_random_get_instance(), default: true } + Rng { + tcod_random: ffi::TCOD_random_get_instance(), + default: true, + } } } pub fn new(algo: Algo) -> Rng { unsafe { - Rng { tcod_random: ffi::TCOD_random_new(algo.into()), default: false } + Rng { + tcod_random: ffi::TCOD_random_new(algo.into()), + default: false, + } } } pub fn new_with_seed(algo: Algo, seed: u32) -> Rng { unsafe { - Rng { tcod_random: ffi::TCOD_random_new_from_seed(algo.into(), seed), default: false } + Rng { + tcod_random: ffi::TCOD_random_new_from_seed(algo.into(), seed), + default: false, + } } } pub fn save(&self) -> Rng { unsafe { - Rng { tcod_random: ffi::TCOD_random_save(self.tcod_random), default: false } + Rng { + tcod_random: ffi::TCOD_random_save(self.tcod_random), + default: false, + } } } @@ -63,39 +76,27 @@ impl Rng { } pub fn get_int(&self, min: i32, max: i32) -> i32 { - unsafe { - ffi::TCOD_random_get_int(self.tcod_random, min, max) - } + unsafe { ffi::TCOD_random_get_int(self.tcod_random, min, max) } } pub fn get_int_mean(&self, min: i32, max: i32, mean: i32) -> i32 { - unsafe { - ffi::TCOD_random_get_int_mean(self.tcod_random, min, max, mean) - } + unsafe { ffi::TCOD_random_get_int_mean(self.tcod_random, min, max, mean) } } pub fn get_float(&self, min: f32, max: f32) -> f32 { - unsafe { - ffi::TCOD_random_get_float(self.tcod_random, min, max) - } + unsafe { ffi::TCOD_random_get_float(self.tcod_random, min, max) } } pub fn get_float_mean(&self, min: f32, max: f32, mean: f32) -> f32 { - unsafe { - ffi::TCOD_random_get_float_mean(self.tcod_random, min, max, mean) - } + unsafe { ffi::TCOD_random_get_float_mean(self.tcod_random, min, max, mean) } } pub fn get_double(&self, min: f64, max: f64) -> f64 { - unsafe { - ffi::TCOD_random_get_double(self.tcod_random, min, max) - } + unsafe { ffi::TCOD_random_get_double(self.tcod_random, min, max) } } pub fn get_double_mean(&self, min: f64, max: f64, mean: f64) -> f64 { - unsafe { - ffi::TCOD_random_get_double_mean(self.tcod_random, min, max, mean) - } + unsafe { ffi::TCOD_random_get_double_mean(self.tcod_random, min, max, mean) } } } @@ -103,7 +104,7 @@ impl AsNative for Rng { unsafe fn as_native(&self) -> &ffi::TCOD_random_t { &self.tcod_random } - + unsafe fn as_native_mut(&mut self) -> &mut ffi::TCOD_random_t { &mut self.tcod_random } @@ -118,5 +119,3 @@ impl Drop for Rng { } } } - - diff --git a/src/rustc_serialize_impls.rs b/src/rustc_serialize_impls.rs index 42163de8c..abf6d6496 100644 --- a/src/rustc_serialize_impls.rs +++ b/src/rustc_serialize_impls.rs @@ -1,12 +1,12 @@ use super::Color; -use rustc_serialize::{Encodable, Encoder, Decodable, Decoder}; +use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; impl Encodable for Color { fn encode(&self, s: &mut S) -> Result<(), S::Error> { s.emit_struct("Color", 3, |s| { - try!{ s.emit_struct_field("r", 0, |s| self.r.encode(s)) }; - try!{ s.emit_struct_field("g", 1, |s| self.g.encode(s)) }; - try!{ s.emit_struct_field("b", 2, |s| self.b.encode(s)) }; + try! { s.emit_struct_field("r", 0, |s| self.r.encode(s)) }; + try! { s.emit_struct_field("g", 1, |s| self.g.encode(s)) }; + try! { s.emit_struct_field("b", 2, |s| self.b.encode(s)) }; Ok(()) }) } @@ -19,27 +19,25 @@ impl Decodable for Color { let r = try!(d.read_struct_field("r", 0, |d| d.read_u8())); let g = try!(d.read_struct_field("g", 1, |d| d.read_u8())); let b = try!(d.read_struct_field("b", 2, |d| d.read_u8())); - Ok(Color{r: r, g: g, b: b}) + Ok(Color { r: r, g: g, b: b }) }) } } - - #[cfg(test)] mod test { - use ::Color; - use ::rustc_serialize::json; + use rustc_serialize::json; + use Color; #[test] fn color_encode() { - let encoded = json::encode(&Color{r: 1, g: 2, b: 3}).unwrap(); + let encoded = json::encode(&Color { r: 1, g: 2, b: 3 }).unwrap(); assert_eq!("{\"r\":1,\"g\":2,\"b\":3}", encoded); } #[test] fn color_decode() { let decoded: Color = json::decode("{\"r\":1,\"g\":2,\"b\":3}").unwrap(); - assert_eq!(Color{r: 1, g: 2, b: 3}, decoded); + assert_eq!(Color { r: 1, g: 2, b: 3 }, decoded); } } diff --git a/src/system.rs b/src/system.rs index ab9e2e5d8..65486c800 100644 --- a/src/system.rs +++ b/src/system.rs @@ -1,30 +1,24 @@ -use std::str; use std::ptr; +use std::str; use std::time::Duration; +use bindings::ffi; use std::ffi::{CStr, CString}; use std::path::Path; -use bindings::ffi; pub fn set_fps(fps: i32) { assert!(fps >= 0); - unsafe { - ffi::TCOD_sys_set_fps(fps) - } + unsafe { ffi::TCOD_sys_set_fps(fps) } } pub fn get_fps() -> i32 { - let result = unsafe { - ffi::TCOD_sys_get_fps() - }; + let result = unsafe { ffi::TCOD_sys_get_fps() }; assert!(result >= 0); result } pub fn get_last_frame_length() -> f32 { - unsafe { - ffi::TCOD_sys_get_last_frame_length() - } + unsafe { ffi::TCOD_sys_get_last_frame_length() } } pub fn sleep(time: Duration) { @@ -35,13 +29,14 @@ pub fn sleep(time: Duration) { } pub fn get_elapsed_time() -> Duration { - let ms: u32 = unsafe { - ffi::TCOD_sys_elapsed_milli() - }; + let ms: u32 = unsafe { ffi::TCOD_sys_elapsed_milli() }; Duration::from_millis(ms as u64) } -pub fn save_screenshot

(path: P) where P: AsRef { +pub fn save_screenshot

(path: P) +where + P: AsRef, +{ let filename = path.as_ref().to_str().expect("Invalid screenshot path"); let c_path = CString::new(filename).unwrap(); unsafe { @@ -89,7 +84,10 @@ pub fn get_char_size() -> (i32, i32) { (width, height) } -pub fn set_clipboard(value: T) where T: AsRef { +pub fn set_clipboard(value: T) +where + T: AsRef, +{ let c_str = CString::new(value.as_ref().as_bytes()).unwrap(); unsafe { ffi::TCOD_sys_clipboard_set(c_str.as_ptr()); From f89fdd25dc081864f649d54b612d8e9eed80934f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sat, 27 Jun 2020 14:40:29 +0200 Subject: [PATCH 07/27] Since TCOD_font_flags_t hosts flags, declare it as a bitfield_enum --- examples/custom_character_mapping.rs | 4 +- examples/samples.rs | 10 ++--- src/console.rs | 46 +++++++++---------- tcod_sys/build.rs | 1 + tcod_sys/x86_64-pc-windows-msvc_bindings.rs | 50 +++++++++++++++++---- 5 files changed, 71 insertions(+), 40 deletions(-) diff --git a/examples/custom_character_mapping.rs b/examples/custom_character_mapping.rs index fe52c8cdb..30537f225 100644 --- a/examples/custom_character_mapping.rs +++ b/examples/custom_character_mapping.rs @@ -17,8 +17,8 @@ const ROOM_HEIGHT: i32 = 15; fn main() { let mut root = RootConsole::initializer() - .font("angband16x16.bmp", FontLayout::Tcod) - .font_type(FontType::Greyscale) + .font("angband16x16.bmp", FontLayout::TCOD) + .font_type(FontType::GREYSCALE) .font_dimensions(32, 60) // angband16x16.bmp has 32 columns & 60 rows of // characters .size(MAP_WIDTH, MAP_HEIGHT) diff --git a/examples/samples.rs b/examples/samples.rs index e23a0e0ef..2fad7568a 100644 --- a/examples/samples.rs +++ b/examples/samples.rs @@ -1866,8 +1866,8 @@ impl Options { fullscreen_width: 0, fullscreen_height: 0, font: "consolas10x10_gs_tc.png".to_owned(), - font_type: FontType::Greyscale, - font_layout: FontLayout::Tcod, + font_type: FontType::GREYSCALE, + font_layout: FontLayout::TCOD, nb_char_horiz: 0, nb_char_vertic: 0, fullscreen: false, @@ -2052,9 +2052,9 @@ fn parse_args(options: &mut Options) { } } "-fullscreen" => options.fullscreen = true, - "-font-in-row" => options.font_layout = FontLayout::AsciiInRow, - "-font-greyscale" => options.font_type = FontType::Greyscale, - "-font-tcod" => options.font_layout = FontLayout::Tcod, + "-font-in-row" => options.font_layout = FontLayout::ASCII_INROW, + "-font-greyscale" => options.font_type = FontType::GREYSCALE, + "-font-tcod" => options.font_layout = FontLayout::TCOD, "-renderer" => { if let Some(renderer) = args.next() { match renderer.parse::().ok() { diff --git a/src/console.rs b/src/console.rs index e0aa72de8..50d7e5675 100644 --- a/src/console.rs +++ b/src/console.rs @@ -61,7 +61,7 @@ use std::mem::transmute; use std::path::Path; use bindings::ffi::{ - self, TCOD_alignment_t, TCOD_bkgnd_flag_t, TCOD_font_flags_t, TCOD_renderer_t, + self, TCOD_alignment_t, TCOD_bkgnd_flag_t, TCOD_renderer_t, }; use bindings::{AsNative, CString, FromNative}; @@ -391,7 +391,7 @@ impl Root { ); ffi::TCOD_console_set_custom_font( path.as_ptr(), - (font_layout as i32) | (font_type as i32), + font_layout.bits() | font_type.bits(), nb_char_horizontal, nb_char_vertical, ); @@ -438,7 +438,7 @@ impl Root { /// .size(80, 20) /// .title("Example") /// .fullscreen(true) -/// .font("terminal.png", FontLayout::AsciiInCol) +/// .font("terminal.png", FontLayout::ASCII_INCOL) /// .renderer(Renderer::GLSL) /// .init(); /// } @@ -463,8 +463,8 @@ impl<'a> RootInitializer<'a> { title: Box::new("Main Window"), is_fullscreen: false, font_path: Box::new("terminal.png"), - font_layout: FontLayout::AsciiInCol, - font_type: FontType::Default, + font_layout: FontLayout::ASCII_INCOL, + font_type: FontType::DEFAULT, font_dimensions: (0, 0), console_renderer: Renderer::SDL, } @@ -1277,49 +1277,47 @@ pub enum Renderer { } native_enum_convert!(Renderer, TCOD_renderer_t); -/// All the possible font layouts that can be used for custom bitmap fonts -#[repr(u32)] -#[derive(Copy, Clone)] -pub enum FontLayout { - AsciiInCol = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_ASCII_INCOL as u32, - AsciiInRow = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_ASCII_INROW as u32, - Tcod = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_TCOD as u32, +bitflags! { + /// All the possible font layouts that can be used for custom bitmap fonts + pub struct FontLayout: i32 { + const ASCII_INCOL = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_ASCII_INCOL.0; + const ASCII_INROW = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_ASCII_INROW.0; + const TCOD = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_TCOD.0; + } } -native_enum_convert!(FontLayout, TCOD_font_flags_t); -#[repr(u32)] -#[derive(Copy, Clone)] -pub enum FontType { - Default = 0, - Greyscale = ffi::TCOD_font_flags_t::TCOD_FONT_TYPE_GREYSCALE as u32, +bitflags! { + pub struct FontType: i32 { + const DEFAULT = 0; + const GREYSCALE = ffi::TCOD_font_flags_t::TCOD_FONT_TYPE_GREYSCALE.0; + } } -native_enum_convert!(FontType, TCOD_font_flags_t); #[cfg(test)] mod test { - use super::FontLayout::AsciiInCol; + use super::FontLayout; use super::Root; use std::path::Path; #[test] fn test_custom_font_as_static_str() { - Root::initializer().font("terminal.png", AsciiInCol); + Root::initializer().font("terminal.png", FontLayout::ASCII_INCOL); } #[test] fn test_custom_font_as_path() { - Root::initializer().font(Path::new("terminal.png"), AsciiInCol); + Root::initializer().font(Path::new("terminal.png"), FontLayout::ASCII_INCOL); } #[test] fn test_custom_font_as_string() { - Root::initializer().font("terminal.png".to_owned(), AsciiInCol); + Root::initializer().font("terminal.png".to_owned(), FontLayout::ASCII_INCOL); } #[test] fn test_custom_font_as_str() { let string = "terminal.png".to_owned(); let s: &str = &string; - Root::initializer().font(s, AsciiInCol); + Root::initializer().font(s, FontLayout::ASCII_INCOL); } } diff --git a/tcod_sys/build.rs b/tcod_sys/build.rs index b9da5a8d5..52a08e85e 100644 --- a/tcod_sys/build.rs +++ b/tcod_sys/build.rs @@ -120,6 +120,7 @@ fn generate_bindings>(dst_dir: P) { .emit_builtins() .default_enum_style(bindgen::EnumVariation::Rust{non_exhaustive:false}) .derive_default(true) + .bitfield_enum("TCOD_font_flags_t") // Tell cargo to invalidate the built crate whenever any of the // included header files changed. .parse_callbacks(Box::new(bindgen::CargoCallbacks)) diff --git a/tcod_sys/x86_64-pc-windows-msvc_bindings.rs b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs index ed6f103cc..2fbdfe59f 100644 --- a/tcod_sys/x86_64-pc-windows-msvc_bindings.rs +++ b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs @@ -5095,17 +5095,49 @@ pub enum TCOD_key_status_t { TCOD_KEY_RELEASED = 2, } impl TCOD_font_flags_t { - pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = - TCOD_font_flags_t::TCOD_FONT_TYPE_GREYSCALE; + pub const TCOD_FONT_LAYOUT_ASCII_INCOL: TCOD_font_flags_t = TCOD_font_flags_t(1); } -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_font_flags_t { - TCOD_FONT_LAYOUT_ASCII_INCOL = 1, - TCOD_FONT_LAYOUT_ASCII_INROW = 2, - TCOD_FONT_TYPE_GREYSCALE = 4, - TCOD_FONT_LAYOUT_TCOD = 8, +impl TCOD_font_flags_t { + pub const TCOD_FONT_LAYOUT_ASCII_INROW: TCOD_font_flags_t = TCOD_font_flags_t(2); +} +impl TCOD_font_flags_t { + pub const TCOD_FONT_TYPE_GREYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); +} +impl TCOD_font_flags_t { + pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); +} +impl TCOD_font_flags_t { + pub const TCOD_FONT_LAYOUT_TCOD: TCOD_font_flags_t = TCOD_font_flags_t(8); } +impl ::std::ops::BitOr for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for TCOD_font_flags_t { + #[inline] + fn bitor_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for TCOD_font_flags_t { + #[inline] + fn bitand_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct TCOD_font_flags_t(pub i32); #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum TCOD_renderer_t { From 63f23f8d0d0c195acfb8e2bfe011b94a64d79291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sat, 27 Jun 2020 14:58:23 +0200 Subject: [PATCH 08/27] Update libtcod to 1.7 --- tcod_sys/bindgen.h | 1 - tcod_sys/build.rs | 8 +- tcod_sys/libtcod/include/bresenham.h | 44 +- tcod_sys/libtcod/include/bresenham.hpp | 26 +- tcod_sys/libtcod/include/bsp.h | 12 +- tcod_sys/libtcod/include/bsp.hpp | 100 +- tcod_sys/libtcod/include/color.h | 58 +- tcod_sys/libtcod/include/color.hpp | 48 +- tcod_sys/libtcod/include/console.h | 17 +- tcod_sys/libtcod/include/console.hpp | 13 +- tcod_sys/libtcod/include/console_rexpaint.h | 50 + tcod_sys/libtcod/include/console_types.h | 73 +- tcod_sys/libtcod/include/fov.h | 10 +- tcod_sys/libtcod/include/fov.hpp | 78 +- tcod_sys/libtcod/include/fov_types.h | 10 +- tcod_sys/libtcod/include/heightmap.h | 13 +- tcod_sys/libtcod/include/heightmap.hpp | 9 +- tcod_sys/libtcod/include/howto.hpp | 10 +- tcod_sys/libtcod/include/image.h | 13 +- tcod_sys/libtcod/include/image.hpp | 102 +- tcod_sys/libtcod/include/lex.h | 10 +- tcod_sys/libtcod/include/lex.hpp | 15 +- tcod_sys/libtcod/include/libtcod.h | 11 +- tcod_sys/libtcod/include/libtcod.hpp | 10 +- tcod_sys/libtcod/include/libtcod_int.h | 36 +- .../libtcod/include/libtcod_portability.h | 20 +- tcod_sys/libtcod/include/libtcod_utility.h | 6 +- tcod_sys/libtcod/include/libtcod_version.h | 12 +- tcod_sys/libtcod/include/list.h | 10 +- tcod_sys/libtcod/include/list.hpp | 128 +- tcod_sys/libtcod/include/mersenne.h | 10 +- tcod_sys/libtcod/include/mersenne.hpp | 10 +- tcod_sys/libtcod/include/mersenne_types.h | 10 +- tcod_sys/libtcod/include/mouse.h | 10 +- tcod_sys/libtcod/include/mouse.hpp | 10 +- tcod_sys/libtcod/include/mouse_types.h | 16 +- tcod_sys/libtcod/include/namegen.h | 9 +- tcod_sys/libtcod/include/namegen.hpp | 33 +- tcod_sys/libtcod/include/noise.h | 10 +- tcod_sys/libtcod/include/noise.hpp | 16 +- tcod_sys/libtcod/include/noise_defaults.h | 27 + tcod_sys/libtcod/include/parser.h | 10 +- tcod_sys/libtcod/include/parser.hpp | 10 +- tcod_sys/libtcod/include/path.h | 10 +- tcod_sys/libtcod/include/path.hpp | 11 +- tcod_sys/libtcod/include/sys.h | 20 +- tcod_sys/libtcod/include/sys.hpp | 32 +- tcod_sys/libtcod/include/tree.h | 10 +- tcod_sys/libtcod/include/tree.hpp | 10 +- tcod_sys/libtcod/include/txtfield.h | 11 +- tcod_sys/libtcod/include/txtfield.hpp | 10 +- tcod_sys/libtcod/include/wrappers.h | 9 +- tcod_sys/libtcod/include/zip.h | 10 +- tcod_sys/libtcod/include/zip.hpp | 82 +- tcod_sys/libtcod/src/README.txt | 14 +- tcod_sys/libtcod/src/bresenham.cpp | 17 +- tcod_sys/libtcod/src/bresenham_c.c | 113 +- tcod_sys/libtcod/src/bsp.cpp | 10 +- tcod_sys/libtcod/src/bsp_c.c | 13 +- tcod_sys/libtcod/src/color.cpp | 10 +- tcod_sys/libtcod/src/color_c.c | 583 +++--- tcod_sys/libtcod/src/console.cpp | 9 +- tcod_sys/libtcod/src/console_c.c | 474 ++++- tcod_sys/libtcod/src/console_rexpaint.c | 442 ++-- tcod_sys/libtcod/src/fov.cpp | 9 +- tcod_sys/libtcod/src/fov_c.c | 10 +- .../libtcod/src/fov_circular_raycasting.c | 17 +- tcod_sys/libtcod/src/fov_diamond_raycasting.c | 9 +- tcod_sys/libtcod/src/fov_permissive2.c | 20 +- .../libtcod/src/fov_recursive_shadowcasting.c | 10 +- tcod_sys/libtcod/src/fov_restrictive.c | 10 +- tcod_sys/libtcod/src/heightmap.cpp | 10 +- tcod_sys/libtcod/src/heightmap_c.c | 11 +- tcod_sys/libtcod/src/image.cpp | 11 +- tcod_sys/libtcod/src/image_c.c | 29 +- tcod_sys/libtcod/src/lex.cpp | 10 +- tcod_sys/libtcod/src/lex_c.c | 32 +- tcod_sys/libtcod/src/libtcod.cpp | 67 + tcod_sys/libtcod/src/libtcod_c.c | 85 + tcod_sys/libtcod/src/list_c.c | 10 +- tcod_sys/libtcod/src/mersenne.cpp | 9 +- tcod_sys/libtcod/src/mersenne_c.c | 9 +- tcod_sys/libtcod/src/mouse.cpp | 9 +- tcod_sys/libtcod/src/namegen.cpp | 9 +- tcod_sys/libtcod/src/namegen_c.c | 10 +- tcod_sys/libtcod/src/noise.cpp | 9 +- tcod_sys/libtcod/src/noise_c.c | 9 +- tcod_sys/libtcod/src/parser.cpp | 10 +- tcod_sys/libtcod/src/parser_c.c | 10 +- tcod_sys/libtcod/src/path.cpp | 10 +- tcod_sys/libtcod/src/path_c.c | 9 +- tcod_sys/libtcod/src/sys.cpp | 23 +- tcod_sys/libtcod/src/sys_c.c | 50 +- tcod_sys/libtcod/src/sys_opengl_c.c | 58 +- tcod_sys/libtcod/src/sys_sdl2_c.c | 57 +- tcod_sys/libtcod/src/sys_sdl_c.c | 196 +- tcod_sys/libtcod/src/sys_sdl_img_bmp.c | 13 +- tcod_sys/libtcod/src/sys_sdl_img_png.c | 19 +- tcod_sys/libtcod/src/tree_c.c | 9 +- tcod_sys/libtcod/src/txtfield.cpp | 14 +- tcod_sys/libtcod/src/txtfield_c.c | 17 +- tcod_sys/libtcod/src/vendor/stb.c | 4 + tcod_sys/libtcod/src/vendor/stb_sprintf.h | 1833 +++++++++++++++++ tcod_sys/libtcod/src/wrappers.c | 11 +- tcod_sys/libtcod/src/zip.cpp | 9 +- tcod_sys/libtcod/src/zip_c.c | 9 +- tcod_sys/x86_64-pc-windows-msvc_bindings.rs | 75 +- 107 files changed, 4302 insertions(+), 1582 deletions(-) create mode 100644 tcod_sys/libtcod/include/console_rexpaint.h create mode 100644 tcod_sys/libtcod/src/libtcod.cpp create mode 100644 tcod_sys/libtcod/src/libtcod_c.c create mode 100644 tcod_sys/libtcod/src/vendor/stb.c create mode 100644 tcod_sys/libtcod/src/vendor/stb_sprintf.h diff --git a/tcod_sys/bindgen.h b/tcod_sys/bindgen.h index 5bdc072c5..d7e175934 100644 --- a/tcod_sys/bindgen.h +++ b/tcod_sys/bindgen.h @@ -1,5 +1,4 @@ #define TCOD_CONSOLE_SUPPORT #define TCOD_OSUTIL_SUPPORT -#define TCOD_SDL2 #include "libtcod/include/libtcod.h" diff --git a/tcod_sys/build.rs b/tcod_sys/build.rs index 52a08e85e..8d607f8d3 100644 --- a/tcod_sys/build.rs +++ b/tcod_sys/build.rs @@ -58,7 +58,6 @@ fn build_linux_static(_dst: &Path, libtcod_sources: &[& 'static str]) { config.include(include_path); } // Build the library - config.define("TCOD_SDL2", None); config.define("NO_OPENGL", None); config.define("NDEBUG", None); config.flag("-fno-strict-aliasing"); @@ -76,7 +75,6 @@ fn build_linux_dynamic(dst: &Path, libtcod_sources: &[& 'static str]) { for include_path in &pkg_config::find_library("sdl2").unwrap().include_paths { config.include(include_path); } - config.define("TCOD_SDL2", None); config.define("NO_OPENGL", None); config.define("NDEBUG", None); config.flag("-fno-strict-aliasing"); @@ -86,7 +84,6 @@ fn build_linux_dynamic(dst: &Path, libtcod_sources: &[& 'static str]) { // Build the DLL let mut config = cc::Build::new(); - config.define("TCOD_SDL2", None); config.define("NO_OPENGL", None); config.define("NDEBUG", None); config.flag("-shared"); @@ -227,6 +224,7 @@ fn main() { "libtcod/src/wrappers.c", "libtcod/src/zip_c.c", "libtcod/src/png/lodepng.c", + "libtcod/src/vendor/stb.c", ]; if target.contains("linux") { @@ -246,7 +244,6 @@ fn main() { for include_path in &pkg_config::find_library("sdl2").unwrap().include_paths { config.include(include_path); } - config.define("TCOD_SDL2", None); config.define("NO_OPENGL", None); config.define("NDEBUG", None); config.flag("-fno-strict-aliasing"); @@ -256,7 +253,6 @@ fn main() { // Build the DLL let mut config = cc::Build::new(); - config.define("TCOD_SDL2", None); config.define("NO_OPENGL", None); config.define("NDEBUG", None); config.flag("-shared"); @@ -291,7 +287,6 @@ fn main() { let mut config = cc::Build::new(); config.flag("-fno-strict-aliasing"); config.flag("-ansi"); - config.define("TCOD_SDL2", None); config.define("NO_OPENGL", None); config.define("NDEBUG", None); config.define("LIBTCOD_EXPORTS", None); @@ -331,7 +326,6 @@ fn main() { // Build the DLL let mut config = cc::Build::new(); - config.flag("/DTCOD_SDL2"); config.flag("/DNO_OPENGL"); config.flag("/DNDEBUG"); config.flag("/DLIBTCOD_EXPORTS"); diff --git a/tcod_sys/libtcod/include/bresenham.h b/tcod_sys/libtcod/include/bresenham.h index d84051f7d..c21200ffa 100644 --- a/tcod_sys/libtcod/include/bresenham.h +++ b/tcod_sys/libtcod/include/bresenham.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_BRESENHAM_H #define _TCOD_BRESENHAM_H @@ -33,28 +33,46 @@ #ifdef __cplusplus extern "C" { #endif +/** + * \brief A callback to be passed to TCOD_line + * + * The points given to the callback include both the starting and ending + * positions. + * + * \param x + * \param y + * \return As long as this callback returns true it will be called with the + * next x,y point on the line. + */ typedef bool (*TCOD_line_listener_t) (int x, int y); -TCODLIB_API void TCOD_line_init(int xFrom, int yFrom, int xTo, int yTo); -TCODLIB_API bool TCOD_line_step(int *xCur, int *yCur); /* advance one step. returns true if we reach destination */ +TCOD_DEPRECATED TCODLIB_API +void TCOD_line_init(int xFrom, int yFrom, int xTo, int yTo); + +TCOD_DEPRECATED TCODLIB_API +bool TCOD_line_step(int *xCur, int *yCur); /* advance one step. returns true if we reach destination */ + /* atomic callback function. Stops when the callback returns false */ TCODLIB_API bool TCOD_line(int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener); - -/* thread-safe versions */ +/** + * \brief A struct used for computing a bresenham line. + */ typedef struct { int stepx; int stepy; int e; int deltax; int deltay; - int origx; - int origy; - int destx; - int desty; + int origx; + int origy; + int destx; + int desty; } TCOD_bresenham_data_t; TCODLIB_API void TCOD_line_init_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_bresenham_data_t *data); TCODLIB_API bool TCOD_line_step_mt(int *xCur, int *yCur, TCOD_bresenham_data_t *data); + +TCOD_DEPRECATED TCODLIB_API bool TCOD_line_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener, TCOD_bresenham_data_t *data); #ifdef __cplusplus } diff --git a/tcod_sys/libtcod/include/bresenham.hpp b/tcod_sys/libtcod/include/bresenham.hpp index 1fac4f1df..7c27a8e43 100644 --- a/tcod_sys/libtcod/include/bresenham.hpp +++ b/tcod_sys/libtcod/include/bresenham.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_BRESENHAM_HPP #define _TCOD_BRESENHAM_HPP @@ -54,7 +54,7 @@ public : @Param xTo,yTo Coordinates of the line's ending point. */ static void init(int xFrom, int yFrom, int xTo, int yTo); - + /** @PageName line @FuncTitle Walking the line @@ -65,20 +65,20 @@ public : @C# static bool TCODLine::step(ref int xCur, ref int yCur) @Lua tcod.line.step(x,y) -- returns lineEnd,x,y @Param xCur,yCur the coordinates of the next cell on the line are stored here when the function returns - @CppEx + @CppEx // Going from point 5,8 to point 13,4 int x = 5, y = 8; TCODLine::init(x,y,13,4); do { // update cell x,y } while (!TCODLine::step(&x,&y)); - @CEx + @CEx int x = 5, y = 8; TCOD_line_init(x,y,13,4); do { - // update cell x,y + // update cell x,y } while (!TCOD_line_step(&x,&y)); - @PyEx + @PyEx libtcod.line_init(5,8,13,4) # update cell 5,8 x,y=libtcod.line_step() @@ -92,8 +92,8 @@ public : repeat -- update cell x,y lineEnd,x,y = tcod.line.step(x,y) - until lineEnd - */ + until lineEnd + */ static bool step(int *xCur, int *yCur); /** @@ -133,7 +133,7 @@ TCOD_line_line(5,8,13,4,my_listener); @PyEx def my_listener(x,y): print x,y return True -libtcod.line_line(5,8,13,4,my_listener) +libtcod.line_line(5,8,13,4,my_listener) */ static bool line(int xFrom, int yFrom, int xTo, int yTo, TCODLineListener *listener); }; diff --git a/tcod_sys/libtcod/include/bsp.h b/tcod_sys/libtcod/include/bsp.h index ae3a31326..00783700f 100644 --- a/tcod_sys/libtcod/include/bsp.h +++ b/tcod_sys/libtcod/include/bsp.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_BSP_H #define _TCOD_BSP_H @@ -63,7 +63,7 @@ TCODLIB_API bool TCOD_bsp_contains(TCOD_bsp_t *node, int x, int y); TCODLIB_API TCOD_bsp_t * TCOD_bsp_find_node(TCOD_bsp_t *node, int x, int y); TCODLIB_API void TCOD_bsp_resize(TCOD_bsp_t *node, int x,int y, int w, int h); TCODLIB_API void TCOD_bsp_split_once(TCOD_bsp_t *node, bool horizontal, int position); -TCODLIB_API void TCOD_bsp_split_recursive(TCOD_bsp_t *node, TCOD_random_t randomizer, int nb, +TCODLIB_API void TCOD_bsp_split_recursive(TCOD_bsp_t *node, TCOD_random_t randomizer, int nb, int minHSize, int minVSize, float maxHRatio, float maxVRatio); TCODLIB_API void TCOD_bsp_remove_sons(TCOD_bsp_t *node); #ifdef __cplusplus diff --git a/tcod_sys/libtcod/include/bsp.hpp b/tcod_sys/libtcod/include/bsp.hpp index d20c003be..06cae8913 100644 --- a/tcod_sys/libtcod/include/bsp.hpp +++ b/tcod_sys/libtcod/include/bsp.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_BSP_HPP #define _TCOD_BSP_HPP @@ -50,11 +50,11 @@ public : class TCODLIB_API TCODBsp : public TCODTree { public : - int x,y,w,h; // + int x,y,w,h; // int position; // position of splitting bool horizontal; // horizontal splitting ? - uint8_t level; // level in the tree - + uint8_t level; // level in the tree + /** @PageName bsp_init @PageFather bsp @@ -82,20 +82,20 @@ public : @Py bsp_remove_sons(node) @C# TCODBsp::removeSons() @Param node In the C version, the node reference. - @CppEx + @CppEx TCODBsp *myBSP = new TCODBsp(0,0,50,50); // create a tree - myBSP->splitRecursive(NULL,4,5,5,1.5f,1.5f); + myBSP->splitRecursive(NULL,4,5,5,1.5f,1.5f); // clear it (keep only the root) myBSP->removeSons(); // and rebuild another random tree - myBSP->splitRecursive(NULL,4,5,5,1.5f,1.5f); - @CEx + myBSP->splitRecursive(NULL,4,5,5,1.5f,1.5f); + @CEx TCOD_bsp_t *my_bsp=TCOD_bsp_new_with_size(0,0,50,50); TCOD_bsp_split_recursive(my_bsp,NULL,4,5,5,1.5f,1.5f); TCOD_bsp_remove_sons(my_bsp); TCOD_bsp_split_recursive(my_bsp,NULL,4,5,5,1.5f,1.5f); - @PyEx + @PyEx my_bsp=libtcod.bsp_new_with_size(0,0,50,50) libtcod.bsp_split_recursive(my_bsp,0,4,5,5,1.5,1.5) libtcod.bsp_remove_sons(my_bsp) @@ -112,19 +112,19 @@ public : @Py bsp_delete(node) @C# void TCODBsp::Dispose() @Param node In the C version, the node reference. - @CppEx + @CppEx TCODBsp *myBSP = new TCODBsp(0,0,50,50); // create a tree - myBSP->splitRecursive(NULL,4,5,5,1.5f,1.5f); + myBSP->splitRecursive(NULL,4,5,5,1.5f,1.5f); // use the tree ... // delete the tree - delete myBSP; - @CEx + delete myBSP; + @CEx TCOD_bsp_t *my_bsp=TCOD_bsp_new_with_size(0,0,50,50); TCOD_bsp_split_recursive(my_bsp,NULL,4,5,5,1.5f,1.5f); - // use the tree ... + // use the tree ... TCOD_bsp_delete(my_bsp); - @PyEx + @PyEx my_bsp=libtcod.bsp_new_with_size(0,0,50,50) libtcod.bsp_split_recursive(my_bsp,0,4,5,5,1.5,1.5) # use the tree ... @@ -147,13 +147,13 @@ public : @Param position Coordinate of the splitting position. If horizontal is true, x <= position < x+w Else, y <= position < y+h - @CppEx + @CppEx TCODBsp *myBSP = new TCODBsp(0,0,50,50); myBSP->splitOnce(true,20); // horizontal split into two nodes : (0,0,50,20) and (0,20,50,30) - @CEx + @CEx TCOD_bsp_t *my_bsp=TCOD_bsp_new_with_size(0,0,50,50); TCOD_bsp_split_once(my_bsp,false,20); // vertical split into two nodes : (0,0,20,50) and (20,0,30,50) - @PyEx + @PyEx my_bsp=libtcod.bsp_new_with_size(0,0,50,50) libtcod.bsp_split_once(my_bsp,False,20) # vertical split into two nodes : (0,0,20,50) and (20,0,30,50) */ @@ -172,14 +172,14 @@ public : @Param nb Number of recursion levels. @Param minHSize, minVSize minimum values of w and h for a node. A node is split only if the resulting sub-nodes are bigger than minHSize x minVSize @Param maxHRatio, maxVRation maximum values of w/h and h/w for a node. If a node does not conform, the splitting orientation is forced to reduce either the w/h or the h/w ratio. Use values near 1.0 to promote square nodes. - @CppEx + @CppEx // Do a 4 levels BSP tree (the region is split into a maximum of 2*2*2*2 sub-regions). TCODBsp *myBSP = new TCODBsp(0,0,50,50); - myBSP->splitRecursive(NULL,4,5,5,1.5f,1.5f); - @CEx + myBSP->splitRecursive(NULL,4,5,5,1.5f,1.5f); + @CEx TCOD_bsp_t *my_bsp=TCOD_bsp_new_with_size(0,0,50,50); TCOD_bsp_split_recursive(my_bsp,NULL,4,5,5,1.5f,1.5f); - @PyEx + @PyEx my_bsp=libtcod.bsp_new_with_size(0,0,50,50) libtcod.bsp_split_recursive(my_bsp,0,4,5,5,1.5,1.5) */ @@ -197,21 +197,21 @@ You can use it if you changed the nodes size and position while using the BSP tr @C# void TCODBsp::resize(int x, int y, int w, int h) @Param node In the C version, the root node created with TCOD_bsp_new_with_size, or a node obtained by splitting. @Param x,y,w,h New position and size of the node. The original rectangular area covered by the node should be included in the new one to ensure that every splitting edge stay inside its node. - @CppEx + @CppEx // We create a BSP, do some processing that will modify the x,y,w,h fields of the tree nodes, then reset all the nodes to their original size. TCODBsp *myBSP = new TCODBsp(0,0,50,50); - myBSP->splitRecursive(NULL,4,5,5,1.5f,1.5f); + myBSP->splitRecursive(NULL,4,5,5,1.5f,1.5f); // ... do something with the tree here myBSP->resize(0,0,50,50); - @CEx + @CEx TCOD_bsp_t *my_bsp=TCOD_bsp_new_with_size(0,0,50,50); TCOD_bsp_split_recursive(my_bsp,NULL,4,5,5,1.5f,1.5f); - // ... do something with the tree here + // ... do something with the tree here TCOD_bsp_resize(my_bsp,0,0,50,50); - @PyEx + @PyEx my_bsp=libtcod.bsp_new_with_size(0,0,50,50) libtcod.bsp_split_recursive(my_bsp,0,4,5,5,1.5,1.5) - # ... do something with the tree here + # ... do something with the tree here libtcod.bsp_resize(my_bsp,0,0,50,50) */ void resize(int x,int y, int w, int h); @@ -221,16 +221,16 @@ You can use it if you changed the nodes size and position while using the BSP tr @PageFather bsp @PageTitle Reading information from the tree @FuncDesc Once you have built a BSP tree, you can retrieve information from any node. The node gives you free access to its fields : - @Cpp + @Cpp class TCODBsp { public : - int x,y,w,h; // + int x,y,w,h; // int position; // position of splitting bool horizontal; // horizontal splitting ? - uint8_t level; // level in the tree + uint8_t level; // level in the tree ... } - @C + @C typedef struct { int x,y,w,h; int position; @@ -238,7 +238,7 @@ You can use it if you changed the nodes size and position while using the BSP tr uint8_t level; ... } TCOD_bsp_t; - @C# + @C# class TCODBsp { public int x { get; set; } @@ -259,19 +259,19 @@ You can use it if you changed the nodes size and position while using the BSP tr @PageName bsp_read @FuncTitle Navigate in the tree @FuncDesc You can navigate from a node to its sons or its parent using one of those functions. Each function returns NULL if the corresponding node does not exists (if the node is not split for getLeft and getRight, and if the node is the root node for getFather). - @Cpp + @Cpp TCODBsp *TCODBsp::getLeft() const TCODBsp *TCODBsp::getRight() const TCODBsp *TCODBsp::getFather() const - @C + @C TCOD_bsp_t * TCOD_bsp_left(TCOD_bsp_t *node) TCOD_bsp_t * TCOD_bsp_right(TCOD_bsp_t *node) TCOD_bsp_t * TCOD_bsp_father(TCOD_bsp_t *node) - @Py + @Py bsp_left(node) bsp_right(node) bsp_father(node) - @C# + @C# TCODBsp TCODBsp::getLeft() TCODBsp TCODBsp::getRight() TCODBsp TCODBsp::getFather() @@ -339,28 +339,28 @@ You can use it if you changed the nodes size and position while using the BSP tr Pre orderIn orderPost orderLevel orderInverted level
order - @Cpp + @Cpp class ITCODBspCallback { public : virtual bool visitNode(TCODBsp *node, void *userData) = 0; }; - + bool TCODBsp::traversePreOrder(ITCODBspCallback *callback, void *userData) bool TCODBsp::traverseInOrder(ITCODBspCallback *callback, void *userData) bool TCODBsp::traversePostOrder(ITCODBspCallback *callback, void *userData) bool TCODBsp::traverseLevelOrder(ITCODBspCallback *callback, void *userData) bool TCODBsp::traverseInvertedLevelOrder(ITCODBspCallback *callback, void *userData) - @C + @C typedef bool (*TCOD_bsp_callback_t)(TCOD_bsp_t *node, void *userData) - + bool TCOD_bsp_traverse_pre_order(TCOD_bsp_t *node, TCOD_bsp_callback_t callback, void *userData) bool TCOD_bsp_traverse_in_order(TCOD_bsp_t *node, TCOD_bsp_callback_t callback, void *userData) bool TCOD_bsp_traverse_post_order(TCOD_bsp_t *node, TCOD_bsp_callback_t callback, void *userData) bool TCOD_bsp_traverse_level_order(TCOD_bsp_t *node, TCOD_bsp_callback_t callback, void *userData) bool TCOD_bsp_traverse_inverted_level_order(TCOD_bsp_t *node, TCOD_bsp_callback_t callback, void *userData) - @Py + @Py def bsp_callback(node, userData) : # ... - + bsp_traverse_pre_order(node, callback, userData=0) bsp_traverse_in_order(node, callback, userData=0) bsp_traverse_post_order(node, callback, userData=0) @@ -377,7 +377,7 @@ You can use it if you changed the nodes size and position while using the BSP tr It receives the current node and the custom data as parameters If it returns false, the traversal is interrupted. @Param userData Custom data to pass to the callback. - @CppEx + @CppEx class MyCallback : public ITCODBspCallback { public : bool visitNode(TCODBsp *node, void *userData) { @@ -386,13 +386,13 @@ You can use it if you changed the nodes size and position while using the BSP tr } }; myBSP->traversePostOrder(new MyListener(),NULL); - @CEx + @CEx bool my_callback(TCOD_bsp_t *node, void *userData) { printf("node pos %dx%d size %dx%d level %d\n",node->x,node->y,node->w,node->h,node->level); return true; } TCOD_bsp_traverse_post_order(my_bsp,my_callback,NULL); - @PyEx + @PyEx def my_callback(node, userData) : print "node pos %dx%d size %dx%d level %d"%(node.x,node.y,node.w,node.h,node.level)) return True diff --git a/tcod_sys/libtcod/include/color.h b/tcod_sys/libtcod/include/color.h index 3050f5c53..a3d109c3d 100644 --- a/tcod_sys/libtcod/include/color.h +++ b/tcod_sys/libtcod/include/color.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_COLOR_H #define _TCOD_COLOR_H @@ -34,33 +34,45 @@ extern "C" { #endif +/** + * \brief An RGB color struct. + */ typedef struct { uint8_t r,g,b; } TCOD_color_t; /* constructors */ TCODLIB_API TCOD_color_t TCOD_color_RGB(uint8_t r, uint8_t g, uint8_t b); -TCODLIB_API TCOD_color_t TCOD_color_HSV(float h, float s, float v); +TCODLIB_API TCOD_color_t TCOD_color_HSV(float hue, float saturation, + float value); /* basic operations */ -TCODLIB_API bool TCOD_color_equals (TCOD_color_t c1, TCOD_color_t c2); -TCODLIB_API TCOD_color_t TCOD_color_add (TCOD_color_t c1, TCOD_color_t c2); -TCODLIB_API TCOD_color_t TCOD_color_subtract (TCOD_color_t c1, TCOD_color_t c2); -TCODLIB_API TCOD_color_t TCOD_color_multiply (TCOD_color_t c1, TCOD_color_t c2); -TCODLIB_API TCOD_color_t TCOD_color_multiply_scalar (TCOD_color_t c1, float value); -TCODLIB_API TCOD_color_t TCOD_color_lerp (TCOD_color_t c1, TCOD_color_t c2, float coef); +TCODLIB_API bool TCOD_color_equals(TCOD_color_t c1, TCOD_color_t c2); +TCODLIB_API TCOD_color_t TCOD_color_add(TCOD_color_t c1, TCOD_color_t c2); +TCODLIB_API TCOD_color_t TCOD_color_subtract(TCOD_color_t c1, TCOD_color_t c2); +TCODLIB_API TCOD_color_t TCOD_color_multiply(TCOD_color_t c1, TCOD_color_t c2); +TCODLIB_API TCOD_color_t TCOD_color_multiply_scalar(TCOD_color_t c1, + float value); +TCODLIB_API TCOD_color_t TCOD_color_lerp(TCOD_color_t c1, TCOD_color_t c2, + float coef); /* HSV transformations */ -TCODLIB_API void TCOD_color_set_HSV (TCOD_color_t *c,float h, float s, float v); -TCODLIB_API void TCOD_color_get_HSV (TCOD_color_t c,float * h, float * s, float * v); -TCODLIB_API float TCOD_color_get_hue (TCOD_color_t c); -TCODLIB_API void TCOD_color_set_hue (TCOD_color_t *c, float h); -TCODLIB_API float TCOD_color_get_saturation (TCOD_color_t c); -TCODLIB_API void TCOD_color_set_saturation (TCOD_color_t *c, float s); -TCODLIB_API float TCOD_color_get_value (TCOD_color_t c); -TCODLIB_API void TCOD_color_set_value (TCOD_color_t *c, float v); -TCODLIB_API void TCOD_color_shift_hue (TCOD_color_t *c, float hshift); -TCODLIB_API void TCOD_color_scale_HSV (TCOD_color_t *c, float scoef, float vcoef); +TCODLIB_API void TCOD_color_set_HSV(TCOD_color_t *color, + float hue, float saturation, float value); +TCODLIB_API void TCOD_color_get_HSV( + TCOD_color_t color, float *hue, float *saturation, float *value); +TCODLIB_API float TCOD_color_get_hue(TCOD_color_t color); +TCODLIB_API void TCOD_color_set_hue(TCOD_color_t *color, float hue); +TCODLIB_API float TCOD_color_get_saturation(TCOD_color_t color); +TCODLIB_API void TCOD_color_set_saturation(TCOD_color_t *color, + float saturation); +TCODLIB_API float TCOD_color_get_value(TCOD_color_t color); +TCODLIB_API void TCOD_color_set_value(TCOD_color_t *color, float value); +TCODLIB_API void TCOD_color_shift_hue(TCOD_color_t *color, float hshift); +TCODLIB_API void TCOD_color_scale_HSV(TCOD_color_t *color, + float saturation_coef, float value_coef); /* color map */ -TCODLIB_API void TCOD_color_gen_map(TCOD_color_t *map, int nb_key, TCOD_color_t const *key_color, int const *key_index); +TCODLIB_API void TCOD_color_gen_map(TCOD_color_t *map, int nb_key, + const TCOD_color_t *key_color, + const int *key_index); /* color names */ enum { diff --git a/tcod_sys/libtcod/include/color.hpp b/tcod_sys/libtcod/include/color.hpp index df567cd5b..557fbe314 100644 --- a/tcod_sys/libtcod/include/color.hpp +++ b/tcod_sys/libtcod/include/color.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_COLOR_HPP #define _TCOD_COLOR_HPP @@ -78,7 +78,7 @@ A color is defined by its red, green and blue component between 0 and 255. You can use the following predefined colors (hover over a color to see its full name and R,G,B values): @ColorTable - @CppEx + @CppEx TCODColor::desaturatedRed TCODColor::lightestRed TCODColor::lighterRed @@ -87,7 +87,7 @@ You can use the following predefined colors (hover over a color to see its full TCODColor::darkRed TCODColor::darkerRed TCODColor::darkestRed - @CEx + @CEx TCOD_desaturated_red TCOD_lightest_red TCOD_lighter_red @@ -96,7 +96,7 @@ You can use the following predefined colors (hover over a color to see its full TCOD_dark_red TCOD_darker_red TCOD_darkest_red - @PyEx + @PyEx libtcod.desaturated_red libtcod.lightest_red libtcod.lighter_red @@ -105,7 +105,7 @@ You can use the following predefined colors (hover over a color to see its full libtcod.dark_red libtcod.darker_red libtcod.darkest_red - @C#Ex + @C#Ex TCODColor::desaturatedRed TCODColor::lightestRed TCODColor::lighterRed @@ -134,10 +134,10 @@ public : @PageName color @FuncTitle Create your own colors @FuncDesc You can create your own colours using a set of constructors, both for RGB and HSV values. - @CppEx + @CppEx TCODColor myColor(24,64,255); //RGB TCODColor myOtherColor(321.0f,0.7f,1.0f); //HSV - @CEx + @CEx TCOD_color_t my_color={24,64,255}; /* RGB */ TCOD_color_t my_other_color = TCOD_color_RGB(24,64,255); /* RGB too */ TCOD_color_t my_yet_another_color = TCOD_color_HSV(321.0f,0.7f,1.0f); /* HSV */ @@ -154,19 +154,19 @@ public : /** @PageName color @FuncTitle Compare two colors - @CppEx + @CppEx if (myColor == TCODColor::yellow) { ... } if (myColor != TCODColor::white) { ... } - @CEx + @CEx if (TCOD_color_equals(my_color,TCOD_yellow)) { ... } if (!TCOD_color_equals(my_color,TCOD_white)) { ... } - @PyEx + @PyEx if my_color == libtcod.yellow : ... if my_color != litbcod.white : ... - @C#Ex + @C#Ex if (myColor.Equal(TCODColor.yellow)) { ... } if (myColor.NotEqual(TCODColor.white)) { ... } - @LuaEx + @LuaEx if myColor == tcod.color.yellow then ... end */ bool operator == (const TCODColor & c) const { @@ -334,15 +334,15 @@ coef should be between 0.0 and 1.0 but you can as well use other values @PageName color @FuncTitle Define a color's hue, saturation or lightness @FuncDesc These functions set only a single component in the HSV color space. - @Cpp + @Cpp void TCODColor::setHue (float h) void TCODColor::setSaturation (float s) void TCODColor::setValue (float v) - @C + @C void TCOD_color_set_hue (TCOD_color_t *c, float h) void TCOD_color_set_saturation (TCOD_color_t *c, float s) void TCOD_color_set_value (TCOD_color_t *c, float v) - @Lua + @Lua Color:setHue(h) Color:setSaturation(s) Color:setValue(v) @@ -373,11 +373,11 @@ coef should be between 0.0 and 1.0 but you can as well use other values @PageName color @FuncTitle Get a color's hue, saturation or value @FuncDesc Should you need to extract only one of the HSV components, these functions are what you should call. Note that if you need all three values, it's way less burdensome for the CPU to call TCODColor::getHSV(). - @Cpp + @Cpp float TCODColor::getHue () float TCODColor::getSaturation () float TCODColor::getValue () - @C + @C float TCOD_color_get_hue (TCOD_color_t c) float TCOD_color_get_saturation (TCOD_color_t c) float TCOD_color_get_value (TCOD_color_t c) @@ -452,17 +452,17 @@ coef should be between 0.0 and 1.0 but you can as well use other values @Param keyColor Array of nbKey colors containing the color of each key @Param keyIndex Array of nbKey integers containing the index of each key. If you want to fill the map array, keyIndex[0] must be 0 and keyIndex[nbKey-1] is the number of elements in map minus 1 but you can also use the function to fill only a part of the map array. - @CppEx + @CppEx int idx[] = { 0, 4, 8 }; // indexes of the keys TCODColor col[] = { TCODColor( 0,0,0 ), TCODColor(255,0,0), TCODColor(255,255,255) }; // colors : black, red, white TCODColor map[9]; TCODColor::genMap(map,3,col,idx); - @CEx + @CEx int idx[] = { 0, 4, 8 }; // indexes of the keys TCOD_color_t col[] = { { 0,0,0 }, {255,0,0}, {255,255,255} }; // colors : black, red, white TCOD_color_t map[9]; TCOD_color_gen_map(map,3,col,idx); - @PyEx + @PyEx idx = [ 0, 4, 8 ] # indexes of the keys col = [ libtcod.Color( 0,0,0 ), libtcod.Color( 255,0,0 ), libtcod.Color(255,255,255) ] # colors : black, red, white map=libtcod.color_gen_map(col,idx) diff --git a/tcod_sys/libtcod/include/console.h b/tcod_sys/libtcod/include/console.h index 6393f595b..cab348adb 100644 --- a/tcod_sys/libtcod/include/console.h +++ b/tcod_sys/libtcod/include/console.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_CONSOLE_H #define _TCOD_CONSOLE_H @@ -131,13 +131,6 @@ TCODLIB_API void TCOD_console_delete(TCOD_console_t console); TCODLIB_API void TCOD_console_credits(void); TCODLIB_API void TCOD_console_credits_reset(void); TCODLIB_API bool TCOD_console_credits_render(int x, int y, bool alpha); - -/* REXPaint support */ -TCODLIB_API TCOD_console_t TCOD_console_from_xp(const char *filename); -TCODLIB_API bool TCOD_console_load_xp(TCOD_console_t con, const char *filename); -TCODLIB_API bool TCOD_console_save_xp(TCOD_console_t con, const char *filename, int compress_level); -TCODLIB_API TCOD_list_t TCOD_console_list_from_xp(const char *filename); -TCODLIB_API bool TCOD_console_list_save_xp(TCOD_list_t console_list, const char *filename, int compress_level); #ifdef __cplusplus } #endif diff --git a/tcod_sys/libtcod/include/console.hpp b/tcod_sys/libtcod/include/console.hpp index 3f6d92f59..8accd6543 100644 --- a/tcod_sys/libtcod/include/console.hpp +++ b/tcod_sys/libtcod/include/console.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,11 +25,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_CONSOLE_HPP #define _TCOD_CONSOLE_HPP #include "console.h" +#include "console_rexpaint.h" #ifdef TCOD_CONSOLE_SUPPORT @@ -1541,7 +1542,7 @@ public : tcod.console.blit(offscreenConsole,0,0,40,20,libtcod.TCODConsole_root,5,5,255) */ TCODConsole(int w, int h); - + /** @PageName console_offscreen @FuncTitle Creating an offscreen console from a .asc or .apf file diff --git a/tcod_sys/libtcod/include/console_rexpaint.h b/tcod_sys/libtcod/include/console_rexpaint.h new file mode 100644 index 000000000..043d821f8 --- /dev/null +++ b/tcod_sys/libtcod/include/console_rexpaint.h @@ -0,0 +1,50 @@ +/* +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. +* +* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef TCOD_CONSOLE_REXPAINT_H_ +#define TCOD_CONSOLE_REXPAINT_H_ + +#include "libtcod_portability.h" +#include "console.h" + +#ifdef __cplusplus +extern "C" { +#endif + +TCODLIB_API TCOD_console_t TCOD_console_from_xp(const char *filename); +TCODLIB_API bool TCOD_console_load_xp(TCOD_console_t con, const char *filename); +TCODLIB_API bool TCOD_console_save_xp(TCOD_console_t con, + const char *filename, int compress_level); +TCODLIB_API TCOD_list_t TCOD_console_list_from_xp(const char *filename); +TCODLIB_API bool TCOD_console_list_save_xp( + TCOD_list_t console_list, const char *filename, int compress_level); + +#ifdef __cplusplus +} +#endif + +#endif /* TCOD_CONSOLE_REXPAINT_H_ */ diff --git a/tcod_sys/libtcod/include/console_types.h b/tcod_sys/libtcod/include/console_types.h index fa3d29dab..054190fdf 100644 --- a/tcod_sys/libtcod/include/console_types.h +++ b/tcod_sys/libtcod/include/console_types.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_CONSOLE_TYPES_H #define _TCOD_CONSOLE_TYPES_H @@ -246,25 +246,60 @@ typedef enum { TCOD_KEY_RELEASED=2, } TCOD_key_status_t; -/* custom font flags */ +/** + * These font flags can be OR'd together into a bit-field and passed to + * TCOD_console_set_custom_font + */ typedef enum { - TCOD_FONT_LAYOUT_ASCII_INCOL=1, - TCOD_FONT_LAYOUT_ASCII_INROW=2, - TCOD_FONT_TYPE_GREYSCALE=4, - TCOD_FONT_TYPE_GRAYSCALE=4, - TCOD_FONT_LAYOUT_TCOD=8, + /** Tiles are arranged in column-major order. + * + * 0 3 6 + * 1 4 7 + * 2 5 8 + */ + TCOD_FONT_LAYOUT_ASCII_INCOL=1, + /** Tiles are arranged in row-major order. + * + * 0 1 2 + * 3 4 5 + * 6 7 8 + */ + TCOD_FONT_LAYOUT_ASCII_INROW=2, + /** Converts all tiles into a monochrome gradient. */ + TCOD_FONT_TYPE_GREYSCALE=4, + TCOD_FONT_TYPE_GRAYSCALE=4, + /** A unique layout used by some of libtcod's fonts. */ + TCOD_FONT_LAYOUT_TCOD=8, } TCOD_font_flags_t; - +/** + * The available renderers. + */ typedef enum { - TCOD_RENDERER_GLSL, - TCOD_RENDERER_OPENGL, - TCOD_RENDERER_SDL, - TCOD_NB_RENDERERS, + /** An OpenGL implementation using a shader. */ + TCOD_RENDERER_GLSL, + /** + * An OpenGL implementation without a shader. + * + * Performs worse than TCOD_RENDERER_GLSL without many benefits. + */ + TCOD_RENDERER_OPENGL, + /** + * A software based renderer. + * + * The font file is loaded into RAM instead of VRAM in this implementation. + */ + TCOD_RENDERER_SDL, + TCOD_NB_RENDERERS, } TCOD_renderer_t; +/** + * \enum TCOD_alignment_t + * + * Print justification options. + */ typedef enum { - TCOD_LEFT, - TCOD_RIGHT, - TCOD_CENTER + TCOD_LEFT, + TCOD_RIGHT, + TCOD_CENTER } TCOD_alignment_t; #endif /* _TCOD_CONSOLE_TYPES_H */ diff --git a/tcod_sys/libtcod/include/fov.h b/tcod_sys/libtcod/include/fov.h index 8387512ec..d574deece 100644 --- a/tcod_sys/libtcod/include/fov.h +++ b/tcod_sys/libtcod/include/fov.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_FOV_H #define _TCOD_FOV_H diff --git a/tcod_sys/libtcod/include/fov.hpp b/tcod_sys/libtcod/include/fov.hpp index b4b951cf6..2ea0d0f33 100644 --- a/tcod_sys/libtcod/include/fov.hpp +++ b/tcod_sys/libtcod/include/fov.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_FOV_HPP #define _TCOD_FOV_HPP @@ -52,9 +52,9 @@ class TCODLIB_API TCODMap { @Py map_new (width, height) @C# TCODMap::TCODMap(int width, int height) @Param width, height The size of the map (in map cells). - */ + */ TCODMap(int width, int height); - + /** @PageName fov_init @PageFather fov @@ -68,9 +68,9 @@ class TCODLIB_API TCODMap { @Param x, y Coordinate of the cell that we want to update. @Param isTransparent If true, this cell will let the light pass else it will block the light. @Param isWalkable If true, creatures can walk true this cell (it is not a wall). - */ + */ void setProperties(int x,int y, bool isTransparent, bool isWalkable); - + /** @PageName fov_init @PageFather fov @@ -86,9 +86,9 @@ class TCODLIB_API TCODMap { @Param map In the C version, the map handler returned by the TCOD_map_new function. @Param walkable Whether the cells should be walkable. @Param transparent Whether the cells should be transparent. - */ + */ void clear(bool transparent=false, bool walkable=false); - + /** @PageName fov_init @PageFather fov @@ -100,22 +100,22 @@ class TCODLIB_API TCODMap { @C# void TCODMap::copy (TCODMap source) @Param source The map containing the source data. @Param dest In C and Python version, the map where data is copied. - @CppEx + @CppEx TCODMap * map = new TCODMap(50,50); // allocate the map map->setProperties(10,10,true,true); // set a cell as 'empty' TCODMap * map2 = new TCODMap(10,10); // allocate another map map2->copy(map); // copy map data into map2, reallocating it to 50x50 - @CEx + @CEx TCOD_map_t map = TCOD_map_new(50,50); TCOD_map_t map2 = TCOD_map_new(10,10); TCOD_map_set_properties(map,10,10,true,true); TCOD_map_copy(map,map2); - @PyEx + @PyEx map = libtcod.map_new(50,50) map2 = libtcod.map_new(10,10) libtcod.map_set_properties(map,10,10,True,True) libtcod.map_copy(map,map2) - */ + */ void copy (const TCODMap *source); /** @@ -123,11 +123,11 @@ class TCODLIB_API TCODMap { @PageTitle Computing the field of view @PageFather fov @FuncDesc Once your map is allocated and empty cells have been defined, you can calculate the field of view with : -

typedef enum { FOV_BASIC, 
-               FOV_DIAMOND, 
-               FOV_SHADOW, 
+			
typedef enum { FOV_BASIC,
+               FOV_DIAMOND,
+               FOV_SHADOW,
                FOV_PERMISSIVE_0,FOV_PERMISSIVE_1,FOV_PERMISSIVE_2,FOV_PERMISSIVE_3,
-               FOV_PERMISSIVE_4,FOV_PERMISSIVE_5,FOV_PERMISSIVE_6,FOV_PERMISSIVE_7,FOV_PERMISSIVE_8, 
+               FOV_PERMISSIVE_4,FOV_PERMISSIVE_5,FOV_PERMISSIVE_6,FOV_PERMISSIVE_7,FOV_PERMISSIVE_8,
                FOV_RESTRICTIVE,
                NB_FOV_ALGORITHMS } TCOD_fov_algorithm_t;
             
@@ -135,13 +135,13 @@ class TCODLIB_API TCODMap { * FOV_DIAMOND : based on this algorithm * FOV_SHADOW : based on this algorithm * FOV_PERMISSIVE_x : based on this algorithm - Permissive has a variable permissiveness parameter. You can either use the constants FOV_PERMISSIVE_x, x between 0 (the less permissive) and 8 (the more permissive), or using the macro FOV_PERMISSIVE(x). + Permissive has a variable permissiveness parameter. You can either use the constants FOV_PERMISSIVE_x, x between 0 (the less permissive) and 8 (the more permissive), or using the macro FOV_PERMISSIVE(x). * FOV_RESTRICTIVE : Mingos' Restrictive Precise Angle Shadowcasting (MRPAS). Original implementation here. Comparison of the algorithms : Check this. @Cpp void TCODMap::computeFov(int playerX,int playerY, int maxRadius=0,bool light_walls = true, TCOD_fov_algorithm_t algo = FOV_BASIC) @C void TCOD_map_compute_fov(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls, TCOD_fov_algorithm_t algo) @Py map_compute_fov(map, player_x, player_y, max_radius=0, light_walls=True, algo=FOV_BASIC ) - @C# + @C# void TCODMap::computeFov(int playerX, int playerY) void TCODMap::computeFov(int playerX, int playerY, int maxRadius) void TCODMap::computeFov(int playerX, int playerY, int maxRadius,bool light_walls) @@ -153,18 +153,18 @@ class TCODLIB_API TCODMap { @Param maxRadius If > 0, the fov is only computed up to maxRadius cells away from the player. Else, the range is unlimited. @Param light_walls Whether the wall cells near ground cells in fov must be in fov too. @Param algo FOV algorithm to use. - @CppEx + @CppEx TCODMap *map = new TCODMap(50,50); // allocate the map map->setProperties(10,10,true,true); // set a cell as 'empty' map->computeFov(10,10); // calculate fov from the cell 10x10 (basic raycasting, unlimited range, walls lighting on) - @CEx + @CEx TCOD_map_t map = TCOD_map_new(50,50); TCOD_map_set_properties(map,10,10,true,true); TCOD_map_compute_fov(map,10,10,0,true,FOV_SHADOW); // using shadow casting - @PyEx + @PyEx map = libtcod.map_new(50,50) libtcod.map_set_properties(map,10,10,True,True) - libtcod.map_compute_fov(map,10,10,0,True,libtcod.FOV_PERMISSIVE(2)) + libtcod.map_compute_fov(map,10,10,0,True,libtcod.FOV_PERMISSIVE(2)) */ void computeFov(int playerX,int playerY, int maxRadius = 0,bool light_walls = true, TCOD_fov_algorithm_t algo = FOV_BASIC); @@ -182,44 +182,44 @@ class TCODLIB_API TCODMap { @Param x,y Coordinates of the cell we want to check. 0 <= x < map width. 0 <= y < map height. - @CppEx + @CppEx TCODMap *map = new TCODMap(50,50); // allocate the map map->setProperties(10,10,true,true); // set a cell as 'empty' map->computeFov(10,10); // calculate fov from the cell 10x10 - bool visible=map->isInFov(10,10); // is the cell 10x10 visible ? - @CEx + bool visible=map->isInFov(10,10); // is the cell 10x10 visible ? + @CEx TCOD_map_t map = TCOD_map_new(50,50); TCOD_map_set_properties(map,10,10,true,true); TCOD_map_compute_fov(map,10,10); bool visible = TCOD_map_is_in_fov(map,10,10); - @PyEx + @PyEx map = libtcod.map_new(50,50) libtcod.map_set_properties(map,10,10,True,True) libtcod.map_compute_fov(map,10,10) visible = libtcod.map_is_in_fov(map,10,10) - */ + */ bool isInFov(int x,int y) const; /** @PageName fov_get @FuncTitle Checking a cell transparency/walkability @FuncDesc You can also retrieve transparent/walkable information with : - @Cpp + @Cpp bool TCODMap::isTransparent(int x, int y) const bool TCODMap::isWalkable(int x, int y) const - @C + @C bool TCOD_map_is_transparent(TCOD_map_t map, int x, int y) bool TCOD_map_is_walkable(TCOD_map_t map, int x, int y) - @Py + @Py map_is_transparent(map, x, y) map_is_walkable(map, x, y) - @C# + @C# bool TCODMap::isTransparent(int x, int y) bool TCODMap::isWalkable(int x, int y) @Param map In the C version, the map handler returned by the TCOD_map_new function. @Param x,y Coordinates of the cell we want to check. 0 <= x < map width. 0 <= y < map height. - */ + */ bool isTransparent(int x, int y) const; bool isWalkable(int x, int y) const; @@ -227,20 +227,20 @@ class TCODLIB_API TCODMap { @PageName fov_get @FuncTitle Getting the map size @FuncDesc You can retrieve the map size with : - @Cpp + @Cpp int TCODMap::getWidth() const int TCODMap::getHeight() const - @C + @C int TCOD_map_get_width(TCOD_map_t map) int TCOD_map_get_height(TCOD_map_t map) - @Py + @Py map_get_width(map) map_get_height(map) @C# int TCODMap::getWidth() int TCODMap::getHeight() @Param map In the C version, the map handler returned by the TCOD_map_new function. - */ + */ int getWidth() const; int getHeight() const; diff --git a/tcod_sys/libtcod/include/fov_types.h b/tcod_sys/libtcod/include/fov_types.h index 8d7e088f7..200464788 100644 --- a/tcod_sys/libtcod/include/fov_types.h +++ b/tcod_sys/libtcod/include/fov_types.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_FOV_TYPES_H #define _TCOD_FOV_TYPES_H diff --git a/tcod_sys/libtcod/include/heightmap.h b/tcod_sys/libtcod/include/heightmap.h index 14d5ac8ff..f113829f8 100644 --- a/tcod_sys/libtcod/include/heightmap.h +++ b/tcod_sys/libtcod/include/heightmap.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -69,8 +70,8 @@ TCODLIB_API void TCOD_heightmap_rain_erosion(TCOD_heightmap_t *hm, int nbDrops,f TCODLIB_API void TCOD_heightmap_kernel_transform(TCOD_heightmap_t *hm, int kernelsize, const int *dx, const int *dy, const float *weight, float minLevel,float maxLevel); TCODLIB_API void TCOD_heightmap_add_voronoi(TCOD_heightmap_t *hm, int nbPoints, int nbCoef, const float *coef,TCOD_random_t rnd); TCODLIB_API void TCOD_heightmap_mid_point_displacement(TCOD_heightmap_t *hm, TCOD_random_t rnd, float roughness); -TCODLIB_API void TCOD_heightmap_add_fbm(TCOD_heightmap_t *hm, TCOD_noise_t noise,float mulx, float muly, float addx, float addy, float octaves, float delta, float scale); -TCODLIB_API void TCOD_heightmap_scale_fbm(TCOD_heightmap_t *hm, TCOD_noise_t noise,float mulx, float muly, float addx, float addy, float octaves, float delta, float scale); +TCODLIB_API void TCOD_heightmap_add_fbm(TCOD_heightmap_t *hm, TCOD_noise_t noise,float mulx, float muly, float addx, float addy, float octaves, float delta, float scale); +TCODLIB_API void TCOD_heightmap_scale_fbm(TCOD_heightmap_t *hm, TCOD_noise_t noise,float mulx, float muly, float addx, float addy, float octaves, float delta, float scale); TCODLIB_API void TCOD_heightmap_islandify(TCOD_heightmap_t *hm, float seaLevel,TCOD_random_t rnd); #ifdef __cplusplus } diff --git a/tcod_sys/libtcod/include/heightmap.hpp b/tcod_sys/libtcod/include/heightmap.hpp index 9eb2a9e96..e7b0643d4 100644 --- a/tcod_sys/libtcod/include/heightmap.hpp +++ b/tcod_sys/libtcod/include/heightmap.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/include/howto.hpp b/tcod_sys/libtcod/include/howto.hpp index 760f7ed96..afc32c11d 100644 --- a/tcod_sys/libtcod/include/howto.hpp +++ b/tcod_sys/libtcod/include/howto.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - /* This file contains no code. It's only an input for doctcod */ /** diff --git a/tcod_sys/libtcod/include/image.h b/tcod_sys/libtcod/include/image.h index 593ae30b4..3a81c5717 100644 --- a/tcod_sys/libtcod/include/image.h +++ b/tcod_sys/libtcod/include/image.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,10 +25,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_IMAGE_H #define _TCOD_IMAGE_H +#include "libtcod_portability.h" #include "color.h" #ifdef TCOD_IMAGE_SUPPORT @@ -60,7 +61,7 @@ TCODLIB_API void TCOD_image_put_pixel(TCOD_image_t image,int x, int y,TCOD_color #ifdef TCOD_CONSOLE_SUPPORT TCODLIB_API void TCOD_image_blit(TCOD_image_t image, TCOD_console_t console, float x, float y, TCOD_bkgnd_flag_t bkgnd_flag, float scalex, float scaley, float angle); -TCODLIB_API void TCOD_image_blit_rect(TCOD_image_t image, TCOD_console_t console, int x, int y, int w, int h, +TCODLIB_API void TCOD_image_blit_rect(TCOD_image_t image, TCOD_console_t console, int x, int y, int w, int h, TCOD_bkgnd_flag_t bkgnd_flag); TCODLIB_API void TCOD_image_blit_2x(TCOD_image_t image, TCOD_console_t dest, int dx, int dy, int sx, int sy, int w, int h); #endif diff --git a/tcod_sys/libtcod/include/image.hpp b/tcod_sys/libtcod/include/image.hpp index ba7b95e39..ad90548ff 100644 --- a/tcod_sys/libtcod/include/image.hpp +++ b/tcod_sys/libtcod/include/image.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_IMAGE_HPP #define _TCOD_IMAGE_HPP @@ -47,9 +47,9 @@ public : @PageName image @PageTitle Image toolkit @PageCategory Base toolkits - @PageDesc This toolkit contains some image manipulation utilities. - */ - + @PageDesc This toolkit contains some image manipulation utilities. + */ + /** @PageName image_create @PageTitle Creating an image @@ -63,8 +63,8 @@ public : @Param width,height Size of the image in pixels. @CppEx TCODImage *pix = new TCODImage(80,50); @CEx TCOD_image_t pix = TCOD_image_new(80,50); - @PyEx pix = litbcod.image_new(80,50) - */ + @PyEx pix = litbcod.image_new(80,50) + */ TCODImage(int width, int height); /** @@ -79,10 +79,10 @@ public : @Param filename Name of the .bmp or .png file to load. @CppEx TCODImage *pix = new TCODImage("mypic.bmp"); @CEx TCOD_image_t pix = TCOD_image_load("mypic.bmp"); - @PyEx pix = libtcod.image_load("mypic.bmp") - */ + @PyEx pix = libtcod.image_load("mypic.bmp") + */ TCODImage(const char *filename); - + #ifdef TCOD_CONSOLE_SUPPORT /** @PageName image_create @@ -98,7 +98,7 @@ public : @CppEx TCODImage *pix = new TCODImage(TCODConsole::root); @CEx TCOD_image_t pix = TCOD_image_from_console(NULL); @PyEx pix = libtcod.image_from_console(0) - */ + */ TCODImage(const TCODConsole *console); /** @@ -111,17 +111,17 @@ public : @C# void TCODImage::refreshConsole(TCODConsole console) @Param image In the C version, the image created with TCOD_image_from_console. @Param console The console to capture. In the C version, use NULL for the root console. - @CppEx + @CppEx TCODImage *pix = new TCODImage(TCODConsole::root); // create an image from the root console // ... modify the console pix->refreshConsole(TCODConsole::root); // update the image with the console's new content - @CEx + @CEx TCOD_image_t pix = TCOD_image_from_console(NULL); - // ... modify the console .. + // ... modify the console .. TCOD_image_refresh_console(pix,NULL); - @PyEx + @PyEx pix = libtcod.image_from_console(0) - # ... modify the console .. + # ... modify the console .. libtcod.image_refresh_console(pix,0) */ void refreshConsole(const TCODConsole *console); @@ -139,19 +139,19 @@ public : @C# void TCODImage::getSize(out int w, out int h) @Param image In the C version, the image handler, obtained with the load function. @Param w,h When the function returns, those variables contain the size of the image. - @CppEx + @CppEx TCODImage *pix = new TCODImage(80,50); int w,h; pix->getSize(&w,&h); // w = 80, h = 50 - @CEx + @CEx TCOD_image_t pix = TCOD_image_new(80,50); int w,h; TCOD_image_get_size(pix,&w,&h); // w = 80, h = 50 - @PyEx + @PyEx pix = libtcod.image_new(80,50) w,h=libtcod.image_get_size(pix) - # w = 80, h = 50 - */ + # w = 80, h = 50 + */ void getSize(int *w,int *h) const; /** @@ -166,13 +166,13 @@ public : @Param x,y The pixel coordinates inside the image. 0 <= x < width 0 <= y < height - @CppEx + @CppEx TCODImage *pix = new TCODImage(80,50); TCODColor col=pix->getPixel(40,25); - @CEx + @CEx TCOD_image_t pix = TCOD_image_new(80,50); TCOD_color_t col=TCOD_image_get_pixel(pix,40,25); - @PyEx + @PyEx pix = litbcod.image_new(80,50) col=litbcod.image_get_pixel(pix,40,25) */ @@ -224,11 +224,11 @@ public : @Param x1,y1 Coordinates in pixels of the lower-right corner of the region. x0 < x1 < width y0 < y1 < height - @CppEx + @CppEx // Get the average color of a 5x5 "superpixel" in the center of the image. TCODImage *pix = new TCODImage(80,50); TCODColor col=pix->getMipMapPixel(37.5f, 22.5f, 42.5f, 28.5f); - @CEx + @CEx TCOD_image_t pix = TCOD_image_new(80,50); TCOD_color_t col=TCOD_image_get_mipmap_pixel(pix,37.5f, 22.5f, 42.5f, 28.5f); @PyEx @@ -266,7 +266,7 @@ public : @Param col The new color of the pixel. */ void putPixel(int x, int y, const TCODColor col); - + /** @PageName image_update @FuncTitle Scaling an image @@ -305,7 +305,7 @@ public : /** @PageName image_update @FuncTitle Rotating the image clockwise - @FuncDesc Rotate the image clockwise by increment of 90 degrees. + @FuncDesc Rotate the image clockwise by increment of 90 degrees. @Cpp void TCODImage::rotate90(int numRotations=1) @C void TCOD_image_rotate90(TCOD_image_t image, int numRotations) @Py image_rotate90(image, num=1) @@ -337,16 +337,16 @@ public : @C# void TCODImage::save(string filename) @Param image In the C version, the image handler, obtained with any image creation function. @Param filename Name of the .bmp or .png file. - @CppEx + @CppEx TCODImage *pix = new TCODImage(10,10); pix->save("mypic.bmp"); - @CEx + @CEx TCOD_image_t pix = TCOD_image_from_console(my_offscreen_console); TCOD_image_save(pix,"mypic.bmp"); - @PyEx + @PyEx pix = libtcod.image_from_console(my_offscreen_console) libtcod.image_save(pix,"mypic.bmp") - */ + */ void save(const char *filename) const; #ifdef TCOD_CONSOLE_SUPPORT @@ -359,19 +359,19 @@ public : @Cpp void TCODImage::blitRect(TCODConsole *console, int x, int y, int w=-1, int h=-1, TCOD_bkgnd_flag_t bkgnd_flag = TCOD_BKGND_SET ) const @C void TCOD_image_blit_rect(TCOD_image_t image, TCOD_console_t console, int x, int y, int w, int h, TCOD_bkgnd_flag_t bkgnd_flag) @Py image_blit_rect(image, console, x, y, w, h, bkgnd_flag) - @C# - void TCODImage::blitRect(TCODConsole console, int x, int y) + @C# + void TCODImage::blitRect(TCODConsole console, int x, int y) void TCODImage::blitRect(TCODConsole console, int x, int y, int w) void TCODImage::blitRect(TCODConsole console, int x, int y, int w, int h) - void TCODImage::blitRect(TCODConsole console, int x, int y, int w, int h, TCODBackgroundFlag bkgnd_flag) + void TCODImage::blitRect(TCODConsole console, int x, int y, int w, int h, TCODBackgroundFlag bkgnd_flag) @Param image In the C version, the image handler, obtained with the load function. @Param console The console on which the image will be drawn. In the C version, use NULL for the root console. @Param x,y Coordinates in the console of the upper-left corner of the image. @Param w,h Dimension of the image on the console. Use -1,-1 to use the image size. - @Param flag This flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t. - */ + @Param flag This flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t. + */ void blitRect(TCODConsole *console, int x, int y, int w=-1, int h=-1, TCOD_bkgnd_flag_t bkgnd_flag = TCOD_BKGND_SET ) const; - + /** @PageName image_blit @FuncTitle Blitting with scaling and/or rotation @@ -392,7 +392,7 @@ public : @Param flag This flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t. @Param scalex,scaley Scale coefficient. Must be > 0.0. @Param angle Rotation angle in radians. - */ + */ void blit(TCODConsole *console, float x, float y, TCOD_bkgnd_flag_t bkgnd_flag = TCOD_BKGND_SET, float scalex=1.0f, float scaley=1.0f, float angle=0.0f) const; #endif @@ -406,20 +406,20 @@ public : @C# void TCODImage::setKeyColor(TCODColor keyColor) @Param image In the C and Python version, the image handler, obtained with the load function. @Param color Pixels with this color will be skipped by blitting functions. - @CppEx + @CppEx TCODImage *pix = TCODImage("mypix.bmp"); pix->setKeyColor(TCODColor::red); // blitting the image, omitting red pixels pix->blitRect(TCODConsole::root,40,25); - @CEx + @CEx TCOD_image_t pix = TCOD_image_new(10,10); TCOD_image_set_key_color(pix,TCOD_red); TCOD_image_blit_rect(pix,NULL,40,25,5,5,TCOD_BKGND_SET); - @PyEx + @PyEx pix = libtcod.image_new(10,10) libtcod.image_set_key_color(pix,libtcod.red) libtcod.image_blit_rect(pix,0,40,25,5,5,libtcod.BKGND_SET) - */ + */ void setKeyColor(const TCODColor keyColor); #ifdef TCOD_CONSOLE_SUPPORT @@ -429,10 +429,10 @@ public : @FuncDesc Eventually, you can use some special characters in the libtcod fonts : to double the console resolution using this blitting function. - $3j}BC~Cbw8qJ-j8M){#7Dgm^z`pC$QCvJa zj?8d3m{h4L_{nue1b{nS?k8M}k};rg$S_+acM~E2unwSd(r&H`0svG6 z#YO$Y0bu+Ur9}NVdpdp(@kRYdtA4bCEj0gbuuCBi{l5!dQ0m+|L;&qT{8Iu9A^ve5 zLI7WB_-y|)10f2e;j{hI48+x3>5EQ+D1m*k0YZ?13$H2HzV4MIQTc!$IUs(Rn0>bM zxznc?7Z*>vBNJt`xTuu7xLBB!lo!TLRP8_{3J$i}CP_aU35b&DMu+sbK!1Bb046B} zKz=|tz&22oByL61D}?d|92z|$@-02csu zpbv>2!nB852O|L2${&<8-M}_m|6nuRgm#ZWew=_701HTb7y;A*E2^jCudX0IbpO?G zmGQOthwXK!0x$vSuD|32-X|LDLHQd!5FxHuf%E~+ff*nuUOxue-WnQ=%7?($eO(xh6`;> z#1Kz|`#$!4-c`qd^r+2_;Tu;=Q~XqEE)Wt1g{Ra|MTYt2s(5pdiWPW5ddJ{aCs^!N z`{&{sJ3IvgkYBudtqFYWE030-)&x8SU!Ii251g<94lwbl16F!a0Sz6WI-s`#6=35- z2dskr;s!#ugLd=+07whycBCGF!G;h4JdgH|ogv!(P<%nqAI{!&w0-)55CjOdgMG?< ze1`kd6CiCCZ8eSE(v&87v?n-~A*;5DiM~glL0K5P-GIO$o5;-|)aKSKbw>^c) zC}}|4#1Q&Z${mS73xl##?+Eyssc|uh0DeI+pBM~~OyjsT{l|&2F<)I1r}`K;%dHJb z)Bz?kAz*JWERWvC$#aT-LX({vP#jwj5#%B52hatf(q!j`tN>;}B(!{JfJ*!x;x|h1 zL3Z4a(P z?t}Jh|4f@@081q>0*wKnffiJnfCu96tAkvGV{kBVVWdBa=2gJT13|z6CN}nA#g~Tc z)fN~cDT`#jHwB)6+2dQc+$4XD3?>Dvz>0*DXeuUU@2T8l6CKY0MIB>$xwfHJ`J29x^21M~+e0jT@Q1KJjV5eVH+9?-S` zdk#Yg3$X&YHN}AES1Gh;ZBzezA{&2+<%iM1d3SU$a?T$-?-TVgG^|n&^UgsUaBlK2 zza{7o0j|AxfxdkqA(*{V2B`!}gM>H6_+(otI6x;6@Ihy6WaoKMBu$i+%QFEQwsqSV zU0_7ICT8fNMT3UA?Tc)W{8hwn3;h`%wqGfJ16}}3fKq(v2f!CJBcUMyXarCJFg`*g zKEC!mI6xbK)X~i8U#bOU0{bU0|IrC z@kD5kqR^|{FVbg95D66tq)DFViBU^udAbxEwR~fI4^{wQT*`fykDwfrXwQ$Ya-p{V zAkN7FB(1b&c!6{T*wXRGCqh8nu!4* z?f|Lcg&t8B$K8Z8}{e=%G0T2snM#MjV_B>SqHWAvsbOVSCfWwcr zFWmql17J2#@lQ~<@kXaTJOA{`%1|D^cMG7ck;1Hme02~+^ za0~#-pAtafU+JbV5U$2pNZ$u8c`a~j z*H}L{p8jNWj^f$QD!8r!JKvrM@IE1})(Eec3bH|}nP8{zTAFNO4QN#R+d3`phQD1x4X5LHSN z>}e82Npj=PWHPytyq1?xKbk}}4yba&F+AO+0R1;Yej8N{ zpt%A53F+>p{Bxa1zjSb8^+aJ&;2AlpAPDyM!q7Z!59xm+nfzpO=kblceZx99fc9F2 z1NdeZjReHcvbZb-m{hGrgZ%b=z2P2suEqjfS+9(t@W6=(#=EC>PlaA70aYV@oz^Of z61}LeKp`BK_BG79&Y=H?AAa%)evkutbf=2#ILV@&?H&E7BTvoTcv)F-{6bZog4-Tk254m4& zBD?aY#|jW%E>Q>R{Ha~$pTaY zaINDkK4&vu>-%UBbnf%nc{|UtyVDi=YXq&Zg)ARm(xMD7WS-+> z5~d;hpf!(=$Ll!ldE@dTe{x3ifEy0|{936qWTSGg8ndzScjg@ZijWBHAFcn(FF*P4 z6X*e*5Qw*Nw~#X1JB!Ou{NVcYY9Az$e&M|O6S$`ulG`f?d9PMP}Vt`{0 zTp%2f+`(;SMvYPv`}%sE@=A}hb+c}qfDOzpkj1$G;FGV&YCv~Q^H*o5+nF;f_wvO& zxc53|%{_$!yt0^zIW!jrl4BqpdtBMwNmEarA}+|8Yl6^r6Pr4F20;A0u|fhs{eLMO zP}l$)cXu~Rxkbr299?k0cfb)QC_riT$6~`#8->;$f&cjecCs*7gCPAYjA>UxM-gcJ z7bOX4{4^S<5;_fN_-su9=+h2m$%-9_sATeZ3LT&?ARyN4bQ>T_$pf6_Vh-rH9td9J zLNalzzyto{+`HQ=Kh4z!cQliCfr!$wouYWyM>LbuUfF1W_ z2B;xSCn?#$?C^E^C^S4ryHZq5zJk46t|j`M-SKnsN__)z09rpy0Qdstpi?Hl0a?HV zoeKRs-|0B`mI0NskuT$PXXFHJP%M;2qc$P^q0`IshXlxN0DzP$H3-PY&}q(unngJE z0LhU9paUeEJ3DbU+1}|E48SI2r(6osNrHMjNx>x(7`aKJeArD^0&p@PIH2Hxth!<& z&A?h;fV@*f1LU8B0_f-}BGpxEy|w;y6;J_~J+3VA19=d#J?ZfseFEFu41lyyA+9Q2 z@+?>a#&iQ|20{^l0jv=SBGtLfSzIy!XD8b!`T$V#k zIr#y|Eqea!Yd1&g2zH$|95?+s12k-}#d_5yzz(W}x}X0ACZ+U&B!wr-?FqMtk{byG z2t+_Ku^j=&W7X*|!>1-}U@O1VDOV0B{)X%8>rNJybI8#+6VxbY4U|My(S*!?c#xu* z2rHFP@wL~5yYhuw*{aG3o|In$=?B1vJ|LulK6s4wlo%xi@SW`ny-xxP0GTC?h+~iL z9W&to`Ec)&+!9N`b*+o?vs`sTX_rmPDDY%HmC_2pw*0J8!9@bRJ=3q;5r=dp-~qTv z1}_4N;59Q4FXw9&hC`)1@?sMfFrl)=NcAz#ZlHU5 zB)6veuu;eOt5O??sPk(9`v%+(p~#t}OdB=I)Vbn5&*!?hQo|PZ#swsQd47_}jVJNv zaPyMbOq;GSq=1(cM_3we&7Mi9FaqlMNI`rnwO&i~`G7m?_uE5>uu^z)lE-98*DS$X zm}>x@DS_utzIj9r&^%Cnz>qgEL13vu{^tPhCv|Lgt9ZiU94u2Mw~!_zx5*NcPRBej z#vhL4s{cg#p9Ec98p!7)c^o~41z6DdgdEn66xSmGxGcKk;sh|a=||A#)aoCdknl61 zq%r9lm3`))`Q}z){H_olNM$s*;D9=E1MvShd_9Fd22M##)WkItvA#0MO@!G!2Apge!lgUJ@1*06g(vM$tVq8)d$1FCILzt)1nFHLAF0v?DCnO& zb{w-BImoZ4FoO}W71}?-A2`5P&~V@na~|m9!>z##y^W@|QzBT1@xTkb!C)&(Vjrm< zry@O5;)E8LWbqa_fRAD&TU%RCVV);owYlm!%`>3?l`E^wE30x4)=yaBfNt7#Q}TiA zN6L-UY~sYVX8hdrNBeg}eJg`LUoiX>l$~zn?!2W3axC^rYkPy}cI0brXooCRR?Dhj z7(9amPHP4r{iPFIbHK#B-Yl6U6Q{dF0kA_MfUV|$!Ek?wudg{k(_eD{e+?3UM))7B zfYv*J6VASPZy;0Y?@UYcZ3W@RYAAJGFu>3j7?h7dd(a=DBraxRKNCiLq4lqZtE1~B>doO3z=>V<8uA_A`U=S}D&r0<)6 zz)hByxiqucB_tnK05ID^d65MgUhUl@f@Ab2MM~&Mf2Q<*DS3{C*0xj}B>-QYD-xi) zv(w#q1oA%u2M7kB|9#HxMfe^IN6KGw`oam#W~05)v|=F1K!4!?u)sjZi|;&Vj~k@n&n z=NvFI!}0Q_?J9BoD4Jv{iIvfX8c(9XCA%}SL~v2qARm9ehTr@W(q`a9r0Iv;YBq4u z>UO#n!&om}YMM=lWF78zyR1Y@;``3-2`pgFHdjo+SM;Ao-rb(2GTIh|A_XX9_YU{M zy>z^X9kz@|JCAnA1XKb9B*6WDh7b@XAVlx`_xe6Q41>!W%?3v@8u(=og#ok-fCzA= zX?MysQSwKtJTGfzs~qqZ4$!60Tje=y{23pl5ep!ysQ~RJP+Y9pnQjV={G#mQWpD`-lkF(fOv0|Pqithg!Jj(%ZnSTgz zPw5w&6Z2>r*ZSA6)%$B}c|(L=0NFWk1+&BqCA!Ws&|NNZfDD%bt`xWvh#Kh3fgGB| z4R-D}cI^!d$ms^!q~ZNs0-nyvkCajQt(Mo~?d3j)hkN*@p$wmb@Zf;Y9)knK3;+hh z`~Uolf8Mt?0O)_M|K_#6?`sZd!Vm-tGyxDpYk;0%!`dr@?Vfm3-<`+>pIM|KV^?zwFhCGng@x&u{3F2~qqU zN-XJ76l*&S%@Qz#jF-yrx~rFci1@fotQ)buUyc6Aj0p)wWP)52D7Veg8?)!k_vf$m z`%6X(tWBEWfHm3#uW~<4Q}9Y?)c{C9bqi@*OiHtDTkkKz_!|bDZA8>I0P^i|c36c0 zhLF)#KA;h34lt4c%D*gw`9edlkRRdU-rnBf(5!hRy8pAIqa*x521pEufPa2hKdY_r z$(x_Nc?}F;*S%`Yfazwaak5wh0NX#l>}~AsB#93hYt#wfT|)jq6~y8NFe9O}$3K*p z<{zv8N&)y0dX*KDeNkwCN@xS&6$~K&_|xQ%VR>4^xJeEO_X2MvZ+F|TZ&_8w5hcUH3ngfX3_COUR*y-;0R4J00l$`RRR0k!KhSFcRf70K20gEpk&TAF`M12j( z14ByPO#4KcV;A9qBs#Mis+C*=F8Yge+lxCJQ)I)k0J1#OkV&>u>wFk2(gFanJ9FAx zG6>aPm<~M1NG-FGU(Y#PqCW_>+UCQsW*2zljqSY04Q;;x;+N^~!{^XY?5@>ylRx5) zAnL>L+ae^ues}KC4hpPgnx%UY2w|h|2m9>$$`ZIga%!eY9+1{QC-y@L&;eFHhI`H) ztVdXYdax9EfeHY1wVtU&=ve3vyF1_l zor#dPH)MXxv$a_P1pv$d{WNXqdCYlRAI!YRx)2=@kovamTQn6U%pN7C@D14oE*rq3u6P)BJ7DsCmyWaH=1}rTph6?+0*8hCnd%In4<) z1|yhbCGygA6%g4v`rI_^xtcH3bFu3AOHhICVd!2Or6XN(kVx&bA;mT0^$I&H&HW! zHM~wKZ2+=jIM##a?@DFOvKQ6bXwIprB!A5lu2@09Lu!93YGuqD6W8!7xwq3e%u~3qr{MPL=u;0CvNF zDuL4DKV9|!kpBGFjYb-OVF8c_?xFqX^q-MGU7K0L`A4w9VFw)bh3D$5vx^U*@mmv&;J=Z-Go_Sdg zo-`OMHD#(xt7GMu1qK$S^;WJ)If2ZDCNMWaZk02#JJ0~D6ne_!N5kHgnh4*VLjn4K zp=<@(_A?Q<(JY{Z{%ku!ey1A@b0H?J-#jMbqUqyX;wWwY>a+0w>IR?^k36(~ImoXA z8ua~y1LR*HD~o?B0FeW_8weHOXg5(lSOL5(Q~)J_AfOSLGi|4vSXIQd5P~Su7CC5ewg|5o!lM@YgOa!$`k%#th$BjP-ISnyZV?pLAQiUKFHY$YHTNfJ;}QPdZj_!zsp6#mf;9W z8rWJ908oN+&YW-n59nBW#FPQhA5;{dN?I~bOYQ2@#ObmMP-y>;<@WezQe1FO_Q@2C zK}Qhux8ygd$bf?WCOdLhkRM(Me5pOy0N?=F#mPhF+v$J{k)F^W`I0t_xctah?hdJn zW77Ibc}@QlDe?@U8qS}%O-jo;r`uE&87MG=e{sa)WsBP@h2)9kOfW~~W+&bGY1xs~HS!~+{1{ZI|9p@XvV;S#LVwr+ws)oj=#aj@#5Fg>-NhHy zIS|uNgn;G)9p_nSasa@DD|k8s6_yW8LB2cuIoDr(CZ^7G<9U;+R{ZY(EdZ=)e=3qF zD!rMy3^v9x%;Bd%>u$Mufqae3uM5>j$!ch_SBI*|?5~(n;Oe}`W7s<^bAXDoe7xd! z#QRf7zV{!#|Kv*8D_la$`|@v&InF`(v8EHSQ_U%dx@pWKnGEWa={$KY=>+t5U;>!k zDh%Con8O+;vV-oP4)@C}po%9ZP6DJma%pym_T7!UCinyd@0vgrqGX%RnHi5=dxitx z;TZ-vX+5=kS^x!A@xY5@I;r*)Jp~8m|0GPQ`SABpd%-8+!GoOl)B@EZ17$HBJoyIG z-?D=M8)y2NKH`Z(wI^nPnr3{94tTj-_7-4*Komm)WO2DWIESHo4s#gTc3l62`U!@P zG^EPttoPu737rIp`HahHn_b7**l6pi^%l()`ZBsJm;NE$tCK{4bl9T(J2UVoW}21* zzyk+TfhW+vaCu=ka|m1@jMS-&T0b3Co2Y_m5^KUw-!IfaX=yhZBAWlznz^_55}+^bue1;l`$wDXRsbA0fBMqe+MhmA>3!zh z+i{Y~7n&8={sUTEA(xazf_K0HWP#j@*Mx7i__zfi4@^SZkvcUz(*95x<_xgy>Yl0_ z`MT%=)FPMwH!e6JR8i{cbqb(^_bZQH3nFkI`NL$OZ61p(gaEZ7YNI@#q4X>naoM?S z-E1g;;LMEahtQbcop0!o&~g$2jwBtTwnEb1nt^n)=Q`Uv+cgnjc4J&qj3q0f{eato z3p%-v3-%5JP(G#!pv{2ldS#q0i2MF(4_v^a^2d${!v+vvYcDN<172BsBb;?Jdp;*&YT>#gWFmJWN7`6!uVATB&8-1rG}w<4s#mxe`K0R z6a3kMzgxjp<`50KTw-&*zm` zATXkUq!;8P=(xe7iHaVvOVrRk2M$R?Tb#4fae~&HO-$n@$O6(A0uI0~h|d)_9B{9` z0YpIft1my?GlBpL0*xeslq}L{R5?H?KKgEK01d4GWTQAh$a;EZzy zJkVHeG(Md70$PIkjF_C+0x%PDEbZTbi)HLUX>J#Tz;u@`~`uqRD`6IMjU1GK@joC4XSNz5-YVd$O%)o^@% z1XTFsHxpyWv+l(PL4A+|(EOPSifGf{-}?}sy$?xbd0`9cGM;R~TGi)Cv(hlirqo2U zX{|tlcQC=OT7Agy`p5 z;H1A5<4a5ZrOuq8zeubwY43$)4yamzNaGDtMG*ZcC@swC`>1F(dN9}RqzCi86YQ-ZzupAQsW=p8HIPo-~nt5{kJB$jR)G(0plt@j`NOi07voI zn;+{TU4SkC>_Ag?w0tywq+rw7nM@vKoE44SYO)tV`!9UOqX zXa)dB%TrT^$HV>oz5Tt7jr~2gN613dC;NH}5zuI^p}-;vKOEPkoq96)spTdqv!iNUXHlRkh zx3RZ@Qid+JIH~;j)<0zN1Wk*l73kme?Q?d`6&Fe!^mpBg4#>sVPZ#GF=jY~rI&W=& zm&pOGGoZg7{pCQY=gmW}6z#vv0UD_LL*a#O&>zloyaO(0A(#3be3=s^AaLUVET8T4-ne)D>1=Qa58!$1&jGEtDn-}_94xkMn`ah@tOKZKCj0lipDgf<0 z+y0%u;O2`G3E>4GZ^nz@^nnf-Qaay_4iE-dw{-~BoQO)&=uUQ!g^7MAj-h)FYJbj; zFfJDm^8pgy=TjushzON)2yYZBKz2cYub9uvwR=LP_T9aG(E+X-(FBYiGAZtJLP?V^ z@{;H)Xba>Bgf>lm=r(I}-|ehjT?0#AHX?u$0F(y@ynM#j9MC}f_DV~VoPI& zhD?g>p9~8RgilPr zukr^#7CEFRj;mDJJUCztnt)-cdfWJkmtI-}|Gm_+Ucj9IDgaEUj0vc_f9xMym}Jsa zFkqU!48-b6hZUgQ_54M3?1|$kVJRSE+V9CWUs9z`&G^HT#R!vbZ zWsO_{+kMwM0c=q0cHh!(awYG(4Hf%(>0J^%c(=(FF{}nq9?Fg!YBTUMtbm{X6k9n5 zfc7v1&$t}@efbP-HPdJ?KDY`g7bUAeR~TE&+|DClha;{X%>n(T(qN}#5HTZgiA_s6 zZ8n&v&>ys)@T&KjZ(~IPQi;6vo>C9ggZw?;l1)Zs7z90NNcIj6I0Hq3WBio5GiIdE zP)+<-S_H6y8Kt0q4it$oNkwP@wZ0C@AuddCH;ZDo%mO)dQU%Q6GR*C&oz2XL4aFI5 z6HoPl{AeC<*-x2Gx!9CGt>lq=$M&`jQhD2tYq|j-Av|V_3kon1(!NB0=S)Zmz-b8- z1mpl+A^bN{sxbMN7}VU`b0mMx;Y6VT5M6VCO-wG5s~u)jAFRS$Az%b>0JLa+2j%WP zc<=z{9)JaO0=U4Y#M~d4Yvo?tN`OKBCV!#xqb61hfK0+e$Dla?(LrsO)WjLI*0bUQ3E@gR(gS;E(Y=OonWr^TO1sasuBdQB;OJO$iZXjk;vTE*G&|V|t z@V`<`2m;uF`dBG@CxBIu$DpRH>dHEf)sxiW)9*l-FgXA$P~tGDt|uoT7ZYZ`3UjWW zCG-CzlrKOK&NvjoNf!wrOE8B^U`o~7%Mp~w?78yBylRwZqC|gD3yHyzf*SFwR6td<&@`h-24sc-%qZA3HZPx&a(eF!WI%dPD&lZCt3?9 z0O~((!LJ1e#IL?;h^F7}WuANDp{UV&8adM-n}q*h{S0F4)t7v08WS4$;y3Mfd$ZlX zM+-A^vU|=wX}%{nf6)CtIk6ZkF2NQ!*ek|3#r=mO;g&&g+ee#v&=(ktJihmY)ba8m zL@%s#eWzX)POA^f)J7ZKE~;C%_Z@P;^nKLN#hnZsfW*%)ER5t0I}(8?dihQSn_m36 z*#SuVQ)B}|TE5xf52WuW?7e{?00*%1Cyo!JLvlcANdI{e|K+Q()8fdKdi5_E1`PdW zOIaQ{4Y)v0Zqe!ZT$n2JEF&>a)q@8$ozb}4G;>VGU);MFZr=N%eea9kpz7pNvM+@A zrl+og5H76@7w2QeWoWsdO7rLK<=v4Y0$@lWs5xMCbCf>ZN@Y^}fK8w8J|ac+g4$e+ zoKMDDq+{%kK@!eo!B0N{?>gYTHd$ zM+Ulm&R&4B53r!gzi^7R$U)=vUCIWfxHx8CAlM;sC0b~?eiAhl9*97b_k znLjGeDVcu2%`fh4-rH=ikqICJGHLiz)BKMM0crT0Dk9@+Jd%_PmhqLb;d;34V3Ury zpdA1s0Hg;82m@?Byy1iVO8i_9C>R|KMh72Z$FpJ@E=?{3$jKZ~$;*SgOtWce#+GvZ z`S@|%^`*YEX&2;wf0|`ol-b*LM!1I;?6Q}~aDcSTC(NjgKhMx|!2(>hn-G)M*>;wl z1>K0&&pGRV_2b=h!U#@3iR3Aus4sc|k_bYa4^vZ^GrF7jj_ceb7d(OI4DJRf^88D$ z&V%~Nq%}MLmoLo=1915X9mR2ETptE~L#67TZW5aZa|daO1ya=4xiC0aJXxV4j@OVK zr4B*<(%b-0AHNXoA7L|&%_T(9h)Om9d@3E#(}YNT_OFuzP>&==lw{z@2-@FCUC0M6 ztxNjT0yJ)f-ZEG2{HA)Ss}rgzI2auSlmsKswo#DG4ljo&4?cWeUiJ^hkEheekBd2b z-B@+Hzg~MBzi0Ndwav}x^!+svU>>M`hy=g_xe(N4$sa(ig7uVuJ2d$P%6YU5BS4*U z7JfoLI`>yU`SH!&bGwuQ{c90B!u)=J+wU`B?8NltMUe=67y!p#xKW4c$eVx3X|<3u zROU;fC(-mle8Cn^uHac2AIfE>;sgXI%G*#_ zTA>Go-&~XSzvE6NNQGf)kqmLfIWuDE;Rx4v_8h%hn|)JQWPH10nx0+naW(Lf74EoQ`dJI^=M#6y-WcDIqX&##^%xBBIEugrAU)~tviCep!Eq$~+;>VG zph-L$xvq8v(B?;=?MILTW%9GVYb^jfLYGIc&_Viu@l{S@P!bX#`*qwEqhBN2w9KHS zgP)}@O;BJTZOmq__h7caQ|)?*^VuK^ngbklO8f30It9Sr{MR3@pOZRGt|dE>@^^N& zul2zIoXbI(z&lJN5l#QR{sp958Nsdx5r?d*`BTnp3#TV7=aiTnZ2#Qc9}cY{;G}99 zT6Ov2vg{mek^_Ev+Q}IAfdKl;1O-rk zo1MWF{ID?~13)J&l%tFT+?h)OKox+)(3>H`xYHaZz;`%arZKw7?M-L_n~ecD;D8FC zY}v~q50X5~gK(uh86Q%xB*M*97e?TFr6O)dQ_BI!CQmRueE^|}4|4m~N=NHRhS~I} z;DFMMVBHAWfQ=sj6X1tG{+qw~A&h`?tkv!Qwf@e|qwO6CfNdxM*bcA(VF04i@>J>! zPy=-wa|aGpj+&jN4FEGxUqkv2_rU>%{4`1~URYjsmj7NDz}ZZl|MQ=Idg-U9jR-)U zaerFP>lH~_%W0Q?|wWH11_KXCTR1-etf zRT-byj*u-}CG<~mP$U6C+phx|U_^k>U$SBC7I_8c0p-870R^ZKZ3d)NDwXoUKB;(E zDpBzNOGh9bO3$#c9`VapK6ZV`DzO0M5-_hD1)y9>1XL|VR5=9znSrL?E-Zk*0{vU( zAOp6yAp(-^P6q)!<$)pq)lE*2eL;o(m7M}sK+Vp|)-r4r%!}(@c>BTy1s*Wibbfm2 z^v>x^W*2P*3ZTpY$dRocp+1RU7=mH2&Lj z+oupn_fxwWxq$m}Yd%`2MYi_;=EwoLA>eGzmt7aCfs@{X+BRlDtvtzNFu>yq2h7h` zx>h;e?ATiPd4#?DKH9vs^Ob@z<$JK{!syHJ}mT73&m9^ilzp`}W`eZ{8IzTYd!3P@9fgYuNup800oV(C()n04`u)k(q%6;3q_gF*(T*cSRu;tN{c=p%)ne0hj=y z1*{Oz(6rYB-T)F6NEj8u0!xuYRQ|E@z{7`x&!$Gk;~Yn2%;kbjIi;0=Nf$p;(W3d2 z36Dsd5RrOHYu& z_#RJ$Dl|4AlK3LKhh)?}Gi0s(KTAC21mAp($ zD*mg2VFQ0h43% zmXpG;2^v4-KQA+r_K-?(ae-2M(e&rd+53M^?yBhNYAouR3>6MwKcaAeDHeD;1@Gt~Dmy=Zi+)U^%I{>0DFJHJ&a(YV0>q{B42?yHpIt18xc@ib4FYf6& zbT=tv5mZyz<%|W<1IG{synr#K{<#B<>MEb~g7wE&)DY|95}5bN0ipvykj<@4IlsBJ zbz+W`3OU7rZ*MFu8u{-z(0IWueQBxc4z6*~85N2Um1fLZ2}+=4vnLrkUsuUKAw!dQT$ z2bf(zxzbcB$4VIAqkv@;H+FbZ&WxS_RE(3 zxA+4`G=-a=*w^&M37j40exv9+`xbxLh>|#tWUdg~f9(57qv7jQ-{KD+5nN8Re!EPE z3_>-JyDs124-`?Bw|;8}HsDKs%K_gMBtD3*o4;lN_9IXMe9Hmf2;>Vi+2;Q(zL9_u zFrjbpO+;m(wr}x`!?)D`7A3#~c*;=QxA?=yw;b>-zI6h>32>bM5653IG5A M07*qoM6N<$f_Lm7y#N3J literal 0 HcmV?d00001 diff --git a/examples/custom_character_mapping.rs b/examples/custom_character_mapping.rs index 30537f225..5faa615ec 100644 --- a/examples/custom_character_mapping.rs +++ b/examples/custom_character_mapping.rs @@ -17,7 +17,7 @@ const ROOM_HEIGHT: i32 = 15; fn main() { let mut root = RootConsole::initializer() - .font("angband16x16.bmp", FontLayout::TCOD) + .font("angband16x16.png", FontLayout::TCOD) .font_type(FontType::GREYSCALE) .font_dimensions(32, 60) // angband16x16.bmp has 32 columns & 60 rows of // characters diff --git a/src/console.rs b/src/console.rs index 7394ac4bf..e3dcfa5f5 100644 --- a/src/console.rs +++ b/src/console.rs @@ -60,9 +60,7 @@ use std::marker::PhantomData; use std::mem::transmute; use std::path::Path; -use bindings::ffi::{ - self, TCOD_alignment_t, TCOD_bkgnd_flag_t, TCOD_renderer_t, -}; +use bindings::ffi::{self, TCOD_alignment_t, TCOD_bkgnd_flag_t, TCOD_renderer_t}; use bindings::{AsNative, CString, FromNative}; use colors::Color; diff --git a/src/pathfinding.rs b/src/pathfinding.rs index ed8fa454a..db7c39ccb 100644 --- a/src/pathfinding.rs +++ b/src/pathfinding.rs @@ -177,7 +177,7 @@ pub struct Dijkstra<'a> { height: i32, } -impl<'a> AsNative for Dijkstra<'a> { +impl<'a> AsNative for Dijkstra<'a> { unsafe fn as_native(&self) -> &ffi::TCOD_dijkstra_t { &self.tcod_path } @@ -333,7 +333,7 @@ impl Iterator for AStarIterator { } pub struct DijkstraIterator { - tcod_path: ffi::TCOD_path_t, + tcod_path: ffi::TCOD_dijkstra_t, } impl Iterator for DijkstraIterator { diff --git a/tcod_sys/bindgen.h b/tcod_sys/bindgen.h index d7e175934..58642d6d7 100644 --- a/tcod_sys/bindgen.h +++ b/tcod_sys/bindgen.h @@ -1,4 +1,4 @@ #define TCOD_CONSOLE_SUPPORT #define TCOD_OSUTIL_SUPPORT -#include "libtcod/include/libtcod.h" +#include "libtcod/src/libtcod.h" diff --git a/tcod_sys/build.rs b/tcod_sys/build.rs index abb3886d8..241e7d82c 100644 --- a/tcod_sys/build.rs +++ b/tcod_sys/build.rs @@ -16,7 +16,7 @@ fn build_libz(libz_sources: &[&str]) { } fn build_libtcod_objects(mut config: cc::Build, sources: &[&str]) { - config.include("libtcod/include"); + config.include("libtcod/src/libtcod"); config.include("libtcod/src/zlib"); for c_file in sources { config.file(c_file); @@ -61,7 +61,7 @@ fn build_linux_static(_dst: &Path, libtcod_sources: &[& 'static str]) { config.define("NO_OPENGL", None); config.define("NDEBUG", None); config.flag("-fno-strict-aliasing"); - config.flag("-ansi"); + config.flag("-std=c99"); build_libtcod_objects(config, libtcod_sources); } @@ -78,7 +78,7 @@ fn build_linux_dynamic(dst: &Path, libtcod_sources: &[& 'static str]) { config.define("NO_OPENGL", None); config.define("NDEBUG", None); config.flag("-fno-strict-aliasing"); - config.flag("-ansi"); + config.flag("-std=c99"); build_libtcod_objects(config, libtcod_sources); } @@ -184,62 +184,84 @@ fn main() { let sdl_include_dir = src.join("libtcod").join("dependencies").join("SDL2-2.0.7").join("include"); let libz_sources = &[ - "libtcod/src/zlib/adler32.c", - "libtcod/src/zlib/crc32.c", - "libtcod/src/zlib/deflate.c", - "libtcod/src/zlib/infback.c", - "libtcod/src/zlib/inffast.c", - "libtcod/src/zlib/inflate.c", - "libtcod/src/zlib/inftrees.c", - "libtcod/src/zlib/trees.c", - "libtcod/src/zlib/zutil.c", - "libtcod/src/zlib/compress.c", - "libtcod/src/zlib/uncompr.c", - "libtcod/src/zlib/gzclose.c", - "libtcod/src/zlib/gzlib.c", - "libtcod/src/zlib/gzread.c", - "libtcod/src/zlib/gzwrite.c", + "libtcod/src/vendor/zlib/adler32.c", + "libtcod/src/vendor/zlib/crc32.c", + "libtcod/src/vendor/zlib/deflate.c", + "libtcod/src/vendor/zlib/infback.c", + "libtcod/src/vendor/zlib/inffast.c", + "libtcod/src/vendor/zlib/inflate.c", + "libtcod/src/vendor/zlib/inftrees.c", + "libtcod/src/vendor/zlib/trees.c", + "libtcod/src/vendor/zlib/zutil.c", + "libtcod/src/vendor/zlib/compress.c", + "libtcod/src/vendor/zlib/uncompr.c", + "libtcod/src/vendor/zlib/gzclose.c", + "libtcod/src/vendor/zlib/gzlib.c", + "libtcod/src/vendor/zlib/gzread.c", + "libtcod/src/vendor/zlib/gzwrite.c", ]; - let libtcod_sources = &[ - "libtcod/src/bresenham_c.c", - "libtcod/src/bsp_c.c", - "libtcod/src/color_c.c", - "libtcod/src/console_c.c", - "libtcod/src/console_rexpaint.c", - "libtcod/src/fov_c.c", - "libtcod/src/fov_circular_raycasting.c", - "libtcod/src/fov_diamond_raycasting.c", - "libtcod/src/fov_permissive2.c", - "libtcod/src/fov_recursive_shadowcasting.c", - "libtcod/src/fov_restrictive.c", - "libtcod/src/heightmap_c.c", - "libtcod/src/image_c.c", - "libtcod/src/lex_c.c", - "libtcod/src/list_c.c", - "libtcod/src/mersenne_c.c", - "libtcod/src/namegen_c.c", - "libtcod/src/noise_c.c", - "libtcod/src/parser_c.c", - "libtcod/src/path_c.c", - "libtcod/src/sys_c.c", - "libtcod/src/sys_sdl2_c.c", - "libtcod/src/sys_sdl_c.c", - "libtcod/src/sys_sdl_img_bmp.c", - "libtcod/src/sys_sdl_img_png.c", - "libtcod/src/tree_c.c", - "libtcod/src/txtfield_c.c", - "libtcod/src/wrappers.c", - "libtcod/src/zip_c.c", - "libtcod/src/png/lodepng.c", + let libtcod_sources = [ + "libtcod/src/libtcod/bresenham_c.c", + "libtcod/src/libtcod/bsp_c.c", + "libtcod/src/libtcod/color.c", + "libtcod/src/libtcod/console.c", + "libtcod/src/libtcod/console_drawing.c", + "libtcod/src/libtcod/console_etc.c", + "libtcod/src/libtcod/console_init.c", + "libtcod/src/libtcod/console_printing.c", + "libtcod/src/libtcod/console_rexpaint.c", + "libtcod/src/libtcod/context.c", + "libtcod/src/libtcod/context_init.c", + "libtcod/src/libtcod/context_viewport.c", + "libtcod/src/libtcod/error.c", + "libtcod/src/libtcod/fov_c.c", + "libtcod/src/libtcod/fov_circular_raycasting.c", + "libtcod/src/libtcod/fov_diamond_raycasting.c", + "libtcod/src/libtcod/fov_permissive2.c", + "libtcod/src/libtcod/fov_recursive_shadowcasting.c", + "libtcod/src/libtcod/fov_restrictive.c", + "libtcod/src/libtcod/globals.c", + "libtcod/src/libtcod/heapq.c", + "libtcod/src/libtcod/heightmap_c.c", + "libtcod/src/libtcod/image_c.c", + "libtcod/src/libtcod/lex_c.c", + "libtcod/src/libtcod/list_c.c", + "libtcod/src/libtcod/mersenne_c.c", + "libtcod/src/libtcod/namegen_c.c", + "libtcod/src/libtcod/noise_c.c", + "libtcod/src/libtcod/parser_c.c", + "libtcod/src/libtcod/path_c.c", + "libtcod/src/libtcod/pathfinder.c", + "libtcod/src/libtcod/pathfinder_frontier.c", + "libtcod/src/libtcod/renderer_gl.c", + "libtcod/src/libtcod/renderer_gl1.c", + "libtcod/src/libtcod/renderer_gl2.c", + "libtcod/src/libtcod/renderer_sdl2.c", + "libtcod/src/libtcod/sys_c.c", + "libtcod/src/libtcod/sys_sdl_c.c", + "libtcod/src/libtcod/sys_sdl_img_bmp.c", + "libtcod/src/libtcod/sys_sdl_img_png.c", + "libtcod/src/libtcod/tileset.c", + "libtcod/src/libtcod/tileset_bdf.c", + "libtcod/src/libtcod/tileset_fallback.c", + "libtcod/src/libtcod/tileset_render.c", + "libtcod/src/libtcod/tileset_truetype.c", + "libtcod/src/libtcod/tree_c.c", + "libtcod/src/libtcod/txtfield_c.c", + "libtcod/src/libtcod/wrappers.c", + "libtcod/src/libtcod/zip_c.c", + "libtcod/src/vendor/glad.c", + "libtcod/src/vendor/lodepng.c", "libtcod/src/vendor/stb.c", + "libtcod/src/vendor/utf8proc/utf8proc.c", ]; if target.contains("linux") { build_libz(libz_sources); #[cfg(not(feature = "dynlib"))] - build_linux_static(&dst, libtcod_sources); + build_linux_static(&dst, &libtcod_sources[..]); #[cfg(feature = "dynlib")] build_linux_dynamic(&dst, libtcod_sources); @@ -255,8 +277,8 @@ fn main() { config.define("NO_OPENGL", None); config.define("NDEBUG", None); config.flag("-fno-strict-aliasing"); - config.flag("-ansi"); - build_libtcod_objects(config, libtcod_sources); + config.flag("-std=c99"); + build_libtcod_objects(config, &libtcod_sources[..]); } // Build the DLL @@ -266,7 +288,7 @@ fn main() { config.flag("-shared"); config.flag("-o"); config.flag(dst.join("libtcod.dylib").to_str().unwrap()); - for c_file in libtcod_sources { + for c_file in &libtcod_sources[..] { config.flag(dst.join(c_file).with_extension("o").to_str().unwrap()); } config.flag(dst.join("libz.a").to_str().unwrap()); @@ -294,7 +316,7 @@ fn main() { // Build the DLL let mut config = cc::Build::new(); config.flag("-fno-strict-aliasing"); - config.flag("-ansi"); + config.flag("-std=c99"); config.define("NO_OPENGL", None); config.define("NDEBUG", None); config.define("LIBTCOD_EXPORTS", None); @@ -303,9 +325,9 @@ fn main() { config.flag("-shared"); fs::create_dir(dst.join("lib")).unwrap(); config.flag(&format!("-Wl,--out-implib,{}", dst.join("lib/libtcod.a").display())); - config.include(Path::new("libtcod").join("src").join("zlib")); - config.include(Path::new("libtcod").join("include")); - for c_file in libz_sources.iter().chain(libtcod_sources) { + config.include(Path::new("libtcod").join("src").join("vendor").join("zlib")); + config.include(Path::new("libtcod").join("src")); + for c_file in libz_sources.iter().chain(libtcod_sources.iter()) { let path = c_file.split('/').fold(PathBuf::new(), |path, segment| path.join(segment)); config.flag(src.join(path).to_str().unwrap()); } @@ -339,9 +361,9 @@ fn main() { config.flag("/DLIBTCOD_EXPORTS"); config.flag(&format!("/Fo:{}\\", dst.to_str().unwrap())); config.include(sdl_include_dir.to_str().unwrap()); - config.include(Path::new("libtcod").join("src").join("zlib")); - config.include(Path::new("libtcod").join("include")); - for c_file in libz_sources.iter().chain(libtcod_sources) { + config.include(Path::new("libtcod").join("src").join("vendor").join("zlib")); + config.include(Path::new("libtcod").join("src")); + for c_file in libz_sources.iter().chain(libtcod_sources.iter()) { // Make sure the path is in the Windows format. This // shouldn't matter but it's distracting when debugging // build script issues. diff --git a/tcod_sys/libtcod/CHANGELOG.md b/tcod_sys/libtcod/CHANGELOG.md index 670e9b774..4b9e7f719 100644 --- a/tcod_sys/libtcod/CHANGELOG.md +++ b/tcod_sys/libtcod/CHANGELOG.md @@ -3,10 +3,341 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -This project DOES NOT adhere to [Semantic Versioning](http://semver.org/). +This project attempts to adhere to [Semantic Versioning](http://semver.org/) +since `1.7.0`. ## [Unreleased] +## [1.16.0-alpha.12] - 2020-05-22 +### Changed +- CMake can now create packages. + +### Fixed +- `TCOD_console_init_root` and context initializing functions were not + returning error codes on failure. + +## [1.16.0-alpha.11] - 2020-05-13 +### Changed +- Print functions will no longer treat special glyphs as double wide. +- Library CMake files now support Vcpkg. + +### Fixed +- Fixed divide by zero when handing mouse input without a global context. + +## [1.16.0-alpha.10] - 2020-04-26 +### Fixed +- Fixed characters being dropped when color codes were used. + +## [1.16.0-alpha.9] - 2020-04-24 +### Fixed +- `FOV_DIAMOND` and `FOV_RESTRICTIVE` algorithms are now reentrant. + [#48](https://github.com/libtcod/libtcod/pull/48) +- Heightmap functions will crash less often when given out-of-bounds parameters. + [#13](https://github.com/libtcod/libtcod/issues/13) + [#50](https://github.com/libtcod/libtcod/pull/50) +- The `TCOD_VSYNC` environment variable was being ignored. +- Malformed UTF-8 strings will no longer hang printing functions. + +## [1.16.0-alpha.8] - 2020-04-03 +### Fixed +- Changing the active tileset now redraws tiles correctly on the next frame. + +## [1.16.0-alpha.7] - 2020-04-02 +### Fixed +- Changing the active tileset will now properly show it on the next render. + +## [1.16.0-alpha.6] - 2020-03-26 +### Added +- Added `TCOD_load_bdf` and `TCOD_load_bdf_memory`. + +## [1.16.0-alpha.5] - 2020-02-28 +### Changed +- Mouse tile coordinates are now always zero before the first call to + TCOD_console_flush. + +## [1.16.0-alpha.4] - 2020-02-22 +### Fixed +- Mouse tile coordinates are now correct on any resized window. + +## [1.16.0-alpha.3] - 2020-02-21 +### Deprecated +- Mouse state and keyboard state functions are deprecated. +- Mouse functions with SDL alternatives are deprecated. + +### Fixed +- The wavelet noise generator now excludes -1.0f and 1.0f as return values. +- Fixed console fading color. +- Fixed keyboard state and mouse state functions losing state when events were + flushed. + +## [1.16.0-alpha.2] - 2020-02-14 +### Fixed +- Fixed possible crash in `TCOD_mouse_move`. + +## [1.16.0-alpha.1] - 2020-02-14 +### Added +- Added the `TCOD_clear_error` and `TCOD_set_errorf` functions. +- Added an error code enum: `TCOD_Error`. + +### Changed +- Console blit operations now perform per-cell alpha transparency. +- When a renderer fails to load it will now fallback to a different one. + The order is: OPENGL2 -> OPENGL -> SDL2. + +### Deprecated +- The use of `libtcod.cfg` or `terminal.png` is deprecated. + +### Fixed +- The following are no longer mislabeled as taking const images: + - `TCOD_image_get_mipmap_pixel` + - `TCOD_image_blit` + - `TCOD_image_blit_rect` +- `TCOD_sys_update_char` now works with the newer renderers. +- Fixed buffer overflow in name generator. +- `TCOD_image_from_console` now works with the newer renderers. +- New renderers now auto-load fonts from `libtcod.cfg` or `terminal.png`. + +## [1.15.1] - 2019-11-22 +### Changed +- Renamed build systems directory from `build/` to `buildsys/`. + +### Fixed +- `OPENGL` and `GLSL` renderers were not properly clearing space characters. + +## [1.15.0] - 2019-11-08 +### Changed +- `TCOD_image_blit_2x` now renders using Unicode block elements instead of a + custom encoding. + +### Fixed +- Libtcod will no longer segfault if it's statically linked to an executable. + +## [1.14.0] - 2019-09-06 +### Added +- `TCODConsole::get_data` method for getting the C struct pointer from C++. + +### Fixed +- `TCOD_map_compute_fov` will now silently ignore out-of-bounds coordinates + instead of crashing. +- Changing the tiles of an active tileset will now work correctly. + +## [1.13.0] - 2019-07-05 +### Added +- You can now set the `TCOD_RENDERER` and `TCOD_VSYNC` environment variables to + force specific options to be used. + Example: ``TCOD_RENDERER=sdl2 TCOD_VSYNC=1`` + +### Changed +- `TCOD_sys_set_renderer` now returns an error status. +- `TCODSystem::setRenderer` will now throw instead of terminating on an error. +- `TCOD_console_init_root` and `TCOD_sys_set_renderer` are now no-discard. + +### Fixed +- `TCOD_console_map_ascii_code_to_font` functions will now work when called + before `TCOD_console_init_root`. + +## [1.12.3] - 2019-06-02 +### Fixed +- Fixed regressions in text alignment for non-rectangle-bound text on UTF-8 + print functions. + +## [1.12.2] - 2019-05-24 +### Fixed +- Fixed crashes and bad output when using printf-style functions. + +## [1.12.1] - 2019-05-17 +### Fixed +- Fixed shader compilation issues in the OPENGL2 renderer. +- Fallback fonts should fail less on Linux. + +## [1.12.0] - 2019-05-17 +### Added +- Added the `TCOD_get_error` and `TCOD_set_error` functions. + +### Changed +- `TCOD_console_init_root` and `TCOD_console_set_custom_font` will now return + an error code instead of terminating on a known error. + +## [1.11.5] - 2019-05-10 +### Added +- Several functions in the `tcod::console` namespace are now accessible. + These functions are provisional, so the API may change at anytime. + +### Fixed +- Corrected bounding box issues with the stateless UTF-8 print functions. + +## [1.11.4] - 2019-04-26 +### Fixed +- Fixed a name conflict with endianness macros on FreeBSD. + +## [1.11.3] - 2019-04-19 +### Changed +- New consoles are initialized as if clear was called. +- The SDL callback type now uses a typed argument instead of void pointer. + +### Fixed +- Fixed horizontal alignment for TrueType fonts. +- Fixed screenshots with the older SDL renderer. + +### Deprecated +- The SDL callback feature has been deprecated. + +## [1.11.2] - 2019-03-29 +### Fixed +- Console printing was ignoring color codes at the beginning of a string. +- Releases no longer display debug messages. + +## [1.11.1] - 2019-03-15 +### Fixed +- Fixed header declaration for `TCOD_sys_accumulate_console`. + +## [1.11.0] - 2019-03-15 +### Added +- Added new functions which convert from SDL events to libtcod events: + - `TCOD_sys_process_key_event` + - `TCOD_sys_process_mouse_event` + - `tcod::sdl2::process_event` +- Added a way to access libtcod's SDL variables. + - `TCOD_sys_get_sdl_window` + - `TCOD_sys_get_sdl_renderer` +- Added `TCOD_sys_accumulate_console` which renders a console to the display + without automatically presenting it. +- The new renderers can potentially use a fall-back font when none is provided. + +### Fixed +- `TCOD_console_has_mouse_focus` and `TCOD_console_is_active` are now more + reliable with the newer renderers. + +## [1.10.8] - 2019-03-01 +### Deprecated +- Updated libtcodpy deprecation warning with instructions on how to update to + python-tcod. + +## [1.10.7] - 2019-03-01 +### Changed +- GCC releases now include debug symbols. +### Fixed +- `SDL2` and `OPENGL2` now support screenshots. +- `TCOD_sys_get_char_size` fixed on the newer renderers. + +## [1.10.6] - 2019-02-15 +### Changed +- Printing generates more compact layouts. +### Fixed +- Fixed segmentation faults in the newer print functions caused by bad color + codes. +- The `OPENGL` and `GLSL` renders work again in static builds. +- The `SDL2` and `OPENGL2` renders can now large numbers of tiles. + +## [1.10.5] - 2019-02-06 +### Changed +- The SDL2/OPENGL2 renderers will now auto-detect a custom fonts key-color. +### Fixed +- `TCOD_console_printf_frame` was clearing tiles outside if it's bounds. +- The `TCOD_FONT_LAYOUT_CP437` layout was incorrect. + +## [1.10.4] - 2019-02-01 +### Fixed +- Fixed regression where mouse wheel events unset mouse coordinates. + +## [1.10.3] - 2019-01-19 +### Fixed +- Use correct math for tile-based delta in mouse events. +- New renderers now support tile-based mouse coordinates. +- SDL2 renderer will now properly refresh after the window is resized. +- MinGW samples now bundle their own runtimes. + +## [1.10.2] - 2018-11-23 +### Fixed +- Version numbers were not updated. + +## [1.10.1] - 2018-11-23 +### Changed +- `RENDERER_OPENGL2` now only needs OpenGL 2.0 to load. + +### Fixed +- `FONT_LAYOUT_CP437` constant was missing from libtcodpy. +- Function stubs for `TCOD_console_set_keyboard_repeat` and + `TCOD_console_disable_keyboard_repeat` have been added to the ABI, this + should fix older programs which depended on them existing. + +## [1.10.0] - 2018-11-17 +### Added +- Added pkg-config for 'libtcod' on AutoTools builds. +- Added `TCOD_FONT_LAYOUT_CP437`. + +### Fixed +- `RENDERER_OPENGL2` constant was missing from libtcodpy. +- Fixed crash when assigning to larger code-points. +- Fixed center alignment on printf functions. +- Fixed missing border tiles on printf frame function. + +## [1.9.0] - 2018-10-24 +### Added +- New renderer: `TCOD_RENDERER_OPENGL2` +- `TCOD_RENDERER_SDL2` and `TCOD_RENDERER_OPENGL2` now have reliable fullscreen + support. +- SCons MSVC releases now include libtcod's `.pdb` file. + +## Changed +- `src/vendor` must be included when building libtcod. +- `glad.c` added to vendor directory. +- In GCC builds: non-public symbols are no longer visible by default. + +## [1.8.2] - 2018-10-13 +### Fixed +- Fixed potential crash when splitting lines in UTF-8 print functions. +- Fixed possible hang in `TCOD_lex_parse_until_token_value`. + +## [1.8.1] - 2018-10-11 +### Changed +- Updated the compiler used to deploy Windows MinGW builds. + +## [1.8.0] - 2018-10-07 +### Added +- New `TCOD_MAJOR_VERSION`, `TCOD_MINOR_VERSION`, and `TCOD_PATCHLEVEL` + constants. +- Added UTF-8 print functions for C and C++: + - `TCOD_console_printf`, `TCOD_console_printf_ex`, + `TCOD_console_printf_rect`, and `TCOD_console_printf_rect_ex`. + - `TCOD_console_printf_frame` + - `TCOD_console_get_height_rect_fmt` + - New overrides for `TCODConsole::print` which can take `std::string`. + - `TCODConsole::printf`. +- Added `TCOD_quit` function, this function must be called on exit. +- New renderer: `TCOD_RENDERER_SDL2` + +### Changed +- AutoTools now adds version numbers to the libraries it builds. +- lodepng and zlib sources moved into `src/vendor/` folder. +- Bundled zlib library updated from `1.2.8` to `1.2.11`. +- LodePNG updated from `20160501` to `20180611`. +- libtcod C type declarations are stricter. +- libtcod now uses the C99 and C++14 standards. +- In the repository `include/` headers have been moved into `src/`. +- Most headers except for `libtcod.h` and `libtcod.h` have been moved into a + `libtcod/` sub-folder. +- SCons default architecture is now automatic instead of just 32-bit. +- libtcod gui headers now use LIBTCOD_EXPORTS instead of LIBTCOD_GUI_EXPORTS to + determine dllexport/dllimport. + +### Deprecated +- All functions replaced by the new UTF-8 functions are deprecated. +- The ctypes implementation of libtcodpy will no longer be maintained, use + python-tcod as a drop-in replacement. +- Deprecated file-system, threading, clipboard, and dynamic library functions. + +### Fixed +- `libtcodpy.map_clear`: `transparent` and `walkable` parameters were reversed. +- Resolved build issues on PowerPC platforms. +- Mouse state is now tracked even when mouse events are not asked for. +- libtcod sys event functions no longer crash if the given key pointer is NULL. +- SCons no longer crashes downloading SDL2 for Windows. + +### Removed +- Autotools no longer creates `libtcodxx` or `libtcodgui` libraries, C++ + programs should link to `libtcod` instead. + ## [1.7.0] - 2018-06-12 ### Changed - `TCOD_console_is_active()` now returns keyboard focus, its previous return @@ -176,7 +507,8 @@ This project DOES NOT adhere to [Semantic Versioning](http://semver.org/). ### Removed - Removed SDL1 support. -- Removed C/C++/Python API functions TCOD_sys_set_keyboard_repeat and TCOD_sys_disable_keyboard_repeat. This was SDL1 functionality, and not supported in SDL2. +- Removed C/C++/Python API functions `TCOD_console_set_keyboard_repeat` and + `TCOD_console_disable_keyboard_repeat`. This was SDL1 functionality, and not supported in SDL2. ## [1.6.1] - 2016-09-23 ### Changed diff --git a/tcod_sys/libtcod/LIBTCOD-CREDITS.txt b/tcod_sys/libtcod/LIBTCOD-CREDITS.txt index cfbcea982..6ea352636 100644 --- a/tcod_sys/libtcod/LIBTCOD-CREDITS.txt +++ b/tcod_sys/libtcod/LIBTCOD-CREDITS.txt @@ -1,46 +1,53 @@ -Products : - -- zlib 1.2.8, by Jean-loup Gailly and Mark Adler - http://www.zlib.org -- lodepng 20160501, by Lode Vandevenne - http://lodev.org/lodepng -- SDL 2, by Sam Lantinga - http://www.libsdl.org -- stb_sprintf, originally by Jeff Roberts / RAD Game Tools, 2015/10/20 - http://github.com/nothings/stb - (modified to compile for C89) - -Many thanks to everyone who provided feedback and patches, and especially : -- Dominik 'Mingos' Marczuk for the restrictive shadowcasting fov, djikstra - pathfinding, name generator, documentation skin, lots of bitmap fonts and - being the #1 libtcod user, supporter and contributor. -- Joao 'Jotaf' Henriques for his long time support, priceless comments and - suggestions and the awesome Python tutorial. -- Chris 'donblas' Hamons for libtcod-net, the cmake system, the swig wrappers... -- Jonathon Duerig for the permissive field of view algorithm -- dividee for polishing and optimizing the Python wrapper. -- John Klimek for the early C# port and valuable bug fixes. -- Kyle 'Hex Decimal' Stewart & Emmanuel 'Altefcat' Dempur for their contribution - to the Python port. -- Antagonist for the awesome SkyFire GLSL roguelike engine, hence libtcod's GLSL - renderer -- Sandman for various tricky bug fixes. -- Joe Osborn for the OSX port, bug fixes and the bresenham 3d routines (still - to be backported from the old 1.5 branch...). -- Paul Sexton for the common Lisp wrapper. -- Bernard Helyer for the D wrapper. -- Adam 'Blinks' Blinkinsop for the OSX port and the autotools compilation system. -- Nick Glauber for being the first libtcod Paypal sponsor. -- Matt Sullivan for the py3k support -- namor for the FreeBSD cmake support -- Anylo for putting some of the demos in the cmake compilation -- Michael De Rosa, Killer_X and Joe Rumsey for their work on OSX port -- Denis Belov for fixes on the heightmap toolkit -- owners of projects using libtcod. - -Fonts : -The celtic garamond and dundalk fonts are from 1001freefonts.com. -The caeldera font is from blambot.com. -Other fonts are included in windows. -The celtic_garamond, arial, courier, dejavu, consolas, prestige and lucida 10x10/12x12 bitmap fonts were created by Mingos. - +Products : + +- zlib 1.2.8, by Jean-loup Gailly and Mark Adler + http://www.zlib.org +- lodepng 20160501, by Lode Vandevenne + http://lodev.org/lodepng +- SDL 2, by Sam Lantinga + http://www.libsdl.org +- stb_sprintf, originally by Jeff Roberts / RAD Game Tools, 2015/10/20 + http://github.com/nothings/stb + (modified to compile for C89) +- stb_truetype, authored from 2009-2016 by Sean Barrett / RAD Game Tools + http://github.com/nothings/stb +- utf8proc + https://github.com/JuliaStrings/utf8proc + (modified to be statically linkable, and to compile for C89) +- glad + https://github.com/Dav1dde/glad + +Many thanks to everyone who provided feedback and patches, and especially : +- Dominik 'Mingos' Marczuk for the restrictive shadowcasting fov, djikstra + pathfinding, name generator, documentation skin, lots of bitmap fonts and + being the #1 libtcod user, supporter and contributor. +- Joao 'Jotaf' Henriques for his long time support, priceless comments and + suggestions and the awesome Python tutorial. +- Chris 'donblas' Hamons for libtcod-net, the cmake system, the swig wrappers... +- Jonathon Duerig for the permissive field of view algorithm +- dividee for polishing and optimizing the Python wrapper. +- John Klimek for the early C# port and valuable bug fixes. +- Kyle 'Hex Decimal' Stewart & Emmanuel 'Altefcat' Dempur for their contribution + to the Python port. +- Antagonist for the awesome SkyFire GLSL roguelike engine, hence libtcod's GLSL + renderer +- Sandman for various tricky bug fixes. +- Joe Osborn for the OSX port, bug fixes and the bresenham 3d routines (still + to be backported from the old 1.5 branch...). +- Paul Sexton for the common Lisp wrapper. +- Bernard Helyer for the D wrapper. +- Adam 'Blinks' Blinkinsop for the OSX port and the autotools compilation system. +- Nick Glauber for being the first libtcod Paypal sponsor. +- Matt Sullivan for the py3k support +- namor for the FreeBSD cmake support +- Anylo for putting some of the demos in the cmake compilation +- Michael De Rosa, Killer_X and Joe Rumsey for their work on OSX port +- Denis Belov for fixes on the heightmap toolkit +- owners of projects using libtcod. + +Fonts : +The celtic garamond and dundalk fonts are from 1001freefonts.com. +The caeldera font is from blambot.com. +Other fonts are included in windows. +The celtic_garamond, arial, courier, dejavu, consolas, prestige and lucida 10x10/12x12 bitmap fonts were created by Mingos. + diff --git a/tcod_sys/libtcod/LIBTCOD-LICENSE.txt b/tcod_sys/libtcod/LIBTCOD-LICENSE.txt deleted file mode 100644 index b8a320974..000000000 --- a/tcod_sys/libtcod/LIBTCOD-LICENSE.txt +++ /dev/null @@ -1,30 +0,0 @@ -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* libtcod 'The Doryen library' is a cross-platform C/C++ library for roguelike -* developers. -* Its source code is available from : -* http://doryen.eptalys.net/libtcod -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tcod_sys/libtcod/LICENSE.txt b/tcod_sys/libtcod/LICENSE.txt new file mode 100644 index 000000000..e2f706095 --- /dev/null +++ b/tcod_sys/libtcod/LICENSE.txt @@ -0,0 +1,30 @@ +BSD 3-Clause License + +Copyright © 2008-2020, Jice and the libtcod contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/tcod_sys/libtcod/README-linux-SDL2.md b/tcod_sys/libtcod/README-linux-SDL2.md deleted file mode 100644 index c661a50bb..000000000 --- a/tcod_sys/libtcod/README-linux-SDL2.md +++ /dev/null @@ -1,50 +0,0 @@ -Building Libtcod 1.6 on Linux with SDL2 -======================================= - -The following instructions have been tested on 32 and 64-bit versions of Ubuntu 14.04 and Fedora 22. - -Dependencies ------------- - -For Ubuntu 14.04, install these dependencies: - - $ sudo apt-get install curl build-essential make cmake autoconf automake libtool mercurial libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev - -For Fedora 22: - - $ sudo dnf -v groupinstall "C Development Tools and Libraries" - $ sudo dnf install mercurial alsa-lib-devel audiofile-devel mesa-libGL-devel mesa-libGLU-devel mesa-libEGL-devel mesa-libGLES-devel libXext-devel libX11-devel libXi-devel libXrandr-devel libXrender-devel dbus-devel libXScrnSaver-devel libusb-devel pulseaudio-libs-devel libXinerama-devel libXcursor-devel systemd-devel - - -Building SDL2 -------------- - -It is recommended strongly that you install SDL2 using your package manager. However, if you are unable to work out the package name, then you can take the harder route and build it yourself. - -Download the supported SDL2 revision, build and install it if you must: - - $ curl -o sdl.tar.gz http://hg.libsdl.org/SDL/archive/007dfe83abf8.tar.gz - $ tar -xf sdl.tar.gz - $ cd SDL-007dfe83abf8/ - $ mkdir -p build - $ cd build - $ ../configure - $ make - $ sudo make install - -This will place the libraries at `/usr/local/lib/` and the development headers at `/usr/local/include/SDL2/`. - - -Building Libtcod 1.6 --------------------- -Download the latest libtcod version, build it and install it: - - $ hg clone https://bitbucket.org/libtcod/libtcod - $ cd libtcod/build/autotools - $ autoreconf -i - $ ./configure CFLAGS='-O2' - $ make - -This will place the libraries in the top level of the libtcod checkout directory. - -Note that the same makefile is used for 32 and 64 bit distributions. diff --git a/tcod_sys/libtcod/README.md b/tcod_sys/libtcod/README.md index 3d31eaeeb..3bc27aab6 100644 --- a/tcod_sys/libtcod/README.md +++ b/tcod_sys/libtcod/README.md @@ -1,56 +1,94 @@ -[TOC] - -## Introduction ## - -libtcod is a free, fast, portable and uncomplicated API for roguelike developers providing an advanced true color console, input, and lots of other utilities frequently used in roguelikes. - -Status: [![Build status](https://ci.appveyor.com/api/projects/status/6jh07hq205iy0mlh/branch/default?svg=true)](https://ci.appveyor.com/project/rmtew/libtcod/branch/default) - -## What can it do? ## - -If you want to get a quick overview of the features that libtcod provides, check out the [Features](https://bitbucket.org/libtcod/libtcod/wiki/Features) page. - -If you want to get a quick overview of games which have used libtcod, check out the [Projects](http://roguecentral.org/doryen/projects-2/) page. - -libtcod is also well known for it's [easy to follow tutorial](http://www.roguebasin.com/index.php?title=Complete_Roguelike_Tutorial,_using_python%2Blibtcod), which many people have used to get started developing a roguelike. Follow the relevant links the tutorial gives, and it will point you to the right locations. - -## How do I get set up? ## - -### Using one of our downloads ### - -Currently, only Windows binaries are available from the Bitbucket [download section](https://bitbucket.org/libtcod/libtcod/downloads) for this project. If you are programming in C or C++, various sample projects are included within the source code which can be used as examples of various features. For those who wish to program in Python which is the only scripting language support that has been contributed so far, the basics are described in [part 1](http://www.roguebasin.com/index.php?title=Complete_Roguelike_Tutorial,_using_python%2Blibtcod,_part_1#Setting_it_up) of the tutorial. - -Two builds are currently provided for each release: - -* 32 bit (Win32, SDL2 only) binaries also including source code. -* 64 bit (x64, SDL2 only) binaries also including source code. - -**Warning:** If you download these builds, run `samples.exe` as your very first action. If you are unable to and get an error about `vcruntime140.dll` being missing, you need to install the two [Visual Studio 2015 runtimes](https://www.microsoft.com/en-us/download/details.aspx?id=53587). Make sure you install the 32-bit runtime. And make sure you also install the 64-bit runtime. Then run `samples.exe` again, and it should now work. Whether you plan to develop in C, C++, Python or some other language, this is required. - -### Compiling from source ### - -These are the recommended places to obtain the source code from: - -* The latest source code release snapshot on the [downloads page](https://bitbucket.org/libtcod/libtcod/downloads). -* Clone the repository with Mercurial and checkout the tag for the latest version in the `default` branch. -* Clone the repository and checkout the bleeding edge from the tip in the default branch. - -All compilation methods, currently including Visual Studio (Windows), SCons (Windows, Linux, MacOS) and autotools (Linux, MacOS), are located within the `build/` subdirectory. - -Windows users who prefer to use Visual Studio directly can either run the top-level 'build.bat' script, or locate and open the provided solution directly using Visual Studio. The solution is currently for Visual Studio 2015, and the [free community edition](https://www.visualstudio.com/vs/community/) is highly recommended. - -Autotools is a standard approach used for decades, and if you are not familiar with it, you can Bing (or Google) the topic and learn more. Explicit instructions for Linux, which should be relevant, are [provided here](README-linux-SDL2.md). SCons is another popular approach, and explicit instructions are [provided here](https://bitbucket.org/libtcod/libtcod/src/tip/build/scons/?at=default) for those who prefer. - -MacOS users with a working Homebrew installation, can install the necessary dependencies with `brew install autoconf automake libtool pkg-build sdl2`. To build from the current development version of libtcod (rather than downloading a source package), `brew install mercurial`. Then follow [the directions](README-linux-SDL2.md) for building libtcod on Linux (just the final section). Note that the actual libraries will be in libtcod/build/autotools/.lib, with several symlinks. - -#### SDL2 #### - -[SDL2](http://hg.libsdl.org/SDL) is the latest version of SDL. Release 2.0.5 (changeset 007dfe83abf8) of SDL2, is currently used for the official Windows builds. If you choose to use a different version of SDL2, please be sure to mention it in any issues you create. And if you are using the bleeding edge (the latest unreleased/untagged changes), please rule out that this is the cause of any problems you encounter, before creating issues. - -## Getting Started ## - -The latest documentation is updated with every significant change made to libtcod. You can find it in [the doc directory](https://bitbucket.org/libtcod/libtcod/src/tip/doc/index2.html?at=default&fileviewer=file-view-default). Similarly, [the changelog](https://bitbucket.org/libtcod/libtcod/src/tip/libtcod-CHANGELOG.txt?at=default) provides a high level overview of the things you might need to be aware of when later updating libtcod. - -libtcod comes with a sample application, implementations of which are provided in each of C ([samples_c.c](https://bitbucket.org/libtcod/libtcod/src/tip/samples/samples_c.c?at=default)), C++ ([samples_cpp.cpp](https://bitbucket.org/libtcod/libtcod/src/tip/samples/samples_cpp.cpp?at=default)) and Python ([samples_py.py](https://bitbucket.org/libtcod/libtcod/src/tip/python/samples_py.py?at=default)). This provides a decent overview of the basic features, in an interactive fashion. Each should be identical for the most part, so if you are using Windows, downloading the precompiled binaries and running the included `samples.exe` which is compiled from the C source code, should be representative of the other versions. - -The popular [Python tutorial](http://www.roguebasin.com/index.php?title=Complete_Roguelike_Tutorial,_using_python%2Blibtcod) is a good way to both build up a simple roguelike, and get familiar with the basics of libtcod. \ No newline at end of file +# Table of contents # + + * [Table of contents](#table-of-contents) + * [Introduction](#introduction) + * [What can it do?](#what-can-it-do) + * [How do I get set up?](#how-do-i-get-set-up) + * [Using one of our downloads](#using-one-of-our-downloads) + * [Compiling from source](#compiling-from-source) + * [Getting Started](#getting-started) + +# Introduction # + +libtcod is a free, fast, portable and uncomplicated API for roguelike +developers providing an advanced true color console, input, and lots of other +utilities frequently used in roguelikes. + +Status: +[![Build status](https://ci.appveyor.com/api/projects/status/pemepxo2221f8heo/branch/master?svg=true)](https://ci.appveyor.com/project/HexDecimal/libtcod-6e1jk/branch/master) +[![Build Status](https://travis-ci.org/libtcod/libtcod.svg?branch=master)](https://travis-ci.org/libtcod/libtcod) +[![Documentation Status](https://readthedocs.org/projects/libtcod/badge/?version=latest)](https://libtcod.readthedocs.io/en/latest/?badge=latest) + +# What can it do? # + +If you want to get a quick overview of the features that libtcod provides, +check out the [Features](https://bitbucket.org/libtcod/libtcod/wiki/Features) +page. + +# How do I get set up? # + +## Using one of our downloads ## + +If you are programming in C or C++ then +Windows and MacOS binaries are available from the +[GitHub Releases page](https://github.com/libtcod/libtcod/releases). + +Various C/C++ sample projects are included within +the repository which can be used as examples of various features. + +Keep in mind that as a C++14 library, you will need to distribute the +appropriate runtime with your program such as the +[Visual Studio 2015 runtimes](https://www.microsoft.com/en-us/download/details.aspx?id=53587) +or else the program will fail to run. This is required even when using Python. + +For those who wish to program in Python you can install python-tcod using +[this installation guide](https://python-tcod.readthedocs.io/en/latest/installation.html). +Once installed you can follow +[the Python 3 tutorial](http://rogueliketutorials.com/tutorials/tcod/) +or you can find Python example scripts on the +[python-tcod repository](https://github.com/libtcod/python-tcod). + +A alternative version of the Python library (libtcodpy) exists in the binary +downloads, but you should avoid using this version as it is not as well +maintained. + +## Compiling from source ## + +You can clone with Git via the +[GitHub repository](https://github.com/libtcod/libtcod). +You can then checkout a specific tag or get the in-development version from +the master branch. + +All compilation methods, currently including +SCons (Windows, Linux, MacOS) and Autotools (Linux, MacOS), are located within +the `buildsys/` subdirectory. + +SCons automatically downloads SDL2 and can be used on all platforms. +Instructions are +[provided here](https://github.com/libtcod/libtcod/tree/master/buildsys/scons). +The current release builds are built using SCons. + +Autotools is a common standard on Linux, and can be used for MacOS. +Instructions are +[provided here](https://github.com/libtcod/libtcod/tree/master/buildsys/autotools). + +# Getting Started # + +The latest documentation is [here](https://libtcod.readthedocs.io/en/latest). +Currently it's very incomplete, so most people will want to read the +[1.6.4 documentation](https://libtcod.github.io/docs/index2.html?c=true&cpp=true&cs=false&py=false&lua=false) +instead. +Python users should use the +[python-tcod documentation](http://python-tcod.readthedocs.io). + +libtcod comes with a sample application, implementations of which are provided +in each of +C ([samples_c.c](https://github.com/libtcod/libtcod/blob/master/samples/samples_c.c)), +C++ ([samples_cpp.cpp](https://github.com/libtcod/libtcod/blob/master/samples/samples_cpp.cpp)), +and Python ([samples_py.py](https://github.com/libtcod/python-tcod/blob/master/examples/samples_tcod.py)). +This provides a decent overview of the basic features, in an interactive +fashion. +Each should be identical for the most part, so if you are using Windows, +downloading the pre-compiled binaries and running the included `samples.exe` +which is compiled from the C source code, should be representative of the other +versions. diff --git a/tcod_sys/libtcod/include/bresenham.h b/tcod_sys/libtcod/include/bresenham.h deleted file mode 100644 index c21200ffa..000000000 --- a/tcod_sys/libtcod/include/bresenham.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_BRESENHAM_H -#define _TCOD_BRESENHAM_H - -#include "libtcod_portability.h" - -#ifdef __cplusplus -extern "C" { -#endif -/** - * \brief A callback to be passed to TCOD_line - * - * The points given to the callback include both the starting and ending - * positions. - * - * \param x - * \param y - * \return As long as this callback returns true it will be called with the - * next x,y point on the line. - */ -typedef bool (*TCOD_line_listener_t) (int x, int y); - -TCOD_DEPRECATED TCODLIB_API -void TCOD_line_init(int xFrom, int yFrom, int xTo, int yTo); - -TCOD_DEPRECATED TCODLIB_API -bool TCOD_line_step(int *xCur, int *yCur); /* advance one step. returns true if we reach destination */ - -/* atomic callback function. Stops when the callback returns false */ -TCODLIB_API bool TCOD_line(int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener); -/** - * \brief A struct used for computing a bresenham line. - */ -typedef struct { - int stepx; - int stepy; - int e; - int deltax; - int deltay; - int origx; - int origy; - int destx; - int desty; -} TCOD_bresenham_data_t; - -TCODLIB_API void TCOD_line_init_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_bresenham_data_t *data); -TCODLIB_API bool TCOD_line_step_mt(int *xCur, int *yCur, TCOD_bresenham_data_t *data); - -TCOD_DEPRECATED -TCODLIB_API bool TCOD_line_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener, TCOD_bresenham_data_t *data); -#ifdef __cplusplus -} -#endif -#endif diff --git a/tcod_sys/libtcod/include/console.h b/tcod_sys/libtcod/include/console.h deleted file mode 100644 index cab348adb..000000000 --- a/tcod_sys/libtcod/include/console.h +++ /dev/null @@ -1,140 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_CONSOLE_H -#define _TCOD_CONSOLE_H - -#include "libtcod_portability.h" - -#ifdef TCOD_CONSOLE_SUPPORT - -#include "color.h" -#include "console_types.h" -#include "image.h" -#include "list.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define TCOD_BKGND_ALPHA(alpha) ((TCOD_bkgnd_flag_t)(TCOD_BKGND_ALPH|(((uint8_t)(alpha*255))<<8))) -#define TCOD_BKGND_ADDALPHA(alpha) ((TCOD_bkgnd_flag_t)(TCOD_BKGND_ADDA|(((uint8_t)(alpha*255))<<8))) - -TCODLIB_API void TCOD_console_init_root(int w, int h, const char * title, bool fullscreen, TCOD_renderer_t renderer); -TCODLIB_API void TCOD_console_set_window_title(const char *title); -TCODLIB_API void TCOD_console_set_fullscreen(bool fullscreen); -TCODLIB_API bool TCOD_console_is_fullscreen(void); -TCODLIB_API bool TCOD_console_is_window_closed(void); -TCODLIB_API bool TCOD_console_has_mouse_focus(void); -TCODLIB_API bool TCOD_console_is_active(void); - -TCODLIB_API void TCOD_console_set_custom_font(const char *fontFile, int flags,int nb_char_horiz, int nb_char_vertic); -TCODLIB_API void TCOD_console_map_ascii_code_to_font(int asciiCode, int fontCharX, int fontCharY); -TCODLIB_API void TCOD_console_map_ascii_codes_to_font(int asciiCode, int nbCodes, int fontCharX, int fontCharY); -TCODLIB_API void TCOD_console_map_string_to_font(const char *s, int fontCharX, int fontCharY); - -TCODLIB_API void TCOD_console_set_dirty(int x, int y, int w, int h); -TCODLIB_API void TCOD_console_set_default_background(TCOD_console_t con,TCOD_color_t col); -TCODLIB_API void TCOD_console_set_default_foreground(TCOD_console_t con,TCOD_color_t col); -TCODLIB_API void TCOD_console_clear(TCOD_console_t con); -TCODLIB_API void TCOD_console_set_char_background(TCOD_console_t con,int x, int y, TCOD_color_t col, TCOD_bkgnd_flag_t flag); -TCODLIB_API void TCOD_console_set_char_foreground(TCOD_console_t con,int x, int y, TCOD_color_t col); -TCODLIB_API void TCOD_console_set_char(TCOD_console_t con,int x, int y, int c); -TCODLIB_API void TCOD_console_put_char(TCOD_console_t con,int x, int y, int c, TCOD_bkgnd_flag_t flag); -TCODLIB_API void TCOD_console_put_char_ex(TCOD_console_t con,int x, int y, int c, TCOD_color_t fore, TCOD_color_t back); - -TCODLIB_API void TCOD_console_set_background_flag(TCOD_console_t con,TCOD_bkgnd_flag_t flag); -TCODLIB_API TCOD_bkgnd_flag_t TCOD_console_get_background_flag(TCOD_console_t con); -TCODLIB_API void TCOD_console_set_alignment(TCOD_console_t con,TCOD_alignment_t alignment); -TCODLIB_API TCOD_alignment_t TCOD_console_get_alignment(TCOD_console_t con); -TCODLIB_API void TCOD_console_print(TCOD_console_t con,int x, int y, const char *fmt, ...); -TCODLIB_API void TCOD_console_print_ex(TCOD_console_t con,int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...); -TCODLIB_API int TCOD_console_print_rect(TCOD_console_t con,int x, int y, int w, int h, const char *fmt, ...); -TCODLIB_API int TCOD_console_print_rect_ex(TCOD_console_t con,int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...); -TCODLIB_API int TCOD_console_get_height_rect(TCOD_console_t con,int x, int y, int w, int h, const char *fmt, ...); - -TCODLIB_API void TCOD_console_rect(TCOD_console_t con,int x, int y, int w, int h, bool clear, TCOD_bkgnd_flag_t flag); -TCODLIB_API void TCOD_console_hline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag); -TCODLIB_API void TCOD_console_vline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag); -TCODLIB_API void TCOD_console_print_frame(TCOD_console_t con,int x,int y,int w,int h, bool empty, TCOD_bkgnd_flag_t flag, const char *fmt, ...); - -#ifndef NO_UNICODE -/* unicode support */ -TCODLIB_API void TCOD_console_map_string_to_font_utf(const wchar_t *s, int fontCharX, int fontCharY); -TCODLIB_API void TCOD_console_print_utf(TCOD_console_t con,int x, int y, const wchar_t *fmt, ...); -TCODLIB_API void TCOD_console_print_ex_utf(TCOD_console_t con,int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...); -TCODLIB_API int TCOD_console_print_rect_utf(TCOD_console_t con,int x, int y, int w, int h, const wchar_t *fmt, ...); -TCODLIB_API int TCOD_console_print_rect_ex_utf(TCOD_console_t con,int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...); -TCODLIB_API int TCOD_console_get_height_rect_utf(TCOD_console_t con,int x, int y, int w, int h, const wchar_t *fmt, ...); -#endif - - -TCODLIB_API TCOD_color_t TCOD_console_get_default_background(TCOD_console_t con); -TCODLIB_API TCOD_color_t TCOD_console_get_default_foreground(TCOD_console_t con); -TCODLIB_API TCOD_color_t TCOD_console_get_char_background(TCOD_console_t con,int x, int y); -TCODLIB_API TCOD_color_t TCOD_console_get_char_foreground(TCOD_console_t con,int x, int y); -TCODLIB_API int TCOD_console_get_char(TCOD_console_t con,int x, int y); - -TCODLIB_API TCOD_image_t TCOD_console_get_background_color_image(TCOD_console_t con); -TCODLIB_API TCOD_image_t TCOD_console_get_foreground_color_image(TCOD_console_t con); - -TCODLIB_API void TCOD_console_set_fade(uint8_t val, TCOD_color_t fade); -TCODLIB_API uint8_t TCOD_console_get_fade(void); -TCODLIB_API TCOD_color_t TCOD_console_get_fading_color(void); - -TCODLIB_API void TCOD_console_flush(void); - -TCODLIB_API void TCOD_console_set_color_control(TCOD_colctrl_t con, TCOD_color_t fore, TCOD_color_t back); - -TCODLIB_API TCOD_key_t TCOD_console_check_for_keypress(int flags); -TCODLIB_API TCOD_key_t TCOD_console_wait_for_keypress(bool flush); -TCODLIB_API bool TCOD_console_is_key_pressed(TCOD_keycode_t key); - -/* ASCII paint file support */ -TCODLIB_API TCOD_console_t TCOD_console_from_file(const char *filename); -TCODLIB_API bool TCOD_console_load_asc(TCOD_console_t con, const char *filename); -TCODLIB_API bool TCOD_console_load_apf(TCOD_console_t con, const char *filename); -TCODLIB_API bool TCOD_console_save_asc(TCOD_console_t con, const char *filename); -TCODLIB_API bool TCOD_console_save_apf(TCOD_console_t con, const char *filename); - -TCODLIB_API TCOD_console_t TCOD_console_new(int w, int h); -TCODLIB_API int TCOD_console_get_width(TCOD_console_t con); -TCODLIB_API int TCOD_console_get_height(TCOD_console_t con); -TCODLIB_API void TCOD_console_set_key_color(TCOD_console_t con,TCOD_color_t col); -TCODLIB_API void TCOD_console_blit(TCOD_console_t src,int xSrc, int ySrc, int wSrc, int hSrc, TCOD_console_t dst, int xDst, int yDst, float foreground_alpha, float background_alpha); -TCODLIB_API void TCOD_console_delete(TCOD_console_t console); - -TCODLIB_API void TCOD_console_credits(void); -TCODLIB_API void TCOD_console_credits_reset(void); -TCODLIB_API bool TCOD_console_credits_render(int x, int y, bool alpha); -#ifdef __cplusplus -} -#endif - -#endif /* TCOD_CONSOLE_SUPPORT */ - -#endif /* _TCOD_CONSOLE_H */ diff --git a/tcod_sys/libtcod/include/console_rexpaint.h b/tcod_sys/libtcod/include/console_rexpaint.h deleted file mode 100644 index 043d821f8..000000000 --- a/tcod_sys/libtcod/include/console_rexpaint.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef TCOD_CONSOLE_REXPAINT_H_ -#define TCOD_CONSOLE_REXPAINT_H_ - -#include "libtcod_portability.h" -#include "console.h" - -#ifdef __cplusplus -extern "C" { -#endif - -TCODLIB_API TCOD_console_t TCOD_console_from_xp(const char *filename); -TCODLIB_API bool TCOD_console_load_xp(TCOD_console_t con, const char *filename); -TCODLIB_API bool TCOD_console_save_xp(TCOD_console_t con, - const char *filename, int compress_level); -TCODLIB_API TCOD_list_t TCOD_console_list_from_xp(const char *filename); -TCODLIB_API bool TCOD_console_list_save_xp( - TCOD_list_t console_list, const char *filename, int compress_level); - -#ifdef __cplusplus -} -#endif - -#endif /* TCOD_CONSOLE_REXPAINT_H_ */ diff --git a/tcod_sys/libtcod/include/external/pstdint.h b/tcod_sys/libtcod/include/external/pstdint.h deleted file mode 100644 index f4a30815a..000000000 --- a/tcod_sys/libtcod/include/external/pstdint.h +++ /dev/null @@ -1,919 +0,0 @@ -/* A portable stdint.h - **************************************************************************** - * BSD License: - **************************************************************************** - * - * Copyright (c) 2005-2016 Paul Hsieh - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - **************************************************************************** - * - * Version 0.1.16.0 - * - * The ANSI C standard committee, for the C99 standard, specified the - * inclusion of a new standard include file called stdint.h. This is - * a very useful and long desired include file which contains several - * very precise definitions for integer scalar types that is critically - * important for making several classes of applications portable - * including cryptography, hashing, variable length integer libraries - * and so on. But for most developers its likely useful just for - * programming sanity. - * - * The problem is that some compiler vendors chose to ignore the C99 - * standard and some older compilers have no opportunity to be updated. - * Because of this situation, simply including stdint.h in your code - * makes it unportable. - * - * So that's what this file is all about. It's an attempt to build a - * single universal include file that works on as many platforms as - * possible to deliver what stdint.h is supposed to. Even compilers - * that already come with stdint.h can use this file instead without - * any loss of functionality. A few things that should be noted about - * this file: - * - * 1) It is not guaranteed to be portable and/or present an identical - * interface on all platforms. The extreme variability of the - * ANSI C standard makes this an impossibility right from the - * very get go. Its really only meant to be useful for the vast - * majority of platforms that possess the capability of - * implementing usefully and precisely defined, standard sized - * integer scalars. Systems which are not intrinsically 2s - * complement may produce invalid constants. - * - * 2) There is an unavoidable use of non-reserved symbols. - * - * 3) Other standard include files are invoked. - * - * 4) This file may come in conflict with future platforms that do - * include stdint.h. The hope is that one or the other can be - * used with no real difference. - * - * 5) In the current version, if your platform can't represent - * int32_t, int16_t and int8_t, it just dumps out with a compiler - * error. - * - * 6) 64 bit integers may or may not be defined. Test for their - * presence with the test: #ifdef INT64_MAX or #ifdef UINT64_MAX. - * Note that this is different from the C99 specification which - * requires the existence of 64 bit support in the compiler. If - * this is not defined for your platform, yet it is capable of - * dealing with 64 bits then it is because this file has not yet - * been extended to cover all of your system's capabilities. - * - * 7) (u)intptr_t may or may not be defined. Test for its presence - * with the test: #ifdef PTRDIFF_MAX. If this is not defined - * for your platform, then it is because this file has not yet - * been extended to cover all of your system's capabilities, not - * because its optional. - * - * 8) The following might not been defined even if your platform is - * capable of defining it: - * - * WCHAR_MIN - * WCHAR_MAX - * (u)int64_t - * PTRDIFF_MIN - * PTRDIFF_MAX - * (u)intptr_t - * - * 9) The following have not been defined: - * - * WINT_MIN - * WINT_MAX - * - * 10) The criteria for defining (u)int_least(*)_t isn't clear, - * except for systems which don't have a type that precisely - * defined 8, 16, or 32 bit types (which this include file does - * not support anyways). Default definitions have been given. - * - * 11) The criteria for defining (u)int_fast(*)_t isn't something I - * would trust to any particular compiler vendor or the ANSI C - * committee. It is well known that "compatible systems" are - * commonly created that have very different performance - * characteristics from the systems they are compatible with, - * especially those whose vendors make both the compiler and the - * system. Default definitions have been given, but its strongly - * recommended that users never use these definitions for any - * reason (they do *NOT* deliver any serious guarantee of - * improved performance -- not in this file, nor any vendor's - * stdint.h). - * - * 12) The following macros: - * - * PRINTF_INTMAX_MODIFIER - * PRINTF_INT64_MODIFIER - * PRINTF_INT32_MODIFIER - * PRINTF_INT16_MODIFIER - * PRINTF_LEAST64_MODIFIER - * PRINTF_LEAST32_MODIFIER - * PRINTF_LEAST16_MODIFIER - * PRINTF_INTPTR_MODIFIER - * - * are strings which have been defined as the modifiers required - * for the "d", "u" and "x" printf formats to correctly output - * (u)intmax_t, (u)int64_t, (u)int32_t, (u)int16_t, (u)least64_t, - * (u)least32_t, (u)least16_t and (u)intptr_t types respectively. - * PRINTF_INTPTR_MODIFIER is not defined for some systems which - * provide their own stdint.h. PRINTF_INT64_MODIFIER is not - * defined if INT64_MAX is not defined. These are an extension - * beyond what C99 specifies must be in stdint.h. - * - * In addition, the following macros are defined: - * - * PRINTF_INTMAX_HEX_WIDTH - * PRINTF_INT64_HEX_WIDTH - * PRINTF_INT32_HEX_WIDTH - * PRINTF_INT16_HEX_WIDTH - * PRINTF_INT8_HEX_WIDTH - * PRINTF_INTMAX_DEC_WIDTH - * PRINTF_INT64_DEC_WIDTH - * PRINTF_INT32_DEC_WIDTH - * PRINTF_INT16_DEC_WIDTH - * PRINTF_UINT8_DEC_WIDTH - * PRINTF_UINTMAX_DEC_WIDTH - * PRINTF_UINT64_DEC_WIDTH - * PRINTF_UINT32_DEC_WIDTH - * PRINTF_UINT16_DEC_WIDTH - * PRINTF_UINT8_DEC_WIDTH - * - * Which specifies the maximum number of characters required to - * print the number of that type in either hexadecimal or decimal. - * These are an extension beyond what C99 specifies must be in - * stdint.h. - * - * Compilers tested (all with 0 warnings at their highest respective - * settings): Borland Turbo C 2.0, WATCOM C/C++ 11.0 (16 bits and 32 - * bits), Microsoft Visual C++ 6.0 (32 bit), Microsoft Visual Studio - * .net (VC7), Intel C++ 4.0, GNU gcc v3.3.3 - * - * This file should be considered a work in progress. Suggestions for - * improvements, especially those which increase coverage are strongly - * encouraged. - * - * Acknowledgements - * - * The following people have made significant contributions to the - * development and testing of this file: - * - * Chris Howie - * John Steele Scott - * Dave Thorup - * John Dill - * Florian Wobbe - * Christopher Sean Morrison - * Mikkel Fahnoe Jorgensen - * - */ - -#include -#include -#include - -/* - * For gcc with _STDINT_H, fill in the PRINTF_INT*_MODIFIER macros, and - * do nothing else. On the Mac OS X version of gcc this is _STDINT_H_. - */ - -#if ((defined(__SUNPRO_C) && __SUNPRO_C >= 0x570) || (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (__GNUC__ > 3 || defined(_STDINT_H) || defined(_STDINT_H_) || defined (__UINT_FAST64_TYPE__)) )) && !defined (_PSTDINT_H_INCLUDED) -#include -#define _PSTDINT_H_INCLUDED -# if defined(__GNUC__) && (defined(__x86_64__) || defined(__ppc64__)) && !(defined(__APPLE__) && defined(__MACH__)) -# ifndef PRINTF_INT64_MODIFIER -# define PRINTF_INT64_MODIFIER "l" -# endif -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "" -# endif -# else -# ifndef PRINTF_INT64_MODIFIER -# define PRINTF_INT64_MODIFIER "ll" -# endif -# ifndef PRINTF_INT32_MODIFIER -# if (UINT_MAX == UINT32_MAX) -# define PRINTF_INT32_MODIFIER "" -# else -# define PRINTF_INT32_MODIFIER "l" -# endif -# endif -# endif -# ifndef PRINTF_INT16_MODIFIER -# define PRINTF_INT16_MODIFIER "h" -# endif -# ifndef PRINTF_INTMAX_MODIFIER -# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER -# endif -# ifndef PRINTF_INT64_HEX_WIDTH -# define PRINTF_INT64_HEX_WIDTH "16" -# endif -# ifndef PRINTF_UINT64_HEX_WIDTH -# define PRINTF_UINT64_HEX_WIDTH "16" -# endif -# ifndef PRINTF_INT32_HEX_WIDTH -# define PRINTF_INT32_HEX_WIDTH "8" -# endif -# ifndef PRINTF_UINT32_HEX_WIDTH -# define PRINTF_UINT32_HEX_WIDTH "8" -# endif -# ifndef PRINTF_INT16_HEX_WIDTH -# define PRINTF_INT16_HEX_WIDTH "4" -# endif -# ifndef PRINTF_UINT16_HEX_WIDTH -# define PRINTF_UINT16_HEX_WIDTH "4" -# endif -# ifndef PRINTF_INT8_HEX_WIDTH -# define PRINTF_INT8_HEX_WIDTH "2" -# endif -# ifndef PRINTF_UINT8_HEX_WIDTH -# define PRINTF_UINT8_HEX_WIDTH "2" -# endif -# ifndef PRINTF_INT64_DEC_WIDTH -# define PRINTF_INT64_DEC_WIDTH "19" -# endif -# ifndef PRINTF_UINT64_DEC_WIDTH -# define PRINTF_UINT64_DEC_WIDTH "20" -# endif -# ifndef PRINTF_INT32_DEC_WIDTH -# define PRINTF_INT32_DEC_WIDTH "10" -# endif -# ifndef PRINTF_UINT32_DEC_WIDTH -# define PRINTF_UINT32_DEC_WIDTH "10" -# endif -# ifndef PRINTF_INT16_DEC_WIDTH -# define PRINTF_INT16_DEC_WIDTH "5" -# endif -# ifndef PRINTF_UINT16_DEC_WIDTH -# define PRINTF_UINT16_DEC_WIDTH "5" -# endif -# ifndef PRINTF_INT8_DEC_WIDTH -# define PRINTF_INT8_DEC_WIDTH "3" -# endif -# ifndef PRINTF_UINT8_DEC_WIDTH -# define PRINTF_UINT8_DEC_WIDTH "3" -# endif -# ifndef PRINTF_INTMAX_HEX_WIDTH -# define PRINTF_INTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH -# endif -# ifndef PRINTF_UINTMAX_HEX_WIDTH -# define PRINTF_UINTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH -# endif -# ifndef PRINTF_INTMAX_DEC_WIDTH -# define PRINTF_INTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH -# endif -# ifndef PRINTF_UINTMAX_DEC_WIDTH -# define PRINTF_UINTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH -# endif - -/* - * Something really weird is going on with Open Watcom. Just pull some of - * these duplicated definitions from Open Watcom's stdint.h file for now. - */ - -# if defined (__WATCOMC__) && __WATCOMC__ >= 1250 -# if !defined (INT64_C) -# define INT64_C(x) (x + (INT64_MAX - INT64_MAX)) -# endif -# if !defined (UINT64_C) -# define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX)) -# endif -# if !defined (INT32_C) -# define INT32_C(x) (x + (INT32_MAX - INT32_MAX)) -# endif -# if !defined (UINT32_C) -# define UINT32_C(x) (x + (UINT32_MAX - UINT32_MAX)) -# endif -# if !defined (INT16_C) -# define INT16_C(x) (x) -# endif -# if !defined (UINT16_C) -# define UINT16_C(x) (x) -# endif -# if !defined (INT8_C) -# define INT8_C(x) (x) -# endif -# if !defined (UINT8_C) -# define UINT8_C(x) (x) -# endif -# if !defined (UINT64_MAX) -# define UINT64_MAX 18446744073709551615ULL -# endif -# if !defined (INT64_MAX) -# define INT64_MAX 9223372036854775807LL -# endif -# if !defined (UINT32_MAX) -# define UINT32_MAX 4294967295UL -# endif -# if !defined (INT32_MAX) -# define INT32_MAX 2147483647L -# endif -# if !defined (INTMAX_MAX) -# define INTMAX_MAX INT64_MAX -# endif -# if !defined (INTMAX_MIN) -# define INTMAX_MIN INT64_MIN -# endif -# endif -#endif - -/* - * I have no idea what is the truly correct thing to do on older Solaris. - * From some online discussions, this seems to be what is being - * recommended. For people who actually are developing on older Solaris, - * what I would like to know is, does this define all of the relevant - * macros of a complete stdint.h? Remember, in pstdint.h 64 bit is - * considered optional. - */ - -#if (defined(__SUNPRO_C) && __SUNPRO_C >= 0x420) && !defined(_PSTDINT_H_INCLUDED) -#include -#define _PSTDINT_H_INCLUDED -#endif - -#ifndef _PSTDINT_H_INCLUDED -#define _PSTDINT_H_INCLUDED - -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t)-1) -#endif - -/* - * Deduce the type assignments from limits.h under the assumption that - * integer sizes in bits are powers of 2, and follow the ANSI - * definitions. - */ - -#ifndef UINT8_MAX -# define UINT8_MAX 0xff -#endif -#if !defined(uint8_t) && !defined(_UINT8_T) && !defined(vxWorks) -# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S) - typedef unsigned char uint8_t; -# define UINT8_C(v) ((uint8_t) v) -# else -# error "Platform not supported" -# endif -#endif - -#ifndef INT8_MAX -# define INT8_MAX 0x7f -#endif -#ifndef INT8_MIN -# define INT8_MIN INT8_C(0x80) -#endif -#if !defined(int8_t) && !defined(_INT8_T) && !defined(vxWorks) -# if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S) - typedef signed char int8_t; -# define INT8_C(v) ((int8_t) v) -# else -# error "Platform not supported" -# endif -#endif - -#ifndef UINT16_MAX -# define UINT16_MAX 0xffff -#endif -#if !defined(uint16_t) && !defined(_UINT16_T) && !defined(vxWorks) -#if (UINT_MAX == UINT16_MAX) || defined (S_SPLINT_S) - typedef unsigned int uint16_t; -# ifndef PRINTF_INT16_MODIFIER -# define PRINTF_INT16_MODIFIER "" -# endif -# define UINT16_C(v) ((uint16_t) (v)) -#elif (USHRT_MAX == UINT16_MAX) - typedef unsigned short uint16_t; -# define UINT16_C(v) ((uint16_t) (v)) -# ifndef PRINTF_INT16_MODIFIER -# define PRINTF_INT16_MODIFIER "h" -# endif -#else -#error "Platform not supported" -#endif -#endif - -#ifndef INT16_MAX -# define INT16_MAX 0x7fff -#endif -#ifndef INT16_MIN -# define INT16_MIN INT16_C(0x8000) -#endif -#if !defined(int16_t) && !defined(_INT16_T) && !defined(vxWorks) -#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S) - typedef signed int int16_t; -# define INT16_C(v) ((int16_t) (v)) -# ifndef PRINTF_INT16_MODIFIER -# define PRINTF_INT16_MODIFIER "" -# endif -#elif (SHRT_MAX == INT16_MAX) - typedef signed short int16_t; -# define INT16_C(v) ((int16_t) (v)) -# ifndef PRINTF_INT16_MODIFIER -# define PRINTF_INT16_MODIFIER "h" -# endif -#else -#error "Platform not supported" -#endif -#endif - -#ifndef UINT32_MAX -# define UINT32_MAX (0xffffffffUL) -#endif -#if !defined(uint32_t) && !defined(_UINT32_T) && !defined(vxWorks) -#if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S) - typedef unsigned long uint32_t; -# define UINT32_C(v) v ## UL -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "l" -# endif -#elif (UINT_MAX == UINT32_MAX) - typedef unsigned int uint32_t; -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "" -# endif -# define UINT32_C(v) v ## U -#elif (USHRT_MAX == UINT32_MAX) - typedef unsigned short uint32_t; -# define UINT32_C(v) ((unsigned short) (v)) -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "" -# endif -#else -#error "Platform not supported" -#endif -#endif - -#ifndef INT32_MAX -# define INT32_MAX (0x7fffffffL) -#endif -#ifndef INT32_MIN -# define INT32_MIN INT32_C(0x80000000) -#endif -#if !defined(int32_t) && !defined(_INT32_T) && !defined(vxWorks) -#if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S) - typedef signed long int32_t; -# define INT32_C(v) v ## L -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "l" -# endif -#elif (INT_MAX == INT32_MAX) - typedef signed int int32_t; -# define INT32_C(v) v -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "" -# endif -#elif (SHRT_MAX == INT32_MAX) - typedef signed short int32_t; -# define INT32_C(v) ((short) (v)) -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "" -# endif -#else -#error "Platform not supported" -#endif -#endif - -/* - * The macro stdint_int64_defined is temporarily used to record - * whether or not 64 integer support is available. It must be - * defined for any 64 integer extensions for new platforms that are - * added. - */ - -#undef stdint_int64_defined -#if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S) -# if (__STDC__ && __STDC_VERSION__ >= 199901L) || defined (S_SPLINT_S) -# define stdint_int64_defined - typedef long long int64_t; - typedef unsigned long long uint64_t; -# define UINT64_C(v) v ## ULL -# define INT64_C(v) v ## LL -# ifndef PRINTF_INT64_MODIFIER -# define PRINTF_INT64_MODIFIER "ll" -# endif -# endif -#endif - -#if !defined (stdint_int64_defined) -# if defined(__GNUC__) && !defined(vxWorks) -# define stdint_int64_defined - __extension__ typedef long long int64_t; - __extension__ typedef unsigned long long uint64_t; -# define UINT64_C(v) v ## ULL -# define INT64_C(v) v ## LL -# ifndef PRINTF_INT64_MODIFIER -# define PRINTF_INT64_MODIFIER "ll" -# endif -# elif defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S) -# define stdint_int64_defined - typedef long long int64_t; - typedef unsigned long long uint64_t; -# define UINT64_C(v) v ## ULL -# define INT64_C(v) v ## LL -# ifndef PRINTF_INT64_MODIFIER -# define PRINTF_INT64_MODIFIER "ll" -# endif -# elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined (__BORLANDC__) && __BORLANDC__ > 0x460) || defined (__alpha) || defined (__DECC) -# define stdint_int64_defined - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; -# define UINT64_C(v) v ## UI64 -# define INT64_C(v) v ## I64 -# ifndef PRINTF_INT64_MODIFIER -# define PRINTF_INT64_MODIFIER "I64" -# endif -# endif -#endif - -#if !defined (LONG_LONG_MAX) && defined (INT64_C) -# define LONG_LONG_MAX INT64_C (9223372036854775807) -#endif -#ifndef ULONG_LONG_MAX -# define ULONG_LONG_MAX UINT64_C (18446744073709551615) -#endif - -#if !defined (INT64_MAX) && defined (INT64_C) -# define INT64_MAX INT64_C (9223372036854775807) -#endif -#if !defined (INT64_MIN) && defined (INT64_C) -# define INT64_MIN INT64_C (-9223372036854775808) -#endif -#if !defined (UINT64_MAX) && defined (INT64_C) -# define UINT64_MAX UINT64_C (18446744073709551615) -#endif - -/* - * Width of hexadecimal for number field. - */ - -#ifndef PRINTF_INT64_HEX_WIDTH -# define PRINTF_INT64_HEX_WIDTH "16" -#endif -#ifndef PRINTF_INT32_HEX_WIDTH -# define PRINTF_INT32_HEX_WIDTH "8" -#endif -#ifndef PRINTF_INT16_HEX_WIDTH -# define PRINTF_INT16_HEX_WIDTH "4" -#endif -#ifndef PRINTF_INT8_HEX_WIDTH -# define PRINTF_INT8_HEX_WIDTH "2" -#endif -#ifndef PRINTF_INT64_DEC_WIDTH -# define PRINTF_INT64_DEC_WIDTH "19" -#endif -#ifndef PRINTF_INT32_DEC_WIDTH -# define PRINTF_INT32_DEC_WIDTH "10" -#endif -#ifndef PRINTF_INT16_DEC_WIDTH -# define PRINTF_INT16_DEC_WIDTH "5" -#endif -#ifndef PRINTF_INT8_DEC_WIDTH -# define PRINTF_INT8_DEC_WIDTH "3" -#endif -#ifndef PRINTF_UINT64_DEC_WIDTH -# define PRINTF_UINT64_DEC_WIDTH "20" -#endif -#ifndef PRINTF_UINT32_DEC_WIDTH -# define PRINTF_UINT32_DEC_WIDTH "10" -#endif -#ifndef PRINTF_UINT16_DEC_WIDTH -# define PRINTF_UINT16_DEC_WIDTH "5" -#endif -#ifndef PRINTF_UINT8_DEC_WIDTH -# define PRINTF_UINT8_DEC_WIDTH "3" -#endif - -/* - * Ok, lets not worry about 128 bit integers for now. Moore's law says - * we don't need to worry about that until about 2040 at which point - * we'll have bigger things to worry about. - */ - -#ifdef stdint_int64_defined - typedef int64_t intmax_t; - typedef uint64_t uintmax_t; -# define INTMAX_MAX INT64_MAX -# define INTMAX_MIN INT64_MIN -# define UINTMAX_MAX UINT64_MAX -# define UINTMAX_C(v) UINT64_C(v) -# define INTMAX_C(v) INT64_C(v) -# ifndef PRINTF_INTMAX_MODIFIER -# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER -# endif -# ifndef PRINTF_INTMAX_HEX_WIDTH -# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH -# endif -# ifndef PRINTF_INTMAX_DEC_WIDTH -# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH -# endif -#else - typedef int32_t intmax_t; - typedef uint32_t uintmax_t; -# define INTMAX_MAX INT32_MAX -# define UINTMAX_MAX UINT32_MAX -# define UINTMAX_C(v) UINT32_C(v) -# define INTMAX_C(v) INT32_C(v) -# ifndef PRINTF_INTMAX_MODIFIER -# define PRINTF_INTMAX_MODIFIER PRINTF_INT32_MODIFIER -# endif -# ifndef PRINTF_INTMAX_HEX_WIDTH -# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT32_HEX_WIDTH -# endif -# ifndef PRINTF_INTMAX_DEC_WIDTH -# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT32_DEC_WIDTH -# endif -#endif - -/* - * Because this file currently only supports platforms which have - * precise powers of 2 as bit sizes for the default integers, the - * least definitions are all trivial. Its possible that a future - * version of this file could have different definitions. - */ - -#ifndef stdint_least_defined - typedef int8_t int_least8_t; - typedef uint8_t uint_least8_t; - typedef int16_t int_least16_t; - typedef uint16_t uint_least16_t; - typedef int32_t int_least32_t; - typedef uint32_t uint_least32_t; -# define PRINTF_LEAST32_MODIFIER PRINTF_INT32_MODIFIER -# define PRINTF_LEAST16_MODIFIER PRINTF_INT16_MODIFIER -# define UINT_LEAST8_MAX UINT8_MAX -# define INT_LEAST8_MAX INT8_MAX -# define UINT_LEAST16_MAX UINT16_MAX -# define INT_LEAST16_MAX INT16_MAX -# define UINT_LEAST32_MAX UINT32_MAX -# define INT_LEAST32_MAX INT32_MAX -# define INT_LEAST8_MIN INT8_MIN -# define INT_LEAST16_MIN INT16_MIN -# define INT_LEAST32_MIN INT32_MIN -# ifdef stdint_int64_defined - typedef int64_t int_least64_t; - typedef uint64_t uint_least64_t; -# define PRINTF_LEAST64_MODIFIER PRINTF_INT64_MODIFIER -# define UINT_LEAST64_MAX UINT64_MAX -# define INT_LEAST64_MAX INT64_MAX -# define INT_LEAST64_MIN INT64_MIN -# endif -#endif -#undef stdint_least_defined - -/* - * The ANSI C committee has defined *int*_fast*_t types as well. This, - * of course, defies rationality -- you can't know what will be fast - * just from the type itself. Even for a given architecture, compatible - * implementations might have different performance characteristics. - * Developers are warned to stay away from these types when using this - * or any other stdint.h. - */ - -typedef int_least8_t int_fast8_t; -typedef uint_least8_t uint_fast8_t; -typedef int_least16_t int_fast16_t; -typedef uint_least16_t uint_fast16_t; -typedef int_least32_t int_fast32_t; -typedef uint_least32_t uint_fast32_t; -#define UINT_FAST8_MAX UINT_LEAST8_MAX -#define INT_FAST8_MAX INT_LEAST8_MAX -#define UINT_FAST16_MAX UINT_LEAST16_MAX -#define INT_FAST16_MAX INT_LEAST16_MAX -#define UINT_FAST32_MAX UINT_LEAST32_MAX -#define INT_FAST32_MAX INT_LEAST32_MAX -#define INT_FAST8_MIN INT_LEAST8_MIN -#define INT_FAST16_MIN INT_LEAST16_MIN -#define INT_FAST32_MIN INT_LEAST32_MIN -#ifdef stdint_int64_defined - typedef int_least64_t int_fast64_t; - typedef uint_least64_t uint_fast64_t; -# define UINT_FAST64_MAX UINT_LEAST64_MAX -# define INT_FAST64_MAX INT_LEAST64_MAX -# define INT_FAST64_MIN INT_LEAST64_MIN -#endif - -#undef stdint_int64_defined - -/* - * Whatever piecemeal, per compiler thing we can do about the wchar_t - * type limits. - */ - -#if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__) && !defined(vxWorks) -# include -# ifndef WCHAR_MIN -# define WCHAR_MIN 0 -# endif -# ifndef WCHAR_MAX -# define WCHAR_MAX ((wchar_t)-1) -# endif -#endif - -/* - * Whatever piecemeal, per compiler/platform thing we can do about the - * (u)intptr_t types and limits. - */ - -#if (defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)) || defined (_UINTPTR_T) -# define STDINT_H_UINTPTR_T_DEFINED -#endif - -#ifndef STDINT_H_UINTPTR_T_DEFINED -# if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64) || defined (__ppc64__) -# define stdint_intptr_bits 64 -# elif defined (__WATCOMC__) || defined (__TURBOC__) -# if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__) -# define stdint_intptr_bits 16 -# else -# define stdint_intptr_bits 32 -# endif -# elif defined (__i386__) || defined (_WIN32) || defined (WIN32) || defined (__ppc64__) -# define stdint_intptr_bits 32 -# elif defined (__INTEL_COMPILER) -/* TODO -- what did Intel do about x86-64? */ -# else -/* #error "This platform might not be supported yet" */ -# endif - -# ifdef stdint_intptr_bits -# define stdint_intptr_glue3_i(a,b,c) a##b##c -# define stdint_intptr_glue3(a,b,c) stdint_intptr_glue3_i(a,b,c) -# ifndef PRINTF_INTPTR_MODIFIER -# define PRINTF_INTPTR_MODIFIER stdint_intptr_glue3(PRINTF_INT,stdint_intptr_bits,_MODIFIER) -# endif -# ifndef PTRDIFF_MAX -# define PTRDIFF_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX) -# endif -# ifndef PTRDIFF_MIN -# define PTRDIFF_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN) -# endif -# ifndef UINTPTR_MAX -# define UINTPTR_MAX stdint_intptr_glue3(UINT,stdint_intptr_bits,_MAX) -# endif -# ifndef INTPTR_MAX -# define INTPTR_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX) -# endif -# ifndef INTPTR_MIN -# define INTPTR_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN) -# endif -# ifndef INTPTR_C -# define INTPTR_C(x) stdint_intptr_glue3(INT,stdint_intptr_bits,_C)(x) -# endif -# ifndef UINTPTR_C -# define UINTPTR_C(x) stdint_intptr_glue3(UINT,stdint_intptr_bits,_C)(x) -# endif - typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t; - typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t) intptr_t; -# else -/* TODO -- This following is likely wrong for some platforms, and does - nothing for the definition of uintptr_t. */ - typedef ptrdiff_t intptr_t; -# endif -# define STDINT_H_UINTPTR_T_DEFINED -#endif - -/* - * Assumes sig_atomic_t is signed and we have a 2s complement machine. - */ - -#ifndef SIG_ATOMIC_MAX -# define SIG_ATOMIC_MAX ((((sig_atomic_t) 1) << (sizeof (sig_atomic_t)*CHAR_BIT-1)) - 1) -#endif - -#endif - -#if defined (__TEST_PSTDINT_FOR_CORRECTNESS) - -/* - * Please compile with the maximum warning settings to make sure macros are - * not defined more than once. - */ - -#include -#include -#include - -#define glue3_aux(x,y,z) x ## y ## z -#define glue3(x,y,z) glue3_aux(x,y,z) - -#define DECLU(bits) glue3(uint,bits,_t) glue3(u,bits,) = glue3(UINT,bits,_C) (0); -#define DECLI(bits) glue3(int,bits,_t) glue3(i,bits,) = glue3(INT,bits,_C) (0); - -#define DECL(us,bits) glue3(DECL,us,) (bits) - -#define TESTUMAX(bits) glue3(u,bits,) = ~glue3(u,bits,); if (glue3(UINT,bits,_MAX) != glue3(u,bits,)) printf ("Something wrong with UINT%d_MAX\n", bits) - -#define REPORTERROR(msg) { err_n++; if (err_first <= 0) err_first = __LINE__; printf msg; } - -#define X_SIZE_MAX ((size_t)-1) - -int main () { - int err_n = 0; - int err_first = 0; - DECL(I,8) - DECL(U,8) - DECL(I,16) - DECL(U,16) - DECL(I,32) - DECL(U,32) -#ifdef INT64_MAX - DECL(I,64) - DECL(U,64) -#endif - intmax_t imax = INTMAX_C(0); - uintmax_t umax = UINTMAX_C(0); - char str0[256], str1[256]; - - sprintf (str0, "%" PRINTF_INT32_MODIFIER "d", INT32_C(2147483647)); - if (0 != strcmp (str0, "2147483647")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0)); - if (atoi(PRINTF_INT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_INT32_DEC_WIDTH : %s\n", PRINTF_INT32_DEC_WIDTH)); - sprintf (str0, "%" PRINTF_INT32_MODIFIER "u", UINT32_C(4294967295)); - if (0 != strcmp (str0, "4294967295")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0)); - if (atoi(PRINTF_UINT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_UINT32_DEC_WIDTH : %s\n", PRINTF_UINT32_DEC_WIDTH)); -#ifdef INT64_MAX - sprintf (str1, "%" PRINTF_INT64_MODIFIER "d", INT64_C(9223372036854775807)); - if (0 != strcmp (str1, "9223372036854775807")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1)); - if (atoi(PRINTF_INT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_INT64_DEC_WIDTH : %s, %d\n", PRINTF_INT64_DEC_WIDTH, (int) strlen(str1))); - sprintf (str1, "%" PRINTF_INT64_MODIFIER "u", UINT64_C(18446744073709550591)); - if (0 != strcmp (str1, "18446744073709550591")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1)); - if (atoi(PRINTF_UINT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_UINT64_DEC_WIDTH : %s, %d\n", PRINTF_UINT64_DEC_WIDTH, (int) strlen(str1))); -#endif - - sprintf (str0, "%d %x\n", 0, ~0); - - sprintf (str1, "%d %x\n", i8, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i8 : %s\n", str1)); - sprintf (str1, "%u %x\n", u8, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u8 : %s\n", str1)); - sprintf (str1, "%d %x\n", i16, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i16 : %s\n", str1)); - sprintf (str1, "%u %x\n", u16, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u16 : %s\n", str1)); - sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n", i32, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i32 : %s\n", str1)); - sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n", u32, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u32 : %s\n", str1)); -#ifdef INT64_MAX - sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n", i64, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i64 : %s\n", str1)); -#endif - sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n", imax, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with imax : %s\n", str1)); - sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n", umax, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with umax : %s\n", str1)); - - TESTUMAX(8); - TESTUMAX(16); - TESTUMAX(32); -#ifdef INT64_MAX - TESTUMAX(64); -#endif - -#define STR(v) #v -#define Q(v) printf ("sizeof " STR(v) " = %u\n", (unsigned) sizeof (v)); - if (err_n) { - printf ("pstdint.h is not correct. Please use sizes below to correct it:\n"); - } - - Q(int) - Q(unsigned) - Q(long int) - Q(short int) - Q(int8_t) - Q(int16_t) - Q(int32_t) -#ifdef INT64_MAX - Q(int64_t) -#endif - -#if UINT_MAX < X_SIZE_MAX - printf ("UINT_MAX < X_SIZE_MAX\n"); -#else - printf ("UINT_MAX >= X_SIZE_MAX\n"); -#endif - printf ("%" PRINTF_INT64_MODIFIER "u vs %" PRINTF_INT64_MODIFIER "u\n", UINT_MAX, X_SIZE_MAX); - - return EXIT_SUCCESS; -} - -#endif diff --git a/tcod_sys/libtcod/include/fov.h b/tcod_sys/libtcod/include/fov.h deleted file mode 100644 index d574deece..000000000 --- a/tcod_sys/libtcod/include/fov.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_FOV_H -#define _TCOD_FOV_H - -#include "libtcod_portability.h" -#include "fov_types.h" - -#ifdef __cplusplus -extern "C" { -#endif -/* allocate a new map */ -TCODLIB_API TCOD_map_t TCOD_map_new(int width, int height); -/* set all cells as solid rock (cannot see through nor walk) */ -TCODLIB_API void TCOD_map_clear(TCOD_map_t map, bool transparent, bool walkable); -/* copy a map to another, reallocating it when needed */ -TCODLIB_API void TCOD_map_copy(TCOD_map_t source, TCOD_map_t dest); -/* change a cell properties */ -TCODLIB_API void TCOD_map_set_properties(TCOD_map_t map, int x, int y, bool is_transparent, bool is_walkable); -/* destroy a map */ -TCODLIB_API void TCOD_map_delete(TCOD_map_t map); - -/* calculate the field of view (potentially visible cells from player_x,player_y) */ -TCODLIB_API void TCOD_map_compute_fov(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls, TCOD_fov_algorithm_t algo); -/* check if a cell is in the last computed field of view */ -TCODLIB_API bool TCOD_map_is_in_fov(TCOD_map_t map, int x, int y); -TCODLIB_API void TCOD_map_set_in_fov(TCOD_map_t map, int x, int y, bool fov); - -/* retrieve properties from the map */ -TCODLIB_API bool TCOD_map_is_transparent(TCOD_map_t map, int x, int y); -TCODLIB_API bool TCOD_map_is_walkable(TCOD_map_t map, int x, int y); -TCODLIB_API int TCOD_map_get_width(TCOD_map_t map); -TCODLIB_API int TCOD_map_get_height(TCOD_map_t map); -TCODLIB_API int TCOD_map_get_nb_cells(TCOD_map_t map); -#ifdef __cplusplus -} -#endif -#endif diff --git a/tcod_sys/libtcod/include/fov_types.h b/tcod_sys/libtcod/include/fov_types.h deleted file mode 100644 index 200464788..000000000 --- a/tcod_sys/libtcod/include/fov_types.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_FOV_TYPES_H -#define _TCOD_FOV_TYPES_H - -#ifdef __cplusplus -extern "C" { -#endif -typedef void *TCOD_map_t; - -/* FOV_BASIC : http://roguebasin.roguelikedevelopment.org/index.php?title=Ray_casting - FOV_DIAMOND : http://www.geocities.com/temerra/los_rays.html - FOV_SHADOW : http://roguebasin.roguelikedevelopment.org/index.php?title=FOV_using_recursive_shadowcasting - FOV_PERMISSIVE : http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View - FOV_RESTRICTIVE : Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos) */ - -typedef enum { - FOV_BASIC, - FOV_DIAMOND, - FOV_SHADOW, - FOV_PERMISSIVE_0, - FOV_PERMISSIVE_1, - FOV_PERMISSIVE_2, - FOV_PERMISSIVE_3, - FOV_PERMISSIVE_4, - FOV_PERMISSIVE_5, - FOV_PERMISSIVE_6, - FOV_PERMISSIVE_7, - FOV_PERMISSIVE_8, - FOV_RESTRICTIVE, - NB_FOV_ALGORITHMS } TCOD_fov_algorithm_t; -#define FOV_PERMISSIVE(x) ((TCOD_fov_algorithm_t)(FOV_PERMISSIVE_0 + (x))) - -#ifdef __cplusplus -} -#endif -#endif /* _TCOD_FOV_TYPES_H */ diff --git a/tcod_sys/libtcod/include/howto.hpp b/tcod_sys/libtcod/include/howto.hpp deleted file mode 100644 index afc32c11d..000000000 --- a/tcod_sys/libtcod/include/howto.hpp +++ /dev/null @@ -1,155 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/* This file contains no code. It's only an input for doctcod */ - -/** - @PageName compile_libtcod - @PageCategory Howtos - @PageTitle How to compile libtcod - @PageDesc This page contains howtos about how to get the latest libtcod source code and compile it. -*/ - -/** - @PageName compile_libtcod_mingw - @PageFather compile_libtcod - @PageTitle On Windows with Mingw - @PageDesc

Mingw installation

- Download the latest version of Mingw from this address : - http://sourceforge.net/projects/mingw/files/ - - The latest installer should be at the top of the page with a name starting with mingw-get-inst.. - - - - Download and run the program. Follow the installation steps. Be sure to check the "Use pre-packaged repository" option : - - - - The latest version might be less stable and might not work with a precompiled libtcod. - - When you arrive at the component selection screen, check C compiler, C++ compiler and MSys system : - - - - Keep on following the installation steps until the installation is finished. Now you have a "Mingw Shell" program in your start menu. This is the terminal you will use to compile and debug your game. - -

TortoiseHg installation

- In order to get the latest version of libtcod, you need a mercurial client. - Go to the download page and grab the client corresponding to your version of Windows : - http://tortoisehg.bitbucket.org/download/index.html - - Follow the installation wizard using the default configuration. Once the installation is finished, restart your computer. - - Now you should be able to use mercurial (hg) from the Mingw Shell. To check if everything is ok, start a shell and type "which hg" : - - - -

Getting libtcod source code

- In Mingw Shell, type : -
hg clone https://bitbucket.org/jice/libtcod
- - This might take some time so grab a beer. Once it's finished, a libtcod directory has been created. - You can check the documentation (the same you're currently reading) in libtcod/doc/index2.html. - The headers are in libtcod/include. - The source code in libtcod/src. - -

Compiling libtcod

- Go in libtcod's main directory : -
cd libtcod
- And start the compilation : -
make -f makefiles/makefile-mingw
- The compilation make take a few seconds depending on your CPU speed. Once it's finished, compile the samples : -
make -f makefiles/makefile-samples-mingw
- Check that everything is ok by running the samples : -
./samples_cpp
-*/ - -/** - @PageName compile_libtcod_linux - @PageFather compile_libtcod - @PageTitle On Linux - @PageDesc

Linux compilation

- On a freshly installed Ubuntu : - Get the tools : -
sudo apt-get install gcc g++ make upx electric-fence libsdl1.2-dev mercurial
- - Get the latest sources : -
hg clone https://bitbucket.org/jice/libtcod
- - Compile the library : -
cd libtcod/
-
make -f makefiles/makefile-linux clean all
- - Compile the samples : -
make -f makefiles/makefile-samples-linux
- - Enjoy : -
./samples_cpp
-*/ - -/** - @PageName compile_libtcod_codelite - @PageFather compile_libtcod - @PageTitle Using CodeLite - @PageDesc TODO -*/ - -/** - @PageName compile_libtcod_haiku - @PageFather compile_libtcod - @PageTitle On Haiku - @PageDesc TODO -*/ - -/** - @PageName start_project - @PageCategory Howtos - @PageTitle How to start a project - @PageDesc This page contains howtos about how to create a project from scratch -*/ - -/** - @PageName start_mingw - @PageFather start_project - @PageTitle On Windows with Mingw - @PageDesc TODO -*/ - -/** - @PageName start_linux - @PageFather start_project - @PageTitle On Linux - @PageDesc TODO -*/ - -/** - @PageName start_codelite - @PageFather start_project - @PageTitle Using CodeLite - @PageDesc TODO -*/ diff --git a/tcod_sys/libtcod/include/image.h b/tcod_sys/libtcod/include/image.h deleted file mode 100644 index 3a81c5717..000000000 --- a/tcod_sys/libtcod/include/image.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_IMAGE_H -#define _TCOD_IMAGE_H - -#include "libtcod_portability.h" -#include "color.h" - -#ifdef TCOD_IMAGE_SUPPORT - -#include "console_types.h" - -#ifdef __cplusplus -extern "C" { -#endif -typedef void *TCOD_image_t; - -TCODLIB_API TCOD_image_t TCOD_image_new(int width, int height); -#ifdef TCOD_CONSOLE_SUPPORT -TCODLIB_API TCOD_image_t TCOD_image_from_console(TCOD_console_t console); -TCODLIB_API void TCOD_image_refresh_console(TCOD_image_t image, TCOD_console_t console); -#endif -TCODLIB_API TCOD_image_t TCOD_image_load(const char *filename); -TCODLIB_API void TCOD_image_clear(TCOD_image_t image, TCOD_color_t color); -TCODLIB_API void TCOD_image_invert(TCOD_image_t image); -TCODLIB_API void TCOD_image_hflip(TCOD_image_t image); -TCODLIB_API void TCOD_image_rotate90(TCOD_image_t image, int numRotations); -TCODLIB_API void TCOD_image_vflip(TCOD_image_t image); -TCODLIB_API void TCOD_image_scale(TCOD_image_t image, int neww, int newh); -TCODLIB_API void TCOD_image_save(TCOD_image_t image, const char *filename); -TCODLIB_API void TCOD_image_get_size(TCOD_image_t image, int *w,int *h); -TCODLIB_API TCOD_color_t TCOD_image_get_pixel(TCOD_image_t image,int x, int y); -TCODLIB_API int TCOD_image_get_alpha(TCOD_image_t image,int x, int y); -TCODLIB_API TCOD_color_t TCOD_image_get_mipmap_pixel(TCOD_image_t image,float x0,float y0, float x1, float y1); -TCODLIB_API void TCOD_image_put_pixel(TCOD_image_t image,int x, int y,TCOD_color_t col); -#ifdef TCOD_CONSOLE_SUPPORT -TCODLIB_API void TCOD_image_blit(TCOD_image_t image, TCOD_console_t console, float x, float y, - TCOD_bkgnd_flag_t bkgnd_flag, float scalex, float scaley, float angle); -TCODLIB_API void TCOD_image_blit_rect(TCOD_image_t image, TCOD_console_t console, int x, int y, int w, int h, - TCOD_bkgnd_flag_t bkgnd_flag); -TCODLIB_API void TCOD_image_blit_2x(TCOD_image_t image, TCOD_console_t dest, int dx, int dy, int sx, int sy, int w, int h); -#endif -TCODLIB_API void TCOD_image_delete(TCOD_image_t image); -TCODLIB_API void TCOD_image_set_key_color(TCOD_image_t image, TCOD_color_t key_color); -TCODLIB_API bool TCOD_image_is_pixel_transparent(TCOD_image_t image, int x, int y); - -#ifdef __cplusplus -} -#endif - -#endif /* TCOD_IMAGE_SUPPORT */ - -#endif /* _TCOD_IMAGE_H */ diff --git a/tcod_sys/libtcod/include/lex.hpp b/tcod_sys/libtcod/include/lex.hpp deleted file mode 100644 index 0db88e654..000000000 --- a/tcod_sys/libtcod/include/lex.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/* - * This is a libtcod internal module. - * Use at your own risks... - */ -#ifndef _TCOD_LEX_HPP -#define _TCOD_LEX_HPP - -#include "lex.h" - -class TCODLIB_API TCODLex { -public : - TCODLex(); - TCODLex( const char **symbols, const char **keywords, const char *simpleComment="//", - const char *commentStart="/*", const char *commentStop="*/", const char *javadocCommentStart="/**", - const char *stringDelim="\"", int flags=TCOD_LEX_FLAG_NESTING_COMMENT); - ~TCODLex(); - - void setDataBuffer(char *dat); - bool setDataFile(const char *filename); - - int parse(void); - int parseUntil(int tokenType); - int parseUntil(const char *tokenValue); - - bool expect(int tokenType); - bool expect(int tokenType,const char *tokenValue); - - void savepoint(TCODLex *savept); - void restore(TCODLex *savept); - char *getLastJavadoc(); - - int getFileLine() { return ((TCOD_lex_t *)data)->file_line; } - int getTokenType() { return ((TCOD_lex_t *)data)->token_type; } - int getTokenIntVal() { return ((TCOD_lex_t *)data)->token_int_val; } - int getTokenIdx() { return ((TCOD_lex_t *)data)->token_idx; } - float getTokenFloatVal() { return ((TCOD_lex_t *)data)->token_float_val; } - char *getToken() { return ((TCOD_lex_t *)data)->tok; } - char getStringLastDelimiter() { return ((TCOD_lex_t *)data)->lastStringDelim; } - char *getPos() { return ((TCOD_lex_t *)data)->pos; } - char *getBuf() { return ((TCOD_lex_t *)data)->buf; } - char *getFilename() { return ((TCOD_lex_t *)data)->filename; } - char *getLastJavadocComment() { return ((TCOD_lex_t *)data)->last_javadoc_comment; } - static const char *getTokenName(int tokenType) { return TCOD_lex_get_token_name(tokenType); } -protected : - void *data; -}; - -#endif diff --git a/tcod_sys/libtcod/include/libtcod.h b/tcod_sys/libtcod/include/libtcod.h deleted file mode 100644 index 138a18fc3..000000000 --- a/tcod_sys/libtcod/include/libtcod.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _LIBTCOD_H -#define _LIBTCOD_H - -#include "libtcod_portability.h" -#include "libtcod_utility.h" -#include "libtcod_version.h" - -#include "bresenham.h" -#include "bsp.h" -#include "color.h" -#include "console.h" -#include "console_rexpaint.h" -#include "fov.h" -#include "heightmap.h" -#include "image.h" -#include "lex.h" -#include "list.h" -#include "mersenne.h" -#include "mouse.h" -#include "namegen.h" -#include "noise.h" -#include "path.h" -#include "parser.h" -#include "sys.h" -#include "tree.h" -#include "txtfield.h" -#include "zip.h" - -#endif diff --git a/tcod_sys/libtcod/include/libtcod.hpp b/tcod_sys/libtcod/include/libtcod.hpp deleted file mode 100644 index 7134208db..000000000 --- a/tcod_sys/libtcod/include/libtcod.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _LIBTCOD_HPP -#define _LIBTCOD_HPP - -#include "libtcod.h" - -#include "bresenham.hpp" -#include "bsp.hpp" -#include "color.hpp" -#include "console.hpp" -#include "fov.hpp" -#include "heightmap.hpp" -#include "image.hpp" -#include "lex.hpp" -#include "list.hpp" -#include "mersenne.hpp" -#include "mouse.hpp" -#include "namegen.hpp" -#include "noise.hpp" -#include "parser.hpp" -#include "path.hpp" -#include "sys.hpp" -#include "tree.hpp" -#include "txtfield.hpp" -#include "zip.hpp" - -#endif diff --git a/tcod_sys/libtcod/include/libtcod_portability.h b/tcod_sys/libtcod/include/libtcod_portability.h deleted file mode 100644 index 3bf9c9ecc..000000000 --- a/tcod_sys/libtcod/include/libtcod_portability.h +++ /dev/null @@ -1,184 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef LIBTCOD_PORTABILITY_H -#define LIBTCOD_PORTABILITY_H -/* uncomment to disable unicode support */ -/*#define NO_UNICODE */ - -/* uncomment to disable opengl support */ -/*#define NO_OPENGL */ - -/* os identification - TCOD_WINDOWS : OS is windows - TCOD_LINUX : OS is Linux - TCOD_MACOSX : OS is Mac OS X - TCOD_HAIKU : OS is Haiku */ - -/* compiler identification - TCOD_VISUAL_STUDIO : compiler is Microsoft Visual Studio - TCOD_MINGW32 : compiler is Mingw32 - TCOD_GCC : compiler is gcc/g++ */ - -/* word size - TCOD_64BITS : 64 bits OS - TCOD_WIN64 : 64 bits Windows - TCOD_WIN32 : 32 bits Windows - TCOD_LINUX64 : 64 bits Linux - TCOD_LINUX32 : 32 bits Linux - TCOD_FREEBSD64 : 64 bits FreeBSD - TCOD_FREEBSD32 : 32 bits FreeBSD */ - -#if defined( _MSC_VER ) -# define TCOD_VISUAL_STUDIO -# define TCOD_WINDOWS -# ifdef _WIN64 -# define TCOD_WIN64 -# define TCOD_64BITS -# else -# define TCOD_WIN32 -# endif -#elif defined( __MINGW32__ ) -# define TCOD_WINDOWS -# define TCOD_MINGW32 -# ifdef _WIN64 -# define TCOD_WIN64 -# define TCOD_64BITS -# else -# define TCOD_WIN32 -# endif -#elif defined( __HAIKU__ ) -# define TCOD_HAIKU -# define TCOD_GCC -# if __WORDSIZE == 64 -# define TCOD_64BITS -# endif -#elif defined( __linux ) -# define TCOD_LINUX -# define TCOD_GCC -# if __WORDSIZE == 64 -# define TCOD_LINUX64 -# define TCOD_64BITS -# else -# define TCOD_LINUX32 -# endif -#elif defined( __FreeBSD__ ) -# define TCOD_FREEBSD -# define TCOD_GCC -# if __WORDSIZE == 64 -# define TCOD_FREEBSD64 -# define TCOD_64BITS -# else -# define TCOD_FREEBSD32 -# endif -#elif defined (__APPLE__) && defined (__MACH__) -# define TCOD_MACOSX -# define TCOD_GCC -# if __WORDSIZE == 64 -# define TCOD_64BITS -# endif -#endif - -/* unicode rendering functions support */ -#ifndef NO_UNICODE -#include -#endif - -/* DLL export */ -#ifndef TCODLIB_API -#ifdef TCOD_WINDOWS -#ifdef LIBTCOD_EXPORTS -#define TCODLIB_API __declspec(dllexport) -#else -#define TCODLIB_API __declspec(dllimport) -#endif -#else -#define TCODLIB_API -#endif -#endif - -/* For now this encapsulates mouse, keyboard, and consoles themselves. */ -#undef TCOD_CONSOLE_SUPPORT -#undef TCOD_IMAGE_SUPPORT -#undef TCOD_OSUTIL_SUPPORT - -#ifndef TCOD_BARE -#define TCOD_CONSOLE_SUPPORT -#define TCOD_IMAGE_SUPPORT -#define TCOD_OSUTIL_SUPPORT -#endif - -/* int types */ -#include "external/pstdint.h" - -/* bool type */ -#ifndef __bool_true_false_are_defined -#ifndef __cplusplus -#if defined(_MSC_VER) && _MSC_VER < 1800 -typedef uint8_t bool; -#define true 1 -#define false 0 -#define __bool_true_false_are_defined 1 -#else -#include -#endif -#endif /* __cplusplus */ -#endif /* __bool_true_false_are_defined */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ansi C lacks support for those functions */ -TCODLIB_API char *TCOD_strdup(const char *s); -TCODLIB_API int TCOD_strcasecmp(const char *s1, const char *s2); -TCODLIB_API int TCOD_strncasecmp(const char *s1, const char *s2, size_t n); - -#if defined(TCOD_WINDOWS) -char *strcasestr (const char *haystack, const char *needle); -#endif -#if defined(TCOD_LINUX) || defined(TCOD_HAIKU) || defined(TCOD_FREEBSD) || defined(TCOD_MACOSX) -#define vsnwprintf vswprintf -#endif -#ifdef TCOD_WINDOWS -#define vsnwprintf _vsnwprintf -#endif - -/* cross platform deprecation */ -#if defined(_MSC_VER) -#define TCOD_DEPRECATED __declspec(deprecated) -#elif defined(__GNUC__) -#define TCOD_DEPRECATED __attribute__ ((deprecated)) -#else -#define TCOD_DEPRECATED -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* LIBTCOD_PORTABILITY_H */ diff --git a/tcod_sys/libtcod/include/libtcod_utility.h b/tcod_sys/libtcod/include/libtcod_utility.h deleted file mode 100644 index 6dab8746f..000000000 --- a/tcod_sys/libtcod/include/libtcod_utility.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef LIBTCOD_UTILITY_H -#define LIBTCOD_UTILITY_H -/****************************************** - utility macros - ******************************************/ -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) -#define ABS(a) ((a)<0?-(a):(a)) -#define CLAMP(a, b, x) ((x) < (a) ? (a) : ((x) > (b) ? (b) : (x))) -#define LERP(a, b, x) ( (a) + (x) * ((b) - (a)) ) - -#endif diff --git a/tcod_sys/libtcod/include/libtcod_version.h b/tcod_sys/libtcod/include/libtcod_version.h deleted file mode 100644 index 336b832ae..000000000 --- a/tcod_sys/libtcod/include/libtcod_version.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef LIBTCOD_VERSION_H -#define LIBTCOD_VERSION_H - -#define TCOD_HEXVERSION 0x010700 -#define TCOD_STRVERSION "1.7.0" -#define TCOD_TECHVERSION 0x01070000 - -#define TCOD_STRVERSIONNAME "libtcod " TCOD_STRVERSION - -#endif /* LIBTCOD_VERSION_H */ diff --git a/tcod_sys/libtcod/include/list.h b/tcod_sys/libtcod/include/list.h deleted file mode 100644 index 15514aa1d..000000000 --- a/tcod_sys/libtcod/include/list.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_LIST_H -#define _TCOD_LIST_H - -#include "libtcod_portability.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *TCOD_list_t; - -TCODLIB_API TCOD_list_t TCOD_list_new(void); -TCODLIB_API TCOD_list_t TCOD_list_allocate(int nb_elements); -TCODLIB_API TCOD_list_t TCOD_list_duplicate(TCOD_list_t l); -TCODLIB_API void TCOD_list_delete(TCOD_list_t l); -TCODLIB_API void TCOD_list_push(TCOD_list_t l, const void * elt); -TCODLIB_API void * TCOD_list_pop(TCOD_list_t l); -TCODLIB_API void * TCOD_list_peek(TCOD_list_t l); -TCODLIB_API void TCOD_list_add_all(TCOD_list_t l, TCOD_list_t l2); -TCODLIB_API void * TCOD_list_get(TCOD_list_t l,int idx); -TCODLIB_API void TCOD_list_set(TCOD_list_t l,const void *elt, int idx); -TCODLIB_API void ** TCOD_list_begin(TCOD_list_t l); -TCODLIB_API void ** TCOD_list_end(TCOD_list_t l); -TCODLIB_API void TCOD_list_reverse(TCOD_list_t l); -TCODLIB_API void **TCOD_list_remove_iterator(TCOD_list_t l, void **elt); -TCODLIB_API void TCOD_list_remove(TCOD_list_t l, const void * elt); -TCODLIB_API void **TCOD_list_remove_iterator_fast(TCOD_list_t l, void **elt); -TCODLIB_API void TCOD_list_remove_fast(TCOD_list_t l, const void * elt); -TCODLIB_API bool TCOD_list_contains(TCOD_list_t l,const void * elt); -TCODLIB_API void TCOD_list_clear(TCOD_list_t l); -TCODLIB_API void TCOD_list_clear_and_delete(TCOD_list_t l); -TCODLIB_API int TCOD_list_size(TCOD_list_t l); -TCODLIB_API void ** TCOD_list_insert_before(TCOD_list_t l,const void *elt,int before); -TCODLIB_API bool TCOD_list_is_empty(TCOD_list_t l); -#ifdef __cplusplus -} -#endif -#endif diff --git a/tcod_sys/libtcod/include/mersenne.h b/tcod_sys/libtcod/include/mersenne.h deleted file mode 100644 index c2bef0fb8..000000000 --- a/tcod_sys/libtcod/include/mersenne.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_RANDOM_H -#define _TCOD_RANDOM_H - -#include "libtcod_portability.h" -#include "mersenne_types.h" - -#ifdef __cplusplus -extern "C" { -#endif -TCODLIB_API TCOD_random_t TCOD_random_get_instance(void); -TCODLIB_API TCOD_random_t TCOD_random_new(TCOD_random_algo_t algo); -TCODLIB_API TCOD_random_t TCOD_random_save(TCOD_random_t mersenne); -TCODLIB_API void TCOD_random_restore(TCOD_random_t mersenne, TCOD_random_t backup); -TCODLIB_API TCOD_random_t TCOD_random_new_from_seed(TCOD_random_algo_t algo, uint32_t seed); -TCODLIB_API void TCOD_random_delete(TCOD_random_t mersenne); - -TCODLIB_API void TCOD_random_set_distribution (TCOD_random_t mersenne, TCOD_distribution_t distribution); - -TCODLIB_API int TCOD_random_get_int (TCOD_random_t mersenne, int min, int max); -TCODLIB_API float TCOD_random_get_float (TCOD_random_t mersenne, float min, float max); -TCODLIB_API double TCOD_random_get_double (TCOD_random_t mersenne, double min, double max); - -TCODLIB_API int TCOD_random_get_int_mean (TCOD_random_t mersenne, int min, int max, int mean); -TCODLIB_API float TCOD_random_get_float_mean (TCOD_random_t mersenne, float min, float max, float mean); -TCODLIB_API double TCOD_random_get_double_mean (TCOD_random_t mersenne, double min, double max, double mean); - -TCODLIB_API TCOD_dice_t TCOD_random_dice_new (const char * s); -TCODLIB_API int TCOD_random_dice_roll (TCOD_random_t mersenne, TCOD_dice_t dice); -TCODLIB_API int TCOD_random_dice_roll_s (TCOD_random_t mersenne, const char * s); -#ifdef __cplusplus -} -#endif -#endif diff --git a/tcod_sys/libtcod/include/mersenne_types.h b/tcod_sys/libtcod/include/mersenne_types.h deleted file mode 100644 index 2d62d5420..000000000 --- a/tcod_sys/libtcod/include/mersenne_types.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_RANDOM_TYPES_H -#define _TCOD_RANDOM_TYPES_H - -typedef void *TCOD_random_t; - -/* dice roll */ -typedef struct { - int nb_rolls; - int nb_faces; - float multiplier; - float addsub; -} TCOD_dice_t; - -/* PRNG algorithms */ -typedef enum { - TCOD_RNG_MT, - TCOD_RNG_CMWC -} TCOD_random_algo_t; - -typedef enum { - TCOD_DISTRIBUTION_LINEAR, - TCOD_DISTRIBUTION_GAUSSIAN, - TCOD_DISTRIBUTION_GAUSSIAN_RANGE, - TCOD_DISTRIBUTION_GAUSSIAN_INVERSE, - TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE -} TCOD_distribution_t; -#endif /* _TCOD_RANDOM_TYPES_H */ diff --git a/tcod_sys/libtcod/include/mouse.h b/tcod_sys/libtcod/include/mouse.h deleted file mode 100644 index 0cad0e22a..000000000 --- a/tcod_sys/libtcod/include/mouse.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_MOUSE_H -#define _TCOD_MOUSE_H - -#include "libtcod_portability.h" - -#ifdef TCOD_CONSOLE_SUPPORT - -#include "mouse_types.h" - -#ifdef __cplusplus -extern "C" { -#endif -TCODLIB_API void TCOD_mouse_show_cursor(bool visible); -TCODLIB_API TCOD_mouse_t TCOD_mouse_get_status(void); -TCODLIB_API bool TCOD_mouse_is_cursor_visible(void); -TCODLIB_API void TCOD_mouse_move(int x, int y); -TCODLIB_API void TCOD_mouse_includes_touch(bool enable); -#ifdef __cplusplus -} -#endif - -#endif /* TCOD_CONSOLE_SUPPORT */ - -#endif /* _TCOD_MOUSE_H */ diff --git a/tcod_sys/libtcod/include/mouse_types.h b/tcod_sys/libtcod/include/mouse_types.h deleted file mode 100644 index c48ac429e..000000000 --- a/tcod_sys/libtcod/include/mouse_types.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_MOUSE_TYPES_H -#define _TCOD_MOUSE_TYPES_H - -#include "libtcod_portability.h" - -#ifdef __cplusplus -extern "C" { -#endif -/* mouse data */ -typedef struct { - int x,y; /* absolute position */ - int dx,dy; /* movement since last update in pixels */ - int cx,cy; /* cell coordinates in the root console */ - int dcx,dcy; /* movement since last update in console cells */ - bool lbutton ; /* left button status */ - bool rbutton ; /* right button status */ - bool mbutton ; /* middle button status */ - bool lbutton_pressed ; /* left button pressed event */ - bool rbutton_pressed ; /* right button pressed event */ - bool mbutton_pressed ; /* middle button pressed event */ - bool wheel_up ; /* wheel up event */ - bool wheel_down ; /* wheel down event */ -} TCOD_mouse_t; -#ifdef __cplusplus -} -#endif -#endif /* _TCOD_MOUSE_TYPES_H */ diff --git a/tcod_sys/libtcod/include/namegen.h b/tcod_sys/libtcod/include/namegen.h deleted file mode 100644 index 6783a0094..000000000 --- a/tcod_sys/libtcod/include/namegen.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/* -* Mingos' NameGen -* This file was written by Dominik "Mingos" Marczuk. -*/ - -#ifndef _TCOD_NAMEGEN_H -#define _TCOD_NAMEGEN_H - -#include "libtcod_portability.h" -#include "list.h" -#include "mersenne.h" - -#ifdef __cplusplus -extern "C" { -#endif -/* the generator typedef */ -typedef void * TCOD_namegen_t; - -/* parse a file with syllable sets */ -TCODLIB_API void TCOD_namegen_parse (const char * filename, TCOD_random_t random); -/* generate a name */ -TCODLIB_API char * TCOD_namegen_generate (char * name, bool allocate); -/* generate a name using a custom generation rule */ -TCODLIB_API char * TCOD_namegen_generate_custom (char * name, char * rule, bool allocate); -/* retrieve the list of all available syllable set names */ -TCODLIB_API TCOD_list_t TCOD_namegen_get_sets (void); -/* delete a generator */ -TCODLIB_API void TCOD_namegen_destroy (void); -#ifdef __cplusplus -} -#endif -#endif diff --git a/tcod_sys/libtcod/include/noise.h b/tcod_sys/libtcod/include/noise.h deleted file mode 100644 index e812a7053..000000000 --- a/tcod_sys/libtcod/include/noise.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_PERLIN_H -#define _TCOD_PERLIN_H - -#include "libtcod_portability.h" -#include "mersenne_types.h" - -#ifdef __cplusplus -extern "C" { -#endif -typedef void *TCOD_noise_t; - -typedef enum { - TCOD_NOISE_PERLIN = 1, - TCOD_NOISE_SIMPLEX = 2, - TCOD_NOISE_WAVELET = 4, - TCOD_NOISE_DEFAULT = 0 -} TCOD_noise_type_t; - -#include "noise_defaults.h" - -/* create a new noise object */ -TCODLIB_API TCOD_noise_t TCOD_noise_new(int dimensions, float hurst, float lacunarity, TCOD_random_t random); - -/* simplified API */ -TCODLIB_API void TCOD_noise_set_type (TCOD_noise_t noise, TCOD_noise_type_t type); -TCODLIB_API float TCOD_noise_get_ex (TCOD_noise_t noise, float *f, TCOD_noise_type_t type); -TCODLIB_API float TCOD_noise_get_fbm_ex (TCOD_noise_t noise, float *f, float octaves, TCOD_noise_type_t type); -TCODLIB_API float TCOD_noise_get_turbulence_ex (TCOD_noise_t noise, float *f, float octaves, TCOD_noise_type_t type); -TCODLIB_API float TCOD_noise_get (TCOD_noise_t noise, float *f); -TCODLIB_API float TCOD_noise_get_fbm (TCOD_noise_t noise, float *f, float octaves); -TCODLIB_API float TCOD_noise_get_turbulence (TCOD_noise_t noise, float *f, float octaves); -/* delete the noise object */ -TCODLIB_API void TCOD_noise_delete(TCOD_noise_t noise); -#ifdef __cplusplus -} -#endif -#endif diff --git a/tcod_sys/libtcod/include/noise_defaults.h b/tcod_sys/libtcod/include/noise_defaults.h deleted file mode 100644 index 9277ff7de..000000000 --- a/tcod_sys/libtcod/include/noise_defaults.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_NOISE_DEFAULTS -#define _TCOD_NOISE_DEFAULTS - -#define TCOD_NOISE_MAX_OCTAVES 128 -#define TCOD_NOISE_MAX_DIMENSIONS 4 -#define TCOD_NOISE_DEFAULT_HURST 0.5f -#define TCOD_NOISE_DEFAULT_LACUNARITY 2.0f - -#endif /* _TCOD_NOISE_DEFAULTS */ diff --git a/tcod_sys/libtcod/include/path.h b/tcod_sys/libtcod/include/path.h deleted file mode 100644 index 28e2c2f99..000000000 --- a/tcod_sys/libtcod/include/path.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_PATH_H -#define _TCOD_PATH_H - -#include "libtcod_portability.h" -#include "fov_types.h" - -#ifdef __cplusplus -extern "C" { -#endif -typedef float (*TCOD_path_func_t)( int xFrom, int yFrom, int xTo, int yTo, void *user_data ); -typedef void *TCOD_path_t; - -TCODLIB_API TCOD_path_t TCOD_path_new_using_map(TCOD_map_t map, float diagonalCost); -TCODLIB_API TCOD_path_t TCOD_path_new_using_function(int map_width, int map_height, TCOD_path_func_t func, void *user_data, float diagonalCost); - -TCODLIB_API bool TCOD_path_compute(TCOD_path_t path, int ox,int oy, int dx, int dy); -TCODLIB_API bool TCOD_path_walk(TCOD_path_t path, int *x, int *y, bool recalculate_when_needed); -TCODLIB_API bool TCOD_path_is_empty(TCOD_path_t path); -TCODLIB_API int TCOD_path_size(TCOD_path_t path); -TCODLIB_API void TCOD_path_reverse(TCOD_path_t path); -TCODLIB_API void TCOD_path_get(TCOD_path_t path, int index, int *x, int *y); -TCODLIB_API void TCOD_path_get_origin(TCOD_path_t path, int *x, int *y); -TCODLIB_API void TCOD_path_get_destination(TCOD_path_t path, int *x, int *y); -TCODLIB_API void TCOD_path_delete(TCOD_path_t path); - -/* Dijkstra stuff - by Mingos*/ - -typedef void *TCOD_dijkstra_t; - -TCODLIB_API TCOD_dijkstra_t TCOD_dijkstra_new (TCOD_map_t map, float diagonalCost); -TCODLIB_API TCOD_dijkstra_t TCOD_dijkstra_new_using_function(int map_width, int map_height, TCOD_path_func_t func, void *user_data, float diagonalCost); -TCODLIB_API void TCOD_dijkstra_compute (TCOD_dijkstra_t dijkstra, int root_x, int root_y); -TCODLIB_API float TCOD_dijkstra_get_distance (TCOD_dijkstra_t dijkstra, int x, int y); -TCODLIB_API bool TCOD_dijkstra_path_set (TCOD_dijkstra_t dijkstra, int x, int y); -TCODLIB_API bool TCOD_dijkstra_is_empty(TCOD_dijkstra_t path); -TCODLIB_API int TCOD_dijkstra_size(TCOD_dijkstra_t path); -TCODLIB_API void TCOD_dijkstra_reverse(TCOD_dijkstra_t path); -TCODLIB_API void TCOD_dijkstra_get(TCOD_dijkstra_t path, int index, int *x, int *y); -TCODLIB_API bool TCOD_dijkstra_path_walk (TCOD_dijkstra_t dijkstra, int *x, int *y); -TCODLIB_API void TCOD_dijkstra_delete (TCOD_dijkstra_t dijkstra); -#ifdef __cplusplus -} -#endif -#endif diff --git a/tcod_sys/libtcod/include/tree.h b/tcod_sys/libtcod/include/tree.h deleted file mode 100644 index 5d3fafd10..000000000 --- a/tcod_sys/libtcod/include/tree.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_TREE_H -#define _TCOD_TREE_H - -#include "libtcod_portability.h" - -#ifdef __cplusplus -extern "C" { -#endif -typedef struct _TCOD_tree_t { - struct _TCOD_tree_t *next; - struct _TCOD_tree_t *father; - struct _TCOD_tree_t *sons; -} TCOD_tree_t; - -TCODLIB_API TCOD_tree_t *TCOD_tree_new(void); -TCODLIB_API void TCOD_tree_add_son(TCOD_tree_t *node, TCOD_tree_t *son); -#ifdef __cplusplus -} -#endif -#endif diff --git a/tcod_sys/libtcod/include/tree.hpp b/tcod_sys/libtcod/include/tree.hpp deleted file mode 100644 index 54b46abdb..000000000 --- a/tcod_sys/libtcod/include/tree.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_TREE_HPP -#define _TCOD_TREE_HPP - -#include "tree.h" - -class TCODLIB_API TCODTree { -public : - TCODTree *next; - TCODTree *father; - TCODTree *sons; - - TCODTree() : next(NULL),father(NULL),sons(NULL){} - void addSon(TCODTree *data) { - data->father=this; - TCODTree *lastson = sons; - while ( lastson && lastson->next ) lastson=lastson->next; - if ( lastson ) { - lastson->next=data; - } else { - sons=data; - } - } - -}; - -#endif diff --git a/tcod_sys/libtcod/include/txtfield.h b/tcod_sys/libtcod/include/txtfield.h deleted file mode 100644 index 48739722a..000000000 --- a/tcod_sys/libtcod/include/txtfield.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_TEXT_H_ -#define _TCOD_TEXT_H_ - -#include "libtcod_portability.h" - -#ifdef TCOD_CONSOLE_SUPPORT - -#include "color.h" -#include "console_types.h" - -#ifdef __cplusplus -extern "C" { -#endif -typedef void * TCOD_text_t; - -TCODLIB_API TCOD_text_t TCOD_text_init(int x, int y, int w, int h, int max_chars); -TCODLIB_API TCOD_text_t TCOD_text_init2(int w, int h, int max_chars); -TCODLIB_API void TCOD_text_set_pos(TCOD_text_t txt, int x, int y); -TCODLIB_API void TCOD_text_set_properties(TCOD_text_t txt, int cursor_char, int blink_interval, const char * prompt, int tab_size); -TCODLIB_API void TCOD_text_set_colors(TCOD_text_t txt, TCOD_color_t fore, TCOD_color_t back, float back_transparency); -TCODLIB_API bool TCOD_text_update(TCOD_text_t txt, TCOD_key_t key); -TCODLIB_API void TCOD_text_render(TCOD_text_t txt, TCOD_console_t con); -TCODLIB_API const char * TCOD_text_get(TCOD_text_t txt); -TCODLIB_API void TCOD_text_reset(TCOD_text_t txt); -TCODLIB_API void TCOD_text_delete(TCOD_text_t txt); -#ifdef __cplusplus -} -#endif - -#endif /* TCOD_CONSOLE_SUPPORT */ - -#endif /* _TCOD_TEXT_H_ */ diff --git a/tcod_sys/libtcod/include/txtfield.hpp b/tcod_sys/libtcod/include/txtfield.hpp deleted file mode 100644 index 807140c4c..000000000 --- a/tcod_sys/libtcod/include/txtfield.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_TEXT_HPP_ -#define _TCOD_TEXT_HPP_ - -#include "color.hpp" -#include "console.hpp" -#include "txtfield.h" - -#ifdef TCOD_CONSOLE_SUPPORT - -class TCODLIB_API TCODText { -public : - TCODText(int x, int y, int w, int h, int max_chars); - TCODText(int w, int h, int max_chars); - ~TCODText(); - void setProperties(int cursor_char, int blink_interval, const char * prompt, int tab_size); - void setColors(TCODColor fore, TCODColor back, float back_transparency); - void setPos(int x, int y); - bool update(TCOD_key_t key); - void render(TCODConsole * con); - const char *getText(); - void reset(); -protected : - TCOD_text_t data; -}; - -#endif /* TCOD_CONSOLE_SUPPORT */ - -#endif diff --git a/tcod_sys/libtcod/include/zip.h b/tcod_sys/libtcod/include/zip.h deleted file mode 100644 index 5d0b449fb..000000000 --- a/tcod_sys/libtcod/include/zip.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_ZIP_H -#define _TCOD_ZIP_H - -#include "libtcod_portability.h" -#include "color.h" -#include "console_types.h" -#include "image.h" - -#ifdef __cplusplus -extern "C" { -#endif -typedef void *TCOD_zip_t; - -TCODLIB_API TCOD_zip_t TCOD_zip_new(void); -TCODLIB_API void TCOD_zip_delete(TCOD_zip_t zip); - -/* output interface */ -TCODLIB_API void TCOD_zip_put_char(TCOD_zip_t zip, char val); -TCODLIB_API void TCOD_zip_put_int(TCOD_zip_t zip, int val); -TCODLIB_API void TCOD_zip_put_float(TCOD_zip_t zip, float val); -TCODLIB_API void TCOD_zip_put_string(TCOD_zip_t zip, const char *val); -TCODLIB_API void TCOD_zip_put_color(TCOD_zip_t zip, const TCOD_color_t val); -#ifdef TCOD_IMAGE_SUPPORT -TCODLIB_API void TCOD_zip_put_image(TCOD_zip_t zip, const TCOD_image_t val); -#endif -#ifdef TCOD_CONSOLE_SUPPORT -TCODLIB_API void TCOD_zip_put_console(TCOD_zip_t zip, const TCOD_console_t val); -#endif -TCODLIB_API void TCOD_zip_put_data(TCOD_zip_t zip, int nbBytes, const void *data); -TCODLIB_API uint32_t TCOD_zip_get_current_bytes(TCOD_zip_t zip); -TCODLIB_API int TCOD_zip_save_to_file(TCOD_zip_t zip, const char *filename); - -/* input interface */ -TCODLIB_API int TCOD_zip_load_from_file(TCOD_zip_t zip, const char *filename); -TCODLIB_API char TCOD_zip_get_char(TCOD_zip_t zip); -TCODLIB_API int TCOD_zip_get_int(TCOD_zip_t zip); -TCODLIB_API float TCOD_zip_get_float(TCOD_zip_t zip); -TCODLIB_API const char *TCOD_zip_get_string(TCOD_zip_t zip); -TCODLIB_API TCOD_color_t TCOD_zip_get_color(TCOD_zip_t zip); -#ifdef TCOD_IMAGE_SUPPORT -TCODLIB_API TCOD_image_t TCOD_zip_get_image(TCOD_zip_t zip); -#endif -#ifdef TCOD_CONSOLE_SUPPORT -TCODLIB_API TCOD_console_t TCOD_zip_get_console(TCOD_zip_t zip); -#endif -TCODLIB_API int TCOD_zip_get_data(TCOD_zip_t zip, int nbBytes, void *data); -TCODLIB_API uint32_t TCOD_zip_get_remaining_bytes(TCOD_zip_t zip); -TCODLIB_API void TCOD_zip_skip_bytes(TCOD_zip_t zip, uint32_t nbBytes); -#ifdef __cplusplus -} -#endif -#endif diff --git a/tcod_sys/libtcod/libtcod.cfg b/tcod_sys/libtcod/libtcod.cfg deleted file mode 100644 index c092064e0..000000000 --- a/tcod_sys/libtcod/libtcod.cfg +++ /dev/null @@ -1,32 +0,0 @@ -/* - Use this file to customize the behaviour of libtcod, - overriding what's defined in the sample/game code. - The main goal of this file is to allow the player - to tweak the game in case it doesn't work properly - on his system and there are no options screen/config - files available in the game. -*/ -libtcod { - // uncomment to force the use of a specific renderer - // renderer = "GLSL" - // renderer = "OPENGL" - //renderer = "SDL" - - // uncomment to force a specific fullscreen resolution - /* - fullscreen=true - fullscreenWidth=1280 - fullscreenHeight=1024 - */ - - // uncomment to use a custom font. - /* - font="data/fonts/terminal8x8_gs_as.png" - fontInRow=false - fontGreyscale=true - fontTcodLayout=false - fontNbCharHoriz=16 - fontNbCharVertic=16 - */ -} - diff --git a/tcod_sys/libtcod/src/README.txt b/tcod_sys/libtcod/src/README.txt index 8b0d61471..788154437 100644 --- a/tcod_sys/libtcod/src/README.txt +++ b/tcod_sys/libtcod/src/README.txt @@ -1,46 +1,46 @@ -This is the Doryen library source code. - -libtcod.h and libtcod.hpp are the main headers, included respectively by -the C and C++ programs that use libtcod. - -Each "toolkit" is in a separate file set. For each toolkit, you may have : -* include/.h : the C header -* include/.hpp : the C++ header -* src/_c.c : the C source code that contains the actual implementation -* src/.cpp : the C++ wrapper - -Current toolkits : -bresenham : line drawing using the Bresenham algorithm. -bsp : binary space partition tree module -color : 24 bits colors operations. -console : true color console emulator. It relies on some private functions of the sys toolkit. -fov : field of view calculator. -heightmap : heightmap toolkit. -image : image manipulation. It relies on some private functions of the sys toolkit. -list : a fast and lightweight generic container (faster than STL). -mersenne : pseudorandom number generator using the Mersenne twister algorithm. -mouse : mouse support. -namegen : name generator -noise : various noise generators. -parser : config file parser. -path : path finding module. -sys : system specific functions. -txtfield : work-in-progress text input utility -zip : compression module - -Note that some of the sys toolkits rely on system dependent functions. -They have currently a single working implementation relying on SDL : sys_sdl_c.c -As it is heavily system dependent, the mouse C implementation is in sys_sdl_c.c. -As of 1.4, the image load/save functions are isolated in sys_sdl_XXX.c, -XXX being the image type (currently bmp and png). -As of 1.5.1, sys_opengl_c.c contains OpenGL and GLSL renderers. Those two -renderers are still dependent on SDL. - -libtcod_int.h contains everything that is exported by the toolkits -(implemented in a toolkit and used in another one) but should not be seen -by the user of the library. - -These are the private (or undocumented) modules : -lex : a generic lexical parser. -tree : a minimalist tree toolkit. -sys : sys also contains an undocumented threading toolkit. +This is the Doryen library source code. + +libtcod.h and libtcod.hpp are the main headers, included respectively by +the C and C++ programs that use libtcod. + +Each "toolkit" is in a separate file set. For each toolkit, you may have : +* include/.h : the C header +* include/.hpp : the C++ header +* src/_c.c : the C source code that contains the actual implementation +* src/.cpp : the C++ wrapper + +Current toolkits : +bresenham : line drawing using the Bresenham algorithm. +bsp : binary space partition tree module +color : 24 bits colors operations. +console : true color console emulator. It relies on some private functions of the sys toolkit. +fov : field of view calculator. +heightmap : heightmap toolkit. +image : image manipulation. It relies on some private functions of the sys toolkit. +list : a fast and lightweight generic container (faster than STL). +mersenne : pseudorandom number generator using the Mersenne twister algorithm. +mouse : mouse support. +namegen : name generator +noise : various noise generators. +parser : config file parser. +path : path finding module. +sys : system specific functions. +txtfield : work-in-progress text input utility +zip : compression module + +Note that some of the sys toolkits rely on system dependent functions. +They have currently a single working implementation relying on SDL : sys_sdl_c.c +As it is heavily system dependent, the mouse C implementation is in sys_sdl_c.c. +As of 1.4, the image load/save functions are isolated in sys_sdl_XXX.c, +XXX being the image type (currently bmp and png). +As of 1.5.1, sys_opengl_c.c contains OpenGL and GLSL renderers. Those two +renderers are still dependent on SDL. + +libtcod_int.h contains everything that is exported by the toolkits +(implemented in a toolkit and used in another one) but should not be seen +by the user of the library. + +These are the private (or undocumented) modules : +lex : a generic lexical parser. +tree : a minimalist tree toolkit. +sys : sys also contains an undocumented threading toolkit. diff --git a/tcod_sys/libtcod/src/bresenham.cpp b/tcod_sys/libtcod/src/bresenham.cpp deleted file mode 100644 index 7ec503f0d..000000000 --- a/tcod_sys/libtcod/src/bresenham.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -// ********** bresenham line drawing ********** -void TCODLine::init(int xFrom, int yFrom, int xTo, int yTo) { - TCOD_line_init(xFrom,yFrom,xTo,yTo); -} - -bool TCODLine::step(int *xCur, int *yCur) { - return TCOD_line_step(xCur,yCur) != 0; -} - -static TCODLineListener *line_listener=NULL; - -// C to C++ bridge -extern "C" bool internalListener(int x,int y) { - return line_listener->putPoint(x,y) ? 1 : 0; -} - -bool TCODLine::line(int xFrom, int yFrom, int xTo, int yTo, TCODLineListener *plistener) { - line_listener=plistener; - return TCOD_line(xFrom,yFrom,xTo,yTo,internalListener) != 0; -} diff --git a/tcod_sys/libtcod/src/console_c.c b/tcod_sys/libtcod/src/console_c.c deleted file mode 100644 index ee21eb319..000000000 --- a/tcod_sys/libtcod/src/console_c.c +++ /dev/null @@ -1,2620 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include -#include -#include -#ifndef NO_UNICODE -#include -#include -#endif - -#include "vendor/stb_sprintf.h" -#include -#include -#include -#include -#include -#include - -#ifdef TCOD_CONSOLE_SUPPORT - -#if defined( TCOD_VISUAL_STUDIO ) -static const char *version_string ="libtcod "TCOD_STRVERSION; -#else -static const char *version_string __attribute__((unused)) ="libtcod "TCOD_STRVERSION; -#endif - -TCOD_internal_context_t TCOD_ctx={ - /* number of characters in the bitmap font */ - 16,16, - /* font type and layout */ - false,false,false, - /* character size in font */ - 8,8, - "terminal.png","", - NULL,NULL,NULL,0,false,0,0,0,0,0,0, -#ifndef TCOD_BARE - /* default renderer to use */ - TCOD_RENDERER_GLSL, - NULL, -#endif - /* fading data */ - {0,0,0},255, - /*key state*/ - {0}, - /* window closed ? */ - false, - /* mouse focus ? */ - false, - /* application active ? */ - true, -}; - -static TCOD_color_t color_control_fore[TCOD_COLCTRL_NUMBER]; -static TCOD_color_t color_control_back[TCOD_COLCTRL_NUMBER]; -/** - * Assign a foreground and background color to a color control index. - * - * \param con Index to change, e.g. `TCOD_COLCTRL_1` - * \param fore Foreground color to assign to this index. - * \param back Background color to assign to this index. - */ -void TCOD_console_set_color_control(TCOD_colctrl_t con, TCOD_color_t fore, TCOD_color_t back) { - TCOD_IFNOT(con >= TCOD_COLCTRL_1 && con <= TCOD_COLCTRL_NUMBER ) return; - color_control_fore[con-1]=fore; - color_control_back[con-1]=back; -} -/** - * Return a new console with a specific number of columns and rows. - * - * \param w Number of columns. - * \param h Number of columns. - * \return A pointer to the new console, or NULL on error. - */ -TCOD_console_t TCOD_console_new(int w, int h) { - TCOD_IFNOT(w > 0 && h > 0 ) { - return NULL; - } else { - TCOD_console_data_t *con=(TCOD_console_data_t *)calloc(sizeof(TCOD_console_data_t),1); - if (!con) { return NULL; } - con->w=w; - con->h=h; - TCOD_console_init(con,NULL,false); /* NOTE: CHECK THIS FOR ERORS */ - if(TCOD_ctx.root) { - con->alignment=TCOD_ctx.root->alignment; - con->bkgnd_flag=TCOD_ctx.root->bkgnd_flag; - } - return (TCOD_console_t)con; - } -} -/** - * Return immediately with a recently pressed key. - * - * \param flags A TCOD_event_t bit-field, for example: `TCOD_EVENT_KEY_PRESS` - * \return A TCOD_key_t struct with a recently pressed key. - * If no event exists then the `vk` attribute will be `TCODK_NONE` - */ -TCOD_key_t TCOD_console_check_for_keypress(int flags) { - return TCOD_sys_check_for_keypress(flags); -} -/** - * Wait for a key press event, then return it. - * - * \param flush If 1 then the event queue will be cleared before waiting for - * the next event. This should always be 0. - * \return A TCOD_key_t struct with the most recent key data. - * - * Do not solve input lag issues by arbitrarily dropping events! - */ -TCOD_key_t TCOD_console_wait_for_keypress(bool flush) { - return TCOD_sys_wait_for_keypress(flush); -} -/** - * Return true if the window is closing. - */ -bool TCOD_console_is_window_closed(void) { - return TCOD_ctx.is_window_closed; -} -/** - * Return true if the window has mouse focus. - */ -bool TCOD_console_has_mouse_focus(void) { - return TCOD_ctx.app_has_mouse_focus; -} -#ifndef TCOD_BARE -/** - * Return true if the window has keyboard focus. - * - * \verbatim embed:rst:leading-asterisk - * .. versionchanged: 1.7 - * This function was previously broken. It now keeps track of keyboard - * focus. - * \endverbatim - */ -bool TCOD_console_is_active(void) { - return TCOD_ctx.app_is_active; -} -#endif -/** - * Change the title string of the active window. - * - * \param title A utf8 string. - */ -void TCOD_console_set_window_title(const char *title) { - TCOD_sys_set_window_title(title); -} -/** - * Set the display to be full-screen or windowed. - * - * \param fullscreen If true the display will go full-screen. - */ -void TCOD_console_set_fullscreen(bool fullscreen) { - TCOD_IFNOT(TCOD_ctx.root != NULL) return; - TCOD_sys_set_fullscreen(fullscreen); - TCOD_ctx.fullscreen=fullscreen; -} -/** - * Return true if the display is full-screen. - */ -bool TCOD_console_is_fullscreen(void) { - return TCOD_ctx.fullscreen; -} -/** - * Set a consoles default background flag. - * - * \param con A console pointer. - * \param flag One of `TCOD_bkgnd_flag_t`. - */ -void TCOD_console_set_background_flag(TCOD_console_t con,TCOD_bkgnd_flag_t flag) { - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT ( dat != NULL ) return; - dat->bkgnd_flag=flag; -} -/** - * Return a consoles default background flag. - */ -TCOD_bkgnd_flag_t TCOD_console_get_background_flag(TCOD_console_t con) { - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT ( dat != NULL ) return TCOD_BKGND_NONE; - return dat->bkgnd_flag; -} -/** - * Set a consoles default alignment. - * - * \param con A console pointer. - * \param alignment One of TCOD_alignment_t - */ -void TCOD_console_set_alignment(TCOD_console_t con,TCOD_alignment_t alignment) { - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT ( dat != NULL ) return; - dat->alignment=alignment; -} -/** - * Return a consoles default alignment. - */ -TCOD_alignment_t TCOD_console_get_alignment(TCOD_console_t con) { - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT ( dat != NULL ) return TCOD_LEFT; - return dat->alignment; -} - -static void TCOD_console_data_free(TCOD_console_data_t *dat) { - if (dat->fg_colors) TCOD_image_delete(dat->fg_colors); - if (dat->bg_colors) TCOD_image_delete(dat->bg_colors); - free(dat->ch_array); -} -/** - * Delete a console. - * - * \param con A console pointer. - * - * If the console being deleted is the root console, then the display will be - * uninitialized. - */ -void TCOD_console_delete(TCOD_console_t con) { - TCOD_console_data_t *dat=(TCOD_console_data_t *)(con); - if (! dat ) { - dat=TCOD_ctx.root; - TCOD_sys_uninit(); - TCOD_ctx.root=NULL; - } - TCOD_console_data_free(dat); - free(dat); -} -/** - * Blit from one console to another. - * - * \param srcCon Pointer to the source console. - * \param xSrc The left region of the source console to blit from. - * \param ySrc The top region of the source console to blit from. - * \param wSrc The width of the region to blit from. - * If 0 then it will fill to the maximum width. - * \param hSrc The height of the region to blit from. - * If 0 then it will fill to the maximum height. - * \param dstCon Pointer to the destination console. - * \param xDst The left corner to blit onto the destination console. - * \param yDst The top corner to blit onto the destination console. - * \param foreground_alpha Foreground blending alpha. - * \param background_alpha Background blending alpha. - * - * If the source console has a key color, this function will use it. - */ -void TCOD_console_blit(TCOD_console_t srcCon, int xSrc, int ySrc, int wSrc, int hSrc, - TCOD_console_t dstCon, int xDst, int yDst, float foreground_alpha, float background_alpha) { - TCOD_console_data_t *src = srcCon ? (TCOD_console_data_t *)srcCon : TCOD_ctx.root; - TCOD_console_data_t *dst = dstCon ? (TCOD_console_data_t *)dstCon : TCOD_ctx.root; - TCOD_color_t *srcFgColors, *srcBgColors, *dstFgColors, *dstBgColors; - bool srcHasKeyColor; - TCOD_color_t srcKeyColor; - int cx, cy; - if (wSrc == 0) wSrc = src->w; - if (hSrc == 0) hSrc = src->h; - TCOD_IFNOT(wSrc > 0 && hSrc > 0) return; - TCOD_IFNOT(xDst + wSrc >= 0 && yDst + hSrc >= 0 && xDst < dst->w && yDst < dst->h) return; - TCOD_image_get_key_data(src->bg_colors, &srcHasKeyColor, &srcKeyColor); - srcFgColors = TCOD_image_get_colors(src->fg_colors); - srcBgColors = TCOD_image_get_colors(src->bg_colors); - dstFgColors = TCOD_image_get_colors(dst->fg_colors); - dstBgColors = TCOD_image_get_colors(dst->bg_colors); - for (cx = xSrc; cx < xSrc + wSrc; cx++) { - for (cy = ySrc; cy < ySrc + hSrc; cy++) { - /* check if we're outside the dest console */ - int dx = cx - xSrc + xDst; - int dy = cy - ySrc + yDst; - int dst_idx = dy * dst->w + dx; - int src_idx = cy * src->w + cx; - int srcChar, dstChar; - TCOD_color_t srcFgColor, srcBgColor, dstFgColor, dstBgColor; - if ((unsigned)cx >= (unsigned)src->w || (unsigned)cy >= (unsigned)src->h) continue; - if ((unsigned)dx >= (unsigned)dst->w || (unsigned)dy >= (unsigned)dst->h) continue; - srcChar = src->ch_array[src_idx]; - srcFgColor = srcFgColors[src_idx]; - srcBgColor = srcBgColors[src_idx]; - /* check if source pixel is transparent */ - if (srcHasKeyColor && - srcBgColor.r == srcKeyColor.r && srcBgColor.g == srcKeyColor.g && srcBgColor.b == srcKeyColor.b) - continue; - - if (foreground_alpha == 1.0f && background_alpha == 1.0f) { - dstChar = srcChar; - dstFgColor = srcFgColor; - dstBgColor = srcBgColor; - } - else { - dstChar = dst->ch_array[dst_idx]; - dstFgColor = dstFgColors[dst_idx]; - dstBgColor = dstBgColors[dst_idx]; - - dstBgColor = TCOD_color_lerp(dstBgColor, srcBgColor, background_alpha); - if (srcChar == ' ') { - dstFgColor = TCOD_color_lerp(dstFgColor, srcBgColor, background_alpha); - } - else if (dstChar == ' ') { - dstChar = srcChar; - dstFgColor = TCOD_color_lerp(dstBgColor, srcFgColor, foreground_alpha); - } - else if (dstChar == srcChar) { - dstFgColor = TCOD_color_lerp(dstFgColor, srcFgColor, foreground_alpha); - } - else { - if (foreground_alpha < 0.5f) { - dstFgColor = TCOD_color_lerp(dstFgColor, dstBgColor, - foreground_alpha * 2); - } - else { - dstChar = srcChar; - dstFgColor = TCOD_color_lerp(dstBgColor, srcFgColor, - (foreground_alpha - 0.5f) * 2); - } - } - } - dstFgColors[dst_idx] = dstFgColor; - dstBgColors[dst_idx] = dstBgColor; - dst->ch_array[dst_idx] = dstChar; - } - } - TCOD_image_invalidate_mipmaps(dst->fg_colors); - TCOD_image_invalidate_mipmaps(dst->bg_colors); -} -/** - * Render and present the root console to the active display. - */ -void TCOD_console_flush(void) { - TCOD_IFNOT(TCOD_ctx.root != NULL) return; - TCOD_sys_flush(true); -} -/** - * Fade the color of the display. - * - * \param val Where at 255 colors are normal and at 0 colors are completely - * faded. - * \param fadecol Color to fade towards. - */ -void TCOD_console_set_fade(uint8_t val, TCOD_color_t fadecol) { - TCOD_ctx.fade=val; - TCOD_ctx.fading_color=fadecol; -} -/** - * Return the fade value. - * - * \return At 255 colors are normal and at 0 colors are completely faded. - */ -uint8_t TCOD_console_get_fade(void) { - return TCOD_ctx.fade; -} -/** - * Return the fade color. - * - * \return The current fading color. - */ -TCOD_color_t TCOD_console_get_fading_color(void) { - return TCOD_ctx.fading_color; -} -/** - * Draw a character on a console using the default colors. - * - * \param con A console pointer. - * \param x The X coordinate, the left-most position being 0. - * \param y The Y coordinate, the top-most position being 0. - * \param c The character code to place. - * \param flag A TCOD_bkgnd_flag_t flag. - */ -void TCOD_console_put_char(TCOD_console_t con, int x, int y, int c, TCOD_bkgnd_flag_t flag) { - int offset; - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL && (unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h) return; - offset = y * dat->w + x; - dat->ch_array[offset] = c; - TCOD_image_put_pixel(dat->fg_colors, x, y, dat->fore); - TCOD_console_set_char_background(con, x, y, dat->back, (TCOD_bkgnd_flag_t)flag); -} -/** - * Draw a character on the console with the given colors. - * - * \param con A console pointer. - * \param x The X coordinate, the left-most position being 0. - * \param y The Y coordinate, the top-most position being 0. - * \param c The character code to place. - * \param fore The foreground color. - * \param back The background color. This color will not be blended. - */ -void TCOD_console_put_char_ex(TCOD_console_t con, int x, int y, int c, TCOD_color_t fore, TCOD_color_t back) { - int offset; - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL && (unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h) return; - offset = y * dat->w + x; - dat->ch_array[offset] = c; - TCOD_image_put_pixel(dat->fg_colors, x, y, fore); - TCOD_image_put_pixel(dat->bg_colors, x, y, back); -} -/** - * Manually mark a region of a console as dirty. - */ -void TCOD_console_set_dirty(int dx, int dy, int dw, int dh) { - TCOD_sys_set_dirty(dx, dy, dw, dh); -} -/** - * Clear a console to its default colors and the space character code. - */ -void TCOD_console_clear(TCOD_console_t con) { - int i; - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL) return; - for (i = 0; i < dat->w * dat->h; i++) { - dat->ch_array[i] = ' '; - } - TCOD_image_clear(dat->fg_colors, dat->fore); - TCOD_image_clear(dat->bg_colors, dat->back); - /* clear the sdl renderer cache */ - TCOD_sys_set_dirty(0, 0, dat->w, dat->h); -} -/** - * Return the background color of a console at x,y - * - * \param con A console pointer. - * \param x The X coordinate, the left-most position being 0. - * \param y The Y coordinate, the top-most position being 0. - * \return A TCOD_color_t struct with a copy of the background color. - */ -TCOD_color_t TCOD_console_get_char_background(TCOD_console_t con, int x, int y) { - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL - && (unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h) - return TCOD_black; - return TCOD_image_get_pixel(dat->bg_colors, x, y); -} -/** - * Change the foreground color of a console tile. - * - * \param con A console pointer. - * \param x The X coordinate, the left-most position being 0. - * \param y The Y coordinate, the top-most position being 0. - * \param col The foreground color to set. - */ -void TCOD_console_set_char_foreground(TCOD_console_t con, int x, int y, TCOD_color_t col) { - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - if ((unsigned)(x) >= (unsigned)dat->w || (unsigned)(y) >= (unsigned)dat->h) return; - TCOD_IFNOT(dat != NULL - && (unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h) - return; - TCOD_image_put_pixel(dat->fg_colors, x, y, col); -} -/** - * Return the foreground color of a console at x,y - * - * \param con A console pointer. - * \param x The X coordinate, the left-most position being 0. - * \param y The Y coordinate, the top-most position being 0. - * \return A TCOD_color_t struct with a copy of the foreground color. - */ -TCOD_color_t TCOD_console_get_char_foreground(TCOD_console_t con, int x, int y) { - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL - && (unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h) - return TCOD_white; - return TCOD_image_get_pixel(dat->fg_colors, x, y); -} -/** - * Return a character code of a console at x,y - * - * \param con A console pointer. - * \param x The X coordinate, the left-most position being 0. - * \param y The Y coordinate, the top-most position being 0. - * \return The character code. - */ -int TCOD_console_get_char(TCOD_console_t con, int x, int y) { - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL - && (unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h) - return 0; - return dat->ch_array[y * dat->w + x]; -} -/** - * Blend a background color onto a console tile. - * - * \param con A console pointer. - * \param x The X coordinate, the left-most position being 0. - * \param y The Y coordinate, the top-most position being 0. - * \param col The background color to blend. - * \param flag The blend mode to use. - */ -void TCOD_console_set_char_background(TCOD_console_t con, int x, int y, TCOD_color_t col, TCOD_bkgnd_flag_t flag) { - TCOD_color_t *back; - int newr, newg, newb; - int alpha; - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL - && (unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h) - return; - back = &(TCOD_image_get_colors(dat->bg_colors)[y*dat->w + x]); - if (flag == TCOD_BKGND_DEFAULT) flag = dat->bkgnd_flag; - switch (flag & 0xff) { - case TCOD_BKGND_SET: *back = col; break; - case TCOD_BKGND_MULTIPLY: *back = TCOD_color_multiply(*back, col); break; - case TCOD_BKGND_LIGHTEN: - back->r = MAX(back->r, col.r); - back->g = MAX(back->g, col.g); - back->b = MAX(back->b, col.b); - break; - case TCOD_BKGND_DARKEN: - back->r = MIN(back->r, col.r); - back->g = MIN(back->g, col.g); - back->b = MIN(back->b, col.b); - break; - case TCOD_BKGND_SCREEN: - /* newbk = white - (white - oldbk) * (white - curbk) */ - back->r = (uint8_t)(255 - (int)(255 - back->r)*(255 - col.r) / 255); - back->g = (uint8_t)(255 - (int)(255 - back->g)*(255 - col.g) / 255); - back->b = (uint8_t)(255 - (int)(255 - back->b)*(255 - col.b) / 255); - break; - case TCOD_BKGND_COLOR_DODGE: - /* newbk = curbk / (white - oldbk) */ - if (back->r != 255) newr = (int)(255 * col.r) / (255 - back->r); - else newr = 255; - if (back->g != 255) newg = (int)(255 * col.g) / (255 - back->g); - else newg = 255; - if (back->b != 255) newb = (int)(255 * col.b) / (255 - back->b); - else newb = 255; - back->r = (uint8_t)CLAMP(0, 255, newr); - back->g = (uint8_t)CLAMP(0, 255, newg); - back->b = (uint8_t)CLAMP(0, 255, newb); - break; - case TCOD_BKGND_COLOR_BURN: - /* newbk = white - (white - oldbk) / curbk */ - if (col.r > 0) newr = 255 - (int)(255 * (255 - back->r)) / col.r; - else newr = 0; - if (col.g > 0) newg = 255 - (int)(255 * (255 - back->g)) / col.g; - else newg = 0; - if (col.b > 0) newb = 255 - (int)(255 * (255 - back->b)) / col.b; - else newb = 0; - back->r = (uint8_t)CLAMP(0, 255, newr); - back->g = (uint8_t)CLAMP(0, 255, newg); - back->b = (uint8_t)CLAMP(0, 255, newb); - break; - case TCOD_BKGND_ADD: - /* newbk = oldbk + curbk */ - newr = (int)(back->r) + col.r; - newg = (int)(back->g) + col.g; - newb = (int)(back->b) + col.b; - back->r = (uint8_t)CLAMP(0, 255, newr); - back->g = (uint8_t)CLAMP(0, 255, newg); - back->b = (uint8_t)CLAMP(0, 255, newb); - break; - case TCOD_BKGND_ADDA: - alpha = (flag >> 8); - /* newbk = oldbk + alpha * curbk */ - newr = (int)(back->r) + alpha * col.r / 255; - newg = (int)(back->g) + alpha * col.g / 255; - newb = (int)(back->b) + alpha * col.b / 255; - back->r = (uint8_t)CLAMP(0, 255, newr); - back->g = (uint8_t)CLAMP(0, 255, newg); - back->b = (uint8_t)CLAMP(0, 255, newb); - break; - case TCOD_BKGND_BURN: - /* newbk = oldbk + curbk - white */ - newr = (int)(back->r) + col.r - 255; - newg = (int)(back->g) + col.g - 255; - newb = (int)(back->b) + col.b - 255; - back->r = (uint8_t)CLAMP(0, 255, newr); - back->g = (uint8_t)CLAMP(0, 255, newg); - back->b = (uint8_t)CLAMP(0, 255, newb); - break; - case TCOD_BKGND_OVERLAY: - /* newbk = curbk.x <= 0.5 ? 2*curbk*oldbk : white - 2*(white-curbk)*(white-oldbk) */ - newr = col.r <= 128 ? 2 * (int)(col.r) * back->r / 255 : 255 - 2 * (int)(255 - col.r)*(255 - back->r) / 255; - newg = col.g <= 128 ? 2 * (int)(col.g) * back->g / 255 : 255 - 2 * (int)(255 - col.g)*(255 - back->g) / 255; - newb = col.b <= 128 ? 2 * (int)(col.b) * back->b / 255 : 255 - 2 * (int)(255 - col.b)*(255 - back->b) / 255; - back->r = (uint8_t)CLAMP(0, 255, newr); - back->g = (uint8_t)CLAMP(0, 255, newg); - back->b = (uint8_t)CLAMP(0, 255, newb); - break; - case TCOD_BKGND_ALPH: - /* newbk = (1.0f-alpha)*oldbk + alpha*(curbk-oldbk) */ - alpha = (flag >> 8); - *back = TCOD_color_lerp(*back, col, (float)(alpha / 255.0f)); - break; - default: break; - } -} -/** - * Change a character on a console tile, without changing its colors. - * - * \param con A console pointer. - * \param x The X coordinate, the left-most position being 0. - * \param y The Y coordinate, the top-most position being 0. - * \param c The character code to set. - */ -void TCOD_console_set_char(TCOD_console_t con, int x, int y, int c) { - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - if ((unsigned)(x) >= (unsigned)dat->w || (unsigned)(y) >= (unsigned)dat->h) return; - dat->ch_array[y * dat->w + x] = c; -} - -static void TCOD_console_clamp(int cx, int cy, int cw, int ch, int *x, int *y, int *w, int *h) { - if (*x + *w > cw) *w = cw - *x; - if (*y + *h > ch) *h = ch - *y; - if (*x < cx) { - *w -= cx - *x; - *x = cx; - } - if (*y < cy) { - *h -= cy - *y; - *y = cy; - } -} -/** - * Draw a rectangle onto a console. - * - * \param con A console pointer. - * \param x The starting region, the left-most position being 0. - * \param y The starting region, the top-most position being 0. - * \param rw The width of the rectangle. - * \param rh The height of the rectangle. - * \param clear If true the drawing region will be filled with spaces. - * \param flag The blending flag to use. - */ -void TCOD_console_rect(TCOD_console_t con, int x, int y, int rw, int rh, bool clear, TCOD_bkgnd_flag_t flag) { - int cx, cy; - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL) return; - TCOD_ASSERT((unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h); - TCOD_ASSERT(x + rw <= dat->w && y + rh <= dat->h); - - TCOD_console_clamp(0, 0, dat->w, dat->h, &x, &y, &rw, &rh); - TCOD_IFNOT(rw > 0 && rh > 0) return; - for (cx = x; cx < x + rw; cx++) { - for (cy = y; cyback, flag); - if (clear) { - dat->ch_array[cx + cy*dat->w] = ' '; - } - } - } -} -/** - * Draw a horizontal line using the default colors. - * - * \param con A console pointer. - * \param x The starting X coordinate, the left-most position being 0. - * \param y The starting Y coordinate, the top-most position being 0. - * \param l The width of the line. - * \param flag The blending flag. - * - * This function makes assumptions about the fonts character encoding. - * It will fail if the font encoding is not `cp437`. - */ -void TCOD_console_hline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag) { - int i; - for (i=x; i< x+l; i++) TCOD_console_put_char(con,i,y,TCOD_CHAR_HLINE,flag); -} -/** - * Draw a vertical line using the default colors. - * - * \param con A console pointer. - * \param x The starting X coordinate, the left-most position being 0. - * \param y The starting Y coordinate, the top-most position being 0. - * \param l The height of the line. - * \param flag The blending flag. - * - * This function makes assumptions about the fonts character encoding. - * It will fail if the font encoding is not `cp437`. - */ -void TCOD_console_vline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag) { - int i; - for (i=y; i< y+l; i++) TCOD_console_put_char(con,x,i,TCOD_CHAR_VLINE,flag); -} - -char *TCOD_console_vsprint(const char *fmt, va_list ap) { - #define NB_BUFFERS 10 - #define INITIAL_SIZE 512 - /* several static buffers in case the function is used more than once in a single function call */ - static char *msg[NB_BUFFERS]={NULL}; - static int buflen[NB_BUFFERS]={0}; - static int curbuf=0; - char *ret; - bool ok=false; - if (!msg[0]) { - int i; - for (i=0; i < NB_BUFFERS; i++) { - buflen[i]=INITIAL_SIZE; - msg[i]=(char *)calloc(sizeof(char),INITIAL_SIZE); - } - } - do { - /* warning ! depending on the compiler, vsnprintf return -1 or - the expected string length if the buffer is not big enough */ - int len = stbsp_vsnprintf(msg[curbuf],buflen[curbuf],fmt,ap); - ok=true; - if (len < 0 || len >= buflen[curbuf]) { - /* buffer too small. */ - if ( len > 0 ) { - while ( buflen[curbuf] < len+1 ) buflen[curbuf]*=2; - } else { - buflen[curbuf]*=2; - } - free( msg[curbuf] ); - msg[curbuf]=(char *)calloc(sizeof(char),buflen[curbuf]); - ok=false; - } - } while (! ok); - ret=msg[curbuf]; - curbuf = (curbuf+1)%NB_BUFFERS; - return ret; -} -/** - * Print a string inside of a framed region on a console, using default - * colors and alignment. - * - * \param con A console pointer. - * \param x The starting X coordinate, the left-most position being 0. - * \param y The starting Y coordinate, the top-most position being 0. - * \param w The width of the frame. - * \param h The height of the frame. - * \param empty If true the characters inside of the frame will be cleared - * with spaces. - * \param flag The blending flag. - * \param fmt A format string as if passed to printf. - * \param ... Variadic arguments as if passed to printf. - * - * This function makes assumptions about the fonts character encoding. - * It will fail if the font encoding is not `cp437`. - */ -void TCOD_console_print_frame(TCOD_console_t con,int x,int y,int w,int h, bool empty, TCOD_bkgnd_flag_t flag, const char *fmt, ...) { - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_console_put_char(con,x,y,TCOD_CHAR_NW,flag); - TCOD_console_put_char(con,x+w-1,y,TCOD_CHAR_NE,flag); - TCOD_console_put_char(con,x,y+h-1,TCOD_CHAR_SW,flag); - TCOD_console_put_char(con,x+w-1,y+h-1,TCOD_CHAR_SE,flag); - TCOD_console_hline(con,x+1,y,w-2,flag); - TCOD_console_hline(con,x+1,y+h-1,w-2,flag); - if ( h > 2 ) { - TCOD_console_vline(con,x,y+1,h-2,flag); - TCOD_console_vline(con,x+w-1,y+1,h-2,flag); - if ( empty ) { - TCOD_console_rect(con,x+1,y+1,w-2,h-2,true,flag); - } - } - if (fmt) { - va_list ap; - int xs; - TCOD_color_t tmp; - char *title; - va_start(ap,fmt); - title = TCOD_console_vsprint(fmt,ap); - va_end(ap); - title[w-3]=0; /* truncate if needed */ - xs = x + (w-(int)strlen(title)-2)/2; - tmp=dat->back; /* swap colors */ - dat->back=dat->fore; - dat->fore=tmp; - TCOD_console_print_ex(con,xs,y,TCOD_BKGND_SET,TCOD_LEFT," %s ",title); - tmp=dat->back; /* swap colors */ - dat->back=dat->fore; - dat->fore=tmp; - } -} -/** - * Print a string on a console, using default colors and alignment. - * - * \param con A console pointer. - * \param x The starting X coordinate, the left-most position being 0. - * \param y The starting Y coordinate, the top-most position being 0. - * \param fmt A format string as if passed to printf. - * \param ... Variadic arguments as if passed to printf. - */ -void TCOD_console_print(TCOD_console_t con,int x, int y, const char *fmt, ...) { - va_list ap; - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT ( dat != NULL ) return; - va_start(ap,fmt); - TCOD_console_print_internal(con,x,y,0,0,dat->bkgnd_flag, - dat->alignment,TCOD_console_vsprint(fmt,ap), false, false); - va_end(ap); -} -/** - * Print a string on a console, using default colors. - * - * \param con A console pointer. - * \param x The starting X coordinate, the left-most position being 0. - * \param y The starting Y coordinate, the top-most position being 0. - * \param flag The blending flag. - * \param alignment The font alignment to use. - * \param fmt A format string as if passed to printf. - * \param ... Variadic arguments as if passed to printf. - */ -void TCOD_console_print_ex(TCOD_console_t con,int x, int y, - TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...) { - va_list ap; - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT ( dat != NULL ) return; - va_start(ap,fmt); - TCOD_console_print_internal(con,x,y,0,0,flag,alignment, - TCOD_console_vsprint(fmt,ap), false, false); - va_end(ap); -} -/** - * Print a string on a console constrained to a rectangle, using default - * colors and alignment. - * - * \param con A console pointer. - * \param x The starting X coordinate, the left-most position being 0. - * \param y The starting Y coordinate, the top-most position being 0. - * \param w The width of the region. - * If 0 then the maximum width will be used. - * \param h The height of the region. - * If 0 then the maximum height will be used. - * \param fmt A format string as if passed to printf. - * \param ... Variadic arguments as if passed to printf. - * \return The number of lines actually printed. - */ -int TCOD_console_print_rect(TCOD_console_t con,int x, int y, int w, int h, const char *fmt, ...) { - int ret; - va_list ap; - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT ( dat != NULL ) return 0; - va_start(ap,fmt); - ret = TCOD_console_print_internal(con,x,y,w,h,dat->bkgnd_flag,dat->alignment, - TCOD_console_vsprint(fmt,ap), true, false); - va_end(ap); - return ret; -} -/** - * Print a string on a console constrained to a rectangle, using default - * colors. - * - * \param con A console pointer. - * \param x The starting X coordinate, the left-most position being 0. - * \param y The starting Y coordinate, the top-most position being 0. - * \param w The width of the region. - * If 0 then the maximum width will be used. - * \param h The height of the region. - * If 0 then the maximum height will be used. - * \param flag The blending flag. - * \param alignment The font alignment to use. - * \param fmt A format string as if passed to printf. - * \param ... Variadic arguments as if passed to printf. - * \return The number of lines actually printed. - */ -int TCOD_console_print_rect_ex(TCOD_console_t con,int x, int y, int w, int h, - TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment,const char *fmt, ...) { - int ret; - va_list ap; - va_start(ap,fmt); - ret = TCOD_console_print_internal(con,x,y,w,h,flag,alignment,TCOD_console_vsprint(fmt,ap), true, false); - va_end(ap); - return ret; -} -/** - * Return the number of lines that would be printed by the - * - * \param con A console pointer. - * \param x The starting X coordinate, the left-most position being 0. - * \param y The starting Y coordinate, the top-most position being 0. - * \param w The width of the region. - * If 0 then the maximum width will be used. - * \param h The height of the region. - * If 0 then the maximum height will be used. - * \param fmt A format string as if passed to printf. - * \param ... Variadic arguments as if passed to printf. - * \return The number of lines that would have been printed. - */ -int TCOD_console_get_height_rect(TCOD_console_t con,int x, int y, int w, int h, const char *fmt, ...) { - int ret; - va_list ap; - va_start(ap,fmt); - ret = TCOD_console_print_internal(con,x,y,w,h,TCOD_BKGND_NONE,TCOD_LEFT,TCOD_console_vsprint(fmt,ap), true, true); - va_end(ap); - return ret; -} - -/* non public methods */ -int TCOD_console_stringLength(const unsigned char *s) { - int l=0; - while (*s) { - if ( *s == (int)TCOD_COLCTRL_FORE_RGB || *s == (int)TCOD_COLCTRL_BACK_RGB ) s+=3; - else if ( (unsigned)(*s) > (unsigned)TCOD_COLCTRL_STOP ) l++; - s++; - } - return l; -} - -unsigned char * TCOD_console_forward(unsigned char *s,int l) { - while ( *s && l > 0 ) { - if ( *s == (int)TCOD_COLCTRL_FORE_RGB || *s == (int)TCOD_COLCTRL_BACK_RGB ) s+=3; - else if ( *s > (int)TCOD_COLCTRL_STOP ) l--; - s++; - } - return s; -} - -unsigned char *TCOD_console_strchr(unsigned char *s, unsigned char c) { - while ( *s && *s != c ) { - if ( *s == (int)TCOD_COLCTRL_FORE_RGB || *s == (int)TCOD_COLCTRL_BACK_RGB ) s+=3; - s++; - } - return (*s ? s : NULL); -} - -int TCOD_console_print_internal(TCOD_console_t con,int x,int y, int rw, int rh, TCOD_bkgnd_flag_t flag, - TCOD_alignment_t align, char *msg, bool can_split, bool count_only) { - unsigned char *c=(unsigned char *)msg; - int cx=0,cy=y; - int minx,maxx,miny,maxy; - TCOD_color_t oldFore; - TCOD_color_t oldBack; - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT ( dat != NULL - && (unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h ) - return 0; - TCOD_IFNOT(msg != NULL) return 0; - if ( rh == 0 ) rh = dat->h-y; - if ( rw == 0 ) switch(align) { - case TCOD_LEFT : rw = dat->w-x; break; - case TCOD_RIGHT : rw=x+1; break; - case TCOD_CENTER : default : rw=dat->w; break; - } - oldFore=dat->fore; - oldBack=dat->back; - miny=y; - maxy=dat->h-1; - if (rh > 0) maxy=MIN(maxy,y+rh-1); - switch (align) { - case TCOD_LEFT : minx=MAX(0,x); maxx=MIN(dat->w-1,x+rw-1); break; - case TCOD_RIGHT : minx=MAX(0,x-rw+1); maxx=MIN(dat->w-1,x); break; - case TCOD_CENTER : default : minx=MAX(0,x-rw/2); maxx=MIN(dat->w-1,x+rw/2); break; - } - - do { - /* get \n delimited sub-message */ - unsigned char *end=TCOD_console_strchr(c,'\n'); - char bak=0; - int cl; - unsigned char *split=NULL; - if ( end ) *end=0; - cl= TCOD_console_stringLength(c); - /* find starting x */ - switch (align) { - case TCOD_LEFT : cx=x; break; - case TCOD_RIGHT : cx=x-cl+1; break; - case TCOD_CENTER : cx= x-cl/2;break; - } - /* check if the string is completely out of the minx,miny,maxx,maxy frame */ - if ( cy >= miny && cy <= maxy && cx <= maxx && cx+cl -1 >= minx ) { - if ( can_split && cy <= maxy ) { - /* if partially out of screen, try to split the sub-message */ - if ( cx < minx ) split = TCOD_console_forward(c, align == TCOD_CENTER ? cl-2*(minx-cx) : cl-(minx-cx)); - else if ( align == TCOD_CENTER ) { - if ( cx + cl/2 > maxx+1 ) split = TCOD_console_forward(c, maxx+1 - cx); - } else { - if ( cx + cl > maxx+1 ) split = TCOD_console_forward(c, maxx+1 - cx); - } - } - if ( split ) { - unsigned char *oldsplit=split; - while ( ! isspace(*split) && split > c ) split --; - if (end) *end='\n'; - if (!isspace(*split) ) { - split=oldsplit; - } - end=split; - bak=*split; - *split=0; - cl=TCOD_console_stringLength(c); - switch (align) { - case TCOD_LEFT : cx=x; break; - case TCOD_RIGHT : cx=x-cl+1; break; - case TCOD_CENTER : cx= x-cl/2;break; - } - } - if ( cx < minx ) { - /* truncate left part */ - c += minx-cx; - cl -= minx-cx; - cx=minx; - } - if ( cx + cl > maxx+1 ) { - /* truncate right part */ - split = TCOD_console_forward(c, maxx+1 - cx); - *split=0; - } - /* render the sub-message */ - if ( cy >= 0 && cy < dat->h ) - while (*c) { - if ( *c >= TCOD_COLCTRL_1 && *c <= TCOD_COLCTRL_NUMBER ) { - dat->fore=color_control_fore[(int)(*c)-1]; - dat->back=color_control_back[(int)(*c)-1]; - } else if ( *c == TCOD_COLCTRL_FORE_RGB ) { - c++; - dat->fore.r=*c++; - dat->fore.g=*c++; - dat->fore.b=*c; - } else if ( *c == TCOD_COLCTRL_BACK_RGB ) { - c++; - dat->back.r=*c++; - dat->back.g=*c++; - dat->back.b=*c; - } else if ( *c == TCOD_COLCTRL_STOP ) { - dat->fore=oldFore; - dat->back=oldBack; - } else { - if (! count_only) TCOD_console_put_char(con,cx,cy,(int)(*c),flag); - cx++; - } - c++; - } - } - if ( end ) { - /* next line */ - if ( split && ! isspace(bak) ) { - *end=bak; - c=end; - } else { - c=end+1; - } - cy++; - } else c=NULL; - } while ( c && cy < dat->h && (rh == 0 || cy < y+rh) ); - return cy-y+1; -} - -#ifndef NO_UNICODE - -wchar_t *TCOD_console_strchr_utf(wchar_t *s, char c) { - while ( *s && *s != c ) { - if ( *s == (int)TCOD_COLCTRL_FORE_RGB || *s == (int)TCOD_COLCTRL_BACK_RGB ) s+=3; - s++; - } - return (*s ? s : NULL); -} - -void TCOD_console_map_string_to_font_utf(const wchar_t *s, int fontCharX, int fontCharY) { - TCOD_IFNOT(s != NULL) return; - while (*s) { - TCOD_sys_map_ascii_to_font(*s, fontCharX, fontCharY); - fontCharX++; - if ( fontCharX == TCOD_ctx.fontNbCharHoriz ) { - fontCharX=0; - fontCharY++; - } - s++; - } -} - -wchar_t *TCOD_console_vsprint_utf(const wchar_t *fmt, va_list ap) { - #define NB_BUFFERS 10 - #define INITIAL_SIZE 512 - /* several static buffers in case the function is used more than once in a single function call */ - static wchar_t *msg[NB_BUFFERS]={NULL}; - static int buflen[NB_BUFFERS]={0}; - static int curbuf=0; - wchar_t *ret; - bool ok=false; - if (!msg[0]) { - int i; - for (i=0; i < NB_BUFFERS; i++) { - buflen[i]=INITIAL_SIZE; - msg[i]=(wchar_t *)calloc(sizeof(wchar_t),INITIAL_SIZE); - } - } - do { - /* warning ! depending on the compiler, vsnprintf return -1 or - the expected string length if the buffer is not big enough */ - int len = vsnwprintf(msg[curbuf],buflen[curbuf],fmt,ap); - ok=true; - if (len < 0 || len >= buflen[curbuf]) { - /* buffer too small. */ - if ( len > 0 ) { - while ( buflen[curbuf] < len+1 ) buflen[curbuf]*=2; - } else { - buflen[curbuf]*=2; - } - free( msg[curbuf] ); - msg[curbuf]=(wchar_t *)calloc(sizeof(wchar_t),buflen[curbuf]); - ok=false; - } - } while (! ok); - ret=msg[curbuf]; - curbuf = (curbuf+1)%NB_BUFFERS; - return ret; -} - - -int TCOD_console_stringLength_utf(const wchar_t *s) { - int l=0; - while (*s) { - if ( *s == (int)TCOD_COLCTRL_FORE_RGB || *s == (int)TCOD_COLCTRL_BACK_RGB ) s+=3; - else if ( *s > (int)TCOD_COLCTRL_STOP ) l++; - s++; - } - return l; -} - -wchar_t * TCOD_console_forward_utf(wchar_t *s,int l) { - while ( *s && l > 0 ) { - if ( *s == (int)TCOD_COLCTRL_FORE_RGB || *s == (int)TCOD_COLCTRL_BACK_RGB ) s+=3; - else if ( *s > (int)TCOD_COLCTRL_STOP ) l--; - s++; - } - return s; -} - -int TCOD_console_print_internal_utf(TCOD_console_t con,int x,int y, int rw, int rh, TCOD_bkgnd_flag_t flag, - TCOD_alignment_t align, wchar_t *msg, bool can_split, bool count_only) { - wchar_t *c=msg; - int cx=0,cy=y; - int minx,maxx,miny,maxy; - TCOD_color_t oldFore; - TCOD_color_t oldBack; - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT ( dat != NULL - && (unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h ) - return 0; - TCOD_IFNOT(msg != NULL) return 0; - if ( rh == 0 ) rh = dat->h-y; - if ( rw == 0 ) switch(align) { - case TCOD_LEFT : rw = dat->w-x; break; - case TCOD_RIGHT : rw=x+1; break; - case TCOD_CENTER : default : rw=dat->w; break; - } - oldFore=dat->fore; - oldBack=dat->back; - miny=y; - maxy=dat->h-1; - if (rh > 0) maxy=MIN(maxy,y+rh-1); - switch (align) { - case TCOD_LEFT : minx=MAX(0,x); maxx=MIN(dat->w-1,x+rw-1); break; - case TCOD_RIGHT : minx=MAX(0,x-rw+1); maxx=MIN(dat->w-1,x); break; - case TCOD_CENTER : default : minx=MAX(0,x-rw/2); maxx=MIN(dat->w-1,x+rw/2); break; - } - - do { - /* get \n delimited sub-message */ - wchar_t *end=TCOD_console_strchr_utf(c,'\n'); - wchar_t bak=0; - int cl; - wchar_t *split=NULL; - if ( end ) *end=0; - cl= TCOD_console_stringLength_utf(c); - /* find starting x */ - switch (align) { - case TCOD_LEFT : cx=x; break; - case TCOD_RIGHT : cx=x-cl+1; break; - case TCOD_CENTER : cx= x-cl/2;break; - } - /* check if the string is completely out of the minx,miny,maxx,maxy frame */ - if ( cy >= miny && cy <= maxy && cx <= maxx && cx+cl -1 >= minx ) { - if ( can_split && cy < maxy ) { - /* if partially out of screen, try to split the sub-message */ - if ( cx < minx ) split = TCOD_console_forward_utf(c, align == TCOD_CENTER ? cl-2*(minx-cx) : cl-(minx-cx)); - else if ( align==TCOD_CENTER ) { - if ( cx + cl/2 > maxx+1 ) split = TCOD_console_forward_utf(c, maxx+1 - cx); - } else { - if ( cx + cl > maxx+1 ) split = TCOD_console_forward_utf(c, maxx+1 - cx); - } - } - if ( split ) { - wchar_t *oldsplit=split; - while ( ! iswspace(*split) && split > c ) split --; - if (end) *end='\n'; - if (!iswspace(*split) ) { - split=oldsplit; - } - end=split; - bak=*split; - *split=0; - cl=TCOD_console_stringLength_utf(c); - switch (align) { - case TCOD_LEFT : cx=x; break; - case TCOD_RIGHT : cx=x-cl+1; break; - case TCOD_CENTER : cx= x-cl/2;break; - } - } - if ( cx < minx ) { - /* truncate left part */ - c += minx-cx; - cl -= minx-cx; - cx=minx; - } - if ( cx + cl > maxx+1 ) { - /* truncate right part */ - split = TCOD_console_forward_utf(c, maxx+1 - cx); - *split=0; - } - /* render the sub-message */ - if ( cy >= 0 && cy < dat->h ) - while (*c) { - if ( *c >= TCOD_COLCTRL_1 && *c <= TCOD_COLCTRL_NUMBER ) { - dat->fore=color_control_fore[(int)(*c)-1]; - dat->back=color_control_back[(int)(*c)-1]; - } else if ( *c == TCOD_COLCTRL_FORE_RGB ) { - c++; - dat->fore.r=(uint8_t)(*c++); - dat->fore.g=(uint8_t)(*c++); - dat->fore.b=(uint8_t)(*c); - } else if ( *c == TCOD_COLCTRL_BACK_RGB ) { - c++; - dat->back.r=(uint8_t)(*c++); - dat->back.g=(uint8_t)(*c++); - dat->back.b=(uint8_t)(*c); - } else if ( *c == TCOD_COLCTRL_STOP ) { - dat->fore=oldFore; - dat->back=oldBack; - } else { - if (! count_only) TCOD_console_put_char(con,cx,cy,(int)(*c),flag); - cx++; - } - c++; - } - } - if ( end ) { - /* next line */ - if ( split && ! iswspace(bak) ) { - *end=bak; - c=end; - } else { - c=end+1; - } - cy++; - } else c=NULL; - } while ( c && cy < dat->h && (rh == 0 || cy < y+rh) ); - return cy-y+1; -} - -void TCOD_console_print_utf(TCOD_console_t con,int x, int y, const wchar_t *fmt, ...) { - va_list ap; - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT ( dat != NULL ) return; - va_start(ap,fmt); - TCOD_console_print_internal_utf(con,x,y,0,0,dat->bkgnd_flag,dat->alignment, - TCOD_console_vsprint_utf(fmt,ap), false, false); - va_end(ap); -} - -void TCOD_console_print_ex_utf(TCOD_console_t con,int x, int y, - TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...) { - va_list ap; - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT ( dat != NULL ) return; - va_start(ap,fmt); - TCOD_console_print_internal_utf(con,x,y,0,0,flag,alignment,TCOD_console_vsprint_utf(fmt,ap), false, false); - va_end(ap); -} - -int TCOD_console_print_rect_utf(TCOD_console_t con,int x, int y, int w, int h, - const wchar_t *fmt, ...) { - int ret; - va_list ap; - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT ( dat != NULL ) return 0; - va_start(ap,fmt); - ret = TCOD_console_print_internal_utf(con,x,y,w,h,dat->bkgnd_flag,dat->alignment, - TCOD_console_vsprint_utf(fmt,ap), true, false); - va_end(ap); - return ret; -} - -int TCOD_console_print_rect_ex_utf(TCOD_console_t con,int x, int y, int w, int h, - TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...) { - int ret; - va_list ap; - va_start(ap,fmt); - ret=TCOD_console_print_internal_utf(con,x,y,w,h,flag,alignment,TCOD_console_vsprint_utf(fmt,ap), true, false); - va_end(ap); - return ret; -} - -int TCOD_console_get_height_rect_utf(TCOD_console_t con,int x, int y, int w, int h, const wchar_t *fmt, ...) { - int ret; - va_list ap; - va_start(ap,fmt); - ret = TCOD_console_print_internal_utf(con,x,y,w,h,TCOD_BKGND_NONE,TCOD_LEFT,TCOD_console_vsprint_utf(fmt,ap), true, true); - va_end(ap); - return ret; -} - -#endif -/** - * \brief Initialize the libtcod graphical engine. - * - * \param w The width in tiles. - * \param h The height in tiles. - * \param title The title for the window. - * \param fullscreen Fullscreen option. - * \param renderer Which renderer to use when rendering the console. - * - * You may want to call TCOD_console_set_custom_font BEFORE calling this - * function. By default this function loads libtcod's `terminal.png` image - * from the working directory. - */ -void TCOD_console_init_root(int w, int h, const char*title, bool fullscreen, TCOD_renderer_t renderer) { - TCOD_IF(w > 0 && h > 0) { - TCOD_console_data_t *con=(TCOD_console_data_t *)calloc(sizeof(TCOD_console_data_t),1); - int i; - con->w=w; - con->h=h; - TCOD_ctx.root=con; -#ifndef TCOD_BARE - TCOD_ctx.renderer=renderer; -#endif - for (i=0; i < TCOD_COLCTRL_NUMBER; i++) { - color_control_fore[i]=TCOD_white; - color_control_back[i]=TCOD_black; - } - TCOD_console_init((TCOD_console_t)con,title,fullscreen); - } -} - -static void TCOD_console_data_alloc(TCOD_console_data_t *dat) { - dat->ch_array = (int *)calloc(sizeof(int), dat->w*dat->h); - dat->fg_colors = TCOD_image_new(dat->w, dat->h); - dat->bg_colors = TCOD_image_new(dat->w, dat->h); -} - -bool TCOD_console_init(TCOD_console_t con,const char *title, bool fullscreen) { - int i; - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL) return false; - dat->fore=TCOD_white; - dat->back=TCOD_black; - - TCOD_console_data_alloc(dat); - - dat->bkgnd_flag=TCOD_BKGND_NONE; - dat->alignment=TCOD_LEFT; - for (i=0; i< dat->w*dat->h; i++) { - dat->ch_array[i] = ' '; - } - if ( title ) { - if (! TCOD_sys_init(dat, fullscreen) ) return false; - TCOD_sys_set_window_title(title); - } - return true; -} - -void TCOD_console_set_default_foreground(TCOD_console_t con,TCOD_color_t col) { - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL) return; - dat->fore=col; -} - -void TCOD_console_set_default_background(TCOD_console_t con,TCOD_color_t col) { - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL) return; - dat->back=col; -} - -TCOD_color_t TCOD_console_get_default_foreground(TCOD_console_t con) { - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL) return TCOD_white; - return dat->fore; -} - -TCOD_color_t TCOD_console_get_default_background(TCOD_console_t con) { - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL) return TCOD_black; - return dat->back; -} - -int TCOD_console_get_width(TCOD_console_t con) { - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL) return 0; - return dat->w; -} - -int TCOD_console_get_height(TCOD_console_t con) { - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL) return 0; - return dat->h; -} - -TCOD_image_t TCOD_console_get_foreground_color_image(TCOD_console_t con) { - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL) return NULL; - return dat->fg_colors; -} - -TCOD_image_t TCOD_console_get_background_color_image(TCOD_console_t con) { - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL) return NULL; - return dat->bg_colors; -} -/** - * \brief Set a font image to be loaded during initialization. - * - * \param fontFile The path to a font image. - * \param flags A TCOD_font_flags_t bit-field describing the font image - * contents. - * \param nb_char_horiz The number of columns in the font image. - * \param nb_char_vertic The number of rows in the font image. - * - * `fontFile` will be case-sensitive depending on the platform. - */ -void TCOD_console_set_custom_font(const char *fontFile, int flags,int nb_char_horiz, int nb_char_vertic) { - TCOD_sys_set_custom_font(fontFile, nb_char_horiz, nb_char_vertic, flags); -} -/** - * \brief Remap a character code to a tile. - * - * \param asciiCode Character code to modify. - * \param fontCharX X tile-coordinate, starting from the left at zero. - * \param fontCharY Y tile-coordinate, starting from the top at zero. - * - * X,Y parameters are the coordinate of the tile, not pixel-coordinates. - */ -void TCOD_console_map_ascii_code_to_font(int asciiCode, int fontCharX, int fontCharY) { - /* cannot change mapping before initRoot is called */ - TCOD_IFNOT(TCOD_ctx.root != NULL) return; - TCOD_sys_map_ascii_to_font(asciiCode, fontCharX, fontCharY); -} -/** - * \brief Remap a series of character codes to a row of tiles. - * - * \param asciiCode The starting character code. - * \param nbCodes Number of character codes to assign. - * \param fontCharX First X tile-coordinate, starting from the left at zero. - * \param fontCharY First Y tile-coordinate, starting from the top at zero. - * - * This function always assigns tiles in row-major order, even if the - * TCOD_FONT_LAYOUT_ASCII_INCOL flag was set. - */ -void TCOD_console_map_ascii_codes_to_font(int asciiCode, int nbCodes, int fontCharX, int fontCharY) { - int c; - /* cannot change mapping before initRoot is called */ - TCOD_IFNOT(TCOD_ctx.root != NULL) return; - TCOD_IFNOT(asciiCode >= 0 && asciiCode+nbCodes <= TCOD_ctx.max_font_chars) return; - for (c=asciiCode; c < asciiCode+nbCodes; c++ ) { - TCOD_sys_map_ascii_to_font(c, fontCharX, fontCharY); - fontCharX++; - if ( fontCharX == TCOD_ctx.fontNbCharHoriz ) { - fontCharX=0; - fontCharY++; - } - } -} -/** - * \brief Remap a string of character codes to a row of tiles. - * - * \param s A null-terminated string. - * \param fontCharX First X tile-coordinate, starting from the left at zero. - * \param fontCharY First Y tile-coordinate, starting from the top at zero. - * - * This function always assigns tiles in row-major order, even if the - * TCOD_FONT_LAYOUT_ASCII_INCOL flag was set. - */ -void TCOD_console_map_string_to_font(const char *s, int fontCharX, int fontCharY) { - TCOD_IFNOT(s != NULL) return; - /* cannot change mapping before initRoot is called */ - TCOD_IFNOT(TCOD_ctx.root != NULL) return; - while (*s) { - TCOD_console_map_ascii_code_to_font(*s, fontCharX, fontCharY); - fontCharX++; - if ( fontCharX == TCOD_ctx.fontNbCharHoriz ) { - fontCharX=0; - fontCharY++; - } - s++; - } -} - -bool TCOD_console_is_key_pressed(TCOD_keycode_t key) { - return TCOD_sys_is_key_pressed(key); -} -void TCOD_console_set_key_color(TCOD_console_t con,TCOD_color_t col) { - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL) return; - TCOD_image_set_key_color(dat->bg_colors, col); -} - -void TCOD_console_credits(void) { - bool end=false; - int x=TCOD_console_get_width(NULL)/2-6; - int y=TCOD_console_get_height(NULL)/2; - int fade=260; - TCOD_sys_save_fps(); - TCOD_sys_set_fps(25); - while (!end ) { - TCOD_key_t k; - end=TCOD_console_credits_render(x,y,false); - TCOD_sys_check_for_event(TCOD_EVENT_KEY_PRESS,&k,NULL); - if ( fade == 260 && k.vk != TCODK_NONE ) { - fade -= 10; - } - TCOD_console_flush(); - if ( fade < 260 ) { - fade -= 10; - TCOD_console_set_fade(fade,TCOD_black); - if ( fade == 0 ) end=true; - } - } - TCOD_console_set_fade(255,TCOD_black); - TCOD_sys_restore_fps(); -} - -static bool init2=false; - -void TCOD_console_credits_reset(void) { - init2=false; -} - -bool TCOD_console_credits_render(int x, int y, bool alpha) { - static char poweredby[128]; - static float char_heat[128]; - static int char_x[128]; - static int char_y[128]; - static bool init1=false; - static int len,len1,cw=-1,ch=-1; - static float xstr; - static TCOD_color_t colmap[64]; - static TCOD_color_t colmap_light[64]; - static TCOD_noise_t noise; - static TCOD_color_t colkeys[4] = { - {255,255,204}, - {255,204,0}, - {255,102,0}, - {102,153,255}, - }; - static TCOD_color_t colkeys_light[4] = { - {255,255,204}, - {128,128,77}, - {51,51,31}, - {0,0,0}, - }; - static int colpos[4]={ - 0,21,42,63 - }; - static TCOD_image_t img=NULL; - int i,xc,yc,xi,yi,j; - static int left,right,top,bottom; - float sparklex,sparkley,sparklerad,sparklerad2,noisex; - /* mini particule system */ -#define MAX_PARTICULES 50 - static float pheat[MAX_PARTICULES]; - static float px[MAX_PARTICULES],py[MAX_PARTICULES], pvx[MAX_PARTICULES],pvy[MAX_PARTICULES]; - static int nbpart=0, firstpart=0; - static float partDelay=0.1f; - float elapsed=TCOD_sys_get_last_frame_length(); - TCOD_color_t fbackup; /* backup fg color */ - - if (!init1) { - /* initialize all static data, colormaps, ... */ - TCOD_color_t col; - TCOD_color_gen_map(colmap,4,colkeys,colpos); - TCOD_color_gen_map(colmap_light,4,colkeys_light,colpos); - sprintf(poweredby,"Powered by\n%s",version_string); - noise=TCOD_noise_new(1,TCOD_NOISE_DEFAULT_HURST,TCOD_NOISE_DEFAULT_LACUNARITY,NULL); - len=(int)strlen(poweredby); - len1=11; /* sizeof "Powered by\n" */ - left=MAX(x-4,0); - top=MAX(y-4,0); - col= TCOD_console_get_default_background(NULL); - TCOD_console_set_default_background(NULL,TCOD_black); - TCOD_console_set_default_background(NULL,col); - init1=true; - } - if (!init2) { - /* reset the credits vars ... */ - int curx,cury; - xstr=-4.0f; - curx=x; - cury=y; - for (i=0; i < len ;i++) { - char_heat[i]=-1; - char_x[i]=curx; - char_y[i]=cury; - curx++; - if ( poweredby[i] == '\n' ) { - curx=x; - cury++; - } - } - nbpart=firstpart=0; - init2=true; - } - if (TCOD_console_get_width(NULL) != cw || TCOD_console_get_height(NULL)!=ch) { - /* console size has changed */ - int width,height; - cw=TCOD_console_get_width(NULL); - ch=TCOD_console_get_height(NULL); - right=MIN(x+len,cw-1); - bottom=MIN(y+6,ch-1); - width=right - left + 1; - height=bottom - top + 1; - if ( img ) TCOD_image_delete(img); - img = TCOD_image_new(width*2,height*2); - } - fbackup=TCOD_console_get_default_foreground(NULL); - if ( xstr < (float)len1 ) { - sparklex=x+xstr; - sparkley=(float)y; - } else { - sparklex=x-len1+xstr; - sparkley=(float)y+1; - } - noisex=xstr*6; - sparklerad=3.0f+2*TCOD_noise_get(noise,&noisex); - if ( xstr >= len-1 ) sparklerad -= (xstr-len+1)*4.0f; - else if ( xstr < 0.0f ) sparklerad += xstr*4.0f; - else if ( poweredby[ (int)(xstr+0.5f) ] == ' ' || poweredby[ (int)(xstr+0.5f) ] == '\n' ) sparklerad/=2; - sparklerad2=sparklerad*sparklerad*4; - - /* draw the light */ - for (xc=left*2,xi=0; xc < (right+1)*2; xc++,xi++) { - for (yc=top*2,yi=0; yc < (bottom+1)*2; yc++,yi++) { - float dist=((xc-2*sparklex)*(xc-2*sparklex)+(yc-2*sparkley)*(yc-2*sparkley)); - TCOD_color_t pixcol; - if ( sparklerad >= 0.0f && dist < sparklerad2 ) { - int colidx=63-(int)(63*(sparklerad2-dist)/sparklerad2) + TCOD_random_get_int(NULL,-10,10); - colidx=CLAMP(0,63,colidx); - pixcol=colmap_light[colidx]; - } else { - pixcol=TCOD_black; - } - if ( alpha ) { - /* console cells have following flag values : - 1 2 - 4 8 - flag indicates which subcell uses foreground color */ - static int asciiToFlag[] = { - 1, /* TCOD_CHAR_SUBP_NW */ - 2, /* TCOD_CHAR_SUBP_NE */ - 3, /* TCOD_CHAR_SUBP_N */ - 8, /* TCOD_CHAR_SUBP_SE */ - 9, /* TCOD_CHAR_SUBP_DIAG */ - 10, /* TCOD_CHAR_SUBP_E */ - 4, /* TCOD_CHAR_SUBP_SW */ - }; - int conc= TCOD_console_get_char(NULL,xc/2,yc/2); - TCOD_color_t bk=TCOD_console_get_char_background(NULL,xc/2,yc/2); - if ( conc >= TCOD_CHAR_SUBP_NW && conc <= TCOD_CHAR_SUBP_SW ) { - /* merge two subcell chars... - get the flag for the existing cell on root console */ - int bkflag=asciiToFlag[conc - TCOD_CHAR_SUBP_NW ]; - int xflag = (xc & 1); - int yflag = (yc & 1); - /* get the flag for the current subcell */ - int credflag = (1+3*yflag) * (xflag+1); - if ( (credflag & bkflag) != 0 ) { - /* the color for this subcell on root console - is foreground, not background */ - bk = TCOD_console_get_char_foreground(NULL,xc/2,yc/2); - } - } - pixcol.r = MIN(255,(int)(bk.r)+pixcol.r); - pixcol.g = MIN(255,(int)(bk.g)+pixcol.g); - pixcol.b = MIN(255,(int)(bk.b)+pixcol.b); - } - TCOD_image_put_pixel(img,xi,yi,pixcol); - } - } - - /* draw and update the particules */ - j=nbpart;i=firstpart; - while (j > 0) { - int colidx=(int)(64*(1.0f-pheat[i])); - TCOD_color_t col; - colidx=MIN(63,colidx); - col=colmap[colidx]; - if ( (int)py[i]< (bottom-top+1)*2 ) { - int ipx = (int)px[i]; - int ipy = (int)py[i]; - float fpx = px[i]-ipx; - float fpy = py[i]-ipy; - TCOD_color_t col2=TCOD_image_get_pixel(img,ipx,ipy); - col2=TCOD_color_lerp(col,col2,0.5f*(fpx+fpy)); - TCOD_image_put_pixel(img,ipx,ipy,col2); - col2=TCOD_image_get_pixel(img,ipx+1,ipy); - col2=TCOD_color_lerp(col2,col,fpx); - TCOD_image_put_pixel(img,ipx+1,ipy,col2); - col2=TCOD_image_get_pixel(img,ipx,ipy+1); - col2=TCOD_color_lerp(col2,col,fpy); - TCOD_image_put_pixel(img,ipx,ipy+1,col2); - } else pvy[i]=-pvy[i] * 0.5f; - pvx[i] *= (1.0f-elapsed); - pvy[i] += (1.0f-pheat[i])*elapsed*300.0f; - px[i] += pvx[i]*elapsed; - py[i] += pvy[i]*elapsed; - pheat[i] -= elapsed*0.3f; - if ( pheat[i] < 0.0f ) { - firstpart = (firstpart+1)%MAX_PARTICULES; - nbpart--; - } - i = (i+1)%MAX_PARTICULES; - j--; - } - partDelay -= elapsed; - if ( partDelay < 0.0f && nbpart < MAX_PARTICULES && sparklerad > 2.0f ) { - /* fire a new particule */ - int lastpart = firstpart; - int nb=nbpart; - while (nb > 0 ) { - lastpart = ( lastpart + 1 )%MAX_PARTICULES; - nb--; - } - nbpart++; - px[lastpart] = 2*(sparklex-left); - py[lastpart] = 2*(sparkley-top)+2; - pvx[lastpart] = TCOD_random_get_float(NULL,-5.0f,5.0f); - pvy[lastpart] = TCOD_random_get_float(NULL,-0.5f, -15.0f); - pheat[lastpart] = 1.0f; - partDelay += 0.1f; - } - TCOD_image_blit_2x(img,NULL,left,top,0,0,-1,-1); - /* draw the text */ - for (i=0; i < len ;i++) { - if ( char_heat[i] >= 0.0f && poweredby[i]!='\n') { - int colidx=(int)(64*char_heat[i]); - TCOD_color_t col; - colidx=MIN(63,colidx); - col=colmap[colidx]; - if ( xstr >= len ) { - float coef=(xstr-len)/len; - if ( alpha ) { - TCOD_color_t fore=TCOD_console_get_char_background(NULL,char_x[i],char_y[i]); - int r=(int)(coef*fore.r + (1.0f-coef)*col.r); - int g=(int)(coef*fore.g + (1.0f-coef)*col.g); - int b=(int)(coef*fore.b + (1.0f-coef)*col.b); - col.r = CLAMP(0,255,r); - col.g = CLAMP(0,255,g); - col.b = CLAMP(0,255,b); - TCOD_console_set_char_foreground(NULL,char_x[i],char_y[i],col); - } else { - col=TCOD_color_lerp(col,TCOD_black,coef); - } - } - TCOD_console_set_char(NULL,char_x[i],char_y[i],poweredby[i]); - TCOD_console_set_char_foreground(NULL,char_x[i],char_y[i],col); - } - } - /* update letters heat */ - xstr += elapsed * 4; - for (i=0; i < (int)(xstr+0.5f); i++) { - char_heat[i]=(xstr-i)/(len/2); - } - /* restore fg color */ - TCOD_console_set_default_foreground(NULL,fbackup); - if ( xstr <= 2*len ) return false; - init2=false; - return true; -} - -static void TCOD_console_read_asc(TCOD_console_t con,FILE *f,int width, int height, float version) { - int x,y; - TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_IFNOT(dat != NULL) return; - while(fgetc(f) != '#'); - for(x = 0; x < width; x++) { - for(y = 0; y < height; y++) { - TCOD_color_t fore,back; - int c = fgetc(f); - fore.r = fgetc(f); - fore.g = fgetc(f); - fore.b = fgetc(f); - back.r = fgetc(f); - back.g = fgetc(f); - back.b = fgetc(f); - /* skip solid/walkable info */ - if ( version >= 0.3f ) { - fgetc(f); - fgetc(f); - } - TCOD_console_put_char_ex(con,x,y,c,fore,back); - } - } - fclose(f); -} - -static void TCOD_console_read_apf(TCOD_console_t con,FILE *f,int width, int height, float version) { -} - -static int string_ends_with(const char *str, const char *suffix) { - size_t str_len = strlen(str); - size_t suffix_len = strlen(suffix); - return - (str_len >= suffix_len) && - (0 == strcmp(str + (str_len-suffix_len), suffix)); -} - -TCOD_console_t TCOD_console_from_file(const char *filename) { - float version; - int width,height; - TCOD_console_t con; - FILE *f; - TCOD_IFNOT( filename != NULL ) { - return NULL; - } - if (string_ends_with(filename, ".xp")) { - return TCOD_console_from_xp(filename); - } - f=fopen(filename,"rb"); - TCOD_IFNOT( f!=NULL ) { - return NULL; - } - if (fscanf(f, "ASCII-Paint v%g", &version) != 1 ) { - fclose(f); - return NULL; - } - if (fscanf(f, "%i %i", &width, &height) != 2 ) { - fclose(f); - return NULL; - } - TCOD_IFNOT ( width > 0 && height > 0) { - fclose(f); - return NULL; - } - con=TCOD_console_new(width,height); - if (string_ends_with(filename, ".asc")) { - TCOD_console_read_asc(con,f,width,height,version); - } else { - TCOD_console_read_apf(con,f,width,height,version); - } - return con; -} - -bool TCOD_console_load_asc(TCOD_console_t pcon, const char *filename) { - float version; - int width,height; - FILE *f; - TCOD_console_data_t *con=pcon ? (TCOD_console_data_t *)pcon : TCOD_ctx.root; - TCOD_IFNOT(con != NULL) return false; - TCOD_IFNOT( filename != NULL ) { - return false; - } - f=fopen(filename,"rb"); - TCOD_IFNOT( f!=NULL ) { - return false; - } - if (fscanf(f, "ASCII-Paint v%g", &version) != 1 ) { - fclose(f); - return false; - } - if (fscanf(f, "%i %i", &width, &height) != 2 ) { - fclose(f); - return false; - } - TCOD_IFNOT ( width > 0 && height > 0) { - fclose(f); - return false; - } - if ( con->w != width || con->h != height ) { - /* resize console */ - TCOD_console_data_free(con); - con->w = width; - con->h = height; - TCOD_console_data_alloc(con); - } - TCOD_console_read_asc(con,f,width,height,version); - return true; -} - -bool TCOD_console_save_asc(TCOD_console_t pcon, const char *filename) { - static float version = 0.3f; - FILE *f; - int x,y; - TCOD_console_data_t *con=pcon ? (TCOD_console_data_t *)pcon : TCOD_ctx.root; - TCOD_IFNOT(con != NULL) return false; - TCOD_IFNOT( filename != NULL ) { - return false; - } - TCOD_IFNOT(con->w > 0 && con->h > 0) return false; - f=fopen(filename,"wb"); - TCOD_IFNOT( f != NULL ) return false; - fprintf(f, "ASCII-Paint v%g\n", version); - fprintf(f, "%i %i\n", con->w, con->h); - fputc('#', f); - for(x = 0; x < con->w; x++) { - for(y = 0; y < con->h; y++) { - TCOD_color_t fore,back; - int c=TCOD_console_get_char(con,x,y); - fore=TCOD_console_get_char_foreground(con,x,y); - back=TCOD_console_get_char_background(con,x,y); - fputc(c, f); - fputc(fore.r,f); - fputc(fore.g,f); - fputc(fore.b,f); - fputc(back.r,f); - fputc(back.g,f); - fputc(back.b,f); - fputc(0,f); /* solid */ - fputc(1,f); /* walkable */ - } - } - fclose(f); - return true; -} - -static bool hasDetectedBigEndianness = false; -static bool isBigEndian; -void detectBigEndianness(void) { - if (!hasDetectedBigEndianness){ - uint32_t Value32; - uint8_t *VPtr = (uint8_t *)&Value32; - VPtr[0] = VPtr[1] = VPtr[2] = 0; VPtr[3] = 1; - if(Value32 == 1) isBigEndian = true; - else isBigEndian = false; - hasDetectedBigEndianness = true; - } -} - -uint16_t bswap16(uint16_t s){ - uint8_t* ps = (uint8_t*)&s; - uint16_t res; - uint8_t* pres = (uint8_t*)&res; - pres[0] = ps[1]; - pres[1] = ps[0]; - return res; -} - -uint32_t bswap32(uint32_t s){ - uint8_t *ps=(uint8_t *)(&s); - uint32_t res; - uint8_t *pres=(uint8_t *)&res; - pres[0]=ps[3]; - pres[1]=ps[2]; - pres[2]=ps[1]; - pres[3]=ps[0]; - return res; -} - -uint16_t l16(uint16_t s){ - if (isBigEndian) return bswap16(s); else return s; -} - -uint32_t l32(uint32_t s){ - if (isBigEndian) return bswap32(s); else return s; -} - -/* fix the endianness */ -void fix16(uint16_t* u){ - *u = l16(*u); -} - -void fix32(uint32_t* u){ - *u = l32(*u); -} - -/************ RIFF helpers */ - -uint32_t fourCC(const char* c){ - return (*(uint32_t*)c); -} - -/* checks if u equals str */ -bool fourCCequals(uint32_t u, const char* str){ - return fourCC(str)==u; -} - -void fromFourCC(uint32_t u, char*s){ - const char* c = (const char*)(&u); - s[0]=c[0]; - s[1]=c[1]; - s[2]=c[2]; - s[3]=c[3]; - s[4]=0; -} - -void put8(uint8_t d, FILE* fp){ - fwrite(&d,1,1,fp); -} - -void put16(uint16_t d, FILE* fp){ - fwrite(&d,2,1,fp); -} - -void put32(uint32_t d, FILE* fp){ - fwrite(&d,4,1,fp); -} - -void putFourCC(const char* c, FILE* fp){ - put32(fourCC(c),fp); -} - -void putData(void* what, int length, FILE* fp){ - fwrite(what,length,1,fp); -} - -bool get8(uint8_t* u, FILE* fp){ - return 1==fread((void*)u, sizeof(uint8_t),1,fp); -} - -bool get16(uint16_t* u, FILE* fp){ - return 1==fread((void*)u, sizeof(uint16_t),1,fp); -} - -bool get32(uint32_t* u, FILE* fp){ - return 1==fread((void*)u, sizeof(uint32_t),1,fp); -} - -bool getData(void* u, size_t sz, FILE* fp){ - return 1==fread(u, sz,1,fp); -} - - -/********* APF RIFF structures */ - -typedef struct { - uint32_t show_grid; - uint32_t grid_width; - uint32_t grid_height; -} SettingsDataV1; - -#define FILTER_TYPE_UNCOMPRESSED 0 -#define FORMAT_TYPE_CRGBRGB 0 - -typedef struct { - uint32_t width; - uint32_t height; - uint32_t filter; - uint32_t format; -} ImageDetailsV1; - -/* Layers */ - -typedef struct { - uint32_t name; - uint32_t mode; - uint32_t index; - uint32_t dataSize; -} LayerV1 ; - -typedef struct { - uint32_t name; - uint32_t mode; - uint32_t fgalpha; - uint32_t bgalpha; - uint32_t visible; - uint32_t index; - uint32_t dataSize; -} LayerV2; - -/* fix the endianness */ -void fixSettings(SettingsDataV1* s){ - fix32(&s->show_grid); - fix32(&s->grid_width); - fix32(&s->grid_height); -} - -void fixImage(ImageDetailsV1* v){ - fix32(&v->width); - fix32(&v->height); - fix32(&v->filter); - fix32(&v->format); -} - -void fixLayerv1(LayerV1* l){ - fix32(&l->mode); - fix32(&l->index); - fix32(&l->dataSize); -} - -void fixLayerv2(LayerV2* l){ - fix32(&l->mode); - fix32(&l->fgalpha); - fix32(&l->bgalpha); - fix32(&l->visible); - fix32(&l->index); - fix32(&l->dataSize); -} - - -/*********** ApfFile */ - -bool TCOD_console_save_apf(TCOD_console_t pcon, const char *filename) { - TCOD_console_data_t *con=pcon ? (TCOD_console_data_t *)pcon : TCOD_ctx.root; - FILE* fp ; - TCOD_IFNOT(con != NULL) return false; - detectBigEndianness(); - - fp = fopen(filename, "wb"); - if(fp == NULL) { - return false; - } - else { - int x,y; - uint32_t riffSize = 0; - uint32_t imgDetailsSize ; - SettingsDataV1 settingsData; - ImageDetailsV1 imgData; - fpos_t posRiffSize; - uint32_t settingsSz ; - uint32_t layerImageSize ; - uint32_t layerChunkSize ; - /* riff header*/ - putFourCC("RIFF",fp); - fgetpos(fp,&posRiffSize); - put32(0,fp); - - /* APF_ header */ - putFourCC("apf ",fp); - riffSize += 4; - - /* settings */ - settingsData.show_grid = 0; - settingsData.grid_width = 8; - settingsData.grid_height = 8; - settingsSz = sizeof(uint32_t) + sizeof settingsData; - putFourCC("sett",fp); - put32(l32(settingsSz),fp); - put32(l32(1),fp); - putData((void*)&settingsData,sizeof settingsData,fp); - if (settingsSz&1){ - put8(0,fp); - riffSize++; - } - riffSize += 4+4+settingsSz; - - /* image details */ - imgData.width = con->w; - imgData.height = con->h; - imgData.filter = 0; - imgData.format = 0; - imgDetailsSize = sizeof(uint32_t) + sizeof imgData; - putFourCC("imgd",fp); - put32(l32(imgDetailsSize),fp); - put32(l32(1),fp); - putData((void*)&imgData,sizeof imgData,fp); - if (imgDetailsSize&1){ - put8(0,fp); - riffSize++; - } - riffSize += 4+4+imgDetailsSize; - - /* now write the layers as a RIFF list - the first layer is the lowest layer - Assume imgData filter = uncompressed, and imgData format = CRGB */ - layerImageSize = imgData.width*imgData.height*7; - layerChunkSize = sizeof(uint32_t) /* version */ - + sizeof(LayerV2) /* header */ - + layerImageSize; /* data */ - - putFourCC("layr",fp); /* layer */ - put32(l32(layerChunkSize),fp); - /* VERSION -> */ - put32(l32(2),fp); - /* Data */ - putFourCC("LAY0",fp); - put32(l32(0),fp); - put32(l32(255),fp); - put32(l32(255),fp); - put32(l32(1),fp); - put32(l32(0),fp); - put32(l32(layerImageSize),fp); - - /* now write out the data */ - - for(x = 0; x < con->w; x++) { - for(y = 0; y < con->h; y++) { - TCOD_color_t fore,back; - int c=TCOD_console_get_char(con,x,y); - fore=TCOD_console_get_char_foreground(con,x,y); - back=TCOD_console_get_char_background(con,x,y); - put8(c, fp); - put8(fore.r,fp); - put8(fore.g,fp); - put8(fore.b,fp); - put8(back.r,fp); - put8(back.g,fp); - put8(back.b,fp); - } - } - - if (layerChunkSize&1){ - put8(0,fp); /* padding bit */ - riffSize++; - } - - riffSize += 2*sizeof(uint32_t)+layerChunkSize; - - fsetpos(fp,&posRiffSize); - put32(l32(riffSize),fp); - } - - fclose(fp); - return true; -} - -typedef struct { - LayerV1 headerv1; - LayerV2 headerv2; - uint8_t* data; /* dynamically allocated */ -} LayerData; - -typedef struct { - ImageDetailsV1 details; - SettingsDataV1 settings; - LayerData layer; -} Data; - -bool TCOD_console_load_apf(TCOD_console_t pcon, const char *filename) { - uint32_t sett = fourCC("sett"); - uint32_t imgd = fourCC("imgd"); - /* - uint32_t LIST = fourCC("LIST"); - uint32_t LAYR = fourCC("LAYR"); - */ - uint32_t layr = fourCC("layr"); - FILE* fp ; - Data data; - TCOD_console_data_t *con=pcon ? (TCOD_console_data_t *)pcon : TCOD_ctx.root; - TCOD_IFNOT(con != NULL) return false; - - detectBigEndianness(); - data.details.width = 1; - data.details.height = 1; - data.details.filter = 0; - data.details.format = 0; - - data.settings.show_grid = true; - data.settings.grid_width = 10; - data.settings.grid_height = 10; - - #define ERR(x) {printf("Error: %s\n. Aborting operation.",x); return false;} - #define ERR_NEWER(x) {printf("Error: It looks like this file was made with a newer version of Ascii-Paint\n. In particular the %s field. Aborting operation.",x); return false;} - - fp = fopen(filename, "rb"); - if(fp == NULL) { - printf("The file %s could not be loaded.\n", filename); - return false; - } - else { - /* read the header */ - uint32_t riff; - uint32_t riffSize; - int index = 0; - int x,y; - uint8_t *imgData; - bool keepGoing = true; - if (! get32(&riff,fp) || ! fourCCequals(riff,"RIFF")){ - ERR("File doesn't have a RIFF header"); - } - if (!get32(&riffSize,fp)) ERR("No RIFF size field!"); - fix32(&riffSize); - - while(keepGoing && fp){ /* for each subfield, try to find the APF_ field */ - uint32_t apf; - if (! get32(&apf,fp)) break; - if (fourCCequals(apf,"apf ") || fourCCequals(apf,"APF ")){ - /* Process APF segment */ - while(keepGoing && fp){ - uint32_t seg; - if (! get32(&seg,fp)){ - keepGoing = false; - break; - } - else { - if (seg==sett){ - /* size */ - uint32_t sz; - uint32_t ver; - SettingsDataV1 settingsData; - - get32(&sz,fp); - fix32(&sz); - /* version */ - get32(&ver,fp); - fix32(&ver); - if (ver!=1) ERR_NEWER("settings"); - /* ver must be 1 */ - if (! getData((void*)&settingsData,sizeof settingsData,fp)) ERR("Can't read settings."); - data.settings = settingsData; - fixSettings(&data.settings); - - } - else if (seg==imgd){ - /* sz */ - uint32_t sz; - uint32_t ver; - ImageDetailsV1 dets; - - get32(&sz,fp); - fix32(&sz); - /* version */ - get32(&ver,fp); - fix32(&ver); - if (ver!=1) ERR_NEWER("image details"); - /* ver must be 1 */ - if (! getData((void*)&dets, sizeof dets, fp)) ERR("Can't read image details."); - data.details = dets; - fixImage(&data.details); - - /* get canvas ready */ - TCOD_IFNOT ( data.details.width > 0 && data.details.height > 0) { - fclose(fp); - return false; - } - if ( con->w != data.details.width || con->h != data.details.height ) { - /* resize console */ - TCOD_console_data_free(con); - con->w = data.details.width; - con->h = data.details.height; - TCOD_console_data_alloc(con); - } - - } - else if (seg==layr){ - uint32_t sz; - uint32_t ver; - - get32(&sz,fp); - fix32(&sz); - /* version */ - get32(&ver,fp); - fix32(&ver); - if (ver>2) ERR_NEWER("layer spec"); - - if (ver==1){ - if (! getData((void*)&data.layer.headerv1, sizeof( LayerV1 ), fp)) ERR("Can't read layer header."); - fixLayerv1(&data.layer.headerv1); - - /* Read in the data chunk*/ - data.layer.data = (uint8_t*)malloc(sizeof(uint8_t)*data.layer.headerv1.dataSize); - getData((void*) data.layer.data, data.layer.headerv1.dataSize, fp); - } - else if (ver==2){ - if (! getData((void*)&data.layer.headerv2, sizeof( LayerV2 ), fp)) ERR("Can't read layer header."); - fixLayerv2(&data.layer.headerv2); - - /* Read in the data chunk */ - data.layer.data = (uint8_t*)malloc(sizeof(uint8_t)*data.layer.headerv2.dataSize); - getData((void*) data.layer.data, data.layer.headerv2.dataSize, fp); - - } - } - else { - /* skip unknown segment */ - uint32_t sz; - get32(&sz,fp); - fix32(&sz); - fseek(fp,sz,SEEK_CUR); - } - } - } - - /* we're done! */ - keepGoing = false; - } - else { - /* skip this segment */ - uint32_t sz; - get32(&sz,fp); - fseek(fp,sz,SEEK_CUR); - } - } - - imgData = data.layer.data; - for(x = 0; x < con->w; x++) { - for(y = 0; y < con->h; y++) { - TCOD_color_t fore,back; - int c = (unsigned char)(imgData[index++]); - fore.r = (uint8_t)(imgData[index++]); - fore.g = (uint8_t)(imgData[index++]); - fore.b = (uint8_t)(imgData[index++]); - back.r = (uint8_t)(imgData[index++]); - back.g = (uint8_t)(imgData[index++]); - back.b = (uint8_t)(imgData[index++]); - TCOD_console_put_char_ex(con,x,y,c,fore,back); - } - } - - free (data.layer.data); - } - fclose(fp); - - return true; -} -/* - -bool ApfFile::Load(std::string filename){ - detectBigEndianness(); - - uint32_t sett = fourCC("sett"); - uint32_t imgd = fourCC("imgd"); - uint32_t LIST = fourCC("LIST"); - uint32_t LAYR = fourCC("LAYR"); - uint32_t layr = fourCC("layr"); - - Data data; // File data - - data.details.width = 1; - data.details.height = 1; - data.details.filter = FILTER_TYPE_UNCOMPRESSED; - data.details.format = FORMAT_TYPE_CRGBRGB; - - data.settings.show_grid = true; - data.settings.grid_width = 10; - data.settings.grid_height = 10; - - data.currentLayer = NULL; - - #define ERR(x) {printf("Error: %s\n. Aborting operation.",x); return false;} - #define ERR_NEWER(x) {printf("Error: It looks like this file was made with a newer version of Ascii-Paint\n. In particular the %s field. Aborting operation.",x); return false;} - - FILE* fp = fopen(filename.c_str(), "rb"); - if(fp == NULL) { - printf("The file %s could not be loaded.\n", filename.c_str()); - return false; - } - else { - // read the header - uint32_t riff; - if (not get32(&riff,fp) - or - not fourCCequals(riff,"RIFF")){ - ERR("File doesn't have a RIFF header"); - } - // else - uint32_t riffSize; - if (!get32(&riffSize,fp)) ERR("No RIFF size field!"); - fix(&riffSize); - - bool keepGoing = true; - while(keepGoing and fp){ // for each subfield, try to find the APF_ field - uint32_t apf; - if (not get32(&apf,fp)) break; - if (fourCCequals(apf,"apf ") or fourCCequals(apf,"APF ")){ - // Process APF segment - while(keepGoing and fp){ - uint32_t seg; - if (not get32(&seg,fp)){ - keepGoing = false; - break; - } - else { - if (seg==sett){ - // size - uint32_t sz; - get32(&sz,fp); - fix(&sz); - // version - uint32_t ver; - get32(&ver,fp); - fix(&ver); - if (ver!=1) ERR_NEWER("settings"); - // ver must be 1 - SettingsDataV1 settingsData; - if (not getData((void*)&settingsData,sizeof settingsData,fp)) ERR("Can't read settings."); - data.settings = settingsData; - fix(&data.settings); - - // Change app settings - app->setGridDimensions(data.settings.grid_width,data.settings.grid_height); - app->setShowGrid(data.settings.show_grid==1); - } - else if (seg==imgd){ - // sz - uint32_t sz; - get32(&sz,fp); - fix(&sz); - // version - uint32_t ver; - get32(&ver,fp); - fix(&ver); - if (ver!=1) ERR_NEWER("image details"); - // ver must be 1 - ImageDetailsV1 dets; - if (not getData((void*)&dets, sizeof dets, fp)) ERR("Can't read image details."); - data.details = dets; - fix(&data.details); - - // get canvas ready - app->canvasWidth = data.details.width; - app->canvasHeight = data.details.height; - app->initCanvas(); - - // delete new layer - app->deleteLayer(app->getCurrentLayer()->name); - - } - else if (seg==layr){ - // printf("Found a layer\n"); - - // sz - uint32_t sz; - get32(&sz,fp); - fix(&sz); - // version - uint32_t ver; - get32(&ver,fp); - fix(&ver); - if (ver>2) ERR_NEWER("layer spec"); - - if (ver==1){ - LayerV1 layerHeader; - if (not getData((void*)&layerHeader, sizeof layerHeader, fp)) ERR("Can't read layer header."); - fix(&layerHeader); - - // creat new layer data - LayerData* ld = new LayerData; - ld->header = layerHeader; // already fix'd - ld->data = new uint8[ld->header.dataSize]; - - // Read in the data chunk - getData((void*) ld->data, ld->header.dataSize, fp); - - // push layer onto the list - data.currentLayer = ld; - data.layers.push(ld); - } - else if (ver==2){ - LayerV2 layerHeader; - if (not getData((void*)&layerHeader, sizeof layerHeader, fp)) ERR("Can't read layer header."); - fix(&layerHeader); - - // creat new layer data - LayerData* ld = new LayerData; - ld->header = layerHeader; // already fix'd - ld->data = new uint8[ld->header.dataSize]; - - // Read in the data chunk - getData((void*) ld->data, ld->header.dataSize, fp); - - // push layer onto the list - data.currentLayer = ld; - data.layers.push(ld); - } - } - else { - // skip unknown segment - uint32_t sz; - get32(&sz,fp); - fix(&sz); - fseek(fp,sz,SEEK_CUR); - } - } - } - - // we're done! - keepGoing = false; - } - else { - // skip this segment - uint32_t sz; - get32(&sz,fp); - fseek(fp,sz,SEEK_CUR); - } - } - - // finally, copy the layers into the current document - for(int i=0;iaddNewLayer(); - - // Parse layer header - l->name = fromFourCC(ld->header.name); - l->fgalpha = ld->header.fgalpha; - l->bgalpha = ld->header.bgalpha; - l->visible = (ld->header.visible==1); - // l->compositingMode = - - // Copy data into currently selected canvas - uint8_t* imgData = ld->data; - CanvasImage *img = new CanvasImage; - // Write the brush data for every brush in the image - int index = 0; - for(int x = 0; x < app->canvasWidth; x++) { - for(int y = 0; y < app->canvasHeight; y++) { - Brush b; - b.symbol = (unsigned char)(imgData[index++]); - b.fore.r = (uint8_t)(imgData[index++]); - b.fore.g = (uint8_t)(imgData[index++]); - b.fore.b = (uint8_t)(imgData[index++]); - b.back.r = (uint8_t)(imgData[index++]); - b.back.g = (uint8_t)(imgData[index++]); - b.back.b = (uint8_t)(imgData[index++]); - b.solid = true; // deprecated - b.walkable = true; // deprecated - img->push_back(b); - } - } - - app->setCanvasImage(*img); - delete img; - } - - // then free all the temporary layer data - for(int i=0;idata; - delete data.layers.get(i); - } - - // and update the layer widget - app->gui->layerWidget->regenerateLayerList(); - } - fclose(fp); - - return true; -} -*/ - -#endif /* TCOD_CONSOLE_SUPPORT */ diff --git a/tcod_sys/libtcod/src/fov.cpp b/tcod_sys/libtcod/src/fov.cpp deleted file mode 100644 index c04214fad..000000000 --- a/tcod_sys/libtcod/src/fov.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -TCODMap::TCODMap(int width,int height) { - data = TCOD_map_new(width,height); -} - -void TCODMap::clear(bool transparent, bool walkable) { - TCOD_map_clear(data,transparent,walkable); -} - -void TCODMap::setProperties(int x, int y, bool isTransparent, bool isWalkable) { - TCOD_map_set_properties(data,x,y,isTransparent,isWalkable); -} - -void TCODMap::copy(const TCODMap *source) { - TCOD_map_copy(source->data,data); -} - -void TCODMap::computeFov(int x, int y, int maxRadius, bool light_walls, TCOD_fov_algorithm_t algo) { - TCOD_map_compute_fov(data,x,y,maxRadius,light_walls, algo); -} - -bool TCODMap::isInFov(int x, int y) const { - return TCOD_map_is_in_fov(data,x,y) != 0; -} - -void TCODMap::setInFov(int x,int y, bool fov) { - TCOD_map_set_in_fov(data, x, y, fov); -} - -bool TCODMap::isTransparent(int x, int y) const { - return TCOD_map_is_transparent(data,x,y) != 0; -} - -bool TCODMap::isWalkable(int x, int y) const { - return TCOD_map_is_walkable(data,x,y) != 0; -} - -int TCODMap::getWidth() const { - return TCOD_map_get_width(data); -} - -int TCODMap::getHeight() const { - return TCOD_map_get_height(data); -} - -int TCODMap::getNbCells() const { - return TCOD_map_get_nb_cells(data); -} - -TCODMap::~TCODMap() { - TCOD_map_delete(data); -} diff --git a/tcod_sys/libtcod/src/fov_c.c b/tcod_sys/libtcod/src/fov_c.c deleted file mode 100644 index 553e8ab29..000000000 --- a/tcod_sys/libtcod/src/fov_c.c +++ /dev/null @@ -1,150 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include - -#include - -TCOD_map_t TCOD_map_new(int width, int height) { - map_t *map=NULL; - TCOD_IFNOT(width > 0 && height > 0) return NULL; - map=(map_t *)calloc(sizeof(map_t),1); - map->width=width; - map->height=height; - map->nbcells=width*height; - map->cells=(cell_t *)calloc(sizeof(cell_t),map->nbcells); - return map; -} - -void TCOD_map_copy(TCOD_map_t source, TCOD_map_t dest) { - map_t *source_int = (map_t *)source; - map_t *dest_int = (map_t *)dest; - TCOD_IFNOT(source != NULL && dest != NULL) return; - if ( dest_int->nbcells != source_int->nbcells ) { - free(dest_int->cells); - dest_int->cells=(cell_t *)malloc(sizeof(cell_t)*dest_int->nbcells); - } - dest_int->width=source_int->width; - dest_int->height=source_int->height; - dest_int->nbcells=source_int->nbcells; - memcpy(dest_int->cells, source_int->cells, sizeof(cell_t) * source_int->nbcells); -} - -void TCOD_map_clear(TCOD_map_t map, bool transparent, bool walkable) { - int i; - map_t *m = (map_t *)map; - cell_t *cell; - TCOD_IFNOT(map != NULL) return; - cell=m->cells; - for (i = 0; i < m->nbcells; i++) { - cell->transparent = transparent; - cell->walkable = walkable; - cell->fov = 0; - cell++; - } -} - -void TCOD_map_set_properties(TCOD_map_t map, int x, int y, bool is_transparent, bool is_walkable) { - map_t *m = (map_t *)map; - TCOD_IFNOT(map != NULL) return; - TCOD_IFNOT((unsigned)x < (unsigned)m->width && (unsigned)y < (unsigned)m->height) return; - m->cells[x+y*m->width].transparent=is_transparent; - m->cells[x+y*m->width].walkable=is_walkable; -} - -void TCOD_map_delete(TCOD_map_t map) { - map_t *m = (map_t *)map; - TCOD_IFNOT(map != NULL) return; - free(m->cells); - free(m); -} - -void TCOD_map_compute_fov(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls, TCOD_fov_algorithm_t algo) { - TCOD_IFNOT(map != NULL) return; - switch(algo) { - case FOV_BASIC : TCOD_map_compute_fov_circular_raycasting(map,player_x,player_y,max_radius,light_walls); break; - case FOV_DIAMOND : TCOD_map_compute_fov_diamond_raycasting(map,player_x,player_y,max_radius,light_walls); break; - case FOV_SHADOW : TCOD_map_compute_fov_recursive_shadowcasting(map,player_x,player_y,max_radius,light_walls); break; - case FOV_PERMISSIVE_0 : - case FOV_PERMISSIVE_1 : - case FOV_PERMISSIVE_2 : - case FOV_PERMISSIVE_3 : - case FOV_PERMISSIVE_4 : - case FOV_PERMISSIVE_5 : - case FOV_PERMISSIVE_6 : - case FOV_PERMISSIVE_7 : - case FOV_PERMISSIVE_8 : - TCOD_map_compute_fov_permissive2(map,player_x,player_y,max_radius,light_walls, algo-FOV_PERMISSIVE_0); - break; - case FOV_RESTRICTIVE : TCOD_map_compute_fov_restrictive_shadowcasting(map,player_x,player_y,max_radius,light_walls); break; - default:break; - } -} - -bool TCOD_map_is_in_fov(TCOD_map_t map, int x, int y) { - map_t *m = (map_t *)map; - TCOD_IFNOT(map != NULL && (unsigned)x < (unsigned)m->width && (unsigned)y < (unsigned)m->height) return false; - return m->cells[x+y*m->width].fov == 1; -} - -void TCOD_map_set_in_fov(TCOD_map_t map, int x, int y, bool fov) { - map_t *m = (map_t *)map; - TCOD_IFNOT(map != NULL && (unsigned)x < (unsigned)m->width && (unsigned)y < (unsigned)m->height) return; - m->cells[x+y*m->width].fov = fov ? 1:0; -} - -bool TCOD_map_is_transparent(TCOD_map_t map, int x, int y) { - map_t *m = (map_t *)map; - TCOD_IFNOT(map != NULL && (unsigned)x < (unsigned)m->width && (unsigned)y < (unsigned)m->height) return false; - return m->cells[x+y*m->width].transparent; -} - -bool TCOD_map_is_walkable(TCOD_map_t map, int x, int y) { - map_t *m = (map_t *)map; - TCOD_IFNOT(map != NULL && (unsigned)x < (unsigned)m->width && (unsigned)y < (unsigned)m->height) return false; - return m->cells[x+y*m->width].walkable; -} -int TCOD_map_get_width(TCOD_map_t map) { - map_t *m = (map_t *)map; - TCOD_IFNOT(map != NULL) return 0; - return m->width; -} - -int TCOD_map_get_height(TCOD_map_t map) { - map_t *m = (map_t *)map; - TCOD_IFNOT(map != NULL) return 0; - return m->height; -} - -int TCOD_map_get_nb_cells(TCOD_map_t map) { - map_t *m = (map_t *)map; - TCOD_IFNOT(map != NULL) return 0; - return m->nbcells; -} diff --git a/tcod_sys/libtcod/src/fov_diamond_raycasting.c b/tcod_sys/libtcod/src/fov_diamond_raycasting.c deleted file mode 100644 index b02eefe5d..000000000 --- a/tcod_sys/libtcod/src/fov_diamond_raycasting.c +++ /dev/null @@ -1,207 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include - -#include -#include - -typedef struct _ray_data_t { - int xloc,yloc; /* position */ - int xob,yob; /* obscurity vector */ - int xerr,yerr; /* bresenham error */ - struct _ray_data_t * xinput, * yinput; /* offset of input rays */ - bool added; /* already in the fov */ - bool ignore; /* non visible. don't bother processing it */ -} ray_data_t; - -static int origx,origy; /* fov origin */ -static ray_data_t **raymap; /* result rays */ -static ray_data_t *raymap2; /* temporary rays */ -static int perimidx; - -static ray_data_t *new_ray(map_t *m,int x, int y) { - ray_data_t *r; - if ( (unsigned) (x+origx) >= (unsigned)m->width ) return NULL; - if ( (unsigned) (y+origy) >= (unsigned)m->height ) return NULL; - r=&raymap2[ x+origx + (y+origy)*m->width ]; - r->xloc=x; - r->yloc=y; - return r; -} - -static void processRay(map_t *m, TCOD_list_t perim, ray_data_t *new_ray, ray_data_t *input_ray) { - if ( new_ray ) { - int mapx=origx+new_ray->xloc; - int mapy=origy+new_ray->yloc; - int newrayidx; - newrayidx=mapx+mapy*m->width; - if ( new_ray->yloc == input_ray->yloc ) new_ray->xinput=input_ray; - else new_ray->yinput=input_ray; - if (! new_ray->added) { - TCOD_list_push(perim,new_ray); - new_ray->added=true; - raymap[newrayidx] = new_ray; - } - } -} - -#define IS_OBSCURE(r) ((r->xerr > 0 && r->xerr <= r->xob) || (r->yerr > 0 && r->yerr <= r->yob) ) - -static void process_x_input(ray_data_t *new_ray, ray_data_t *xinput) { - if ( xinput->xob == 0 && xinput->yob == 0 ) return; - if ( xinput->xerr > 0 && new_ray->xob == 0) { - new_ray->xerr = xinput->xerr - xinput->yob; - new_ray->yerr = xinput->yerr + xinput->yob; - new_ray->xob=xinput->xob; - new_ray->yob=xinput->yob; - } - if ( xinput->yerr <= 0 && xinput->yob > 0 && xinput->xerr > 0) { - new_ray->yerr = xinput->yerr + xinput->yob; - new_ray->xerr = xinput->xerr - xinput->yob; - new_ray->xob=xinput->xob; - new_ray->yob=xinput->yob; - } -} - -static void process_y_input(ray_data_t *new_ray, ray_data_t *yinput) { - if ( yinput->xob == 0 && yinput->yob == 0 ) return; - if ( yinput->yerr > 0 && new_ray->yob == 0) { - new_ray->yerr = yinput->yerr - yinput->xob; - new_ray->xerr = yinput->xerr + yinput->xob; - new_ray->xob=yinput->xob; - new_ray->yob=yinput->yob; - } - if ( yinput->xerr <= 0 && yinput->xob > 0 && yinput->yerr > 0) { - new_ray->yerr = yinput->yerr - yinput->xob; - new_ray->xerr = yinput->xerr + yinput->xob; - new_ray->xob=yinput->xob; - new_ray->yob=yinput->yob; - } -} - -static void merge_input(map_t *m, ray_data_t *r) { - int rayidx=r->xloc+origx+(r->yloc+origy)*m->width; - ray_data_t *xi=r->xinput; - ray_data_t *yi=r->yinput; - if ( xi ) process_x_input(r,xi); - if ( yi ) process_y_input(r,yi); - if ( ! xi ) { - if ( IS_OBSCURE(yi) ) r->ignore=true; - } else if ( ! yi ) { - if ( IS_OBSCURE(xi) ) r->ignore=true; - } else if ( IS_OBSCURE(xi) && IS_OBSCURE(yi) ) { - r->ignore=true; - } - if (! r->ignore && !m->cells[rayidx].transparent) { - r->xerr = r->xob = ABS(r->xloc); - r->yerr = r->yob = ABS(r->yloc); - } -} - -static void expandPerimeterFrom(map_t *m,TCOD_list_t perim,ray_data_t *r) { - if ( r->xloc >= 0 ) { - processRay(m,perim,new_ray(m,r->xloc+1,r->yloc),r); - } - if ( r->xloc <= 0 ) { - processRay(m,perim,new_ray(m,r->xloc-1,r->yloc),r); - } - if ( r->yloc >= 0 ) { - processRay(m,perim,new_ray(m,r->xloc,r->yloc+1),r); - } - if ( r->yloc <= 0 ) { - processRay(m,perim,new_ray(m,r->xloc,r->yloc-1),r); - } -} - - -void TCOD_map_compute_fov_diamond_raycasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls) { - map_t *m = (map_t *)map; - TCOD_list_t perim=TCOD_list_allocate(m->nbcells); - cell_t *c; - ray_data_t **r; - int nbcells; - int r2=max_radius*max_radius; - - perimidx=0; - raymap=(ray_data_t **)calloc(sizeof(ray_data_t*),m->nbcells); - raymap2=(ray_data_t *)calloc(sizeof(ray_data_t),m->nbcells); - origx=player_x; - origy=player_y; - expandPerimeterFrom(m,perim,new_ray(m,0,0)); - while ( perimidx < TCOD_list_size(perim) ) { - ray_data_t *ray=(ray_data_t *)TCOD_list_get(perim,perimidx); - int distance = 0; - if ( r2 > 0 ) distance = ((ray->xloc * ray->xloc) + (ray->yloc * ray->yloc)); - perimidx++; - if ( distance <= r2) { - merge_input(m, ray); - if ( !ray->ignore ) expandPerimeterFrom(m,perim,ray); - } else ray->ignore=true; - } - - /* set fov data */ - c=m->cells; - r=raymap; - nbcells=m->nbcells; - while ( nbcells!= 0 ) { - if ( *r == NULL || (*r)->ignore - || ((*r)->xerr > 0 && (*r)->xerr <= (*r)->xob ) - || ((*r)->yerr > 0 && (*r)->yerr <= (*r)->yob ) - ) { - c->fov=0; - } else { - c->fov=1; - } - c++; - r++; - nbcells--; - } - m->cells[origx+origy*m->width].fov=1; - - /* light walls */ - if ( light_walls ) { - int xmin=0, ymin=0, xmax=m->width, ymax=m->height; - if ( max_radius > 0 ) { - xmin=MAX(0,player_x-max_radius); - ymin=MAX(0,player_y-max_radius); - xmax=MIN(m->width,player_x+max_radius+1); - ymax=MIN(m->height,player_y+max_radius+1); - } - TCOD_map_postproc(m,xmin,ymin,player_x,player_y,-1,-1); - TCOD_map_postproc(m,player_x,ymin,xmax-1,player_y,1,-1); - TCOD_map_postproc(m,xmin,player_y,player_x,ymax-1,-1,1); - TCOD_map_postproc(m,player_x,player_y,xmax-1,ymax-1,1,1); - } - - free(raymap); - free(raymap2); - TCOD_list_delete(perim); -} diff --git a/tcod_sys/libtcod/src/heightmap_c.c b/tcod_sys/libtcod/src/heightmap_c.c deleted file mode 100644 index d8937f2ed..000000000 --- a/tcod_sys/libtcod/src/heightmap_c.c +++ /dev/null @@ -1,562 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include - -#include -#include - -#define GET_VALUE(hm,x,y) (hm)->values[(x)+(y)*(hm)->w] - -TCOD_heightmap_t *TCOD_heightmap_new(int w,int h) { - TCOD_heightmap_t *hm=(TCOD_heightmap_t *)malloc(sizeof(TCOD_heightmap_t)); - hm->values = (float *)calloc(sizeof(float),w*h); - hm->w=w; - hm->h=h; - return hm; -} -void TCOD_heightmap_delete(TCOD_heightmap_t *hm) { - free(hm->values); - free(hm); -} - -void TCOD_heightmap_clear(TCOD_heightmap_t *hm) { - memset(hm->values,0,hm->w*hm->h*sizeof(float)); -} - -float TCOD_heightmap_get_value(const TCOD_heightmap_t *hm, int x, int y) { - return GET_VALUE(hm,x,y); -} - -void TCOD_heightmap_set_value(TCOD_heightmap_t *hm, int x, int y, float value) { - GET_VALUE(hm,x,y)=value; -} - -void TCOD_heightmap_get_minmax(const TCOD_heightmap_t *hm, float *min, float *max) { - float curmax=hm->values[0]; - float curmin=hm->values[0]; - int x,y; - float *value = hm->values; - /* get max and min height */ - for (y=0; y < hm->h; y++) { - for (x=0; x < hm->w; x++) { - float val=*value; - if ( val > curmax ) curmax = val; - else if ( val < curmin ) curmin = val; - value++; - } - } - *min=curmin; - *max=curmax; -} - -void TCOD_heightmap_normalize(TCOD_heightmap_t *hm, float min, float max) { - float curmin,curmax; - int x,y; - float invmax; - float *value = hm->values; - TCOD_heightmap_get_minmax(hm,&curmin,&curmax); - if (curmax - curmin == 0.0f) invmax=0.0f; - else invmax = (max-min) / (curmax-curmin); - /* normalize */ - for (y=0; y < hm->h; y++) { - for (x=0; x < hm->w; x++) { - *value = min + (*value - curmin) * invmax ; - value++; - } - } -} -void TCOD_heightmap_add_hill(TCOD_heightmap_t *hm, float hx, float hy, float hradius, float hheight) { - int x,y; - float hradius2=hradius*hradius; - float coef=hheight / hradius2; - int minx=(int)MAX(0,hx-hradius); - int maxx=(int)MIN(hm->w,hx+hradius); - int miny=(int)MAX(0,hy-hradius); - int maxy=(int)MIN(hm->h,hy+hradius); - for (x=minx; x < maxx; x++) { - float xdist=( x - hx )*( x - hx ); - for (y=miny; y < maxy; y++) { - float z = hradius2 - xdist - (y - hy)*(y - hy); - if ( z > 0.0 ) GET_VALUE(hm,x,y) += z * coef; - } - } -} - -void TCOD_heightmap_dig_hill(TCOD_heightmap_t *hm, float hx, float hy, float hradius, float hheight) { - int x,y; - float hradius2=hradius*hradius; - float coef=hheight / hradius2; - int minx=(int)MAX(0,hx-hradius); - int maxx=(int)MIN(hm->w,hx+hradius); - int miny=(int)MAX(0,hy-hradius); - int maxy=(int)MIN(hm->h,hy+hradius); - for (x=minx; x < maxx; x++) { - float xdist=( x - hx )*( x - hx ); - for (y=miny; y < maxy; y++) { - float dist=xdist + (y - hy)*(y - hy); - if ( dist < hradius2 ) { - float z = (hradius2 - dist) * coef; - if ( hheight > 0.0 ) { - if ( GET_VALUE(hm,x,y) < z ) GET_VALUE(hm,x,y) = z; - } else { - if ( GET_VALUE(hm,x,y) > z ) GET_VALUE(hm,x,y) = z; - } - } - } - } -} - -void TCOD_heightmap_copy(const TCOD_heightmap_t *hm_source,TCOD_heightmap_t *hm_dest) { - if ( hm_source->w != hm_dest->w || hm_source->h != hm_dest->h) return; - memcpy(hm_dest->values,hm_source->values,sizeof(float)*hm_source->w*hm_source->h); -} - -void TCOD_heightmap_add_fbm(TCOD_heightmap_t *hm, TCOD_noise_t noise,float mulx, float muly, float addx, float addy, float octaves, float delta, float scale) { - int x,y; - float xcoef=mulx / hm->w; - float ycoef=muly / hm->h; - float min=1.0f; - float max=0.0f; - for (x=0; x < hm->w; x++) { - float f[2]; - int offset=x; - f[0] = (x + addx) * xcoef; - for (y=0; y < hm->h; y++) { - float value; - f[1] = (y + addy)*ycoef; - value=delta+TCOD_noise_get_fbm(noise,f,octaves)*scale; - hm->values[offset] += value; - if ( value < min ) min = value; - if ( value > max ) max=value; - offset+=hm->w; - } - } -} -void TCOD_heightmap_scale_fbm(TCOD_heightmap_t *hm, TCOD_noise_t noise,float mulx, float muly, float addx, float addy, float octaves, float delta, float scale) { - int x,y; - float xcoef=mulx / hm->w; - float ycoef=muly / hm->h; - for (x=0; x < hm->w; x++) { - float f[2]; - int offset=x; - f[0] = (x + addx) * xcoef; - for (y=0; y < hm->h; y++) { - f[1] = (y + addy)*ycoef; - hm->values[offset] *= (delta+TCOD_noise_get_fbm(noise,f,octaves)*scale); - offset+=hm->w; - } - } -} - -float TCOD_heightmap_get_interpolated_value(const TCOD_heightmap_t *hm, float x, float y) { - int ix = (int) x; - int iy = (int) y; - if ( ix >= hm->w-1 || iy >= hm->h-1 ) { - return GET_VALUE(hm,ix,iy); - } else { - float dx = x - ix; - float dy = y - iy; - float c1 = GET_VALUE(hm,ix,iy); - float c2 = GET_VALUE(hm,ix+1,iy); - float c3 = GET_VALUE(hm,ix,iy+1); - float c4 = GET_VALUE(hm,ix+1,iy+1); - float top = (1.0f-dx)*c1 + dx*c2; - float bottom = (1.0f-dx)*c3 + dx*c4; - return (1.0f-dy)*top + dy*bottom; - } -} - -void TCOD_heightmap_get_normal(const TCOD_heightmap_t *hm, float x, float y, float n[3], float waterLevel) { - float h0,hx,hy,invlen; /* map heights at x,y x+1,y and x,y+1 */ - n[0]=0.0f;n[1]=0.0f;n[2]=1.0f; - if ( x >= hm->w-1 || y >= hm->h-1 ) return; - h0 = TCOD_heightmap_get_interpolated_value(hm,x,y); - if ( h0 < waterLevel ) h0=waterLevel; - hx = TCOD_heightmap_get_interpolated_value(hm,x+1,y); - if ( hx < waterLevel ) hx=waterLevel; - hy = TCOD_heightmap_get_interpolated_value(hm,x,y+1); - if ( hy < waterLevel ) hy=waterLevel; - /* vx = 1 vy = 0 */ - /* 0 1 */ - /* hx-h0 hy-h0 */ - /* vz = vx cross vy */ - n[0] = 255*(h0-hx); - n[1] = 255*(h0-hy); - n[2] = 16.0f; - /* normalize */ - invlen=1.0f / (float)sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]); - n[0]*=invlen; - n[1]*=invlen; - n[2]*=invlen; -} - -void TCOD_heightmap_dig_bezier(TCOD_heightmap_t *hm, int px[4], int py[4], float startRadius, float startDepth, float endRadius, float endDepth) { - int xFrom=px[0]; - int yFrom=py[0]; - float t; - for ( t=0.0f;t <= 1.0f ; t += 0.001f ) { - int xTo,yTo; - float it=1.0f-t; - xTo=(int)(px[0]*it*it*it + 3*px[1]*t*it*it + 3*px[2]*t*t*it + px[3]*t*t*t); - yTo=(int)(py[0]*it*it*it + 3*py[1]*t*it*it + 3*py[2]*t*t*it + py[3]*t*t*t); - if ( xTo != xFrom || yTo != yFrom ) { - float radius=startRadius+(endRadius-startRadius)*t; - float depth=startDepth+(endDepth-startDepth)*t; - TCOD_heightmap_dig_hill(hm,(float)xTo,(float)yTo,radius,depth); - xFrom=xTo; - yFrom=yTo; - } - } -} - -bool TCOD_heightmap_has_land_on_border(const TCOD_heightmap_t *hm, float waterLevel) { - int x,y; - for (x=0; x < hm->w; x++) { - if ( GET_VALUE(hm,x,0) > waterLevel - || GET_VALUE(hm,x,hm->h-1) > waterLevel ) { - return true; - } - } - for (y=0; y < hm->h; y++) { - if ( GET_VALUE(hm,0,y) > waterLevel - || GET_VALUE(hm,hm->w-1,y) > waterLevel ) { - return true; - } - } - return false; -} - -void TCOD_heightmap_islandify(TCOD_heightmap_t *hm, float seaLevel,TCOD_random_t rnd) { - /* TODO */ -} - -void TCOD_heightmap_add(TCOD_heightmap_t *hm, float value) { - int i; - for (i=0; i < hm->w*hm->h; i++ ) hm->values[i]+=value; -} - -int TCOD_heightmap_count_cells(const TCOD_heightmap_t *hm, float min, float max) { - int count=0,i; - for (i=0; i < hm->w*hm->h; i++ ) if (hm->values[i] >= min && hm->values[i] <= max) count++; - return count; -} - -void TCOD_heightmap_scale(TCOD_heightmap_t *hm, float value) { - int i; - for (i=0; i < hm->w*hm->h; i++ ) hm->values[i]*=value; -} - -void TCOD_heightmap_clamp(TCOD_heightmap_t *hm, float min, float max) { - int i; - for (i=0; i < hm->w*hm->h; i++ ) { - hm->values[i]=CLAMP(min,max,hm->values[i]); - } -} - -void TCOD_heightmap_lerp_hm(const TCOD_heightmap_t *hm1, const TCOD_heightmap_t *hm2, TCOD_heightmap_t *hmres, float coef) { - int i; - if ( hm1->w != hm2->w || hm1->h != hm2->h - || hm1->w != hmres->w || hm1->h != hmres->h - ) { - return; - } - for (i=0; i < hm1->w*hm1->h; i++ ) { - hmres->values[i]=hm1->values[i]+(hm2->values[i]-hm1->values[i])*coef; - } -} - -void TCOD_heightmap_add_hm(const TCOD_heightmap_t *hm1, const TCOD_heightmap_t *hm2, TCOD_heightmap_t *hmres) { - int i; - if ( hm1->w != hm2->w || hm1->h != hm2->h - || hm1->w != hmres->w || hm1->h != hmres->h - ) { - return; - } - for (i=0; i < hm1->w*hm1->h; i++ ) { - hmres->values[i]=hm1->values[i]+hm2->values[i]; - } -} - -void TCOD_heightmap_multiply_hm(const TCOD_heightmap_t *hm1, const TCOD_heightmap_t *hm2, TCOD_heightmap_t *hmres) { - int i; - if ( hm1->w != hm2->w || hm1->h != hm2->h - || hm1->w != hmres->w || hm1->h != hmres->h - ) { - return; - } - for (i=0; i < hm1->w*hm1->h; i++ ) { - hmres->values[i]=hm1->values[i]*hm2->values[i]; - } -} - - -float TCOD_heightmap_get_slope(const TCOD_heightmap_t *hm, int x, int y) { - static int dix[8]={-1,0,1,-1,1,-1,0,1}; - static int diy[8]={-1,-1,-1,0,0,1,1,1}; - float mindy=0.0f,maxdy=0.0f; - float v=GET_VALUE(hm,x,y); - int i; - for (i=0; i < 8; i++ ) { - int nx=x+dix[i]; - int ny=y+diy[i]; - if ( nx >= 0 && nx < hm->w && ny >= 0 && ny < hm->h ) { - float nslope=(GET_VALUE(hm,nx,ny)-v); - if ( nslope > maxdy ) { - maxdy=nslope; - } else if ( nslope < mindy ) { - mindy=nslope; - } - } - } - return (float)atan2(maxdy+mindy,1.0f); -} - -void TCOD_heightmap_rain_erosion(TCOD_heightmap_t *hm, int nbDrops,float erosionCoef,float agregationCoef,TCOD_random_t rnd) { - while ( nbDrops > 0 ) { - int curx=TCOD_random_get_int(rnd,0,hm->w-1); - int cury=TCOD_random_get_int(rnd,0,hm->h-1); - static int dx[8]={-1,0,1,-1,1,-1,0,1}; - static int dy[8]={-1,-1,-1,0,0,1,1,1}; - float slope=0.0f; - float sediment=0.0f; - do { - int nextx=0,nexty=0,i; - float v=GET_VALUE(hm,curx,cury); - /* calculate slope at x,y */ - slope=0.0f; - for (i=0; i < 8; i++ ) { - int nx=curx+dx[i]; - int ny=cury+dy[i]; - if ( nx >= 0 && nx < hm->w && ny >= 0 && ny < hm->h ) { - float nslope=v-GET_VALUE(hm,nx,ny); - if ( nslope > slope ) { - slope=nslope; - nextx=nx; - nexty=ny; - } - } - } - if ( slope > 0.0f ) { -/* GET_VALUE(hm,curx,cury) *= 1.0f - (erosionCoef * slope); */ - GET_VALUE(hm,curx,cury) -= erosionCoef * slope; - curx=nextx; - cury=nexty; - sediment+=slope; - } else { -/* GET_VALUE(hm,curx,cury) *= 1.0f + (agregationCoef*sediment); */ - GET_VALUE(hm,curx,cury) += agregationCoef*sediment; - } - } while ( slope > 0.0f ); - nbDrops--; - } -} - -#if 0 -static void setMPDHeight(TCOD_heightmap_t *hm, TCOD_random_t rnd,int x,int y, float z, float offset); -static void setMDPHeightSquare(TCOD_heightmap_t *hm, TCOD_random_t rnd,int x, int y, int initsz, int sz,float offset); - -void TCOD_heightmap_heat_erosion(TCOD_heightmap_t *hm, int nbPass,float minSlope,float erosionCoef,float agregationCoef,TCOD_random_t rnd) { - int x; - while ( nbPass > 0 ) { - for (x=0; x < hm->w; x++) { - int offset=x,y; - for (y=0; y < hm->h; y++) { - static int dx[8]={-1,0,1,-1,1,-1,0,1}; - static int dy[8]={-1,-1,-1,0,0,1,1,1}; - int nextx=0,nexty=0,i; - float v=hm->values[offset]; - /* calculate slope at x,y */ - float slope=0.0f; - for (i=0; i < 8; i++ ) { /* 4 : von neumann neighbourhood 8 : moore neighbourhood */ - int nx=x+dx[i]; - int ny=y+dy[i]; - if ( nx >= 0 && nx < hm->w && ny >= 0 && ny < hm->h ) { - float nslope=v-GET_VALUE(hm,nx,ny); - if ( nslope > slope ) { - slope=nslope; - nextx=nx; - nexty=ny; - } - } - } - if ( slope > minSlope ) { - GET_VALUE(hm,x,y) -= erosionCoef*(slope-minSlope); - GET_VALUE(hm,nextx,nexty) += agregationCoef*(slope-minSlope); - } - offset+=hm->w; - } - } - nbPass--; - } -} -#endif - -void TCOD_heightmap_kernel_transform(TCOD_heightmap_t *hm, int kernelsize, const int *dx, const int *dy, const float *weight, float minLevel,float maxLevel) { - int x,y; - for (x=0; x < hm->w; x++) { - int offset=x; - for (y=0; y < hm->h; y++) { - if ( hm->values[offset] >= minLevel && hm->values[offset] <= maxLevel ) { - float val=0.0f; - float totalWeight=0.0f; - int i; - for (i=0; i < kernelsize; i++ ) { - int nx=x+dx[i]; - int ny=y+dy[i]; - if ( nx >= 0 && nx < hm->w && ny >= 0 && ny < hm->h ) { - val+=weight[i]*GET_VALUE(hm,nx,ny); - totalWeight+=weight[i]; - } - } - hm->values[offset]=val/totalWeight; - } - offset+=hm->w; - } - } - -} - -void TCOD_heightmap_add_voronoi(TCOD_heightmap_t *hm, int nbPoints, int nbCoef, const float *coef,TCOD_random_t rnd) { - typedef struct { - int x,y; - float dist; - } point_t; - point_t *pt; - int i,x,y; - if ( nbPoints <= 0 ) return; - pt=(point_t *)malloc(sizeof(point_t)*nbPoints); - for (i=0; i < nbPoints; i++ ) { - pt[i].x = TCOD_random_get_int(rnd,0,hm->w-1); - pt[i].y = TCOD_random_get_int(rnd,0,hm->h-1); - } - for (x=0; x < hm->w; x++) { - int offset=x; - for (y=0; y < hm->h; y++) { - /* calculate distance to voronoi points */ - for (i=0; i < nbPoints; i++ ) { - pt[i].dist = (float)(pt[i].x-x)*(pt[i].x-x)+(pt[i].y-y)*(pt[i].y-y); - } - for (i=0; i < nbCoef; i++ ) { - /* get closest point */ - float minDist=1E8f; - int idx=-1,j; - for (j=0; j < nbPoints; j++ ) { - if ( pt[j].dist < minDist ) { - idx=j; - minDist=pt[j].dist; - } - } - hm->values[offset]+=coef[i]*pt[idx].dist; - pt[idx].dist=1E8f; - } - offset+= hm->w; - } - } - free(pt); -} - -static void setMPDHeight(TCOD_heightmap_t *hm, TCOD_random_t rnd,int x,int y, float z, float offset); -static void setMDPHeightSquare(TCOD_heightmap_t *hm, TCOD_random_t rnd,int x, int y, int initsz, int sz,float offset); - -void TCOD_heightmap_mid_point_displacement(TCOD_heightmap_t *hm, TCOD_random_t rnd, float roughness) { - int step = 1; - float offset = 1.0f; - int initsz = MIN(hm->w,hm->h)-1; - int sz = initsz; - hm->values[0] = TCOD_random_get_float(rnd,0.0f,1.0f); - hm->values[sz-1] = TCOD_random_get_float(rnd,0.0f,1.0f); - hm->values[(sz-1)*sz] = TCOD_random_get_float(rnd,0.0f,1.0f); - hm->values[sz*sz-1] = TCOD_random_get_float(rnd,0.0f,1.0f); - while (sz > 0) { - int x,y; - /* diamond step */ - for (x=0; x < step; x++ ) { - for (y=0; y < step; y++ ) { - int diamondx = sz / 2 + x * sz; - int diamondy = sz / 2 + y * sz; - float z= GET_VALUE(hm,x*sz,y*sz); - z += GET_VALUE(hm,(x+1)*sz,y*sz); - z += GET_VALUE(hm,(x+1)*sz,(y+1)*sz); - z += GET_VALUE(hm,x*sz,(y+1)*sz); - z *= 0.25f; - setMPDHeight(hm,rnd,diamondx,diamondy,z,offset); - } - } - offset*=roughness; - /* square step */ - for (x=0; x < step; x++ ) { - for (y=0; y < step; y++ ) { - int diamondx = sz / 2 + x * sz; - int diamondy = sz / 2 + y * sz; - /* north */ - setMDPHeightSquare(hm, rnd, diamondx, diamondy-sz/2, initsz,sz/2, offset); - /* south */ - setMDPHeightSquare(hm, rnd, diamondx, diamondy+sz/2, initsz,sz/2, offset); - /* west */ - setMDPHeightSquare(hm, rnd, diamondx-sz/2, diamondy, initsz,sz/2, offset); - /* east */ - setMDPHeightSquare(hm, rnd, diamondx+sz/2, diamondy, initsz,sz/2, offset); - } - } - sz /= 2; - step *= 2; - } -} - -/* private stuff */ -static void setMPDHeight(TCOD_heightmap_t *hm, TCOD_random_t rnd,int x,int y, float z, float offset) { - z += TCOD_random_get_float(rnd,-offset,offset); - GET_VALUE(hm,x,y)=z; -} - -static void setMDPHeightSquare(TCOD_heightmap_t *hm, TCOD_random_t rnd,int x, int y, int initsz, int sz,float offset) { - float z=0; - int count=0; - if ( y >= sz ) { - z += GET_VALUE(hm,x,y-sz); - count++; - } - if ( x >= sz ) { - z += GET_VALUE(hm,x-sz,y); - count++; - } - if ( y+sz < initsz ) { - z += GET_VALUE(hm,x,y+sz); - count++; - } - if ( x+sz < initsz ) { - z += GET_VALUE(hm,x+sz,y); - count++; - } - z /= count; - setMPDHeight(hm,rnd,x,y,z,offset); -} diff --git a/tcod_sys/libtcod/src/image.cpp b/tcod_sys/libtcod/src/image.cpp deleted file mode 100644 index ae8e916d1..000000000 --- a/tcod_sys/libtcod/src/image.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#ifdef TCOD_IMAGE_SUPPORT - -TCODImage::TCODImage(const char *filename) : deleteData(true) { - data=(void *)TCOD_image_load(filename); -} - -TCODImage::TCODImage(int width, int height) : deleteData(true) { - data=(void *)TCOD_image_new(width,height); -} - -#ifdef TCOD_CONSOLE_SUPPORT -TCODImage::TCODImage(const TCODConsole *con) { - data=(void *)TCOD_image_from_console(con->data); -} -#endif - -void TCODImage::clear(const TCODColor col) { - TCOD_color_t ccol; - ccol.r=col.r; - ccol.g=col.g; - ccol.b=col.b; - TCOD_image_clear(data,ccol); -} - -void TCODImage::getSize(int *w,int *h) const { - TCOD_image_get_size(data,w,h); -} - -TCODImage::~TCODImage() { - if ( deleteData ) TCOD_image_delete(data); -} - -TCODColor TCODImage::getPixel(int x, int y) const { - return TCOD_image_get_pixel(data,x,y); -} - -int TCODImage::getAlpha(int x,int y) const { - return TCOD_image_get_alpha(data,x,y); -} - -TCODColor TCODImage::getMipmapPixel(float x0,float y0, float x1, float y1) { - return TCOD_image_get_mipmap_pixel(data,x0,y0,x1,y1); -} - -void TCODImage::putPixel(int x, int y, const TCODColor col) { - TCOD_color_t ccol = {col.r,col.g,col.b}; - TCOD_image_put_pixel(data,x,y,ccol); -} - -#ifdef TCOD_CONSOLE_SUPPORT -void TCODImage::blit(TCODConsole *console, float x, float y, TCOD_bkgnd_flag_t bkgnd_flag, float scalex, float scaley, float angle) const { - TCOD_image_blit(data,console->data,x,y,bkgnd_flag,scalex,scaley,angle); -} - -void TCODImage::blitRect(TCODConsole *console, int x, int y, int w, int h, TCOD_bkgnd_flag_t bkgnd_flag) const { - TCOD_image_blit_rect(data,console->data,x,y,w,h,bkgnd_flag); -} -#endif /* TCOD_CONSOLE_SUPPORT */ - -void TCODImage::save(const char *filename) const { - TCOD_image_save(data,filename); -} - -void TCODImage::setKeyColor(const TCODColor keyColor) { - TCOD_color_t ccol = {keyColor.r,keyColor.g,keyColor.b}; - TCOD_image_set_key_color(data,ccol); -} - -bool TCODImage::isPixelTransparent(int x, int y) const { - return TCOD_image_is_pixel_transparent(data,x,y) != 0; -} - -#ifdef TCOD_CONSOLE_SUPPORT -void TCODImage::refreshConsole(const TCODConsole *console) { - TCOD_image_refresh_console(data,console->data); -} -#endif /* TCOD_CONSOLE_SUPPORT */ - -void TCODImage::invert() { - TCOD_image_invert(data); -} - -void TCODImage::hflip() { - TCOD_image_hflip(data); -} - -void TCODImage::rotate90(int numRotations) { - TCOD_image_rotate90(data,numRotations); -} - -void TCODImage::vflip() { - TCOD_image_vflip(data); -} - -void TCODImage::scale(int neww, int newh) { - TCOD_image_scale(data,neww,newh); -} - -#ifdef TCOD_CONSOLE_SUPPORT -void TCODImage::blit2x(TCODConsole *dest, int dx, int dy, int sx, int sy, int w, int h) const { - TCOD_image_blit_2x(data,dest->data,dx,dy,sx,sy,w,h); -} -#endif /* TCOD_CONSOLE_SUPPORT */ - -#endif /* TCOD_IMAGE_SUPPORT */ diff --git a/tcod_sys/libtcod/src/image_c.c b/tcod_sys/libtcod/src/image_c.c deleted file mode 100644 index 89f89cd42..000000000 --- a/tcod_sys/libtcod/src/image_c.c +++ /dev/null @@ -1,866 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include "libtcod_portability.h" -#ifdef TCOD_IMAGE_SUPPORT -#include - -#include -#include -#include -#include - -#include -#include -#include - -typedef struct { - int width,height; - float fwidth,fheight; - TCOD_color_t *buf; - bool dirty; -} mipmap_t; - -typedef struct { - void *sys_img; - int nb_mipmaps; - mipmap_t *mipmaps; - TCOD_color_t key_color; - bool has_key_color; -} image_data_t; - -/* -Internal libtcod optimisation, direct colour manipulation in the images primary mipmap. -*/ -TCOD_color_t *TCOD_image_get_colors(TCOD_image_t *image) { - image_data_t *img = ((image_data_t *)image); - return img->mipmaps[0].buf; -} - -void TCOD_image_get_key_data(TCOD_image_t image, bool *has_key_color, TCOD_color_t *key_color) { - image_data_t *img = ((image_data_t *)image); - *has_key_color = img->has_key_color; - *key_color = img->key_color; -} - -void TCOD_image_invalidate_mipmaps(TCOD_image_t *image) { - int i; - image_data_t *img = ((image_data_t *)image); - for (i = 1; i < img->nb_mipmaps; i++) { - img->mipmaps[i].dirty = true; - } -} - -static int TCOD_image_get_mipmap_levels(int width, int height) { - int curw=width; - int curh=height; - int nb_mipmap=0; - while ( curw > 0 && curh > 0 ) { - nb_mipmap++; - curw >>= 1; - curh >>= 1; - } - return nb_mipmap; -} - -static void TCOD_image_generate_mip(image_data_t *img, int mip) { - mipmap_t *orig=&img->mipmaps[0]; - mipmap_t *cur =&img->mipmaps[mip]; - int x,y; - if (! cur->buf) { - cur->buf=(TCOD_color_t *)calloc(sizeof(TCOD_color_t),cur->width*cur->height); - } - cur->dirty=false; - for (x=0; x < cur->width; x++) { - for (y=0; y < cur->height; y++) { - int r=0,g=0,b=0, count=0; - int sx,sy; - TCOD_color_t *col; - for (sx=(x << mip); sx < ((x+1)<width; - count++; - r+=orig->buf[offset].r; - g+=orig->buf[offset].g; - b+=orig->buf[offset].b; - } - } - r /= count; - g /= count; - b /= count; - col = &cur->buf[x+y*cur->width]; - col->r=r; - col->g=g; - col->b=b; - } - } -} - -/* -Internal way of copying rendering fg/bg color frame data. -*/ -bool TCOD_image_mipmap_copy_internal(TCOD_image_t srcImage, TCOD_image_t dstImage) { - int i; - image_data_t *img_src = (image_data_t *)srcImage; - image_data_t *img_dst = (image_data_t *)dstImage; - if (!img_src->mipmaps || img_src->sys_img || !img_dst->mipmaps || img_dst->sys_img) /* Both internal images. */ - return false; - if (img_src->mipmaps[0].width != img_dst->mipmaps[0].width || img_src->mipmaps[0].height != img_dst->mipmaps[0].height) - return false; - /* Copy all mipmaps? */ - img_dst->mipmaps[0].dirty = img_src->mipmaps[0].dirty; - memcpy(img_dst->mipmaps[0].buf, img_src->mipmaps[0].buf, sizeof(TCOD_color_t)*(img_src->mipmaps[0].width)*(img_src->mipmaps[0].height)); - for (i = 1; i < img_src->nb_mipmaps; i++) - img_dst->mipmaps[i].dirty = true; - return true; -} - -static void TCOD_image_init_mipmaps(image_data_t *img) { - int w,h,i,x,y; - float fw,fh; - if (! img->sys_img ) return; - TCOD_sys_get_image_size(img->sys_img,&w,&h); - img->nb_mipmaps=TCOD_image_get_mipmap_levels(w,h); - img->mipmaps = (mipmap_t *)calloc(sizeof(mipmap_t),img->nb_mipmaps); - img->mipmaps[0].buf = (TCOD_color_t *)calloc(sizeof(TCOD_color_t),w*h); - for (x=0; x < w; x++) { - for (y=0;y < h; y++) { - img->mipmaps[0].buf[x+y*w]=TCOD_sys_get_image_pixel(img->sys_img,x,y); - } - } - fw=(float)w; - fh=(float)h; - for ( i=0; i < img->nb_mipmaps; i++) { - img->mipmaps[i].width=w; - img->mipmaps[i].height=h; - img->mipmaps[i].fwidth=fw; - img->mipmaps[i].fheight=fh; - img->mipmaps[i].dirty=true; - w >>= 1; - h >>= 1; - fw *= 0.5f; - fh *= 0.5f; - } - img->mipmaps[0].dirty=false; -} - -void TCOD_image_clear(TCOD_image_t image, TCOD_color_t color) { - int i; - image_data_t *img=(image_data_t *)image; - if ( !img->mipmaps && !img->sys_img) return; /* no image data */ - if ( ! img->mipmaps ) { - TCOD_image_init_mipmaps(img); - } - for (i=0; i< img->mipmaps[0].width*img->mipmaps[0].height; i++) { - img->mipmaps[0].buf[i] = color; - } - for ( i=1; i < img->nb_mipmaps; i++) { - img->mipmaps[i].dirty=true; - } -} - -TCOD_image_t TCOD_image_new(int width, int height) { - int i; - float fw,fh; - image_data_t *ret=(image_data_t *)calloc(sizeof(image_data_t),1); - ret->nb_mipmaps=TCOD_image_get_mipmap_levels(width,height); - ret->mipmaps = (mipmap_t *)calloc(sizeof(mipmap_t),ret->nb_mipmaps); - ret->mipmaps[0].buf = (TCOD_color_t *)calloc(sizeof(TCOD_color_t),width*height); - - for (i=0; i< width*height; i++) { - ret->mipmaps[0].buf[i] = TCOD_black; - } - fw=(float)width; - fh=(float)height; - for ( i=0; i < ret->nb_mipmaps; i++) { - ret->mipmaps[i].width=width; - ret->mipmaps[i].height=height; - ret->mipmaps[i].fwidth=fw; - ret->mipmaps[i].fheight=fh; - width >>= 1; - height >>= 1; - fw *= 0.5f; - fh *= 0.5f; - } - return (TCOD_image_t)ret; -} - -TCOD_image_t TCOD_image_load(const char *filename) { - image_data_t *ret=(image_data_t *)calloc(sizeof(image_data_t),1); - ret->sys_img=TCOD_sys_load_image(filename); - return (TCOD_image_t)ret; -} - -void TCOD_image_get_size(TCOD_image_t image, int *w,int *h) { - image_data_t *img=(image_data_t *)image; - if ( !img->mipmaps && !img->sys_img) return; /* no image data */ - if ( img->mipmaps ) { - *w = img->mipmaps[0].width; - *h = img->mipmaps[0].height; - } else { - TCOD_sys_get_image_size(img->sys_img,w,h); - } -} - -TCOD_color_t TCOD_image_get_pixel(TCOD_image_t image,int x, int y) { - image_data_t *img=(image_data_t *)image; - if ( !img->mipmaps && !img->sys_img) return TCOD_black; /* no image data */ - if ( img->mipmaps ) { - if ( x >= 0 && x < img->mipmaps[0].width - && y >= 0 && y < img->mipmaps[0].height ) { - return img->mipmaps[0].buf[x+y*img->mipmaps[0].width]; - } else { - return TCOD_black; - } - } else { - return TCOD_sys_get_image_pixel(img->sys_img,x,y); - } -} - -int TCOD_image_get_alpha(TCOD_image_t image,int x, int y) { - image_data_t *img=(image_data_t *)image; - if ( img->sys_img ) { - return TCOD_sys_get_image_alpha(img->sys_img,x,y); - } else return 255; -} - -TCOD_color_t TCOD_image_get_mipmap_pixel(TCOD_image_t image,float x0,float y0, float x1, float y1) { - int texel_xsize,texel_ysize, texel_size, texel_x,texel_y; - int cur_size=1; - int mip=0; - image_data_t *img=(image_data_t *)image; - if ( !img->mipmaps && !img->sys_img) return TCOD_black; /* no image data */ - if (!img->mipmaps) TCOD_image_init_mipmaps(img); - texel_xsize=(int)(x1-x0); - texel_ysize=(int)(y1-y0); - texel_size=texel_xsize < texel_ysize ? texel_ysize : texel_xsize; - while ( mip < img->nb_mipmaps-1 && cur_size < texel_size ) { - mip++; - cur_size <<= 1; - } - if ( mip > 0 ) mip --; - texel_x=(int)(x0*(img->mipmaps[mip].width)/img->mipmaps[0].fwidth); - texel_y=(int)(y0*(img->mipmaps[mip].height)/img->mipmaps[0].fheight); - - if (img->mipmaps[mip].buf == NULL || img->mipmaps[mip].dirty) { - TCOD_image_generate_mip(img,mip); - } - if ( texel_x < 0 || texel_y < 0 || texel_x >= img->mipmaps[mip].width || texel_y >= img->mipmaps[mip].height ) - return TCOD_black; - return img->mipmaps[mip].buf[texel_x+texel_y*img->mipmaps[mip].width]; -} - -void TCOD_image_put_pixel(TCOD_image_t image,int x, int y,TCOD_color_t col) { - image_data_t *img=(image_data_t *)image; - if ( !img->mipmaps && !img->sys_img) return; /* no image data */ - if ( ! img->mipmaps ) { - TCOD_image_init_mipmaps(img); - } - if ( x >= 0 && x < img->mipmaps[0].width - && y >= 0 && y < img->mipmaps[0].height ) { - int mip; - img->mipmaps[0].buf[x+y*img->mipmaps[0].width] = col; - for (mip=1; mip < img->nb_mipmaps; mip++) { - img->mipmaps[mip].dirty=true; - } - } -} - -void TCOD_image_delete_internal(TCOD_image_t image) { - image_data_t *img=(image_data_t *)image; - if ( img->mipmaps ) { - int i; - for ( i=0; i < img->nb_mipmaps; i++) { - if ( img->mipmaps[i].buf ) free(img->mipmaps[i].buf); - } - free(img->mipmaps); - } - if ( img->sys_img ) { -#ifndef TCOD_BARE - TCOD_sys_delete_bitmap(img->sys_img); -#endif - } -} - -void TCOD_image_delete(TCOD_image_t image) { - TCOD_image_delete_internal(image); - free(image); -} - -bool TCOD_image_is_pixel_transparent(TCOD_image_t image, int x, int y) { - image_data_t *img=(image_data_t *)image; - TCOD_color_t col=TCOD_image_get_pixel(image,x,y); - if ( img->has_key_color && img->key_color.r == col.r - && img->key_color.g == col.g && img->key_color.b == col.b ) { - return true; - } - if ( TCOD_image_get_alpha(image,x,y) == 0 ) return true; - return false; -} - -#ifdef TCOD_CONSOLE_SUPPORT - -void TCOD_image_blit(TCOD_image_t image, TCOD_console_t console, float x, float y, - TCOD_bkgnd_flag_t bkgnd_flag, float scalex, float scaley, float angle) { - int width,height; - float rx,ry; - image_data_t *img=(image_data_t *)image; - if ( scalex == 0.0f || scaley == 0.0f || bkgnd_flag == TCOD_BKGND_NONE ) return; - TCOD_image_get_size(image,&width,&height); - rx = x - width * 0.5f; - ry = y - height * 0.5f; - if ( scalex == 1.0f && scaley == 1.0f && angle == 0.0f && rx == ((int)rx) && ry == ((int)ry)) { - /* clip the image */ - int ix = (int)(x - width*0.5f); - int iy = (int)(y - height*0.5f); - int minx=MAX(ix,0); - int miny=MAX(iy,0); - int maxx=MIN(ix+width,TCOD_console_get_width(console)); - int maxy=MIN(iy+height,TCOD_console_get_height(console)); - int offx=0,offy=0; - int cx,cy; - if ( ix < 0 ) offx=-ix; - if ( iy < 0 ) offy=-iy; - for (cx=minx; cx < maxx; cx ++) { - for (cy=miny; cy < maxy; cy ++) { - TCOD_color_t col=TCOD_image_get_pixel(image,cx-minx+offx,cy-miny+offy); - if ( !img->has_key_color || img->key_color.r != col.r - || img->key_color.g != col.g || img->key_color.b != col.b ) { - TCOD_console_set_char_background(console,cx,cy,col,bkgnd_flag); - } - } - } - } else { - float iw=width/2*scalex; - float ih=height/2*scaley; - /* get the coordinates of the image corners in the console */ - float newx_x = (float)cos(angle); - float newx_y = -(float)sin(angle); - float newy_x = newx_y; - float newy_y = -newx_x; - float x0,y0,x1,y1,x2,y2,x3,y3; /* image corners coordinates */ - int rx,ry,rw,rh; /* rectangular area in the console */ - int cx,cy; - int minx,miny,maxx,maxy; - float invscalex,invscaley; - /* 0 = P - w/2 x' +h/2 y' */ - x0 = x-iw*newx_x+ih*newy_x; - y0 = y-iw*newx_y+ih*newy_y; - /* 1 = P + w/2 x' + h/2 y' */ - x1 = x+iw*newx_x+ih*newy_x; - y1 = y+iw*newx_y+ih*newy_y; - /* 2 = P + w/2 x' - h/2 y' */ - x2 = x+iw*newx_x-ih*newy_x; - y2 = y+iw*newx_y-ih*newy_y; - /* 3 = P - w/2 x' - h/2 y' */ - x3 = x-iw*newx_x-ih*newy_x; - y3 = y-iw*newx_y-ih*newy_y; - /* get the affected rectangular area in the console */ - rx=(int)(MIN(MIN(x0,x1),MIN(x2,x3))); - ry=(int)(MIN(MIN(y0,y1),MIN(y2,y3))); - rw=(int)(MAX(MAX(x0,x1),MAX(x2,x3))) - rx; - rh=(int)(MAX(MAX(y0,y1),MAX(y2,y3))) - ry; - /* clip it */ - minx=MAX(rx,0); - miny=MAX(ry,0); - maxx=MIN(rx+rw,TCOD_console_get_width(console)); - maxy=MIN(ry+rh,TCOD_console_get_height(console)); - invscalex=1.0f / scalex; - invscaley=1.0f / scaley; - for (cx=minx; cx < maxx; cx ++) { - for (cy=miny; cy < maxy; cy ++) { - float ix,iy; - TCOD_color_t col; - /* map the console pixel to the image world */ - ix = (iw+ (cx-x) * newx_x + (cy-y) *(-newy_x))*invscalex; - iy = (ih + (cx-x) * (newx_y) - (cy-y)*newy_y)*invscaley; - col = TCOD_image_get_pixel(image,(int)(ix),(int)(iy)); - if ( !img->has_key_color || img->key_color.r != col.r - || img->key_color.g != col.g || img->key_color.b != col.b ) { - if ( scalex < 1.0f || scaley < 1.0f ) { - col = TCOD_image_get_mipmap_pixel(image,ix,iy,ix+1.0f,iy+1.0f); - } - TCOD_console_set_char_background(console,cx,cy,col,bkgnd_flag); - } - } - } - } -} - -void TCOD_image_blit_rect(TCOD_image_t image, TCOD_console_t console, int x, int y, - int w, int h, TCOD_bkgnd_flag_t bkgnd_flag) { - int width,height; - float scalex,scaley; - TCOD_image_get_size(image,&width,&height); - if ( w == -1 ) w=width; - if ( h == -1 ) h=height; - if ( w <= 0 || h <= 0 || bkgnd_flag == TCOD_BKGND_NONE ) return; - scalex = (float)(w)/width; - scaley = (float)(h)/height; - TCOD_image_blit(image,console,x+w*0.5f,y+h*0.5f,bkgnd_flag,scalex,scaley,0.0f); -} - -TCOD_image_t TCOD_image_from_console(TCOD_console_t console) { - image_data_t *ret; - void *bitmap=TCOD_sys_create_bitmap_for_console(console); - ret=(image_data_t *)calloc(sizeof(image_data_t),1); - ret->sys_img=bitmap; - TCOD_image_refresh_console((TCOD_image_t)ret,console); - return (TCOD_image_t)ret; -} - -void TCOD_image_refresh_console(TCOD_image_t image, TCOD_console_t console) { - image_data_t *img=(image_data_t *)image; - console = (console?console:TCOD_ctx.root); - /* We're copying the state and clearing part of the copy, no need to delete/free. */ - TCOD_sys_console_to_bitmap( - img->sys_img, (TCOD_console_data_t*)console, NULL); -} - -#endif /* TCOD_CONSOLE_SUPPORT */ - -void TCOD_image_save(TCOD_image_t image, const char *filename) { - image_data_t *img=(image_data_t *)image; - void *bitmap=NULL; - bool must_free=false; - if ( img->sys_img ) { - bitmap=img->sys_img; - } else if ( img->mipmaps ){ - bitmap=TCOD_sys_create_bitmap(img->mipmaps[0].width, img->mipmaps[0].height, img->mipmaps[0].buf); - must_free=true; - } - if (bitmap) { - TCOD_sys_save_bitmap(bitmap, filename); - if ( must_free ) { - TCOD_sys_delete_bitmap(bitmap); - } - } -} - -void TCOD_image_set_key_color(TCOD_image_t image, TCOD_color_t key_color) { - image_data_t *img=(image_data_t *)image; - img->has_key_color=true; - img->key_color=key_color; -} - -void TCOD_image_invert(TCOD_image_t image) { - int i,mip; - int width,height; - image_data_t *img=(image_data_t *)image; - if ( !img->mipmaps && !img->sys_img) return; /* no image data */ - if ( ! img->mipmaps ) { - TCOD_image_init_mipmaps(img); - } - TCOD_image_get_size(image,&width,&height); - for (i=0; i< width*height; i++) { - TCOD_color_t col=img->mipmaps[0].buf[i]; - col.r=255-col.r; - col.g=255-col.g; - col.b=255-col.b; - img->mipmaps[0].buf[i] = col; - } - for (mip=1; mip < img->nb_mipmaps; mip++) { - img->mipmaps[mip].dirty=true; - } -} - -void TCOD_image_hflip(TCOD_image_t image) { - int px,py; - int width,height; - TCOD_image_get_size(image,&width,&height); - for (py = 0; py < height; py++ ) { - for (px = 0; px < width/2; px++ ) { - TCOD_color_t col1=TCOD_image_get_pixel(image,px,py); - TCOD_color_t col2=TCOD_image_get_pixel(image,width-1-px,py); - TCOD_image_put_pixel(image,px,py,col2); - TCOD_image_put_pixel(image,width-1-px,py,col1); - } - } -} - -void TCOD_image_vflip(TCOD_image_t image) { - int px,py; - int width,height; - TCOD_image_get_size(image,&width,&height); - for (px = 0; px < width; px++ ) { - for (py = 0; py < height/2; py++ ) { - TCOD_color_t col1=TCOD_image_get_pixel(image,px,py); - TCOD_color_t col2=TCOD_image_get_pixel(image,px,height-1-py); - TCOD_image_put_pixel(image,px,py,col2); - TCOD_image_put_pixel(image,px,height-1-py,col1); - } - } -} - -void TCOD_image_rotate90(TCOD_image_t image, int numRotations) { - int px,py; - int width,height; - numRotations = numRotations % 4; - if (numRotations == 0 ) return; - if ( numRotations < 0 ) numRotations += 4; - TCOD_image_get_size(image,&width,&height); - if (numRotations == 1) { - /* rotate 90 degrees */ - TCOD_image_t newImg=TCOD_image_new(height,width); - image_data_t *img=(image_data_t *)image; - image_data_t *img2=(image_data_t *)newImg; - for (px = 0; px < width; px++ ) { - for (py = 0; py < height; py++ ) { - TCOD_color_t col1=TCOD_image_get_pixel(image,px,py); - TCOD_image_put_pixel(newImg,height-1-py,px,col1); - } - } - TCOD_image_delete_internal(image); - /* update img with the new image content */ - img->mipmaps = img2->mipmaps; - img->sys_img=NULL; - img->nb_mipmaps=img2->nb_mipmaps; - free(img2); - } else if ( numRotations == 2 ) { - /* rotate 180 degrees */ - int maxy=height/2 + ((height & 1) == 1? 1 : 0 ); - for (px = 0; px < width; px++ ) { - for (py = 0; py < maxy; py++ ) { - if ( py != height-1-py || px < width/2 ) { - TCOD_color_t col1=TCOD_image_get_pixel(image,px,py); - TCOD_color_t col2=TCOD_image_get_pixel(image,width-1-px,height-1-py); - TCOD_image_put_pixel(image,px,py,col2); - TCOD_image_put_pixel(image,width-1-px,height-1-py,col1); - } - } - } - } else if (numRotations == 3) { - /* rotate 270 degrees */ - TCOD_image_t newImg=TCOD_image_new(height,width); - image_data_t *img=(image_data_t *)image; - image_data_t *img2=(image_data_t *)newImg; - for (px = 0; px < width; px++ ) { - for (py = 0; py < height; py++ ) { - TCOD_color_t col1=TCOD_image_get_pixel(image,px,py); - TCOD_image_put_pixel(newImg,py,width-1-px,col1); - } - } - TCOD_image_delete_internal(image); - /* update img with the new image content */ - img->mipmaps = img2->mipmaps; - img->sys_img=NULL; - img->nb_mipmaps=img2->nb_mipmaps; - free(img2); - } -} - -void TCOD_image_scale(TCOD_image_t image, int neww, int newh) { - image_data_t *img=(image_data_t *)image; - int px,py; - int width,height; - image_data_t *newimg; - TCOD_image_get_size(image,&width,&height); - if ( neww==width && newh==height ) return; - if ( neww == 0 || newh == 0 ) return; - newimg=(image_data_t *)TCOD_image_new(neww,newh); - - if ( neww < width && newh < height ) { - /* scale down image, using supersampling */ - for (py = 0; py < newh; py++ ) { - float y0 = (float)(py) * height / newh; - float y0floor = (float)floor(y0); - float y0weight = 1.0f - (y0 - y0floor); - int iy0 = (int)y0floor; - - float y1 = (float)(py+1) * height / newh; - float y1floor = (float)floor(y1-0.00001); - float y1weight = (y1 - y1floor); - int iy1 = (int)y1floor; - - for (px = 0; px < neww; px++ ) { - TCOD_color_t col; - float x0 = (float)(px) * width / neww; - float x0floor = (float)floor(x0); - float x0weight = 1.0f - (x0 - x0floor); - int ix0 = (int)x0floor; - - float x1 = (float)(px+1) * width / neww; - float x1floor = (float)floor(x1- 0.00001); - float x1weight = (x1 - x1floor); - int ix1 = (int)x1floor; - - float r=0,g=0,b=0,sumweight=0.0f; - int srcx,srcy; - /* left & right fractional edges */ - for (srcy=(int)(y0+1); srcy < (int)y1; srcy++) { - TCOD_color_t col_left=TCOD_image_get_pixel(image,ix0,srcy); - TCOD_color_t col_right=TCOD_image_get_pixel(image,ix1,srcy); - r += col_left.r * x0weight + col_right.r * x1weight; - g += col_left.g * x0weight + col_right.g * x1weight; - b += col_left.b * x0weight + col_right.b * x1weight; - sumweight += x0weight+x1weight; - } - /* top & bottom fractional edges */ - for (srcx = (int)(x0+1); srcx < (int)x1; srcx++) { - TCOD_color_t col_top=TCOD_image_get_pixel(image,srcx,iy0); - TCOD_color_t col_bottom=TCOD_image_get_pixel(image,srcx,iy1); - r += col_top.r * y0weight + col_bottom.r * y1weight; - g += col_top.g * y0weight + col_bottom.g * y1weight; - b += col_top.b * y0weight + col_bottom.b * y1weight; - sumweight += y0weight+y1weight; - } - /* center */ - for (srcy=(int)(y0+1); srcy < (int)y1; srcy++) { - for (srcx = (int)(x0+1); srcx < (int)x1; srcx++) { - TCOD_color_t col=TCOD_image_get_pixel(image,srcx,srcy); - r += col.r; - g += col.g; - b += col.b; - sumweight += 1.0f; - } - } - /* corners */ - col=TCOD_image_get_pixel(image,ix0,iy0); - r += col.r * (x0weight * y0weight); - g += col.g * (x0weight * y0weight); - b += col.b * (x0weight * y0weight); - sumweight += x0weight * y0weight; - col=TCOD_image_get_pixel(image,ix0,iy1); - r += col.r * (x0weight * y1weight); - g += col.g * (x0weight * y1weight); - b += col.b * (x0weight * y1weight); - sumweight += x0weight * y1weight; - col=TCOD_image_get_pixel(image,ix1,iy1); - r += col.r * (x1weight * y1weight); - g += col.g * (x1weight * y1weight); - b += col.b * (x1weight * y1weight); - sumweight += x1weight * y1weight; - col=TCOD_image_get_pixel(image,ix1,iy0); - r += col.r * (x1weight * y0weight); - g += col.g * (x1weight * y0weight); - b += col.b * (x1weight * y0weight); - sumweight += x1weight * y0weight; - sumweight = 1.0f / sumweight; - r = r*sumweight + 0.5f; - g = g*sumweight + 0.5f; - b = b*sumweight + 0.5f; - col.r=(int)r; - col.g=(int)g; - col.b=(int)b; - TCOD_image_put_pixel(newimg,px,py,col); - } - } - } else { - /* scale up image, using nearest neightbor */ - for (py = 0; py < newh; py++ ) { - int srcy = py * height / newh; - for (px = 0; px < neww; px++ ) { - int srcx = px * width / neww; - TCOD_color_t col=TCOD_image_get_pixel(image,srcx,srcy); - TCOD_image_put_pixel(newimg,px,py,col); - } - } - } - - /* destroy old image */ - TCOD_image_delete_internal(image); - /* update img with the new image content */ - img->mipmaps = newimg->mipmaps; - img->sys_img=NULL; - img->nb_mipmaps=newimg->nb_mipmaps; - free(newimg); -} - - -/* distance between two colors */ -int rgbdist(const TCOD_color_t *c1,const TCOD_color_t *c2) { - int dr=(int)(c1->r)-c2->r; - int dg=(int)(c1->g)-c2->g; - int db=(int)(c1->b)-c2->b; - return dr*dr+dg*dg+db*db; -} - -void getPattern(TCOD_color_t desired[4], TCOD_color_t palette[2], int *nbCols, int *ascii) { - /* adapted from Jeff Lait's code posted on r.g.r.d */ - int flag=0; - /* - pixels have following flag values : - X 1 - 2 4 - flag indicates which pixels uses foreground color (palette[1]) - */ - static int flagToAscii[8] = { - 0, - TCOD_CHAR_SUBP_NE,TCOD_CHAR_SUBP_SW,-TCOD_CHAR_SUBP_DIAG,TCOD_CHAR_SUBP_SE, - TCOD_CHAR_SUBP_E,-TCOD_CHAR_SUBP_N,-TCOD_CHAR_SUBP_NW - }; - int weight[2] = { 0, 0 }; - int i; - - /* First colour trivial. */ - palette[0] = desired[0]; - - /* Ignore all duplicates... */ - for (i = 1; i < 4; i++) { - if (desired[i].r != palette[0].r || desired[i].g != palette[0].g || desired[i].b != palette[0].b) - break; - } - - /* All the same. */ - if (i == 4) { - *nbCols=1; - return; - } - weight[0] = i; - - /* Found a second colour... */ - palette[1] = desired[i]; - weight[1] = 1; - flag |= 1<<(i-1); - *nbCols = 2; - /* remaining colours */ - i++; - while (i< 4) { - if (desired[i].r == palette[0].r && desired[i].g == palette[0].g && desired[i].b == palette[0].b) { - weight[0]++; - } else if (desired[i].r == palette[1].r && desired[i].g == palette[1].g && desired[i].b == palette[1].b) { - flag |= 1<<(i-1); - weight[1]++; - } else { - /* Bah, too many colours, */ - /* merge the two nearest */ - int dist0i=rgbdist(&desired[i], &palette[0]); - int dist1i=rgbdist(&desired[i], &palette[1]); - int dist01=rgbdist(&palette[0],&palette[1]); - if ( dist0i < dist1i ) { - if ( dist0i <= dist01 ) { - /* merge 0 and i */ - palette[0]=TCOD_color_lerp(desired[i],palette[0],weight[0]/(1.0f+weight[0])); - weight[0]++; - } else { - /* merge 0 and 1 */ - palette[0]=TCOD_color_lerp(palette[0],palette[1],(float)(weight[1])/(weight[0]+weight[1])); - weight[0]++; - palette[1]=desired[i]; - flag=1<<(i-1); - } - } else { - if ( dist1i <= dist01 ) { - /* merge 1 and i */ - palette[1]=TCOD_color_lerp(desired[i],palette[1],weight[1]/(1.0f+weight[1])); - weight[1]++; - flag|=1<<(i-1); - } else { - /* merge 0 and 1 */ - palette[0]=TCOD_color_lerp(palette[0],palette[1],(float)(weight[1])/(weight[0]+weight[1])); - weight[0]++; - palette[1]=desired[i]; - flag=1<<(i-1); - } - } - } - i++; - } - *ascii=flagToAscii[flag]; -} - -#ifdef TCOD_CONSOLE_SUPPORT - -void TCOD_image_blit_2x(TCOD_image_t image, TCOD_console_t con, int dx, int dy, int sx, int sy, int w, int h) { - TCOD_color_t grid[4]; - TCOD_color_t cols[2]; - int nbCols; - int width,height,ascii,cx,cy; - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)(con) : TCOD_ctx.root; - image_data_t *img=(image_data_t *)image; - int maxx,maxy; - TCOD_IFNOT(image != NULL && dat != NULL) return; - - TCOD_image_get_size(image,&width,&height); - if ( w == -1 ) w=width; - if ( h == -1 ) h=height; - - /* check that the sx,sy/w,h rectangle is inside the image */ - TCOD_ASSERT(sx >= 0 && sy >= 0 && sx+w <= width && sy+h <= height); - TCOD_IFNOT(w > 0 && h > 0) return; - - sx=MAX(0,sx); - sy=MAX(0,sy); - w = MIN(w,width-sx); - h = MIN(h,height-sy); - - maxx=dx+w/2 <= dat->w ? w : (dat->w-dx)*2; - maxy=dy+h/2 <= dat->h ? h : (dat->h-dy)*2; - /* check that the image is not blitted outside the console */ - TCOD_IFNOT(dx+maxx/2 >= 0 && dy+maxy/2 >= 0 && dx < dat->w && dy < dat->h) return; - maxx+=sx; - maxy+=sy; - - for (cx=sx; cx < maxx; cx += 2) { - for (cy=sy; cy < maxy; cy += 2) { - /* get the 2x2 super pixel colors from the image */ - int conx=dx+(cx-sx)/2; - int cony=dy+(cy-sy)/2; - TCOD_color_t consoleBack=TCOD_console_get_char_background(con,conx,cony); - grid[0]=TCOD_image_get_pixel(image,cx,cy); - if ( img->has_key_color && grid[0].r == img->key_color.r && grid[0].g == img->key_color.g && grid[0].b == img->key_color.b) - grid[0]=consoleBack; - if ( cx < maxx-1 ) { - grid[1]=TCOD_image_get_pixel(image,cx+1,cy); - if ( img->has_key_color && grid[1].r == img->key_color.r && grid[1].g == img->key_color.g && grid[1].b == img->key_color.b) - grid[1]=consoleBack; - } else grid[1]=consoleBack; - if ( cy < maxy-1 ) { - grid[2]=TCOD_image_get_pixel(image,cx,cy+1); - if ( img->has_key_color && grid[2].r == img->key_color.r && grid[2].g == img->key_color.g && grid[2].b == img->key_color.b) - grid[2]=consoleBack; - } else grid[2]=consoleBack; - if ( cx < maxx-1 && cy < maxy-1 ) { - grid[3]=TCOD_image_get_pixel(image,cx+1,cy+1); - if ( img->has_key_color && grid[3].r == img->key_color.r && grid[3].g == img->key_color.g && grid[3].b == img->key_color.b) - grid[3]=consoleBack; - } else grid[3]=consoleBack; - /* analyse color, posterize, get pattern */ - getPattern(grid,cols,&nbCols,&ascii); - if ( nbCols == 1 ) { - /* single color */ - TCOD_console_set_char_background(con,conx,cony,cols[0],TCOD_BKGND_SET); - TCOD_console_set_char(con,conx,cony,' '); - } else { - if ( ascii >= 0 ) { - TCOD_console_set_char_background(con,conx,cony,cols[0],TCOD_BKGND_SET); - TCOD_console_set_char_foreground(con,conx,cony,cols[1]); - TCOD_console_set_char(con,conx,cony,ascii); - } else { - /* negative ascii code means we need to invert back/fore colors */ - TCOD_console_set_char_background(con,conx,cony,cols[1],TCOD_BKGND_SET); - TCOD_console_set_char_foreground(con,conx,cony,cols[0]); - TCOD_console_set_char(con,conx,cony,-ascii); - } - } - } - } -} - -#endif /* TCOD_CONSOLE_SUPPORT */ - -#endif /* TCOD_IMAGE_SUPPORT */ diff --git a/tcod_sys/libtcod/src/lex.cpp b/tcod_sys/libtcod/src/lex.cpp deleted file mode 100644 index 7fc49a9ab..000000000 --- a/tcod_sys/libtcod/src/lex.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include "lex.hpp" - -#include -#include -#include -#include -#include - -#include - -TCODLex::TCODLex( const char **_symbols, const char **_keywords, const char *simpleComment, - const char *commentStart, const char *commentStop, const char *javadocCommentStart, - const char *_stringDelim, int _flags) -{ - data=(void *)TCOD_lex_new(_symbols,_keywords,simpleComment,commentStart,commentStop,javadocCommentStart,_stringDelim,_flags); - -} - -TCODLex::TCODLex() -{ - data= (void *)TCOD_lex_new_intern(); -} - -TCODLex::~TCODLex() -{ - TCOD_lex_delete((TCOD_lex_t *)data); -} - -char *TCODLex::getLastJavadoc() -{ - return TCOD_lex_get_last_javadoc((TCOD_lex_t *)data); -} - - -void TCODLex::setDataBuffer(char *dat) -{ - TCOD_lex_set_data_buffer((TCOD_lex_t *)data,dat); -} - -bool TCODLex::setDataFile(const char *_filename) -{ - return TCOD_lex_set_data_file((TCOD_lex_t *)data,_filename) != 0; -} - -int TCODLex::parse() -{ - return TCOD_lex_parse((TCOD_lex_t *)data); -} - - -int TCODLex::parseUntil(int tokenType) -{ - return TCOD_lex_parse_until_token_type((TCOD_lex_t *)data,tokenType); -} - -int TCODLex::parseUntil(const char *tokenValue) -{ - return TCOD_lex_parse_until_token_value((TCOD_lex_t *)data,tokenValue); -} - -void TCODLex::savepoint(TCODLex *savepoint) -{ - TCOD_lex_savepoint((TCOD_lex_t *)data,(TCOD_lex_t *)(savepoint->data)); -} - -void TCODLex::restore(TCODLex *savepoint) -{ - TCOD_lex_restore((TCOD_lex_t *)data,(TCOD_lex_t *)(savepoint->data)); -} - -bool TCODLex::expect(int tokenType) -{ - return TCOD_lex_expect_token_type((TCOD_lex_t *)data,tokenType) != 0; -} - -bool TCODLex::expect(int tokenType, const char *tokenValue) -{ - return TCOD_lex_expect_token_value((TCOD_lex_t *)data,tokenType,tokenValue) != 0; -} diff --git a/tcod_sys/libtcod/src/libtcod.cpp b/tcod_sys/libtcod/src/libtcod.cpp index 717eb04a0..3572d607a 100644 --- a/tcod_sys/libtcod/src/libtcod.cpp +++ b/tcod_sys/libtcod/src/libtcod.cpp @@ -1,67 +1,107 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ /** \file libtcod.cpp * * To statically link a C++ program with libtcod you'll need to follow * the directions for compiling `libtcod_c.c` and then add `libtcod.cpp` to * your source files. */ -#include "bresenham.cpp" -#include "bsp.cpp" -#include "color.cpp" -#include "console.cpp" -#include "fov.cpp" -#include "heightmap.cpp" -#include "image.cpp" -#include "lex.cpp" -#include "mersenne.cpp" -#include "mouse.cpp" -#include "namegen.cpp" -#include "noise.cpp" -#include "parser.cpp" -#include "path.cpp" -#include "sys.cpp" -#include "txtfield.cpp" -#include "zip.cpp" +#include "libtcod/bresenham.cpp" +#include "libtcod/bsp.cpp" +#include "libtcod/color.cpp" +#include "libtcod/console.cpp" +#include "libtcod/console_c.cpp" +#include "libtcod/deprecated.cpp" +#include "libtcod/fov.cpp" +#include "libtcod/heightmap.cpp" +#include "libtcod/image.cpp" +#include "libtcod/image_c.cpp" +#include "libtcod/lex.cpp" +#include "libtcod/mersenne.cpp" +#include "libtcod/mouse.cpp" +#include "libtcod/namegen.cpp" +#include "libtcod/noise.cpp" +#include "libtcod/parser.cpp" +#include "libtcod/path.cpp" +#include "libtcod/sys.cpp" +#include "libtcod/sys_c.cpp" +#include "libtcod/sys_opengl_c.cpp" +#include "libtcod/sys_sdl_c.cpp" +#include "libtcod/sys_sdl_img_bmp.cpp" +#include "libtcod/sys_sdl_img_png.cpp" +#include "libtcod/sys_sdl2_c.cpp" +#include "libtcod/txtfield.cpp" +#include "libtcod/wrappers.cpp" +#include "libtcod/zip.cpp" + +#include "libtcod/color/canvas.cpp" +#include "libtcod/console/console.cpp" +#include "libtcod/console/drawing.cpp" +#include "libtcod/console/printing.cpp" +#include "libtcod/console/rexpaint.cpp" +#include "libtcod/engine/backend.cpp" +#include "libtcod/engine/display.cpp" +#include "libtcod/engine/error.cpp" +#include "libtcod/engine/globals.cpp" +#include "libtcod/pathfinding/astar.cpp" +#include "libtcod/pathfinding/generic.cpp" +#include "libtcod/pathfinding/dijkstra.cpp" +#include "libtcod/sdl2/event.cpp" +#include "libtcod/sdl2/gl_alias.cpp" +#include "libtcod/sdl2/gl2_display.cpp" +#include "libtcod/sdl2/gl2_raii.cpp" +#include "libtcod/sdl2/gl2_renderer.cpp" +#include "libtcod/sdl2/legacy_backend.cpp" +#include "libtcod/sdl2/sdl2_alias.cpp" +#include "libtcod/sdl2/sdl2_display.cpp" +#include "libtcod/sdl2/sdl2_renderer.cpp" +#include "libtcod/tileset/fallback.cpp" +#include "libtcod/tileset/observer.cpp" +#include "libtcod/tileset/tile.cpp" +#include "libtcod/tileset/tileset.cpp" +#include "libtcod/tileset/tilesheet.cpp" +#include "libtcod/tileset/truetype.cpp" -/* -#include "gui/button.cpp" -#include "gui/container.cpp" -#include "gui/flatlist.cpp" -#include "gui/hbox.cpp" -#include "gui/image.cpp" -#include "gui/label.cpp" -#include "gui/radiobutton.cpp" -#include "gui/slider.cpp" -#include "gui/statusbar.cpp" -#include "gui/textbox.cpp" -#include "gui/togglebutton.cpp" -#include "gui/toolbar.cpp" -#include "gui/vbox.cpp" -#include "gui/widget.cpp" -*/ +#include "libtcod/gui/button.cpp" +#include "libtcod/gui/container.cpp" +#include "libtcod/gui/flatlist.cpp" +#include "libtcod/gui/hbox.cpp" +#include "libtcod/gui/image.cpp" +#include "libtcod/gui/label.cpp" +#include "libtcod/gui/radiobutton.cpp" +#include "libtcod/gui/slider.cpp" +#include "libtcod/gui/statusbar.cpp" +#include "libtcod/gui/textbox.cpp" +#include "libtcod/gui/togglebutton.cpp" +#include "libtcod/gui/toolbar.cpp" +#include "libtcod/gui/vbox.cpp" +#include "libtcod/gui/widget.cpp" diff --git a/tcod_sys/libtcod/src/libtcod.h b/tcod_sys/libtcod/src/libtcod.h new file mode 100644 index 000000000..b20d39eb6 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod.h @@ -0,0 +1,32 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "libtcod/libtcod.h" diff --git a/tcod_sys/libtcod/src/libtcod.hpp b/tcod_sys/libtcod/src/libtcod.hpp new file mode 100644 index 000000000..4de7afbcc --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod.hpp @@ -0,0 +1,32 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "libtcod.h" diff --git a/tcod_sys/libtcod/src/libtcod/bresenham.cpp b/tcod_sys/libtcod/src/libtcod/bresenham.cpp new file mode 100644 index 000000000..983891eee --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/bresenham.cpp @@ -0,0 +1,53 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "bresenham.hpp" + +// ********** bresenham line drawing ********** +void TCODLine::init(int xFrom, int yFrom, int xTo, int yTo) { + TCOD_line_init(xFrom,yFrom,xTo,yTo); +} + +bool TCODLine::step(int *xCur, int *yCur) { + return TCOD_line_step(xCur,yCur) != 0; +} + +static TCODLineListener *line_listener=NULL; + +// C to C++ bridge +extern "C" bool internalListener(int x,int y) { + return line_listener->putPoint(x,y) ? 1 : 0; +} + +bool TCODLine::line(int xFrom, int yFrom, int xTo, int yTo, TCODLineListener *plistener) { + line_listener=plistener; + return TCOD_line(xFrom,yFrom,xTo,yTo,internalListener) != 0; +} diff --git a/tcod_sys/libtcod/src/libtcod/bresenham.h b/tcod_sys/libtcod/src/libtcod/bresenham.h new file mode 100644 index 000000000..b31784568 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/bresenham.h @@ -0,0 +1,85 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_BRESENHAM_H +#define _TCOD_BRESENHAM_H + +#include "portability.h" + +#ifdef __cplusplus +extern "C" { +#endif +/** + * \brief A callback to be passed to TCOD_line + * + * The points given to the callback include both the starting and ending + * positions. + * + * \param x + * \param y + * \return As long as this callback returns true it will be called with the + * next x,y point on the line. + */ +typedef bool (*TCOD_line_listener_t) (int x, int y); + +TCODLIB_API TCOD_DEPRECATED( + "This function is not reentrant. Use TCOD_line_init_mt instead.") +void TCOD_line_init(int xFrom, int yFrom, int xTo, int yTo); + +TCODLIB_API TCOD_DEPRECATED("This function is not reentrant.") +bool TCOD_line_step(int *xCur, int *yCur); /* advance one step. returns true if we reach destination */ + +/* atomic callback function. Stops when the callback returns false */ +TCODLIB_API bool TCOD_line(int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener); +/** + * \brief A struct used for computing a bresenham line. + */ +typedef struct { + int stepx; + int stepy; + int e; + int deltax; + int deltay; + int origx; + int origy; + int destx; + int desty; +} TCOD_bresenham_data_t; + +TCODLIB_API void TCOD_line_init_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_bresenham_data_t *data); +TCODLIB_API bool TCOD_line_step_mt(int *xCur, int *yCur, TCOD_bresenham_data_t *data); + +TCOD_DEPRECATED("Use TCOD_line instead.") +TCODLIB_API bool TCOD_line_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener, TCOD_bresenham_data_t *data); +#ifdef __cplusplus +} +#endif +#endif diff --git a/tcod_sys/libtcod/include/bresenham.hpp b/tcod_sys/libtcod/src/libtcod/bresenham.hpp similarity index 69% rename from tcod_sys/libtcod/include/bresenham.hpp rename to tcod_sys/libtcod/src/libtcod/bresenham.hpp index 7c27a8e43..7a5a1681c 100644 --- a/tcod_sys/libtcod/include/bresenham.hpp +++ b/tcod_sys/libtcod/src/libtcod/bresenham.hpp @@ -1,30 +1,34 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_BRESENHAM_HPP #define _TCOD_BRESENHAM_HPP diff --git a/tcod_sys/libtcod/src/bresenham_c.c b/tcod_sys/libtcod/src/libtcod/bresenham_c.c similarity index 75% rename from tcod_sys/libtcod/src/bresenham_c.c rename to tcod_sys/libtcod/src/libtcod/bresenham_c.c index cc3fbde21..17a3eab79 100644 --- a/tcod_sys/libtcod/src/bresenham_c.c +++ b/tcod_sys/libtcod/src/libtcod/bresenham_c.c @@ -1,189 +1,193 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include -/** - * \file bresenham_c.c - * \brief bresenham line drawing - */ -/* This static variable is deprecated since 1.6 */ -static TCOD_bresenham_data_t bresenham_data; -/** - * \brief Initialize a TCOD_bresenham_data_t struct. - * - * \param xFrom The starting x position. - * \param yFrom The starting y position. - * \param xTo The ending x position. - * \param yTo The ending y position. - * \param data Pointer to a TCOD_bresenham_data_t struct. - * - * After calling this function you use TCOD_line_step_mt to iterate - * over the individual points on the line. - */ -void TCOD_line_init_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_bresenham_data_t *data) { - data->origx=xFrom; - data->origy=yFrom; - data->destx=xTo; - data->desty=yTo; - data->deltax=xTo - xFrom; - data->deltay=yTo - yFrom; - if ( data->deltax > 0 ) { - data->stepx=1; - } else if ( data->deltax < 0 ){ - data->stepx=-1; - } else data->stepx=0; - if ( data->deltay > 0 ) { - data->stepy=1; - } else if ( data->deltay < 0 ){ - data->stepy=-1; - } else data->stepy = 0; - if ( data->stepx*data->deltax > data->stepy*data->deltay ) { - data->e = data->stepx*data->deltax; - data->deltax *= 2; - data->deltay *= 2; - } else { - data->e = data->stepy*data->deltay; - data->deltax *= 2; - data->deltay *= 2; - } -} -/** - * \brief Get the next point on a line, returns true once the line has ended. - * - * \param xCur An int pointer to fill with the next x position. - * \param yCur An int pointer to fill with the next y position. - * \param data Pointer to a initialized TCOD_bresenham_data_t struct. - * \return true after the ending point has been reached. - * - * The starting point is excluded by this function. - * After the ending point is reached, the next call will return true. - */ -bool TCOD_line_step_mt(int *xCur, int *yCur, TCOD_bresenham_data_t *data) { - if ( data->stepx*data->deltax > data->stepy*data->deltay ) { - if ( data->origx == data->destx ) return true; - data->origx+=data->stepx; - data->e -= data->stepy*data->deltay; - if ( data->e < 0) { - data->origy+=data->stepy; - data->e+=data->stepx*data->deltax; - } - } else { - if ( data->origy == data->desty ) return true; - data->origy+=data->stepy; - data->e -= data->stepx*data->deltax; - if ( data->e < 0) { - data->origx+=data->stepx; - data->e+=data->stepy*data->deltay; - } - } - *xCur=data->origx; - *yCur=data->origy; - return false; -} -/** - * \brief Iterate over a line using a callback. - * - * \param xo The origin x position. - * \param yo The origin y position. - * \param xd The destination x position. - * \param yd The destination y position. - * \param listener A TCOD_line_listener_t callback. - * \param data Pointer to a TCOD_bresenham_data_t struct. - * \return true if the line was completely exhausted by the callback. - * - * \verbatim embed:rst:leading-asterisk - * .. deprecated:: 1.6.6 - * The `data` parameter for this call is redundant, you should call - * :any:`TCOD_line` instead. - * \endverbatim - */ -bool TCOD_line_mt(int xo, int yo, int xd, int yd, TCOD_line_listener_t listener, TCOD_bresenham_data_t *data) { - TCOD_line_init_mt(xo,yo,xd,yd,data); - do { - if (! listener(xo,yo)) return false; - } while (! TCOD_line_step_mt(&xo,&yo,data)); - return true; -} -/** - * \brief Initialize a line using a global state. - * - * \param xFrom The starting x position. - * \param yFrom The starting y position. - * \param xTo The ending x position. - * \param yTo The ending y position. - * - * \verbatim embed:rst:leading-asterisk - * .. deprecated:: 1.6.6 - * This function is not reentrant and will fail if a new line is started - * before the last is finished processing. - * - * Use :any:`TCOD_line_init_mt` instead. - * \endverbatim - */ -void TCOD_line_init(int xFrom, int yFrom, int xTo, int yTo) { - TCOD_line_init_mt(xFrom,yFrom,xTo,yTo,&bresenham_data); -} -/** - * \brief Get the next point in a line, returns true once the line has ended. - * - * \param xCur An int pointer to fill with the next x position. - * \param yCur An int pointer to fill with the next y position. - * \return true once the ending point has been reached. - * - * The starting point is excluded by this function. - * After the ending point is reached, the next call will return true. - * - * \verbatim embed:rst:leading-asterisk - * .. deprecated:: 1.6.6 - * This function is not reentrant and will fail if a new line is started - * before the last is finished processing. - * - * Use :any:`TCOD_line_step_mt` instead. - * \endverbatim - */ -bool TCOD_line_step(int *xCur, int *yCur) { - return TCOD_line_step_mt(xCur,yCur,&bresenham_data); -} -/** - * \brief Iterate over a line using a callback. - * - * \param xo The origin x position. - * \param yo The origin y position. - * \param xd The destination x position. - * \param yd The destination y position. - * \param listener A TCOD_line_listener_t callback. - * \return true if the line was completely exhausted by the callback. - * - * \verbatim embed:rst:leading-asterisk - * .. versionchanged:: 1.6.6 - * This function is now reentrant. - * \endverbatim - */ -bool TCOD_line(int xo, int yo, int xd, int yd, TCOD_line_listener_t listener) { - TCOD_bresenham_data_t bresenham_data; - return TCOD_line_mt(xo,yo,xd,yd,listener,&bresenham_data); -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "bresenham.h" +/** + * \file bresenham_c.c + * \brief bresenham line drawing + */ +/* This static variable is deprecated since 1.6 */ +static TCOD_bresenham_data_t bresenham_data; +/** + * \brief Initialize a TCOD_bresenham_data_t struct. + * + * \param xFrom The starting x position. + * \param yFrom The starting y position. + * \param xTo The ending x position. + * \param yTo The ending y position. + * \param data Pointer to a TCOD_bresenham_data_t struct. + * + * After calling this function you use TCOD_line_step_mt to iterate + * over the individual points on the line. + */ +void TCOD_line_init_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_bresenham_data_t *data) { + data->origx=xFrom; + data->origy=yFrom; + data->destx=xTo; + data->desty=yTo; + data->deltax=xTo - xFrom; + data->deltay=yTo - yFrom; + if ( data->deltax > 0 ) { + data->stepx=1; + } else if ( data->deltax < 0 ){ + data->stepx=-1; + } else data->stepx=0; + if ( data->deltay > 0 ) { + data->stepy=1; + } else if ( data->deltay < 0 ){ + data->stepy=-1; + } else data->stepy = 0; + if ( data->stepx*data->deltax > data->stepy*data->deltay ) { + data->e = data->stepx*data->deltax; + data->deltax *= 2; + data->deltay *= 2; + } else { + data->e = data->stepy*data->deltay; + data->deltax *= 2; + data->deltay *= 2; + } +} +/** + * \brief Get the next point on a line, returns true once the line has ended. + * + * \param xCur An int pointer to fill with the next x position. + * \param yCur An int pointer to fill with the next y position. + * \param data Pointer to a initialized TCOD_bresenham_data_t struct. + * \return true after the ending point has been reached. + * + * The starting point is excluded by this function. + * After the ending point is reached, the next call will return true. + */ +bool TCOD_line_step_mt(int *xCur, int *yCur, TCOD_bresenham_data_t *data) { + if ( data->stepx*data->deltax > data->stepy*data->deltay ) { + if ( data->origx == data->destx ) return true; + data->origx+=data->stepx; + data->e -= data->stepy*data->deltay; + if ( data->e < 0) { + data->origy+=data->stepy; + data->e+=data->stepx*data->deltax; + } + } else { + if ( data->origy == data->desty ) return true; + data->origy+=data->stepy; + data->e -= data->stepx*data->deltax; + if ( data->e < 0) { + data->origx+=data->stepx; + data->e+=data->stepy*data->deltay; + } + } + *xCur=data->origx; + *yCur=data->origy; + return false; +} +/** + * \brief Iterate over a line using a callback. + * + * \param xo The origin x position. + * \param yo The origin y position. + * \param xd The destination x position. + * \param yd The destination y position. + * \param listener A TCOD_line_listener_t callback. + * \param data Pointer to a TCOD_bresenham_data_t struct. + * \return true if the line was completely exhausted by the callback. + * + * \verbatim embed:rst:leading-asterisk + * .. deprecated:: 1.6.6 + * The `data` parameter for this call is redundant, you should call + * :any:`TCOD_line` instead. + * \endverbatim + */ +bool TCOD_line_mt(int xo, int yo, int xd, int yd, TCOD_line_listener_t listener, TCOD_bresenham_data_t *data) { + TCOD_line_init_mt(xo,yo,xd,yd,data); + do { + if (! listener(xo,yo)) return false; + } while (! TCOD_line_step_mt(&xo,&yo,data)); + return true; +} +/** + * \brief Initialize a line using a global state. + * + * \param xFrom The starting x position. + * \param yFrom The starting y position. + * \param xTo The ending x position. + * \param yTo The ending y position. + * + * \verbatim embed:rst:leading-asterisk + * .. deprecated:: 1.6.6 + * This function is not reentrant and will fail if a new line is started + * before the last is finished processing. + * + * Use :any:`TCOD_line_init_mt` instead. + * \endverbatim + */ +void TCOD_line_init(int xFrom, int yFrom, int xTo, int yTo) { + TCOD_line_init_mt(xFrom,yFrom,xTo,yTo,&bresenham_data); +} +/** + * \brief Get the next point in a line, returns true once the line has ended. + * + * \param xCur An int pointer to fill with the next x position. + * \param yCur An int pointer to fill with the next y position. + * \return true once the ending point has been reached. + * + * The starting point is excluded by this function. + * After the ending point is reached, the next call will return true. + * + * \verbatim embed:rst:leading-asterisk + * .. deprecated:: 1.6.6 + * This function is not reentrant and will fail if a new line is started + * before the last is finished processing. + * + * Use :any:`TCOD_line_step_mt` instead. + * \endverbatim + */ +bool TCOD_line_step(int *xCur, int *yCur) { + return TCOD_line_step_mt(xCur,yCur,&bresenham_data); +} +/** + * \brief Iterate over a line using a callback. + * + * \param xo The origin x position. + * \param yo The origin y position. + * \param xd The destination x position. + * \param yd The destination y position. + * \param listener A TCOD_line_listener_t callback. + * \return true if the line was completely exhausted by the callback. + * + * \verbatim embed:rst:leading-asterisk + * .. versionchanged:: 1.6.6 + * This function is now reentrant. + * \endverbatim + */ +bool TCOD_line(int xo, int yo, int xd, int yd, TCOD_line_listener_t listener) { + TCOD_bresenham_data_t bresenham_data; + return TCOD_line_mt(xo,yo,xd,yd,listener,&bresenham_data); +} diff --git a/tcod_sys/libtcod/src/bsp.cpp b/tcod_sys/libtcod/src/libtcod/bsp.cpp similarity index 70% rename from tcod_sys/libtcod/src/bsp.cpp rename to tcod_sys/libtcod/src/libtcod/bsp.cpp index 4f7cb7f31..1627a8e0d 100644 --- a/tcod_sys/libtcod/src/bsp.cpp +++ b/tcod_sys/libtcod/src/libtcod/bsp.cpp @@ -1,168 +1,172 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -TCODBsp::TCODBsp(TCODBsp *father, bool left) { - if ( father->horizontal ) { - x=father->x; - w=father->w; - y = left ? father->y : father->position; - h = left ? father->position - y: father->y + father->h - father->position; - } else { - y=father->y; - h=father->h; - x = left ? father->x : father->position; - w = left ? father->position - x: father->x + father->w - father->position; - } - level=father->level+1; -} - -TCODBsp::~TCODBsp() { - removeSons(); -} - -bool TCODBsp::traversePreOrder(ITCODBspCallback *listener, void *userData) { - if (!listener->visitNode(this,userData)) return false; - if ( getLeft() && !getLeft()->traversePreOrder(listener,userData) ) return false; - if ( getRight() && !getRight()->traversePreOrder(listener,userData)) return false; - return true; -} - -bool TCODBsp::traverseInOrder(ITCODBspCallback *listener, void *userData) { - if ( getLeft() && !getLeft()->traverseInOrder(listener,userData) ) return false; - if (!listener->visitNode(this,userData)) return false; - if ( getRight() && !getRight()->traverseInOrder(listener,userData)) return false; - return true; -} - -bool TCODBsp::traversePostOrder(ITCODBspCallback *listener,void *userData) { - if ( getLeft() && !getLeft()->traversePostOrder(listener,userData)) return false; - if ( getRight() && !getRight()->traversePostOrder(listener,userData)) return false; - if (!listener->visitNode(this,userData)) return false; - return true; -} - -bool TCODBsp::traverseLevelOrder(ITCODBspCallback *listener, void *userData) { - TCODList stack; - stack.push(this); - while ( ! stack.isEmpty() ) { - TCODBsp *node=stack.get(0); - stack.remove(node); - if ( node->getLeft() ) stack.push(node->getLeft()); - if ( node->getRight() ) stack.push(node->getRight()); - if (!listener->visitNode(node,userData)) return false; - } - return true; -} - -bool TCODBsp::traverseInvertedLevelOrder(ITCODBspCallback *listener, void *userData) { - TCODList stack1; - TCODList stack2; - stack1.push(this); - while ( ! stack1.isEmpty() ) { - TCODBsp *node=stack1.get(0); - stack2.push(node); - stack1.remove(node); - if ( node->getLeft() ) stack1.push(node->getLeft()); - if ( node->getRight() ) stack1.push(node->getRight()); - } - while ( ! stack2.isEmpty() ) { - TCODBsp *node=stack2.pop(); - if (!listener->visitNode(node,userData)) return false; - } - return true; -} - -void TCODBsp::removeSons() { - TCODBsp *node=(TCODBsp *)sons; - while ( node ) { - TCODBsp *nextNode=(TCODBsp *)node->next; - node->removeSons(); - delete node; - node=nextNode; - } - sons=NULL; -} - -void TCODBsp::splitOnce(bool horizontal, int position) { - this->horizontal = horizontal; - this->position=position; - addSon(new TCODBsp(this,true)); - addSon(new TCODBsp(this,false)); -} - -void TCODBsp::splitRecursive(TCODRandom *randomizer, int nb, int minHSize, int minVSize, float maxHRatio, float maxVRatio) { - if ( nb == 0 || (w < 2*minHSize && h < 2*minVSize ) ) return; - bool horiz; - if (! randomizer ) randomizer=TCODRandom::getInstance(); - // promote square rooms - if ( h < 2*minVSize || w > h * maxHRatio ) horiz = false; - else if ( w < 2*minHSize || h > w * maxVRatio) horiz = true; - else horiz = randomizer->getInt(0,1) == 0; - int position; - if ( horiz ) { - position = randomizer->getInt(y+minVSize,y+h-minVSize); - } else { - position = randomizer->getInt(x+minHSize,x+w-minHSize); - } - splitOnce(horiz,position); - getLeft()->splitRecursive(randomizer,nb-1,minHSize,minVSize,maxHRatio,maxVRatio); - getRight()->splitRecursive(randomizer,nb-1,minHSize,minVSize,maxHRatio,maxVRatio); -} - -void TCODBsp::resize(int x,int y, int w, int h) { - this->x=x; - this->y=y; - this->w=w; - this->h=h; - if ( getLeft() ) { - if ( horizontal ) { - getLeft()->resize(x,y,w,position-y); - getRight()->resize(x,position,w,y+h-position); - } else { - getLeft()->resize(x,y,position-x,h); - getRight()->resize(position,y,x+w-position,h); - } - } -} - -bool TCODBsp::contains(int px, int py) const { - return (px >= x && py >= y && px < x+w && py < y+h); -} - -TCODBsp *TCODBsp::findNode(int px, int py) { - if ( ! contains(px,py) ) return NULL; - if ( ! isLeaf() ) { - TCODBsp *left,*right; - left=getLeft(); - if ( left->contains(px,py) ) return left->findNode(px,py); - right=getRight(); - if ( right->contains(px,py) ) return right->findNode(px,py); - } - return this; -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "bsp.hpp" + +TCODBsp::TCODBsp(TCODBsp *father, bool left) { + if ( father->horizontal ) { + x=father->x; + w=father->w; + y = left ? father->y : father->position; + h = left ? father->position - y: father->y + father->h - father->position; + } else { + y=father->y; + h=father->h; + x = left ? father->x : father->position; + w = left ? father->position - x: father->x + father->w - father->position; + } + level=father->level+1; +} + +TCODBsp::~TCODBsp() { + removeSons(); +} + +bool TCODBsp::traversePreOrder(ITCODBspCallback *listener, void *userData) { + if (!listener->visitNode(this,userData)) return false; + if ( getLeft() && !getLeft()->traversePreOrder(listener,userData) ) return false; + if ( getRight() && !getRight()->traversePreOrder(listener,userData)) return false; + return true; +} + +bool TCODBsp::traverseInOrder(ITCODBspCallback *listener, void *userData) { + if ( getLeft() && !getLeft()->traverseInOrder(listener,userData) ) return false; + if (!listener->visitNode(this,userData)) return false; + if ( getRight() && !getRight()->traverseInOrder(listener,userData)) return false; + return true; +} + +bool TCODBsp::traversePostOrder(ITCODBspCallback *listener,void *userData) { + if ( getLeft() && !getLeft()->traversePostOrder(listener,userData)) return false; + if ( getRight() && !getRight()->traversePostOrder(listener,userData)) return false; + if (!listener->visitNode(this,userData)) return false; + return true; +} + +bool TCODBsp::traverseLevelOrder(ITCODBspCallback *listener, void *userData) { + TCODList stack; + stack.push(this); + while ( ! stack.isEmpty() ) { + TCODBsp *node=stack.get(0); + stack.remove(node); + if ( node->getLeft() ) stack.push(node->getLeft()); + if ( node->getRight() ) stack.push(node->getRight()); + if (!listener->visitNode(node,userData)) return false; + } + return true; +} + +bool TCODBsp::traverseInvertedLevelOrder(ITCODBspCallback *listener, void *userData) { + TCODList stack1; + TCODList stack2; + stack1.push(this); + while ( ! stack1.isEmpty() ) { + TCODBsp *node=stack1.get(0); + stack2.push(node); + stack1.remove(node); + if ( node->getLeft() ) stack1.push(node->getLeft()); + if ( node->getRight() ) stack1.push(node->getRight()); + } + while ( ! stack2.isEmpty() ) { + TCODBsp *node=stack2.pop(); + if (!listener->visitNode(node,userData)) return false; + } + return true; +} + +void TCODBsp::removeSons() { + TCODBsp *node = static_cast(sons); + while ( node ) { + TCODBsp *nextNode = static_cast(node->next); + node->removeSons(); + delete node; + node=nextNode; + } + sons=NULL; +} + +void TCODBsp::splitOnce(bool horizontal, int position) { + this->horizontal = horizontal; + this->position=position; + addSon(new TCODBsp(this,true)); + addSon(new TCODBsp(this,false)); +} + +void TCODBsp::splitRecursive(TCODRandom *randomizer, int nb, int minHSize, int minVSize, float maxHRatio, float maxVRatio) { + if ( nb == 0 || (w < 2*minHSize && h < 2*minVSize ) ) return; + bool horiz; + if (! randomizer ) randomizer=TCODRandom::getInstance(); + // promote square rooms + if ( h < 2*minVSize || w > h * maxHRatio ) horiz = false; + else if ( w < 2*minHSize || h > w * maxVRatio) horiz = true; + else horiz = randomizer->getInt(0,1) == 0; + int position; + if ( horiz ) { + position = randomizer->getInt(y+minVSize,y+h-minVSize); + } else { + position = randomizer->getInt(x+minHSize,x+w-minHSize); + } + splitOnce(horiz,position); + getLeft()->splitRecursive(randomizer,nb-1,minHSize,minVSize,maxHRatio,maxVRatio); + getRight()->splitRecursive(randomizer,nb-1,minHSize,minVSize,maxHRatio,maxVRatio); +} + +void TCODBsp::resize(int x,int y, int w, int h) { + this->x=x; + this->y=y; + this->w=w; + this->h=h; + if ( getLeft() ) { + if ( horizontal ) { + getLeft()->resize(x,y,w,position-y); + getRight()->resize(x,position,w,y+h-position); + } else { + getLeft()->resize(x,y,position-x,h); + getRight()->resize(position,y,x+w-position,h); + } + } +} + +bool TCODBsp::contains(int px, int py) const { + return (px >= x && py >= y && px < x+w && py < y+h); +} + +TCODBsp *TCODBsp::findNode(int px, int py) { + if ( ! contains(px,py) ) return NULL; + if ( ! isLeaf() ) { + TCODBsp *left,*right; + left=getLeft(); + if ( left->contains(px,py) ) return left->findNode(px,py); + right=getRight(); + if ( right->contains(px,py) ) return right->findNode(px,py); + } + return this; +} diff --git a/tcod_sys/libtcod/include/bsp.h b/tcod_sys/libtcod/src/libtcod/bsp.h similarity index 54% rename from tcod_sys/libtcod/include/bsp.h rename to tcod_sys/libtcod/src/libtcod/bsp.h index 00783700f..bdc2865f9 100644 --- a/tcod_sys/libtcod/include/bsp.h +++ b/tcod_sys/libtcod/src/libtcod/bsp.h @@ -1,34 +1,38 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_BSP_H #define _TCOD_BSP_H -#include "libtcod_portability.h" +#include "portability.h" #include "mersenne_types.h" #include "tree.h" diff --git a/tcod_sys/libtcod/include/bsp.hpp b/tcod_sys/libtcod/src/libtcod/bsp.hpp similarity index 90% rename from tcod_sys/libtcod/include/bsp.hpp rename to tcod_sys/libtcod/src/libtcod/bsp.hpp index 06cae8913..b9c8a6c90 100644 --- a/tcod_sys/libtcod/include/bsp.hpp +++ b/tcod_sys/libtcod/src/libtcod/bsp.hpp @@ -1,30 +1,34 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_BSP_HPP #define _TCOD_BSP_HPP @@ -278,13 +282,13 @@ You can use it if you changed the nodes size and position while using the BSP tr @Param node In the C version, the node reference. */ TCODBsp *getLeft() const { - return (TCODBsp *)sons; + return static_cast(sons); } TCODBsp *getRight() const { - return sons ? (TCODBsp *)(sons->next) : NULL; + return sons ? static_cast(sons->next) : NULL; } TCODBsp *getFather() const { - return (TCODBsp *)father; + return static_cast(father); } /** diff --git a/tcod_sys/libtcod/src/bsp_c.c b/tcod_sys/libtcod/src/libtcod/bsp_c.c similarity index 70% rename from tcod_sys/libtcod/src/bsp_c.c rename to tcod_sys/libtcod/src/libtcod/bsp_c.c index a959966d7..f2e906688 100644 --- a/tcod_sys/libtcod/src/bsp_c.c +++ b/tcod_sys/libtcod/src/libtcod/bsp_c.c @@ -1,216 +1,220 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include - -#include -#include - -TCOD_bsp_t *TCOD_bsp_new(void) { - return (TCOD_bsp_t *)calloc(sizeof(TCOD_bsp_t),1); -} - -TCOD_bsp_t *TCOD_bsp_new_with_size(int x,int y,int w, int h) { - TCOD_bsp_t *bsp=(TCOD_bsp_t *)calloc(sizeof(TCOD_bsp_t),1); - bsp->x=x; - bsp->y=y; - bsp->w=w; - bsp->h=h; - return bsp; -} - -TCOD_bsp_t * TCOD_bsp_left(TCOD_bsp_t *node) { - return (TCOD_bsp_t *)node->tree.sons; -} - -TCOD_bsp_t * TCOD_bsp_right(TCOD_bsp_t *node) { - return node->tree.sons ? (TCOD_bsp_t *)node->tree.sons->next : NULL; -} - -TCOD_bsp_t * TCOD_bsp_father(TCOD_bsp_t *node) { - return (TCOD_bsp_t *)node->tree.father; -} - -bool TCOD_bsp_is_leaf(TCOD_bsp_t *node) { - return node->tree.sons==NULL; -} - -void TCOD_bsp_delete(TCOD_bsp_t *node) { - TCOD_bsp_remove_sons(node); - free(node); -} - -static TCOD_bsp_t *TCOD_bsp_new_intern(TCOD_bsp_t *father, bool left) { - TCOD_bsp_t *bsp=(TCOD_bsp_t *)calloc(sizeof(TCOD_bsp_t),1); - if ( father->horizontal ) { - bsp->x=father->x; - bsp->w=father->w; - bsp->y = left ? father->y : father->position; - bsp->h = left ? father->position - bsp->y: father->y + father->h - father->position; - } else { - bsp->y=father->y; - bsp->h=father->h; - bsp->x = left ? father->x : father->position; - bsp->w = left ? father->position - bsp->x: father->x + father->w - father->position; - } - bsp->level=father->level+1; - return bsp; -} - -bool TCOD_bsp_traverse_pre_order(TCOD_bsp_t *node, TCOD_bsp_callback_t listener, void *userData) { - if (!listener(node,userData)) return false; - if ( TCOD_bsp_left(node) && !TCOD_bsp_traverse_pre_order(TCOD_bsp_left(node),listener,userData)) return false; - if ( TCOD_bsp_right(node) && !TCOD_bsp_traverse_pre_order(TCOD_bsp_right(node),listener,userData)) return false; - return true; -} - -bool TCOD_bsp_traverse_in_order(TCOD_bsp_t *node, TCOD_bsp_callback_t listener, void *userData) { - if ( TCOD_bsp_left(node) && !TCOD_bsp_traverse_in_order(TCOD_bsp_left(node),listener,userData)) return false; - if (!listener(node,userData)) return false; - if ( TCOD_bsp_right(node) && !TCOD_bsp_traverse_in_order(TCOD_bsp_right(node),listener,userData)) return false; - return true; -} - -bool TCOD_bsp_traverse_post_order(TCOD_bsp_t *node, TCOD_bsp_callback_t listener, void *userData) { - if ( TCOD_bsp_left(node) && !TCOD_bsp_traverse_post_order(TCOD_bsp_left(node),listener,userData)) return false; - if ( TCOD_bsp_right(node) && !TCOD_bsp_traverse_post_order(TCOD_bsp_right(node),listener,userData)) return false; - if (!listener(node,userData)) return false; - return true; -} - -bool TCOD_bsp_traverse_level_order(TCOD_bsp_t *node, TCOD_bsp_callback_t listener, void *userData) { - TCOD_list_t stack=TCOD_list_new(); - TCOD_list_push(stack,node); - while ( ! TCOD_list_is_empty(stack) ) { - TCOD_bsp_t *node=(TCOD_bsp_t *)TCOD_list_get(stack,0); - TCOD_list_remove(stack,node); - if ( TCOD_bsp_left(node) ) TCOD_list_push(stack,TCOD_bsp_left(node)); - if ( TCOD_bsp_right(node) ) TCOD_list_push(stack,TCOD_bsp_right(node)); - if (!listener(node,userData)) { - TCOD_list_delete(stack); - return false; - } - } - TCOD_list_delete(stack); - return true; -} - -bool TCOD_bsp_traverse_inverted_level_order(TCOD_bsp_t *node, TCOD_bsp_callback_t listener, void *userData) { - TCOD_list_t stack1=TCOD_list_new(); - TCOD_list_t stack2=TCOD_list_new(); - TCOD_list_push(stack1,node); - while ( ! TCOD_list_is_empty(stack1) ) { - TCOD_bsp_t *node=(TCOD_bsp_t *)TCOD_list_get(stack1,0); - TCOD_list_push(stack2,node); - TCOD_list_remove(stack1,node); - if ( TCOD_bsp_left(node) ) TCOD_list_push(stack1,TCOD_bsp_left(node)); - if ( TCOD_bsp_right(node) ) TCOD_list_push(stack1,TCOD_bsp_right(node)); - } - while ( ! TCOD_list_is_empty(stack2) ) { - TCOD_bsp_t *node=(TCOD_bsp_t *)TCOD_list_pop(stack2); - if (!listener(node,userData)) { - TCOD_list_delete(stack1); - TCOD_list_delete(stack2); - return false; - } - } - TCOD_list_delete(stack1); - TCOD_list_delete(stack2); - return true; -} - -void TCOD_bsp_remove_sons(TCOD_bsp_t *root) { - TCOD_bsp_t *node=(TCOD_bsp_t *)root->tree.sons; - while ( node ) { - TCOD_bsp_t *nextNode=(TCOD_bsp_t *)node->tree.next; - TCOD_bsp_remove_sons(node); - free( node ); - node=nextNode; - } - root->tree.sons=NULL; -} - -void TCOD_bsp_split_once(TCOD_bsp_t *node, bool horizontal, int position) { - node->horizontal = horizontal; - node->position=position; - TCOD_tree_add_son(&node->tree,&TCOD_bsp_new_intern(node,true)->tree); - TCOD_tree_add_son(&node->tree,&TCOD_bsp_new_intern(node,false)->tree); -} - -void TCOD_bsp_split_recursive(TCOD_bsp_t *node, TCOD_random_t randomizer, int nb, - int minHSize, int minVSize, float maxHRatio, float maxVRatio) { - bool horiz; - int position; - if ( nb == 0 || (node->w < 2*minHSize && node->h < 2*minVSize ) ) return; - if (! randomizer ) randomizer=TCOD_random_get_instance(); - /* promote square rooms */ - if ( node->h < 2*minVSize || node->w > node->h * maxHRatio ) horiz = false; - else if ( node->w < 2*minHSize || node->h > node->w * maxVRatio) horiz = true; - else horiz = (TCOD_random_get_int(randomizer,0,1) == 0); - if ( horiz ) { - position = TCOD_random_get_int(randomizer,node->y+minVSize,node->y+node->h-minVSize); - } else { - position = TCOD_random_get_int(randomizer,node->x+minHSize,node->x+node->w-minHSize); - } - TCOD_bsp_split_once(node,horiz,position); - TCOD_bsp_split_recursive(TCOD_bsp_left(node),randomizer,nb-1,minHSize,minVSize,maxHRatio,maxVRatio); - TCOD_bsp_split_recursive(TCOD_bsp_right(node),randomizer,nb-1,minHSize,minVSize,maxHRatio,maxVRatio); -} - -void TCOD_bsp_resize(TCOD_bsp_t *node, int x,int y, int w, int h) { - node->x=x; - node->y=y; - node->w=w; - node->h=h; - if ( TCOD_bsp_left(node) ) { - if ( node->horizontal ) { - TCOD_bsp_resize(TCOD_bsp_left(node),x,y,w,node->position-y); - TCOD_bsp_resize(TCOD_bsp_right(node),x,node->position,w,y+h-node->position); - } else { - TCOD_bsp_resize(TCOD_bsp_left(node),x,y,node->position-x,h); - TCOD_bsp_resize(TCOD_bsp_right(node),node->position,y,x+w-node->position,h); - } - } -} - -bool TCOD_bsp_contains(TCOD_bsp_t *node, int x, int y) { - return (x >= node->x && y >= node->y && x < node->x+node->w && y < node->y+node->h); -} - -TCOD_bsp_t * TCOD_bsp_find_node(TCOD_bsp_t *node, int x, int y) { - if ( ! TCOD_bsp_contains(node,x,y) ) return NULL; - if ( ! TCOD_bsp_is_leaf(node) ) { - TCOD_bsp_t *left,*right; - left=TCOD_bsp_left(node); - if ( TCOD_bsp_contains(left,x,y) ) return TCOD_bsp_find_node(left,x,y); - right=TCOD_bsp_right(node); - if ( TCOD_bsp_contains(right,x,y) ) return TCOD_bsp_find_node(right,x,y); - } - return node; -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "bsp.h" + +#include + +#include "list.h" +#include "mersenne.h" + +TCOD_bsp_t *TCOD_bsp_new(void) { + return (TCOD_bsp_t *)calloc(sizeof(TCOD_bsp_t),1); +} + +TCOD_bsp_t *TCOD_bsp_new_with_size(int x,int y,int w, int h) { + TCOD_bsp_t *bsp=(TCOD_bsp_t *)calloc(sizeof(TCOD_bsp_t),1); + bsp->x=x; + bsp->y=y; + bsp->w=w; + bsp->h=h; + return bsp; +} + +TCOD_bsp_t * TCOD_bsp_left(TCOD_bsp_t *node) { + return (TCOD_bsp_t *)node->tree.sons; +} + +TCOD_bsp_t * TCOD_bsp_right(TCOD_bsp_t *node) { + return node->tree.sons ? (TCOD_bsp_t *)node->tree.sons->next : NULL; +} + +TCOD_bsp_t * TCOD_bsp_father(TCOD_bsp_t *node) { + return (TCOD_bsp_t *)node->tree.father; +} + +bool TCOD_bsp_is_leaf(TCOD_bsp_t *node) { + return node->tree.sons==NULL; +} + +void TCOD_bsp_delete(TCOD_bsp_t *node) { + TCOD_bsp_remove_sons(node); + free(node); +} + +static TCOD_bsp_t *TCOD_bsp_new_intern(TCOD_bsp_t *father, bool left) { + TCOD_bsp_t *bsp=(TCOD_bsp_t *)calloc(sizeof(TCOD_bsp_t),1); + if ( father->horizontal ) { + bsp->x=father->x; + bsp->w=father->w; + bsp->y = left ? father->y : father->position; + bsp->h = left ? father->position - bsp->y: father->y + father->h - father->position; + } else { + bsp->y=father->y; + bsp->h=father->h; + bsp->x = left ? father->x : father->position; + bsp->w = left ? father->position - bsp->x: father->x + father->w - father->position; + } + bsp->level=father->level+1; + return bsp; +} + +bool TCOD_bsp_traverse_pre_order(TCOD_bsp_t *node, TCOD_bsp_callback_t listener, void *userData) { + if (!listener(node,userData)) return false; + if ( TCOD_bsp_left(node) && !TCOD_bsp_traverse_pre_order(TCOD_bsp_left(node),listener,userData)) return false; + if ( TCOD_bsp_right(node) && !TCOD_bsp_traverse_pre_order(TCOD_bsp_right(node),listener,userData)) return false; + return true; +} + +bool TCOD_bsp_traverse_in_order(TCOD_bsp_t *node, TCOD_bsp_callback_t listener, void *userData) { + if ( TCOD_bsp_left(node) && !TCOD_bsp_traverse_in_order(TCOD_bsp_left(node),listener,userData)) return false; + if (!listener(node,userData)) return false; + if ( TCOD_bsp_right(node) && !TCOD_bsp_traverse_in_order(TCOD_bsp_right(node),listener,userData)) return false; + return true; +} + +bool TCOD_bsp_traverse_post_order(TCOD_bsp_t *node, TCOD_bsp_callback_t listener, void *userData) { + if ( TCOD_bsp_left(node) && !TCOD_bsp_traverse_post_order(TCOD_bsp_left(node),listener,userData)) return false; + if ( TCOD_bsp_right(node) && !TCOD_bsp_traverse_post_order(TCOD_bsp_right(node),listener,userData)) return false; + if (!listener(node,userData)) return false; + return true; +} + +bool TCOD_bsp_traverse_level_order(TCOD_bsp_t *node, TCOD_bsp_callback_t listener, void *userData) { + TCOD_list_t stack=TCOD_list_new(); + TCOD_list_push(stack,node); + while ( ! TCOD_list_is_empty(stack) ) { + TCOD_bsp_t *node_=(TCOD_bsp_t *)TCOD_list_get(stack,0); + TCOD_list_remove(stack,node_); + if ( TCOD_bsp_left(node_) ) TCOD_list_push(stack,TCOD_bsp_left(node_)); + if ( TCOD_bsp_right(node_) ) TCOD_list_push(stack,TCOD_bsp_right(node_)); + if (!listener(node_,userData)) { + TCOD_list_delete(stack); + return false; + } + } + TCOD_list_delete(stack); + return true; +} + +bool TCOD_bsp_traverse_inverted_level_order(TCOD_bsp_t *node, TCOD_bsp_callback_t listener, void *userData) { + TCOD_list_t stack1=TCOD_list_new(); + TCOD_list_t stack2=TCOD_list_new(); + TCOD_list_push(stack1,node); + while ( ! TCOD_list_is_empty(stack1) ) { + TCOD_bsp_t *node_ = (TCOD_bsp_t *)TCOD_list_get(stack1,0); + TCOD_list_push(stack2,node_); + TCOD_list_remove(stack1,node_); + if (TCOD_bsp_left(node_)) TCOD_list_push(stack1,TCOD_bsp_left(node_)); + if (TCOD_bsp_right(node_)) TCOD_list_push(stack1,TCOD_bsp_right(node_)); + } + while ( ! TCOD_list_is_empty(stack2) ) { + TCOD_bsp_t *node_ = (TCOD_bsp_t *)TCOD_list_pop(stack2); + if (!listener(node_, userData)) { + TCOD_list_delete(stack1); + TCOD_list_delete(stack2); + return false; + } + } + TCOD_list_delete(stack1); + TCOD_list_delete(stack2); + return true; +} + +void TCOD_bsp_remove_sons(TCOD_bsp_t *root) { + TCOD_bsp_t *node=(TCOD_bsp_t *)root->tree.sons; + while ( node ) { + TCOD_bsp_t *nextNode=(TCOD_bsp_t *)node->tree.next; + TCOD_bsp_remove_sons(node); + free( node ); + node=nextNode; + } + root->tree.sons=NULL; +} + +void TCOD_bsp_split_once(TCOD_bsp_t *node, bool horizontal, int position) { + node->horizontal = horizontal; + node->position=position; + TCOD_tree_add_son(&node->tree,&TCOD_bsp_new_intern(node,true)->tree); + TCOD_tree_add_son(&node->tree,&TCOD_bsp_new_intern(node,false)->tree); +} + +void TCOD_bsp_split_recursive(TCOD_bsp_t *node, TCOD_random_t randomizer, int nb, + int minHSize, int minVSize, float maxHRatio, float maxVRatio) { + bool horiz; + int position; + if ( nb == 0 || (node->w < 2*minHSize && node->h < 2*minVSize ) ) return; + if (! randomizer ) randomizer=TCOD_random_get_instance(); + /* promote square rooms */ + if ( node->h < 2*minVSize || node->w > node->h * maxHRatio ) horiz = false; + else if ( node->w < 2*minHSize || node->h > node->w * maxVRatio) horiz = true; + else horiz = (TCOD_random_get_int(randomizer,0,1) == 0); + if ( horiz ) { + position = TCOD_random_get_int(randomizer,node->y+minVSize,node->y+node->h-minVSize); + } else { + position = TCOD_random_get_int(randomizer,node->x+minHSize,node->x+node->w-minHSize); + } + TCOD_bsp_split_once(node,horiz,position); + TCOD_bsp_split_recursive(TCOD_bsp_left(node),randomizer,nb-1,minHSize,minVSize,maxHRatio,maxVRatio); + TCOD_bsp_split_recursive(TCOD_bsp_right(node),randomizer,nb-1,minHSize,minVSize,maxHRatio,maxVRatio); +} + +void TCOD_bsp_resize(TCOD_bsp_t *node, int x,int y, int w, int h) { + node->x=x; + node->y=y; + node->w=w; + node->h=h; + if ( TCOD_bsp_left(node) ) { + if ( node->horizontal ) { + TCOD_bsp_resize(TCOD_bsp_left(node),x,y,w,node->position-y); + TCOD_bsp_resize(TCOD_bsp_right(node),x,node->position,w,y+h-node->position); + } else { + TCOD_bsp_resize(TCOD_bsp_left(node),x,y,node->position-x,h); + TCOD_bsp_resize(TCOD_bsp_right(node),node->position,y,x+w-node->position,h); + } + } +} + +bool TCOD_bsp_contains(TCOD_bsp_t *node, int x, int y) { + return (x >= node->x && y >= node->y && x < node->x+node->w && y < node->y+node->h); +} + +TCOD_bsp_t * TCOD_bsp_find_node(TCOD_bsp_t *node, int x, int y) { + if ( ! TCOD_bsp_contains(node,x,y) ) return NULL; + if ( ! TCOD_bsp_is_leaf(node) ) { + TCOD_bsp_t *left,*right; + left=TCOD_bsp_left(node); + if ( TCOD_bsp_contains(left,x,y) ) return TCOD_bsp_find_node(left,x,y); + right=TCOD_bsp_right(node); + if ( TCOD_bsp_contains(right,x,y) ) return TCOD_bsp_find_node(right,x,y); + } + return node; +} diff --git a/tcod_sys/libtcod/src/color_c.c b/tcod_sys/libtcod/src/libtcod/color.c similarity index 91% rename from tcod_sys/libtcod/src/color_c.c rename to tcod_sys/libtcod/src/libtcod/color.c index 728f2893a..dc6682832 100644 --- a/tcod_sys/libtcod/src/color_c.c +++ b/tcod_sys/libtcod/src/libtcod/color.c @@ -1,612 +1,638 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include - -#include -#include - -/* grey levels */ -const TCOD_color_t TCOD_black={TCOD_BLACK}; -const TCOD_color_t TCOD_darkest_grey={TCOD_DARKEST_GREY}; -const TCOD_color_t TCOD_darker_grey={TCOD_DARKER_GREY}; -const TCOD_color_t TCOD_dark_grey={TCOD_DARK_GREY}; -const TCOD_color_t TCOD_grey={TCOD_GREY}; -const TCOD_color_t TCOD_light_grey={TCOD_LIGHT_GREY}; -const TCOD_color_t TCOD_lighter_grey={TCOD_LIGHTER_GREY}; -const TCOD_color_t TCOD_lightest_grey={TCOD_LIGHTEST_GREY}; -const TCOD_color_t TCOD_darkest_gray={TCOD_DARKEST_GREY}; -const TCOD_color_t TCOD_darker_gray={TCOD_DARKER_GREY}; -const TCOD_color_t TCOD_dark_gray={TCOD_DARK_GREY}; -const TCOD_color_t TCOD_gray={TCOD_GREY}; -const TCOD_color_t TCOD_light_gray={TCOD_LIGHT_GREY}; -const TCOD_color_t TCOD_lighter_gray={TCOD_LIGHTER_GREY}; -const TCOD_color_t TCOD_lightest_gray={TCOD_LIGHTEST_GREY}; -const TCOD_color_t TCOD_white={TCOD_WHITE}; - -/* sepia */ -const TCOD_color_t TCOD_darkest_sepia={TCOD_DARKEST_SEPIA}; -const TCOD_color_t TCOD_darker_sepia={TCOD_DARKER_SEPIA}; -const TCOD_color_t TCOD_dark_sepia={TCOD_DARK_SEPIA}; -const TCOD_color_t TCOD_sepia={TCOD_SEPIA}; -const TCOD_color_t TCOD_light_sepia={TCOD_LIGHT_SEPIA}; -const TCOD_color_t TCOD_lighter_sepia={TCOD_LIGHTER_SEPIA}; -const TCOD_color_t TCOD_lightest_sepia={TCOD_LIGHTEST_SEPIA}; - -/* standard colors */ -const TCOD_color_t TCOD_red = {TCOD_RED}; -const TCOD_color_t TCOD_flame = {TCOD_FLAME}; -const TCOD_color_t TCOD_orange = {TCOD_ORANGE}; -const TCOD_color_t TCOD_amber = {TCOD_AMBER}; -const TCOD_color_t TCOD_yellow = {TCOD_YELLOW}; -const TCOD_color_t TCOD_lime = {TCOD_LIME}; -const TCOD_color_t TCOD_chartreuse = {TCOD_CHARTREUSE}; -const TCOD_color_t TCOD_green = {TCOD_GREEN}; -const TCOD_color_t TCOD_sea = {TCOD_SEA}; -const TCOD_color_t TCOD_turquoise = {TCOD_TURQUOISE}; -const TCOD_color_t TCOD_cyan = {TCOD_CYAN}; -const TCOD_color_t TCOD_sky = {TCOD_SKY}; -const TCOD_color_t TCOD_azure = {TCOD_AZURE}; -const TCOD_color_t TCOD_blue = {TCOD_BLUE}; -const TCOD_color_t TCOD_han = {TCOD_HAN}; -const TCOD_color_t TCOD_violet = {TCOD_VIOLET}; -const TCOD_color_t TCOD_purple = {TCOD_PURPLE}; -const TCOD_color_t TCOD_fuchsia = {TCOD_FUCHSIA}; -const TCOD_color_t TCOD_magenta = {TCOD_MAGENTA}; -const TCOD_color_t TCOD_pink = {TCOD_PINK}; -const TCOD_color_t TCOD_crimson = {TCOD_CRIMSON}; - -/* dark colors */ -const TCOD_color_t TCOD_dark_red = {TCOD_DARK_RED}; -const TCOD_color_t TCOD_dark_flame = {TCOD_DARK_FLAME}; -const TCOD_color_t TCOD_dark_orange = {TCOD_DARK_ORANGE}; -const TCOD_color_t TCOD_dark_amber = {TCOD_DARK_AMBER}; -const TCOD_color_t TCOD_dark_yellow = {TCOD_DARK_YELLOW}; -const TCOD_color_t TCOD_dark_lime = {TCOD_DARK_LIME}; -const TCOD_color_t TCOD_dark_chartreuse = {TCOD_DARK_CHARTREUSE}; -const TCOD_color_t TCOD_dark_green = {TCOD_DARK_GREEN}; -const TCOD_color_t TCOD_dark_sea = {TCOD_DARK_SEA}; -const TCOD_color_t TCOD_dark_turquoise = {TCOD_DARK_TURQUOISE}; -const TCOD_color_t TCOD_dark_cyan = {TCOD_DARK_CYAN}; -const TCOD_color_t TCOD_dark_sky = {TCOD_DARK_SKY}; -const TCOD_color_t TCOD_dark_azure = {TCOD_DARK_AZURE}; -const TCOD_color_t TCOD_dark_blue = {TCOD_DARK_BLUE}; -const TCOD_color_t TCOD_dark_han = {TCOD_DARK_HAN}; -const TCOD_color_t TCOD_dark_violet = {TCOD_DARK_VIOLET}; -const TCOD_color_t TCOD_dark_purple = {TCOD_DARK_PURPLE}; -const TCOD_color_t TCOD_dark_fuchsia = {TCOD_DARK_FUCHSIA}; -const TCOD_color_t TCOD_dark_magenta = {TCOD_DARK_MAGENTA}; -const TCOD_color_t TCOD_dark_pink = {TCOD_DARK_PINK}; -const TCOD_color_t TCOD_dark_crimson = {TCOD_DARK_CRIMSON}; - -/* darker colors */ -const TCOD_color_t TCOD_darker_red = {TCOD_DARKER_RED}; -const TCOD_color_t TCOD_darker_flame = {TCOD_DARKER_FLAME}; -const TCOD_color_t TCOD_darker_orange = {TCOD_DARKER_ORANGE}; -const TCOD_color_t TCOD_darker_amber = {TCOD_DARKER_AMBER}; -const TCOD_color_t TCOD_darker_yellow = {TCOD_DARKER_YELLOW}; -const TCOD_color_t TCOD_darker_lime = {TCOD_DARKER_LIME}; -const TCOD_color_t TCOD_darker_chartreuse = {TCOD_DARKER_CHARTREUSE}; -const TCOD_color_t TCOD_darker_green = {TCOD_DARKER_GREEN}; -const TCOD_color_t TCOD_darker_sea = {TCOD_DARKER_SEA}; -const TCOD_color_t TCOD_darker_turquoise = {TCOD_DARKER_TURQUOISE}; -const TCOD_color_t TCOD_darker_cyan = {TCOD_DARKER_CYAN}; -const TCOD_color_t TCOD_darker_sky = {TCOD_DARKER_SKY}; -const TCOD_color_t TCOD_darker_azure = {TCOD_DARKER_AZURE}; -const TCOD_color_t TCOD_darker_blue = {TCOD_DARKER_BLUE}; -const TCOD_color_t TCOD_darker_han = {TCOD_DARKER_HAN}; -const TCOD_color_t TCOD_darker_violet = {TCOD_DARKER_VIOLET}; -const TCOD_color_t TCOD_darker_purple = {TCOD_DARKER_PURPLE}; -const TCOD_color_t TCOD_darker_fuchsia = {TCOD_DARKER_FUCHSIA}; -const TCOD_color_t TCOD_darker_magenta = {TCOD_DARKER_MAGENTA}; -const TCOD_color_t TCOD_darker_pink = {TCOD_DARKER_PINK}; -const TCOD_color_t TCOD_darker_crimson = {TCOD_DARKER_CRIMSON}; - -/* darkest colors */ -const TCOD_color_t TCOD_darkest_red = {TCOD_DARKEST_RED}; -const TCOD_color_t TCOD_darkest_flame = {TCOD_DARKEST_FLAME}; -const TCOD_color_t TCOD_darkest_orange = {TCOD_DARKEST_ORANGE}; -const TCOD_color_t TCOD_darkest_amber = {TCOD_DARKEST_AMBER}; -const TCOD_color_t TCOD_darkest_yellow = {TCOD_DARKEST_YELLOW}; -const TCOD_color_t TCOD_darkest_lime = {TCOD_DARKEST_LIME}; -const TCOD_color_t TCOD_darkest_chartreuse = {TCOD_DARKEST_CHARTREUSE}; -const TCOD_color_t TCOD_darkest_green = {TCOD_DARKEST_GREEN}; -const TCOD_color_t TCOD_darkest_sea = {TCOD_DARKEST_SEA}; -const TCOD_color_t TCOD_darkest_turquoise = {TCOD_DARKEST_TURQUOISE}; -const TCOD_color_t TCOD_darkest_cyan = {TCOD_DARKEST_CYAN}; -const TCOD_color_t TCOD_darkest_sky = {TCOD_DARKEST_SKY}; -const TCOD_color_t TCOD_darkest_azure = {TCOD_DARKEST_AZURE}; -const TCOD_color_t TCOD_darkest_blue = {TCOD_DARKEST_BLUE}; -const TCOD_color_t TCOD_darkest_han = {TCOD_DARKEST_HAN}; -const TCOD_color_t TCOD_darkest_violet = {TCOD_DARKEST_VIOLET}; -const TCOD_color_t TCOD_darkest_purple = {TCOD_DARKEST_PURPLE}; -const TCOD_color_t TCOD_darkest_fuchsia = {TCOD_DARKEST_FUCHSIA}; -const TCOD_color_t TCOD_darkest_magenta = {TCOD_DARKEST_MAGENTA}; -const TCOD_color_t TCOD_darkest_pink = {TCOD_DARKEST_PINK}; -const TCOD_color_t TCOD_darkest_crimson = {TCOD_DARKEST_CRIMSON}; - -/* light colors */ -const TCOD_color_t TCOD_light_red = {TCOD_LIGHT_RED}; -const TCOD_color_t TCOD_light_flame = {TCOD_LIGHT_FLAME}; -const TCOD_color_t TCOD_light_orange = {TCOD_LIGHT_ORANGE}; -const TCOD_color_t TCOD_light_amber = {TCOD_LIGHT_AMBER}; -const TCOD_color_t TCOD_light_yellow = {TCOD_LIGHT_YELLOW}; -const TCOD_color_t TCOD_light_lime = {TCOD_LIGHT_LIME}; -const TCOD_color_t TCOD_light_chartreuse = {TCOD_LIGHT_CHARTREUSE}; -const TCOD_color_t TCOD_light_green = {TCOD_LIGHT_GREEN}; -const TCOD_color_t TCOD_light_sea = {TCOD_LIGHT_SEA}; -const TCOD_color_t TCOD_light_turquoise = {TCOD_LIGHT_TURQUOISE}; -const TCOD_color_t TCOD_light_cyan = {TCOD_LIGHT_CYAN}; -const TCOD_color_t TCOD_light_sky = {TCOD_LIGHT_SKY}; -const TCOD_color_t TCOD_light_azure = {TCOD_LIGHT_AZURE}; -const TCOD_color_t TCOD_light_blue = {TCOD_LIGHT_BLUE}; -const TCOD_color_t TCOD_light_han = {TCOD_LIGHT_HAN}; -const TCOD_color_t TCOD_light_violet = {TCOD_LIGHT_VIOLET}; -const TCOD_color_t TCOD_light_purple = {TCOD_LIGHT_PURPLE}; -const TCOD_color_t TCOD_light_fuchsia = {TCOD_LIGHT_FUCHSIA}; -const TCOD_color_t TCOD_light_magenta = {TCOD_LIGHT_MAGENTA}; -const TCOD_color_t TCOD_light_pink = {TCOD_LIGHT_PINK}; -const TCOD_color_t TCOD_light_crimson = {TCOD_LIGHT_CRIMSON}; - -/*lighter colors */ -const TCOD_color_t TCOD_lighter_red = {TCOD_LIGHTER_RED}; -const TCOD_color_t TCOD_lighter_flame = {TCOD_LIGHTER_FLAME}; -const TCOD_color_t TCOD_lighter_orange = {TCOD_LIGHTER_ORANGE}; -const TCOD_color_t TCOD_lighter_amber = {TCOD_LIGHTER_AMBER}; -const TCOD_color_t TCOD_lighter_yellow = {TCOD_LIGHTER_YELLOW}; -const TCOD_color_t TCOD_lighter_lime = {TCOD_LIGHTER_LIME}; -const TCOD_color_t TCOD_lighter_chartreuse = {TCOD_LIGHTER_CHARTREUSE}; -const TCOD_color_t TCOD_lighter_green = {TCOD_LIGHTER_GREEN}; -const TCOD_color_t TCOD_lighter_sea = {TCOD_LIGHTER_SEA}; -const TCOD_color_t TCOD_lighter_turquoise = {TCOD_LIGHTER_TURQUOISE}; -const TCOD_color_t TCOD_lighter_cyan = {TCOD_LIGHTER_CYAN}; -const TCOD_color_t TCOD_lighter_sky = {TCOD_LIGHTER_SKY}; -const TCOD_color_t TCOD_lighter_azure = {TCOD_LIGHTER_AZURE}; -const TCOD_color_t TCOD_lighter_blue = {TCOD_LIGHTER_BLUE}; -const TCOD_color_t TCOD_lighter_han = {TCOD_LIGHTER_HAN}; -const TCOD_color_t TCOD_lighter_violet = {TCOD_LIGHTER_VIOLET}; -const TCOD_color_t TCOD_lighter_purple = {TCOD_LIGHTER_PURPLE}; -const TCOD_color_t TCOD_lighter_fuchsia = {TCOD_LIGHTER_FUCHSIA}; -const TCOD_color_t TCOD_lighter_magenta = {TCOD_LIGHTER_MAGENTA}; -const TCOD_color_t TCOD_lighter_pink = {TCOD_LIGHTER_PINK}; -const TCOD_color_t TCOD_lighter_crimson = {TCOD_LIGHTER_CRIMSON}; - -/* lightest colors */ -const TCOD_color_t TCOD_lightest_red = {TCOD_LIGHTEST_RED}; -const TCOD_color_t TCOD_lightest_flame = {TCOD_LIGHTEST_FLAME}; -const TCOD_color_t TCOD_lightest_orange = {TCOD_LIGHTEST_ORANGE}; -const TCOD_color_t TCOD_lightest_amber = {TCOD_LIGHTEST_AMBER}; -const TCOD_color_t TCOD_lightest_yellow = {TCOD_LIGHTEST_YELLOW}; -const TCOD_color_t TCOD_lightest_lime = {TCOD_LIGHTEST_LIME}; -const TCOD_color_t TCOD_lightest_chartreuse = {TCOD_LIGHTEST_CHARTREUSE}; -const TCOD_color_t TCOD_lightest_green = {TCOD_LIGHTEST_GREEN}; -const TCOD_color_t TCOD_lightest_sea = {TCOD_LIGHTEST_SEA}; -const TCOD_color_t TCOD_lightest_turquoise = {TCOD_LIGHTEST_TURQUOISE}; -const TCOD_color_t TCOD_lightest_cyan = {TCOD_LIGHTEST_CYAN}; -const TCOD_color_t TCOD_lightest_sky = {TCOD_LIGHTEST_SKY}; -const TCOD_color_t TCOD_lightest_azure = {TCOD_LIGHTEST_AZURE}; -const TCOD_color_t TCOD_lightest_blue = {TCOD_LIGHTEST_BLUE}; -const TCOD_color_t TCOD_lightest_han = {TCOD_LIGHTEST_HAN}; -const TCOD_color_t TCOD_lightest_violet = {TCOD_LIGHTEST_VIOLET}; -const TCOD_color_t TCOD_lightest_purple = {TCOD_LIGHTEST_PURPLE}; -const TCOD_color_t TCOD_lightest_fuchsia = {TCOD_LIGHTEST_FUCHSIA}; -const TCOD_color_t TCOD_lightest_magenta = {TCOD_LIGHTEST_MAGENTA}; -const TCOD_color_t TCOD_lightest_pink = {TCOD_LIGHTEST_PINK}; -const TCOD_color_t TCOD_lightest_crimson = {TCOD_LIGHTEST_CRIMSON}; - -/* desaturated colors */ -const TCOD_color_t TCOD_desaturated_red = {TCOD_DESATURATED_RED}; -const TCOD_color_t TCOD_desaturated_flame = {TCOD_DESATURATED_FLAME}; -const TCOD_color_t TCOD_desaturated_orange = {TCOD_DESATURATED_ORANGE}; -const TCOD_color_t TCOD_desaturated_amber = {TCOD_DESATURATED_AMBER}; -const TCOD_color_t TCOD_desaturated_yellow = {TCOD_DESATURATED_YELLOW}; -const TCOD_color_t TCOD_desaturated_lime = {TCOD_DESATURATED_LIME}; -const TCOD_color_t TCOD_desaturated_chartreuse = {TCOD_DESATURATED_CHARTREUSE}; -const TCOD_color_t TCOD_desaturated_green = {TCOD_DESATURATED_GREEN}; -const TCOD_color_t TCOD_desaturated_sea = {TCOD_DESATURATED_SEA}; -const TCOD_color_t TCOD_desaturated_turquoise = {TCOD_DESATURATED_TURQUOISE}; -const TCOD_color_t TCOD_desaturated_cyan = {TCOD_DESATURATED_CYAN}; -const TCOD_color_t TCOD_desaturated_sky = {TCOD_DESATURATED_SKY}; -const TCOD_color_t TCOD_desaturated_azure = {TCOD_DESATURATED_AZURE}; -const TCOD_color_t TCOD_desaturated_blue = {TCOD_DESATURATED_BLUE}; -const TCOD_color_t TCOD_desaturated_han = {TCOD_DESATURATED_HAN}; -const TCOD_color_t TCOD_desaturated_violet = {TCOD_DESATURATED_VIOLET}; -const TCOD_color_t TCOD_desaturated_purple = {TCOD_DESATURATED_PURPLE}; -const TCOD_color_t TCOD_desaturated_fuchsia = {TCOD_DESATURATED_FUCHSIA}; -const TCOD_color_t TCOD_desaturated_magenta = {TCOD_DESATURATED_MAGENTA}; -const TCOD_color_t TCOD_desaturated_pink = {TCOD_DESATURATED_PINK}; -const TCOD_color_t TCOD_desaturated_crimson = {TCOD_DESATURATED_CRIMSON}; - -/* metallic */ -const TCOD_color_t TCOD_brass = {TCOD_BRASS}; -const TCOD_color_t TCOD_copper = {TCOD_COPPER}; -const TCOD_color_t TCOD_gold = {TCOD_GOLD}; -const TCOD_color_t TCOD_silver = {TCOD_SILVER}; - -/* miscellaneous */ -const TCOD_color_t TCOD_celadon = {TCOD_CELADON}; -const TCOD_color_t TCOD_peach = {TCOD_PEACH}; - -/* color array */ -const TCOD_color_t TCOD_colors[TCOD_COLOR_NB][TCOD_COLOR_LEVELS] = { - {{TCOD_DESATURATED_RED},{TCOD_LIGHTEST_RED},{TCOD_LIGHTER_RED},{TCOD_LIGHT_RED},{TCOD_RED},{TCOD_DARK_RED},{TCOD_DARKER_RED},{TCOD_DARKEST_RED}}, - {{TCOD_DESATURATED_FLAME},{TCOD_LIGHTEST_FLAME},{TCOD_LIGHTER_FLAME},{TCOD_LIGHT_FLAME},{TCOD_FLAME},{TCOD_DARK_FLAME},{TCOD_DARKER_FLAME},{TCOD_DARKEST_FLAME}}, - {{TCOD_DESATURATED_ORANGE},{TCOD_LIGHTEST_ORANGE},{TCOD_LIGHTER_ORANGE},{TCOD_LIGHT_ORANGE},{TCOD_ORANGE},{TCOD_DARK_ORANGE},{TCOD_DARKER_ORANGE},{TCOD_DARKEST_ORANGE}}, - {{TCOD_DESATURATED_AMBER},{TCOD_LIGHTEST_AMBER},{TCOD_LIGHTER_AMBER},{TCOD_LIGHT_AMBER},{TCOD_AMBER},{TCOD_DARK_AMBER},{TCOD_DARKER_AMBER},{TCOD_DARKEST_AMBER}}, - {{TCOD_DESATURATED_YELLOW},{TCOD_LIGHTEST_YELLOW},{TCOD_LIGHTER_YELLOW},{TCOD_LIGHT_YELLOW},{TCOD_YELLOW},{TCOD_DARK_YELLOW},{TCOD_DARKER_YELLOW},{TCOD_DARKEST_YELLOW}}, - {{TCOD_DESATURATED_LIME},{TCOD_LIGHTEST_LIME},{TCOD_LIGHTER_LIME},{TCOD_LIGHT_LIME},{TCOD_LIME},{TCOD_DARK_LIME},{TCOD_DARKER_LIME},{TCOD_DARKEST_LIME}}, - {{TCOD_DESATURATED_CHARTREUSE},{TCOD_LIGHTEST_CHARTREUSE},{TCOD_LIGHTER_CHARTREUSE},{TCOD_LIGHT_CHARTREUSE},{TCOD_CHARTREUSE},{TCOD_DARK_CHARTREUSE},{TCOD_DARKER_CHARTREUSE},{TCOD_DARKEST_CHARTREUSE}}, - {{TCOD_DESATURATED_GREEN},{TCOD_LIGHTEST_GREEN},{TCOD_LIGHTER_GREEN},{TCOD_LIGHT_GREEN},{TCOD_GREEN},{TCOD_DARK_GREEN},{TCOD_DARKER_GREEN},{TCOD_DARKEST_GREEN}}, - {{TCOD_DESATURATED_SEA},{TCOD_LIGHTEST_SEA},{TCOD_LIGHTER_SEA},{TCOD_LIGHT_SEA},{TCOD_SEA},{TCOD_DARK_SEA},{TCOD_DARKER_SEA},{TCOD_DARKEST_SEA}}, - {{TCOD_DESATURATED_TURQUOISE},{TCOD_LIGHTEST_TURQUOISE},{TCOD_LIGHTER_TURQUOISE},{TCOD_LIGHT_TURQUOISE},{TCOD_TURQUOISE},{TCOD_DARK_TURQUOISE},{TCOD_DARKER_TURQUOISE},{TCOD_DARKEST_TURQUOISE}}, - {{TCOD_DESATURATED_CYAN},{TCOD_LIGHTEST_CYAN},{TCOD_LIGHTER_CYAN},{TCOD_LIGHT_CYAN},{TCOD_CYAN},{TCOD_DARK_CYAN},{TCOD_DARKER_CYAN},{TCOD_DARKEST_CYAN}}, - {{TCOD_DESATURATED_SKY},{TCOD_LIGHTEST_SKY},{TCOD_LIGHTER_SKY},{TCOD_LIGHT_SKY},{TCOD_SKY},{TCOD_DARK_SKY},{TCOD_DARKER_SKY},{TCOD_DARKEST_SKY}}, - {{TCOD_DESATURATED_AZURE},{TCOD_LIGHTEST_AZURE},{TCOD_LIGHTER_AZURE},{TCOD_LIGHT_AZURE},{TCOD_AZURE},{TCOD_DARK_AZURE},{TCOD_DARKER_AZURE},{TCOD_DARKEST_AZURE}}, - {{TCOD_DESATURATED_BLUE},{TCOD_LIGHTEST_BLUE},{TCOD_LIGHTER_BLUE},{TCOD_LIGHT_BLUE},{TCOD_BLUE},{TCOD_DARK_BLUE},{TCOD_DARKER_BLUE},{TCOD_DARKEST_BLUE}}, - {{TCOD_DESATURATED_HAN},{TCOD_LIGHTEST_HAN},{TCOD_LIGHTER_HAN},{TCOD_LIGHT_HAN},{TCOD_HAN},{TCOD_DARK_HAN},{TCOD_DARKER_HAN},{TCOD_DARKEST_HAN}}, - {{TCOD_DESATURATED_VIOLET},{TCOD_LIGHTEST_VIOLET},{TCOD_LIGHTER_VIOLET},{TCOD_LIGHT_VIOLET},{TCOD_VIOLET},{TCOD_DARK_VIOLET},{TCOD_DARKER_VIOLET},{TCOD_DARKEST_VIOLET}}, - {{TCOD_DESATURATED_PURPLE},{TCOD_LIGHTEST_PURPLE},{TCOD_LIGHTER_PURPLE},{TCOD_LIGHT_PURPLE},{TCOD_PURPLE},{TCOD_DARK_PURPLE},{TCOD_DARKER_PURPLE},{TCOD_DARKEST_PURPLE}}, - {{TCOD_DESATURATED_FUCHSIA},{TCOD_LIGHTEST_FUCHSIA},{TCOD_LIGHTER_FUCHSIA},{TCOD_LIGHT_FUCHSIA},{TCOD_FUCHSIA},{TCOD_DARK_FUCHSIA},{TCOD_DARKER_FUCHSIA},{TCOD_DARKEST_FUCHSIA}}, - {{TCOD_DESATURATED_MAGENTA},{TCOD_LIGHTEST_MAGENTA},{TCOD_LIGHTER_MAGENTA},{TCOD_LIGHT_MAGENTA},{TCOD_MAGENTA},{TCOD_DARK_MAGENTA},{TCOD_DARKER_MAGENTA},{TCOD_DARKEST_MAGENTA}}, - {{TCOD_DESATURATED_PINK},{TCOD_LIGHTEST_PINK},{TCOD_LIGHTER_PINK},{TCOD_LIGHT_PINK},{TCOD_PINK},{TCOD_DARK_PINK},{TCOD_DARKER_PINK},{TCOD_DARKEST_PINK}}, - {{TCOD_DESATURATED_CRIMSON},{TCOD_LIGHTEST_CRIMSON},{TCOD_LIGHTER_CRIMSON},{TCOD_LIGHT_CRIMSON},{TCOD_CRIMSON},{TCOD_DARK_CRIMSON},{TCOD_DARKER_CRIMSON},{TCOD_DARKEST_CRIMSON}} -}; -/** - * \brief Return a new TCOD_color_t from RGB values. - * - * This function is redundant, you should use a braced initializer instead: - * - * TCOD_color_t white = {255, 255, 255}; - */ -TCOD_color_t TCOD_color_RGB(uint8_t r, uint8_t g, uint8_t b) { - TCOD_color_t new_color = {r, g, b}; - return new_color; -} -/** - * \brief Return a new TCOD_color_t from HSV values. - * - * \param hue The colors hue (in degrees.) - * \param saturation The colors saturation (from 0 to 1) - * \param value The colors value (from 0 to 1) - * \return A new TCOD_color_t struct. - * - * The saturation and value parameters are automatically clamped to 0 and 1. - * - * TCOD_color_t light_blue = TCOD_color_HSV(240.0f, 0.75f, 1.0f); - * - * Use TCOD_color_set_HSV to fill an existing struct with HSV values. - */ -TCOD_color_t TCOD_color_HSV(float hue, float saturation, float value) { - TCOD_color_t new_color; - TCOD_color_set_HSV(&new_color, hue, saturation, value); - return new_color; -} -/** - * \brief Return a true value if c1 and c2 are equal. - */ -bool TCOD_color_equals(TCOD_color_t c1, TCOD_color_t c2) { - return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b); -} -/** - * \brief Add two colors together and return the result. - * - * \param c1 The first color. - * \param c2 The second color. - * \return A new TCOD_color_t struct with the result. - */ -TCOD_color_t TCOD_color_add(TCOD_color_t c1, TCOD_color_t c2) { - TCOD_color_t new_color = { - (uint8_t)MIN(255, (int)c1.r + c2.r), - (uint8_t)MIN(255, (int)c1.g + c2.g), - (uint8_t)MIN(255, (int)c1.b + c2.b)}; - return new_color; -} -/** - * \brief Subtract c2 from c1 and return the result. - * - * \param c1 The first color. - * \param c2 The second color. - * \return A new TCOD_color_t struct with the result. - */ -TCOD_color_t TCOD_color_subtract(TCOD_color_t c1, TCOD_color_t c2) { - TCOD_color_t new_color = { - (uint8_t)MAX(0, (int)c1.r - c2.r), - (uint8_t)MAX(0, (int)c1.g - c2.g), - (uint8_t)MAX(0, (int)c1.b - c2.b)}; - return new_color; -} -/** - * \brief Multiply two colors together and return the result. - * - * \param c1 The first color. - * \param c2 The second color. - * \return A new TCOD_color_t struct with the result. - */ -TCOD_color_t TCOD_color_multiply(TCOD_color_t c1, TCOD_color_t c2) { - TCOD_color_t new_color = { - (uint8_t)(((int)c1.r) * c2.r / 255), - (uint8_t)(((int)c1.g) * c2.g / 255), - (uint8_t)(((int)c1.b) * c2.b / 255)}; - return new_color; -} -/** - * \brief Multiply a color with a scalar value and return the result. - * - * \param c1 The color to multiply. - * \param value The scalar float. - * \return A new TCOD_color_t struct with the result. - */ -TCOD_color_t TCOD_color_multiply_scalar(TCOD_color_t c1, float value) { - TCOD_color_t new_color = { - (uint8_t)CLAMP(0.0f, 255.0f, (float)c1.r * value), - (uint8_t)CLAMP(0.0f, 255.0f, (float)c1.g * value), - (uint8_t)CLAMP(0.0f, 255.0f, (float)c1.b * value)}; - return new_color; -} -/** - * \brief Interpolate two colors together and return the result. - * - * \param c1 The first color (where coef if 0) - * \param c2 The second color (where coef if 1) - * \param coef The coefficient. - * \return A new TCOD_color_t struct with the result. - */ -TCOD_color_t TCOD_color_lerp(TCOD_color_t c1, TCOD_color_t c2, float coef) { - TCOD_color_t new_color = { - (uint8_t)(c1.r + (c2.r - c1.r) * coef), - (uint8_t)(c1.g + (c2.g - c1.g) * coef), - (uint8_t)(c1.b + (c2.b - c1.b) * coef)}; - return new_color; -} -/* Return floor modulo for double values. */ -static double fabsmod(double x, double n) { - double m = fmod(x, n); - return m < 0 ? m+n : m; -} - -/** - * \brief Sets a colors values from HSV values. - * - * \param color The color to be changed. - * \param hue The colors hue (in degrees.) - * \param saturation The colors saturation (from 0 to 1) - * \param value The colors value (from 0 to 1) - */ -void TCOD_color_set_HSV(TCOD_color_t *color, - float hue, float saturation, float value) { - int hue_section; - float hue_fraction, p, q, t; - - saturation = CLAMP(0.0f, 1.0f, saturation); - value = CLAMP(0.0f, 1.0f, value); - if( saturation == 0.0f ) { /* achromatic (grey) */ - color->r = color->g = color->b = (uint8_t)(value * 255.0f + 0.5f); - return; - } - - hue = (float)fabsmod(hue, 360.0f); - hue /= 60.0f; /* sector 0 to 5 */ - hue_section = (int)floor(hue); - hue_fraction = hue - hue_section; /* fraction between sections */ - p = value * (1 - saturation); - q = value * (1 - saturation * hue_fraction); - t = value * (1 - saturation * (1 - hue_fraction)); - - switch (hue_section) { - default: - case 0: /* red/yellow */ - color->r = (uint8_t)(value * 255.0f + 0.5f); - color->g = (uint8_t)(t * 255.0f + 0.5f); - color->b = (uint8_t)(p * 255.0f + 0.5f); - break; - case 1: /* yellow/green */ - color->r = (uint8_t)(q * 255.0f + 0.5f); - color->g = (uint8_t)(value * 255.0f + 0.5f); - color->b = (uint8_t)(p * 255.0f + 0.5f); - break; - case 2: /* green/cyan */ - color->r = (uint8_t)(p * 255.0f + 0.5f); - color->g = (uint8_t)(value * 255.0f + 0.5f); - color->b = (uint8_t)(t * 255.0f + 0.5f); - break; - case 3: /* cyan/blue */ - color->r = (uint8_t)(p * 255.0f + 0.5f); - color->g = (uint8_t)(q * 255.0f + 0.5f); - color->b = (uint8_t)(value * 255.0f + 0.5f); - break; - case 4: /* blue/purple */ - color->r = (uint8_t)(t * 255.0f + 0.5f); - color->g = (uint8_t)(p * 255.0f + 0.5f); - color->b = (uint8_t)(value * 255.0f + 0.5f); - break; - case 5: /* purple/red */ - color->r = (uint8_t)(value * 255.0f + 0.5f); - color->g = (uint8_t)(p * 255.0f + 0.5f); - color->b = (uint8_t)(q * 255.0f + 0.5f); - break; - } -} -/** - * \brief Get a set of HSV values from a color. - * - * \param color The color - * \param hue Pointer to a float, filled with the hue. (degrees) - * \param saturation Pointer to a float, filled with the saturation. (0 to 1) - * \param value Pointer to a float, filled with the value. (0 to 1) - * - * The hue, saturation, and value parameters can not be NULL pointers, - */ -void TCOD_color_get_HSV(TCOD_color_t color, - float *hue, float *saturation, float *value) { - *hue = TCOD_color_get_hue(color); - *saturation = TCOD_color_get_saturation(color); - *value = TCOD_color_get_value(color); - return; -} -/** - * \brief Return a colors hue. - * - * \param color A color struct. - * \return The colors hue. (degrees) - */ -float TCOD_color_get_hue(TCOD_color_t color) { - uint8_t max = MAX(color.r, MAX(color.g, color.b)); - uint8_t min = MIN(color.r, MIN(color.g, color.b)); - float delta = (float)max - (float)min; - float hue; /* degrees */ - if (delta == 0.0f) { return 0.0f; } /* achromatic, including black */ - if (color.r == max) { - hue = (float)(color.g - color.b) / delta; - } else if (color.g == max) { - hue = 2.0f + (float)(color.b - color.r) / delta; - } else { - hue = 4.0f + (float)(color.r - color.g) / delta; - } - hue *= 60.0f; - hue = (float)fabsmod(hue, 360.0f); - return hue; -} -/** - * \brief Change a colors hue. - * - * \param color Pointer to a color struct. - * \param hue The hue in degrees. - */ -void TCOD_color_set_hue(TCOD_color_t *color, float hue) { - TCOD_color_set_HSV(color, - hue, - TCOD_color_get_saturation(*color), - TCOD_color_get_value(*color)); -} -/** - * \brief Return a colors saturation. - * - * \param color A color struct. - * \return The colors saturation. (0 to 1) - */ -float TCOD_color_get_saturation (TCOD_color_t color) { - float max = (float)(MAX(color.r, MAX(color.g, color.b))) / 255.0f; - float min = (float)(MIN(color.r, MIN(color.g, color.b))) / 255.0f; - float delta = max - min; - if (max == 0.0f) { return 0.0f; } - return delta / max; -} -/** - * \brief Change a colors saturation. - * - * \param color Pointer to a color struct. - * \param saturation The desired saturation value. - */ -void TCOD_color_set_saturation(TCOD_color_t *color, float saturation) { - TCOD_color_set_HSV(color, - TCOD_color_get_hue(*color), - saturation, - TCOD_color_get_value(*color)); -} -/** - * \brief Get a colors value. - * - * \param color A color struct. - * \return The colors value. (0 to 1) - */ -float TCOD_color_get_value(TCOD_color_t color) { - return (float)(MAX(color.r, MAX(color.g, color.b))) / 255.0f; -} -/** - * \brief Change a colors value. - * - * \param color Pointer to a color struct. - * \param value The desired value. - */ -void TCOD_color_set_value(TCOD_color_t *color, float value) { - TCOD_color_set_HSV(color, - TCOD_color_get_hue(*color), - TCOD_color_get_saturation(*color), - value); -} -/** - * \brief Shift a colors hue by an amount. - * - * \param color Pointer to a color struct. - * \param hue_shift The distance to shift the hue, in degrees. - */ -void TCOD_color_shift_hue(TCOD_color_t *color, float hue_shift) { - if (hue_shift == 0.0f) { return; } - TCOD_color_set_HSV(color, - TCOD_color_get_hue(*color) + hue_shift, - TCOD_color_get_saturation(*color), - TCOD_color_get_value(*color)); -} -/** - * \brief Scale a colors saturation and value. - * - * \param color Pointer to a color struct. - * \param saturation_coef Multiplier for this colors saturation. - * \param value_coef Multiplier for this colors value. - */ -void TCOD_color_scale_HSV(TCOD_color_t *color, - float saturation_coef, float value_coef) { - TCOD_color_set_HSV(color, - TCOD_color_get_hue(*color), - TCOD_color_get_saturation(*color) * saturation_coef, - TCOD_color_get_value(*color) * value_coef); -} -/** - * \brief Generate an interpolated gradient of colors. - * - * \param map Array to fill with the new gradient. - * \param nb_key The array size of the key_color and key_index parameters. - * \param key_color An array of colors to use, in order. - * \param key_index An array mapping key_color items to the map array. - * - * \verbatim embed:rst:leading-asterisk - * .. code-block:: c - * - * TCOD_color_t[256] gradient; - * TCOD_color_t[4] key_color = {TCOD_black, TCOD_dark_amber, - * TCOD_cyan, TCOD_white}; - * int[4] key_index = {0, 64, 192, 255}; - * TCOD_color_gen_map(&gradient, 4, &key_color, &key_index); - * \endverbatim - */ -void TCOD_color_gen_map(TCOD_color_t *map, int nb_key, - const TCOD_color_t *key_color, const int *key_index) { - int segment = 0; - for (segment = 0; segment < nb_key - 1; ++segment) { - int idx_start = key_index[segment]; - int idx_end = key_index[segment + 1]; - int idx; - for (idx = idx_start; idx <= idx_end; ++idx) { - map[idx] = TCOD_color_lerp( - key_color[segment], - key_color[segment + 1], - (float)(idx - idx_start) / (idx_end - idx_start)); - } - } -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "color.h" + +#include + +#include "libtcod_int.h" +#include "utility.h" + +/* grey levels */ +const TCOD_color_t TCOD_black={TCOD_BLACK}; +const TCOD_color_t TCOD_darkest_grey={TCOD_DARKEST_GREY}; +const TCOD_color_t TCOD_darker_grey={TCOD_DARKER_GREY}; +const TCOD_color_t TCOD_dark_grey={TCOD_DARK_GREY}; +const TCOD_color_t TCOD_grey={TCOD_GREY}; +const TCOD_color_t TCOD_light_grey={TCOD_LIGHT_GREY}; +const TCOD_color_t TCOD_lighter_grey={TCOD_LIGHTER_GREY}; +const TCOD_color_t TCOD_lightest_grey={TCOD_LIGHTEST_GREY}; +const TCOD_color_t TCOD_darkest_gray={TCOD_DARKEST_GREY}; +const TCOD_color_t TCOD_darker_gray={TCOD_DARKER_GREY}; +const TCOD_color_t TCOD_dark_gray={TCOD_DARK_GREY}; +const TCOD_color_t TCOD_gray={TCOD_GREY}; +const TCOD_color_t TCOD_light_gray={TCOD_LIGHT_GREY}; +const TCOD_color_t TCOD_lighter_gray={TCOD_LIGHTER_GREY}; +const TCOD_color_t TCOD_lightest_gray={TCOD_LIGHTEST_GREY}; +const TCOD_color_t TCOD_white={TCOD_WHITE}; + +/* sepia */ +const TCOD_color_t TCOD_darkest_sepia={TCOD_DARKEST_SEPIA}; +const TCOD_color_t TCOD_darker_sepia={TCOD_DARKER_SEPIA}; +const TCOD_color_t TCOD_dark_sepia={TCOD_DARK_SEPIA}; +const TCOD_color_t TCOD_sepia={TCOD_SEPIA}; +const TCOD_color_t TCOD_light_sepia={TCOD_LIGHT_SEPIA}; +const TCOD_color_t TCOD_lighter_sepia={TCOD_LIGHTER_SEPIA}; +const TCOD_color_t TCOD_lightest_sepia={TCOD_LIGHTEST_SEPIA}; + +/* standard colors */ +const TCOD_color_t TCOD_red = {TCOD_RED}; +const TCOD_color_t TCOD_flame = {TCOD_FLAME}; +const TCOD_color_t TCOD_orange = {TCOD_ORANGE}; +const TCOD_color_t TCOD_amber = {TCOD_AMBER}; +const TCOD_color_t TCOD_yellow = {TCOD_YELLOW}; +const TCOD_color_t TCOD_lime = {TCOD_LIME}; +const TCOD_color_t TCOD_chartreuse = {TCOD_CHARTREUSE}; +const TCOD_color_t TCOD_green = {TCOD_GREEN}; +const TCOD_color_t TCOD_sea = {TCOD_SEA}; +const TCOD_color_t TCOD_turquoise = {TCOD_TURQUOISE}; +const TCOD_color_t TCOD_cyan = {TCOD_CYAN}; +const TCOD_color_t TCOD_sky = {TCOD_SKY}; +const TCOD_color_t TCOD_azure = {TCOD_AZURE}; +const TCOD_color_t TCOD_blue = {TCOD_BLUE}; +const TCOD_color_t TCOD_han = {TCOD_HAN}; +const TCOD_color_t TCOD_violet = {TCOD_VIOLET}; +const TCOD_color_t TCOD_purple = {TCOD_PURPLE}; +const TCOD_color_t TCOD_fuchsia = {TCOD_FUCHSIA}; +const TCOD_color_t TCOD_magenta = {TCOD_MAGENTA}; +const TCOD_color_t TCOD_pink = {TCOD_PINK}; +const TCOD_color_t TCOD_crimson = {TCOD_CRIMSON}; + +/* dark colors */ +const TCOD_color_t TCOD_dark_red = {TCOD_DARK_RED}; +const TCOD_color_t TCOD_dark_flame = {TCOD_DARK_FLAME}; +const TCOD_color_t TCOD_dark_orange = {TCOD_DARK_ORANGE}; +const TCOD_color_t TCOD_dark_amber = {TCOD_DARK_AMBER}; +const TCOD_color_t TCOD_dark_yellow = {TCOD_DARK_YELLOW}; +const TCOD_color_t TCOD_dark_lime = {TCOD_DARK_LIME}; +const TCOD_color_t TCOD_dark_chartreuse = {TCOD_DARK_CHARTREUSE}; +const TCOD_color_t TCOD_dark_green = {TCOD_DARK_GREEN}; +const TCOD_color_t TCOD_dark_sea = {TCOD_DARK_SEA}; +const TCOD_color_t TCOD_dark_turquoise = {TCOD_DARK_TURQUOISE}; +const TCOD_color_t TCOD_dark_cyan = {TCOD_DARK_CYAN}; +const TCOD_color_t TCOD_dark_sky = {TCOD_DARK_SKY}; +const TCOD_color_t TCOD_dark_azure = {TCOD_DARK_AZURE}; +const TCOD_color_t TCOD_dark_blue = {TCOD_DARK_BLUE}; +const TCOD_color_t TCOD_dark_han = {TCOD_DARK_HAN}; +const TCOD_color_t TCOD_dark_violet = {TCOD_DARK_VIOLET}; +const TCOD_color_t TCOD_dark_purple = {TCOD_DARK_PURPLE}; +const TCOD_color_t TCOD_dark_fuchsia = {TCOD_DARK_FUCHSIA}; +const TCOD_color_t TCOD_dark_magenta = {TCOD_DARK_MAGENTA}; +const TCOD_color_t TCOD_dark_pink = {TCOD_DARK_PINK}; +const TCOD_color_t TCOD_dark_crimson = {TCOD_DARK_CRIMSON}; + +/* darker colors */ +const TCOD_color_t TCOD_darker_red = {TCOD_DARKER_RED}; +const TCOD_color_t TCOD_darker_flame = {TCOD_DARKER_FLAME}; +const TCOD_color_t TCOD_darker_orange = {TCOD_DARKER_ORANGE}; +const TCOD_color_t TCOD_darker_amber = {TCOD_DARKER_AMBER}; +const TCOD_color_t TCOD_darker_yellow = {TCOD_DARKER_YELLOW}; +const TCOD_color_t TCOD_darker_lime = {TCOD_DARKER_LIME}; +const TCOD_color_t TCOD_darker_chartreuse = {TCOD_DARKER_CHARTREUSE}; +const TCOD_color_t TCOD_darker_green = {TCOD_DARKER_GREEN}; +const TCOD_color_t TCOD_darker_sea = {TCOD_DARKER_SEA}; +const TCOD_color_t TCOD_darker_turquoise = {TCOD_DARKER_TURQUOISE}; +const TCOD_color_t TCOD_darker_cyan = {TCOD_DARKER_CYAN}; +const TCOD_color_t TCOD_darker_sky = {TCOD_DARKER_SKY}; +const TCOD_color_t TCOD_darker_azure = {TCOD_DARKER_AZURE}; +const TCOD_color_t TCOD_darker_blue = {TCOD_DARKER_BLUE}; +const TCOD_color_t TCOD_darker_han = {TCOD_DARKER_HAN}; +const TCOD_color_t TCOD_darker_violet = {TCOD_DARKER_VIOLET}; +const TCOD_color_t TCOD_darker_purple = {TCOD_DARKER_PURPLE}; +const TCOD_color_t TCOD_darker_fuchsia = {TCOD_DARKER_FUCHSIA}; +const TCOD_color_t TCOD_darker_magenta = {TCOD_DARKER_MAGENTA}; +const TCOD_color_t TCOD_darker_pink = {TCOD_DARKER_PINK}; +const TCOD_color_t TCOD_darker_crimson = {TCOD_DARKER_CRIMSON}; + +/* darkest colors */ +const TCOD_color_t TCOD_darkest_red = {TCOD_DARKEST_RED}; +const TCOD_color_t TCOD_darkest_flame = {TCOD_DARKEST_FLAME}; +const TCOD_color_t TCOD_darkest_orange = {TCOD_DARKEST_ORANGE}; +const TCOD_color_t TCOD_darkest_amber = {TCOD_DARKEST_AMBER}; +const TCOD_color_t TCOD_darkest_yellow = {TCOD_DARKEST_YELLOW}; +const TCOD_color_t TCOD_darkest_lime = {TCOD_DARKEST_LIME}; +const TCOD_color_t TCOD_darkest_chartreuse = {TCOD_DARKEST_CHARTREUSE}; +const TCOD_color_t TCOD_darkest_green = {TCOD_DARKEST_GREEN}; +const TCOD_color_t TCOD_darkest_sea = {TCOD_DARKEST_SEA}; +const TCOD_color_t TCOD_darkest_turquoise = {TCOD_DARKEST_TURQUOISE}; +const TCOD_color_t TCOD_darkest_cyan = {TCOD_DARKEST_CYAN}; +const TCOD_color_t TCOD_darkest_sky = {TCOD_DARKEST_SKY}; +const TCOD_color_t TCOD_darkest_azure = {TCOD_DARKEST_AZURE}; +const TCOD_color_t TCOD_darkest_blue = {TCOD_DARKEST_BLUE}; +const TCOD_color_t TCOD_darkest_han = {TCOD_DARKEST_HAN}; +const TCOD_color_t TCOD_darkest_violet = {TCOD_DARKEST_VIOLET}; +const TCOD_color_t TCOD_darkest_purple = {TCOD_DARKEST_PURPLE}; +const TCOD_color_t TCOD_darkest_fuchsia = {TCOD_DARKEST_FUCHSIA}; +const TCOD_color_t TCOD_darkest_magenta = {TCOD_DARKEST_MAGENTA}; +const TCOD_color_t TCOD_darkest_pink = {TCOD_DARKEST_PINK}; +const TCOD_color_t TCOD_darkest_crimson = {TCOD_DARKEST_CRIMSON}; + +/* light colors */ +const TCOD_color_t TCOD_light_red = {TCOD_LIGHT_RED}; +const TCOD_color_t TCOD_light_flame = {TCOD_LIGHT_FLAME}; +const TCOD_color_t TCOD_light_orange = {TCOD_LIGHT_ORANGE}; +const TCOD_color_t TCOD_light_amber = {TCOD_LIGHT_AMBER}; +const TCOD_color_t TCOD_light_yellow = {TCOD_LIGHT_YELLOW}; +const TCOD_color_t TCOD_light_lime = {TCOD_LIGHT_LIME}; +const TCOD_color_t TCOD_light_chartreuse = {TCOD_LIGHT_CHARTREUSE}; +const TCOD_color_t TCOD_light_green = {TCOD_LIGHT_GREEN}; +const TCOD_color_t TCOD_light_sea = {TCOD_LIGHT_SEA}; +const TCOD_color_t TCOD_light_turquoise = {TCOD_LIGHT_TURQUOISE}; +const TCOD_color_t TCOD_light_cyan = {TCOD_LIGHT_CYAN}; +const TCOD_color_t TCOD_light_sky = {TCOD_LIGHT_SKY}; +const TCOD_color_t TCOD_light_azure = {TCOD_LIGHT_AZURE}; +const TCOD_color_t TCOD_light_blue = {TCOD_LIGHT_BLUE}; +const TCOD_color_t TCOD_light_han = {TCOD_LIGHT_HAN}; +const TCOD_color_t TCOD_light_violet = {TCOD_LIGHT_VIOLET}; +const TCOD_color_t TCOD_light_purple = {TCOD_LIGHT_PURPLE}; +const TCOD_color_t TCOD_light_fuchsia = {TCOD_LIGHT_FUCHSIA}; +const TCOD_color_t TCOD_light_magenta = {TCOD_LIGHT_MAGENTA}; +const TCOD_color_t TCOD_light_pink = {TCOD_LIGHT_PINK}; +const TCOD_color_t TCOD_light_crimson = {TCOD_LIGHT_CRIMSON}; + +/*lighter colors */ +const TCOD_color_t TCOD_lighter_red = {TCOD_LIGHTER_RED}; +const TCOD_color_t TCOD_lighter_flame = {TCOD_LIGHTER_FLAME}; +const TCOD_color_t TCOD_lighter_orange = {TCOD_LIGHTER_ORANGE}; +const TCOD_color_t TCOD_lighter_amber = {TCOD_LIGHTER_AMBER}; +const TCOD_color_t TCOD_lighter_yellow = {TCOD_LIGHTER_YELLOW}; +const TCOD_color_t TCOD_lighter_lime = {TCOD_LIGHTER_LIME}; +const TCOD_color_t TCOD_lighter_chartreuse = {TCOD_LIGHTER_CHARTREUSE}; +const TCOD_color_t TCOD_lighter_green = {TCOD_LIGHTER_GREEN}; +const TCOD_color_t TCOD_lighter_sea = {TCOD_LIGHTER_SEA}; +const TCOD_color_t TCOD_lighter_turquoise = {TCOD_LIGHTER_TURQUOISE}; +const TCOD_color_t TCOD_lighter_cyan = {TCOD_LIGHTER_CYAN}; +const TCOD_color_t TCOD_lighter_sky = {TCOD_LIGHTER_SKY}; +const TCOD_color_t TCOD_lighter_azure = {TCOD_LIGHTER_AZURE}; +const TCOD_color_t TCOD_lighter_blue = {TCOD_LIGHTER_BLUE}; +const TCOD_color_t TCOD_lighter_han = {TCOD_LIGHTER_HAN}; +const TCOD_color_t TCOD_lighter_violet = {TCOD_LIGHTER_VIOLET}; +const TCOD_color_t TCOD_lighter_purple = {TCOD_LIGHTER_PURPLE}; +const TCOD_color_t TCOD_lighter_fuchsia = {TCOD_LIGHTER_FUCHSIA}; +const TCOD_color_t TCOD_lighter_magenta = {TCOD_LIGHTER_MAGENTA}; +const TCOD_color_t TCOD_lighter_pink = {TCOD_LIGHTER_PINK}; +const TCOD_color_t TCOD_lighter_crimson = {TCOD_LIGHTER_CRIMSON}; + +/* lightest colors */ +const TCOD_color_t TCOD_lightest_red = {TCOD_LIGHTEST_RED}; +const TCOD_color_t TCOD_lightest_flame = {TCOD_LIGHTEST_FLAME}; +const TCOD_color_t TCOD_lightest_orange = {TCOD_LIGHTEST_ORANGE}; +const TCOD_color_t TCOD_lightest_amber = {TCOD_LIGHTEST_AMBER}; +const TCOD_color_t TCOD_lightest_yellow = {TCOD_LIGHTEST_YELLOW}; +const TCOD_color_t TCOD_lightest_lime = {TCOD_LIGHTEST_LIME}; +const TCOD_color_t TCOD_lightest_chartreuse = {TCOD_LIGHTEST_CHARTREUSE}; +const TCOD_color_t TCOD_lightest_green = {TCOD_LIGHTEST_GREEN}; +const TCOD_color_t TCOD_lightest_sea = {TCOD_LIGHTEST_SEA}; +const TCOD_color_t TCOD_lightest_turquoise = {TCOD_LIGHTEST_TURQUOISE}; +const TCOD_color_t TCOD_lightest_cyan = {TCOD_LIGHTEST_CYAN}; +const TCOD_color_t TCOD_lightest_sky = {TCOD_LIGHTEST_SKY}; +const TCOD_color_t TCOD_lightest_azure = {TCOD_LIGHTEST_AZURE}; +const TCOD_color_t TCOD_lightest_blue = {TCOD_LIGHTEST_BLUE}; +const TCOD_color_t TCOD_lightest_han = {TCOD_LIGHTEST_HAN}; +const TCOD_color_t TCOD_lightest_violet = {TCOD_LIGHTEST_VIOLET}; +const TCOD_color_t TCOD_lightest_purple = {TCOD_LIGHTEST_PURPLE}; +const TCOD_color_t TCOD_lightest_fuchsia = {TCOD_LIGHTEST_FUCHSIA}; +const TCOD_color_t TCOD_lightest_magenta = {TCOD_LIGHTEST_MAGENTA}; +const TCOD_color_t TCOD_lightest_pink = {TCOD_LIGHTEST_PINK}; +const TCOD_color_t TCOD_lightest_crimson = {TCOD_LIGHTEST_CRIMSON}; + +/* desaturated colors */ +const TCOD_color_t TCOD_desaturated_red = {TCOD_DESATURATED_RED}; +const TCOD_color_t TCOD_desaturated_flame = {TCOD_DESATURATED_FLAME}; +const TCOD_color_t TCOD_desaturated_orange = {TCOD_DESATURATED_ORANGE}; +const TCOD_color_t TCOD_desaturated_amber = {TCOD_DESATURATED_AMBER}; +const TCOD_color_t TCOD_desaturated_yellow = {TCOD_DESATURATED_YELLOW}; +const TCOD_color_t TCOD_desaturated_lime = {TCOD_DESATURATED_LIME}; +const TCOD_color_t TCOD_desaturated_chartreuse = {TCOD_DESATURATED_CHARTREUSE}; +const TCOD_color_t TCOD_desaturated_green = {TCOD_DESATURATED_GREEN}; +const TCOD_color_t TCOD_desaturated_sea = {TCOD_DESATURATED_SEA}; +const TCOD_color_t TCOD_desaturated_turquoise = {TCOD_DESATURATED_TURQUOISE}; +const TCOD_color_t TCOD_desaturated_cyan = {TCOD_DESATURATED_CYAN}; +const TCOD_color_t TCOD_desaturated_sky = {TCOD_DESATURATED_SKY}; +const TCOD_color_t TCOD_desaturated_azure = {TCOD_DESATURATED_AZURE}; +const TCOD_color_t TCOD_desaturated_blue = {TCOD_DESATURATED_BLUE}; +const TCOD_color_t TCOD_desaturated_han = {TCOD_DESATURATED_HAN}; +const TCOD_color_t TCOD_desaturated_violet = {TCOD_DESATURATED_VIOLET}; +const TCOD_color_t TCOD_desaturated_purple = {TCOD_DESATURATED_PURPLE}; +const TCOD_color_t TCOD_desaturated_fuchsia = {TCOD_DESATURATED_FUCHSIA}; +const TCOD_color_t TCOD_desaturated_magenta = {TCOD_DESATURATED_MAGENTA}; +const TCOD_color_t TCOD_desaturated_pink = {TCOD_DESATURATED_PINK}; +const TCOD_color_t TCOD_desaturated_crimson = {TCOD_DESATURATED_CRIMSON}; + +/* metallic */ +const TCOD_color_t TCOD_brass = {TCOD_BRASS}; +const TCOD_color_t TCOD_copper = {TCOD_COPPER}; +const TCOD_color_t TCOD_gold = {TCOD_GOLD}; +const TCOD_color_t TCOD_silver = {TCOD_SILVER}; + +/* miscellaneous */ +const TCOD_color_t TCOD_celadon = {TCOD_CELADON}; +const TCOD_color_t TCOD_peach = {TCOD_PEACH}; + +/* color array */ +const TCOD_color_t TCOD_colors[TCOD_COLOR_NB][TCOD_COLOR_LEVELS] = { + {{TCOD_DESATURATED_RED},{TCOD_LIGHTEST_RED},{TCOD_LIGHTER_RED},{TCOD_LIGHT_RED},{TCOD_RED},{TCOD_DARK_RED},{TCOD_DARKER_RED},{TCOD_DARKEST_RED}}, + {{TCOD_DESATURATED_FLAME},{TCOD_LIGHTEST_FLAME},{TCOD_LIGHTER_FLAME},{TCOD_LIGHT_FLAME},{TCOD_FLAME},{TCOD_DARK_FLAME},{TCOD_DARKER_FLAME},{TCOD_DARKEST_FLAME}}, + {{TCOD_DESATURATED_ORANGE},{TCOD_LIGHTEST_ORANGE},{TCOD_LIGHTER_ORANGE},{TCOD_LIGHT_ORANGE},{TCOD_ORANGE},{TCOD_DARK_ORANGE},{TCOD_DARKER_ORANGE},{TCOD_DARKEST_ORANGE}}, + {{TCOD_DESATURATED_AMBER},{TCOD_LIGHTEST_AMBER},{TCOD_LIGHTER_AMBER},{TCOD_LIGHT_AMBER},{TCOD_AMBER},{TCOD_DARK_AMBER},{TCOD_DARKER_AMBER},{TCOD_DARKEST_AMBER}}, + {{TCOD_DESATURATED_YELLOW},{TCOD_LIGHTEST_YELLOW},{TCOD_LIGHTER_YELLOW},{TCOD_LIGHT_YELLOW},{TCOD_YELLOW},{TCOD_DARK_YELLOW},{TCOD_DARKER_YELLOW},{TCOD_DARKEST_YELLOW}}, + {{TCOD_DESATURATED_LIME},{TCOD_LIGHTEST_LIME},{TCOD_LIGHTER_LIME},{TCOD_LIGHT_LIME},{TCOD_LIME},{TCOD_DARK_LIME},{TCOD_DARKER_LIME},{TCOD_DARKEST_LIME}}, + {{TCOD_DESATURATED_CHARTREUSE},{TCOD_LIGHTEST_CHARTREUSE},{TCOD_LIGHTER_CHARTREUSE},{TCOD_LIGHT_CHARTREUSE},{TCOD_CHARTREUSE},{TCOD_DARK_CHARTREUSE},{TCOD_DARKER_CHARTREUSE},{TCOD_DARKEST_CHARTREUSE}}, + {{TCOD_DESATURATED_GREEN},{TCOD_LIGHTEST_GREEN},{TCOD_LIGHTER_GREEN},{TCOD_LIGHT_GREEN},{TCOD_GREEN},{TCOD_DARK_GREEN},{TCOD_DARKER_GREEN},{TCOD_DARKEST_GREEN}}, + {{TCOD_DESATURATED_SEA},{TCOD_LIGHTEST_SEA},{TCOD_LIGHTER_SEA},{TCOD_LIGHT_SEA},{TCOD_SEA},{TCOD_DARK_SEA},{TCOD_DARKER_SEA},{TCOD_DARKEST_SEA}}, + {{TCOD_DESATURATED_TURQUOISE},{TCOD_LIGHTEST_TURQUOISE},{TCOD_LIGHTER_TURQUOISE},{TCOD_LIGHT_TURQUOISE},{TCOD_TURQUOISE},{TCOD_DARK_TURQUOISE},{TCOD_DARKER_TURQUOISE},{TCOD_DARKEST_TURQUOISE}}, + {{TCOD_DESATURATED_CYAN},{TCOD_LIGHTEST_CYAN},{TCOD_LIGHTER_CYAN},{TCOD_LIGHT_CYAN},{TCOD_CYAN},{TCOD_DARK_CYAN},{TCOD_DARKER_CYAN},{TCOD_DARKEST_CYAN}}, + {{TCOD_DESATURATED_SKY},{TCOD_LIGHTEST_SKY},{TCOD_LIGHTER_SKY},{TCOD_LIGHT_SKY},{TCOD_SKY},{TCOD_DARK_SKY},{TCOD_DARKER_SKY},{TCOD_DARKEST_SKY}}, + {{TCOD_DESATURATED_AZURE},{TCOD_LIGHTEST_AZURE},{TCOD_LIGHTER_AZURE},{TCOD_LIGHT_AZURE},{TCOD_AZURE},{TCOD_DARK_AZURE},{TCOD_DARKER_AZURE},{TCOD_DARKEST_AZURE}}, + {{TCOD_DESATURATED_BLUE},{TCOD_LIGHTEST_BLUE},{TCOD_LIGHTER_BLUE},{TCOD_LIGHT_BLUE},{TCOD_BLUE},{TCOD_DARK_BLUE},{TCOD_DARKER_BLUE},{TCOD_DARKEST_BLUE}}, + {{TCOD_DESATURATED_HAN},{TCOD_LIGHTEST_HAN},{TCOD_LIGHTER_HAN},{TCOD_LIGHT_HAN},{TCOD_HAN},{TCOD_DARK_HAN},{TCOD_DARKER_HAN},{TCOD_DARKEST_HAN}}, + {{TCOD_DESATURATED_VIOLET},{TCOD_LIGHTEST_VIOLET},{TCOD_LIGHTER_VIOLET},{TCOD_LIGHT_VIOLET},{TCOD_VIOLET},{TCOD_DARK_VIOLET},{TCOD_DARKER_VIOLET},{TCOD_DARKEST_VIOLET}}, + {{TCOD_DESATURATED_PURPLE},{TCOD_LIGHTEST_PURPLE},{TCOD_LIGHTER_PURPLE},{TCOD_LIGHT_PURPLE},{TCOD_PURPLE},{TCOD_DARK_PURPLE},{TCOD_DARKER_PURPLE},{TCOD_DARKEST_PURPLE}}, + {{TCOD_DESATURATED_FUCHSIA},{TCOD_LIGHTEST_FUCHSIA},{TCOD_LIGHTER_FUCHSIA},{TCOD_LIGHT_FUCHSIA},{TCOD_FUCHSIA},{TCOD_DARK_FUCHSIA},{TCOD_DARKER_FUCHSIA},{TCOD_DARKEST_FUCHSIA}}, + {{TCOD_DESATURATED_MAGENTA},{TCOD_LIGHTEST_MAGENTA},{TCOD_LIGHTER_MAGENTA},{TCOD_LIGHT_MAGENTA},{TCOD_MAGENTA},{TCOD_DARK_MAGENTA},{TCOD_DARKER_MAGENTA},{TCOD_DARKEST_MAGENTA}}, + {{TCOD_DESATURATED_PINK},{TCOD_LIGHTEST_PINK},{TCOD_LIGHTER_PINK},{TCOD_LIGHT_PINK},{TCOD_PINK},{TCOD_DARK_PINK},{TCOD_DARKER_PINK},{TCOD_DARKEST_PINK}}, + {{TCOD_DESATURATED_CRIMSON},{TCOD_LIGHTEST_CRIMSON},{TCOD_LIGHTER_CRIMSON},{TCOD_LIGHT_CRIMSON},{TCOD_CRIMSON},{TCOD_DARK_CRIMSON},{TCOD_DARKER_CRIMSON},{TCOD_DARKEST_CRIMSON}} +}; +/** + * \brief Return a new TCOD_color_t from RGB values. + * + * This function is redundant, you should use a braced initializer instead: + * + * TCOD_color_t white = {255, 255, 255}; + */ +TCOD_color_t TCOD_color_RGB(uint8_t r, uint8_t g, uint8_t b) { + TCOD_color_t new_color = {r, g, b}; + return new_color; +} +/** + * \brief Return a new TCOD_color_t from HSV values. + * + * \param hue The colors hue (in degrees.) + * \param saturation The colors saturation (from 0 to 1) + * \param value The colors value (from 0 to 1) + * \return A new TCOD_color_t struct. + * + * The saturation and value parameters are automatically clamped to 0 and 1. + * + * TCOD_color_t light_blue = TCOD_color_HSV(240.0f, 0.75f, 1.0f); + * + * Use TCOD_color_set_HSV to fill an existing struct with HSV values. + */ +TCOD_color_t TCOD_color_HSV(float hue, float saturation, float value) { + TCOD_color_t new_color; + TCOD_color_set_HSV(&new_color, hue, saturation, value); + return new_color; +} +/** + * \brief Return a true value if c1 and c2 are equal. + */ +bool TCOD_color_equals(TCOD_color_t c1, TCOD_color_t c2) { + return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b); +} +/** + * \brief Add two colors together and return the result. + * + * \param c1 The first color. + * \param c2 The second color. + * \return A new TCOD_color_t struct with the result. + */ +TCOD_color_t TCOD_color_add(TCOD_color_t c1, TCOD_color_t c2) { + TCOD_color_t new_color = { + (uint8_t)MIN(255, (int)c1.r + c2.r), + (uint8_t)MIN(255, (int)c1.g + c2.g), + (uint8_t)MIN(255, (int)c1.b + c2.b)}; + return new_color; +} +/** + * \brief Subtract c2 from c1 and return the result. + * + * \param c1 The first color. + * \param c2 The second color. + * \return A new TCOD_color_t struct with the result. + */ +TCOD_color_t TCOD_color_subtract(TCOD_color_t c1, TCOD_color_t c2) { + TCOD_color_t new_color = { + (uint8_t)MAX(0, (int)c1.r - c2.r), + (uint8_t)MAX(0, (int)c1.g - c2.g), + (uint8_t)MAX(0, (int)c1.b - c2.b)}; + return new_color; +} +/** + * \brief Multiply two colors together and return the result. + * + * \param c1 The first color. + * \param c2 The second color. + * \return A new TCOD_color_t struct with the result. + */ +TCOD_color_t TCOD_color_multiply(TCOD_color_t c1, TCOD_color_t c2) { + TCOD_color_t new_color = { + (uint8_t)(((int)c1.r) * c2.r / 255), + (uint8_t)(((int)c1.g) * c2.g / 255), + (uint8_t)(((int)c1.b) * c2.b / 255)}; + return new_color; +} +/** + * \brief Multiply a color with a scalar value and return the result. + * + * \param c1 The color to multiply. + * \param value The scalar float. + * \return A new TCOD_color_t struct with the result. + */ +TCOD_color_t TCOD_color_multiply_scalar(TCOD_color_t c1, float value) { + TCOD_color_t new_color = { + (uint8_t)CLAMP(0.0f, 255.0f, (float)c1.r * value), + (uint8_t)CLAMP(0.0f, 255.0f, (float)c1.g * value), + (uint8_t)CLAMP(0.0f, 255.0f, (float)c1.b * value)}; + return new_color; +} +/** + * \brief Interpolate two colors together and return the result. + * + * \param c1 The first color (where coef if 0) + * \param c2 The second color (where coef if 1) + * \param coef The coefficient. + * \return A new TCOD_color_t struct with the result. + */ +TCOD_color_t TCOD_color_lerp(TCOD_color_t c1, TCOD_color_t c2, float coef) { + TCOD_color_t new_color = { + (uint8_t)(c1.r + (c2.r - c1.r) * coef), + (uint8_t)(c1.g + (c2.g - c1.g) * coef), + (uint8_t)(c1.b + (c2.b - c1.b) * coef)}; + return new_color; +} +/* Return floor modulo for double values. */ +static double fabsmod(double x, double n) { + double m = fmod(x, n); + return m < 0 ? m+n : m; +} + +/** + * \brief Sets a colors values from HSV values. + * + * \param color The color to be changed. + * \param hue The colors hue (in degrees.) + * \param saturation The colors saturation (from 0 to 1) + * \param value The colors value (from 0 to 1) + */ +void TCOD_color_set_HSV(TCOD_color_t *color, + float hue, float saturation, float value) { + int hue_section; + float hue_fraction, p, q, t; + + saturation = CLAMP(0.0f, 1.0f, saturation); + value = CLAMP(0.0f, 1.0f, value); + if( saturation == 0.0f ) { /* achromatic (grey) */ + color->r = color->g = color->b = (uint8_t)(value * 255.0f + 0.5f); + return; + } + + hue = (float)fabsmod(hue, 360.0f); + hue /= 60.0f; /* sector 0 to 5 */ + hue_section = (int)floor(hue); + hue_fraction = hue - hue_section; /* fraction between sections */ + p = value * (1 - saturation); + q = value * (1 - saturation * hue_fraction); + t = value * (1 - saturation * (1 - hue_fraction)); + + switch (hue_section) { + default: + case 0: /* red/yellow */ + color->r = (uint8_t)(value * 255.0f + 0.5f); + color->g = (uint8_t)(t * 255.0f + 0.5f); + color->b = (uint8_t)(p * 255.0f + 0.5f); + break; + case 1: /* yellow/green */ + color->r = (uint8_t)(q * 255.0f + 0.5f); + color->g = (uint8_t)(value * 255.0f + 0.5f); + color->b = (uint8_t)(p * 255.0f + 0.5f); + break; + case 2: /* green/cyan */ + color->r = (uint8_t)(p * 255.0f + 0.5f); + color->g = (uint8_t)(value * 255.0f + 0.5f); + color->b = (uint8_t)(t * 255.0f + 0.5f); + break; + case 3: /* cyan/blue */ + color->r = (uint8_t)(p * 255.0f + 0.5f); + color->g = (uint8_t)(q * 255.0f + 0.5f); + color->b = (uint8_t)(value * 255.0f + 0.5f); + break; + case 4: /* blue/purple */ + color->r = (uint8_t)(t * 255.0f + 0.5f); + color->g = (uint8_t)(p * 255.0f + 0.5f); + color->b = (uint8_t)(value * 255.0f + 0.5f); + break; + case 5: /* purple/red */ + color->r = (uint8_t)(value * 255.0f + 0.5f); + color->g = (uint8_t)(p * 255.0f + 0.5f); + color->b = (uint8_t)(q * 255.0f + 0.5f); + break; + } +} +/** + * \brief Get a set of HSV values from a color. + * + * \param color The color + * \param hue Pointer to a float, filled with the hue. (degrees) + * \param saturation Pointer to a float, filled with the saturation. (0 to 1) + * \param value Pointer to a float, filled with the value. (0 to 1) + * + * The hue, saturation, and value parameters can not be NULL pointers, + */ +void TCOD_color_get_HSV(TCOD_color_t color, + float *hue, float *saturation, float *value) { + *hue = TCOD_color_get_hue(color); + *saturation = TCOD_color_get_saturation(color); + *value = TCOD_color_get_value(color); + return; +} +/** + * \brief Return a colors hue. + * + * \param color A color struct. + * \return The colors hue. (degrees) + */ +float TCOD_color_get_hue(TCOD_color_t color) { + uint8_t max = MAX(color.r, MAX(color.g, color.b)); + uint8_t min = MIN(color.r, MIN(color.g, color.b)); + float delta = (float)max - (float)min; + float hue; /* degrees */ + if (delta == 0.0f) { return 0.0f; } /* achromatic, including black */ + if (color.r == max) { + hue = (float)(color.g - color.b) / delta; + } else if (color.g == max) { + hue = 2.0f + (float)(color.b - color.r) / delta; + } else { + hue = 4.0f + (float)(color.r - color.g) / delta; + } + hue *= 60.0f; + hue = (float)fabsmod(hue, 360.0f); + return hue; +} +/** + * \brief Change a colors hue. + * + * \param color Pointer to a color struct. + * \param hue The hue in degrees. + */ +void TCOD_color_set_hue(TCOD_color_t *color, float hue) { + TCOD_color_set_HSV(color, + hue, + TCOD_color_get_saturation(*color), + TCOD_color_get_value(*color)); +} +/** + * \brief Return a colors saturation. + * + * \param color A color struct. + * \return The colors saturation. (0 to 1) + */ +float TCOD_color_get_saturation (TCOD_color_t color) { + float max = (float)(MAX(color.r, MAX(color.g, color.b))) / 255.0f; + float min = (float)(MIN(color.r, MIN(color.g, color.b))) / 255.0f; + float delta = max - min; + if (max == 0.0f) { return 0.0f; } + return delta / max; +} +/** + * \brief Change a colors saturation. + * + * \param color Pointer to a color struct. + * \param saturation The desired saturation value. + */ +void TCOD_color_set_saturation(TCOD_color_t *color, float saturation) { + TCOD_color_set_HSV(color, + TCOD_color_get_hue(*color), + saturation, + TCOD_color_get_value(*color)); +} +/** + * \brief Get a colors value. + * + * \param color A color struct. + * \return The colors value. (0 to 1) + */ +float TCOD_color_get_value(TCOD_color_t color) { + return (float)(MAX(color.r, MAX(color.g, color.b))) / 255.0f; +} +/** + * \brief Change a colors value. + * + * \param color Pointer to a color struct. + * \param value The desired value. + */ +void TCOD_color_set_value(TCOD_color_t *color, float value) { + TCOD_color_set_HSV(color, + TCOD_color_get_hue(*color), + TCOD_color_get_saturation(*color), + value); +} +/** + * \brief Shift a colors hue by an amount. + * + * \param color Pointer to a color struct. + * \param hue_shift The distance to shift the hue, in degrees. + */ +void TCOD_color_shift_hue(TCOD_color_t *color, float hue_shift) { + if (hue_shift == 0.0f) { return; } + TCOD_color_set_HSV(color, + TCOD_color_get_hue(*color) + hue_shift, + TCOD_color_get_saturation(*color), + TCOD_color_get_value(*color)); +} +/** + * \brief Scale a colors saturation and value. + * + * \param color Pointer to a color struct. + * \param saturation_coef Multiplier for this colors saturation. + * \param value_coef Multiplier for this colors value. + */ +void TCOD_color_scale_HSV(TCOD_color_t *color, + float saturation_coef, float value_coef) { + TCOD_color_set_HSV(color, + TCOD_color_get_hue(*color), + TCOD_color_get_saturation(*color) * saturation_coef, + TCOD_color_get_value(*color) * value_coef); +} +/** + * \brief Generate an interpolated gradient of colors. + * + * \param map Array to fill with the new gradient. + * \param nb_key The array size of the key_color and key_index parameters. + * \param key_color An array of colors to use, in order. + * \param key_index An array mapping key_color items to the map array. + * + * \verbatim embed:rst:leading-asterisk + * .. code-block:: c + * + * TCOD_color_t[256] gradient; + * TCOD_color_t[4] key_color = {TCOD_black, TCOD_dark_amber, + * TCOD_cyan, TCOD_white}; + * int[4] key_index = {0, 64, 192, 255}; + * TCOD_color_gen_map(&gradient, 4, &key_color, &key_index); + * \endverbatim + */ +void TCOD_color_gen_map(TCOD_color_t *map, int nb_key, + const TCOD_color_t *key_color, const int *key_index) { + int segment = 0; + for (segment = 0; segment < nb_key - 1; ++segment) { + int idx_start = key_index[segment]; + int idx_end = key_index[segment + 1]; + int idx; + for (idx = idx_start; idx <= idx_end; ++idx) { + map[idx] = TCOD_color_lerp( + key_color[segment], + key_color[segment + 1], + (float)(idx - idx_start) / (idx_end - idx_start)); + } + } +} +/** + * Perform alpha blending on a single channel. + */ +static uint8_t alpha_blend_channel( + int dst_c, int dst_a, int src_c, int src_a, int out_a) +{ + return (uint8_t)( + ((src_c * src_a) + (dst_c * dst_a * (255 - src_a) / 255)) / out_a + ); +} +/** + * A modified lerp operation which can accept RGBA types. + */ +void TCOD_color_alpha_blend(TCOD_ColorRGBA* dst, const TCOD_ColorRGBA* src) +{ + if (!dst || !src) { return; } + uint8_t out_a = (uint8_t)(src->a + dst->a * (255 - src->a) / 255); + dst->r = alpha_blend_channel(dst->r, dst->a, src->r, src->a, out_a); + dst->g = alpha_blend_channel(dst->g, dst->a, src->g, src->a, out_a); + dst->b = alpha_blend_channel(dst->b, dst->a, src->b, src->a, out_a); + dst->a = out_a; +} diff --git a/tcod_sys/libtcod/include/color.h b/tcod_sys/libtcod/src/libtcod/color.h similarity index 83% rename from tcod_sys/libtcod/include/color.h rename to tcod_sys/libtcod/src/libtcod/color.h index a3d109c3d..05295cee2 100644 --- a/tcod_sys/libtcod/include/color.h +++ b/tcod_sys/libtcod/src/libtcod/color.h @@ -1,46 +1,84 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_COLOR_H #define _TCOD_COLOR_H -#include "libtcod_portability.h" +#include +#include +#include "config.h" +/** + * A three channel color struct. + */ +struct TCOD_ColorRGB { #ifdef __cplusplus -extern "C" { -#endif - + bool operator==(const TCOD_ColorRGB& rhs) const noexcept + { + return r == rhs.r && g == rhs.g && b == rhs.b; + } + bool operator!=(const TCOD_ColorRGB& rhs) const noexcept + { + return !(*this == rhs); + } +#endif // __cplusplus + uint8_t r; + uint8_t g; + uint8_t b; +}; +typedef struct TCOD_ColorRGB TCOD_color_t; +typedef struct TCOD_ColorRGB TCOD_ColorRGB; /** - * \brief An RGB color struct. + * A four channel color struct. */ -typedef struct { - uint8_t r,g,b; -} TCOD_color_t; - +struct TCOD_ColorRGBA { +#ifdef __cplusplus + bool operator==(const TCOD_ColorRGBA& rhs) const noexcept + { + return r == rhs.r && g == rhs.g && b == rhs.b && a == rhs.a; + } + bool operator!=(const TCOD_ColorRGBA& rhs) const noexcept + { + return !(*this == rhs); + } +#endif // __cplusplus + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t a; +}; +typedef struct TCOD_ColorRGBA TCOD_ColorRGBA; +#ifdef __cplusplus +extern "C" { +#endif /* constructors */ TCODLIB_API TCOD_color_t TCOD_color_RGB(uint8_t r, uint8_t g, uint8_t b); TCODLIB_API TCOD_color_t TCOD_color_HSV(float hue, float saturation, @@ -54,6 +92,14 @@ TCODLIB_API TCOD_color_t TCOD_color_multiply_scalar(TCOD_color_t c1, float value); TCODLIB_API TCOD_color_t TCOD_color_lerp(TCOD_color_t c1, TCOD_color_t c2, float coef); +/** + * Blend `src` into `dst` as an alpha blending operation. + * \rst + * .. versionadded:: 1.16 + * \endrst + */ +void TCOD_color_alpha_blend(TCOD_ColorRGBA* dst, const TCOD_ColorRGBA* src); + /* HSV transformations */ TCODLIB_API void TCOD_color_set_HSV(TCOD_color_t *color, float hue, float saturation, float value); diff --git a/tcod_sys/libtcod/include/color.hpp b/tcod_sys/libtcod/src/libtcod/color.hpp similarity index 87% rename from tcod_sys/libtcod/include/color.hpp rename to tcod_sys/libtcod/src/libtcod/color.hpp index 557fbe314..16383618c 100644 --- a/tcod_sys/libtcod/include/color.hpp +++ b/tcod_sys/libtcod/src/libtcod/color.hpp @@ -1,35 +1,41 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_COLOR_HPP #define _TCOD_COLOR_HPP +#include + #include "color.h" -#include "libtcod_utility.h" +#include "utility.h" // color constants uses to generate @ColorTable /** @ColorCategory STANDARD COLORS @@ -146,8 +152,12 @@ public : TCODColor myColor = new TCODColor(321.0f,0.7f,1.0f); //HSV @LuaEx myColor = tcod.Color(24,24,255) */ - TCODColor(uint8_t r, uint8_t g, uint8_t b): r(r), g(g), b(b) {} - TCODColor(int r, int g, int b): r(r), g(g), b(b) {} + TCODColor(uint8_t r_, uint8_t g_, uint8_t b_) + : r(r_), g(g_), b(b_) + {} + TCODColor(int r_, int g_, int b_) + : r(r_), g(g_), b(b_) + {} TCODColor(const TCOD_color_t &col): r(col.r), g(col.g), b(col.b) {} TCODColor(float h, float s, float v); @@ -169,12 +179,14 @@ public : @LuaEx if myColor == tcod.color.yellow then ... end */ - bool operator == (const TCODColor & c) const { - return (c.r == r && c.g == g && c.b == b); - } - bool operator != (const TCODColor & c) const { - return (c.r != r || c.g != g || c.b != b); - } + bool operator == (const TCODColor& c) const + { + return (c.r == r && c.g == g && c.b == b); + } + bool operator != (const TCODColor& c) const + { + return !(*this == c); + } /** @PageName color @@ -191,13 +203,10 @@ public : @C#Ex TCODColor myDarkishRed = TCODColor.darkGrey.Multiply(TCODColor.lightRed); @LuaEx myDarkishRed = tcod.color.darkGrey * tcod.color.lightRed */ - TCODColor operator * (const TCODColor & a) const { - TCODColor ret; - ret.r=(uint8_t)(((int)r)*a.r/255); - ret.g=(uint8_t)(((int)g)*a.g/255); - ret.b=(uint8_t)(((int)b)*a.b/255); - return ret; - } + TCODColor operator*(const TCODColor& rhs) const + { + return TCODColor(*this, rhs, [](int c1, int c2){ return c1 * c2 / 255; }); + } /** @PageName color @@ -215,20 +224,10 @@ public : @C#Ex TCODColor myDarkishRed = TCODColor.lightRed.Multiply(0.5f); @LuaEx myDarkishRed = tcod.color.lightRed * 0.5 */ - TCODColor operator *(float value) const { - TCOD_color_t ret; - int r,g,b; - r = (int)(this->r * value); - g = (int)(this->g * value); - b = (int)(this->b * value); - r = CLAMP(0,255,r); - g = CLAMP(0,255,g); - b = CLAMP(0,255,b); - ret.r=(uint8_t)r; - ret.g=(uint8_t)g; - ret.b=(uint8_t)b; - return ret; - } + TCODColor operator*(float value) const + { + return TCODColor(*this, [=](int c){ return static_cast(c * value); }); + } /** @PageName color @@ -244,19 +243,10 @@ public : @C#Ex TCODColor myLightishRed = TCODColor.red.Plus(TCODColor.darkGrey) @LuaEx myLightishRed = tcod.color.red + tcod.color.darkGrey */ - TCODColor operator + (const TCODColor & a) const { - TCODColor ret; - int r=(int)(this->r)+a.r; - int g=(int)(this->g)+a.g; - int b=(int)(this->b)+a.b; - r = MIN(255,r); - g = MIN(255,g); - b = MIN(255,b); - ret.r=(uint8_t)r; - ret.g=(uint8_t)g; - ret.b=(uint8_t)b; - return ret; - } + TCODColor operator+(const TCODColor & rhs) const + { + return TCODColor(*this, rhs, [](int c1, int c2){ return c1 + c2; }); + } /** @PageName color @@ -272,19 +262,10 @@ public : @C#Ex TCODColor myRedish = TCODColor.red.Minus(TCODColor.darkGrey) @LuaEx myRedish = tcod.color.red - tcod.color.darkGrey */ - TCODColor operator - (const TCODColor & a) const { - TCODColor ret; - int r=(int)(this->r)-a.r; - int g=(int)(this->g)-a.g; - int b=(int)(this->b)-a.b; - r = MAX(0,r); - g = MAX(0,g); - b = MAX(0,b); - ret.r=(uint8_t)r; - ret.g=(uint8_t)g; - ret.b=(uint8_t)b; - return ret; - } + TCODColor operator-(const TCODColor& rhs) const + { + return TCODColor(*this, rhs, [](int c1, int c2){ return c1 - c2; }); + } /** @PageName color @@ -305,13 +286,10 @@ coef should be between 0.0 and 1.0 but you can as well use other values @C#Ex TCODColor myColor = TCODColor.Interpolate( TCODColor.darkGrey, TCODColor.lightRed, coef ); @LuaEx myColor = tcod.color.Interpolate( tcod.color.darkGrey, tcod.color.lightRed, coef ) */ - static TCODColor lerp(const TCODColor &a, const TCODColor &b, float coef) { - TCODColor ret; - ret.r=(uint8_t)(a.r+(b.r-a.r)*coef); - ret.g=(uint8_t)(a.g+(b.g-a.g)*coef); - ret.b=(uint8_t)(a.b+(b.b-a.b)*coef); - return ret; - } + static TCODColor lerp(const TCODColor &c1, const TCODColor &c2, float coef) + { + return TCODColor(c1, c2, [=](int c, int d){ return c + (d - c) * coef; }); + } /** @PageName color @@ -685,6 +663,33 @@ coef should be between 0.0 and 1.0 but you can as well use other values // miscellaneous static const TCODColor celadon; static const TCODColor peach; + private: + /** + * Return a color transformed by a lambda. + */ + template + TCODColor(const TCODColor& color, const F& lambda) + : r(clamp_(lambda(color.r))), + g(clamp_(lambda(color.g))), + b(clamp_(lambda(color.b))) + {} + /** + * Return a color from two colors combined using a lambda. + */ + template + TCODColor(const TCODColor& color1, const TCODColor& color2, const F& lambda) + : r(clamp_(lambda(color1.r, color2.r))), + g(clamp_(lambda(color1.g, color2.g))), + b(clamp_(lambda(color1.b, color2.b))) + {} + /** + * Return a color value clamped between 0 to 255. + */ + template + static constexpr uint8_t clamp_(const T& value) noexcept + { + return static_cast(std::max(0, std::min(value, 255))); + } }; TCODLIB_API TCODColor operator *(float value, const TCODColor &c); diff --git a/tcod_sys/libtcod/src/color.cpp b/tcod_sys/libtcod/src/libtcod/color_.cpp similarity index 88% rename from tcod_sys/libtcod/src/color.cpp rename to tcod_sys/libtcod/src/libtcod/color_.cpp index 29e1a167e..1a1ceaa93 100644 --- a/tcod_sys/libtcod/src/color.cpp +++ b/tcod_sys/libtcod/src/libtcod/color_.cpp @@ -1,349 +1,358 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include - -// grey levels -const TCODColor TCODColor::black(TCOD_BLACK); -const TCODColor TCODColor::darkestGrey(TCOD_DARKEST_GREY); -const TCODColor TCODColor::darkerGrey(TCOD_DARKER_GREY); -const TCODColor TCODColor::darkGrey(TCOD_DARK_GREY); -const TCODColor TCODColor::grey(TCOD_GREY); -const TCODColor TCODColor::lightGrey(TCOD_LIGHT_GREY); -const TCODColor TCODColor::lighterGrey(TCOD_LIGHTER_GREY); -const TCODColor TCODColor::lightestGrey(TCOD_LIGHTEST_GREY); -const TCODColor TCODColor::white(TCOD_WHITE); - -//sepia -const TCODColor TCODColor::darkestSepia(TCOD_DARKEST_SEPIA); -const TCODColor TCODColor::darkerSepia(TCOD_DARKER_SEPIA); -const TCODColor TCODColor::darkSepia(TCOD_DARK_SEPIA); -const TCODColor TCODColor::sepia(TCOD_SEPIA); -const TCODColor TCODColor::lightSepia(TCOD_LIGHT_SEPIA); -const TCODColor TCODColor::lighterSepia(TCOD_LIGHTER_SEPIA); -const TCODColor TCODColor::lightestSepia(TCOD_LIGHTEST_SEPIA); - -// standard colors -const TCODColor TCODColor::red(TCOD_RED); -const TCODColor TCODColor::flame(TCOD_FLAME); -const TCODColor TCODColor::orange(TCOD_ORANGE); -const TCODColor TCODColor::amber(TCOD_AMBER); -const TCODColor TCODColor::yellow(TCOD_YELLOW); -const TCODColor TCODColor::lime(TCOD_LIME); -const TCODColor TCODColor::chartreuse(TCOD_CHARTREUSE); -const TCODColor TCODColor::green(TCOD_GREEN); -const TCODColor TCODColor::sea(TCOD_SEA); -const TCODColor TCODColor::turquoise(TCOD_TURQUOISE); -const TCODColor TCODColor::cyan(TCOD_CYAN); -const TCODColor TCODColor::sky(TCOD_SKY); -const TCODColor TCODColor::azure(TCOD_AZURE); -const TCODColor TCODColor::blue(TCOD_BLUE); -const TCODColor TCODColor::han(TCOD_HAN); -const TCODColor TCODColor::violet(TCOD_VIOLET); -const TCODColor TCODColor::purple(TCOD_PURPLE); -const TCODColor TCODColor::fuchsia(TCOD_FUCHSIA); -const TCODColor TCODColor::magenta(TCOD_MAGENTA); -const TCODColor TCODColor::pink(TCOD_PINK); -const TCODColor TCODColor::crimson(TCOD_CRIMSON); - -// dark colors -const TCODColor TCODColor::darkRed(TCOD_DARK_RED); -const TCODColor TCODColor::darkFlame(TCOD_DARK_FLAME); -const TCODColor TCODColor::darkOrange(TCOD_DARK_ORANGE); -const TCODColor TCODColor::darkAmber(TCOD_DARK_AMBER); -const TCODColor TCODColor::darkYellow(TCOD_DARK_YELLOW); -const TCODColor TCODColor::darkLime(TCOD_DARK_LIME); -const TCODColor TCODColor::darkChartreuse(TCOD_DARK_CHARTREUSE); -const TCODColor TCODColor::darkGreen(TCOD_DARK_GREEN); -const TCODColor TCODColor::darkSea(TCOD_DARK_SEA); -const TCODColor TCODColor::darkTurquoise(TCOD_DARK_TURQUOISE); -const TCODColor TCODColor::darkCyan(TCOD_DARK_CYAN); -const TCODColor TCODColor::darkSky(TCOD_DARK_SKY); -const TCODColor TCODColor::darkAzure(TCOD_DARK_AZURE); -const TCODColor TCODColor::darkBlue(TCOD_DARK_BLUE); -const TCODColor TCODColor::darkHan(TCOD_DARK_HAN); -const TCODColor TCODColor::darkViolet(TCOD_DARK_VIOLET); -const TCODColor TCODColor::darkPurple(TCOD_DARK_PURPLE); -const TCODColor TCODColor::darkFuchsia(TCOD_DARK_FUCHSIA); -const TCODColor TCODColor::darkMagenta(TCOD_DARK_MAGENTA); -const TCODColor TCODColor::darkPink(TCOD_DARK_PINK); -const TCODColor TCODColor::darkCrimson(TCOD_DARK_CRIMSON); - -// darker colors -const TCODColor TCODColor::darkerRed(TCOD_DARKER_RED); -const TCODColor TCODColor::darkerFlame(TCOD_DARKER_FLAME); -const TCODColor TCODColor::darkerOrange(TCOD_DARKER_ORANGE); -const TCODColor TCODColor::darkerAmber(TCOD_DARKER_AMBER); -const TCODColor TCODColor::darkerYellow(TCOD_DARKER_YELLOW); -const TCODColor TCODColor::darkerLime(TCOD_DARKER_LIME); -const TCODColor TCODColor::darkerChartreuse(TCOD_DARKER_CHARTREUSE); -const TCODColor TCODColor::darkerGreen(TCOD_DARKER_GREEN); -const TCODColor TCODColor::darkerSea(TCOD_DARKER_SEA); -const TCODColor TCODColor::darkerTurquoise(TCOD_DARKER_TURQUOISE); -const TCODColor TCODColor::darkerCyan(TCOD_DARKER_CYAN); -const TCODColor TCODColor::darkerSky(TCOD_DARKER_SKY); -const TCODColor TCODColor::darkerAzure(TCOD_DARKER_AZURE); -const TCODColor TCODColor::darkerBlue(TCOD_DARKER_BLUE); -const TCODColor TCODColor::darkerHan(TCOD_DARKER_HAN); -const TCODColor TCODColor::darkerViolet(TCOD_DARKER_VIOLET); -const TCODColor TCODColor::darkerPurple(TCOD_DARKER_PURPLE); -const TCODColor TCODColor::darkerFuchsia(TCOD_DARKER_FUCHSIA); -const TCODColor TCODColor::darkerMagenta(TCOD_DARKER_MAGENTA); -const TCODColor TCODColor::darkerPink(TCOD_DARKER_PINK); -const TCODColor TCODColor::darkerCrimson(TCOD_DARKER_CRIMSON); - -// darkest colors -const TCODColor TCODColor::darkestRed(TCOD_DARKEST_RED); -const TCODColor TCODColor::darkestFlame(TCOD_DARKEST_FLAME); -const TCODColor TCODColor::darkestOrange(TCOD_DARKEST_ORANGE); -const TCODColor TCODColor::darkestAmber(TCOD_DARKEST_AMBER); -const TCODColor TCODColor::darkestYellow(TCOD_DARKEST_YELLOW); -const TCODColor TCODColor::darkestLime(TCOD_DARKEST_LIME); -const TCODColor TCODColor::darkestChartreuse(TCOD_DARKEST_CHARTREUSE); -const TCODColor TCODColor::darkestGreen(TCOD_DARKEST_GREEN); -const TCODColor TCODColor::darkestSea(TCOD_DARKEST_SEA); -const TCODColor TCODColor::darkestTurquoise(TCOD_DARKEST_TURQUOISE); -const TCODColor TCODColor::darkestCyan(TCOD_DARKEST_CYAN); -const TCODColor TCODColor::darkestSky(TCOD_DARKEST_SKY); -const TCODColor TCODColor::darkestAzure(TCOD_DARKEST_AZURE); -const TCODColor TCODColor::darkestBlue(TCOD_DARKEST_BLUE); -const TCODColor TCODColor::darkestHan(TCOD_DARKEST_HAN); -const TCODColor TCODColor::darkestViolet(TCOD_DARKEST_VIOLET); -const TCODColor TCODColor::darkestPurple(TCOD_DARKEST_PURPLE); -const TCODColor TCODColor::darkestFuchsia(TCOD_DARKEST_FUCHSIA); -const TCODColor TCODColor::darkestMagenta(TCOD_DARKEST_MAGENTA); -const TCODColor TCODColor::darkestPink(TCOD_DARKEST_PINK); -const TCODColor TCODColor::darkestCrimson(TCOD_DARKEST_CRIMSON); - -// light colors -const TCODColor TCODColor::lightRed(TCOD_LIGHT_RED); -const TCODColor TCODColor::lightFlame(TCOD_LIGHT_FLAME); -const TCODColor TCODColor::lightOrange(TCOD_LIGHT_ORANGE); -const TCODColor TCODColor::lightAmber(TCOD_LIGHT_AMBER); -const TCODColor TCODColor::lightYellow(TCOD_LIGHT_YELLOW); -const TCODColor TCODColor::lightLime(TCOD_LIGHT_LIME); -const TCODColor TCODColor::lightChartreuse(TCOD_LIGHT_CHARTREUSE); -const TCODColor TCODColor::lightGreen(TCOD_LIGHT_GREEN); -const TCODColor TCODColor::lightSea(TCOD_LIGHT_SEA); -const TCODColor TCODColor::lightTurquoise(TCOD_LIGHT_TURQUOISE); -const TCODColor TCODColor::lightCyan(TCOD_LIGHT_CYAN); -const TCODColor TCODColor::lightSky(TCOD_LIGHT_SKY); -const TCODColor TCODColor::lightAzure(TCOD_LIGHT_AZURE); -const TCODColor TCODColor::lightBlue(TCOD_LIGHT_BLUE); -const TCODColor TCODColor::lightHan(TCOD_LIGHT_HAN); -const TCODColor TCODColor::lightViolet(TCOD_LIGHT_VIOLET); -const TCODColor TCODColor::lightPurple(TCOD_LIGHT_PURPLE); -const TCODColor TCODColor::lightFuchsia(TCOD_LIGHT_FUCHSIA); -const TCODColor TCODColor::lightMagenta(TCOD_LIGHT_MAGENTA); -const TCODColor TCODColor::lightPink(TCOD_LIGHT_PINK); -const TCODColor TCODColor::lightCrimson(TCOD_LIGHT_CRIMSON); - -// lighter colors -const TCODColor TCODColor::lighterRed(TCOD_LIGHTER_RED); -const TCODColor TCODColor::lighterFlame(TCOD_LIGHTER_FLAME); -const TCODColor TCODColor::lighterOrange(TCOD_LIGHTER_ORANGE); -const TCODColor TCODColor::lighterAmber(TCOD_LIGHTER_AMBER); -const TCODColor TCODColor::lighterYellow(TCOD_LIGHTER_YELLOW); -const TCODColor TCODColor::lighterLime(TCOD_LIGHTER_LIME); -const TCODColor TCODColor::lighterChartreuse(TCOD_LIGHTER_CHARTREUSE); -const TCODColor TCODColor::lighterGreen(TCOD_LIGHTER_GREEN); -const TCODColor TCODColor::lighterSea(TCOD_LIGHTER_SEA); -const TCODColor TCODColor::lighterTurquoise(TCOD_LIGHTER_TURQUOISE); -const TCODColor TCODColor::lighterCyan(TCOD_LIGHTER_CYAN); -const TCODColor TCODColor::lighterSky(TCOD_LIGHTER_SKY); -const TCODColor TCODColor::lighterAzure(TCOD_LIGHTER_AZURE); -const TCODColor TCODColor::lighterBlue(TCOD_LIGHTER_BLUE); -const TCODColor TCODColor::lighterHan(TCOD_LIGHTER_HAN); -const TCODColor TCODColor::lighterViolet(TCOD_LIGHTER_VIOLET); -const TCODColor TCODColor::lighterPurple(TCOD_LIGHTER_PURPLE); -const TCODColor TCODColor::lighterFuchsia(TCOD_LIGHTER_FUCHSIA); -const TCODColor TCODColor::lighterMagenta(TCOD_LIGHTER_MAGENTA); -const TCODColor TCODColor::lighterPink(TCOD_LIGHTER_PINK); -const TCODColor TCODColor::lighterCrimson(TCOD_LIGHTER_CRIMSON); - -// lightest colors -const TCODColor TCODColor::lightestRed(TCOD_LIGHTEST_RED); -const TCODColor TCODColor::lightestFlame(TCOD_LIGHTEST_FLAME); -const TCODColor TCODColor::lightestOrange(TCOD_LIGHTEST_ORANGE); -const TCODColor TCODColor::lightestAmber(TCOD_LIGHTEST_AMBER); -const TCODColor TCODColor::lightestYellow(TCOD_LIGHTEST_YELLOW); -const TCODColor TCODColor::lightestLime(TCOD_LIGHTEST_LIME); -const TCODColor TCODColor::lightestChartreuse(TCOD_LIGHTEST_CHARTREUSE); -const TCODColor TCODColor::lightestGreen(TCOD_LIGHTEST_GREEN); -const TCODColor TCODColor::lightestSea(TCOD_LIGHTEST_SEA); -const TCODColor TCODColor::lightestTurquoise(TCOD_LIGHTEST_TURQUOISE); -const TCODColor TCODColor::lightestCyan(TCOD_LIGHTEST_CYAN); -const TCODColor TCODColor::lightestSky(TCOD_LIGHTEST_SKY); -const TCODColor TCODColor::lightestAzure(TCOD_LIGHTEST_AZURE); -const TCODColor TCODColor::lightestBlue(TCOD_LIGHTEST_BLUE); -const TCODColor TCODColor::lightestHan(TCOD_LIGHTEST_HAN); -const TCODColor TCODColor::lightestViolet(TCOD_LIGHTEST_VIOLET); -const TCODColor TCODColor::lightestPurple(TCOD_LIGHTEST_PURPLE); -const TCODColor TCODColor::lightestFuchsia(TCOD_LIGHTEST_FUCHSIA); -const TCODColor TCODColor::lightestMagenta(TCOD_LIGHTEST_MAGENTA); -const TCODColor TCODColor::lightestPink(TCOD_LIGHTEST_PINK); -const TCODColor TCODColor::lightestCrimson(TCOD_LIGHTEST_CRIMSON); - -// desaturated colors -const TCODColor TCODColor::desaturatedRed(TCOD_DESATURATED_RED); -const TCODColor TCODColor::desaturatedFlame(TCOD_DESATURATED_FLAME); -const TCODColor TCODColor::desaturatedOrange(TCOD_DESATURATED_ORANGE); -const TCODColor TCODColor::desaturatedAmber(TCOD_DESATURATED_AMBER); -const TCODColor TCODColor::desaturatedYellow(TCOD_DESATURATED_YELLOW); -const TCODColor TCODColor::desaturatedLime(TCOD_DESATURATED_LIME); -const TCODColor TCODColor::desaturatedChartreuse(TCOD_DESATURATED_CHARTREUSE); -const TCODColor TCODColor::desaturatedGreen(TCOD_DESATURATED_GREEN); -const TCODColor TCODColor::desaturatedSea(TCOD_DESATURATED_SEA); -const TCODColor TCODColor::desaturatedTurquoise(TCOD_DESATURATED_TURQUOISE); -const TCODColor TCODColor::desaturatedCyan(TCOD_DESATURATED_CYAN); -const TCODColor TCODColor::desaturatedSky(TCOD_DESATURATED_SKY); -const TCODColor TCODColor::desaturatedAzure(TCOD_DESATURATED_AZURE); -const TCODColor TCODColor::desaturatedBlue(TCOD_DESATURATED_BLUE); -const TCODColor TCODColor::desaturatedHan(TCOD_DESATURATED_HAN); -const TCODColor TCODColor::desaturatedViolet(TCOD_DESATURATED_VIOLET); -const TCODColor TCODColor::desaturatedPurple(TCOD_DESATURATED_PURPLE); -const TCODColor TCODColor::desaturatedFuchsia(TCOD_DESATURATED_FUCHSIA); -const TCODColor TCODColor::desaturatedMagenta(TCOD_DESATURATED_MAGENTA); -const TCODColor TCODColor::desaturatedPink(TCOD_DESATURATED_PINK); -const TCODColor TCODColor::desaturatedCrimson(TCOD_DESATURATED_CRIMSON); - -//special -const TCODColor TCODColor::brass(TCOD_BRASS); -const TCODColor TCODColor::copper(TCOD_COPPER); -const TCODColor TCODColor::gold(TCOD_GOLD); -const TCODColor TCODColor::silver(TCOD_SILVER); - -//miscellaneous -const TCODColor TCODColor::celadon(TCOD_CELADON); -const TCODColor TCODColor::peach(TCOD_PEACH); - -#ifndef TCOD_HAIKU -// color array -const TCODColor TCODColor::colors[TCOD_COLOR_NB][TCOD_COLOR_LEVELS] = { - {TCODColor(TCOD_DESATURATED_RED),TCODColor(TCOD_LIGHTEST_RED),TCODColor(TCOD_LIGHTER_RED),TCODColor(TCOD_LIGHT_RED),TCODColor(TCOD_RED),TCODColor(TCOD_DARK_RED),TCODColor(TCOD_DARKER_RED),TCODColor(TCOD_DARKEST_RED)}, - {TCODColor(TCOD_DESATURATED_FLAME),TCODColor(TCOD_LIGHTEST_FLAME),TCODColor(TCOD_LIGHTER_FLAME),TCODColor(TCOD_LIGHT_FLAME),TCODColor(TCOD_FLAME),TCODColor(TCOD_DARK_FLAME),TCODColor(TCOD_DARKER_FLAME),TCODColor(TCOD_DARKEST_FLAME)}, - {TCODColor(TCOD_DESATURATED_ORANGE),TCODColor(TCOD_LIGHTEST_ORANGE),TCODColor(TCOD_LIGHTER_ORANGE),TCODColor(TCOD_LIGHT_ORANGE),TCODColor(TCOD_ORANGE),TCODColor(TCOD_DARK_ORANGE),TCODColor(TCOD_DARKER_ORANGE),TCODColor(TCOD_DARKEST_ORANGE)}, - {TCODColor(TCOD_DESATURATED_AMBER),TCODColor(TCOD_LIGHTEST_AMBER),TCODColor(TCOD_LIGHTER_AMBER),TCODColor(TCOD_LIGHT_AMBER),TCODColor(TCOD_AMBER),TCODColor(TCOD_DARK_AMBER),TCODColor(TCOD_DARKER_AMBER),TCODColor(TCOD_DARKEST_AMBER)}, - {TCODColor(TCOD_DESATURATED_YELLOW),TCODColor(TCOD_LIGHTEST_YELLOW),TCODColor(TCOD_LIGHTER_YELLOW),TCODColor(TCOD_LIGHT_YELLOW),TCODColor(TCOD_YELLOW),TCODColor(TCOD_DARK_YELLOW),TCODColor(TCOD_DARKER_YELLOW),TCODColor(TCOD_DARKEST_YELLOW)}, - {TCODColor(TCOD_DESATURATED_LIME),TCODColor(TCOD_LIGHTEST_LIME),TCODColor(TCOD_LIGHTER_LIME),TCODColor(TCOD_LIGHT_LIME),TCODColor(TCOD_LIME),TCODColor(TCOD_DARK_LIME),TCODColor(TCOD_DARKER_LIME),TCODColor(TCOD_DARKEST_LIME)}, - {TCODColor(TCOD_DESATURATED_CHARTREUSE),TCODColor(TCOD_LIGHTEST_CHARTREUSE),TCODColor(TCOD_LIGHTER_CHARTREUSE),TCODColor(TCOD_LIGHT_CHARTREUSE),TCODColor(TCOD_CHARTREUSE),TCODColor(TCOD_DARK_CHARTREUSE),TCODColor(TCOD_DARKER_CHARTREUSE),TCODColor(TCOD_DARKEST_CHARTREUSE)}, - {TCODColor(TCOD_DESATURATED_GREEN),TCODColor(TCOD_LIGHTEST_GREEN),TCODColor(TCOD_LIGHTER_GREEN),TCODColor(TCOD_LIGHT_GREEN),TCODColor(TCOD_GREEN),TCODColor(TCOD_DARK_GREEN),TCODColor(TCOD_DARKER_GREEN),TCODColor(TCOD_DARKEST_GREEN)}, - {TCODColor(TCOD_DESATURATED_SEA),TCODColor(TCOD_LIGHTEST_SEA),TCODColor(TCOD_LIGHTER_SEA),TCODColor(TCOD_LIGHT_SEA),TCODColor(TCOD_SEA),TCODColor(TCOD_DARK_SEA),TCODColor(TCOD_DARKER_SEA),TCODColor(TCOD_DARKEST_SEA)}, - {TCODColor(TCOD_DESATURATED_TURQUOISE),TCODColor(TCOD_LIGHTEST_TURQUOISE),TCODColor(TCOD_LIGHTER_TURQUOISE),TCODColor(TCOD_LIGHT_TURQUOISE),TCODColor(TCOD_TURQUOISE),TCODColor(TCOD_DARK_TURQUOISE),TCODColor(TCOD_DARKER_TURQUOISE),TCODColor(TCOD_DARKEST_TURQUOISE)}, - {TCODColor(TCOD_DESATURATED_CYAN),TCODColor(TCOD_LIGHTEST_CYAN),TCODColor(TCOD_LIGHTER_CYAN),TCODColor(TCOD_LIGHT_CYAN),TCODColor(TCOD_CYAN),TCODColor(TCOD_DARK_CYAN),TCODColor(TCOD_DARKER_CYAN),TCODColor(TCOD_DARKEST_CYAN)}, - {TCODColor(TCOD_DESATURATED_SKY),TCODColor(TCOD_LIGHTEST_SKY),TCODColor(TCOD_LIGHTER_SKY),TCODColor(TCOD_LIGHT_SKY),TCODColor(TCOD_SKY),TCODColor(TCOD_DARK_SKY),TCODColor(TCOD_DARKER_SKY),TCODColor(TCOD_DARKEST_SKY)}, - {TCODColor(TCOD_DESATURATED_AZURE),TCODColor(TCOD_LIGHTEST_AZURE),TCODColor(TCOD_LIGHTER_AZURE),TCODColor(TCOD_LIGHT_AZURE),TCODColor(TCOD_AZURE),TCODColor(TCOD_DARK_AZURE),TCODColor(TCOD_DARKER_AZURE),TCODColor(TCOD_DARKEST_AZURE)}, - {TCODColor(TCOD_DESATURATED_BLUE),TCODColor(TCOD_LIGHTEST_BLUE),TCODColor(TCOD_LIGHTER_BLUE),TCODColor(TCOD_LIGHT_BLUE),TCODColor(TCOD_BLUE),TCODColor(TCOD_DARK_BLUE),TCODColor(TCOD_DARKER_BLUE),TCODColor(TCOD_DARKEST_BLUE)}, - {TCODColor(TCOD_DESATURATED_HAN),TCODColor(TCOD_LIGHTEST_HAN),TCODColor(TCOD_LIGHTER_HAN),TCODColor(TCOD_LIGHT_HAN),TCODColor(TCOD_HAN),TCODColor(TCOD_DARK_HAN),TCODColor(TCOD_DARKER_HAN),TCODColor(TCOD_DARKEST_HAN)}, - {TCODColor(TCOD_DESATURATED_VIOLET),TCODColor(TCOD_LIGHTEST_VIOLET),TCODColor(TCOD_LIGHTER_VIOLET),TCODColor(TCOD_LIGHT_VIOLET),TCODColor(TCOD_VIOLET),TCODColor(TCOD_DARK_VIOLET),TCODColor(TCOD_DARKER_VIOLET),TCODColor(TCOD_DARKEST_VIOLET)}, - {TCODColor(TCOD_DESATURATED_PURPLE),TCODColor(TCOD_LIGHTEST_PURPLE),TCODColor(TCOD_LIGHTER_PURPLE),TCODColor(TCOD_LIGHT_PURPLE),TCODColor(TCOD_PURPLE),TCODColor(TCOD_DARK_PURPLE),TCODColor(TCOD_DARKER_PURPLE),TCODColor(TCOD_DARKEST_PURPLE)}, - {TCODColor(TCOD_DESATURATED_FUCHSIA),TCODColor(TCOD_LIGHTEST_FUCHSIA),TCODColor(TCOD_LIGHTER_FUCHSIA),TCODColor(TCOD_LIGHT_FUCHSIA),TCODColor(TCOD_FUCHSIA),TCODColor(TCOD_DARK_FUCHSIA),TCODColor(TCOD_DARKER_FUCHSIA),TCODColor(TCOD_DARKEST_FUCHSIA)}, - {TCODColor(TCOD_DESATURATED_MAGENTA),TCODColor(TCOD_LIGHTEST_MAGENTA),TCODColor(TCOD_LIGHTER_MAGENTA),TCODColor(TCOD_LIGHT_MAGENTA),TCODColor(TCOD_MAGENTA),TCODColor(TCOD_DARK_MAGENTA),TCODColor(TCOD_DARKER_MAGENTA),TCODColor(TCOD_DARKEST_MAGENTA)}, - {TCODColor(TCOD_DESATURATED_PINK),TCODColor(TCOD_LIGHTEST_PINK),TCODColor(TCOD_LIGHTER_PINK),TCODColor(TCOD_LIGHT_PINK),TCODColor(TCOD_PINK),TCODColor(TCOD_DARK_PINK),TCODColor(TCOD_DARKER_PINK),TCODColor(TCOD_DARKEST_PINK)}, - {TCODColor(TCOD_DESATURATED_CRIMSON),TCODColor(TCOD_LIGHTEST_CRIMSON),TCODColor(TCOD_LIGHTER_CRIMSON),TCODColor(TCOD_LIGHT_CRIMSON),TCODColor(TCOD_CRIMSON),TCODColor(TCOD_DARK_CRIMSON),TCODColor(TCOD_DARKER_CRIMSON),TCODColor(TCOD_DARKEST_CRIMSON)} -}; -#endif - -TCODColor::TCODColor(float h, float s, float v) { - //setHSV(h,s,v); - TCOD_color_t c = TCOD_color_HSV(h,s,v); - r = c.r; g = c.g; b = c.b; -} - -void TCODColor::setHSV(float h, float s, float v) { - TCOD_color_t c; - TCOD_color_set_HSV(&c,h,s,v); - r = c.r; g = c.g; b = c.b; -} - -void TCODColor::setHue (float h) { - TCOD_color_t c = { r, g, b }; - TCOD_color_set_hue (&c, h); - r = c.r; g = c.g; b = c.b; -} - -void TCODColor::setSaturation (float s) { - TCOD_color_t c = { r, g, b }; - TCOD_color_set_saturation (&c, s); - r = c.r; g = c.g; b = c.b; -} - -void TCODColor::setValue (float v) { - TCOD_color_t c = { r, g, b }; - TCOD_color_set_value (&c, v); - r = c.r; g = c.g; b = c.b; -} - -void TCODColor::getHSV(float *h, float *s, float *v) const { - TCOD_color_t c={r,g,b}; - TCOD_color_get_HSV(c,h,s,v); -} - -float TCODColor::getHue () { - TCOD_color_t c = { r, g, b }; - return TCOD_color_get_hue(c); -} - -float TCODColor::getSaturation () { - TCOD_color_t c = { r, g, b }; - return TCOD_color_get_saturation(c); -} - -float TCODColor::getValue () { - TCOD_color_t c = { r, g, b }; - return TCOD_color_get_value(c); -} - -void TCODColor::shiftHue (float hshift) { - TCOD_color_t c = { r, g, b }; - TCOD_color_shift_hue (&c, hshift); - r = c.r; g = c.g; b = c.b; -} - -void TCODColor::scaleHSV (float sscale, float vscale) { - TCOD_color_t c = {r,g,b}; - TCOD_color_scale_HSV(&c,sscale,vscale); - r = c.r; g = c.g; b = c.b; -} - -// non member operators -TCODColor operator *(float value, const TCODColor &c) { - return c*value; -} - -void TCODColor::genMap(TCODColor *map, int nbKey, TCODColor const *keyColor, int const *keyIndex) { - for (int segment=0; segment < nbKey-1; segment++) { - int idxStart=keyIndex[segment]; - int idxEnd=keyIndex[segment+1]; - int idx; - for ( idx=idxStart;idx <= idxEnd; idx++) { - map[idx]=TCODColor::lerp(keyColor[segment],keyColor[segment+1],(float)(idx-idxStart)/(idxEnd-idxStart)); - } - } -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "color.hpp" + +#include "libtcod_int.h" + +// grey levels +const TCODColor TCODColor::black(TCOD_BLACK); +const TCODColor TCODColor::darkestGrey(TCOD_DARKEST_GREY); +const TCODColor TCODColor::darkerGrey(TCOD_DARKER_GREY); +const TCODColor TCODColor::darkGrey(TCOD_DARK_GREY); +const TCODColor TCODColor::grey(TCOD_GREY); +const TCODColor TCODColor::lightGrey(TCOD_LIGHT_GREY); +const TCODColor TCODColor::lighterGrey(TCOD_LIGHTER_GREY); +const TCODColor TCODColor::lightestGrey(TCOD_LIGHTEST_GREY); +const TCODColor TCODColor::white(TCOD_WHITE); + +//sepia +const TCODColor TCODColor::darkestSepia(TCOD_DARKEST_SEPIA); +const TCODColor TCODColor::darkerSepia(TCOD_DARKER_SEPIA); +const TCODColor TCODColor::darkSepia(TCOD_DARK_SEPIA); +const TCODColor TCODColor::sepia(TCOD_SEPIA); +const TCODColor TCODColor::lightSepia(TCOD_LIGHT_SEPIA); +const TCODColor TCODColor::lighterSepia(TCOD_LIGHTER_SEPIA); +const TCODColor TCODColor::lightestSepia(TCOD_LIGHTEST_SEPIA); + +// standard colors +const TCODColor TCODColor::red(TCOD_RED); +const TCODColor TCODColor::flame(TCOD_FLAME); +const TCODColor TCODColor::orange(TCOD_ORANGE); +const TCODColor TCODColor::amber(TCOD_AMBER); +const TCODColor TCODColor::yellow(TCOD_YELLOW); +const TCODColor TCODColor::lime(TCOD_LIME); +const TCODColor TCODColor::chartreuse(TCOD_CHARTREUSE); +const TCODColor TCODColor::green(TCOD_GREEN); +const TCODColor TCODColor::sea(TCOD_SEA); +const TCODColor TCODColor::turquoise(TCOD_TURQUOISE); +const TCODColor TCODColor::cyan(TCOD_CYAN); +const TCODColor TCODColor::sky(TCOD_SKY); +const TCODColor TCODColor::azure(TCOD_AZURE); +const TCODColor TCODColor::blue(TCOD_BLUE); +const TCODColor TCODColor::han(TCOD_HAN); +const TCODColor TCODColor::violet(TCOD_VIOLET); +const TCODColor TCODColor::purple(TCOD_PURPLE); +const TCODColor TCODColor::fuchsia(TCOD_FUCHSIA); +const TCODColor TCODColor::magenta(TCOD_MAGENTA); +const TCODColor TCODColor::pink(TCOD_PINK); +const TCODColor TCODColor::crimson(TCOD_CRIMSON); + +// dark colors +const TCODColor TCODColor::darkRed(TCOD_DARK_RED); +const TCODColor TCODColor::darkFlame(TCOD_DARK_FLAME); +const TCODColor TCODColor::darkOrange(TCOD_DARK_ORANGE); +const TCODColor TCODColor::darkAmber(TCOD_DARK_AMBER); +const TCODColor TCODColor::darkYellow(TCOD_DARK_YELLOW); +const TCODColor TCODColor::darkLime(TCOD_DARK_LIME); +const TCODColor TCODColor::darkChartreuse(TCOD_DARK_CHARTREUSE); +const TCODColor TCODColor::darkGreen(TCOD_DARK_GREEN); +const TCODColor TCODColor::darkSea(TCOD_DARK_SEA); +const TCODColor TCODColor::darkTurquoise(TCOD_DARK_TURQUOISE); +const TCODColor TCODColor::darkCyan(TCOD_DARK_CYAN); +const TCODColor TCODColor::darkSky(TCOD_DARK_SKY); +const TCODColor TCODColor::darkAzure(TCOD_DARK_AZURE); +const TCODColor TCODColor::darkBlue(TCOD_DARK_BLUE); +const TCODColor TCODColor::darkHan(TCOD_DARK_HAN); +const TCODColor TCODColor::darkViolet(TCOD_DARK_VIOLET); +const TCODColor TCODColor::darkPurple(TCOD_DARK_PURPLE); +const TCODColor TCODColor::darkFuchsia(TCOD_DARK_FUCHSIA); +const TCODColor TCODColor::darkMagenta(TCOD_DARK_MAGENTA); +const TCODColor TCODColor::darkPink(TCOD_DARK_PINK); +const TCODColor TCODColor::darkCrimson(TCOD_DARK_CRIMSON); + +// darker colors +const TCODColor TCODColor::darkerRed(TCOD_DARKER_RED); +const TCODColor TCODColor::darkerFlame(TCOD_DARKER_FLAME); +const TCODColor TCODColor::darkerOrange(TCOD_DARKER_ORANGE); +const TCODColor TCODColor::darkerAmber(TCOD_DARKER_AMBER); +const TCODColor TCODColor::darkerYellow(TCOD_DARKER_YELLOW); +const TCODColor TCODColor::darkerLime(TCOD_DARKER_LIME); +const TCODColor TCODColor::darkerChartreuse(TCOD_DARKER_CHARTREUSE); +const TCODColor TCODColor::darkerGreen(TCOD_DARKER_GREEN); +const TCODColor TCODColor::darkerSea(TCOD_DARKER_SEA); +const TCODColor TCODColor::darkerTurquoise(TCOD_DARKER_TURQUOISE); +const TCODColor TCODColor::darkerCyan(TCOD_DARKER_CYAN); +const TCODColor TCODColor::darkerSky(TCOD_DARKER_SKY); +const TCODColor TCODColor::darkerAzure(TCOD_DARKER_AZURE); +const TCODColor TCODColor::darkerBlue(TCOD_DARKER_BLUE); +const TCODColor TCODColor::darkerHan(TCOD_DARKER_HAN); +const TCODColor TCODColor::darkerViolet(TCOD_DARKER_VIOLET); +const TCODColor TCODColor::darkerPurple(TCOD_DARKER_PURPLE); +const TCODColor TCODColor::darkerFuchsia(TCOD_DARKER_FUCHSIA); +const TCODColor TCODColor::darkerMagenta(TCOD_DARKER_MAGENTA); +const TCODColor TCODColor::darkerPink(TCOD_DARKER_PINK); +const TCODColor TCODColor::darkerCrimson(TCOD_DARKER_CRIMSON); + +// darkest colors +const TCODColor TCODColor::darkestRed(TCOD_DARKEST_RED); +const TCODColor TCODColor::darkestFlame(TCOD_DARKEST_FLAME); +const TCODColor TCODColor::darkestOrange(TCOD_DARKEST_ORANGE); +const TCODColor TCODColor::darkestAmber(TCOD_DARKEST_AMBER); +const TCODColor TCODColor::darkestYellow(TCOD_DARKEST_YELLOW); +const TCODColor TCODColor::darkestLime(TCOD_DARKEST_LIME); +const TCODColor TCODColor::darkestChartreuse(TCOD_DARKEST_CHARTREUSE); +const TCODColor TCODColor::darkestGreen(TCOD_DARKEST_GREEN); +const TCODColor TCODColor::darkestSea(TCOD_DARKEST_SEA); +const TCODColor TCODColor::darkestTurquoise(TCOD_DARKEST_TURQUOISE); +const TCODColor TCODColor::darkestCyan(TCOD_DARKEST_CYAN); +const TCODColor TCODColor::darkestSky(TCOD_DARKEST_SKY); +const TCODColor TCODColor::darkestAzure(TCOD_DARKEST_AZURE); +const TCODColor TCODColor::darkestBlue(TCOD_DARKEST_BLUE); +const TCODColor TCODColor::darkestHan(TCOD_DARKEST_HAN); +const TCODColor TCODColor::darkestViolet(TCOD_DARKEST_VIOLET); +const TCODColor TCODColor::darkestPurple(TCOD_DARKEST_PURPLE); +const TCODColor TCODColor::darkestFuchsia(TCOD_DARKEST_FUCHSIA); +const TCODColor TCODColor::darkestMagenta(TCOD_DARKEST_MAGENTA); +const TCODColor TCODColor::darkestPink(TCOD_DARKEST_PINK); +const TCODColor TCODColor::darkestCrimson(TCOD_DARKEST_CRIMSON); + +// light colors +const TCODColor TCODColor::lightRed(TCOD_LIGHT_RED); +const TCODColor TCODColor::lightFlame(TCOD_LIGHT_FLAME); +const TCODColor TCODColor::lightOrange(TCOD_LIGHT_ORANGE); +const TCODColor TCODColor::lightAmber(TCOD_LIGHT_AMBER); +const TCODColor TCODColor::lightYellow(TCOD_LIGHT_YELLOW); +const TCODColor TCODColor::lightLime(TCOD_LIGHT_LIME); +const TCODColor TCODColor::lightChartreuse(TCOD_LIGHT_CHARTREUSE); +const TCODColor TCODColor::lightGreen(TCOD_LIGHT_GREEN); +const TCODColor TCODColor::lightSea(TCOD_LIGHT_SEA); +const TCODColor TCODColor::lightTurquoise(TCOD_LIGHT_TURQUOISE); +const TCODColor TCODColor::lightCyan(TCOD_LIGHT_CYAN); +const TCODColor TCODColor::lightSky(TCOD_LIGHT_SKY); +const TCODColor TCODColor::lightAzure(TCOD_LIGHT_AZURE); +const TCODColor TCODColor::lightBlue(TCOD_LIGHT_BLUE); +const TCODColor TCODColor::lightHan(TCOD_LIGHT_HAN); +const TCODColor TCODColor::lightViolet(TCOD_LIGHT_VIOLET); +const TCODColor TCODColor::lightPurple(TCOD_LIGHT_PURPLE); +const TCODColor TCODColor::lightFuchsia(TCOD_LIGHT_FUCHSIA); +const TCODColor TCODColor::lightMagenta(TCOD_LIGHT_MAGENTA); +const TCODColor TCODColor::lightPink(TCOD_LIGHT_PINK); +const TCODColor TCODColor::lightCrimson(TCOD_LIGHT_CRIMSON); + +// lighter colors +const TCODColor TCODColor::lighterRed(TCOD_LIGHTER_RED); +const TCODColor TCODColor::lighterFlame(TCOD_LIGHTER_FLAME); +const TCODColor TCODColor::lighterOrange(TCOD_LIGHTER_ORANGE); +const TCODColor TCODColor::lighterAmber(TCOD_LIGHTER_AMBER); +const TCODColor TCODColor::lighterYellow(TCOD_LIGHTER_YELLOW); +const TCODColor TCODColor::lighterLime(TCOD_LIGHTER_LIME); +const TCODColor TCODColor::lighterChartreuse(TCOD_LIGHTER_CHARTREUSE); +const TCODColor TCODColor::lighterGreen(TCOD_LIGHTER_GREEN); +const TCODColor TCODColor::lighterSea(TCOD_LIGHTER_SEA); +const TCODColor TCODColor::lighterTurquoise(TCOD_LIGHTER_TURQUOISE); +const TCODColor TCODColor::lighterCyan(TCOD_LIGHTER_CYAN); +const TCODColor TCODColor::lighterSky(TCOD_LIGHTER_SKY); +const TCODColor TCODColor::lighterAzure(TCOD_LIGHTER_AZURE); +const TCODColor TCODColor::lighterBlue(TCOD_LIGHTER_BLUE); +const TCODColor TCODColor::lighterHan(TCOD_LIGHTER_HAN); +const TCODColor TCODColor::lighterViolet(TCOD_LIGHTER_VIOLET); +const TCODColor TCODColor::lighterPurple(TCOD_LIGHTER_PURPLE); +const TCODColor TCODColor::lighterFuchsia(TCOD_LIGHTER_FUCHSIA); +const TCODColor TCODColor::lighterMagenta(TCOD_LIGHTER_MAGENTA); +const TCODColor TCODColor::lighterPink(TCOD_LIGHTER_PINK); +const TCODColor TCODColor::lighterCrimson(TCOD_LIGHTER_CRIMSON); + +// lightest colors +const TCODColor TCODColor::lightestRed(TCOD_LIGHTEST_RED); +const TCODColor TCODColor::lightestFlame(TCOD_LIGHTEST_FLAME); +const TCODColor TCODColor::lightestOrange(TCOD_LIGHTEST_ORANGE); +const TCODColor TCODColor::lightestAmber(TCOD_LIGHTEST_AMBER); +const TCODColor TCODColor::lightestYellow(TCOD_LIGHTEST_YELLOW); +const TCODColor TCODColor::lightestLime(TCOD_LIGHTEST_LIME); +const TCODColor TCODColor::lightestChartreuse(TCOD_LIGHTEST_CHARTREUSE); +const TCODColor TCODColor::lightestGreen(TCOD_LIGHTEST_GREEN); +const TCODColor TCODColor::lightestSea(TCOD_LIGHTEST_SEA); +const TCODColor TCODColor::lightestTurquoise(TCOD_LIGHTEST_TURQUOISE); +const TCODColor TCODColor::lightestCyan(TCOD_LIGHTEST_CYAN); +const TCODColor TCODColor::lightestSky(TCOD_LIGHTEST_SKY); +const TCODColor TCODColor::lightestAzure(TCOD_LIGHTEST_AZURE); +const TCODColor TCODColor::lightestBlue(TCOD_LIGHTEST_BLUE); +const TCODColor TCODColor::lightestHan(TCOD_LIGHTEST_HAN); +const TCODColor TCODColor::lightestViolet(TCOD_LIGHTEST_VIOLET); +const TCODColor TCODColor::lightestPurple(TCOD_LIGHTEST_PURPLE); +const TCODColor TCODColor::lightestFuchsia(TCOD_LIGHTEST_FUCHSIA); +const TCODColor TCODColor::lightestMagenta(TCOD_LIGHTEST_MAGENTA); +const TCODColor TCODColor::lightestPink(TCOD_LIGHTEST_PINK); +const TCODColor TCODColor::lightestCrimson(TCOD_LIGHTEST_CRIMSON); + +// desaturated colors +const TCODColor TCODColor::desaturatedRed(TCOD_DESATURATED_RED); +const TCODColor TCODColor::desaturatedFlame(TCOD_DESATURATED_FLAME); +const TCODColor TCODColor::desaturatedOrange(TCOD_DESATURATED_ORANGE); +const TCODColor TCODColor::desaturatedAmber(TCOD_DESATURATED_AMBER); +const TCODColor TCODColor::desaturatedYellow(TCOD_DESATURATED_YELLOW); +const TCODColor TCODColor::desaturatedLime(TCOD_DESATURATED_LIME); +const TCODColor TCODColor::desaturatedChartreuse(TCOD_DESATURATED_CHARTREUSE); +const TCODColor TCODColor::desaturatedGreen(TCOD_DESATURATED_GREEN); +const TCODColor TCODColor::desaturatedSea(TCOD_DESATURATED_SEA); +const TCODColor TCODColor::desaturatedTurquoise(TCOD_DESATURATED_TURQUOISE); +const TCODColor TCODColor::desaturatedCyan(TCOD_DESATURATED_CYAN); +const TCODColor TCODColor::desaturatedSky(TCOD_DESATURATED_SKY); +const TCODColor TCODColor::desaturatedAzure(TCOD_DESATURATED_AZURE); +const TCODColor TCODColor::desaturatedBlue(TCOD_DESATURATED_BLUE); +const TCODColor TCODColor::desaturatedHan(TCOD_DESATURATED_HAN); +const TCODColor TCODColor::desaturatedViolet(TCOD_DESATURATED_VIOLET); +const TCODColor TCODColor::desaturatedPurple(TCOD_DESATURATED_PURPLE); +const TCODColor TCODColor::desaturatedFuchsia(TCOD_DESATURATED_FUCHSIA); +const TCODColor TCODColor::desaturatedMagenta(TCOD_DESATURATED_MAGENTA); +const TCODColor TCODColor::desaturatedPink(TCOD_DESATURATED_PINK); +const TCODColor TCODColor::desaturatedCrimson(TCOD_DESATURATED_CRIMSON); + +//special +const TCODColor TCODColor::brass(TCOD_BRASS); +const TCODColor TCODColor::copper(TCOD_COPPER); +const TCODColor TCODColor::gold(TCOD_GOLD); +const TCODColor TCODColor::silver(TCOD_SILVER); + +//miscellaneous +const TCODColor TCODColor::celadon(TCOD_CELADON); +const TCODColor TCODColor::peach(TCOD_PEACH); + +#ifndef TCOD_HAIKU +// color array +const TCODColor TCODColor::colors[TCOD_COLOR_NB][TCOD_COLOR_LEVELS] = { + {TCODColor(TCOD_DESATURATED_RED),TCODColor(TCOD_LIGHTEST_RED),TCODColor(TCOD_LIGHTER_RED),TCODColor(TCOD_LIGHT_RED),TCODColor(TCOD_RED),TCODColor(TCOD_DARK_RED),TCODColor(TCOD_DARKER_RED),TCODColor(TCOD_DARKEST_RED)}, + {TCODColor(TCOD_DESATURATED_FLAME),TCODColor(TCOD_LIGHTEST_FLAME),TCODColor(TCOD_LIGHTER_FLAME),TCODColor(TCOD_LIGHT_FLAME),TCODColor(TCOD_FLAME),TCODColor(TCOD_DARK_FLAME),TCODColor(TCOD_DARKER_FLAME),TCODColor(TCOD_DARKEST_FLAME)}, + {TCODColor(TCOD_DESATURATED_ORANGE),TCODColor(TCOD_LIGHTEST_ORANGE),TCODColor(TCOD_LIGHTER_ORANGE),TCODColor(TCOD_LIGHT_ORANGE),TCODColor(TCOD_ORANGE),TCODColor(TCOD_DARK_ORANGE),TCODColor(TCOD_DARKER_ORANGE),TCODColor(TCOD_DARKEST_ORANGE)}, + {TCODColor(TCOD_DESATURATED_AMBER),TCODColor(TCOD_LIGHTEST_AMBER),TCODColor(TCOD_LIGHTER_AMBER),TCODColor(TCOD_LIGHT_AMBER),TCODColor(TCOD_AMBER),TCODColor(TCOD_DARK_AMBER),TCODColor(TCOD_DARKER_AMBER),TCODColor(TCOD_DARKEST_AMBER)}, + {TCODColor(TCOD_DESATURATED_YELLOW),TCODColor(TCOD_LIGHTEST_YELLOW),TCODColor(TCOD_LIGHTER_YELLOW),TCODColor(TCOD_LIGHT_YELLOW),TCODColor(TCOD_YELLOW),TCODColor(TCOD_DARK_YELLOW),TCODColor(TCOD_DARKER_YELLOW),TCODColor(TCOD_DARKEST_YELLOW)}, + {TCODColor(TCOD_DESATURATED_LIME),TCODColor(TCOD_LIGHTEST_LIME),TCODColor(TCOD_LIGHTER_LIME),TCODColor(TCOD_LIGHT_LIME),TCODColor(TCOD_LIME),TCODColor(TCOD_DARK_LIME),TCODColor(TCOD_DARKER_LIME),TCODColor(TCOD_DARKEST_LIME)}, + {TCODColor(TCOD_DESATURATED_CHARTREUSE),TCODColor(TCOD_LIGHTEST_CHARTREUSE),TCODColor(TCOD_LIGHTER_CHARTREUSE),TCODColor(TCOD_LIGHT_CHARTREUSE),TCODColor(TCOD_CHARTREUSE),TCODColor(TCOD_DARK_CHARTREUSE),TCODColor(TCOD_DARKER_CHARTREUSE),TCODColor(TCOD_DARKEST_CHARTREUSE)}, + {TCODColor(TCOD_DESATURATED_GREEN),TCODColor(TCOD_LIGHTEST_GREEN),TCODColor(TCOD_LIGHTER_GREEN),TCODColor(TCOD_LIGHT_GREEN),TCODColor(TCOD_GREEN),TCODColor(TCOD_DARK_GREEN),TCODColor(TCOD_DARKER_GREEN),TCODColor(TCOD_DARKEST_GREEN)}, + {TCODColor(TCOD_DESATURATED_SEA),TCODColor(TCOD_LIGHTEST_SEA),TCODColor(TCOD_LIGHTER_SEA),TCODColor(TCOD_LIGHT_SEA),TCODColor(TCOD_SEA),TCODColor(TCOD_DARK_SEA),TCODColor(TCOD_DARKER_SEA),TCODColor(TCOD_DARKEST_SEA)}, + {TCODColor(TCOD_DESATURATED_TURQUOISE),TCODColor(TCOD_LIGHTEST_TURQUOISE),TCODColor(TCOD_LIGHTER_TURQUOISE),TCODColor(TCOD_LIGHT_TURQUOISE),TCODColor(TCOD_TURQUOISE),TCODColor(TCOD_DARK_TURQUOISE),TCODColor(TCOD_DARKER_TURQUOISE),TCODColor(TCOD_DARKEST_TURQUOISE)}, + {TCODColor(TCOD_DESATURATED_CYAN),TCODColor(TCOD_LIGHTEST_CYAN),TCODColor(TCOD_LIGHTER_CYAN),TCODColor(TCOD_LIGHT_CYAN),TCODColor(TCOD_CYAN),TCODColor(TCOD_DARK_CYAN),TCODColor(TCOD_DARKER_CYAN),TCODColor(TCOD_DARKEST_CYAN)}, + {TCODColor(TCOD_DESATURATED_SKY),TCODColor(TCOD_LIGHTEST_SKY),TCODColor(TCOD_LIGHTER_SKY),TCODColor(TCOD_LIGHT_SKY),TCODColor(TCOD_SKY),TCODColor(TCOD_DARK_SKY),TCODColor(TCOD_DARKER_SKY),TCODColor(TCOD_DARKEST_SKY)}, + {TCODColor(TCOD_DESATURATED_AZURE),TCODColor(TCOD_LIGHTEST_AZURE),TCODColor(TCOD_LIGHTER_AZURE),TCODColor(TCOD_LIGHT_AZURE),TCODColor(TCOD_AZURE),TCODColor(TCOD_DARK_AZURE),TCODColor(TCOD_DARKER_AZURE),TCODColor(TCOD_DARKEST_AZURE)}, + {TCODColor(TCOD_DESATURATED_BLUE),TCODColor(TCOD_LIGHTEST_BLUE),TCODColor(TCOD_LIGHTER_BLUE),TCODColor(TCOD_LIGHT_BLUE),TCODColor(TCOD_BLUE),TCODColor(TCOD_DARK_BLUE),TCODColor(TCOD_DARKER_BLUE),TCODColor(TCOD_DARKEST_BLUE)}, + {TCODColor(TCOD_DESATURATED_HAN),TCODColor(TCOD_LIGHTEST_HAN),TCODColor(TCOD_LIGHTER_HAN),TCODColor(TCOD_LIGHT_HAN),TCODColor(TCOD_HAN),TCODColor(TCOD_DARK_HAN),TCODColor(TCOD_DARKER_HAN),TCODColor(TCOD_DARKEST_HAN)}, + {TCODColor(TCOD_DESATURATED_VIOLET),TCODColor(TCOD_LIGHTEST_VIOLET),TCODColor(TCOD_LIGHTER_VIOLET),TCODColor(TCOD_LIGHT_VIOLET),TCODColor(TCOD_VIOLET),TCODColor(TCOD_DARK_VIOLET),TCODColor(TCOD_DARKER_VIOLET),TCODColor(TCOD_DARKEST_VIOLET)}, + {TCODColor(TCOD_DESATURATED_PURPLE),TCODColor(TCOD_LIGHTEST_PURPLE),TCODColor(TCOD_LIGHTER_PURPLE),TCODColor(TCOD_LIGHT_PURPLE),TCODColor(TCOD_PURPLE),TCODColor(TCOD_DARK_PURPLE),TCODColor(TCOD_DARKER_PURPLE),TCODColor(TCOD_DARKEST_PURPLE)}, + {TCODColor(TCOD_DESATURATED_FUCHSIA),TCODColor(TCOD_LIGHTEST_FUCHSIA),TCODColor(TCOD_LIGHTER_FUCHSIA),TCODColor(TCOD_LIGHT_FUCHSIA),TCODColor(TCOD_FUCHSIA),TCODColor(TCOD_DARK_FUCHSIA),TCODColor(TCOD_DARKER_FUCHSIA),TCODColor(TCOD_DARKEST_FUCHSIA)}, + {TCODColor(TCOD_DESATURATED_MAGENTA),TCODColor(TCOD_LIGHTEST_MAGENTA),TCODColor(TCOD_LIGHTER_MAGENTA),TCODColor(TCOD_LIGHT_MAGENTA),TCODColor(TCOD_MAGENTA),TCODColor(TCOD_DARK_MAGENTA),TCODColor(TCOD_DARKER_MAGENTA),TCODColor(TCOD_DARKEST_MAGENTA)}, + {TCODColor(TCOD_DESATURATED_PINK),TCODColor(TCOD_LIGHTEST_PINK),TCODColor(TCOD_LIGHTER_PINK),TCODColor(TCOD_LIGHT_PINK),TCODColor(TCOD_PINK),TCODColor(TCOD_DARK_PINK),TCODColor(TCOD_DARKER_PINK),TCODColor(TCOD_DARKEST_PINK)}, + {TCODColor(TCOD_DESATURATED_CRIMSON),TCODColor(TCOD_LIGHTEST_CRIMSON),TCODColor(TCOD_LIGHTER_CRIMSON),TCODColor(TCOD_LIGHT_CRIMSON),TCODColor(TCOD_CRIMSON),TCODColor(TCOD_DARK_CRIMSON),TCODColor(TCOD_DARKER_CRIMSON),TCODColor(TCOD_DARKEST_CRIMSON)} +}; +#endif + +TCODColor::TCODColor(float h, float s, float v) { + //setHSV(h,s,v); + TCOD_color_t c = TCOD_color_HSV(h,s,v); + r = c.r; g = c.g; b = c.b; +} + +void TCODColor::setHSV(float h, float s, float v) { + TCOD_color_t c; + TCOD_color_set_HSV(&c,h,s,v); + r = c.r; g = c.g; b = c.b; +} + +void TCODColor::setHue (float h) { + TCOD_color_t c = { r, g, b }; + TCOD_color_set_hue (&c, h); + r = c.r; g = c.g; b = c.b; +} + +void TCODColor::setSaturation (float s) { + TCOD_color_t c = { r, g, b }; + TCOD_color_set_saturation (&c, s); + r = c.r; g = c.g; b = c.b; +} + +void TCODColor::setValue (float v) { + TCOD_color_t c = { r, g, b }; + TCOD_color_set_value (&c, v); + r = c.r; g = c.g; b = c.b; +} + +void TCODColor::getHSV(float *h, float *s, float *v) const { + TCOD_color_t c={r,g,b}; + TCOD_color_get_HSV(c,h,s,v); +} + +float TCODColor::getHue () { + TCOD_color_t c = { r, g, b }; + return TCOD_color_get_hue(c); +} + +float TCODColor::getSaturation () { + TCOD_color_t c = { r, g, b }; + return TCOD_color_get_saturation(c); +} + +float TCODColor::getValue () { + TCOD_color_t c = { r, g, b }; + return TCOD_color_get_value(c); +} + +void TCODColor::shiftHue (float hshift) { + TCOD_color_t c = { r, g, b }; + TCOD_color_shift_hue (&c, hshift); + r = c.r; g = c.g; b = c.b; +} + +void TCODColor::scaleHSV (float sscale, float vscale) { + TCOD_color_t c = {r,g,b}; + TCOD_color_scale_HSV(&c,sscale,vscale); + r = c.r; g = c.g; b = c.b; +} + +// non member operators +TCODColor operator *(float value, const TCODColor &c) { + return c*value; +} + +void TCODColor::genMap(TCODColor *map, int nbKey, TCODColor const *keyColor, + int const *keyIndex) +{ + for (int segment = 0; segment < nbKey - 1; ++segment) { + int idxStart = keyIndex[segment]; + int idxEnd = keyIndex[segment + 1]; + for (int idx = idxStart; idx <= idxEnd; ++idx) { + map[idx] = TCODColor::lerp( + keyColor[segment], + keyColor[segment + 1], + static_cast(idx - idxStart) / (idxEnd - idxStart) + ); + } + } +} diff --git a/tcod_sys/libtcod/src/libtcod/config.h b/tcod_sys/libtcod/src/libtcod/config.h new file mode 100644 index 000000000..d5c77fda8 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/config.h @@ -0,0 +1,114 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_CONFIG_H_ +#define LIBTCOD_CONFIG_H_ + +/* DLL export */ +#ifndef TCODLIB_API +#ifdef LIBTCOD_STATIC +#define TCODLIB_API +#elif defined _WIN32 || defined __CYGWIN__ || defined __MINGW32__ +#ifdef LIBTCOD_EXPORTS +#ifdef __GNUC__ +#define TCODLIB_API __attribute__((dllexport)) +#else +#define TCODLIB_API __declspec(dllexport) +#endif // __GNUC__ +#else +#ifdef __GNUC__ +#define TCODLIB_API __attribute__((dllimport)) +#else +#define TCODLIB_API __declspec(dllimport) +#endif // __GNUC__ +#endif // LIBTCOD_EXPORTS +#elif __GNUC__ >= 4 +#define TCODLIB_API __attribute__((visibility("default"))) +#else +#define TCODLIB_API +#endif +#endif // TCODLIB_API + +#ifndef TCODLIB_CAPI +#ifdef __cplusplus +#define TCODLIB_CAPI extern "C" TCODLIB_API +#else +#define TCODLIB_CAPI TCODLIB_API +#endif // __cplusplus +#endif // TCODLIB_CAPI + +// Publicly visible symbols and functions. +#define TCOD_PUBLIC TCODLIB_API + +// Private hidden symbols. +#if __GNUC__ >= 4 +#define TCOD_PRIVATE __attribute__((visibility("hidden"))) +#else +#define TCOD_PRIVATE +#endif // __GNUC__ >= 4 + +// Cross platform deprecation. +#ifdef TCOD_IGNORE_DEPRECATED +#define TCOD_DEPRECATED(msg) +#define TCOD_DEPRECATED_NOMESSAGE +#elif defined(__cplusplus) && __cplusplus >= 201402L && !defined(__clang__) +#define TCOD_DEPRECATED(msg) [[deprecated(msg)]] +#define TCOD_DEPRECATED_NOMESSAGE [[deprecated]] +#elif defined(_MSC_VER) +#define TCOD_DEPRECATED(msg) __declspec(deprecated(msg)) +#define TCOD_DEPRECATED_NOMESSAGE __declspec(deprecated) +#elif defined(__GNUC__) +#define TCOD_DEPRECATED(msg) __attribute__ ((deprecated(msg))) +#define TCOD_DEPRECATED_NOMESSAGE __attribute__ ((deprecated)) +#else +#define TCOD_DEPRECATED(msg) +#define TCOD_DEPRECATED_NOMESSAGE +#endif + +// Tells GCC the these functions are like printf. +#ifdef __GNUC__ +#define TCODLIB_FORMAT(str_index, first_arg) \ + __attribute__((format(printf, str_index, first_arg))) +#else +#define TCODLIB_FORMAT(str_index, first_arg) +#endif + +#if defined(__cplusplus) && __cplusplus >= 201703L && !defined(__clang__) +#define TCOD_NODISCARD [[nodiscard]] +#elif defined(_MSC_VER) +#define TCOD_NODISCARD +#elif defined(__GNUC__) +#define TCOD_NODISCARD __attribute__ ((warn_unused_result)) +#else +#define TCOD_NODISCARD +#endif + +#endif // LIBTCOD_CONFIG_H_ diff --git a/tcod_sys/libtcod/src/libtcod/console.c b/tcod_sys/libtcod/src/libtcod/console.c new file mode 100644 index 000000000..c3e8d7ad2 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/console.c @@ -0,0 +1,507 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "stdlib.h" + +#include "console.h" +#include "libtcod_int.h" +#include "utility.h" +static TCOD_Error TCOD_console_data_alloc(struct TCOD_Console* console) +{ + if (!console) { return TCOD_E_ERROR; } + if (console->tiles) { return TCOD_E_ERROR; } + console->tiles = calloc(sizeof(*console->tiles), console->elements); + return TCOD_E_OK; +} +static void TCOD_console_data_free(struct TCOD_Console *con) +{ + if (!con) { return; } + if (con->tiles) { free(con->tiles); con->tiles = NULL; } +} +static bool TCOD_console_init_(TCOD_Console* con) +{ + con = TCOD_console_validate_(con); + if (!con) { return false; } + con->fore = TCOD_white; + con->back = TCOD_black; + + TCOD_console_data_alloc(con); + + con->bkgnd_flag = TCOD_BKGND_NONE; + con->alignment = TCOD_LEFT; + TCOD_console_clear(con); + return true; +} +TCOD_Console* TCOD_console_new(int w, int h) +{ + if (w < 0 || h < 0) { + TCOD_set_errorvf("Width and height can not be negative: got %i,%i", w, h); + return NULL; + } + struct TCOD_Console *con = calloc(sizeof(*con), 1); + if (!con) { + TCOD_set_errorv("Could not allocate memory for a console."); + return NULL; + } + con->w = w; + con->h = h; + con->elements = w * h; + TCOD_console_init_(con); + if (TCOD_ctx.root) { + // Default values for the root console are set by TCOD_console_init_. + con->alignment = TCOD_ctx.root->alignment; + con->bkgnd_flag = TCOD_ctx.root->bkgnd_flag; + } + return con; +} +void TCOD_console_delete(TCOD_Console* con) +{ + TCOD_Console* console = (con ? con : TCOD_ctx.root); + if (console) { + if (console->on_delete) { + console->on_delete(console); + } + TCOD_console_data_free(console); + free(console); + } + if (console == TCOD_ctx.root) { + TCOD_ctx.root = NULL; + } + if (con == NULL) { + TCOD_sys_shutdown(); + } +} +void TCOD_console_resize_(TCOD_Console* console, int width, int height) +{ + console = TCOD_console_validate_(console); + if (!console) { return; } + if (console->w == width && console->h == height) { return; } + TCOD_console_data_free(console); + console->w = width; + console->h = height; + console->elements = width * height; + TCOD_console_data_alloc(console); +} +int TCOD_console_get_width(const TCOD_Console* con) +{ + con = TCOD_console_validate_(con); + return (con ? con->w : 0); +} +int TCOD_console_get_height(const TCOD_Console* con) +{ + con = TCOD_console_validate_(con); + return (con ? con->h : 0); +} +void TCOD_console_set_background_flag(TCOD_Console* con, + TCOD_bkgnd_flag_t flag) +{ + con = TCOD_console_validate_(con); + if (con) { con->bkgnd_flag = flag; } +} +TCOD_bkgnd_flag_t TCOD_console_get_background_flag(TCOD_Console* con) +{ + con = TCOD_console_validate_(con); + return (con ? con->bkgnd_flag : TCOD_BKGND_NONE); +} +void TCOD_console_set_alignment(TCOD_Console* con, TCOD_alignment_t alignment) +{ + con = TCOD_console_validate_(con); + if (con) { con->alignment = alignment; } +} +TCOD_alignment_t TCOD_console_get_alignment(TCOD_console_t con) +{ + con = TCOD_console_validate_(con); + return (con ? con->alignment : TCOD_LEFT); +} +/** + * Perform alpha blending on a single channel. + */ +static uint8_t alpha_blend( + int src_c, int src_a, int dst_c, int dst_a, int out_a) +{ + return (uint8_t)( + ((src_c * src_a) + (dst_c * dst_a * (255 - src_a) / 255)) / out_a + ); +} +/** + * A modified lerp operation which can accept RGBA types. + */ +static struct TCOD_ColorRGBA TCOD_console_blit_lerp_( + const struct TCOD_ColorRGBA dst, + const struct TCOD_ColorRGBA src, + float interp) +{ + uint8_t out_a = (uint8_t)(src.a + dst.a * (255 - src.a) / 255); + uint8_t src_a = (uint8_t)(src.a * interp); + struct TCOD_ColorRGBA out = { + alpha_blend(src.r, src_a, dst.r, dst.a, out_a), + alpha_blend(src.g, src_a, dst.g, dst.a, out_a), + alpha_blend(src.b, src_a, dst.b, dst.a, out_a), + out_a, + }; + return out; +} +/** + * Return the tile for a blit operation between src and dst. + */ +static struct TCOD_ConsoleTile TCOD_console_blit_cell_( + const struct TCOD_ConsoleTile* src, + const struct TCOD_ConsoleTile* dst, + float fg_alpha, + float bg_alpha, + const struct TCOD_ColorRGB* key_color) +{ + if (key_color && key_color->r == src->bg.r + && key_color->g == src->bg.g && key_color->b == src->bg.b) { + return *dst; // Source pixel is transparent. + } + fg_alpha *= src->fg.a / 255.0f; + bg_alpha *= src->bg.a / 255.0f; + if (fg_alpha > 254.5f / 255.0f && bg_alpha > 254.5f / 255.0f) { + return *src; // No alpha. Perform a plain copy. + } + struct TCOD_ConsoleTile out = *dst; + out.bg = TCOD_console_blit_lerp_(out.bg, src->bg, bg_alpha); + if (src->ch == ' ') { + // Source is space, so keep the current glyph. + out.fg = TCOD_console_blit_lerp_(out.fg, src->bg, bg_alpha); + } else if (out.ch == ' ') { + // Destination is space, so use the glyph from source. + out.ch = src->ch; + out.fg = TCOD_console_blit_lerp_(out.bg, src->fg, fg_alpha); + } else if (out.ch == src->ch) { + out.fg = TCOD_console_blit_lerp_(out.fg, src->fg, fg_alpha); + } else { + /* Pick the glyph based on foreground_alpha. */ + if (fg_alpha < 0.5f) { + out.fg = TCOD_console_blit_lerp_(out.fg, out.bg, fg_alpha * 2); + } else { + out.ch = src->ch; + out.fg = TCOD_console_blit_lerp_(out.bg, src->fg, (fg_alpha - 0.5f) * 2); + } + } + return out; +} +void TCOD_console_blit_key_color( + const TCOD_Console* src, + int xSrc, + int ySrc, + int wSrc, + int hSrc, + TCOD_Console* dst, + int xDst, + int yDst, + float foreground_alpha, + float background_alpha, + const TCOD_color_t* key_color) +{ + src = TCOD_console_validate_(src); + dst = TCOD_console_validate_(dst); + if (!src || !dst) { return; } + if (wSrc == 0) { wSrc = src->w; } + if (hSrc == 0) { hSrc = src->h; } + if (wSrc <= 0 || hSrc <= 0) { return; } + if (xDst + wSrc < 0 || yDst + hSrc < 0 || xDst >= dst->w || yDst >= dst->h) { + return; + } + for (int cx = xSrc; cx < xSrc + wSrc; ++cx) { + for (int cy = ySrc; cy < ySrc + hSrc; ++cy) { + /* Check if we're outside the dest console. */ + int dx = cx - xSrc + xDst; + int dy = cy - ySrc + yDst; + if (!TCOD_console_is_index_valid_(src, cx, cy)) { continue; } + if (!TCOD_console_is_index_valid_(dst, dx, dy)) { continue; } + dst->tiles[dy * dst->w + dx] = TCOD_console_blit_cell_( + &src->tiles[cy * src->w + cx], + &dst->tiles[dy * dst->w + dx], + foreground_alpha, + background_alpha, + key_color); + } + } +} +void TCOD_console_blit( + const TCOD_Console* src, + int xSrc, + int ySrc, + int wSrc, + int hSrc, + TCOD_Console* dst, + int xDst, + int yDst, + float foreground_alpha, + float background_alpha) +{ + src = TCOD_console_validate_(src); + if (!src) { return; } + TCOD_console_blit_key_color( + src, xSrc, ySrc, wSrc, hSrc, dst, xDst, yDst, + foreground_alpha, background_alpha, + (src->has_key_color ? &src->key_color : NULL)); +} +void TCOD_console_put_char(TCOD_Console* con, int x, int y, int c, + TCOD_bkgnd_flag_t flag) +{ + con = TCOD_console_validate_(con); + if (!TCOD_console_is_index_valid_(con, x, y)) { return; } + con->tiles[y * con->w + x].ch = c; + TCOD_console_set_char_foreground(con, x, y, con->fore); + TCOD_console_set_char_background(con, x, y, con->back, flag); +} +void TCOD_console_put_char_ex(TCOD_console_t con, int x, int y, int c, + TCOD_color_t fore, TCOD_color_t back) +{ + con = TCOD_console_validate_(con); + if (!TCOD_console_is_index_valid_(con, x, y)) { return; } + con->tiles[y * con->w + x].ch = c; + TCOD_console_set_char_foreground(con, x, y, fore); + TCOD_console_set_char_background(con, x, y, back, TCOD_BKGND_SET); +} +void TCOD_console_clear(TCOD_console_t con) +{ + con = TCOD_console_validate_(con); + if(!con) { return; } + struct TCOD_ConsoleTile fill = { + ' ', + { con->fore.r, con->fore.g, con->fore.b, 255 }, + { con->back.r, con->back.g, con->back.b, 255 }, + }; + for (int i = 0; i < con->elements; ++i) { + con->tiles[i] = fill; + } +} +TCOD_color_t TCOD_console_get_char_background(const TCOD_Console* con, + int x, int y) +{ + con = TCOD_console_validate_(con); + if (!TCOD_console_is_index_valid_(con, x, y)) { return TCOD_black; } + const struct TCOD_ColorRGBA* color = &con->tiles[y * con->w + x].bg; + struct TCOD_ColorRGB out = {color->r, color->g, color->b}; + return out; +} +void TCOD_console_set_char_foreground(TCOD_Console* con, + int x, int y, TCOD_color_t col) +{ + con = TCOD_console_validate_(con); + if (!TCOD_console_is_index_valid_(con, x, y)) { return; } + struct TCOD_ColorRGBA* out = &con->tiles[y * con->w + x].fg; + out->r = col.r; + out->g = col.g; + out->b = col.b; + out->a = 255; +} +TCOD_color_t TCOD_console_get_char_foreground(const TCOD_Console* con, + int x, int y) +{ + con = TCOD_console_validate_(con); + if (!TCOD_console_is_index_valid_(con, x, y)) { return TCOD_white; } + const struct TCOD_ColorRGBA* color = &con->tiles[y * con->w + x].fg; + struct TCOD_ColorRGB out = {color->r, color->g, color->b}; + return out; +} +int TCOD_console_get_char(const TCOD_Console* con, int x, int y) +{ + con = TCOD_console_validate_(con); + if (!TCOD_console_is_index_valid_(con, x, y)) { return 0; } + return con->tiles[y * con->w + x].ch; +} +/** + * Clamp colors channels that are outside of uint8_t's range. + */ +static uint8_t clamp_color_(int c) +{ + return (uint8_t)(MAX(0, MIN(c, 255))); +} +/** + * Mix two colors using a lambda. + */ +static struct TCOD_ColorRGBA blend_color_( + const struct TCOD_ColorRGBA* bg, + const struct TCOD_ColorRGB* fg, + int (*lambda)(uint8_t, uint8_t)) +{ + struct TCOD_ColorRGBA out = { + clamp_color_(lambda(bg->r, fg->r)), + clamp_color_(lambda(bg->g, fg->g)), + clamp_color_(lambda(bg->b, fg->b)), + bg->a, + }; + return out; +} +static int channel_multiply(uint8_t dst, uint8_t src) +{ + return (int)dst * (int)src / 255; +} +static int channel_lighten(uint8_t dst, uint8_t src) +{ + return MAX(dst, src); +} +static int channel_darken(uint8_t dst, uint8_t src) +{ + return MIN(dst, src); +} +static int channel_screen(uint8_t dst, uint8_t src) +{ + // newbk = white - (white - oldbk) * (white - curbk) + return 255 - (255 - (int)dst) * (255 - (int)src) / 255; +} +static int channel_color_dodge(uint8_t dst, uint8_t src) +{ + // newbk = curbk / (white - oldbk) + return (int)dst == 255 ? 255 : 255 * (int)src / (255 - (int)dst); +} +static int channel_color_burn(uint8_t dst, uint8_t src) +{ + // newbk = white - (white - oldbk) / curbk + return src == 0 ? 0 : 255 - (255 * (255 - (int)dst)) / (int)src; +} +static int channel_add(uint8_t dst, uint8_t src) +{ + return (int)dst + (int)src; +} +static int channel_burn(uint8_t dst, uint8_t src) +{ + // newbk = oldbk + curbk - white + return (int)dst + (int)src - 255; +} +static int channel_overlay(uint8_t dst, uint8_t src) +{ + // newbk = curbk.x <= 0.5 ? 2*curbk*oldbk + // : white - 2*(white-curbk)*(white-oldbk) + return ((int)src <= 128 ? 2 * (int)src * (int)dst / 255 + : 255 - 2 * (255 - (int)src) * (255 - (int)dst) / 255); +} +void TCOD_console_set_char_background( + TCOD_Console* con, int x, int y, TCOD_color_t col, TCOD_bkgnd_flag_t flag) +{ + con = TCOD_console_validate_(con); + if (!TCOD_console_is_index_valid_(con, x, y)) { return; } + struct TCOD_ColorRGBA* bg = &con->tiles[y * con->w + x].bg; + if (flag == TCOD_BKGND_DEFAULT) { flag = con->bkgnd_flag; } + int alpha = flag >> 8; + switch (flag & 0xff) { + case TCOD_BKGND_SET: + bg->r = col.r; + bg->g = col.g; + bg->b = col.b; + break; + case TCOD_BKGND_MULTIPLY: + *bg = blend_color_(bg, &col, channel_multiply); + break; + case TCOD_BKGND_LIGHTEN: + *bg = blend_color_(bg, &col, channel_lighten); + break; + case TCOD_BKGND_DARKEN: + *bg = blend_color_(bg, &col, channel_darken); + break; + case TCOD_BKGND_SCREEN: + // newbk = white - (white - oldbk) * (white - curbk) + *bg = blend_color_(bg, &col, channel_screen); + break; + case TCOD_BKGND_COLOR_DODGE: + // newbk = curbk / (white - oldbk) + *bg = blend_color_(bg, &col, channel_color_dodge); + break; + case TCOD_BKGND_COLOR_BURN: + // newbk = white - (white - oldbk) / curbk + *bg = blend_color_(bg, &col, channel_color_burn); + break; + case TCOD_BKGND_ADD: + // newbk = oldbk + curbk + *bg = blend_color_(bg, &col, channel_add); + break; + case TCOD_BKGND_ADDA: + // newbk = oldbk + alpha * curbk + bg->r = clamp_color_((int)bg->r + alpha * (int)col.r / 255); + bg->g = clamp_color_((int)bg->g + alpha * (int)col.g / 255); + bg->b = clamp_color_((int)bg->b + alpha * (int)col.b / 255); + break; + case TCOD_BKGND_BURN: + // newbk = oldbk + curbk - white + *bg = blend_color_(bg, &col, channel_burn); + break; + case TCOD_BKGND_OVERLAY: + // newbk = curbk.x <= 0.5 ? 2*curbk*oldbk + // : white - 2*(white-curbk)*(white-oldbk) + *bg = blend_color_(bg, &col, channel_overlay); + break; + case TCOD_BKGND_ALPH: { + // newbk = (1.0f-alpha)*oldbk + alpha*(curbk-oldbk) + struct TCOD_ColorRGBA col_rgba = {col.r, col.g, col.b, alpha}; + *bg = TCOD_console_blit_lerp_(*bg, col_rgba, 1.0f); + break; + } + default: break; + } +} +void TCOD_console_set_char(TCOD_console_t con, int x, int y, int c) +{ + con = TCOD_console_validate_(con); + if (!TCOD_console_is_index_valid_(con, x, y)) { return; } + con->tiles[y * con->w + x].ch = c; +} +void TCOD_console_set_default_foreground(TCOD_Console* con, TCOD_color_t col) +{ + con = TCOD_console_validate_(con); + TCOD_IFNOT(con) { return; } + con->fore = col; +} +void TCOD_console_set_default_background(TCOD_Console* con,TCOD_color_t col) +{ + con = TCOD_console_validate_(con); + TCOD_IFNOT(con) { return; } + con->back = col; +} +TCOD_color_t TCOD_console_get_default_foreground(TCOD_Console* con) +{ + con = TCOD_console_validate_(con); + TCOD_IFNOT(con) { return TCOD_white; } + return con->fore; +} +TCOD_color_t TCOD_console_get_default_background(TCOD_Console* con) +{ + con = TCOD_console_validate_(con); + TCOD_IFNOT(con) { return TCOD_black; } + return con->back; +} +void TCOD_console_set_fade(uint8_t val, TCOD_color_t fadecol) +{ + TCOD_ctx.fade = val; + TCOD_ctx.fading_color = fadecol; +} +uint8_t TCOD_console_get_fade(void) +{ + return TCOD_ctx.fade; +} +TCOD_color_t TCOD_console_get_fading_color(void) +{ + return TCOD_ctx.fading_color; +} diff --git a/tcod_sys/libtcod/src/libtcod/console.h b/tcod_sys/libtcod/src/libtcod/console.h new file mode 100644 index 000000000..bca0dea7b --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/console.h @@ -0,0 +1,468 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef TCOD_CONSOLE_H_ +#define TCOD_CONSOLE_H_ + +#include "stdbool.h" +#ifdef __cplusplus +#include +#include +#include +#endif // __cplusplus + +#include "config.h" +#include "color.h" +#include "tileset.h" +#include "error.h" +/** + * \enum TCOD_bkgnd_flag_t + * + * Background color blend modes. + */ +typedef enum { + TCOD_BKGND_NONE, + TCOD_BKGND_SET, + TCOD_BKGND_MULTIPLY, + TCOD_BKGND_LIGHTEN, + TCOD_BKGND_DARKEN, + TCOD_BKGND_SCREEN, + TCOD_BKGND_COLOR_DODGE, + TCOD_BKGND_COLOR_BURN, + TCOD_BKGND_ADD, + TCOD_BKGND_ADDA, + TCOD_BKGND_BURN, + TCOD_BKGND_OVERLAY, + TCOD_BKGND_ALPH, + TCOD_BKGND_DEFAULT +} TCOD_bkgnd_flag_t; +/** + * \enum TCOD_alignment_t + * + * Print justification options. + */ +typedef enum { + TCOD_LEFT, + TCOD_RIGHT, + TCOD_CENTER +} TCOD_alignment_t; +/** + * A console tile. + */ +struct TCOD_ConsoleTile { +#ifdef __cplusplus + bool operator==(const TCOD_ConsoleTile& rhs) const noexcept + { + return ch == rhs.ch && fg == rhs.fg && bg == rhs.bg; + } + bool operator!=(const TCOD_ConsoleTile& rhs) const noexcept + { + return !(*this == rhs); + } +#endif // __cplusplus + /** + * The Unicode codepoint for this tile. + */ + int ch; + /** + * The tile glyph color, rendered on top of the background. + */ + struct TCOD_ColorRGBA fg; + /** + * The tile background color, rendered behind the glyph. + */ + struct TCOD_ColorRGBA bg; +}; +/** + * The libtcod console struct. + * + * All attributes should be considered private. + * + * All C++ methods should be considered provisional, and are subject to + * change. + */ +struct TCOD_Console { +#ifdef __cplusplus + struct TCOD_ConsoleTile* begin() noexcept + { + return tiles; + } + const struct TCOD_ConsoleTile* begin() const noexcept + { + return tiles; + } + struct TCOD_ConsoleTile* end() noexcept + { + return tiles + size(); + } + const struct TCOD_ConsoleTile* end() const noexcept + { + return tiles + size(); + } + auto operator[](const std::array& yx) noexcept + -> struct TCOD_ConsoleTile& + { + return tiles[w * yx[0] + yx[1]]; + } + auto operator[](const std::array& yx) const noexcept + -> const struct TCOD_ConsoleTile& + { + return tiles[w * yx[0] + yx[1]]; + } + struct TCOD_ConsoleTile& at(int y, int x) + { + range_check_(y, x); + return (*this)[{y, x}]; + } + const struct TCOD_ConsoleTile& at(int y, int x) const + { + range_check_(y, x); + return (*this)[{y, x}]; + } + int size() const + { + return elements; + } + void range_check_(int y, int x) const + { + if (!in_bounds(y, x)) { + throw std::out_of_range( + std::string("Out of bounds lookup {x=") + + std::to_string(x) + + ", y=" + + std::to_string(y) + + "} on console of shape {" + + std::to_string(w) + + ", " + + std::to_string(h) + + "}."); + } + } + bool in_bounds(int y, int x) const noexcept + { + return 0 <= x && x < w && 0 <= y && y < h; + } +#endif // __cplusplus + /** Console width and height (in characters, not pixels.) */ + int w,h; + /** A contiguous array of console tiles. */ + struct TCOD_ConsoleTile* tiles; + /** Default background operator for print & print_rect functions. */ + TCOD_bkgnd_flag_t bkgnd_flag; + /** Default alignment for print & print_rect functions. */ + TCOD_alignment_t alignment; + /** Foreground (text) and background colors. */ + TCOD_color_t fore, back; + /** True if a key color is being used. */ + bool has_key_color; + /** The current key color for this console. */ + TCOD_color_t key_color; + /** + The total length of the tiles array. Same as `w * h`. + + \rst + .. versionadded:: 1.16 + \endrst + */ + int elements; + /** + \rst + .. versionadded:: 1.16 + \endrst + */ + void* userdata; + /** Internal use. */ + void (*on_delete)(struct TCOD_Console* self); +}; +typedef struct TCOD_Console TCOD_Console; +typedef struct TCOD_Console *TCOD_console_t; +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +/** + * Return a new console with a specific number of columns and rows. + * + * \param w Number of columns. + * \param h Number of columns. + * \return A pointer to the new console, or NULL on error. + */ +TCOD_PUBLIC TCOD_NODISCARD +TCOD_Console* TCOD_console_new(int w, int h); +/** + * Return the width of a console. + */ +TCOD_PUBLIC TCOD_NODISCARD +int TCOD_console_get_width(const TCOD_Console* con); +/** + * Return the height of a console. + */ +TCOD_PUBLIC TCOD_NODISCARD +int TCOD_console_get_height(const TCOD_Console* con); +TCOD_PUBLIC void TCOD_console_set_key_color( + TCOD_Console* con, TCOD_color_t col); +/** + * Blit from one console to another. + * + * \param srcCon Pointer to the source console. + * \param xSrc The left region of the source console to blit from. + * \param ySrc The top region of the source console to blit from. + * \param wSrc The width of the region to blit from. + * If 0 then it will fill to the maximum width. + * \param hSrc The height of the region to blit from. + * If 0 then it will fill to the maximum height. + * \param dstCon Pointer to the destination console. + * \param xDst The left corner to blit onto the destination console. + * \param yDst The top corner to blit onto the destination console. + * \param foreground_alpha Foreground blending alpha. + * \param background_alpha Background blending alpha. + * + * If the source console has a key color, this function will use it. + * \rst + * .. versionchanged:: 1.16 + * Blits can now handle per-cell alpha transparency. + * \endrst + */ +TCOD_PUBLIC void TCOD_console_blit( + const TCOD_Console* src, + int xSrc, + int ySrc, + int wSrc, + int hSrc, + TCOD_Console* dst, + int xDst, + int yDst, + float foreground_alpha, + float background_alpha); +TCOD_PUBLIC void TCOD_console_blit_key_color( + const TCOD_Console* src, + int xSrc, + int ySrc, + int wSrc, + int hSrc, + TCOD_Console* dst, + int xDst, + int yDst, + float foreground_alpha, + float background_alpha, + const TCOD_color_t *key_color); +/** + * Delete a console. + * + * \param con A console pointer. + * + * If the console being deleted is the root console, then the display will be + * uninitialized. + */ +TCOD_PUBLIC void TCOD_console_delete(TCOD_Console* console); + +TCOD_PUBLIC void TCOD_console_set_default_background( + TCOD_Console* con, TCOD_color_t col); +TCOD_PUBLIC void TCOD_console_set_default_foreground( + TCOD_Console* con, TCOD_color_t col); +/** + * Clear a console to its default colors and the space character code. + */ +TCOD_PUBLIC void TCOD_console_clear(TCOD_Console* con); +/** + * Blend a background color onto a console tile. + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \param col The background color to blend. + * \param flag The blend mode to use. + */ +TCOD_PUBLIC void TCOD_console_set_char_background( + TCOD_Console* con, + int x, + int y, + TCOD_color_t col, + TCOD_bkgnd_flag_t flag); +/** + * Change the foreground color of a console tile. + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \param col The foreground color to set. + */ +TCOD_PUBLIC void TCOD_console_set_char_foreground( + TCOD_Console* con, int x, int y, TCOD_color_t col); +/** + * Change a character on a console tile, without changing its colors. + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \param c The character code to set. + */ +TCOD_PUBLIC void TCOD_console_set_char( + TCOD_Console* con, int x, int y, int c); +/** + * Draw a character on a console using the default colors. + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \param c The character code to place. + * \param flag A TCOD_bkgnd_flag_t flag. + */ +TCOD_PUBLIC void TCOD_console_put_char( + TCOD_Console* con, int x, int y, int c, TCOD_bkgnd_flag_t flag); +/** + * Draw a character on the console with the given colors. + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \param c The character code to place. + * \param fore The foreground color. + * \param back The background color. This color will not be blended. + */ +TCOD_PUBLIC void TCOD_console_put_char_ex( + TCOD_Console* con, + int x, + int y, + int c, + TCOD_color_t fore, TCOD_color_t back); +/** + * Set a consoles default background flag. + * + * \param con A console pointer. + * \param flag One of `TCOD_bkgnd_flag_t`. + */ +TCOD_PUBLIC void TCOD_console_set_background_flag( + TCOD_Console* con, + TCOD_bkgnd_flag_t flag); +/** + * Return a consoles default background flag. + */ +TCOD_PUBLIC TCOD_NODISCARD +TCOD_bkgnd_flag_t TCOD_console_get_background_flag( + TCOD_Console* con); +/** + * Set a consoles default alignment. + * + * \param con A console pointer. + * \param alignment One of TCOD_alignment_t + */ +TCOD_PUBLIC void TCOD_console_set_alignment( + TCOD_Console* con, + TCOD_alignment_t alignment); +/** + * Return a consoles default alignment. + */ +TCOD_PUBLIC TCOD_NODISCARD +TCOD_alignment_t TCOD_console_get_alignment(TCOD_Console* con); + +TCOD_PUBLIC TCOD_NODISCARD +TCOD_color_t TCOD_console_get_default_background( + TCOD_Console* con); +TCOD_PUBLIC TCOD_NODISCARD +TCOD_color_t TCOD_console_get_default_foreground( + TCOD_Console* con); +/** + * Return the background color of a console at x,y + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \return A TCOD_color_t struct with a copy of the background color. + */ +TCOD_PUBLIC TCOD_NODISCARD +TCOD_color_t TCOD_console_get_char_background( + const TCOD_Console* con, int x, int y); +/** + * Return the foreground color of a console at x,y + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \return A TCOD_color_t struct with a copy of the foreground color. + */ +TCOD_PUBLIC TCOD_NODISCARD +TCOD_color_t TCOD_console_get_char_foreground( + const TCOD_Console* con, int x, int y); +/** + * Return a character code of a console at x,y + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \return The character code. + */ +TCOD_PUBLIC TCOD_NODISCARD +int TCOD_console_get_char(const TCOD_Console* con, int x, int y); +/** + * Fade the color of the display. + * + * \param val Where at 255 colors are normal and at 0 colors are completely + * faded. + * \param fadecol Color to fade towards. + */ +TCOD_PUBLIC +void TCOD_console_set_fade(uint8_t val, TCOD_color_t fade); +/** + * Return the fade value. + * + * \return At 255 colors are normal and at 0 colors are completely faded. + */ +TCOD_PUBLIC TCOD_NODISCARD +uint8_t TCOD_console_get_fade(void); +/** + * Return the fade color. + * + * \return The current fading color. + */ +TCOD_PUBLIC TCOD_NODISCARD +TCOD_color_t TCOD_console_get_fading_color(void); +void TCOD_console_resize_( + TCOD_Console* console, int width, int height); +#ifdef __cplusplus +} // extern "C" +namespace tcod { +struct ConsoleDeleter { + void operator()(TCOD_Console* console) const { + TCOD_console_delete(console); + } +}; +typedef std::unique_ptr ConsolePtr; +TCOD_NODISCARD +inline auto new_console(int width, int height) +-> ConsolePtr +{ + ConsolePtr console{TCOD_console_new(width, height)}; + if (!console) { throw std::runtime_error(TCOD_get_error()); } + return console; +} +} // namespace tcod +#endif // __cplusplus +#endif // TCOD_CONSOLE_H_ diff --git a/tcod_sys/libtcod/include/console.hpp b/tcod_sys/libtcod/src/libtcod/console.hpp similarity index 91% rename from tcod_sys/libtcod/include/console.hpp rename to tcod_sys/libtcod/src/libtcod/console.hpp index 8accd6543..22f4c34e9 100644 --- a/tcod_sys/libtcod/include/console.hpp +++ b/tcod_sys/libtcod/src/libtcod/console.hpp @@ -1,1791 +1,1823 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_CONSOLE_HPP -#define _TCOD_CONSOLE_HPP - -#include "console.h" -#include "console_rexpaint.h" - -#ifdef TCOD_CONSOLE_SUPPORT - -#include "image.hpp" -#include "color.hpp" - -class TCODImage; -/** - @PageName console - @PageCategory Core - @PageTitle Console - @PageDesc The console emulator handles the rendering of the game screen and the keyboard input. -Classic real time game loop: - @Cpp - TCODConsole::initRoot(80,50,"my game",false); - TCODSystem::setFps(25); // limit framerate to 25 frames per second - while (!endGame && !TCODConsole::isWindowClosed()) { - TCOD_key_t key; - TCODSystem::checkForEvent(TCOD_EVENT_KEY_PRESS,&key,NULL); - updateWorld (key, TCODSystem::getLastFrameLength()); - // updateWorld(TCOD_key_t key, float elapsed) (using key if key.vk != TCODK_NONE) - // use elapsed to scale any update that is time dependent. - // ... draw world+GUI on TCODConsole::root - TCODConsole::flush(); - } - @Lua - tcod.console.initRoot(80,50,"my game", false) - root=libtcod.TCODConsole_root - tcod.system.setFps(25) - while not tcod.console.isWindowClosed() do - -- ... draw on root - tcod.console.flush() - key=tcod.console.checkForKeypress() - -- ... update world, using key and tcod.system.getLastFrameLength - end - -*/ -/** - @PageName console - @FuncDesc Classic turn by turn game loop: - @Cpp - TCODConsole::initRoot(80,50,"my game",false); - while (!endGame && !TCODConsole::isWindowClosed()) { - // ... draw on TCODConsole::root - TCODConsole::flush(); - TCOD_key_t key; - TCODConsole::waitForEvent(TCOD_EVENT_KEY_PRESS,&key,NULL,true); - //... update world, using key - } -*/ - -class TCODLIB_API TCODConsole { -public : - /** - @PageName console_init - @PageTitle Initializing the console - @PageFather console - */ - - static TCODConsole *root; - - /** - @PageName console_init_root - @PageTitle Creating the game window - @PageFather console_init - @Cpp static void TCODConsole::initRoot (int w, int h, const char * title, bool fullscreen = false, TCOD_renderer_t renderer = TCOD_RENDERER_SDL) - @C void TCOD_console_init_root (int w, int h, const char * title, bool fullscreen, TCOD_renderer_t renderer) - @Py console_init_root (w, h, title, fullscreen = False, renderer = RENDERER_SDL) - @C# - static void TCODConsole::initRoot(int w, int h, string title) - static void TCODConsole::initRoot(int w, int h, string title, bool fullscreen) - static void TCODConsole::initRoot(int w, int h, string title, bool fullscreen, TCODRendererType renderer) - @Lua - tcod.console.initRoot(w,h,title) -- fullscreen = false, renderer = SDL - tcod.console.initRoot(w,h,title,fullscreen) -- renderer = SDL - tcod.console.initRoot(w,h,title,fullscreen,renderer) - -- renderers : tcod.GLSL, tcod.OpenGL, tcod.SDL - @Param w,h size of the console(in characters). The default font in libtcod (./terminal.png) uses 8x8 pixels characters. - You can change the font by calling TCODConsole::setCustomFont before calling initRoot. - @Param title title of the window. It's not visible when you are in fullscreen. - Note 1 : you can dynamically change the window title with TCODConsole::setWindowTitle - @Param fullscreen whether you start in windowed or fullscreen mode. - Note 1 : you can dynamically change this mode with TCODConsole::setFullscreen - Note 2 : you can get current mode with TCODConsole::isFullscreen - @Param renderer which renderer to use. Possible values are : - * TCOD_RENDERER_GLSL : works only on video cards with pixel shaders - * TCOD_RENDERER_OPENGL : works on all video cards supporting OpenGL 1.4 - * TCOD_RENDERER_SDL : should work everywhere! - Note 1: if you select a renderer that is not supported by the player's machine, libtcod scan the lower renderers until it finds a working one. - Note 2: on recent video cards, GLSL results in up to 900% increase of framerates in the true color sample compared to SDL renderer. - Note 3: whatever renderer you use, it can always be overridden by the player through the libtcod.cfg file. - Note 4: you can dynamically change the renderer after calling initRoot with TCODSystem::setRenderer. - Note 5: you can get current renderer with TCODSystem::getRenderer. It might be different from the one you set in initRoot in case it's not supported on the player's computer. - @CppEx TCODConsole::initRoot(80, 50, "The Chronicles Of Doryen v0.1"); - @CEx TCOD_console_init_root(80, 50, "The Chronicles Of Doryen v0.1", false, TCOD_RENDERER_OPENGL); - @PyEx libtcod.console_init_root(80, 50, 'The Chronicles Of Doryen v0.1') - @LuaEx tcod.console.initRoot(80,50,"The Chronicles Of Doryen v0.1") - */ - static void initRoot(int w, int h, const char * title, bool fullscreen = false, TCOD_renderer_t renderer=TCOD_RENDERER_SDL); - - /** - @PageName console_set_custom_font - @PageTitle Using a custom bitmap font - @PageFather console_init - @FuncTitle setCustomFont - @FuncDesc This function allows you to use a bitmap font (png or bmp) with custom character size or layout. - It should be called before initializing the root console with initRoot. - Once this function is called, you can define your own custom mappings using mapping functions -
Different font layouts
-
- Comparison before/after subcell resolution in TCOD :
-
- Pyromancer ! screenshot, making full usage of subcell resolution :
+
+ Comparison before/after subcell resolution in TCOD :
+
+ Pyromancer ! screenshot, making full usage of subcell resolution :
@Cpp void TCODImage::blit2x(TCODConsole *dest, int dx, int dy, int sx=0, int sy=0, int w=-1, int h=-1 ) const; @C void TCOD_image_blit_2x(TCOD_image_t image, TCOD_console_t dest, int dx, int dy, int sx, int sy, int w, int h); @@ -447,7 +447,7 @@ public : @Param dest The console of which the image will be blited. Foreground, background and character data will be overwritten. @Param dx,dy Coordinate of the console cell where the upper left corner of the blitted image will be. @Param sx,sy,w,h Part of the image to blit. Use -1 in w and h to blit the whole image. - */ + */ void blit2x(TCODConsole *dest, int dx, int dy, int sx=0, int sy=0, int w=-1, int h=-1) const; #endif diff --git a/tcod_sys/libtcod/include/lex.h b/tcod_sys/libtcod/include/lex.h index cf05e64b2..fe92b7ac4 100644 --- a/tcod_sys/libtcod/include/lex.h +++ b/tcod_sys/libtcod/include/lex.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - /* * This is a libtcod internal module. * Use at your own risks... diff --git a/tcod_sys/libtcod/include/lex.hpp b/tcod_sys/libtcod/include/lex.hpp index bdcbec53e..0db88e654 100644 --- a/tcod_sys/libtcod/include/lex.hpp +++ b/tcod_sys/libtcod/include/lex.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -32,12 +33,12 @@ #define _TCOD_LEX_HPP #include "lex.h" - + class TCODLIB_API TCODLex { public : TCODLex(); - TCODLex( const char **symbols, const char **keywords, const char *simpleComment="//", - const char *commentStart="/*", const char *commentStop="*/", const char *javadocCommentStart="/**", + TCODLex( const char **symbols, const char **keywords, const char *simpleComment="//", + const char *commentStart="/*", const char *commentStop="*/", const char *javadocCommentStart="/**", const char *stringDelim="\"", int flags=TCOD_LEX_FLAG_NESTING_COMMENT); ~TCODLex(); diff --git a/tcod_sys/libtcod/include/libtcod.h b/tcod_sys/libtcod/include/libtcod.h index f203a7aaa..138a18fc3 100644 --- a/tcod_sys/libtcod/include/libtcod.h +++ b/tcod_sys/libtcod/include/libtcod.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _LIBTCOD_H #define _LIBTCOD_H @@ -36,6 +36,7 @@ #include "bsp.h" #include "color.h" #include "console.h" +#include "console_rexpaint.h" #include "fov.h" #include "heightmap.h" #include "image.h" diff --git a/tcod_sys/libtcod/include/libtcod.hpp b/tcod_sys/libtcod/include/libtcod.hpp index 2655a6601..7134208db 100644 --- a/tcod_sys/libtcod/include/libtcod.hpp +++ b/tcod_sys/libtcod/include/libtcod.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _LIBTCOD_HPP #define _LIBTCOD_HPP diff --git a/tcod_sys/libtcod/include/libtcod_int.h b/tcod_sys/libtcod/include/libtcod_int.h index 9209419af..efe5d3698 100644 --- a/tcod_sys/libtcod/include/libtcod_int.h +++ b/tcod_sys/libtcod/include/libtcod_int.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCODLIB_INT_H #define _TCODLIB_INT_H #include @@ -32,9 +32,6 @@ #if defined(__ANDROID__) #include #endif -#ifdef TCOD_SDL2 -#include -#endif #include "libtcod_portability.h" #include "color.h" @@ -49,6 +46,11 @@ extern "C" { #endif +/* SDL2 forward declarations */ +struct SDL_Surface; +struct SDL_Window; +struct SDL_Renderer; + #ifdef TCOD_CONSOLE_SUPPORT typedef struct { int *ch_array; /* character code array */ @@ -126,7 +128,7 @@ typedef struct { int actual_fullscreen_width; int actual_fullscreen_height; #endif -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE /* renderer to use */ TCOD_renderer_t renderer; /* user post-processing callback */ @@ -138,7 +140,7 @@ typedef struct { #ifdef TCOD_CONSOLE_SUPPORT TCOD_key_t key_state; #endif -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE /* application window was closed */ bool is_window_closed; /* application has mouse focus */ @@ -179,7 +181,7 @@ extern TCOD_internal_context_t TCOD_ctx; #define TCOD_LOG(x) printf x #endif -#if defined(TCOD_SDL2) && !defined(NO_OPENGL) +#if !defined(TCOD_BARE) && !defined(NO_OPENGL) /* opengl utilities */ void TCOD_opengl_init_attributes(void); bool TCOD_opengl_init_state(int conw, int conh, void *font_tex); @@ -236,6 +238,7 @@ void TCOD_sys_save_fps(void); void TCOD_sys_restore_fps(void); void TCOD_sys_set_dirty(int dx, int dy, int dw, int dh); void TCOD_sys_set_dirty_character_code(int ch); +int TCOD_get_tileid_for_charcode_(int charcode); /* switch fullscreen mode */ void TCOD_sys_set_fullscreen(bool fullscreen); @@ -269,7 +272,7 @@ bool TCOD_sys_check_magic_number(const char *filename, size_t size, uint8_t *dat /* TCOD_list nonpublic methods */ void TCOD_list_set_size(TCOD_list_t l, int size); -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE /* SDL12/SDL2 abstraction layer */ @@ -282,7 +285,7 @@ typedef struct TCOD_SDL_driver_t { /* render the console on a surface/texture */ void (*render)(struct TCOD_SDL_driver_t *sdl, void *vbitmap, TCOD_console_data_t *console); /* create a new surface */ - SDL_Surface *(*create_surface) (int width, int height, bool with_alpha); + struct SDL_Surface *(*create_surface) (int width, int height, bool with_alpha); /* create the game window */ void (*create_window)(int w, int h, bool fullscreen); /* destroy the game window */ @@ -335,9 +338,9 @@ typedef struct { extern scale_data_t scale_data; extern float scale_factor; -extern SDL_Surface* charmap; -extern SDL_Window* window; -extern SDL_Renderer* renderer; +extern struct SDL_Surface* charmap; +extern struct SDL_Window* window; +extern struct SDL_Renderer* renderer; extern char *last_clipboard_text; #endif @@ -561,4 +564,3 @@ extern int oldFade; } #endif #endif - diff --git a/tcod_sys/libtcod/include/libtcod_portability.h b/tcod_sys/libtcod/include/libtcod_portability.h index bace23f8a..3bf9c9ecc 100644 --- a/tcod_sys/libtcod/include/libtcod_portability.h +++ b/tcod_sys/libtcod/include/libtcod_portability.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -98,6 +98,9 @@ #elif defined (__APPLE__) && defined (__MACH__) # define TCOD_MACOSX # define TCOD_GCC +# if __WORDSIZE == 64 +# define TCOD_64BITS +# endif #endif /* unicode rendering functions support */ @@ -123,12 +126,10 @@ #undef TCOD_IMAGE_SUPPORT #undef TCOD_OSUTIL_SUPPORT -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE #define TCOD_CONSOLE_SUPPORT #define TCOD_IMAGE_SUPPORT #define TCOD_OSUTIL_SUPPORT -#else -#define TCOD_BARE #endif /* int types */ @@ -167,6 +168,15 @@ char *strcasestr (const char *haystack, const char *needle); #define vsnwprintf _vsnwprintf #endif +/* cross platform deprecation */ +#if defined(_MSC_VER) +#define TCOD_DEPRECATED __declspec(deprecated) +#elif defined(__GNUC__) +#define TCOD_DEPRECATED __attribute__ ((deprecated)) +#else +#define TCOD_DEPRECATED +#endif + #ifdef __cplusplus } #endif diff --git a/tcod_sys/libtcod/include/libtcod_utility.h b/tcod_sys/libtcod/include/libtcod_utility.h index 14322e1cd..6dab8746f 100644 --- a/tcod_sys/libtcod/include/libtcod_utility.h +++ b/tcod_sys/libtcod/include/libtcod_utility.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,4 +36,4 @@ #define CLAMP(a, b, x) ((x) < (a) ? (a) : ((x) > (b) ? (b) : (x))) #define LERP(a, b, x) ( (a) + (x) * ((b) - (a)) ) -#endif \ No newline at end of file +#endif diff --git a/tcod_sys/libtcod/include/libtcod_version.h b/tcod_sys/libtcod/include/libtcod_version.h index bae64637a..336b832ae 100644 --- a/tcod_sys/libtcod/include/libtcod_version.h +++ b/tcod_sys/libtcod/include/libtcod_version.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,10 +28,10 @@ #ifndef LIBTCOD_VERSION_H #define LIBTCOD_VERSION_H -#define TCOD_HEXVERSION 0x010603 -#define TCOD_STRVERSION "1.6.3" -#define TCOD_TECHVERSION 0x01060300 +#define TCOD_HEXVERSION 0x010700 +#define TCOD_STRVERSION "1.7.0" +#define TCOD_TECHVERSION 0x01070000 -#define TCOD_STRVERSIONNAME "libtcod "TCOD_STRVERSION +#define TCOD_STRVERSIONNAME "libtcod " TCOD_STRVERSION #endif /* LIBTCOD_VERSION_H */ diff --git a/tcod_sys/libtcod/include/list.h b/tcod_sys/libtcod/include/list.h index edaac0e51..15514aa1d 100644 --- a/tcod_sys/libtcod/include/list.h +++ b/tcod_sys/libtcod/include/list.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_LIST_H #define _TCOD_LIST_H diff --git a/tcod_sys/libtcod/include/list.hpp b/tcod_sys/libtcod/include/list.hpp index 4ecbaa2d9..57d07f854 100644 --- a/tcod_sys/libtcod/include/list.hpp +++ b/tcod_sys/libtcod/include/list.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_LIST_HPP #define _TCOD_LIST_HPP @@ -55,10 +55,10 @@ public : @FuncDesc You can create an empty list with the default constructor. The C version returns a handler on the list. @Cpp template TCODList::TCODList() @C TCOD_list_t TCOD_list_new() - @CppEx + @CppEx TCODList intList; TCODList *floatList = new TCODList(); - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_t floatList = TCOD_list_new(); */ @@ -74,12 +74,12 @@ public : @Cpp template TCODList::TCODList(const TCODList &l) @C TCOD_list_t TCOD_list_duplicate(TCOD_list_t l) @Param l Existing list to duplicate. - @CppEx + @CppEx TCODList intList; intList.push(3); intList.push(5); TCODList intList2(intList); // intList2 contains two elements : 3 and 5 - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_push(intList,(const void *)3); TCOD_list_push(intList,(const void *)5); @@ -121,11 +121,11 @@ public : @Cpp virtual template TCODList::~TCODList() @C void TCOD_list_delete(TCOD_list_t l) @Param l In the C version, the list handler, returned by a constructor. - @CppEx + @CppEx TCODList *intList = new TCODList(); // allocate a new empty list intList->push(5); // the list contains 1 element at position 0, value = 5 delete intList; // destroy the list - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_push(intList,(const void *)5); TCOD_list_delete(intList); @@ -146,11 +146,11 @@ public : @Param idx Index of the element. 0 <= idx @Param l In the C version, the handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; // the array is empty (contains 0 elements) intList.set(5,0); // the array contains 1 element at position 0, value = 5 intList.set(7,2); // the array contains 3 elements : 5, 0, 7 - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_set(intList,(const void *)5,0); TCOD_list_set(intList,(const void *)7,2); @@ -171,11 +171,11 @@ public : @Param idx Index of the element. 0 <= idx < size of the array @Param l In the C version, the handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; intList.set(5,0); int val = intList.get(0); // val == 5 - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_set(intList,(const void *)5,0); int val = (int)TCOD_list_get(intList,0); // val == 5 @@ -190,16 +190,16 @@ public : @Cpp template bool TCODList::isEmpty() const @C bool TCOD_list_is_empty(TCOD_list_t l) @Param l In the C version, the handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; bool empty=intList.isEmpty(); // empty == true intList.set(3,0); empty=intList.isEmpty(); // empty == false - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); - bool empty=TCOD_list_is_empty(intList); // empty == true + bool empty=TCOD_list_is_empty(intList); // empty == true TCOD_list_set(intList,(const void *)5,0); - empty=TCOD_list_is_empty(intList); // empty == false + empty=TCOD_list_is_empty(intList); // empty == false */ bool isEmpty() const { return ( fillSize == 0 ); @@ -211,16 +211,16 @@ public : @Cpp template int TCODList::size() const @C int TCOD_list_size(TCOD_list_t l) @Param l In the C version, the handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; int size=intList.size(); // size == 0 intList.set(3,0); size=intList.size(); // size == 1 - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); - int size=TCOD_list_size(intList); // size == 0 + int size=TCOD_list_size(intList); // size == 0 TCOD_list_set(intList,(const void *)5,0); - size=TCOD_list_size(intList); // size == 1 + size=TCOD_list_size(intList); // size == 1 */ int size() const { return fillSize; @@ -233,16 +233,16 @@ public : @C bool TCOD_list_contains(TCOD_list_t l,const void * elt) @Param elt The element. @Param l In the C version, the handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; intList.set(3,0); bool has3 = intList.contains(3); // has3 == true bool has4 = intList.contains(4); // has4 == false - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_set(intList,(const void *)3,0); - bool has3 = TCOD_list_contains(intList,(const void *)3); // has3 == true - bool has4 = TCOD_list_contains(intList,(const void *)4); // has4 == false + bool has3 = TCOD_list_contains(intList,(const void *)3); // has3 == true + bool has4 = TCOD_list_contains(intList,(const void *)4); // has4 == false */ bool contains(const T elt) const { for ( T* curElt = begin(); curElt != end(); curElt ++) { @@ -262,11 +262,11 @@ public : @Param idx Index of the element after the insertion. 0 <= idx < list size @Param l In the C version, the list handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; // the list is empty (contains 0 elements) intList.set(0,5); // the list contains 1 element at position 0, value = 5 intList.insertBefore(2,0); // the list contains 2 elements : 2,5 - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_set(intList,0,(const void *)5); TCOD_list_insert_before(intList,(const void *)2,0); @@ -285,19 +285,19 @@ public : @PageName list_list @FuncTitle Removing an element from the list @FuncDesc The _fast versions replace the element to remove with the last element of the list. They're faster, but do not preserve the list order. - @Cpp + @Cpp template void TCODList::remove(const T elt) template void TCODList::removeFast(const T elt) - @C + @C void TCOD_list_remove(TCOD_list_t l, const void * elt) void TCOD_list_remove_fast(TCOD_list_t l, const void * elt) @Param elt The element to remove @Param l In the C version, the list handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; // the list is empty (contains 0 elements) intList.set(0,5); // the list contains 1 element at position 0, value = 5 intList.remove(5); // the list is empty - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_set(intList,0,(const void *)5); TCOD_list_remove(intList,(const void *)5); @@ -327,13 +327,13 @@ public : @C void TCOD_list_add_all(TCOD_list_t l, TCOD_list_t l2) @Param l The list inside which elements will be added. @Param l2 the list handler containing elements to insert. - @CppEx + @CppEx TCODList intList; intList.set(1,3); // intList contains 2 elements : 0, 3 TCODList intList2; // intList2 is empty intList2.set(0,1); // intList2 contains 1 element : 1 intList2.addAll(intList); // intList2 contains 3 elements : 1, 0, 3 - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_set(intList,1,(const void *)3); TCOD_list_t intList2 = TCOD_list_new(); @@ -352,11 +352,11 @@ public : @Cpp template void TCODList::clear() @C void TCOD_list_clear(TCOD_list_t l) @Param l In the C version, the list handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; intList.set(0,3); // intList contains 1 element intList.clear(); // intList is empty - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_set(intList,0,(const void *)5); TCOD_list_clear(intList); @@ -371,20 +371,20 @@ public : @Cpp template void TCODList::clearAndDelete() @C void TCOD_list_clear_and_delete(TCOD_list_t l) @Param l In the C version, the list handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; MyClass * cl=new MyClass(); // new instance of MyClass allocated here - intList.set(0,cl); + intList.set(0,cl); intList.clear(); // the list is empty. cl is always valid - intList.set(0,cl); + intList.set(0,cl); intList.clearAndDelete(); // the list is empty. delete cl has been called. The address cl is no longer valid. - @C + @C TCOD_list_t intList = TCOD_list_new(); - void *data=calloc(10,1); // some memory allocation here + void *data=calloc(10,1); // some memory allocation here TCOD_list_set(intList,0,(const void *)data); - TCOD_list_clear(intList); // the list is empty, but data is always valid + TCOD_list_clear(intList); // the list is empty, but data is always valid TCOD_list_set(intList,0,(const void *)data); - TCOD_list_clear_and_delete(intList); // the list is empty, free(data) has been called. The address data is no longer valid + TCOD_list_clear_and_delete(intList); // the list is empty, free(data) has been called. The address data is no longer valid */ void clearAndDelete() { for ( T* curElt = begin(); curElt != end(); curElt ++ ) { @@ -397,17 +397,17 @@ public : @PageName list_list @FuncTitle Reversing a list @FuncDesc This function reverses the order of the elements in the list. - @Cpp + @Cpp void TCODList::reverse() - @C + @C void TCOD_list_reverse(TCOD_list_t l) @Param l In the C version, the list handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; // the list is empty (contains 0 elements) intList.push(5); // the list contains 1 element at position 0, value = 5 intList.push(2); // the list contains 2 elements : 5,2 intList.reverse(); // now order is 2,5 - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_push(intList,(const void *)5); TCOD_list_push(intList,(const void *)2); @@ -431,15 +431,15 @@ public : @PageFather list @FuncTitle Pushing an element on the stack @FuncDesc You can push an element on the stack (append it to the end of the list) : - @Cpp template void TCODList::push(const T elt) + @Cpp template void TCODList::push(const T elt) @C void TCOD_list_push(TCOD_list_t l, const void * elt) @Param elt Element to append to the list. @Param l In the C version, the list handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; // the list is empty (contains 0 elements) intList.push(5); // the list contains 1 element at position 0, value = 5 intList.push(2); // the list contains 2 elements : 5,2 - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_push(intList,(const void *)5); TCOD_list_push(intList,(const void *)2); @@ -456,13 +456,13 @@ public : @Cpp template T TCODList::pop() @C void * TCOD_list_pop(TCOD_list_t l) @Param l In the C version, the list handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; // the list is empty (contains 0 elements) intList.push(5); // the list contains 1 element at position 0, value = 5 intList.push(2); // the list contains 2 elements : 5,2 int val = intList.pop(); // val == 2, the list contains 1 element : 5 val = intList.pop(); // val == 5, the list is empty - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_push(intList,(const void *)5); TCOD_list_push(intList,(const void *)2); @@ -481,13 +481,13 @@ public : @Cpp template T TCODList::peek() const @C void * TCOD_list_peek(TCOD_list_t l) @Param l In the C version, the list handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; intList.push(3); // intList contains 1 elements : 3 int val = intList.peek(); // val == 3, inList contains 1 elements : 3 intList.push(2); // intList contains 2 elements : 3, 2 val = intList.peek(); // val == 2, inList contains 2 elements : 3, 2 - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_push(intList,(const void *)3); int val = (int)TCOD_list_peek(intList); @@ -504,14 +504,14 @@ public : @PageFather list @PageTitle Iterators @FuncDesc You can iterate through the elements of the list using an iterator. begin() returns the address of the first element of the list. You go to the next element using the increment operator ++. When the iterator's value is equal to end(), you've gone through all the elements. Warning ! You cannot insert elements in the list while iterating through it. Inserting elements can result in reallocation of the list and your iterator will not longer be valid. - @Cpp + @Cpp template T * TCODList::begin() const template T * TCODList::end() const - @C + @C void ** TCOD_list_begin(TCOD_list_t l) void ** TCOD_list_end(TCOD_list_t l) @Param l In the C version, the list handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; // the list is empty (contains 0 elements) intList.push(5); // the list contains 1 element at position 0, value = 5 intList.push(2); // the list contains 2 elements : 5,2 @@ -519,7 +519,7 @@ public : int currentValue=*iterator; printf("value : %d\n", currentValue ); } - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_push(intList,(const void *)5); TCOD_list_push(intList,(const void *)2); @@ -540,15 +540,15 @@ public : /** @PageName list_iterator @FuncDesc You can remove an element from the list while iterating. The element at the iterator position will be removed. The function returns the new iterator. The _fast versions replace the element to remove with the last element of the list. They're faster, but do not preserve the list order. - @Cpp + @Cpp template T *TCODList::remove(T *iterator) template T *TCODList::removeFast(T *iterator) - @C + @C void **TCOD_list_remove_iterator(TCOD_list_t l, void **iterator) void **TCOD_list_remove_iterator_fast(TCOD_list_t l, void **iterator) @Param iterator The list iterator. @Param l In the C version, the list handler, returned by a constructor. - @CppEx + @CppEx TCODList intList; // the list is empty (contains 0 elements) intList.push(5); // the list contains 1 element at position 0, value = 5 intList.push(2); // the list contains 2 elements : 5,2 @@ -562,7 +562,7 @@ public : printf("value : %d\n", currentValue ); // all 3 values will be printed : 5,2,3 } // now the list contains only two elements : 5,3 - @CEx + @CEx TCOD_list_t intList = TCOD_list_new(); TCOD_list_push(intList,(const void *)5); TCOD_list_push(intList,(const void *)2); @@ -598,7 +598,7 @@ public : array[i++]=*t; } return *this; - } + } protected : void allocate() { diff --git a/tcod_sys/libtcod/include/mersenne.h b/tcod_sys/libtcod/include/mersenne.h index 198acccc1..c2bef0fb8 100644 --- a/tcod_sys/libtcod/include/mersenne.h +++ b/tcod_sys/libtcod/include/mersenne.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_RANDOM_H #define _TCOD_RANDOM_H diff --git a/tcod_sys/libtcod/include/mersenne.hpp b/tcod_sys/libtcod/include/mersenne.hpp index 80d79205f..3b09906c6 100644 --- a/tcod_sys/libtcod/include/mersenne.hpp +++ b/tcod_sys/libtcod/include/mersenne.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_RANDOM_HPP #define _TCOD_RANDOM_HPP diff --git a/tcod_sys/libtcod/include/mersenne_types.h b/tcod_sys/libtcod/include/mersenne_types.h index 99b21e27d..2d62d5420 100644 --- a/tcod_sys/libtcod/include/mersenne_types.h +++ b/tcod_sys/libtcod/include/mersenne_types.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_RANDOM_TYPES_H #define _TCOD_RANDOM_TYPES_H diff --git a/tcod_sys/libtcod/include/mouse.h b/tcod_sys/libtcod/include/mouse.h index b0f1bdd34..0cad0e22a 100644 --- a/tcod_sys/libtcod/include/mouse.h +++ b/tcod_sys/libtcod/include/mouse.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_MOUSE_H #define _TCOD_MOUSE_H diff --git a/tcod_sys/libtcod/include/mouse.hpp b/tcod_sys/libtcod/include/mouse.hpp index 5a87569e2..ac40cfc61 100644 --- a/tcod_sys/libtcod/include/mouse.hpp +++ b/tcod_sys/libtcod/include/mouse.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_MOUSE_HPP #define _TCOD_MOUSE_HPP diff --git a/tcod_sys/libtcod/include/mouse_types.h b/tcod_sys/libtcod/include/mouse_types.h index e8dd52b5f..c48ac429e 100644 --- a/tcod_sys/libtcod/include/mouse_types.h +++ b/tcod_sys/libtcod/include/mouse_types.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_MOUSE_TYPES_H #define _TCOD_MOUSE_TYPES_H @@ -42,9 +42,9 @@ typedef struct { bool lbutton ; /* left button status */ bool rbutton ; /* right button status */ bool mbutton ; /* middle button status */ - bool lbutton_pressed ; /* left button pressed event */ - bool rbutton_pressed ; /* right button pressed event */ - bool mbutton_pressed ; /* middle button pressed event */ + bool lbutton_pressed ; /* left button pressed event */ + bool rbutton_pressed ; /* right button pressed event */ + bool mbutton_pressed ; /* middle button pressed event */ bool wheel_up ; /* wheel up event */ bool wheel_down ; /* wheel down event */ } TCOD_mouse_t; diff --git a/tcod_sys/libtcod/include/namegen.h b/tcod_sys/libtcod/include/namegen.h index 8f5b4813e..6783a0094 100644 --- a/tcod_sys/libtcod/include/namegen.h +++ b/tcod_sys/libtcod/include/namegen.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/include/namegen.hpp b/tcod_sys/libtcod/include/namegen.hpp index 0dc4b3c96..82a07d8c2 100644 --- a/tcod_sys/libtcod/include/namegen.hpp +++ b/tcod_sys/libtcod/include/namegen.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -49,9 +50,9 @@ class TCODLIB_API TCODNamegen { @PageTitle Creating a generator @FuncDesc In order to be able to generate names, the name generator needs to be fed proper data. It will then be ready to generate random names defined in the file(s) it is fed. Syllable set parsing is achieved via the following. Note 1: Each file will be parsed once only. If, for some reason, you would like to parse the same file twice, you will need to destroy the generator first, which will empty the list of parsed files along with erasing all the data retrieved from those files. - + Note 2: The generator can be fed data multiple times if you have it in separate files. Just make sure the structure names in them aren't duplicated, otherwise they will be silently ignored. - + Note 3: In the C++ version, you are not obliged to specify the random number generator. If you skip it in the function call, the generator will assume you would like to use an instance of the default generator. @Cpp static void TCODNamegen::parse (const char * filename, TCODRandom * random = NULL) @@ -62,7 +63,7 @@ class TCODLIB_API TCODNamegen { static void TCODNameGenerator::parse(string filename, TCODRandom random) @Param filename The file where the desired syllable set is saved, along with its relative parh, for instance, "data/names.txt". @Param random A random number generator object. Use NULL for the default random number generator - @CppEx + @CppEx TCODNamegen::parse("data/names.txt",TCODRandom::getInstance()); TCODNamegen::parse("data/names2.txt"); @CEx TCOD_namegen_parse("data/names.txt",TCOD_random_get_instance()); @@ -74,7 +75,7 @@ class TCODLIB_API TCODNamegen { @PageName namegen_init @FuncTitle Destroying a generator @FuncDesc To release the resources used by a name generator, you may call: - This will free all memory used by the generator. In order to generate a name again, you have to parse a file again. + This will free all memory used by the generator. In order to generate a name again, you have to parse a file again. @Cpp static void TCODNamegen::destroy (void) @C void TCOD_namegen_destroy (void) @Py namegen_destroy () @@ -89,9 +90,9 @@ class TCODLIB_API TCODNamegen { @FuncTitle Generating a default name @FuncDesc The following will output a random name generated using one of the generation rules specified in the syllable set: Should you choose to allocate memory for the output, you need to remember to deallocate it once you don't need the name anymore using the free() function. This applies to C++ as well (delete won't work - you have to use free()). - + On the other hand, should you choose not to allocate memory, be aware that subsequent calls will overwrite the previously returned pointer, so make sure to copy the output using strcpy(), strdup() or other means of your choosing. - + The name you specify needs to be in one of the files the generator has previously parsed (see Creating a generator). If such a name doesn't exist, a warning will be displayed and NULL will be returned. @Cpp static char * TCODNamegen::generate (char * name, bool allocate = false) @C char * TCOD_namegen_generate (char * name, bool allocate) @@ -100,13 +101,13 @@ class TCODLIB_API TCODNamegen { @Param name The structure name you wish to refer to, for instance, "celtic female". For more about how structure names work, please refer to those chapters. @Param allocate Whether memory should be allocated for the output or not. - @CppEx + @CppEx TCODNamegen::parse("data/names.txt",TCODRandom::getInstance()); char * myName = TCODNamegen::generate("fantasy female"); - @CEx + @CEx TCOD_namegen_parse("data/names.txt",TCOD_random_get_instance()); char * my_name = TCOD_namegen_generate("Celtic male",false); - @PyEx + @PyEx libtcod.namegen_parse('data/names.txt') name = libtcod.namegen_generate('Nordic female') */ @@ -124,13 +125,13 @@ class TCODLIB_API TCODNamegen { For more about how structure names work, please refer to those chapters. @Param rule The name generation rule. See this chapter for more details. @Param allocate Whether memory should be allocated for the output or not. - @CppEx + @CppEx TCODNamegen::parse("data/names.txt",TCODRandom::getInstance()); char * myName = TCODNamegen::generateCustom("Nordic male","$s$e"); - @CEx + @CEx TCOD_namegen_parse("data/names.txt",TCOD_random_get_instance()); char * my_name = TCOD_namegen_generate_custom("Mesopotamian female","$s$e",false); - @PyEx + @PyEx libtcod.namegen_parse('data/names.txt') name = libtcod.namegen_generate_custom('Nordic female','$s$e') */ diff --git a/tcod_sys/libtcod/include/noise.h b/tcod_sys/libtcod/include/noise.h index 3ba90d63f..e812a7053 100644 --- a/tcod_sys/libtcod/include/noise.h +++ b/tcod_sys/libtcod/include/noise.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_PERLIN_H #define _TCOD_PERLIN_H diff --git a/tcod_sys/libtcod/include/noise.hpp b/tcod_sys/libtcod/include/noise.hpp index 0fbe7c3ef..915b9cd4a 100644 --- a/tcod_sys/libtcod/include/noise.hpp +++ b/tcod_sys/libtcod/include/noise.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_PERLIN_HPP #define _TCOD_PERLIN_HPP @@ -157,7 +157,7 @@ class TCODLIB_API TCODNoise { @PageFather noise @PageTitle Choosing a noise type @FuncTitle Choosing a noise type - @FuncDesc Use this function to define the default algorithm used by the noise functions. + @FuncDesc Use this function to define the default algorithm used by the noise functions. The default algorithm is simplex. It's much faster than Perlin, especially in 4 dimensions. It has a better contrast too. @Cpp void TCODNoise::setType(TCOD_noise_type_t type) @C void TCOD_noise_set_type(TCOD_noise_t noise, TCOD_noise_type_t type) @@ -188,7 +188,7 @@ float TCOD_noise_get_ex(TCOD_noise_t noise, float *f, TCOD_noise_type_t type) @C# float TCODNoise::get(float[] f, type=NoiseDefault) @Param noise In the C version, the generator handler, returned by the initialization function. @Param f An array of coordinates, depending on the generator dimensions (between 1 and 4). The same array of coordinates will always return the same value. - @Param type The algorithm to use. If not defined, use the default one (set with setType or simplex if not set) + @Param type The algorithm to use. If not defined, use the default one (set with setType or simplex if not set) @CppEx // 1d noise TCODNoise * noise1d = new TCODNoise(1); @@ -235,7 +235,7 @@ float TCOD_noise_get_fbm(TCOD_noise_t noise, float *f, float octaves, TCOD_noise @Param noise In the C version, the generator handler, returned by the initialization function. @Param f An array of coordinates, depending on the generator dimensions (between 1 and 4). The same array of coordinates will always return the same value. @Param octaves Number of iterations. Must be < TCOD_NOISE_MAX_OCTAVES = 128 - @Param type The algorithm to use. If not defined, use the default one (set with setType or simplex if not set) + @Param type The algorithm to use. If not defined, use the default one (set with setType or simplex if not set) @CppEx // 1d fbm TCODNoise * noise1d = new TCODNoise(1); diff --git a/tcod_sys/libtcod/include/noise_defaults.h b/tcod_sys/libtcod/include/noise_defaults.h index 41a02fe78..9277ff7de 100644 --- a/tcod_sys/libtcod/include/noise_defaults.h +++ b/tcod_sys/libtcod/include/noise_defaults.h @@ -1,3 +1,30 @@ +/* +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. +* +* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ #ifndef _TCOD_NOISE_DEFAULTS #define _TCOD_NOISE_DEFAULTS diff --git a/tcod_sys/libtcod/include/parser.h b/tcod_sys/libtcod/include/parser.h index 3132eb04e..2f1110ff8 100644 --- a/tcod_sys/libtcod/include/parser.h +++ b/tcod_sys/libtcod/include/parser.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_PARSER_H #define _TCOD_PARSER_H diff --git a/tcod_sys/libtcod/include/parser.hpp b/tcod_sys/libtcod/include/parser.hpp index 242670cb8..a77ae79d3 100644 --- a/tcod_sys/libtcod/include/parser.hpp +++ b/tcod_sys/libtcod/include/parser.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_PARSER_HPP #define _TCOD_PARSER_HPP diff --git a/tcod_sys/libtcod/include/path.h b/tcod_sys/libtcod/include/path.h index 4d1239060..28e2c2f99 100644 --- a/tcod_sys/libtcod/include/path.h +++ b/tcod_sys/libtcod/include/path.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_PATH_H #define _TCOD_PATH_H diff --git a/tcod_sys/libtcod/include/path.hpp b/tcod_sys/libtcod/include/path.hpp index a9a3bc46b..d32c7228b 100644 --- a/tcod_sys/libtcod/include/path.hpp +++ b/tcod_sys/libtcod/include/path.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_PATH_HPP #define _TCOD_PATH_HPP @@ -552,4 +552,3 @@ class TCODLIB_API TCODDijkstra { }; #endif - diff --git a/tcod_sys/libtcod/include/sys.h b/tcod_sys/libtcod/include/sys.h index f7b764615..d6169b19d 100644 --- a/tcod_sys/libtcod/include/sys.h +++ b/tcod_sys/libtcod/include/sys.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_SYS_H #define _TCOD_SYS_H @@ -48,7 +48,7 @@ TCODLIB_API int TCOD_sys_get_fps(void); TCODLIB_API float TCOD_sys_get_last_frame_length(void); #endif -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE TCODLIB_API void TCOD_sys_save_screenshot(const char *filename); TCODLIB_API void TCOD_sys_force_fullscreen_resolution(int width, int height); TCODLIB_API void TCOD_sys_set_renderer(TCOD_renderer_t renderer); @@ -62,12 +62,12 @@ TCODLIB_API void TCOD_sys_get_char_size(int *w, int *h); TCODLIB_API void TCOD_sys_update_char(int asciiCode, int fontx, int fonty, TCOD_image_t img, int x, int y); #endif -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE TCODLIB_API void *TCOD_sys_get_SDL_window(void); TCODLIB_API void *TCOD_sys_get_SDL_renderer(void); #endif -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE typedef enum { TCOD_EVENT_NONE=0, TCOD_EVENT_KEY_PRESS=1, @@ -99,7 +99,7 @@ TCODLIB_API bool TCOD_sys_file_exists(const char * filename, ...); TCODLIB_API bool TCOD_sys_read_file(const char *filename, unsigned char **buf, size_t *size); TCODLIB_API bool TCOD_sys_write_file(const char *filename, unsigned char *buf, uint32_t size); -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE /* clipboard */ TCODLIB_API bool TCOD_sys_clipboard_set(const char *value); TCODLIB_API char *TCOD_sys_clipboard_get(void); @@ -137,7 +137,7 @@ TCODLIB_API TCOD_library_t TCOD_load_library(const char *path); TCODLIB_API void * TCOD_get_function_address(TCOD_library_t library, const char *function_name); TCODLIB_API void TCOD_close_library(TCOD_library_t); /* SDL renderer callback */ -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE typedef void (*SDL_renderer_t) (void *sdl_renderer); TCODLIB_API void TCOD_sys_register_SDL_renderer(SDL_renderer_t renderer); #endif diff --git a/tcod_sys/libtcod/include/sys.hpp b/tcod_sys/libtcod/include/sys.hpp index f7cbef28c..c344ef47d 100644 --- a/tcod_sys/libtcod/include/sys.hpp +++ b/tcod_sys/libtcod/include/sys.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_SYS_HPP #define _TCOD_SYS_HPP @@ -167,8 +167,8 @@ public : TCOD_EVENT_MOUSE_PRESS=8, TCOD_EVENT_MOUSE_RELEASE=16, TCOD_EVENT_MOUSE=TCOD_EVENT_MOUSE_MOVE|TCOD_EVENT_MOUSE_PRESS|TCOD_EVENT_MOUSE_RELEASE, - TCOD_EVENT_ANY=TCOD_EVENT_KEY|TCOD_EVENT_MOUSE, - } TCOD_event_t; + TCOD_EVENT_ANY=TCOD_EVENT_KEY|TCOD_EVENT_MOUSE, + } TCOD_event_t; static TCOD_event_t TCODSystem::waitForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush) @C TCOD_event_t TCOD_sys_wait_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush) @Py sys_wait_for_event(eventMask,key,mouse,flush) @@ -185,7 +185,7 @@ public : TCOD_key_t key; TCOD_mouse_t mouse; TCOD_event_t ev = TCOD_sys_wait_for_event(TCOD_EVENT_ANY,&key,&mouse,true); - if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... } + if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... } */ static TCOD_event_t waitForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush); @@ -202,8 +202,8 @@ public : TCOD_EVENT_MOUSE_PRESS=8, TCOD_EVENT_MOUSE_RELEASE=16, TCOD_EVENT_MOUSE=TCOD_EVENT_MOUSE_MOVE|TCOD_EVENT_MOUSE_PRESS|TCOD_EVENT_MOUSE_RELEASE, - TCOD_EVENT_ANY=TCOD_EVENT_KEY|TCOD_EVENT_MOUSE, - } TCOD_event_t; + TCOD_EVENT_ANY=TCOD_EVENT_KEY|TCOD_EVENT_MOUSE, + } TCOD_event_t; static TCOD_event_t TCODSystem::checkForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse) @C TCOD_event_t TCOD_sys_check_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse) @Py sys_check_for_event(eventMask,key,mouse) @@ -219,12 +219,12 @@ public : TCOD_key_t key; TCOD_mouse_t mouse; TCOD_event_t ev = TCOD_sys_check_for_event(TCOD_EVENT_ANY,&key,&mouse); - if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... } + if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... } */ static TCOD_event_t checkForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse); #endif -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE /** @PageName system_screenshots @PageFather system @@ -331,7 +331,7 @@ public : // do something with buf free(buf); } - */ + */ static bool readFile(const char *filename, unsigned char **buf, size_t *size); /** @PageName system_filesystem @@ -346,7 +346,7 @@ public : TCODSystem::writeFile("myfile.dat",buf,size)); @CEx TCOD_sys_write_file("myfile.dat",buf,size)); - */ + */ static bool writeFile(const char *filename, unsigned char *buf, uint32_t size); /** @PageName system_sdlcbk @@ -402,7 +402,7 @@ public : @Param x,y,w,h Part of the root console you want to redraw even if nothing has changed in the console back/fore/char. */ -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE /** @PageName system_misc @PageFather system @@ -483,7 +483,7 @@ public : static void updateChar(int asciiCode, int fontx, int fonty,const TCODImage *img,int x,int y); #endif -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE /** @PageName system_misc @FuncTitle Dynamically change libtcod's internal renderer diff --git a/tcod_sys/libtcod/include/tree.h b/tcod_sys/libtcod/include/tree.h index bf44f1b54..5d3fafd10 100644 --- a/tcod_sys/libtcod/include/tree.h +++ b/tcod_sys/libtcod/include/tree.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_TREE_H #define _TCOD_TREE_H diff --git a/tcod_sys/libtcod/include/tree.hpp b/tcod_sys/libtcod/include/tree.hpp index 5e7f6b22f..54b46abdb 100644 --- a/tcod_sys/libtcod/include/tree.hpp +++ b/tcod_sys/libtcod/include/tree.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_TREE_HPP #define _TCOD_TREE_HPP diff --git a/tcod_sys/libtcod/include/txtfield.h b/tcod_sys/libtcod/include/txtfield.h index 9d2399c3d..48739722a 100644 --- a/tcod_sys/libtcod/include/txtfield.h +++ b/tcod_sys/libtcod/include/txtfield.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,8 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - - #ifndef _TCOD_TEXT_H_ #define _TCOD_TEXT_H_ diff --git a/tcod_sys/libtcod/include/txtfield.hpp b/tcod_sys/libtcod/include/txtfield.hpp index 2a96883cf..807140c4c 100644 --- a/tcod_sys/libtcod/include/txtfield.hpp +++ b/tcod_sys/libtcod/include/txtfield.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_TEXT_HPP_ #define _TCOD_TEXT_HPP_ diff --git a/tcod_sys/libtcod/include/wrappers.h b/tcod_sys/libtcod/include/wrappers.h index 1da7ec7bb..ed0f6bf0c 100644 --- a/tcod_sys/libtcod/include/wrappers.h +++ b/tcod_sys/libtcod/include/wrappers.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/include/zip.h b/tcod_sys/libtcod/include/zip.h index e850a392c..5d0b449fb 100644 --- a/tcod_sys/libtcod/include/zip.h +++ b/tcod_sys/libtcod/include/zip.h @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_ZIP_H #define _TCOD_ZIP_H diff --git a/tcod_sys/libtcod/include/zip.hpp b/tcod_sys/libtcod/include/zip.hpp index 49b37c45f..6e0680ede 100644 --- a/tcod_sys/libtcod/include/zip.hpp +++ b/tcod_sys/libtcod/include/zip.hpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _TCOD_ZIP_HPP #define _TCOD_ZIP_HPP @@ -38,7 +38,7 @@ @PageTitle Compression toolkit @PageDesc This toolkit provides functions to save or read compressed data from a file. While the module is named Zip, it has nothing to do with the .zip format as it uses zlib compression (.gz format). Note that this modules has no Python wrapper. Use Python built-in zip module instead. - + You can use the compression buffer in two modes: * put data in the buffer, then save it to a file, * load a file into the buffer, then get data from it. @@ -52,17 +52,17 @@ public : @PageTitle Creating a compression buffer @FuncDesc This function initializes a compression buffer. @Cpp TCODZip::TCODZip() - @C TCOD_zip_t TCOD_zip_new() - */ + @C TCOD_zip_t TCOD_zip_new() + */ TCODZip(); - + /** @PageName zip_init @FuncDesc Once you don't need the buffer anymore, you can release resources. Note that the addresses returned by the getString function are no longer valid once the buffer has been destroyed. @Cpp TCODZip::~TCODZip() @C void TCOD_zip_delete(TCOD_zip_t zip) @Param zip In the C version, the buffer handler, returned by the constructor. - @CppEx + @CppEx TCODZip *zip = new TCODZip(); zip->loadFromFile("myCompressedFile.gz"); char c=zip->getChar(); @@ -71,7 +71,7 @@ public : const char *s=strdup(zip->getString()); // we duplicate the string to be able to use it after the buffer deletion zip->getData(nbBytes, dataPtr); delete zip; - @CEx + @CEx TCOD_zip_t zip=TCOD_zip_new(); TCOD_zip_load_from_file(zip,"myCompressedFile.gz"); char c=TCOD_zip_get_char(zip); @@ -79,8 +79,8 @@ public : float f=TCOD_zip_get_float(zip); const char *s=strdup(TCOD_zip_get_string(zip)); TCOD_zip_get_data(zip,nbBytes, dataPtr); - TCOD_zip_delete(zip); - */ + TCOD_zip_delete(zip); + */ ~TCODZip(); /** @@ -92,9 +92,9 @@ public : @C void TCOD_zip_put_char(TCOD_zip_t zip, char val) @Param zip In the C version, the buffer handler, returned by the constructor. @Param val A 8 bits value to store in the buffer - */ + */ void putChar(char val); - + /** @PageName zip_put @FuncTitle Putting an integer in the buffer @@ -102,7 +102,7 @@ public : @C void TCOD_zip_put_int(TCOD_zip_t zip, int val) @Param zip In the C version, the buffer handler, returned by the constructor. @Param val An integer value to store in the buffer - */ + */ void putInt(int val); /** @@ -176,9 +176,9 @@ public : @Cpp uint32_t TCODZip::getCurrentBytes() @C uint32_t TCOD_zip_get_current_bytes(TCOD_zip_t zip) @Param zip In the C version, the buffer handler, returned by the constructor. - */ + */ uint32_t getCurrentBytes() const; - + /** @PageName zip_put @FuncTitle Saving the buffer on disk @@ -188,7 +188,7 @@ public : @C int TCOD_zip_save_to_file(TCOD_zip_t zip, const char *filename) @Param zip In the C version, the buffer handler, returned by the constructor. @Param filename Name of the file - @CppEx + @CppEx TCODZip zip; zip.putChar('A'); zip.putInt(1764); @@ -196,7 +196,7 @@ public : zip.putString("A string"); zip.putData(nbBytes, dataPtr); zip.saveToFile("myCompressedFile.gz"); - @CEx + @CEx TCOD_zip_t zip=TCOD_zip_new(); TCOD_zip_put_char(zip,'A'); TCOD_zip_put_int(zip,1764); @@ -204,7 +204,7 @@ public : TCOD_zip_put_string(zip,"A string"); TCOD_zip_put_data(zip,nbBytes, dataPtr); TCOD_zip_save_to_file(zip,"myCompressedFile.gz"); - */ + */ int saveToFile(const char *filename); /** @@ -218,36 +218,36 @@ public : @C int TCOD_zip_load_from_file(TCOD_zip_t zip, const char *filename) @Param zip In the C version, the buffer handler, returned by the constructor. @Param filename Name of the file - */ + */ int loadFromFile(const char *filename); - + /** @PageName zip_load @FuncTitle Reading a char from the buffer @Cpp char TCODZip::getChar() @C char TCOD_zip_get_char(TCOD_zip_t zip) @Param zip In the C version, the buffer handler, returned by the constructor - */ + */ char getChar(); - + /** @PageName zip_load @FuncTitle Reading an integer from the buffer @Cpp int TCODZip::getInt() @C int TCOD_zip_get_int(TCOD_zip_t zip) @Param zip In the C version, the buffer handler, returned by the constructor. - */ + */ int getInt(); - + /** @PageName zip_load @FuncTitle Reading a floating point value from the buffer @Cpp float TCODZip::getFloat() @C float TCOD_zip_get_float(TCOD_zip_t zip) @Param zip In the C version, the buffer handler, returned by the constructor. - */ + */ float getFloat(); - + /** @PageName zip_load @FuncTitle Reading a string from the buffer @@ -255,16 +255,16 @@ public : @Cpp const char *TCODZip::getString() @C const char *TCOD_zip_get_string(TCOD_zip_t zip) @Param zip In the C version, the buffer handler, returned by the constructor. - */ + */ const char *getString(); - + /** @PageName zip_load @FuncTitle Reading a color from the buffer @Cpp TCODColor TCODZip::getColor() @C TCOD_color_t TCOD_zip_get_color(TCOD_zip_t zip) @Param zip In the C version, the buffer handler, returned by the constructor. - */ + */ TCODColor getColor(); #ifdef TCOD_IMAGE_SUPPORT @@ -274,7 +274,7 @@ public : @Cpp TCODImage *TCODZip::getImage() @C TCOD_image_t TCOD_zip_get_image(TCOD_zip_t zip) @Param zip In the C version, the buffer handler, returned by the constructor. - */ + */ TCODImage *getImage(); #endif @@ -285,10 +285,10 @@ public : @Cpp TCODConsole *TCODZip::getConsole() @C TCOD_console_t TCOD_zip_get_console(TCOD_zip_t zip) @Param zip In the C version, the buffer handler, returned by the constructor. - */ + */ TCODConsole *getConsole(); #endif - + /** @PageName zip_load @FuncTitle Reading some custom data from the buffer @@ -299,7 +299,7 @@ public : @Param zip In the C version, the buffer handler, returned by the constructor. @Param nbBytes Number of bytes to read @Param data Address of a pre-allocated buffer (at least nbBytes bytes) - @CppEx + @CppEx TCODZip zip; zip.loadFromFile("myCompressedFile.gz"); char c=zip.getChar(); @@ -307,7 +307,7 @@ public : float f= zip.getFloat(); const char *s=zip.getString(); zip.getData(nbBytes, dataPtr); - @CEx + @CEx TCOD_zip_t zip=TCOD_zip_new(); TCOD_zip_load_from_file(zip,"myCompressedFile.gz"); char c=TCOD_zip_get_char(zip); @@ -315,16 +315,16 @@ public : float f=TCOD_zip_get_float(zip); const char *s=TCOD_zip_get_string(zip); TCOD_zip_get_data(zip,nbBytes, dataPtr); - */ + */ int getData(int nbBytes, void *data); - + /** @PageName zip_load @FuncTitle Getting the number of remaining bytes in the buffer @Cpp uint32_t TCODZip::getRemainingBytes() const @C uint32_t TCOD_zip_get_remaining_bytes(TCOD_zip_t zip) @Param zip In the C version, the buffer handler, returned by the constructor. - */ + */ uint32_t getRemainingBytes() const; /** @@ -334,7 +334,7 @@ public : @C void TCOD_zip_skip_bytes(TCOD_zip_t zip, uint32_t nbBytes) @Param zip In the C version, the buffer handler, returned by the constructor. @Param nbBytes number of uncompressed bytes to skip - */ + */ void skipBytes(uint32_t nbBytes); protected : TCOD_zip_t data; diff --git a/tcod_sys/libtcod/src/README.txt b/tcod_sys/libtcod/src/README.txt index d7a6a6b7a..8b0d61471 100644 --- a/tcod_sys/libtcod/src/README.txt +++ b/tcod_sys/libtcod/src/README.txt @@ -1,7 +1,7 @@ This is the Doryen library source code. -libtcod.h and libtcod.hpp are the main headers, included respectively by -the C and C++ programs that use libtcod. +libtcod.h and libtcod.hpp are the main headers, included respectively by +the C and C++ programs that use libtcod. Each "toolkit" is in a separate file set. For each toolkit, you may have : * include/.h : the C header @@ -25,19 +25,19 @@ noise : various noise generators. parser : config file parser. path : path finding module. sys : system specific functions. -txtfield : work-in-progress text input utility +txtfield : work-in-progress text input utility zip : compression module -Note that some of the sys toolkits rely on system dependent functions. +Note that some of the sys toolkits rely on system dependent functions. They have currently a single working implementation relying on SDL : sys_sdl_c.c As it is heavily system dependent, the mouse C implementation is in sys_sdl_c.c. -As of 1.4, the image load/save functions are isolated in sys_sdl_XXX.c, +As of 1.4, the image load/save functions are isolated in sys_sdl_XXX.c, XXX being the image type (currently bmp and png). As of 1.5.1, sys_opengl_c.c contains OpenGL and GLSL renderers. Those two renderers are still dependent on SDL. -libtcod_int.h contains everything that is exported by the toolkits -(implemented in a toolkit and used in another one) but should not be seen +libtcod_int.h contains everything that is exported by the toolkits +(implemented in a toolkit and used in another one) but should not be seen by the user of the library. These are the private (or undocumented) modules : diff --git a/tcod_sys/libtcod/src/bresenham.cpp b/tcod_sys/libtcod/src/bresenham.cpp index 0b168a4cb..7ec503f0d 100644 --- a/tcod_sys/libtcod/src/bresenham.cpp +++ b/tcod_sys/libtcod/src/bresenham.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -35,16 +36,14 @@ bool TCODLine::step(int *xCur, int *yCur) { return TCOD_line_step(xCur,yCur) != 0; } -static TCODLineListener *listener=NULL; +static TCODLineListener *line_listener=NULL; // C to C++ bridge extern "C" bool internalListener(int x,int y) { - return listener->putPoint(x,y) ? 1 : 0; + return line_listener->putPoint(x,y) ? 1 : 0; } bool TCODLine::line(int xFrom, int yFrom, int xTo, int yTo, TCODLineListener *plistener) { - listener=plistener; + line_listener=plistener; return TCOD_line(xFrom,yFrom,xTo,yTo,internalListener) != 0; } - - diff --git a/tcod_sys/libtcod/src/bresenham_c.c b/tcod_sys/libtcod/src/bresenham_c.c index 611920922..cc3fbde21 100644 --- a/tcod_sys/libtcod/src/bresenham_c.c +++ b/tcod_sys/libtcod/src/bresenham_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -25,10 +26,24 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include - +/** + * \file bresenham_c.c + * \brief bresenham line drawing + */ +/* This static variable is deprecated since 1.6 */ static TCOD_bresenham_data_t bresenham_data; - -/* ********** bresenham line drawing ********** */ +/** + * \brief Initialize a TCOD_bresenham_data_t struct. + * + * \param xFrom The starting x position. + * \param yFrom The starting y position. + * \param xTo The ending x position. + * \param yTo The ending y position. + * \param data Pointer to a TCOD_bresenham_data_t struct. + * + * After calling this function you use TCOD_line_step_mt to iterate + * over the individual points on the line. + */ void TCOD_line_init_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_bresenham_data_t *data) { data->origx=xFrom; data->origy=yFrom; @@ -56,7 +71,17 @@ void TCOD_line_init_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_bresenham_da data->deltay *= 2; } } - +/** + * \brief Get the next point on a line, returns true once the line has ended. + * + * \param xCur An int pointer to fill with the next x position. + * \param yCur An int pointer to fill with the next y position. + * \param data Pointer to a initialized TCOD_bresenham_data_t struct. + * \return true after the ending point has been reached. + * + * The starting point is excluded by this function. + * After the ending point is reached, the next call will return true. + */ bool TCOD_line_step_mt(int *xCur, int *yCur, TCOD_bresenham_data_t *data) { if ( data->stepx*data->deltax > data->stepy*data->deltay ) { if ( data->origx == data->destx ) return true; @@ -79,7 +104,23 @@ bool TCOD_line_step_mt(int *xCur, int *yCur, TCOD_bresenham_data_t *data) { *yCur=data->origy; return false; } - +/** + * \brief Iterate over a line using a callback. + * + * \param xo The origin x position. + * \param yo The origin y position. + * \param xd The destination x position. + * \param yd The destination y position. + * \param listener A TCOD_line_listener_t callback. + * \param data Pointer to a TCOD_bresenham_data_t struct. + * \return true if the line was completely exhausted by the callback. + * + * \verbatim embed:rst:leading-asterisk + * .. deprecated:: 1.6.6 + * The `data` parameter for this call is redundant, you should call + * :any:`TCOD_line` instead. + * \endverbatim + */ bool TCOD_line_mt(int xo, int yo, int xd, int yd, TCOD_line_listener_t listener, TCOD_bresenham_data_t *data) { TCOD_line_init_mt(xo,yo,xd,yd,data); do { @@ -87,16 +128,62 @@ bool TCOD_line_mt(int xo, int yo, int xd, int yd, TCOD_line_listener_t listener, } while (! TCOD_line_step_mt(&xo,&yo,data)); return true; } - +/** + * \brief Initialize a line using a global state. + * + * \param xFrom The starting x position. + * \param yFrom The starting y position. + * \param xTo The ending x position. + * \param yTo The ending y position. + * + * \verbatim embed:rst:leading-asterisk + * .. deprecated:: 1.6.6 + * This function is not reentrant and will fail if a new line is started + * before the last is finished processing. + * + * Use :any:`TCOD_line_init_mt` instead. + * \endverbatim + */ void TCOD_line_init(int xFrom, int yFrom, int xTo, int yTo) { TCOD_line_init_mt(xFrom,yFrom,xTo,yTo,&bresenham_data); } - +/** + * \brief Get the next point in a line, returns true once the line has ended. + * + * \param xCur An int pointer to fill with the next x position. + * \param yCur An int pointer to fill with the next y position. + * \return true once the ending point has been reached. + * + * The starting point is excluded by this function. + * After the ending point is reached, the next call will return true. + * + * \verbatim embed:rst:leading-asterisk + * .. deprecated:: 1.6.6 + * This function is not reentrant and will fail if a new line is started + * before the last is finished processing. + * + * Use :any:`TCOD_line_step_mt` instead. + * \endverbatim + */ bool TCOD_line_step(int *xCur, int *yCur) { return TCOD_line_step_mt(xCur,yCur,&bresenham_data); } - +/** + * \brief Iterate over a line using a callback. + * + * \param xo The origin x position. + * \param yo The origin y position. + * \param xd The destination x position. + * \param yd The destination y position. + * \param listener A TCOD_line_listener_t callback. + * \return true if the line was completely exhausted by the callback. + * + * \verbatim embed:rst:leading-asterisk + * .. versionchanged:: 1.6.6 + * This function is now reentrant. + * \endverbatim + */ bool TCOD_line(int xo, int yo, int xd, int yd, TCOD_line_listener_t listener) { + TCOD_bresenham_data_t bresenham_data; return TCOD_line_mt(xo,yo,xd,yd,listener,&bresenham_data); } - diff --git a/tcod_sys/libtcod/src/bsp.cpp b/tcod_sys/libtcod/src/bsp.cpp index 1b77d5368..4f7cb7f31 100644 --- a/tcod_sys/libtcod/src/bsp.cpp +++ b/tcod_sys/libtcod/src/bsp.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -165,4 +166,3 @@ TCODBsp *TCODBsp::findNode(int px, int py) { } return this; } - diff --git a/tcod_sys/libtcod/src/bsp_c.c b/tcod_sys/libtcod/src/bsp_c.c index ac9a5d12c..a959966d7 100644 --- a/tcod_sys/libtcod/src/bsp_c.c +++ b/tcod_sys/libtcod/src/bsp_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -162,7 +163,7 @@ void TCOD_bsp_split_once(TCOD_bsp_t *node, bool horizontal, int position) { TCOD_tree_add_son(&node->tree,&TCOD_bsp_new_intern(node,false)->tree); } -void TCOD_bsp_split_recursive(TCOD_bsp_t *node, TCOD_random_t randomizer, int nb, +void TCOD_bsp_split_recursive(TCOD_bsp_t *node, TCOD_random_t randomizer, int nb, int minHSize, int minVSize, float maxHRatio, float maxVRatio) { bool horiz; int position; @@ -213,5 +214,3 @@ TCOD_bsp_t * TCOD_bsp_find_node(TCOD_bsp_t *node, int x, int y) { } return node; } - - diff --git a/tcod_sys/libtcod/src/color.cpp b/tcod_sys/libtcod/src/color.cpp index 7880557ef..29e1a167e 100644 --- a/tcod_sys/libtcod/src/color.cpp +++ b/tcod_sys/libtcod/src/color.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -346,4 +347,3 @@ void TCODColor::genMap(TCODColor *map, int nbKey, TCODColor const *keyColor, int } } } - diff --git a/tcod_sys/libtcod/src/color_c.c b/tcod_sys/libtcod/src/color_c.c index b7146e330..728f2893a 100644 --- a/tcod_sys/libtcod/src/color_c.c +++ b/tcod_sys/libtcod/src/color_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -276,288 +277,336 @@ const TCOD_color_t TCOD_colors[TCOD_COLOR_NB][TCOD_COLOR_LEVELS] = { {{TCOD_DESATURATED_PINK},{TCOD_LIGHTEST_PINK},{TCOD_LIGHTER_PINK},{TCOD_LIGHT_PINK},{TCOD_PINK},{TCOD_DARK_PINK},{TCOD_DARKER_PINK},{TCOD_DARKEST_PINK}}, {{TCOD_DESATURATED_CRIMSON},{TCOD_LIGHTEST_CRIMSON},{TCOD_LIGHTER_CRIMSON},{TCOD_LIGHT_CRIMSON},{TCOD_CRIMSON},{TCOD_DARK_CRIMSON},{TCOD_DARKER_CRIMSON},{TCOD_DARKEST_CRIMSON}} }; - +/** + * \brief Return a new TCOD_color_t from RGB values. + * + * This function is redundant, you should use a braced initializer instead: + * + * TCOD_color_t white = {255, 255, 255}; + */ TCOD_color_t TCOD_color_RGB(uint8_t r, uint8_t g, uint8_t b) { - TCOD_color_t ret = { r, g, b }; - return ret; + TCOD_color_t new_color = {r, g, b}; + return new_color; } - -TCOD_color_t TCOD_color_HSV(float h, float s, float v) { - TCOD_color_t ret; - int i; - float f, p, q, t; - - if( s == 0 ) { - /* achromatic (grey) */ - ret.r = ret.g = ret.b = (uint8_t)(v*255.0f+0.5f); - } - else { - while (h < 0.0f) h += 360.0f; /*for H < 0 */ - while (h >= 360.0f) h -= 360.0f; /*for H >= 360 */ - h /= 60; - i = (int)(h); /*hue sector 0-5 */ - f = h - i; /* factorial part of h */ - p = v * ( 1 - s ); - q = v * ( 1 - s * f ); - t = v * ( 1 - s * ( 1 - f ) ); - - switch (i) { - case 0: - ret.r = (uint8_t)(v*255.0f+0.5f); - ret.g = (uint8_t)(t*255.0f+0.5f); - ret.b = (uint8_t)(p*255.0f+0.5f); - break; - case 1: - ret.r = (uint8_t)(q*255.0f+0.5f); - ret.g = (uint8_t)(v*255.0f+0.5f); - ret.b = (uint8_t)(p*255.0f+0.5f); - break; - case 2: - ret.r = (uint8_t)(p*255.0f+0.5f); - ret.g = (uint8_t)(v*255.0f+0.5f); - ret.b = (uint8_t)(t*255.0f+0.5f); - break; - case 3: - ret.r = (uint8_t)(p*255.0f+0.5f); - ret.g = (uint8_t)(q*255.0f+0.5f); - ret.b = (uint8_t)(v*255.0f+0.5f); - break; - case 4: - ret.r = (uint8_t)(t*255.0f+0.5f); - ret.g = (uint8_t)(p*255.0f+0.5f); - ret.b = (uint8_t)(v*255.0f+0.5f); - break; - default: - ret.r = (uint8_t)(v*255.0f+0.5f); - ret.g = (uint8_t)(p*255.0f+0.5f); - ret.b = (uint8_t)(q*255.0f+0.5f); - break; - } - } - return ret; +/** + * \brief Return a new TCOD_color_t from HSV values. + * + * \param hue The colors hue (in degrees.) + * \param saturation The colors saturation (from 0 to 1) + * \param value The colors value (from 0 to 1) + * \return A new TCOD_color_t struct. + * + * The saturation and value parameters are automatically clamped to 0 and 1. + * + * TCOD_color_t light_blue = TCOD_color_HSV(240.0f, 0.75f, 1.0f); + * + * Use TCOD_color_set_HSV to fill an existing struct with HSV values. + */ +TCOD_color_t TCOD_color_HSV(float hue, float saturation, float value) { + TCOD_color_t new_color; + TCOD_color_set_HSV(&new_color, hue, saturation, value); + return new_color; } - -bool TCOD_color_equals (TCOD_color_t c1, TCOD_color_t c2) { - return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b); +/** + * \brief Return a true value if c1 and c2 are equal. + */ +bool TCOD_color_equals(TCOD_color_t c1, TCOD_color_t c2) { + return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b); } - -TCOD_color_t TCOD_color_add (TCOD_color_t c1, TCOD_color_t c2) { - TCOD_color_t ret; - int r,g,b; - r = (int)(c1.r) + c2.r; - g = (int)(c1.g) + c2.g; - b = (int)(c1.b) + c2.b; - r=MIN(255,r); - g=MIN(255,g); - b=MIN(255,b); - ret.r=(uint8_t)r; - ret.g=(uint8_t)g; - ret.b=(uint8_t)b; - return ret; +/** + * \brief Add two colors together and return the result. + * + * \param c1 The first color. + * \param c2 The second color. + * \return A new TCOD_color_t struct with the result. + */ +TCOD_color_t TCOD_color_add(TCOD_color_t c1, TCOD_color_t c2) { + TCOD_color_t new_color = { + (uint8_t)MIN(255, (int)c1.r + c2.r), + (uint8_t)MIN(255, (int)c1.g + c2.g), + (uint8_t)MIN(255, (int)c1.b + c2.b)}; + return new_color; } - -TCOD_color_t TCOD_color_subtract (TCOD_color_t c1, TCOD_color_t c2) { - TCOD_color_t ret; - int r,g,b; - r = (int)(c1.r) - c2.r; - g = (int)(c1.g) - c2.g; - b = (int)(c1.b) - c2.b; - r=MAX(0,r); - g=MAX(0,g); - b=MAX(0,b); - ret.r=(uint8_t)r; - ret.g=(uint8_t)g; - ret.b=(uint8_t)b; - return ret; +/** + * \brief Subtract c2 from c1 and return the result. + * + * \param c1 The first color. + * \param c2 The second color. + * \return A new TCOD_color_t struct with the result. + */ +TCOD_color_t TCOD_color_subtract(TCOD_color_t c1, TCOD_color_t c2) { + TCOD_color_t new_color = { + (uint8_t)MAX(0, (int)c1.r - c2.r), + (uint8_t)MAX(0, (int)c1.g - c2.g), + (uint8_t)MAX(0, (int)c1.b - c2.b)}; + return new_color; } - -TCOD_color_t TCOD_color_multiply (TCOD_color_t c1, TCOD_color_t c2) { - TCOD_color_t ret; - ret.r=(uint8_t)(((int)c1.r)*c2.r/255); - ret.g=(uint8_t)(((int)c1.g)*c2.g/255); - ret.b=(uint8_t)(((int)c1.b)*c2.b/255); - return ret; +/** + * \brief Multiply two colors together and return the result. + * + * \param c1 The first color. + * \param c2 The second color. + * \return A new TCOD_color_t struct with the result. + */ +TCOD_color_t TCOD_color_multiply(TCOD_color_t c1, TCOD_color_t c2) { + TCOD_color_t new_color = { + (uint8_t)(((int)c1.r) * c2.r / 255), + (uint8_t)(((int)c1.g) * c2.g / 255), + (uint8_t)(((int)c1.b) * c2.b / 255)}; + return new_color; } - -TCOD_color_t TCOD_color_multiply_scalar (TCOD_color_t c1, float value) { - TCOD_color_t ret; - int r,g,b; - r = (int)(c1.r * value); - g = (int)(c1.g * value); - b = (int)(c1.b * value); - ret.r=(uint8_t)CLAMP(0,255,r); - ret.g=(uint8_t)CLAMP(0,255,g); - ret.b=(uint8_t)CLAMP(0,255,b); - return ret; +/** + * \brief Multiply a color with a scalar value and return the result. + * + * \param c1 The color to multiply. + * \param value The scalar float. + * \return A new TCOD_color_t struct with the result. + */ +TCOD_color_t TCOD_color_multiply_scalar(TCOD_color_t c1, float value) { + TCOD_color_t new_color = { + (uint8_t)CLAMP(0.0f, 255.0f, (float)c1.r * value), + (uint8_t)CLAMP(0.0f, 255.0f, (float)c1.g * value), + (uint8_t)CLAMP(0.0f, 255.0f, (float)c1.b * value)}; + return new_color; } - +/** + * \brief Interpolate two colors together and return the result. + * + * \param c1 The first color (where coef if 0) + * \param c2 The second color (where coef if 1) + * \param coef The coefficient. + * \return A new TCOD_color_t struct with the result. + */ TCOD_color_t TCOD_color_lerp(TCOD_color_t c1, TCOD_color_t c2, float coef) { - TCOD_color_t ret; - ret.r=(uint8_t)(c1.r+(c2.r-c1.r)*coef); - ret.g=(uint8_t)(c1.g+(c2.g-c1.g)*coef); - ret.b=(uint8_t)(c1.b+(c2.b-c1.b)*coef); - return ret; + TCOD_color_t new_color = { + (uint8_t)(c1.r + (c2.r - c1.r) * coef), + (uint8_t)(c1.g + (c2.g - c1.g) * coef), + (uint8_t)(c1.b + (c2.b - c1.b) * coef)}; + return new_color; } - -/* 0<= h < 360, 0 <= s <= 1, 0 <= v <= 1 */ -void TCOD_color_set_HSV(TCOD_color_t *c, float h, float s, float v) -{ - int i; - float f, p, q, t; - - if( s == 0.0f ) { - /* achromatic (grey) */ - c->r = c->g = c->b = (uint8_t)(v*255.0f+0.5f); - return; - } - - while (h < 0.0f) h += 360.0f; /*for H < 0 */ - while (h >= 360.0f) h -= 360.0f; /*for H >= 360 */ - h /= 60.0f; /* sector 0 to 5 */ - i = (int)floor( h ); - f = h - i; /* factorial part of h */ - p = v * ( 1 - s ); - q = v * ( 1 - s * f ); - t = v * ( 1 - s * ( 1 - f ) ); - - switch( i ) { - case 0: - c->r = (uint8_t)(v*255.0f+0.5f); - c->g = (uint8_t)(t*255.0f+0.5f); - c->b = (uint8_t)(p*255.0f+0.5f); - break; - case 1: - c->r = (uint8_t)(q*255.0f+0.5f); - c->g = (uint8_t)(v*255.0f+0.5f); - c->b = (uint8_t)(p*255.0f+0.5f); - break; - case 2: - c->r = (uint8_t)(p*255.0f+0.5f); - c->g = (uint8_t)(v*255.0f+0.5f); - c->b = (uint8_t)(t*255.0f+0.5f); - break; - case 3: - c->r = (uint8_t)(p*255.0f+0.5f); - c->g = (uint8_t)(q*255.0f+0.5f); - c->b = (uint8_t)(v*255.0f+0.5f); - break; - case 4: - c->r = (uint8_t)(t*255.0f+0.5f); - c->g = (uint8_t)(p*255.0f+0.5f); - c->b = (uint8_t)(v*255.0f+0.5f); - break; - default: - c->r = (uint8_t)(v*255.0f+0.5f); - c->g = (uint8_t)(p*255.0f+0.5f); - c->b = (uint8_t)(q*255.0f+0.5f); - break; - } +/* Return floor modulo for double values. */ +static double fabsmod(double x, double n) { + double m = fmod(x, n); + return m < 0 ? m+n : m; } -void TCOD_color_get_HSV(TCOD_color_t c, float *h, float *s, float *v) -{ - uint8_t imax,imin; - float min, max, delta; - - imax = ( c.r > c.g ? - ( c.r > c.b ? c.r : c.b ) - : ( c.g > c.b ? c.g : c.b) ); - imin = ( c.r < c.g ? - ( c.r < c.b ? c.r : c.b ) - : ( c.g < c.b ? c.g : c.b) ); - max = imax/255.0f; - min = imin/255.0f; - *v = max; /* v */ - - delta = max - min; - if( max != 0.0f ) *s = delta / max; /* s */ - else - { - *s = 0.0f; /* s */ - *h = 0.0f; /* h */ - return; - } - - if( c.r == imax ) *h = ( c.g - c.b ) / (255.0f * delta); /* between yellow & magenta */ - else if( c.g == imax ) *h = 2.0f + ( c.b - c.r ) / (255.0f * delta); /* between cyan & yellow */ - else *h = 4.0f + ( c.r - c.g ) / (255.0f * delta); /* between magenta & cyan */ - - *h *= 60.0f; /* degrees */ - if( *h < 0 ) *h += 360.0f; +/** + * \brief Sets a colors values from HSV values. + * + * \param color The color to be changed. + * \param hue The colors hue (in degrees.) + * \param saturation The colors saturation (from 0 to 1) + * \param value The colors value (from 0 to 1) + */ +void TCOD_color_set_HSV(TCOD_color_t *color, + float hue, float saturation, float value) { + int hue_section; + float hue_fraction, p, q, t; + + saturation = CLAMP(0.0f, 1.0f, saturation); + value = CLAMP(0.0f, 1.0f, value); + if( saturation == 0.0f ) { /* achromatic (grey) */ + color->r = color->g = color->b = (uint8_t)(value * 255.0f + 0.5f); + return; + } + + hue = (float)fabsmod(hue, 360.0f); + hue /= 60.0f; /* sector 0 to 5 */ + hue_section = (int)floor(hue); + hue_fraction = hue - hue_section; /* fraction between sections */ + p = value * (1 - saturation); + q = value * (1 - saturation * hue_fraction); + t = value * (1 - saturation * (1 - hue_fraction)); + + switch (hue_section) { + default: + case 0: /* red/yellow */ + color->r = (uint8_t)(value * 255.0f + 0.5f); + color->g = (uint8_t)(t * 255.0f + 0.5f); + color->b = (uint8_t)(p * 255.0f + 0.5f); + break; + case 1: /* yellow/green */ + color->r = (uint8_t)(q * 255.0f + 0.5f); + color->g = (uint8_t)(value * 255.0f + 0.5f); + color->b = (uint8_t)(p * 255.0f + 0.5f); + break; + case 2: /* green/cyan */ + color->r = (uint8_t)(p * 255.0f + 0.5f); + color->g = (uint8_t)(value * 255.0f + 0.5f); + color->b = (uint8_t)(t * 255.0f + 0.5f); + break; + case 3: /* cyan/blue */ + color->r = (uint8_t)(p * 255.0f + 0.5f); + color->g = (uint8_t)(q * 255.0f + 0.5f); + color->b = (uint8_t)(value * 255.0f + 0.5f); + break; + case 4: /* blue/purple */ + color->r = (uint8_t)(t * 255.0f + 0.5f); + color->g = (uint8_t)(p * 255.0f + 0.5f); + color->b = (uint8_t)(value * 255.0f + 0.5f); + break; + case 5: /* purple/red */ + color->r = (uint8_t)(value * 255.0f + 0.5f); + color->g = (uint8_t)(p * 255.0f + 0.5f); + color->b = (uint8_t)(q * 255.0f + 0.5f); + break; + } } - -float TCOD_color_get_hue (TCOD_color_t c) { - uint8_t max = MAX(c.r,MAX(c.g,c.b)); - uint8_t min = MIN(c.r,MIN(c.g,c.b)); - float delta = (float)max - (float)min; - float ret; - if (delta == 0.0f) ret = 0.0f; /*achromatic, including black */ - else { - if (c.r == max) ret = (float)(c.g - c.b) / delta; - else if (c.g == max) ret = 2.0f + (float)(c.b - c.r) / delta; - else ret = 4.0f + (float)(c.r - c.g) / delta; - ret *= 60.0f; - if (ret < 0.0f) ret += 360.0f; - if (ret >= 360.0f) ret -= 360.0f; - } - return ret; +/** + * \brief Get a set of HSV values from a color. + * + * \param color The color + * \param hue Pointer to a float, filled with the hue. (degrees) + * \param saturation Pointer to a float, filled with the saturation. (0 to 1) + * \param value Pointer to a float, filled with the value. (0 to 1) + * + * The hue, saturation, and value parameters can not be NULL pointers, + */ +void TCOD_color_get_HSV(TCOD_color_t color, + float *hue, float *saturation, float *value) { + *hue = TCOD_color_get_hue(color); + *saturation = TCOD_color_get_saturation(color); + *value = TCOD_color_get_value(color); + return; } - -void TCOD_color_set_hue (TCOD_color_t *c, float h) { - float obsolete, s, v; - TCOD_color_get_HSV(*c,&obsolete,&s,&v); - *c = TCOD_color_HSV(h,s,v); +/** + * \brief Return a colors hue. + * + * \param color A color struct. + * \return The colors hue. (degrees) + */ +float TCOD_color_get_hue(TCOD_color_t color) { + uint8_t max = MAX(color.r, MAX(color.g, color.b)); + uint8_t min = MIN(color.r, MIN(color.g, color.b)); + float delta = (float)max - (float)min; + float hue; /* degrees */ + if (delta == 0.0f) { return 0.0f; } /* achromatic, including black */ + if (color.r == max) { + hue = (float)(color.g - color.b) / delta; + } else if (color.g == max) { + hue = 2.0f + (float)(color.b - color.r) / delta; + } else { + hue = 4.0f + (float)(color.r - color.g) / delta; + } + hue *= 60.0f; + hue = (float)fabsmod(hue, 360.0f); + return hue; } - -float TCOD_color_get_saturation (TCOD_color_t c) { - float max = (float)(MAX(c.r,MAX(c.g,c.b)))/255.0f; - float min = (float)(MIN(c.r,MIN(c.g,c.b)))/255.0f; - float delta = max - min; - if (max == 0.0f) return 0.0f; - else return delta/max; +/** + * \brief Change a colors hue. + * + * \param color Pointer to a color struct. + * \param hue The hue in degrees. + */ +void TCOD_color_set_hue(TCOD_color_t *color, float hue) { + TCOD_color_set_HSV(color, + hue, + TCOD_color_get_saturation(*color), + TCOD_color_get_value(*color)); } - -void TCOD_color_set_saturation (TCOD_color_t *c, float s) { - float h, obsolete, v; - TCOD_color_get_HSV(*c,&h,&obsolete,&v); - *c = TCOD_color_HSV(h,s,v); +/** + * \brief Return a colors saturation. + * + * \param color A color struct. + * \return The colors saturation. (0 to 1) + */ +float TCOD_color_get_saturation (TCOD_color_t color) { + float max = (float)(MAX(color.r, MAX(color.g, color.b))) / 255.0f; + float min = (float)(MIN(color.r, MIN(color.g, color.b))) / 255.0f; + float delta = max - min; + if (max == 0.0f) { return 0.0f; } + return delta / max; } - -float TCOD_color_get_value (TCOD_color_t c) { - return (float)(MAX(c.r,MAX(c.g,c.b)))/255.0f; +/** + * \brief Change a colors saturation. + * + * \param color Pointer to a color struct. + * \param saturation The desired saturation value. + */ +void TCOD_color_set_saturation(TCOD_color_t *color, float saturation) { + TCOD_color_set_HSV(color, + TCOD_color_get_hue(*color), + saturation, + TCOD_color_get_value(*color)); } - -void TCOD_color_set_value (TCOD_color_t *c, float v) { - float h, s, obsolete; - TCOD_color_get_HSV(*c,&h,&s,&obsolete); - *c = TCOD_color_HSV(h,s,v); +/** + * \brief Get a colors value. + * + * \param color A color struct. + * \return The colors value. (0 to 1) + */ +float TCOD_color_get_value(TCOD_color_t color) { + return (float)(MAX(color.r, MAX(color.g, color.b))) / 255.0f; } - -void TCOD_color_shift_hue (TCOD_color_t *c, float hshift) { - float h, s, v; - if (hshift == 0.0f) return; - TCOD_color_get_HSV(*c,&h,&s,&v); - *c = TCOD_color_HSV(h+hshift,s,v); +/** + * \brief Change a colors value. + * + * \param color Pointer to a color struct. + * \param value The desired value. + */ +void TCOD_color_set_value(TCOD_color_t *color, float value) { + TCOD_color_set_HSV(color, + TCOD_color_get_hue(*color), + TCOD_color_get_saturation(*color), + value); } - -void TCOD_color_scale_HSV (TCOD_color_t *c, float scoef, float vcoef) { - float h, s, v; - TCOD_color_get_HSV(*c,&h,&s,&v); - s = CLAMP(0.0f,1.0f,s*scoef); - v = CLAMP(0.0f,1.0f,v*vcoef); - *c = TCOD_color_HSV(h,s,v); +/** + * \brief Shift a colors hue by an amount. + * + * \param color Pointer to a color struct. + * \param hue_shift The distance to shift the hue, in degrees. + */ +void TCOD_color_shift_hue(TCOD_color_t *color, float hue_shift) { + if (hue_shift == 0.0f) { return; } + TCOD_color_set_HSV(color, + TCOD_color_get_hue(*color) + hue_shift, + TCOD_color_get_saturation(*color), + TCOD_color_get_value(*color)); } - -void TCOD_color_gen_map(TCOD_color_t *map, int nb_key, TCOD_color_t const *key_color, int const *key_index) { - int segment=0; - for (segment=0; segment < nb_key-1; segment++) { - int idx_start=key_index[segment]; - int idx_end=key_index[segment+1]; - int idx; - for ( idx=idx_start;idx <= idx_end; idx++) { - map[idx]=TCOD_color_lerp(key_color[segment],key_color[segment+1],(float)(idx-idx_start)/(idx_end-idx_start)); - } - } +/** + * \brief Scale a colors saturation and value. + * + * \param color Pointer to a color struct. + * \param saturation_coef Multiplier for this colors saturation. + * \param value_coef Multiplier for this colors value. + */ +void TCOD_color_scale_HSV(TCOD_color_t *color, + float saturation_coef, float value_coef) { + TCOD_color_set_HSV(color, + TCOD_color_get_hue(*color), + TCOD_color_get_saturation(*color) * saturation_coef, + TCOD_color_get_value(*color) * value_coef); +} +/** + * \brief Generate an interpolated gradient of colors. + * + * \param map Array to fill with the new gradient. + * \param nb_key The array size of the key_color and key_index parameters. + * \param key_color An array of colors to use, in order. + * \param key_index An array mapping key_color items to the map array. + * + * \verbatim embed:rst:leading-asterisk + * .. code-block:: c + * + * TCOD_color_t[256] gradient; + * TCOD_color_t[4] key_color = {TCOD_black, TCOD_dark_amber, + * TCOD_cyan, TCOD_white}; + * int[4] key_index = {0, 64, 192, 255}; + * TCOD_color_gen_map(&gradient, 4, &key_color, &key_index); + * \endverbatim + */ +void TCOD_color_gen_map(TCOD_color_t *map, int nb_key, + const TCOD_color_t *key_color, const int *key_index) { + int segment = 0; + for (segment = 0; segment < nb_key - 1; ++segment) { + int idx_start = key_index[segment]; + int idx_end = key_index[segment + 1]; + int idx; + for (idx = idx_start; idx <= idx_end; ++idx) { + map[idx] = TCOD_color_lerp( + key_color[segment], + key_color[segment + 1], + (float)(idx - idx_start) / (idx_end - idx_start)); + } + } } - - diff --git a/tcod_sys/libtcod/src/console.cpp b/tcod_sys/libtcod/src/console.cpp index 01b8b0d78..34fb53e2a 100644 --- a/tcod_sys/libtcod/src/console.cpp +++ b/tcod_sys/libtcod/src/console.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/src/console_c.c b/tcod_sys/libtcod/src/console_c.c index c868deb97..ee21eb319 100644 --- a/tcod_sys/libtcod/src/console_c.c +++ b/tcod_sys/libtcod/src/console_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #include #include @@ -37,6 +37,8 @@ #include #endif +#include "vendor/stb_sprintf.h" +#include #include #include #include @@ -60,7 +62,7 @@ TCOD_internal_context_t TCOD_ctx={ 8,8, "terminal.png","", NULL,NULL,NULL,0,false,0,0,0,0,0,0, -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE /* default renderer to use */ TCOD_RENDERER_GLSL, NULL, @@ -71,7 +73,7 @@ TCOD_internal_context_t TCOD_ctx={ {0}, /* window closed ? */ false, - /* mouse focus ? */ + /* mouse focus ? */ false, /* application active ? */ true, @@ -79,21 +81,34 @@ TCOD_internal_context_t TCOD_ctx={ static TCOD_color_t color_control_fore[TCOD_COLCTRL_NUMBER]; static TCOD_color_t color_control_back[TCOD_COLCTRL_NUMBER]; - +/** + * Assign a foreground and background color to a color control index. + * + * \param con Index to change, e.g. `TCOD_COLCTRL_1` + * \param fore Foreground color to assign to this index. + * \param back Background color to assign to this index. + */ void TCOD_console_set_color_control(TCOD_colctrl_t con, TCOD_color_t fore, TCOD_color_t back) { TCOD_IFNOT(con >= TCOD_COLCTRL_1 && con <= TCOD_COLCTRL_NUMBER ) return; color_control_fore[con-1]=fore; color_control_back[con-1]=back; } - +/** + * Return a new console with a specific number of columns and rows. + * + * \param w Number of columns. + * \param h Number of columns. + * \return A pointer to the new console, or NULL on error. + */ TCOD_console_t TCOD_console_new(int w, int h) { TCOD_IFNOT(w > 0 && h > 0 ) { return NULL; } else { TCOD_console_data_t *con=(TCOD_console_data_t *)calloc(sizeof(TCOD_console_data_t),1); + if (!con) { return NULL; } con->w=w; con->h=h; - TCOD_console_init(con,NULL,false); + TCOD_console_init(con,NULL,false); /* NOTE: CHECK THIS FOR ERORS */ if(TCOD_ctx.root) { con->alignment=TCOD_ctx.root->alignment; con->bkgnd_flag=TCOD_ctx.root->bkgnd_flag; @@ -101,61 +116,111 @@ TCOD_console_t TCOD_console_new(int w, int h) { return (TCOD_console_t)con; } } - +/** + * Return immediately with a recently pressed key. + * + * \param flags A TCOD_event_t bit-field, for example: `TCOD_EVENT_KEY_PRESS` + * \return A TCOD_key_t struct with a recently pressed key. + * If no event exists then the `vk` attribute will be `TCODK_NONE` + */ TCOD_key_t TCOD_console_check_for_keypress(int flags) { return TCOD_sys_check_for_keypress(flags); } - +/** + * Wait for a key press event, then return it. + * + * \param flush If 1 then the event queue will be cleared before waiting for + * the next event. This should always be 0. + * \return A TCOD_key_t struct with the most recent key data. + * + * Do not solve input lag issues by arbitrarily dropping events! + */ TCOD_key_t TCOD_console_wait_for_keypress(bool flush) { return TCOD_sys_wait_for_keypress(flush); } - +/** + * Return true if the window is closing. + */ bool TCOD_console_is_window_closed(void) { return TCOD_ctx.is_window_closed; } - +/** + * Return true if the window has mouse focus. + */ bool TCOD_console_has_mouse_focus(void) { return TCOD_ctx.app_has_mouse_focus; } - -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE +/** + * Return true if the window has keyboard focus. + * + * \verbatim embed:rst:leading-asterisk + * .. versionchanged: 1.7 + * This function was previously broken. It now keeps track of keyboard + * focus. + * \endverbatim + */ bool TCOD_console_is_active(void) { return TCOD_ctx.app_is_active; } #endif - +/** + * Change the title string of the active window. + * + * \param title A utf8 string. + */ void TCOD_console_set_window_title(const char *title) { TCOD_sys_set_window_title(title); } - +/** + * Set the display to be full-screen or windowed. + * + * \param fullscreen If true the display will go full-screen. + */ void TCOD_console_set_fullscreen(bool fullscreen) { TCOD_IFNOT(TCOD_ctx.root != NULL) return; TCOD_sys_set_fullscreen(fullscreen); TCOD_ctx.fullscreen=fullscreen; } - +/** + * Return true if the display is full-screen. + */ bool TCOD_console_is_fullscreen(void) { return TCOD_ctx.fullscreen; } - +/** + * Set a consoles default background flag. + * + * \param con A console pointer. + * \param flag One of `TCOD_bkgnd_flag_t`. + */ void TCOD_console_set_background_flag(TCOD_console_t con,TCOD_bkgnd_flag_t flag) { TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; TCOD_IFNOT ( dat != NULL ) return; dat->bkgnd_flag=flag; } - +/** + * Return a consoles default background flag. + */ TCOD_bkgnd_flag_t TCOD_console_get_background_flag(TCOD_console_t con) { TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; TCOD_IFNOT ( dat != NULL ) return TCOD_BKGND_NONE; return dat->bkgnd_flag; } - +/** + * Set a consoles default alignment. + * + * \param con A console pointer. + * \param alignment One of TCOD_alignment_t + */ void TCOD_console_set_alignment(TCOD_console_t con,TCOD_alignment_t alignment) { TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; TCOD_IFNOT ( dat != NULL ) return; dat->alignment=alignment; } - +/** + * Return a consoles default alignment. + */ TCOD_alignment_t TCOD_console_get_alignment(TCOD_console_t con) { TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; TCOD_IFNOT ( dat != NULL ) return TCOD_LEFT; @@ -167,7 +232,14 @@ static void TCOD_console_data_free(TCOD_console_data_t *dat) { if (dat->bg_colors) TCOD_image_delete(dat->bg_colors); free(dat->ch_array); } - +/** + * Delete a console. + * + * \param con A console pointer. + * + * If the console being deleted is the root console, then the display will be + * uninitialized. + */ void TCOD_console_delete(TCOD_console_t con) { TCOD_console_data_t *dat=(TCOD_console_data_t *)(con); if (! dat ) { @@ -178,7 +250,24 @@ void TCOD_console_delete(TCOD_console_t con) { TCOD_console_data_free(dat); free(dat); } - +/** + * Blit from one console to another. + * + * \param srcCon Pointer to the source console. + * \param xSrc The left region of the source console to blit from. + * \param ySrc The top region of the source console to blit from. + * \param wSrc The width of the region to blit from. + * If 0 then it will fill to the maximum width. + * \param hSrc The height of the region to blit from. + * If 0 then it will fill to the maximum height. + * \param dstCon Pointer to the destination console. + * \param xDst The left corner to blit onto the destination console. + * \param yDst The top corner to blit onto the destination console. + * \param foreground_alpha Foreground blending alpha. + * \param background_alpha Background blending alpha. + * + * If the source console has a key color, this function will use it. + */ void TCOD_console_blit(TCOD_console_t srcCon, int xSrc, int ySrc, int wSrc, int hSrc, TCOD_console_t dstCon, int xDst, int yDst, float foreground_alpha, float background_alpha) { TCOD_console_data_t *src = srcCon ? (TCOD_console_data_t *)srcCon : TCOD_ctx.root; @@ -256,51 +345,86 @@ void TCOD_console_blit(TCOD_console_t srcCon, int xSrc, int ySrc, int wSrc, int TCOD_image_invalidate_mipmaps(dst->fg_colors); TCOD_image_invalidate_mipmaps(dst->bg_colors); } - +/** + * Render and present the root console to the active display. + */ void TCOD_console_flush(void) { TCOD_IFNOT(TCOD_ctx.root != NULL) return; TCOD_sys_flush(true); } - +/** + * Fade the color of the display. + * + * \param val Where at 255 colors are normal and at 0 colors are completely + * faded. + * \param fadecol Color to fade towards. + */ void TCOD_console_set_fade(uint8_t val, TCOD_color_t fadecol) { TCOD_ctx.fade=val; TCOD_ctx.fading_color=fadecol; } - +/** + * Return the fade value. + * + * \return At 255 colors are normal and at 0 colors are completely faded. + */ uint8_t TCOD_console_get_fade(void) { return TCOD_ctx.fade; } - +/** + * Return the fade color. + * + * \return The current fading color. + */ TCOD_color_t TCOD_console_get_fading_color(void) { return TCOD_ctx.fading_color; } - +/** + * Draw a character on a console using the default colors. + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \param c The character code to place. + * \param flag A TCOD_bkgnd_flag_t flag. + */ void TCOD_console_put_char(TCOD_console_t con, int x, int y, int c, TCOD_bkgnd_flag_t flag) { int offset; TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; TCOD_IFNOT(dat != NULL && (unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h) return; - TCOD_IFNOT(c >= 0 && c < TCOD_ctx.max_font_chars) return; offset = y * dat->w + x; dat->ch_array[offset] = c; TCOD_image_put_pixel(dat->fg_colors, x, y, dat->fore); TCOD_console_set_char_background(con, x, y, dat->back, (TCOD_bkgnd_flag_t)flag); } - +/** + * Draw a character on the console with the given colors. + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \param c The character code to place. + * \param fore The foreground color. + * \param back The background color. This color will not be blended. + */ void TCOD_console_put_char_ex(TCOD_console_t con, int x, int y, int c, TCOD_color_t fore, TCOD_color_t back) { int offset; TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; TCOD_IFNOT(dat != NULL && (unsigned)(x) < (unsigned)dat->w && (unsigned)(y) < (unsigned)dat->h) return; - TCOD_IFNOT(c >= 0 && c < TCOD_ctx.max_font_chars) return; offset = y * dat->w + x; dat->ch_array[offset] = c; TCOD_image_put_pixel(dat->fg_colors, x, y, fore); TCOD_image_put_pixel(dat->bg_colors, x, y, back); } - +/** + * Manually mark a region of a console as dirty. + */ void TCOD_console_set_dirty(int dx, int dy, int dw, int dh) { TCOD_sys_set_dirty(dx, dy, dw, dh); } - +/** + * Clear a console to its default colors and the space character code. + */ void TCOD_console_clear(TCOD_console_t con) { int i; TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; @@ -313,7 +437,14 @@ void TCOD_console_clear(TCOD_console_t con) { /* clear the sdl renderer cache */ TCOD_sys_set_dirty(0, 0, dat->w, dat->h); } - +/** + * Return the background color of a console at x,y + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \return A TCOD_color_t struct with a copy of the background color. + */ TCOD_color_t TCOD_console_get_char_background(TCOD_console_t con, int x, int y) { TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; TCOD_IFNOT(dat != NULL @@ -321,7 +452,14 @@ TCOD_color_t TCOD_console_get_char_background(TCOD_console_t con, int x, int y) return TCOD_black; return TCOD_image_get_pixel(dat->bg_colors, x, y); } - +/** + * Change the foreground color of a console tile. + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \param col The foreground color to set. + */ void TCOD_console_set_char_foreground(TCOD_console_t con, int x, int y, TCOD_color_t col) { TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; if ((unsigned)(x) >= (unsigned)dat->w || (unsigned)(y) >= (unsigned)dat->h) return; @@ -330,7 +468,14 @@ void TCOD_console_set_char_foreground(TCOD_console_t con, int x, int y, TCOD_col return; TCOD_image_put_pixel(dat->fg_colors, x, y, col); } - +/** + * Return the foreground color of a console at x,y + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \return A TCOD_color_t struct with a copy of the foreground color. + */ TCOD_color_t TCOD_console_get_char_foreground(TCOD_console_t con, int x, int y) { TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; TCOD_IFNOT(dat != NULL @@ -338,7 +483,14 @@ TCOD_color_t TCOD_console_get_char_foreground(TCOD_console_t con, int x, int y) return TCOD_white; return TCOD_image_get_pixel(dat->fg_colors, x, y); } - +/** + * Return a character code of a console at x,y + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \return The character code. + */ int TCOD_console_get_char(TCOD_console_t con, int x, int y) { TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; TCOD_IFNOT(dat != NULL @@ -346,7 +498,15 @@ int TCOD_console_get_char(TCOD_console_t con, int x, int y) { return 0; return dat->ch_array[y * dat->w + x]; } - +/** + * Blend a background color onto a console tile. + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \param col The background color to blend. + * \param flag The blend mode to use. + */ void TCOD_console_set_char_background(TCOD_console_t con, int x, int y, TCOD_color_t col, TCOD_bkgnd_flag_t flag) { TCOD_color_t *back; int newr, newg, newb; @@ -445,7 +605,14 @@ void TCOD_console_set_char_background(TCOD_console_t con, int x, int y, TCOD_col default: break; } } - +/** + * Change a character on a console tile, without changing its colors. + * + * \param con A console pointer. + * \param x The X coordinate, the left-most position being 0. + * \param y The Y coordinate, the top-most position being 0. + * \param c The character code to set. + */ void TCOD_console_set_char(TCOD_console_t con, int x, int y, int c) { TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; if ((unsigned)(x) >= (unsigned)dat->w || (unsigned)(y) >= (unsigned)dat->h) return; @@ -464,7 +631,17 @@ static void TCOD_console_clamp(int cx, int cy, int cw, int ch, int *x, int *y, i *y = cy; } } - +/** + * Draw a rectangle onto a console. + * + * \param con A console pointer. + * \param x The starting region, the left-most position being 0. + * \param y The starting region, the top-most position being 0. + * \param rw The width of the rectangle. + * \param rh The height of the rectangle. + * \param clear If true the drawing region will be filled with spaces. + * \param flag The blending flag to use. + */ void TCOD_console_rect(TCOD_console_t con, int x, int y, int rw, int rh, bool clear, TCOD_bkgnd_flag_t flag) { int cx, cy; TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; @@ -483,12 +660,34 @@ void TCOD_console_rect(TCOD_console_t con, int x, int y, int rw, int rh, bool cl } } } - +/** + * Draw a horizontal line using the default colors. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param l The width of the line. + * \param flag The blending flag. + * + * This function makes assumptions about the fonts character encoding. + * It will fail if the font encoding is not `cp437`. + */ void TCOD_console_hline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag) { int i; for (i=x; i< x+l; i++) TCOD_console_put_char(con,i,y,TCOD_CHAR_HLINE,flag); } - +/** + * Draw a vertical line using the default colors. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param l The height of the line. + * \param flag The blending flag. + * + * This function makes assumptions about the fonts character encoding. + * It will fail if the font encoding is not `cp437`. + */ void TCOD_console_vline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag) { int i; for (i=y; i< y+l; i++) TCOD_console_put_char(con,x,i,TCOD_CHAR_VLINE,flag); @@ -513,7 +712,7 @@ char *TCOD_console_vsprint(const char *fmt, va_list ap) { do { /* warning ! depending on the compiler, vsnprintf return -1 or the expected string length if the buffer is not big enough */ - int len = vsnprintf(msg[curbuf],buflen[curbuf],fmt,ap); + int len = stbsp_vsnprintf(msg[curbuf],buflen[curbuf],fmt,ap); ok=true; if (len < 0 || len >= buflen[curbuf]) { /* buffer too small. */ @@ -531,7 +730,24 @@ char *TCOD_console_vsprint(const char *fmt, va_list ap) { curbuf = (curbuf+1)%NB_BUFFERS; return ret; } - +/** + * Print a string inside of a framed region on a console, using default + * colors and alignment. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param w The width of the frame. + * \param h The height of the frame. + * \param empty If true the characters inside of the frame will be cleared + * with spaces. + * \param flag The blending flag. + * \param fmt A format string as if passed to printf. + * \param ... Variadic arguments as if passed to printf. + * + * This function makes assumptions about the fonts character encoding. + * It will fail if the font encoding is not `cp437`. + */ void TCOD_console_print_frame(TCOD_console_t con,int x,int y,int w,int h, bool empty, TCOD_bkgnd_flag_t flag, const char *fmt, ...) { TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; TCOD_console_put_char(con,x,y,TCOD_CHAR_NW,flag); @@ -566,7 +782,15 @@ void TCOD_console_print_frame(TCOD_console_t con,int x,int y,int w,int h, bool e dat->fore=tmp; } } - +/** + * Print a string on a console, using default colors and alignment. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param fmt A format string as if passed to printf. + * \param ... Variadic arguments as if passed to printf. + */ void TCOD_console_print(TCOD_console_t con,int x, int y, const char *fmt, ...) { va_list ap; TCOD_console_data_t *dat=con ? (TCOD_console_data_t *)con : TCOD_ctx.root; @@ -576,7 +800,17 @@ void TCOD_console_print(TCOD_console_t con,int x, int y, const char *fmt, ...) { dat->alignment,TCOD_console_vsprint(fmt,ap), false, false); va_end(ap); } - +/** + * Print a string on a console, using default colors. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param flag The blending flag. + * \param alignment The font alignment to use. + * \param fmt A format string as if passed to printf. + * \param ... Variadic arguments as if passed to printf. + */ void TCOD_console_print_ex(TCOD_console_t con,int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...) { va_list ap; @@ -587,7 +821,21 @@ void TCOD_console_print_ex(TCOD_console_t con,int x, int y, TCOD_console_vsprint(fmt,ap), false, false); va_end(ap); } - +/** + * Print a string on a console constrained to a rectangle, using default + * colors and alignment. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param w The width of the region. + * If 0 then the maximum width will be used. + * \param h The height of the region. + * If 0 then the maximum height will be used. + * \param fmt A format string as if passed to printf. + * \param ... Variadic arguments as if passed to printf. + * \return The number of lines actually printed. + */ int TCOD_console_print_rect(TCOD_console_t con,int x, int y, int w, int h, const char *fmt, ...) { int ret; va_list ap; @@ -599,7 +847,23 @@ int TCOD_console_print_rect(TCOD_console_t con,int x, int y, int w, int h, const va_end(ap); return ret; } - +/** + * Print a string on a console constrained to a rectangle, using default + * colors. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param w The width of the region. + * If 0 then the maximum width will be used. + * \param h The height of the region. + * If 0 then the maximum height will be used. + * \param flag The blending flag. + * \param alignment The font alignment to use. + * \param fmt A format string as if passed to printf. + * \param ... Variadic arguments as if passed to printf. + * \return The number of lines actually printed. + */ int TCOD_console_print_rect_ex(TCOD_console_t con,int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment,const char *fmt, ...) { int ret; @@ -609,7 +873,20 @@ int TCOD_console_print_rect_ex(TCOD_console_t con,int x, int y, int w, int h, va_end(ap); return ret; } - +/** + * Return the number of lines that would be printed by the + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param w The width of the region. + * If 0 then the maximum width will be used. + * \param h The height of the region. + * If 0 then the maximum height will be used. + * \param fmt A format string as if passed to printf. + * \param ... Variadic arguments as if passed to printf. + * \return The number of lines that would have been printed. + */ int TCOD_console_get_height_rect(TCOD_console_t con,int x, int y, int w, int h, const char *fmt, ...) { int ret; va_list ap; @@ -1025,7 +1302,19 @@ int TCOD_console_get_height_rect_utf(TCOD_console_t con,int x, int y, int w, int } #endif - +/** + * \brief Initialize the libtcod graphical engine. + * + * \param w The width in tiles. + * \param h The height in tiles. + * \param title The title for the window. + * \param fullscreen Fullscreen option. + * \param renderer Which renderer to use when rendering the console. + * + * You may want to call TCOD_console_set_custom_font BEFORE calling this + * function. By default this function loads libtcod's `terminal.png` image + * from the working directory. + */ void TCOD_console_init_root(int w, int h, const char*title, bool fullscreen, TCOD_renderer_t renderer) { TCOD_IF(w > 0 && h > 0) { TCOD_console_data_t *con=(TCOD_console_data_t *)calloc(sizeof(TCOD_console_data_t),1); @@ -1033,7 +1322,7 @@ void TCOD_console_init_root(int w, int h, const char*title, bool fullscreen, TCO con->w=w; con->h=h; TCOD_ctx.root=con; -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE TCOD_ctx.renderer=renderer; #endif for (i=0; i < TCOD_COLCTRL_NUMBER; i++) { @@ -1118,17 +1407,45 @@ TCOD_image_t TCOD_console_get_background_color_image(TCOD_console_t con) { TCOD_IFNOT(dat != NULL) return NULL; return dat->bg_colors; } - +/** + * \brief Set a font image to be loaded during initialization. + * + * \param fontFile The path to a font image. + * \param flags A TCOD_font_flags_t bit-field describing the font image + * contents. + * \param nb_char_horiz The number of columns in the font image. + * \param nb_char_vertic The number of rows in the font image. + * + * `fontFile` will be case-sensitive depending on the platform. + */ void TCOD_console_set_custom_font(const char *fontFile, int flags,int nb_char_horiz, int nb_char_vertic) { TCOD_sys_set_custom_font(fontFile, nb_char_horiz, nb_char_vertic, flags); } - +/** + * \brief Remap a character code to a tile. + * + * \param asciiCode Character code to modify. + * \param fontCharX X tile-coordinate, starting from the left at zero. + * \param fontCharY Y tile-coordinate, starting from the top at zero. + * + * X,Y parameters are the coordinate of the tile, not pixel-coordinates. + */ void TCOD_console_map_ascii_code_to_font(int asciiCode, int fontCharX, int fontCharY) { /* cannot change mapping before initRoot is called */ TCOD_IFNOT(TCOD_ctx.root != NULL) return; TCOD_sys_map_ascii_to_font(asciiCode, fontCharX, fontCharY); } - +/** + * \brief Remap a series of character codes to a row of tiles. + * + * \param asciiCode The starting character code. + * \param nbCodes Number of character codes to assign. + * \param fontCharX First X tile-coordinate, starting from the left at zero. + * \param fontCharY First Y tile-coordinate, starting from the top at zero. + * + * This function always assigns tiles in row-major order, even if the + * TCOD_FONT_LAYOUT_ASCII_INCOL flag was set. + */ void TCOD_console_map_ascii_codes_to_font(int asciiCode, int nbCodes, int fontCharX, int fontCharY) { int c; /* cannot change mapping before initRoot is called */ @@ -1143,7 +1460,16 @@ void TCOD_console_map_ascii_codes_to_font(int asciiCode, int nbCodes, int fontCh } } } - +/** + * \brief Remap a string of character codes to a row of tiles. + * + * \param s A null-terminated string. + * \param fontCharX First X tile-coordinate, starting from the left at zero. + * \param fontCharY First Y tile-coordinate, starting from the top at zero. + * + * This function always assigns tiles in row-major order, even if the + * TCOD_FONT_LAYOUT_ASCII_INCOL flag was set. + */ void TCOD_console_map_string_to_font(const char *s, int fontCharX, int fontCharY) { TCOD_IFNOT(s != NULL) return; /* cannot change mapping before initRoot is called */ @@ -1457,7 +1783,7 @@ static void TCOD_console_read_asc(TCOD_console_t con,FILE *f,int width, int heig back.b = fgetc(f); /* skip solid/walkable info */ if ( version >= 0.3f ) { - fgetc(f); + fgetc(f); fgetc(f); } TCOD_console_put_char_ex(con,x,y,c,fore,back); @@ -1568,17 +1894,17 @@ bool TCOD_console_save_asc(TCOD_console_t pcon, const char *filename) { for(y = 0; y < con->h; y++) { TCOD_color_t fore,back; int c=TCOD_console_get_char(con,x,y); - fore=TCOD_console_get_char_foreground(con,x,y); + fore=TCOD_console_get_char_foreground(con,x,y); back=TCOD_console_get_char_background(con,x,y); fputc(c, f); - fputc(fore.r,f); - fputc(fore.g,f); - fputc(fore.b,f); - fputc(back.r,f); - fputc(back.g,f); + fputc(fore.r,f); + fputc(fore.g,f); + fputc(fore.b,f); + fputc(back.r,f); + fputc(back.g,f); fputc(back.b,f); fputc(0,f); /* solid */ - fputc(1,f); /* walkable */ + fputc(1,f); /* walkable */ } } fclose(f); @@ -1784,7 +2110,7 @@ bool TCOD_console_save_apf(TCOD_console_t pcon, const char *filename) { /* riff header*/ putFourCC("RIFF",fp); fgetpos(fp,&posRiffSize); - put32(0,fp); + put32(0,fp); /* APF_ header */ putFourCC("apf ",fp); @@ -1813,7 +2139,7 @@ bool TCOD_console_save_apf(TCOD_console_t pcon, const char *filename) { imgDetailsSize = sizeof(uint32_t) + sizeof imgData; putFourCC("imgd",fp); put32(l32(imgDetailsSize),fp); - put32(l32(1),fp); + put32(l32(1),fp); putData((void*)&imgData,sizeof imgData,fp); if (imgDetailsSize&1){ put8(0,fp); @@ -1848,14 +2174,14 @@ bool TCOD_console_save_apf(TCOD_console_t pcon, const char *filename) { for(y = 0; y < con->h; y++) { TCOD_color_t fore,back; int c=TCOD_console_get_char(con,x,y); - fore=TCOD_console_get_char_foreground(con,x,y); + fore=TCOD_console_get_char_foreground(con,x,y); back=TCOD_console_get_char_background(con,x,y); put8(c, fp); - put8(fore.r,fp); - put8(fore.g,fp); - put8(fore.b,fp); - put8(back.r,fp); - put8(back.g,fp); + put8(fore.r,fp); + put8(fore.g,fp); + put8(fore.b,fp); + put8(back.r,fp); + put8(back.g,fp); put8(back.b,fp); } } @@ -1896,7 +2222,7 @@ bool TCOD_console_load_apf(TCOD_console_t pcon, const char *filename) { */ uint32_t layr = fourCC("layr"); FILE* fp ; - Data data; + Data data; TCOD_console_data_t *con=pcon ? (TCOD_console_data_t *)pcon : TCOD_ctx.root; TCOD_IFNOT(con != NULL) return false; diff --git a/tcod_sys/libtcod/src/console_rexpaint.c b/tcod_sys/libtcod/src/console_rexpaint.c index 52bf5e017..862b00985 100644 --- a/tcod_sys/libtcod/src/console_rexpaint.c +++ b/tcod_sys/libtcod/src/console_rexpaint.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,185 +25,196 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #ifdef TCOD_CONSOLE_SUPPORT -#include +#include -/* Needed only for TCOD_fatal */ -#include +#include +#include +#include +#include /* Needed only for TCOD_fatal */ #include #include -/* Confirm that the current types are the same as what this code expects. */ -#if UINT_MAX != 0xffffffff -#error int type must be 32-bit! -#endif - -#ifdef TCOD_SDL2 -#include -#if SDL_BYTEORDER != SDL_LIL_ENDIAN -#error byte-order must be little endian! -#endif -#endif - +/* Convert a little-endian number to native memory order. */ +static uint32_t decode_little_endian(uint32_t data) { + int i; + uint32_t result=0; + for(i=0; i<(int)sizeof(result);++i){ + result += (unsigned int)((unsigned char*)&data)[i] << (CHAR_BIT * i); + } + return result; +} +/* Byte swaps a number into little-endian order to be saved to disk. */ +static uint32_t encode_little_endian(uint32_t number) { + int i; + uint32_t result=0; + for(i=0; i<(int)sizeof(result);++i){ + ((unsigned char*)&result)[i] = number & UCHAR_MAX; + number >>= CHAR_BIT; + } + return result; +} +/* RexPaint structs */ struct RexPaintHeader { - int version; - int layer_count; + int32_t version; + int32_t layer_count; }; struct RexPaintLayerChunk { - int width; - int height; + int32_t width; + int32_t height; }; struct RexPaintTile { - int ch; - TCOD_color_t fg; - TCOD_color_t bg; + int32_t ch; + TCOD_color_t fg; + TCOD_color_t bg; }; /* Read data from a gz file, returns 0 on success, or -1 on any error. */ static int load_gz_confirm(gzFile gz_file, void *data, size_t length) { - if (gzread(gz_file, data, (int)length) != length) { return -1; } - return 0; + if (gzread(gz_file, data, (int)length) != length) { return -1; } + return 0; +} +/* Loads a little-endian 32 bit signed int into memory. */ +static int load_int32(gzFile gz_file, int32_t *out) { + if (load_gz_confirm(gz_file, out, sizeof(out[0]))) { return -1; } + *out = (int32_t)decode_little_endian((uint32_t)(out[0])); + return 0; } static int load_header(gzFile gz_file, struct RexPaintHeader *xp_header) { - return load_gz_confirm(gz_file, xp_header, sizeof(xp_header[0])); + return (load_int32(gz_file, &xp_header->version) || + load_int32(gz_file, &xp_header->layer_count)); } static int load_layer(gzFile gz_file, struct RexPaintLayerChunk *xp_layer) { - return load_gz_confirm(gz_file, xp_layer, sizeof(xp_layer[0])); + return (load_int32(gz_file, &xp_layer->width) || + load_int32(gz_file, &xp_layer->height)); } /* Read a single REXPaint tile, return 0 on success, or -1 on error. */ static int load_tile(gzFile gz_file, struct RexPaintTile *tile) { - return ( - load_gz_confirm(gz_file, &tile->ch, sizeof(tile->ch)) || - load_gz_confirm(gz_file, &tile->fg, sizeof(tile->fg)) || - load_gz_confirm(gz_file, &tile->bg, sizeof(tile->bg)) - ); + return (load_int32(gz_file, &tile->ch) || + load_gz_confirm(gz_file, &tile->fg, sizeof(tile->fg)) || + load_gz_confirm(gz_file, &tile->bg, sizeof(tile->bg))); } /* Read a layer of REXPaint tiles onto a console. - If transparent is true, then follow REXPaint's rules for transparency. */ + If transparent is true, then follow REXPaint's rules for transparency. */ static int load_tiles( - gzFile gz_file, TCOD_console_t console, int transparent) { - int x, y; - const int width = TCOD_console_get_width(console); - const int height = TCOD_console_get_height(console); - /* REXPaint tiles are in column-major order. */ - for (x = 0; x < width; ++x) { - for (y = 0; y < height; ++y) { - struct RexPaintTile tile; - if (load_tile(gz_file, &tile)) { - return -1; - } - /* REXPaint uses a magic pink background to mark transparency. */ - if (transparent && - tile.bg.r == 0xff && - tile.bg.g == 0x00 && - tile.bg.b == 0xff) { continue; } - TCOD_console_set_char(console, x, y, tile.ch); - TCOD_console_set_char_foreground(console, x, y, tile.fg); - TCOD_console_set_char_background(console, x, y, tile.bg, TCOD_BKGND_SET); - } - } - return 0; + gzFile gz_file, TCOD_console_t console, int transparent) { + int x, y; + const int width = TCOD_console_get_width(console); + const int height = TCOD_console_get_height(console); + /* REXPaint tiles are in column-major order. */ + for (x = 0; x < width; ++x) { + for (y = 0; y < height; ++y) { + struct RexPaintTile tile; + if (load_tile(gz_file, &tile)) { + return -1; + } + /* REXPaint uses a magic pink background to mark transparency. */ + if (transparent && + tile.bg.r == 0xff && + tile.bg.g == 0x00 && + tile.bg.b == 0xff) { continue; } + TCOD_console_set_char(console, x, y, tile.ch); + TCOD_console_set_char_foreground(console, x, y, tile.fg); + TCOD_console_set_char_background(console, x, y, tile.bg, TCOD_BKGND_SET); + } + } + return 0; } /* Return the next REXPaint layer as a console. After reading the header you - could just keep calling this function until it returns NULL. */ + could just keep calling this function until it returns NULL. */ static TCOD_console_t load_console(gzFile gz_file) { - struct RexPaintLayerChunk xp_layer; - TCOD_console_t console; - if (load_layer(gz_file, &xp_layer)) { return NULL; } - console = TCOD_console_new(xp_layer.width, xp_layer.height); - if (!console) { return NULL; } - if (load_tiles(gz_file, console, 0)) { - TCOD_console_delete(console); - return NULL; - } - return console; + struct RexPaintLayerChunk xp_layer; + TCOD_console_t console; + if (load_layer(gz_file, &xp_layer)) { return NULL; } + console = TCOD_console_new(xp_layer.width, xp_layer.height); + if (!console) { return NULL; } + if (load_tiles(gz_file, console, 0)) { + TCOD_console_delete(console); + return NULL; + } + return console; } /* Load all the contents of a REXPaint file into a list of consoles. */ static TCOD_list_t load_consoleList(gzFile gz_file) { - struct RexPaintHeader xp_header; - TCOD_list_t console_list; - int i; - if (load_header(gz_file, &xp_header)) { return NULL; } - console_list = TCOD_list_allocate(xp_header.layer_count); - if (!console_list) { return NULL; } - for (i = 0; i < xp_header.layer_count; ++i) { - TCOD_console_t console = load_console(gz_file); - if (!console) { - /* There was an issue then delete everything so far and return NULL */ - while (!TCOD_list_is_empty(console_list)) { - TCOD_console_delete(TCOD_list_pop(console_list)); - } - TCOD_list_delete(console_list); - return NULL; - } - TCOD_list_push(console_list, console); - } - return console_list; + struct RexPaintHeader xp_header; + TCOD_list_t console_list; + int i; + if (load_header(gz_file, &xp_header)) { return NULL; } + console_list = TCOD_list_allocate(xp_header.layer_count); + if (!console_list) { return NULL; } + for (i = 0; i < xp_header.layer_count; ++i) { + TCOD_console_t console = load_console(gz_file); + if (!console) { + /* There was an issue then delete everything so far and return NULL */ + while (!TCOD_list_is_empty(console_list)) { + TCOD_console_delete(TCOD_list_pop(console_list)); + } + TCOD_list_delete(console_list); + return NULL; + } + TCOD_list_push(console_list, console); + } + return console_list; } /* Convert a list of consoles into a single console, deleting the list. - Follows REXPaint's rules for transparency. */ + Follows REXPaint's rules for transparency. */ static TCOD_console_t combine_console_list(TCOD_list_t console_list) { - TCOD_console_t main_console; - if (!console_list) { return NULL; } - /* Reverse the list so that elements will be dequeued. */ - TCOD_list_reverse(console_list); - main_console = TCOD_list_pop(console_list); - while (!TCOD_list_is_empty(console_list)) { - TCOD_console_t console = TCOD_list_pop(console_list); - /* Set key color to {255, 0, 255} before blit. */ - TCOD_console_set_key_color(console, TCOD_fuchsia); - /* This blit may fail if the consoles do not match shapes. */ - TCOD_console_blit(console, 0, 0, 0, 0, main_console, 0, 0, 1.0f, 1.0f); - TCOD_console_delete(console); - } - TCOD_list_delete(console_list); - return main_console; + TCOD_console_t main_console; + if (!console_list) { return NULL; } + /* Reverse the list so that elements will be dequeued. */ + TCOD_list_reverse(console_list); + main_console = TCOD_list_pop(console_list); + while (!TCOD_list_is_empty(console_list)) { + TCOD_console_t console = TCOD_list_pop(console_list); + /* Set key color to {255, 0, 255} before blit. */ + TCOD_console_set_key_color(console, TCOD_fuchsia); + /* This blit may fail if the consoles do not match shapes. */ + TCOD_console_blit(console, 0, 0, 0, 0, main_console, 0, 0, 1.0f, 1.0f); + TCOD_console_delete(console); + } + TCOD_list_delete(console_list); + return main_console; } /** * \brief Return a list of consoles from a REXPaint file. * - * \param [in] A path to the REXPaint file. + * \param [in] filename A path to the REXPaint file. * \return Returns a TCOD_list_t of TCOD_console_t objects. Or NULL on an * error. You will need to delete this list and each console individually. * - * \details This function can load a REXPaint file with variable layer shapes, + * This function can load a REXPaint file with variable layer shapes, * which would cause issues for a function like TCOD_console_list_from_xp. */ TCOD_list_t TCOD_console_list_from_xp(const char *filename) { - int z_errno = Z_ERRNO; - TCOD_list_t console_list; - gzFile gz_file = gzopen(filename, "rb"); - if (!gz_file) { - TCOD_fatal("Could not open file: '%s'", filename); - return NULL; - } - console_list = load_consoleList(gz_file); - if (!console_list){ - TCOD_fatal("Error parsing '%s'\n%s", filename, gzerror(gz_file, &z_errno)); - /* Could fall-through here and return NULL. */ - } - gzclose(gz_file); - return console_list; + int z_errno = Z_ERRNO; + TCOD_list_t console_list; + gzFile gz_file = gzopen(filename, "rb"); + if (!gz_file) { + TCOD_fatal("Could not open file: '%s'", filename); + return NULL; + } + console_list = load_consoleList(gz_file); + if (!console_list){ + TCOD_fatal("Error parsing '%s'\n%s", filename, gzerror(gz_file, &z_errno)); + /* Could fall-through here and return NULL. */ + } + gzclose(gz_file); + return console_list; } /** * \brief Return a new console loaded from a REXPaint ``.xp`` file. * * \param [in] filename A path to the REXPaint file. - * \param [in] layer The specific layer to return, or ``0`` to return a - * console with all layers overlaid using REXPaint's rules for transparency. * \return A new TCOD_console_t object. New consoles will need * to be deleted with a call to :any:`TCOD_console_delete`. * Returns NULL on an error. * - * \details REXPaint gives special treatment to tiles with a magic pink - * ``{255, 0, 255}`` background color. You can processes this color - * manually or set :any:`TCOD_console_set_key_color` to `TCOD_fuchsia`. */ TCOD_console_t TCOD_console_from_xp(const char *filename) { - return combine_console_list(TCOD_console_list_from_xp(filename)); + return combine_console_list(TCOD_console_list_from_xp(filename)); } /** * \brief Update a console from a REXPaint ``.xp`` file. @@ -211,63 +222,66 @@ TCOD_console_t TCOD_console_from_xp(const char *filename) { * \param [out] con A console instance to update from the REXPaint file. * \param [in] filename A path to the REXPaint file. * - * \details REXPaint gives special treatment to tiles with a magic pink - * ``{255, 0, 255}`` background color. You can processes this color - * manually or set :any:`TCOD_console_set_key_color` to `TCOD_fuchsia`. + * In C++, you can pass the filepath directly to the :any:`TCODConsole` + * constructor to load a REXPaint file. */ bool TCOD_console_load_xp(TCOD_console_t con, const char *filename) { - TCOD_console_t xp_console = TCOD_console_from_xp(filename); - if (!xp_console) { return false; } - if (TCOD_console_get_width(con) != TCOD_console_get_width(xp_console) || - TCOD_console_get_height(con) != TCOD_console_get_height(xp_console)) { - TCOD_console_delete(xp_console); - return false; - } - TCOD_console_blit(xp_console, 0, 0, 0, 0, con, 0, 0, 1.0f, 1.0f); - TCOD_console_delete(xp_console); - return true; + TCOD_console_t xp_console = TCOD_console_from_xp(filename); + if (!xp_console) { return false; } + if (TCOD_console_get_width(con) != TCOD_console_get_width(xp_console) || + TCOD_console_get_height(con) != TCOD_console_get_height(xp_console)) { + TCOD_console_delete(xp_console); + return false; + } + TCOD_console_blit(xp_console, 0, 0, 0, 0, con, 0, 0, 1.0f, 1.0f); + TCOD_console_delete(xp_console); + return true; +} +/* Saves a 32-bit signed int encoded as little-endian to gz_file. */ +static int write_int32(gzFile gz_file, int32_t number) { + uint32_t encoded = encode_little_endian((uint32_t)number); + if (!gzwrite(gz_file, &encoded, sizeof(encoded))) { + return -1; + } + return 0; } static int write_header(gzFile gz_file, struct RexPaintHeader *xp_header) { - if (!gzwrite(gz_file, xp_header, sizeof(xp_header[0]))) { - return -1; - } - return 0; + return (write_int32(gz_file, xp_header->version) || + write_int32(gz_file, xp_header->layer_count)); } static int write_layer(gzFile gz_file, struct RexPaintLayerChunk *xp_layer) { - if (!gzwrite(gz_file, xp_layer, sizeof(xp_layer[0]))) { - return -1; - } - return 0; + return (write_int32(gz_file, xp_layer->width) || + write_int32(gz_file, xp_layer->height)); } static int write_tile(gzFile gz_file, struct RexPaintTile *tile) { - if (!gzwrite(gz_file, &tile->ch, sizeof(tile->ch)) || - !gzwrite(gz_file, &tile->fg, sizeof(tile->fg)) || - !gzwrite(gz_file, &tile->bg, sizeof(tile->bg))) { - return -1; - } - return 0; + if (write_int32(gz_file, tile->ch) || + !gzwrite(gz_file, &tile->fg, sizeof(tile->fg)) || + !gzwrite(gz_file, &tile->bg, sizeof(tile->bg))) { + return -1; + } + return 0; } static int write_console(gzFile gz_file, TCOD_console_t console) { - int x, y; - struct RexPaintLayerChunk xp_layer; - xp_layer.width = TCOD_console_get_width(console); - xp_layer.height = TCOD_console_get_height(console); - if (write_layer(gz_file, &xp_layer)) { - return -1; /* error writing layer */ - } - /* Write console data out in column-major order. */ - for (x = 0; x < xp_layer.width; ++x) { - for (y = 0; y < xp_layer.height; ++y) { - struct RexPaintTile tile; - tile.ch = TCOD_console_get_char(console, x, y); - tile.fg = TCOD_console_get_char_foreground(console, x, y); - tile.bg = TCOD_console_get_char_background(console, x, y); - if (write_tile(gz_file, &tile)) { - return -1; /* error writing tile data */ - } - } - } - return 0; + int x, y; + struct RexPaintLayerChunk xp_layer; + xp_layer.width = TCOD_console_get_width(console); + xp_layer.height = TCOD_console_get_height(console); + if (write_layer(gz_file, &xp_layer)) { + return -1; /* error writing layer */ + } + /* Write console data out in column-major order. */ + for (x = 0; x < xp_layer.width; ++x) { + for (y = 0; y < xp_layer.height; ++y) { + struct RexPaintTile tile; + tile.ch = TCOD_console_get_char(console, x, y); + tile.fg = TCOD_console_get_char_foreground(console, x, y); + tile.bg = TCOD_console_get_char_background(console, x, y); + if (write_tile(gz_file, &tile)) { + return -1; /* error writing tile data */ + } + } + } + return 0; } /** * \brief Save a console as a REXPaint ``.xp`` file. @@ -279,61 +293,59 @@ static int write_console(gzFile gz_file, TCOD_console_t console) { * \return ``true`` when the file is saved succesfully, or ``false`` when an * issue is detected. * - * \details REXPaint has enough fidelity to make a 1:1 copy of a libtcod - * console. + * The REXPaint format can support a 1:1 copy of a libtcod console. */ bool TCOD_console_save_xp( - TCOD_console_t con, const char *filename, int compress_level) { - struct RexPaintHeader xp_header; - gzFile gz_file = gzopen(filename, "wb"); - if (!gz_file) { return false; /* could not open file */ } - gzsetparams(gz_file, compress_level, Z_DEFAULT_STRATEGY); - xp_header.version = -1; /* REXPaint uses this version. */ - xp_header.layer_count = 1; - if (write_header(gz_file, &xp_header) || write_console(gz_file, con)) { - gzclose(gz_file); - return false; /* error writing data */ - } - if (gzclose(gz_file)) { return false; /* error writing to file */ } - return true; + TCOD_console_t con, const char *filename, int compress_level) { + struct RexPaintHeader xp_header; + gzFile gz_file = gzopen(filename, "wb"); + if (!gz_file) { return false; /* could not open file */ } + gzsetparams(gz_file, compress_level, Z_DEFAULT_STRATEGY); + xp_header.version = -1; /* REXPaint uses this version. */ + xp_header.layer_count = 1; + if (write_header(gz_file, &xp_header) || write_console(gz_file, con)) { + gzclose(gz_file); + return false; /* error writing data */ + } + if (gzclose(gz_file)) { return false; /* error writing to file */ } + return true; } /** * \brief Save a list of consoles to a REXPaint file. * - * \param [in] A TCOD_list_t of TCOD_console_t objects. - * \param [in] Path to save to. - * \param [in] zlib compression level. + * \param [in] console_list A TCOD_list_t of TCOD_console_t objects. + * \param [in] filename Path to save to. + * \param [in] compress_level zlib compression level. * \return true on success, false on a failure such as not being able to write * to the path provided. * - * \details The REXPaint tool can only work on files with up to 4 layers where - * all layers are the same size. + * This function can save any number of layers with multiple + * different sizes. * - * This function can save any number of layers with multiple different sizes, - * these files can be loaded without issues as long you use - * :any:`TCOD_console_list_from_xp` for loading. + * The REXPaint tool only supports files with up to 4 layers where + * all layers are the same size. */ bool TCOD_console_list_save_xp( - TCOD_list_t console_list, const char *filename, int compress_level) { - int i; - struct RexPaintHeader xp_header; - gzFile gz_file = gzopen(filename, "wb"); - if (!gz_file) { return false; /* could not open file */ } - gzsetparams(gz_file, compress_level, Z_DEFAULT_STRATEGY); - xp_header.version = -1; - xp_header.layer_count = TCOD_list_size(console_list); - if (write_header(gz_file, &xp_header)) { - gzclose(gz_file); - return false; /* error writing metadata */ - } - for (i = 0; i < xp_header.layer_count; ++i){ - if (write_console(gz_file, TCOD_list_get(console_list, i))) { - gzclose(gz_file); - return false; /* error writing out console data */ - } - } - if (gzclose(gz_file)) { return false; /* error writing to file */ } - return true; + TCOD_list_t console_list, const char *filename, int compress_level) { + int i; + struct RexPaintHeader xp_header; + gzFile gz_file = gzopen(filename, "wb"); + if (!gz_file) { return false; /* could not open file */ } + gzsetparams(gz_file, compress_level, Z_DEFAULT_STRATEGY); + xp_header.version = -1; + xp_header.layer_count = TCOD_list_size(console_list); + if (write_header(gz_file, &xp_header)) { + gzclose(gz_file); + return false; /* error writing metadata */ + } + for (i = 0; i < xp_header.layer_count; ++i){ + if (write_console(gz_file, TCOD_list_get(console_list, i))) { + gzclose(gz_file); + return false; /* error writing out console data */ + } + } + if (gzclose(gz_file)) { return false; /* error writing to file */ } + return true; } #endif /* TCOD_CONSOLE_SUPPORT */ diff --git a/tcod_sys/libtcod/src/fov.cpp b/tcod_sys/libtcod/src/fov.cpp index 2bdf5ecd4..c04214fad 100644 --- a/tcod_sys/libtcod/src/fov.cpp +++ b/tcod_sys/libtcod/src/fov.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/src/fov_c.c b/tcod_sys/libtcod/src/fov_c.c index 3bc17a696..553e8ab29 100644 --- a/tcod_sys/libtcod/src/fov_c.c +++ b/tcod_sys/libtcod/src/fov_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -147,4 +148,3 @@ int TCOD_map_get_nb_cells(TCOD_map_t map) { TCOD_IFNOT(map != NULL) return 0; return m->nbcells; } - diff --git a/tcod_sys/libtcod/src/fov_circular_raycasting.c b/tcod_sys/libtcod/src/fov_circular_raycasting.c index ee532726e..aafb3c7bc 100644 --- a/tcod_sys/libtcod/src/fov_circular_raycasting.c +++ b/tcod_sys/libtcod/src/fov_circular_raycasting.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -40,14 +41,15 @@ static void cast_ray(map_t *map, int xo, int yo, int xd, int yd, int r2,bool lig bool blocked=false; bool end=false; int offset; - TCOD_line_init(xo,yo,xd,yd); + TCOD_bresenham_data_t bresenham_data; + TCOD_line_init_mt(xo,yo,xd,yd,&bresenham_data); offset=curx+cury*map->width; if ( 0 <= offset && offset < map->nbcells ) { in=true; map->cells[offset].fov=1; } while (!end) { - end = TCOD_line_step(&curx,&cury); /* reached xd,yd */ + end = TCOD_line_step_mt(&curx,&cury,&bresenham_data); /* reached xd,yd */ offset=curx+cury*map->width; if ( r2 > 0 ) { /* check radius */ @@ -73,7 +75,7 @@ void TCOD_map_postproc(map_t *map,int x0,int y0, int x1, int y1, int dx, int dy) int x2 = cx+dx; int y2 = cy+dy; unsigned int offset=cx+cy*map->width; - if ( offset < (unsigned)map->nbcells && map->cells[offset].fov == 1 + if ( offset < (unsigned)map->nbcells && map->cells[offset].fov == 1 && map->cells[offset].transparent ) { if ( x2 >= x0 && x2 <= x1 ) { unsigned int offset2=x2+cy*map->width; @@ -236,4 +238,3 @@ void TCOD_map_compute_fov_circular_raycasting(TCOD_map_t map, int player_x, int TCOD_map_postproc(m,player_x,player_y,xmax-1,ymax-1,1,1); } } - diff --git a/tcod_sys/libtcod/src/fov_diamond_raycasting.c b/tcod_sys/libtcod/src/fov_diamond_raycasting.c index bf0855559..b02eefe5d 100644 --- a/tcod_sys/libtcod/src/fov_diamond_raycasting.c +++ b/tcod_sys/libtcod/src/fov_diamond_raycasting.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/src/fov_permissive2.c b/tcod_sys/libtcod/src/fov_permissive2.c index e3dcc1bd3..3d9f96bc6 100644 --- a/tcod_sys/libtcod/src/fov_permissive2.c +++ b/tcod_sys/libtcod/src/fov_permissive2.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -77,7 +78,7 @@ static bool is_blocked(map_t *map, view_t *view, int startX, int startY, int x, int posy=y*dy/STEP_SIZE+startY; int offset=posx + (posy)*map->width; bool blocked=!map->cells[offset].transparent; - if (! blocked || light_walls) map->cells[offset].fov=1; + if (! blocked || light_walls) map->cells[offset].fov=1; return blocked; } @@ -124,7 +125,7 @@ static bool check_view(TCOD_list_t active_views, view_t **it) { line_t *shallow_line=&view->shallow_line; line_t *steep_line=&view->steep_line; if (LINE_COLINEAR(shallow_line,steep_line) - && (COLINEAR(shallow_line,offset,limit) + && (COLINEAR(shallow_line,offset,limit) || COLINEAR(shallow_line,limit,offset)) ){ /*printf ("deleting view %x\n",it); */ /* slow ! */ @@ -134,7 +135,7 @@ static bool check_view(TCOD_list_t active_views, view_t **it) { return true; } -static void visit_coords(map_t *m,int startX, int startY, int x, int y, int dx, int dy, +static void visit_coords(map_t *m,int startX, int startY, int x, int y, int dx, int dy, TCOD_list_t active_views, bool light_walls) { /* top left */ int tlx=x, tly=y+STEP_SIZE; @@ -153,13 +154,13 @@ static void visit_coords(map_t *m,int startX, int startY, int x, int y, int dx, return; } if ( !is_blocked(m,view,startX,startY,x,y,dx,dy,light_walls) ) return; - if ( ABOVE(&view->shallow_line,brx,bry) + if ( ABOVE(&view->shallow_line,brx,bry) && BELOW(&view->steep_line,tlx,tly)) { /* view blocked */ /* slow ! */ TCOD_list_remove_iterator(active_views,(void **)current_view); } else if ( ABOVE(&view->shallow_line,brx,bry)) { - /* shallow bump */ + /* shallow bump */ add_shallow_bump(tlx,tly,view); check_view(active_views,current_view); } else if (BELOW(&view->steep_line,tlx,tly)) { @@ -253,4 +254,3 @@ void TCOD_map_compute_fov_permissive2(TCOD_map_t map, int player_x, int player_y free(bumps); free(views); } - diff --git a/tcod_sys/libtcod/src/fov_recursive_shadowcasting.c b/tcod_sys/libtcod/src/fov_recursive_shadowcasting.c index 2ffc70e19..2814e9652 100644 --- a/tcod_sys/libtcod/src/fov_recursive_shadowcasting.c +++ b/tcod_sys/libtcod/src/fov_recursive_shadowcasting.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -105,4 +106,3 @@ void TCOD_map_compute_fov_recursive_shadowcasting(TCOD_map_t map, int player_x, mult[0][oct],mult[1][oct],mult[2][oct],mult[3][oct],0,light_walls); m->cells[player_x+player_y*m->width].fov=1; } - diff --git a/tcod_sys/libtcod/src/fov_restrictive.c b/tcod_sys/libtcod/src/fov_restrictive.c index a02034d9b..277484fc1 100644 --- a/tcod_sys/libtcod/src/fov_restrictive.c +++ b/tcod_sys/libtcod/src/fov_restrictive.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - /* * Mingos' Restrictive Precise Angle Shadowcasting (MRPAS) v1.2 */ diff --git a/tcod_sys/libtcod/src/heightmap.cpp b/tcod_sys/libtcod/src/heightmap.cpp index a2e47dcac..f1c568d67 100644 --- a/tcod_sys/libtcod/src/heightmap.cpp +++ b/tcod_sys/libtcod/src/heightmap.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -175,4 +176,3 @@ void TCODHeightMap::midPointDisplacement(TCODRandom *rnd, float roughness) { if ( ! rnd ) rnd = TCODRandom::getInstance(); TCOD_heightmap_mid_point_displacement(&hm, rnd->data, roughness); } - diff --git a/tcod_sys/libtcod/src/heightmap_c.c b/tcod_sys/libtcod/src/heightmap_c.c index 81f785ec1..d8937f2ed 100644 --- a/tcod_sys/libtcod/src/heightmap_c.c +++ b/tcod_sys/libtcod/src/heightmap_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -89,7 +90,7 @@ void TCOD_heightmap_normalize(TCOD_heightmap_t *hm, float min, float max) { for (y=0; y < hm->h; y++) { for (x=0; x < hm->w; x++) { *value = min + (*value - curmin) * invmax ; - value++; + value++; } } } diff --git a/tcod_sys/libtcod/src/image.cpp b/tcod_sys/libtcod/src/image.cpp index 6ef3d5c80..ae8e916d1 100644 --- a/tcod_sys/libtcod/src/image.cpp +++ b/tcod_sys/libtcod/src/image.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -130,4 +131,4 @@ void TCODImage::blit2x(TCODConsole *dest, int dx, int dy, int sx, int sy, int w, } #endif /* TCOD_CONSOLE_SUPPORT */ -#endif /* TCOD_IMAGE_SUPPORT */ \ No newline at end of file +#endif /* TCOD_IMAGE_SUPPORT */ diff --git a/tcod_sys/libtcod/src/image_c.c b/tcod_sys/libtcod/src/image_c.c index 0bf579d58..89f89cd42 100644 --- a/tcod_sys/libtcod/src/image_c.c +++ b/tcod_sys/libtcod/src/image_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,18 +25,16 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include - +#include "libtcod_portability.h" #ifdef TCOD_IMAGE_SUPPORT +#include #include #include +#include #include -#include -#ifdef TCOD_CONSOLE_SUPPORT #include -#endif #include #include @@ -62,11 +61,11 @@ TCOD_color_t *TCOD_image_get_colors(TCOD_image_t *image) { return img->mipmaps[0].buf; } -void TCOD_image_get_key_data(TCOD_image_t image, bool *has_key_color, TCOD_color_t *key_color) { +void TCOD_image_get_key_data(TCOD_image_t image, bool *has_key_color, TCOD_color_t *key_color) { image_data_t *img = ((image_data_t *)image); - *has_key_color = img->has_key_color; - *key_color = img->key_color; -} + *has_key_color = img->has_key_color; + *key_color = img->key_color; +} void TCOD_image_invalidate_mipmaps(TCOD_image_t *image) { int i; @@ -301,7 +300,7 @@ void TCOD_image_delete_internal(TCOD_image_t image) { free(img->mipmaps); } if ( img->sys_img ) { -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE TCOD_sys_delete_bitmap(img->sys_img); #endif } @@ -333,7 +332,7 @@ void TCOD_image_blit(TCOD_image_t image, TCOD_console_t console, float x, float if ( scalex == 0.0f || scaley == 0.0f || bkgnd_flag == TCOD_BKGND_NONE ) return; TCOD_image_get_size(image,&width,&height); rx = x - width * 0.5f; - ry = y - height * 0.5f; + ry = y - height * 0.5f; if ( scalex == 1.0f && scaley == 1.0f && angle == 0.0f && rx == ((int)rx) && ry == ((int)ry)) { /* clip the image */ int ix = (int)(x - width*0.5f); diff --git a/tcod_sys/libtcod/src/lex.cpp b/tcod_sys/libtcod/src/lex.cpp index a1858ee52..7fc49a9ab 100644 --- a/tcod_sys/libtcod/src/lex.cpp +++ b/tcod_sys/libtcod/src/lex.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -103,4 +104,3 @@ bool TCODLex::expect(int tokenType, const char *tokenValue) { return TCOD_lex_expect_token_value((TCOD_lex_t *)data,tokenType,tokenValue) != 0; } - diff --git a/tcod_sys/libtcod/src/lex_c.c b/tcod_sys/libtcod/src/lex_c.c index 802096727..525a3b210 100644 --- a/tcod_sys/libtcod/src/lex_c.c +++ b/tcod_sys/libtcod/src/lex_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -34,11 +35,11 @@ #define MAX_JAVADOC_COMMENT_SIZE 16384 /* damn ANSI C does not know strdup, strcasecmp, strncasecmp */ -char *TCOD_strdup(const char *s) { - size_t l=strlen(s)+1; - char *ret=malloc(sizeof(char)*l); - memcpy(ret,s,sizeof(char)*l); - return ret; +char *TCOD_strdup(const char *str) { + size_t l = strlen(str) + 1; + char *duplicate = malloc(l); + if (duplicate) { strcpy(duplicate, str); } + return duplicate; } int TCOD_strcasecmp(const char *s1, const char *s2) { @@ -50,7 +51,7 @@ int TCOD_strcasecmp(const char *s1, const char *s2) { c2 = (unsigned char) tolower( (unsigned char) c2); } while((c1 == c2) && (c1 != '\0')); return (int) c1-c2; -} +} int TCOD_strncasecmp(const char *s1, const char *s2, size_t n) { unsigned char c1,c2; @@ -62,7 +63,7 @@ int TCOD_strncasecmp(const char *s1, const char *s2, size_t n) { n--; } while((c1 == c2) && (c1 != '\0') && n > 0); return (int) c1-c2; -} +} static const char * TCOD_LEX_names[] = { "unknown token", @@ -96,7 +97,7 @@ TCOD_lex_t *TCOD_lex_new_intern(void) { } TCOD_lex_t * TCOD_lex_new( const char **_symbols, const char **_keywords, const char *simpleComment, - const char *commentStart, const char *commentStop, const char *javadocCommentStart, + const char *commentStart, const char *commentStop, const char *javadocCommentStart, const char *_stringDelim, int _flags) { TCOD_lex_t *lex=(TCOD_lex_t *)TCOD_lex_new_intern(); @@ -112,6 +113,7 @@ TCOD_lex_t * TCOD_lex_new( const char **_symbols, const char **_keywords, const sprintf (msg, "symbol '%s' too long (max size %d)", _symbols[ lex->nb_symbols ], TCOD_LEX_SYMBOL_SIZE ); TCOD_last_error=TCOD_strdup(msg); + TCOD_lex_delete (lex); return NULL; } strcpy(lex->symbols[ lex->nb_symbols ], _symbols[ lex->nb_symbols ] ); @@ -128,6 +130,7 @@ TCOD_lex_t * TCOD_lex_new( const char **_symbols, const char **_keywords, const sprintf(msg,"keyword '%s' too long (max size %d)", _keywords[ lex->nb_keywords ], TCOD_LEX_KEYWORD_SIZE); TCOD_last_error=TCOD_strdup(msg); + TCOD_lex_delete (lex); return NULL; } if ( lex->flags & TCOD_LEX_FLAG_NOCASE ) @@ -221,7 +224,7 @@ bool TCOD_lex_set_data_file(TCOD_lex_t *lex, const char *_filename) size = ftell(f); fclose(f); f = fopen( _filename, "r" ); - + lex->buf = (char*)calloc(sizeof(char),(size + 1)); lex->filename = TCOD_strdup( _filename ); if ( lex->buf == NULL || lex->filename == NULL ) @@ -359,7 +362,7 @@ static bool TCOD_lex_get_special_char(TCOD_lex_t *lex, char *c) { case 'n' : *c='\n'; break; case 't' : *c='\t'; break; case 'r' : *c='\r'; break; - case '\\' : + case '\\' : case '\"' : case '\'' : break; @@ -697,4 +700,3 @@ bool TCOD_lex_expect_token_value(TCOD_lex_t *lex,int token_type, const char *tok TCOD_lex_parse(lex); return (token_type == lex->token_type && strcmp(lex->tok, token_value) == 0 ); } - diff --git a/tcod_sys/libtcod/src/libtcod.cpp b/tcod_sys/libtcod/src/libtcod.cpp new file mode 100644 index 000000000..717eb04a0 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod.cpp @@ -0,0 +1,67 @@ +/* +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. +* +* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +/** \file libtcod.cpp + * + * To statically link a C++ program with libtcod you'll need to follow + * the directions for compiling `libtcod_c.c` and then add `libtcod.cpp` to + * your source files. + */ +#include "bresenham.cpp" +#include "bsp.cpp" +#include "color.cpp" +#include "console.cpp" +#include "fov.cpp" +#include "heightmap.cpp" +#include "image.cpp" +#include "lex.cpp" +#include "mersenne.cpp" +#include "mouse.cpp" +#include "namegen.cpp" +#include "noise.cpp" +#include "parser.cpp" +#include "path.cpp" +#include "sys.cpp" +#include "txtfield.cpp" +#include "zip.cpp" + +/* +#include "gui/button.cpp" +#include "gui/container.cpp" +#include "gui/flatlist.cpp" +#include "gui/hbox.cpp" +#include "gui/image.cpp" +#include "gui/label.cpp" +#include "gui/radiobutton.cpp" +#include "gui/slider.cpp" +#include "gui/statusbar.cpp" +#include "gui/textbox.cpp" +#include "gui/togglebutton.cpp" +#include "gui/toolbar.cpp" +#include "gui/vbox.cpp" +#include "gui/widget.cpp" +*/ diff --git a/tcod_sys/libtcod/src/libtcod_c.c b/tcod_sys/libtcod/src/libtcod_c.c new file mode 100644 index 000000000..72a2acf63 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod_c.c @@ -0,0 +1,85 @@ +/* +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. +* +* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +/** \file libtcod_c.c + * + * To statically link a C program with libtcod: + * + * * Add `libtcod_c.c` to your list of source files to compile. + * * Add libtcod's include directory. + * * Add `SDL2` to be dynamically linked, and add its include directory. + * You can get the development libraries from: + * https://www.libsdl.org/download-2.0.php + * * Add `GL` to be dynamically linked. + * * Compile and link libtcod's src/png/lodepng.c file. + * * Link with `zlib`, and add its include directory. You can include + * libtcod's src/zlib directory and compile all `.c` files in there to + * statically link it. + * * If you're using C++ then add `libtcod.cpp` to your source files. + * + * You can define `NO_OPENGL` to remove the dependency on the GL library. + * You can also define `TCOD_BARE` to remove the dependency on SDL2 and GL. + */ +#include "vendor/stb.c" + +#include "bresenham_c.c" +#include "bsp_c.c" +#include "color_c.c" +#include "console_c.c" +#include "console_rexpaint.c" +#include "fov_c.c" +#include "fov_circular_raycasting.c" +#include "fov_diamond_raycasting.c" +#include "fov_permissive2.c" +#include "fov_recursive_shadowcasting.c" +#include "fov_restrictive.c" +#include "heightmap_c.c" +#include "image_c.c" +#include "lex_c.c" +#include "list_c.c" +#include "mersenne_c.c" +#include "namegen_c.c" +#include "noise_c.c" +#include "parser_c.c" +#include "path_c.c" +#include "sys_c.c" +#include "tree_c.c" +#include "txtfield_c.c" +#include "wrappers.c" +#include "zip_c.c" + +#ifndef TCOD_BARE +#include "sys_sdl_c.c" +#include "sys_sdl_img_bmp.c" +#include "sys_sdl_img_png.c" +#include "sys_sdl2_c.c" + +#ifndef NO_OPENGL +#include "sys_opengl_c.c" +#endif /* NO_OPENGL */ + +#endif /* TCOD_BARE */ diff --git a/tcod_sys/libtcod/src/list_c.c b/tcod_sys/libtcod/src/list_c.c index 680544f40..04fd3d6f8 100644 --- a/tcod_sys/libtcod/src/list_c.c +++ b/tcod_sys/libtcod/src/list_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -198,4 +199,3 @@ void **TCOD_list_insert_before(TCOD_list_t l,const void *elt,int before) { bool TCOD_list_is_empty(TCOD_list_t l) { return ( LIST(l)->fillSize == 0 ); } - diff --git a/tcod_sys/libtcod/src/mersenne.cpp b/tcod_sys/libtcod/src/mersenne.cpp index c045e71f1..bab46be81 100644 --- a/tcod_sys/libtcod/src/mersenne.cpp +++ b/tcod_sys/libtcod/src/mersenne.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/src/mersenne_c.c b/tcod_sys/libtcod/src/mersenne_c.c index fb694bf46..6ce7dbfbf 100644 --- a/tcod_sys/libtcod/src/mersenne_c.c +++ b/tcod_sys/libtcod/src/mersenne_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/src/mouse.cpp b/tcod_sys/libtcod/src/mouse.cpp index 21984cbdf..b131f87d6 100644 --- a/tcod_sys/libtcod/src/mouse.cpp +++ b/tcod_sys/libtcod/src/mouse.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/src/namegen.cpp b/tcod_sys/libtcod/src/namegen.cpp index 6302ace5a..55fab1f56 100644 --- a/tcod_sys/libtcod/src/namegen.cpp +++ b/tcod_sys/libtcod/src/namegen.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/src/namegen_c.c b/tcod_sys/libtcod/src/namegen_c.c index 36b0b3181..dc699a2c5 100644 --- a/tcod_sys/libtcod/src/namegen_c.c +++ b/tcod_sys/libtcod/src/namegen_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -638,4 +639,3 @@ void TCOD_namegen_destroy (void) { /* get rid of the parsed files list */ TCOD_list_clear_and_delete(parsed_files); } - diff --git a/tcod_sys/libtcod/src/noise.cpp b/tcod_sys/libtcod/src/noise.cpp index 1c9e5ed86..d731cb9dc 100644 --- a/tcod_sys/libtcod/src/noise.cpp +++ b/tcod_sys/libtcod/src/noise.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/src/noise_c.c b/tcod_sys/libtcod/src/noise_c.c index 010d377e1..c91d23491 100644 --- a/tcod_sys/libtcod/src/noise_c.c +++ b/tcod_sys/libtcod/src/noise_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/src/parser.cpp b/tcod_sys/libtcod/src/parser.cpp index db29c9acc..2aa8a8b48 100644 --- a/tcod_sys/libtcod/src/parser.cpp +++ b/tcod_sys/libtcod/src/parser.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -186,4 +187,3 @@ void * TCODParser::getCustomProperty(const char *name) const { TCOD_list_t TCODParser::getListProperty(const char *name, TCOD_value_type_t type) const { return TCOD_parser_get_list_property(data,name,type); } - diff --git a/tcod_sys/libtcod/src/parser_c.c b/tcod_sys/libtcod/src/parser_c.c index db1e7d727..c9d5d6b72 100644 --- a/tcod_sys/libtcod/src/parser_c.c +++ b/tcod_sys/libtcod/src/parser_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -930,4 +931,3 @@ TCOD_list_t TCOD_parser_get_list_property(TCOD_parser_t parser, const char *name value=TCOD_get_property(parser,TCOD_TYPE_LIST|type,name); return value ? value->list : empty_list; } - diff --git a/tcod_sys/libtcod/src/path.cpp b/tcod_sys/libtcod/src/path.cpp index 88a0ff789..d1edd69c7 100644 --- a/tcod_sys/libtcod/src/path.cpp +++ b/tcod_sys/libtcod/src/path.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -136,4 +137,3 @@ int TCODDijkstra::size() const { void TCODDijkstra::get(int index, int *x, int *y) const { return TCOD_dijkstra_get(data,index,x,y); } - diff --git a/tcod_sys/libtcod/src/path_c.c b/tcod_sys/libtcod/src/path_c.c index 163db7bf3..d1142d5c3 100644 --- a/tcod_sys/libtcod/src/path_c.c +++ b/tcod_sys/libtcod/src/path_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/src/sys.cpp b/tcod_sys/libtcod/src/sys.cpp index ee384ded0..f89e60690 100644 --- a/tcod_sys/libtcod/src/sys.cpp +++ b/tcod_sys/libtcod/src/sys.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -43,7 +44,7 @@ float TCODSystem::getElapsedSeconds() { } #endif -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE void TCODSystem::saveScreenshot(const char *filename) { TCOD_sys_save_screenshot(filename); } @@ -82,7 +83,7 @@ float TCODSystem::getLastFrameLength() { } #endif -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE void TCODSystem::getCurrentResolution(int *w, int *h) { TCOD_sys_get_current_resolution(w, h); } @@ -145,7 +146,7 @@ bool TCODSystem::writeFile(const char *filename, unsigned char *buf, uint32_t si return TCOD_sys_write_file(filename,buf,size) != 0; } -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE // clipboard stuff bool TCODSystem::setClipboard(const char *value) { return TCOD_sys_clipboard_set(value) != 0; @@ -229,13 +230,13 @@ void TCODSystem::deleteCondition( TCOD_cond_t cond) { } // custom post-renderer -static ITCODSDLRenderer *renderer=NULL; +static ITCODSDLRenderer *post_renderer=NULL; extern "C" void TCOD_CRenderer(void *sdl_surface) { - if ( renderer ) renderer->render(sdl_surface); + if ( post_renderer ) post_renderer->render(sdl_surface); } void TCODSystem::registerSDLRenderer(ITCODSDLRenderer *renderer) { - ::renderer = renderer; -#ifdef TCOD_SDL2 + ::post_renderer = renderer; +#ifndef TCOD_BARE TCOD_sys_register_SDL_renderer(TCOD_CRenderer); #endif } diff --git a/tcod_sys/libtcod/src/sys_c.c b/tcod_sys/libtcod/src/sys_c.c index 17fdbc5fb..4689d7bff 100644 --- a/tcod_sys/libtcod/src/sys_c.c +++ b/tcod_sys/libtcod/src/sys_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -52,34 +53,6 @@ #include #endif -#if defined(TCOD_WINDOWS) -char *strcasestr (const char *haystack, const char *needle) { - const char *p, *startn = 0, *np = 0; - - for (p = haystack; *p; p++) { - if (np) { - if (toupper(*p) == toupper(*np)) { - if (!*++np) - return (char *)startn; - } else - np = 0; - } else if (toupper(*p) == toupper(*needle)) { - np = needle + 1; - startn = p; - } - } - - return 0; -} -#endif - -#ifdef TCOD_SDL2 -void TCOD_sys_get_fullscreen_offsets(int *offx, int *offy) { - if ( offx ) *offx = TCOD_ctx.fullscreen_offsetx; - if ( offy ) *offy = TCOD_ctx.fullscreen_offsety; -} -#endif - bool TCOD_sys_create_directory(const char *path) { #ifdef TCOD_WINDOWS return (CreateDirectory(path,NULL) != 0 || GetLastError() == ERROR_ALREADY_EXISTS); @@ -157,7 +130,7 @@ TCOD_list_t TCOD_sys_get_directory_content(const char *path, const char *pattern if ( ! (strcmp(dirent->d_name,".") == 0 || strcmp(dirent->d_name,"..") == 0 ) ) { if ( filename_match(dirent->d_name,pattern) ) - TCOD_list_push(list,strdup(dirent->d_name)); + TCOD_list_push(list,TCOD_strdup(dirent->d_name)); } } closedir(dir); @@ -521,8 +494,12 @@ void TCOD_condition_delete( TCOD_cond_t pcond) { #endif } -#ifdef TCOD_BARE - +#ifndef TCOD_BARE +void TCOD_sys_get_fullscreen_offsets(int *offx, int *offy) { + if ( offx ) *offx = TCOD_ctx.fullscreen_offsetx; + if ( offy ) *offy = TCOD_ctx.fullscreen_offsety; +} +#else void TCOD_sys_startup(void) { //TCOD_ctx.max_font_chars = 256; //alloc_ascii_tables(); @@ -538,7 +515,6 @@ bool TCOD_sys_read_file(const char *filename, unsigned char **buf, size_t *size) bool TCOD_sys_write_file(const char *filename, unsigned char *buf, uint32_t size) { return false; } - #endif /* TCOD_BARE */ void TCOD_fatal(const char *fmt, ...) { @@ -564,7 +540,7 @@ TCOD_library_t TCOD_load_library(const char *path) { return (TCOD_library_t)LoadLibrary(path); } void * TCOD_get_function_address(TCOD_library_t library, const char *function_name) { - return (void *)GetProcAddress((HMODULE)library,function_name); + return (void *)GetProcAddress((HMODULE)library,function_name); } void TCOD_close_library(TCOD_library_t library) { FreeLibrary((HMODULE)library); diff --git a/tcod_sys/libtcod/src/sys_opengl_c.c b/tcod_sys/libtcod/src/sys_opengl_c.c index 5047a37c5..eecfd948d 100644 --- a/tcod_sys/libtcod/src/sys_opengl_c.c +++ b/tcod_sys/libtcod/src/sys_opengl_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,11 +25,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - /* * This renderer is mostly copied and pasted from Antagonist's SkyFire GLSL roguelike engine - */ -#ifdef TCOD_SDL2 + */ +#ifndef TCOD_BARE #include #include "libtcod_int.h" @@ -50,7 +50,7 @@ #define DBGCHECKGL CHECKGL #endif -typedef enum +typedef enum { Character, ForeCol, @@ -58,7 +58,7 @@ typedef enum ConsoleDataEnumSize } ConsoleDataEnum; /* JBR04152012 - Made Character a 4 byte value here to support extended characters like other renderers. - Seems like it should be possible to make it a two byte value using GL_UNSIGNED_SHORT_5_6_5_REV in updateTex, + Seems like it should be possible to make it a two byte value using GL_UNSIGNED_SHORT_5_6_5_REV in updateTex, but I can't seem to get the math right in the shader code, it always loses precision somewhere, resulting in incorrect characters. */ const int ConsoleDataAlignment[3] = {4, 3, 3 }; @@ -170,7 +170,7 @@ static PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB=0; static PFNGLUNIFORM1FARBPROC glUniform1fARB=0; static PFNGLUNIFORM1IARBPROC glUniform1iARB=0; static PFNGLACTIVETEXTUREPROC glActiveTextureF=0; - + static SDL_GLContext glcontext; void TCOD_opengl_uninit_state() { @@ -198,7 +198,7 @@ bool TCOD_opengl_init_state(int conw, int conh, void *font) { } if (! hasShader ) { TCOD_LOG(("Missing GL_ARB_shader_objects extension. Falling back to fixed pipeline...\n")); - TCOD_ctx.renderer = TCOD_RENDERER_OPENGL; + TCOD_ctx.renderer = TCOD_RENDERER_OPENGL; } } @@ -217,7 +217,7 @@ bool TCOD_opengl_init_state(int conw, int conh, void *font) { glUniform1fARB=(PFNGLUNIFORM1FARBPROC)SDL_GL_GetProcAddress("glUniform1fARB"); glUniform1iARB=(PFNGLUNIFORM1IARBPROC)SDL_GL_GetProcAddress("glUniform1iARB"); glActiveTextureF=(PFNGLACTIVETEXTUREPROC)SDL_GL_GetProcAddress("glActiveTexture"); - + /* set opengl state */ glEnable(GL_TEXTURE_2D); glClearColor(1.0f, 1.0f, 0.0f, 0.0f); @@ -227,11 +227,11 @@ bool TCOD_opengl_init_state(int conw, int conh, void *font) { glLoadIdentity(); if ( TCOD_ctx.renderer == TCOD_RENDERER_GLSL ) { glOrtho(0, conw, 0, conh, -1.0f, 1.0f); - glDisable (GL_BLEND); + glDisable (GL_BLEND); } else { glOrtho(0, conw, conh, 0.0f, -1.0f, 1.0f); - glEnable (GL_BLEND); - glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable (GL_BLEND); + glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); } glMatrixMode( GL_MODELVIEW ); @@ -411,7 +411,7 @@ bool TCOD_opengl_init_shaders(void) { CHECKGL(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, POTconwidth, POTconheight, 0, GL_RGB, GL_UNSIGNED_BYTE, 0)); CHECKGL(glBindTexture(GL_TEXTURE_2D, 0)); - + return true; } @@ -491,7 +491,7 @@ bool TCOD_opengl_render( int oldFade, bool *ascii_updated, TCOD_console_data_t * } } if ( changed ) { - TCOD_opengl_putchar_ex(x, y, TCOD_ctx.ascii_to_tcod[*c], *nfg, *nbg); + TCOD_opengl_putchar_ex(x, y, TCOD_get_tileid_for_charcode_(*c), *nfg, *nbg); } c++; nfg++; @@ -534,7 +534,7 @@ bool TCOD_opengl_render( int oldFade, bool *ascii_updated, TCOD_console_data_t * glEnd()); /* draw the characters (one quad per cell) */ DBGCHECKGL(glBindTexture(GL_TEXTURE_2D, font_tex)); - + c = console->ch_array; nfg = TCOD_image_get_colors(console->fg_colors); nbg = TCOD_image_get_colors(console->bg_colors); @@ -579,7 +579,7 @@ bool TCOD_opengl_render( int oldFade, bool *ascii_updated, TCOD_console_data_t * } else { /* actual rendering */ DBGCHECKGL(glUseProgramObjectARB(conProgram)); - + /* Technically all these glUniform calls can be moved to SFConsole() when the shader is loaded */ /* None of these change */ /* The Textures still need to bind to the same # Activetexture throughout though */ @@ -588,25 +588,25 @@ bool TCOD_opengl_render( int oldFade, bool *ascii_updated, TCOD_console_data_t * DBGCHECKGL(glUniform1fARB(glGetUniformLocationARB(conProgram,"fontw"), (float)TCOD_ctx.fontNbCharHoriz)); DBGCHECKGL(glUniform2fARB(glGetUniformLocationARB(conProgram,"fontcoef"), (float)(fontwidth)/(POTfontwidth*TCOD_ctx.fontNbCharHoriz), (float)(fontheight)/(POTfontheight*TCOD_ctx.fontNbCharVertic))); - + DBGCHECKGL(glActiveTextureF(GL_TEXTURE0)); DBGCHECKGL(glBindTexture(GL_TEXTURE_2D, font_tex)); DBGCHECKGL(glUniform1iARB(glGetUniformLocationARB(conProgram,"font"),0)); - + DBGCHECKGL(glActiveTextureF(GL_TEXTURE1)); DBGCHECKGL(glBindTexture(GL_TEXTURE_2D, Tex[Character])); DBGCHECKGL(glUniform1iARB(glGetUniformLocationARB(conProgram,"term"),1)); - + DBGCHECKGL(glActiveTextureF(GL_TEXTURE2)); DBGCHECKGL(glBindTexture(GL_TEXTURE_2D, Tex[ForeCol])); DBGCHECKGL(glUniform1iARB(glGetUniformLocationARB(conProgram,"termfcol"),2)); - + DBGCHECKGL(glActiveTextureF(GL_TEXTURE3)); DBGCHECKGL(glBindTexture(GL_TEXTURE_2D, Tex[BackCol])); DBGCHECKGL(glUniform1iARB(glGetUniformLocationARB(conProgram,"termbcol"),3)); - + /* DBGCHECKGL(shader->Validate()); */ - + DBGCHECKGL(glBegin(GL_QUADS); glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f,-1.0f,0.0f); @@ -617,9 +617,9 @@ bool TCOD_opengl_render( int oldFade, bool *ascii_updated, TCOD_console_data_t * glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,1.0f,0.0f); glEnd()); - + DBGCHECKGL(glBindTexture(GL_TEXTURE_2D, 0)); - + DBGCHECKGL(glUseProgramObjectARB(0)); } /* fading overlay */ @@ -664,7 +664,7 @@ void * TCOD_opengl_get_screen(void) { glPixelStorei(GL_PACK_ALIGNMENT, 1); glReadPixels(offx,offy,pixw,pixh, GL_RGB, GL_UNSIGNED_BYTE, surf->pixels); glPopClientAttrib(); - + /* vertical flip (opengl has lower-left origin, SDL upper left) */ mask=surf->format->Rmask|surf->format->Gmask|surf->format->Bmask; nmask=~mask; @@ -685,4 +685,4 @@ void * TCOD_opengl_get_screen(void) { #endif /* NO_OPENGL */ -#endif /* TCOD_SDL2 */ +#endif /* TCOD_BARE */ diff --git a/tcod_sys/libtcod/src/sys_sdl2_c.c b/tcod_sys/libtcod/src/sys_sdl2_c.c index 454a8e849..77e5a39f3 100644 --- a/tcod_sys/libtcod/src/sys_sdl2_c.c +++ b/tcod_sys/libtcod/src/sys_sdl2_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,13 +25,15 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE #include #include #include +#include + #include #include #include @@ -190,7 +193,7 @@ static void render(TCOD_SDL_driver_t *sdl, void *vbitmap, TCOD_console_data_t *c else { TCOD_opengl_render(oldFade, NULL, console, ensure_cache(console)); TCOD_opengl_swap(); - } + } #endif oldFade=(int)TCOD_console_get_fade(); } @@ -246,7 +249,7 @@ static void create_window(int w, int h, bool fullscreen) { #endif if ( fullscreen ) { find_resolution(); -#ifndef NO_OPENGL +#ifndef NO_OPENGL if (TCOD_ctx.renderer != TCOD_RENDERER_SDL ) { TCOD_opengl_init_attributes(); winflags |= SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS | SDL_WINDOW_OPENGL; @@ -260,21 +263,21 @@ static void create_window(int w, int h, bool fullscreen) { TCOD_LOG(("Fallback to SDL renderer...\n")); TCOD_ctx.renderer = TCOD_RENDERER_SDL; } - } -#endif + } +#endif if (TCOD_ctx.renderer == TCOD_RENDERER_SDL ) { winflags |= SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS; # if defined(TCOD_ANDROID) && defined(FUTURE_SUPPORT) winflags |= SDL_WINDOW_RESIZABLE; # endif window = SDL_CreateWindow(TCOD_ctx.window_title,SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, TCOD_ctx.actual_fullscreen_width,TCOD_ctx.actual_fullscreen_height,winflags); - if ( window == NULL ) TCOD_fatal_nopar("SDL : cannot set fullscreen video mode"); + if ( window == NULL ) TCOD_fatal("SDL : cannot set fullscreen video mode: %s", SDL_GetError()); } SDL_ShowCursor(0); SDL_GetWindowSize(window,&TCOD_ctx.actual_fullscreen_width,&TCOD_ctx.actual_fullscreen_height); TCOD_sys_init_screen_offset(); } else { -#ifndef NO_OPENGL +#ifndef NO_OPENGL if (TCOD_ctx.renderer != TCOD_RENDERER_SDL ) { TCOD_opengl_init_attributes(); winflags |= SDL_WINDOW_OPENGL; @@ -285,23 +288,23 @@ static void create_window(int w, int h, bool fullscreen) { TCOD_LOG(("Fallback to SDL renderer...\n")); TCOD_ctx.renderer = TCOD_RENDERER_SDL; } - } -#endif + } +#endif if (TCOD_ctx.renderer == TCOD_RENDERER_SDL ) { window = SDL_CreateWindow(TCOD_ctx.window_title,SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,w*TCOD_ctx.font_width,h*TCOD_ctx.font_height,winflags); - SDL_PumpEvents(); - SDL_SetWindowSize(window,w*TCOD_ctx.font_width,h*TCOD_ctx.font_height); TCOD_LOG(("Using SDL renderer...\n")); } - if ( window == NULL ) TCOD_fatal_nopar("SDL : cannot create window"); + if ( window == NULL ) TCOD_fatal("Cannot create SDL window: %s", SDL_GetError()); + } + if (TCOD_ctx.renderer == TCOD_RENDERER_SDL ) { + renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); + if ( renderer == NULL ) TCOD_fatal("Cannot create SDL renderer: %s", SDL_GetError()); + SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); } - renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); - if ( renderer == NULL ) TCOD_fatal_nopar("SDL : cannot create renderer"); - SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); } static void destroy_window(void) { -#ifndef NO_OPENGL +#ifndef NO_OPENGL if (TCOD_ctx.renderer == TCOD_RENDERER_OPENGL || TCOD_ctx.renderer == TCOD_RENDERER_GLSL) { TCOD_opengl_uninit_state(); } @@ -321,7 +324,7 @@ static void destroy_window(void) { } static void set_fullscreen(bool fullscreen) { - bool mouseOn=SDL_ShowCursor(-1); + bool mouseOn=SDL_ShowCursor(-1); if ( fullscreen ) { find_resolution(); SDL_SetWindowFullscreen(window, fullscreen); @@ -379,12 +382,12 @@ static void save_screenshot(const char *filename) { SDL_DestroyTexture(texture); } else TCOD_LOG(("TCOD_sys_save_screenshot - failed call to SDL_CreateTexture")); -#ifndef NO_OPENGL +#ifndef NO_OPENGL } else { SDL_Surface *screenshot=(SDL_Surface *)TCOD_opengl_get_screen(); TCOD_sys_save_bitmap((void *)screenshot,filename); SDL_FreeSurface(screenshot); -#endif +#endif } } /* get desktop resolution */ @@ -453,7 +456,7 @@ static bool file_read(const char *filename, unsigned char **buf, size_t *size) { if (!rwops) return false; SDL_RWseek(rwops,0,RW_SEEK_END); filesize=SDL_RWtell(rwops); - SDL_RWseek(rwops,0,RW_SEEK_SET); + SDL_RWseek(rwops,0,RW_SEEK_SET); /* allocate buffer */ *buf = (unsigned char *)malloc(sizeof(unsigned char)*filesize); /* read from file */ @@ -485,7 +488,7 @@ static bool file_write(const char *filename, unsigned char *buf, uint32_t size) return true; } -static void shutdown(void) { +static void shutdown_(void) { if (last_clipboard_text) { SDL_free(last_clipboard_text); last_clipboard_text = NULL; @@ -516,9 +519,9 @@ TCOD_SDL_driver_t *SDL_implementation_factory(void) { ret->file_read = file_read; ret->file_exists = file_exists; ret->file_write = file_write; - ret->shutdown = shutdown; + ret->shutdown = shutdown_; ret->get_root_console_cache = get_root_console_cache; return ret; } -#endif /* TCOD_SDL2 */ +#endif /* TCOD_BARE */ diff --git a/tcod_sys/libtcod/src/sys_sdl_c.c b/tcod_sys/libtcod/src/sys_sdl_c.c index 3efa70297..b39d7665e 100644 --- a/tcod_sys/libtcod/src/sys_sdl_c.c +++ b/tcod_sys/libtcod/src/sys_sdl_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE #include #include @@ -33,6 +34,8 @@ #include #include +#include + #include #include #include @@ -179,6 +182,22 @@ static void alloc_ascii_tables(void) { first_draw =(bool *)calloc(sizeof(bool),TCOD_ctx.max_font_chars); memcpy(TCOD_ctx.ascii_to_tcod,init_ascii_to_tcod,sizeof(int)*256); } +/** Reallocate the TCOD_ctx.ascii_to_tcod array, usually to make it bigger. + */ +static int realloc_ascii_tables(int new_size) { + int *new_table = realloc(TCOD_ctx.ascii_to_tcod, sizeof(int) * new_size); + int i; + if (!new_table) { + return -1; /* failed to realloc table (old table pointer is still good) */ + } + /* any new array indexes are undefined and need to be filled with zeros */ + for (i = TCOD_ctx.max_font_chars; i < new_size; ++i) { + new_table[i] = 0; + } + TCOD_ctx.ascii_to_tcod = new_table; + TCOD_ctx.max_font_chars = new_size; + return 0; +} static void check_ascii_to_tcod(void) { if ( TCOD_ctx.fontNbCharHoriz * TCOD_ctx.fontNbCharVertic != TCOD_ctx.max_font_chars ) { @@ -190,10 +209,17 @@ static void check_ascii_to_tcod(void) { void TCOD_sys_register_SDL_renderer(SDL_renderer_t renderer) { TCOD_ctx.sdl_cbk=renderer; } - +/** See TCOD_console_map_ascii_code_to_font */ void TCOD_sys_map_ascii_to_font(int asciiCode, int fontCharX, int fontCharY) { - if ( asciiCode > 0 && asciiCode < TCOD_ctx.max_font_chars ) - TCOD_ctx.ascii_to_tcod[asciiCode] = fontCharX + fontCharY * TCOD_ctx.fontNbCharHoriz; + if (asciiCode <= 0) { return; } /* can't reassign 0 or negatives */ + if (asciiCode >= TCOD_ctx.max_font_chars) { + /* reduce total allocations by resizing in increments of 256 */ + if (realloc_ascii_tables((asciiCode & 0xff) + 1)) { + return; /* Failed to realloc table (old table pointer is still good) */ + } + } + TCOD_ctx.ascii_to_tcod[asciiCode] = + fontCharX + fontCharY * TCOD_ctx.fontNbCharHoriz; } void TCOD_sys_load_font(void) { @@ -216,7 +242,7 @@ void TCOD_sys_load_font(void) { /* figure out what kind of font we have */ /* check if the alpha layer is actually used */ if ( charmap->format->BytesPerPixel == 4 ) { - printf ("32bits font... checking for alpha layer... "); + TCOD_LOG(("32bits font... checking for alpha layer... ")); for (x=0; !hasTransparent && x < charmap->w; x ++ ) { for (y=0;!hasTransparent && y < charmap->h; y++ ) { uint8_t*pixel=(uint8_t*)(charmap->pixels) + y * charmap->pitch + x * charmap->format->BytesPerPixel; @@ -226,17 +252,17 @@ void TCOD_sys_load_font(void) { } } } - printf (hasTransparent ? "present\n" : "not present\n"); + TCOD_LOG((hasTransparent ? "present\n" : "not present\n")); } else if ( charmap->format->BytesPerPixel != 3 ) { /* convert to 24 bits */ SDL_Surface *temp; - printf ("font bpp < 24. converting to 24bits\n"); + TCOD_LOG(("font bpp < 24. converting to 24bits\n")); temp=(SDL_Surface *)TCOD_sys_get_surface(charmap->w,charmap->h,false); SDL_BlitSurface(charmap,NULL,temp,NULL); SDL_FreeSurface(charmap); charmap=temp; } else { - printf ("24 bits font.\n"); + TCOD_LOG(("24 bits font.\n")); } if (! hasTransparent ) { /* alpha layer not used */ @@ -257,11 +283,11 @@ void TCOD_sys_load_font(void) { fontKeyCol.r=*((pixel)+charmap->format->Rshift/8); fontKeyCol.g=*((pixel)+charmap->format->Gshift/8); fontKeyCol.b=*((pixel)+charmap->format->Bshift/8); - printf ("key color : %d %d %d\n",fontKeyCol.r,fontKeyCol.g,fontKeyCol.b); + TCOD_LOG(("key color : %d %d %d\n",fontKeyCol.r,fontKeyCol.g,fontKeyCol.b)); if ( ! TCOD_ctx.font_greyscale && charmap->format->BytesPerPixel == 4 ) { /* 32 bits font but alpha layer not used. convert to 24 bits (faster) */ SDL_Surface *temp; - printf ("32bits font with no alpha => converting to faster 24 bits\n"); + TCOD_LOG(("32bits font with no alpha => converting to faster 24 bits\n")); temp=(SDL_Surface *)TCOD_sys_get_surface(charmap->w,charmap->h,false); SDL_BlitSurface(charmap,NULL,temp,NULL); SDL_FreeSurface(charmap); @@ -276,7 +302,7 @@ void TCOD_sys_load_font(void) { cy=(i/TCOD_ctx.fontNbCharHoriz); for( px=0; !end && px < TCOD_ctx.font_width; px++ ) { for (py=0; !end && py < TCOD_ctx.font_height; py++ ) { - uint8_t*pixel=(uint8_t*)(charmap->pixels) + (cy*TCOD_ctx.font_height+py) * charmap->pitch + uint8_t*pixel=(uint8_t*)(charmap->pixels) + (cy*TCOD_ctx.font_height+py) * charmap->pitch + (cx*TCOD_ctx.font_width+px) * charmap->format->BytesPerPixel; uint8_t r=*((pixel)+charmap->format->Rshift/8); uint8_t g=*((pixel)+charmap->format->Gshift/8); @@ -288,19 +314,19 @@ void TCOD_sys_load_font(void) { /* colored tile if a pixel is not desaturated */ if ( r != g || g !=b || b != r ) { TCOD_ctx.colored[i]=true; - printf ("character for ascii code %d is colored\n",i); + TCOD_LOG(("character for ascii code %d is colored\n",i)); end=true; } } } - } + } /* convert 24/32 bits greyscale to 32bits font with alpha layer */ if ( ! hasTransparent && TCOD_ctx.font_greyscale ) { bool invert=( fontKeyCol.r > 128 ); /* black on white font ? */ /* convert the surface to 32 bits if needed */ if ( charmap->format->BytesPerPixel != 4 ) { SDL_Surface *temp; - printf("24bits greyscale font. converting to 32bits\n"); + TCOD_LOG(("24bits greyscale font. converting to 32bits\n")); temp=(SDL_Surface *)TCOD_sys_get_surface(charmap->w,charmap->h,true); SDL_BlitSurface(charmap,NULL,temp,NULL); SDL_FreeSurface(charmap); @@ -309,7 +335,7 @@ void TCOD_sys_load_font(void) { for (i=0; i < TCOD_ctx.fontNbCharHoriz*TCOD_ctx.fontNbCharVertic; i++ ) { int cx,cy; cx=(i%TCOD_ctx.fontNbCharHoriz); - cy=(i/TCOD_ctx.fontNbCharHoriz); + cy=(i/TCOD_ctx.fontNbCharHoriz); /* fill the surface with white (except colored tiles), use alpha layer for characters */ for (x=cx*TCOD_ctx.font_width; x < (cx+1)*TCOD_ctx.font_width; x ++ ) { for (y=cy*TCOD_ctx.font_height;y < (cy+1)*TCOD_ctx.font_height; y++ ) { @@ -328,7 +354,7 @@ void TCOD_sys_load_font(void) { if ( r == fontKeyCol.r && g == fontKeyCol.g && b == fontKeyCol.b ) { *((pixel)+charmap->format->Ashift/8) = 0; } else { - *((pixel)+charmap->format->Ashift/8) = 255; + *((pixel)+charmap->format->Ashift/8) = 255; } } } @@ -468,7 +494,7 @@ void TCOD_sys_console_to_bitmap(void *vbitmap, SDL_FillRect(bitmap,&dstRect,sdl_back); if ( *c != ' ' ) { /* draw foreground */ - int ascii = TCOD_ctx.ascii_to_tcod[*c]; + int ascii = TCOD_get_tileid_for_charcode_(*c); TCOD_color_t *curtext = &charcols[ascii]; bool first = first_draw[ascii]; TCOD_color_t f=*nfg; @@ -536,7 +562,7 @@ void TCOD_sys_console_to_bitmap(void *vbitmap, } h--; pix += hdelta; - pixorig += hdelta_backup; + pixorig += hdelta_backup; } } } else { @@ -572,7 +598,7 @@ void TCOD_sys_console_to_bitmap(void *vbitmap, g = g * f.g / 255; b = b * f.b / 255; /* set the new color */ - (*pix) |= (r<format->Rshift)|(g<format->Gshift)|(b<format->Bshift); + (*pix) |= (r<format->Rshift)|(g<format->Gshift)|(b<format->Bshift); } w--; pix = (uint32_t *) (((uint8_t*)pix)+3); @@ -678,8 +704,8 @@ void TCOD_sys_shutdown(void) { } static void TCOD_sys_load_player_config(void) { - const char *renderer; - const char *font; + const char *renderer; + const char *font; int fullscreenWidth,fullscreenHeight; /* define file structure */ @@ -782,30 +808,48 @@ void TCOD_sys_uninit(void) { sdl->destroy_window(); } +static char *TCOD_strcasestr (const char *haystack, const char *needle) { + const char *p, *startn = 0, *np = 0; + + for (p = haystack; *p; p++) { + if (np) { + if (toupper(*p) == toupper(*np)) { + if (!*++np) + return (char *)startn; + } else + np = 0; + } else if (toupper(*p) == toupper(*needle)) { + np = needle + 1; + startn = p; + } + } + + return 0; +} + void TCOD_sys_save_bitmap(void *bitmap, const char *filename) { image_support_t *img=image_type; - while ( img->extension != NULL && strcasestr(filename,img->extension) == NULL ) img++; + while ( img->extension != NULL && TCOD_strcasestr(filename,img->extension) == NULL ) img++; if ( img->extension == NULL || img->write == NULL ) img=image_type; /* default to bmp */ img->write((SDL_Surface *)bitmap,filename); } void TCOD_sys_save_screenshot(const char *filename) { - char buf[128]; - if ( filename == NULL ) { - /* generate filename */ - int idx=0; - do { - FILE *f=NULL; - sprintf(buf,"./screenshot%03d.png",idx); - f=fopen(buf,"rb"); - if ( ! f ) filename=buf; - else { - idx++; - fclose(f); - } - } while(!filename); - } - sdl->save_screenshot(filename); + char buf[128]; + int idx = 0; + while (!filename) { + /* generate filename */ + FILE *access_file = NULL; + sprintf(buf, "./screenshot%03d.png", idx); + access_file = fopen(buf, "rb"); + if (!access_file) { + filename = buf; + } else { + idx++; + fclose(access_file); + } + } + sdl->save_screenshot(filename); } void TCOD_sys_set_fullscreen(bool fullscreen) { @@ -1077,21 +1121,21 @@ static TCOD_event_t TCOD_sys_handle_event(SDL_Event *ev,TCOD_event_t eventMask, key->text[0] = '\0'; /* printf("TCOD_sys_handle_event type=%04x\n", ev->type); */ switch(ev->type) { - case SDL_KEYDOWN : { + case SDL_KEYDOWN : { TCOD_key_t tmpKey=TCOD_sys_SDLtoTCOD(ev,TCOD_KEY_PRESSED); if ( (TCOD_EVENT_KEY_PRESS & eventMask) != 0) { - retMask|=TCOD_EVENT_KEY_PRESS; - if ( key ) *key = tmpKey; - return retMask; + retMask|=TCOD_EVENT_KEY_PRESS; + if ( key ) *key = tmpKey; + return retMask; } } break; - case SDL_KEYUP : { + case SDL_KEYUP : { TCOD_key_t tmpKey=TCOD_sys_SDLtoTCOD(ev,TCOD_KEY_RELEASED); if ( (TCOD_EVENT_KEY_RELEASE & eventMask) != 0) { - retMask|=TCOD_EVENT_KEY_RELEASE; + retMask|=TCOD_EVENT_KEY_RELEASE; if ( key ) *key = tmpKey; - return retMask; + return retMask; } } break; @@ -1099,9 +1143,10 @@ static TCOD_event_t TCOD_sys_handle_event(SDL_Event *ev,TCOD_event_t eventMask, SDL_TextInputEvent *iev=&ev->text; *key = TCOD_ctx.key_state; key->vk = TCODK_TEXT; + key->c = 0; key->pressed = 1; strncpy(key->text, iev->text, TCOD_KEY_TEXT_SIZE); - return retMask | TCOD_EVENT_KEY_PRESS; + return retMask | TCOD_EVENT_KEY_PRESS; } break; #ifdef TCOD_TOUCH_INPUT @@ -1265,7 +1310,7 @@ static TCOD_event_t TCOD_sys_handle_event(SDL_Event *ev,TCOD_event_t eventMask, break; } #endif - case SDL_MOUSEMOTION : + case SDL_MOUSEMOTION : if ( (TCOD_EVENT_MOUSE_MOVE & eventMask) != 0) { SDL_MouseMotionEvent *mev=&ev->motion; TCOD_sys_unproject_screen_coords(mev->x, mev->y, &mouse->x, &mouse->y); @@ -1280,7 +1325,7 @@ static TCOD_event_t TCOD_sys_handle_event(SDL_Event *ev,TCOD_event_t eventMask, return retMask | TCOD_EVENT_MOUSE_MOVE; } - break; + break; case SDL_MOUSEWHEEL : if (ev->wheel.y < 0) mouse->wheel_down=true; @@ -1288,7 +1333,7 @@ static TCOD_event_t TCOD_sys_handle_event(SDL_Event *ev,TCOD_event_t eventMask, mouse->wheel_up=true; return retMask | TCOD_EVENT_MOUSE_PRESS; break; - case SDL_MOUSEBUTTONDOWN : + case SDL_MOUSEBUTTONDOWN : if ( (TCOD_EVENT_MOUSE_PRESS & eventMask) != 0) { SDL_MouseButtonEvent *mev=&ev->button; retMask|=TCOD_EVENT_MOUSE_PRESS; @@ -1306,8 +1351,8 @@ static TCOD_event_t TCOD_sys_handle_event(SDL_Event *ev,TCOD_event_t eventMask, } return retMask; } - break; - case SDL_MOUSEBUTTONUP : + break; + case SDL_MOUSEBUTTONUP : if ( (TCOD_EVENT_MOUSE_RELEASE & eventMask) != 0) { SDL_MouseButtonEvent *mev=&ev->button; retMask|=TCOD_EVENT_MOUSE_RELEASE; @@ -1322,7 +1367,7 @@ static TCOD_event_t TCOD_sys_handle_event(SDL_Event *ev,TCOD_event_t eventMask, mouse->y=mev->y; mouse->cx = (mouse->x - TCOD_ctx.fullscreen_offsetx) / TCOD_ctx.font_width; mouse->cy = (mouse->y - TCOD_ctx.fullscreen_offsety) / TCOD_ctx.font_height; - } + } return retMask; } break; @@ -1347,9 +1392,9 @@ static TCOD_event_t TCOD_sys_handle_event(SDL_Event *ev,TCOD_event_t eventMask, TCOD_ctx.app_has_mouse_focus=true; break; case SDL_WINDOWEVENT_LEAVE: /**< Window has lost mouse focus */ TCOD_ctx.app_has_mouse_focus=false; break; - case SDL_WINDOWEVENT_MAXIMIZED: /**< Window has been maximized */ + case SDL_WINDOWEVENT_FOCUS_GAINED: TCOD_ctx.app_is_active=true; break; - case SDL_WINDOWEVENT_MINIMIZED: /**< Window has been minimized */ + case SDL_WINDOWEVENT_FOCUS_LOST: TCOD_ctx.app_is_active=false; break; case SDL_WINDOWEVENT_EXPOSED: /**< Window has been returned to and needs a refresh. */ TCOD_sys_render(NULL, TCOD_ctx.root); @@ -1361,7 +1406,7 @@ static TCOD_event_t TCOD_sys_handle_event(SDL_Event *ev,TCOD_event_t eventMask, #endif } break; - default : break; + default : break; } return retMask; } @@ -1385,7 +1430,7 @@ TCOD_event_t TCOD_sys_wait_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse_ if ( key ) { key->vk=TCODK_NONE; key->c=0; - } + } do { SDL_WaitEvent(&ev); retMask=TCOD_sys_handle_event(&ev,eventMask,key,&tcod_mouse); @@ -1412,8 +1457,8 @@ TCOD_event_t TCOD_sys_check_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse while ( SDL_PollEvent(&ev) ) { retMask=TCOD_sys_handle_event(&ev,eventMask,key,&tcod_mouse); if ((retMask & TCOD_EVENT_KEY) != 0) - /* only one key event per frame */ - break; + /* only one key event per frame */ + break; } if (mouse) { *mouse=tcod_mouse; } return retMask; @@ -1425,7 +1470,13 @@ TCOD_mouse_t TCOD_mouse_get_status(void) { /* classic keyboard functions (based on generic events) */ - +/** + * Return immediately with a recently pressed key. + * + * \param flags A TCOD_event_t bit-field, for example: `TCOD_EVENT_KEY_PRESS` + * \return A TCOD_key_t struct with a recently pressed key. + * If no event exists then the `vk` attribute will be `TCODK_NONE` + */ TCOD_key_t TCOD_sys_check_for_keypress(int flags) { static TCOD_key_t noret={TCODK_NONE,0}; @@ -1436,7 +1487,13 @@ TCOD_key_t TCOD_sys_check_for_keypress(int flags) { return key; } - +/** + * Wait for a key press event, then return it. + * + * \param flush If 1 then the event queue will be cleared before waiting for + * the next event. This should always be 0. + * \return A TCOD_key_t struct with the most recent key data. + */ TCOD_key_t TCOD_sys_wait_for_keypress(bool flush) { static TCOD_key_t noret={TCODK_NONE,0}; @@ -1699,4 +1756,13 @@ void TCOD_sys_set_dirty_character_code(int ch) { } } } -#endif /* TCOD_SDL2 */ \ No newline at end of file +/** + * Return the current tile index for a given character code. + */ +int TCOD_get_tileid_for_charcode_(int charcode) { + if (charcode >= 0 && charcode < TCOD_ctx.max_font_chars) { + return TCOD_ctx.ascii_to_tcod[charcode]; + } + return 0; +} +#endif /* TCOD_BARE */ diff --git a/tcod_sys/libtcod/src/sys_sdl_img_bmp.c b/tcod_sys/libtcod/src/sys_sdl_img_bmp.c index 0c2ccb25a..8256d1bb3 100644 --- a/tcod_sys/libtcod/src/sys_sdl_img_bmp.c +++ b/tcod_sys/libtcod/src/sys_sdl_img_bmp.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE #include @@ -66,4 +67,4 @@ void TCOD_sys_write_bmp(const SDL_Surface *surf, const char *filename) { SDL_SaveBMP((SDL_Surface *)surf,filename); } -#endif /* TCOD_SDL2 */ +#endif /* TCOD_BARE */ diff --git a/tcod_sys/libtcod/src/sys_sdl_img_png.c b/tcod_sys/libtcod/src/sys_sdl_img_png.c index 3aa997975..51a4a6886 100644 --- a/tcod_sys/libtcod/src/sys_sdl_img_png.c +++ b/tcod_sys/libtcod/src/sys_sdl_img_png.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE #include @@ -64,7 +65,7 @@ SDL_Surface *TCOD_sys_read_png(const char *filename) { if ( bpp == 24 ) { /* don't convert to 32 bits because libtcod's 24bits renderer is faster */ state.info_raw.colortype=LCT_RGB; - } else if ( bpp != 24 && bpp != 32 ) { + } else if ( bpp != 24 && bpp != 32 ) { /* paletted png. convert to 24 bits */ state.info_raw.colortype=LCT_RGB; state.info_raw.bitdepth=8; @@ -77,7 +78,7 @@ SDL_Surface *TCOD_sys_read_png(const char *filename) { lodepng_state_cleanup(&state); return NULL; } - + /* create the SDL surface */ bitmap=TCOD_sys_get_surface(width,height,bpp==32); source=image; @@ -89,7 +90,7 @@ SDL_Surface *TCOD_sys_read_png(const char *filename) { } lodepng_state_cleanup(&state); - free(image); + free(image); return bitmap; } @@ -119,4 +120,4 @@ void TCOD_sys_write_png(const SDL_Surface *surf, const char *filename) { } } -#endif /* TCOD_SDL2 */ +#endif /* TCOD_BARE */ diff --git a/tcod_sys/libtcod/src/tree_c.c b/tcod_sys/libtcod/src/tree_c.c index 4a9cfc167..c8bf96e59 100644 --- a/tcod_sys/libtcod/src/tree_c.c +++ b/tcod_sys/libtcod/src/tree_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/src/txtfield.cpp b/tcod_sys/libtcod/src/txtfield.cpp index d97c4417e..a2966b86e 100644 --- a/tcod_sys/libtcod/src/txtfield.cpp +++ b/tcod_sys/libtcod/src/txtfield.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -24,7 +25,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #include #ifdef TCOD_CONSOLE_SUPPORT @@ -46,7 +46,7 @@ void TCODText::setPos(int x, int y) { } void TCODText::setProperties(int cursor_char, int blink_interval, const char * prompt, int tab_size){ - TCOD_text_set_properties(data,cursor_char,blink_interval,prompt,tab_size); + TCOD_text_set_properties(data,cursor_char,blink_interval,prompt,tab_size); } void TCODText::setColors(TCODColor fore, TCODColor back, float back_transparency){ @@ -63,7 +63,7 @@ void TCODText::render(TCODConsole * con){ TCOD_text_render(data,con->data); } -const char *TCODText::getText(){ +const char *TCODText::getText(){ return TCOD_text_get(data); } diff --git a/tcod_sys/libtcod/src/txtfield_c.c b/tcod_sys/libtcod/src/txtfield_c.c index b31de67fd..3af7708f0 100644 --- a/tcod_sys/libtcod/src/txtfield_c.c +++ b/tcod_sys/libtcod/src/txtfield_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -133,7 +134,7 @@ TCOD_text_t TCOD_text_init2(int w, int h, int max_chars) { void TCOD_text_set_pos(TCOD_text_t txt, int x, int y) { text_t * data = (text_t*)txt; data->x=x; - data->y=y; + data->y=y; } /* set cursor and prompt */ @@ -330,7 +331,7 @@ static void selectEnd(text_t *data, int oldpos, TCOD_key_t key) { } enum { TYPE_SYMBOL, TYPE_ALPHANUM, TYPE_SPACE }; -static const char symbols[]="&~\"#'{([-|`_\\^@)]=+}*/!:;.,?<>"; +static const char txt_symbols[]="&~\"#'{([-|`_\\^@)]=+}*/!:;.,?<>"; /* check whether a character is a space */ /* this is needed because cctype isspace() returns rubbish for many diacritics */ @@ -344,7 +345,7 @@ static bool is_space (int ch) { } static void typecheck (int * type, int ch) { - if (strchr(symbols,ch)) *type = TYPE_SYMBOL; + if (strchr(txt_symbols,ch)) *type = TYPE_SYMBOL; else if (is_space(ch)) *type = TYPE_SPACE; else *type = TYPE_ALPHANUM; } @@ -685,4 +686,4 @@ void TCOD_text_delete (TCOD_text_t txt) { free(data); } -#endif /* TCOD_CONSOLE_SUPPORT */ \ No newline at end of file +#endif /* TCOD_CONSOLE_SUPPORT */ diff --git a/tcod_sys/libtcod/src/vendor/stb.c b/tcod_sys/libtcod/src/vendor/stb.c new file mode 100644 index 000000000..2d869d998 --- /dev/null +++ b/tcod_sys/libtcod/src/vendor/stb.c @@ -0,0 +1,4 @@ + +#define STB_SPRINTF_IMPLEMENTATION +#include "stb_sprintf.h" +#undef STB_SPRINTF_IMPLEMENTATION diff --git a/tcod_sys/libtcod/src/vendor/stb_sprintf.h b/tcod_sys/libtcod/src/vendor/stb_sprintf.h new file mode 100644 index 000000000..36a3668a2 --- /dev/null +++ b/tcod_sys/libtcod/src/vendor/stb_sprintf.h @@ -0,0 +1,1833 @@ +/* stb_sprintf - v1.05 - public domain snprintf() implementation + originally by Jeff Roberts / RAD Game Tools, 2015/10/20 + http://github.com/nothings/stb + + allowed types: sc uidBboXx p AaGgEef n + lengths : h ll j z t I64 I32 I + + Contributors: + Fabian "ryg" Giesen (reformatting) + + Contributors (bugfixes): + github:d26435 + github:trex78 + Jari Komppa (SI suffixes) + Rohit Nirmal + Marcin Wojdyr + Leonard Ritter + + LICENSE: + + See end of file for license information. */ + +#ifndef STB_SPRINTF_H_INCLUDE +#define STB_SPRINTF_H_INCLUDE + +/* +Single file sprintf replacement. + +Originally written by Jeff Roberts at RAD Game Tools - 2015/10/20. +Hereby placed in public domain. + +This is a full sprintf replacement that supports everything that +the C runtime sprintfs support, including float/double, 64-bit integers, +hex floats, field parameters (%*.*d stuff), length reads backs, etc. + +Why would you need this if sprintf already exists? Well, first off, +it's *much* faster (see below). It's also much smaller than the CRT +versions code-space-wise. We've also added some simple improvements +that are super handy (commas in thousands, callbacks at buffer full, +for example). Finally, the format strings for MSVC and GCC differ +for 64-bit integers (among other small things), so this lets you use +the same format strings in cross platform code. + +It uses the standard single file trick of being both the header file +and the source itself. If you just include it normally, you just get +the header file function definitions. To get the code, you include +it from a C or C++ file and define STB_SPRINTF_IMPLEMENTATION first. + +It only uses va_args macros from the C runtime to do it's work. It +does cast doubles to S64s and shifts and divides U64s, which does +drag in CRT code on most platforms. + +It compiles to roughly 8K with float support, and 4K without. +As a comparison, when using MSVC static libs, calling sprintf drags +in 16K. + +API: +==== +int stbsp_sprintf( char * buf, char const * fmt, ... ) +int stbsp_snprintf( char * buf, int count, char const * fmt, ... ) + Convert an arg list into a buffer. stbsp_snprintf always returns + a zero-terminated string (unlike regular snprintf). + +int stbsp_vsprintf( char * buf, char const * fmt, va_list va ) +int stbsp_vsnprintf( char * buf, int count, char const * fmt, va_list va ) + Convert a va_list arg list into a buffer. stbsp_vsnprintf always returns + a zero-terminated string (unlike regular snprintf). + +int stbsp_vsprintfcb( STBSP_SPRINTFCB * callback, void * user, char * buf, char const * fmt, va_list va ) + typedef char * STBSP_SPRINTFCB( char const * buf, void * user, int len ); + Convert into a buffer, calling back every STB_SPRINTF_MIN chars. + Your callback can then copy the chars out, print them or whatever. + This function is actually the workhorse for everything else. + The buffer you pass in must hold at least STB_SPRINTF_MIN characters. + // you return the next buffer to use or 0 to stop converting + +void stbsp_set_separators( char comma, char period ) + Set the comma and period characters to use. + +FLOATS/DOUBLES: +=============== +This code uses a internal float->ascii conversion method that uses +doubles with error correction (double-doubles, for ~105 bits of +precision). This conversion is round-trip perfect - that is, an atof +of the values output here will give you the bit-exact double back. + +One difference is that our insignificant digits will be different than +with MSVC or GCC (but they don't match each other either). We also +don't attempt to find the minimum length matching float (pre-MSVC15 +doesn't either). + +If you don't need float or doubles at all, define STB_SPRINTF_NOFLOAT +and you'll save 4K of code space. + +64-BIT INTS: +============ +This library also supports 64-bit integers and you can use MSVC style or +GCC style indicators (%I64d or %lld). It supports the C99 specifiers +for size_t and ptr_diff_t (%jd %zd) as well. + +EXTRAS: +======= +Like some GCCs, for integers and floats, you can use a ' (single quote) +specifier and commas will be inserted on the thousands: "%'d" on 12345 +would print 12,345. + +For integers and floats, you can use a "$" specifier and the number +will be converted to float and then divided to get kilo, mega, giga or +tera and then printed, so "%$d" 1000 is "1.0 k", "%$.2d" 2536000 is +"2.53 M", etc. For byte values, use two $:s, like "%$$d" to turn +2536000 to "2.42 Mi". If you prefer JEDEC suffixes to SI ones, use three +$:s: "%$$$d" -> "2.42 M". To remove the space between the number and the +suffix, add "_" specifier: "%_$d" -> "2.53M". + +In addition to octal and hexadecimal conversions, you can print +integers in binary: "%b" for 256 would print 100. + +PERFORMANCE vs MSVC 2008 32-/64-bit (GCC is even slower than MSVC): +=================================================================== +"%d" across all 32-bit ints (4.8x/4.0x faster than 32-/64-bit MSVC) +"%24d" across all 32-bit ints (4.5x/4.2x faster) +"%x" across all 32-bit ints (4.5x/3.8x faster) +"%08x" across all 32-bit ints (4.3x/3.8x faster) +"%f" across e-10 to e+10 floats (7.3x/6.0x faster) +"%e" across e-10 to e+10 floats (8.1x/6.0x faster) +"%g" across e-10 to e+10 floats (10.0x/7.1x faster) +"%f" for values near e-300 (7.9x/6.5x faster) +"%f" for values near e+300 (10.0x/9.1x faster) +"%e" for values near e-300 (10.1x/7.0x faster) +"%e" for values near e+300 (9.2x/6.0x faster) +"%.320f" for values near e-300 (12.6x/11.2x faster) +"%a" for random values (8.6x/4.3x faster) +"%I64d" for 64-bits with 32-bit values (4.8x/3.4x faster) +"%I64d" for 64-bits > 32-bit values (4.9x/5.5x faster) +"%s%s%s" for 64 char strings (7.1x/7.3x faster) +"...512 char string..." ( 35.0x/32.5x faster!) +*/ + +#if defined(__has_feature) + #if __has_feature(address_sanitizer) + #define STBI__ASAN __attribute__((no_sanitize("address"))) + #endif +#endif +#ifndef STBI__ASAN +#define STBI__ASAN +#endif + +#ifdef STB_SPRINTF_STATIC +#define STBSP__PUBLICDEC static +#define STBSP__PUBLICDEF static STBI__ASAN +#else +#ifdef __cplusplus +#define STBSP__PUBLICDEC extern "C" +#define STBSP__PUBLICDEF extern "C" STBI__ASAN +#else +#define STBSP__PUBLICDEC extern +#define STBSP__PUBLICDEF STBI__ASAN +#endif +#endif + +#include /* for va_list() */ + +#ifndef STB_SPRINTF_MIN +#define STB_SPRINTF_MIN 512 /* how many characters per callback */ +#endif +typedef char *STBSP_SPRINTFCB(char *buf, void *user, int len); + +#ifndef STB_SPRINTF_DECORATE +#define STB_SPRINTF_DECORATE(name) stbsp_##name /* define this before including if you want to change the names */ +#endif + +STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(vsprintf)(char *buf, char const *fmt, va_list va); +STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(vsnprintf)(char *buf, int count, char const *fmt, va_list va); +STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(sprintf)(char *buf, char const *fmt, ...); +STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(snprintf)(char *buf, int count, char const *fmt, ...); + +STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(vsprintfcb)(STBSP_SPRINTFCB *callback, void *user, char *buf, char const *fmt, va_list va); +STBSP__PUBLICDEF void STB_SPRINTF_DECORATE(set_separators)(char comma, char period); + +#endif /* STB_SPRINTF_H_INCLUDE */ + +#ifdef STB_SPRINTF_IMPLEMENTATION + +#include /* for va_arg() */ + +#define stbsp__uint32 unsigned int +#define stbsp__int32 signed int + +#ifdef _MSC_VER +#define stbsp__uint64 unsigned __int64 +#define stbsp__int64 signed __int64 +#else +#define stbsp__uint64 unsigned long long +#define stbsp__int64 signed long long +#endif +#define stbsp__uint16 unsigned short + +#ifndef stbsp__uintptr +#if defined(__ppc64__) || defined(__aarch64__) || defined(_M_X64) || defined(__x86_64__) || defined(__x86_64) +#define stbsp__uintptr stbsp__uint64 +#else +#define stbsp__uintptr stbsp__uint32 +#endif +#endif + +#ifndef STB_SPRINTF_MSVC_MODE /* used for MSVC2013 and earlier (MSVC2015 matches GCC) */ +#if defined(_MSC_VER) && (_MSC_VER < 1900) +#define STB_SPRINTF_MSVC_MODE +#endif +#endif + +#ifdef STB_SPRINTF_NOUNALIGNED /* define this before inclusion to force stbsp_sprintf to always use aligned accesses */ +#define STBSP__UNALIGNED(code) +#else +#define STBSP__UNALIGNED(code) code +#endif + +#ifndef STB_SPRINTF_NOFLOAT +/* internal float utility functions */ +static stbsp__int32 stbsp__real_to_str(char const **start, stbsp__uint32 *len, char *out, stbsp__int32 *decimal_pos, double value, stbsp__uint32 frac_digits); +static stbsp__int32 stbsp__real_to_parts(stbsp__int64 *bits, stbsp__int32 *expo, double value); +#define STBSP__SPECIAL 0x7000 +#endif + +static char stbsp__period = '.'; +static char stbsp__comma = ','; +static char stbsp__digitpair[201] = + "0001020304050607080910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576" + "7778798081828384858687888990919293949596979899"; + +STBSP__PUBLICDEF void STB_SPRINTF_DECORATE(set_separators)(char pcomma, char pperiod) +{ + stbsp__period = pperiod; + stbsp__comma = pcomma; +} + +#define STBSP__LEFTJUST 1 +#define STBSP__LEADINGPLUS 2 +#define STBSP__LEADINGSPACE 4 +#define STBSP__LEADING_0X 8 +#define STBSP__LEADINGZERO 16 +#define STBSP__INTMAX 32 +#define STBSP__TRIPLET_COMMA 64 +#define STBSP__NEGATIVE 128 +#define STBSP__METRIC_SUFFIX 256 +#define STBSP__HALFWIDTH 512 +#define STBSP__METRIC_NOSPACE 1024 +#define STBSP__METRIC_1024 2048 +#define STBSP__METRIC_JEDEC 4096 + +static void stbsp__lead_sign(stbsp__uint32 fl, char *sign) +{ + sign[0] = 0; + if (fl & STBSP__NEGATIVE) { + sign[0] = 1; + sign[1] = '-'; + } else if (fl & STBSP__LEADINGSPACE) { + sign[0] = 1; + sign[1] = ' '; + } else if (fl & STBSP__LEADINGPLUS) { + sign[0] = 1; + sign[1] = '+'; + } +} + +STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(vsprintfcb)(STBSP_SPRINTFCB *callback, void *user, char *buf, char const *fmt, va_list va) +{ + static char hex[] = "0123456789abcdefxp"; + static char hexu[] = "0123456789ABCDEFXP"; + char *bf; + char const *f; + int tlen = 0; + + bf = buf; + f = fmt; + for (;;) { + stbsp__int32 fw, pr, tz; + stbsp__uint32 fl; + + /* macros for the callback buffer stuff */ + #define stbsp__chk_cb_bufL(bytes) \ + { \ + int len = (int)(bf - buf); \ + if ((len + (bytes)) >= STB_SPRINTF_MIN) { \ + tlen += len; \ + if (0 == (bf = buf = callback(buf, user, len))) \ + goto done; \ + } \ + } + #define stbsp__chk_cb_buf(bytes) \ + { \ + if (callback) { \ + stbsp__chk_cb_bufL(bytes); \ + } \ + } + #define stbsp__flush_cb() \ + { \ + stbsp__chk_cb_bufL(STB_SPRINTF_MIN - 1); \ + } /* flush if there is even one byte in the buffer */ + #define stbsp__cb_buf_clamp(cl, v) \ + cl = v; \ + if (callback) { \ + int lg = STB_SPRINTF_MIN - (int)(bf - buf); \ + if (cl > lg) \ + cl = lg; \ + } + + /* fast copy everything up to the next % (or end of string) */ + for (;;) { + while (((stbsp__uintptr)f) & 3) { + schk1: + if (f[0] == '%') + goto scandd; + schk2: + if (f[0] == 0) + goto endfmt; + stbsp__chk_cb_buf(1); + *bf++ = f[0]; + ++f; + } + for (;;) { + /* Check if the next 4 bytes contain %(0x25) or end of string. */ + /* Using the 'hasless' trick: */ + /* https://graphics.stanford.edu/~seander/bithacks.html#HasLessInWord */ + stbsp__uint32 v, c; + v = *(stbsp__uint32 *)f; + c = (~v) & 0x80808080; + if (((v ^ 0x25252525) - 0x01010101) & c) + goto schk1; + if ((v - 0x01010101) & c) + goto schk2; + if (callback) + if ((STB_SPRINTF_MIN - (int)(bf - buf)) < 4) + goto schk1; + *(stbsp__uint32 *)bf = v; + bf += 4; + f += 4; + } + } + scandd: + + ++f; + + /* ok, we have a percent, read the modifiers first */ + fw = 0; + pr = -1; + fl = 0; + tz = 0; + + /* flags */ + for (;;) { + switch (f[0]) { + /* if we have left justify */ + case '-': + fl |= STBSP__LEFTJUST; + ++f; + continue; + /* if we have leading plus */ + case '+': + fl |= STBSP__LEADINGPLUS; + ++f; + continue; + /* if we have leading space */ + case ' ': + fl |= STBSP__LEADINGSPACE; + ++f; + continue; + /* if we have leading 0x */ + case '#': + fl |= STBSP__LEADING_0X; + ++f; + continue; + /* if we have thousand commas */ + case '\'': + fl |= STBSP__TRIPLET_COMMA; + ++f; + continue; + /* if we have kilo marker (none->kilo->kibi->jedec) */ + case '$': + if (fl & STBSP__METRIC_SUFFIX) { + if (fl & STBSP__METRIC_1024) { + fl |= STBSP__METRIC_JEDEC; + } else { + fl |= STBSP__METRIC_1024; + } + } else { + fl |= STBSP__METRIC_SUFFIX; + } + ++f; + continue; + /* if we don't want space between metric suffix and number */ + case '_': + fl |= STBSP__METRIC_NOSPACE; + ++f; + continue; + /* if we have leading zero */ + case '0': + fl |= STBSP__LEADINGZERO; + ++f; + goto flags_done; + default: goto flags_done; + } + } + flags_done: + + /* get the field width */ + if (f[0] == '*') { + fw = va_arg(va, stbsp__uint32); + ++f; + } else { + while ((f[0] >= '0') && (f[0] <= '9')) { + fw = fw * 10 + f[0] - '0'; + f++; + } + } + /* get the precision */ + if (f[0] == '.') { + ++f; + if (f[0] == '*') { + pr = va_arg(va, stbsp__uint32); + ++f; + } else { + pr = 0; + while ((f[0] >= '0') && (f[0] <= '9')) { + pr = pr * 10 + f[0] - '0'; + f++; + } + } + } + + /* handle integer size overrides */ + switch (f[0]) { + /* are we halfwidth? */ + case 'h': + fl |= STBSP__HALFWIDTH; + ++f; + break; + /* are we 64-bit (unix style) */ + case 'l': + ++f; + if (f[0] == 'l') { + fl |= STBSP__INTMAX; + ++f; + } + break; + /* are we 64-bit on intmax? (c99) */ + case 'j': + fl |= STBSP__INTMAX; + ++f; + break; + /* are we 64-bit on size_t or ptrdiff_t? (c99) */ + case 'z': + case 't': + fl |= ((sizeof(char *) == 8) ? STBSP__INTMAX : 0); + ++f; + break; + /* are we 64-bit (msft style) */ + case 'I': + if ((f[1] == '6') && (f[2] == '4')) { + fl |= STBSP__INTMAX; + f += 3; + } else if ((f[1] == '3') && (f[2] == '2')) { + f += 3; + } else { + fl |= ((sizeof(void *) == 8) ? STBSP__INTMAX : 0); + ++f; + } + break; + default: break; + } + + /* handle each replacement */ + switch (f[0]) { + #define STBSP__NUMSZ 512 /* big enough for e308 (with commas) or e-307 */ + char num[STBSP__NUMSZ]; + char lead[8]; + char tail[8]; + char *s; + char const *h; + stbsp__uint32 l, n, cs; + stbsp__uint64 n64; +#ifndef STB_SPRINTF_NOFLOAT + double fv; +#endif + stbsp__int32 dp; + char const *sn; + + case 's': + /* get the string */ + s = va_arg(va, char *); + if (s == 0) + s = (char *)"null"; + /* get the length */ + sn = s; + for (;;) { + if ((((stbsp__uintptr)sn) & 3) == 0) + break; + lchk: + if (sn[0] == 0) + goto ld; + ++sn; + } + n = 0xffffffff; + if (pr >= 0) { + n = (stbsp__uint32)(sn - s); + if (n >= (stbsp__uint32)pr) + goto ld; + n = ((stbsp__uint32)(pr - n)) >> 2; + } + while (n) { + stbsp__uint32 v = *(stbsp__uint32 *)sn; + if ((v - 0x01010101) & (~v) & 0x80808080UL) + goto lchk; + sn += 4; + --n; + } + goto lchk; + ld: + + l = (stbsp__uint32)(sn - s); + /* clamp to precision */ + if (l > (stbsp__uint32)pr) + l = pr; + lead[0] = 0; + tail[0] = 0; + pr = 0; + dp = 0; + cs = 0; + /* copy the string in */ + goto scopy; + + case 'c': /* char */ + /* get the character */ + s = num + STBSP__NUMSZ - 1; + *s = (char)va_arg(va, int); + l = 1; + lead[0] = 0; + tail[0] = 0; + pr = 0; + dp = 0; + cs = 0; + goto scopy; + + case 'n': /* weird write-bytes specifier */ + { + int *d = va_arg(va, int *); + *d = tlen + (int)(bf - buf); + } break; + +#ifdef STB_SPRINTF_NOFLOAT + case 'A': /* float */ + case 'a': /* hex float */ + case 'G': /* float */ + case 'g': /* float */ + case 'E': /* float */ + case 'e': /* float */ + case 'f': /* float */ + va_arg(va, double); /* eat it */ + s = (char *)"No float"; + l = 8; + lead[0] = 0; + tail[0] = 0; + pr = 0; + dp = 0; + cs = 0; + goto scopy; +#else + case 'A': /* hex float */ + case 'a': /* hex float */ + h = (f[0] == 'A') ? hexu : hex; + fv = va_arg(va, double); + if (pr == -1) + pr = 6; /* default is 6 */ + /* read the double into a string */ + if (stbsp__real_to_parts((stbsp__int64 *)&n64, &dp, fv)) + fl |= STBSP__NEGATIVE; + + s = num + 64; + + stbsp__lead_sign(fl, lead); + + if (dp == -1023) + dp = (n64) ? -1022 : 0; + else + n64 |= (((stbsp__uint64)1) << 52); + n64 <<= (64 - 56); + if (pr < 15) + n64 += ((((stbsp__uint64)8) << 56) >> (pr * 4)); +/* add leading chars */ + +#ifdef STB_SPRINTF_MSVC_MODE + *s++ = '0'; + *s++ = 'x'; +#else + lead[1 + lead[0]] = '0'; + lead[2 + lead[0]] = 'x'; + lead[0] += 2; +#endif + *s++ = h[(n64 >> 60) & 15]; + n64 <<= 4; + if (pr) + *s++ = stbsp__period; + sn = s; + + /* print the bits */ + n = pr; + if (n > 13) + n = 13; + if (pr > (stbsp__int32)n) + tz = pr - n; + pr = 0; + while (n--) { + *s++ = h[(n64 >> 60) & 15]; + n64 <<= 4; + } + + /* print the expo */ + tail[1] = h[17]; + if (dp < 0) { + tail[2] = '-'; + dp = -dp; + } else + tail[2] = '+'; + n = (dp >= 1000) ? 6 : ((dp >= 100) ? 5 : ((dp >= 10) ? 4 : 3)); + tail[0] = (char)n; + for (;;) { + tail[n] = '0' + dp % 10; + if (n <= 3) + break; + --n; + dp /= 10; + } + + dp = (int)(s - sn); + l = (int)(s - (num + 64)); + s = num + 64; + cs = 1 + (3 << 24); + goto scopy; + + case 'G': /* float */ + case 'g': /* float */ + h = (f[0] == 'G') ? hexu : hex; + fv = va_arg(va, double); + if (pr == -1) + pr = 6; + else if (pr == 0) + pr = 1; /* default is 6 */ + /* read the double into a string */ + if (stbsp__real_to_str(&sn, &l, num, &dp, fv, (pr - 1) | 0x80000000)) + fl |= STBSP__NEGATIVE; + + /* clamp the precision and delete extra zeros after clamp */ + n = pr; + if (l > (stbsp__uint32)pr) + l = pr; + while ((l > 1) && (pr) && (sn[l - 1] == '0')) { + --pr; + --l; + } + + /* should we use %e */ + if ((dp <= -4) || (dp > (stbsp__int32)n)) { + if (pr > (stbsp__int32)l) + pr = l - 1; + else if (pr) + --pr; /* when using %e, there is one digit before the decimal */ + goto doexpfromg; + } + /* this is the insane action to get the pr to match %g sematics for %f */ + if (dp > 0) { + pr = (dp < (stbsp__int32)l) ? l - dp : 0; + } else { + pr = -dp + ((pr > (stbsp__int32)l) ? l : pr); + } + goto dofloatfromg; + + case 'E': /* float */ + case 'e': /* float */ + h = (f[0] == 'E') ? hexu : hex; + fv = va_arg(va, double); + if (pr == -1) + pr = 6; /* default is 6 */ + /* read the double into a string */ + if (stbsp__real_to_str(&sn, &l, num, &dp, fv, pr | 0x80000000)) + fl |= STBSP__NEGATIVE; + doexpfromg: + tail[0] = 0; + stbsp__lead_sign(fl, lead); + if (dp == STBSP__SPECIAL) { + s = (char *)sn; + cs = 0; + pr = 0; + goto scopy; + } + s = num + 64; + /* handle leading chars */ + *s++ = sn[0]; + + if (pr) + *s++ = stbsp__period; + + /* handle after decimal */ + if ((l - 1) > (stbsp__uint32)pr) + l = pr + 1; + for (n = 1; n < l; n++) + *s++ = sn[n]; + /* trailing zeros */ + tz = pr - (l - 1); + pr = 0; + /* dump expo */ + tail[1] = h[0xe]; + dp -= 1; + if (dp < 0) { + tail[2] = '-'; + dp = -dp; + } else + tail[2] = '+'; +#ifdef STB_SPRINTF_MSVC_MODE + n = 5; +#else + n = (dp >= 100) ? 5 : 4; +#endif + tail[0] = (char)n; + for (;;) { + tail[n] = '0' + dp % 10; + if (n <= 3) + break; + --n; + dp /= 10; + } + cs = 1 + (3 << 24); /* how many tens */ + goto flt_lead; + + case 'f': /* float */ + fv = va_arg(va, double); + doafloat: + /* do kilos */ + if (fl & STBSP__METRIC_SUFFIX) { + double divisor; + divisor = 1000.0f; + if (fl & STBSP__METRIC_1024) + divisor = 1024.0; + while (fl < 0x4000000) { + if ((fv < divisor) && (fv > -divisor)) + break; + fv /= divisor; + fl += 0x1000000; + } + } + if (pr == -1) + pr = 6; /* default is 6 */ + /* read the double into a string */ + if (stbsp__real_to_str(&sn, &l, num, &dp, fv, pr)) + fl |= STBSP__NEGATIVE; + dofloatfromg: + tail[0] = 0; + stbsp__lead_sign(fl, lead); + if (dp == STBSP__SPECIAL) { + s = (char *)sn; + cs = 0; + pr = 0; + goto scopy; + } + s = num + 64; + + /* handle the three decimal varieties */ + if (dp <= 0) { + stbsp__int32 i; + /* handle 0.000*000xxxx */ + *s++ = '0'; + if (pr) + *s++ = stbsp__period; + n = -dp; + if ((stbsp__int32)n > pr) + n = pr; + i = n; + while (i) { + if ((((stbsp__uintptr)s) & 3) == 0) + break; + *s++ = '0'; + --i; + } + while (i >= 4) { + *(stbsp__uint32 *)s = 0x30303030; + s += 4; + i -= 4; + } + while (i) { + *s++ = '0'; + --i; + } + if ((stbsp__int32)(l + n) > pr) + l = pr - n; + i = l; + while (i) { + *s++ = *sn++; + --i; + } + tz = pr - (n + l); + cs = 1 + (3 << 24); /* how many tens did we write (for commas below) */ + } else { + cs = (fl & STBSP__TRIPLET_COMMA) ? ((600 - (stbsp__uint32)dp) % 3) : 0; + if ((stbsp__uint32)dp >= l) { + /* handle xxxx000*000.0 */ + n = 0; + for (;;) { + if ((fl & STBSP__TRIPLET_COMMA) && (++cs == 4)) { + cs = 0; + *s++ = stbsp__comma; + } else { + *s++ = sn[n]; + ++n; + if (n >= l) + break; + } + } + if (n < (stbsp__uint32)dp) { + n = dp - n; + if ((fl & STBSP__TRIPLET_COMMA) == 0) { + while (n) { + if ((((stbsp__uintptr)s) & 3) == 0) + break; + *s++ = '0'; + --n; + } + while (n >= 4) { + *(stbsp__uint32 *)s = 0x30303030; + s += 4; + n -= 4; + } + } + while (n) { + if ((fl & STBSP__TRIPLET_COMMA) && (++cs == 4)) { + cs = 0; + *s++ = stbsp__comma; + } else { + *s++ = '0'; + --n; + } + } + } + cs = (int)(s - (num + 64)) + (3 << 24); /* cs is how many tens */ + if (pr) { + *s++ = stbsp__period; + tz = pr; + } + } else { + /* handle xxxxx.xxxx000*000 */ + n = 0; + for (;;) { + if ((fl & STBSP__TRIPLET_COMMA) && (++cs == 4)) { + cs = 0; + *s++ = stbsp__comma; + } else { + *s++ = sn[n]; + ++n; + if (n >= (stbsp__uint32)dp) + break; + } + } + cs = (int)(s - (num + 64)) + (3 << 24); /* cs is how many tens */ + if (pr) + *s++ = stbsp__period; + if ((l - dp) > (stbsp__uint32)pr) + l = pr + dp; + while (n < l) { + *s++ = sn[n]; + ++n; + } + tz = pr - (l - dp); + } + } + pr = 0; + + /* handle k,m,g,t */ + if (fl & STBSP__METRIC_SUFFIX) { + char idx; + idx = 1; + if (fl & STBSP__METRIC_NOSPACE) + idx = 0; + tail[0] = idx; + tail[1] = ' '; + { + if (fl >> 24) { /* SI kilo is 'k', JEDEC and SI kibits are 'K'. */ + if (fl & STBSP__METRIC_1024) + tail[idx + 1] = "_KMGT"[fl >> 24]; + else + tail[idx + 1] = "_kMGT"[fl >> 24]; + idx++; + /* If printing kibits and not in jedec, add the 'i'. */ + if (fl & STBSP__METRIC_1024 && !(fl & STBSP__METRIC_JEDEC)) { + tail[idx + 1] = 'i'; + idx++; + } + tail[0] = idx; + } + } + }; + + flt_lead: + /* get the length that we copied */ + l = (stbsp__uint32)(s - (num + 64)); + s = num + 64; + goto scopy; +#endif + + case 'B': /* upper binary */ + case 'b': /* lower binary */ + h = (f[0] == 'B') ? hexu : hex; + lead[0] = 0; + if (fl & STBSP__LEADING_0X) { + lead[0] = 2; + lead[1] = '0'; + lead[2] = h[0xb]; + } + l = (8 << 4) | (1 << 8); + goto radixnum; + + case 'o': /* octal */ + h = hexu; + lead[0] = 0; + if (fl & STBSP__LEADING_0X) { + lead[0] = 1; + lead[1] = '0'; + } + l = (3 << 4) | (3 << 8); + goto radixnum; + + case 'p': /* pointer */ + fl |= (sizeof(void *) == 8) ? STBSP__INTMAX : 0; + pr = sizeof(void *) * 2; + fl &= ~STBSP__LEADINGZERO; /* 'p' only prints the pointer with zeros */ + /* fall through - to X */ + + case 'X': /* upper hex */ + case 'x': /* lower hex */ + h = (f[0] == 'X') ? hexu : hex; + l = (4 << 4) | (4 << 8); + lead[0] = 0; + if (fl & STBSP__LEADING_0X) { + lead[0] = 2; + lead[1] = '0'; + lead[2] = h[16]; + } + radixnum: + /* get the number */ + if (fl & STBSP__INTMAX) + n64 = va_arg(va, stbsp__uint64); + else + n64 = va_arg(va, stbsp__uint32); + + s = num + STBSP__NUMSZ; + dp = 0; + /* clear tail, and clear leading if value is zero */ + tail[0] = 0; + if (n64 == 0) { + lead[0] = 0; + if (pr == 0) { + l = 0; + cs = (((l >> 4) & 15)) << 24; + goto scopy; + } + } + /* convert to string */ + for (;;) { + *--s = h[n64 & ((1 << (l >> 8)) - 1)]; + n64 >>= (l >> 8); + if (!((n64) || ((stbsp__int32)((num + STBSP__NUMSZ) - s) < pr))) + break; + if (fl & STBSP__TRIPLET_COMMA) { + ++l; + if ((l & 15) == ((l >> 4) & 15)) { + l &= ~15; + *--s = stbsp__comma; + } + } + }; + /* get the tens and the comma pos */ + cs = (stbsp__uint32)((num + STBSP__NUMSZ) - s) + ((((l >> 4) & 15)) << 24); + /* get the length that we copied */ + l = (stbsp__uint32)((num + STBSP__NUMSZ) - s); + /* copy it */ + goto scopy; + + case 'u': /* unsigned */ + case 'i': + case 'd': /* integer */ + /* get the integer and abs it */ + if (fl & STBSP__INTMAX) { + stbsp__int64 i64 = va_arg(va, stbsp__int64); + n64 = (stbsp__uint64)i64; + if ((f[0] != 'u') && (i64 < 0)) { + n64 = (stbsp__uint64)-i64; + fl |= STBSP__NEGATIVE; + } + } else { + stbsp__int32 i = va_arg(va, stbsp__int32); + n64 = (stbsp__uint32)i; + if ((f[0] != 'u') && (i < 0)) { + n64 = (stbsp__uint32)-i; + fl |= STBSP__NEGATIVE; + } + } + +#ifndef STB_SPRINTF_NOFLOAT + if (fl & STBSP__METRIC_SUFFIX) { + if (n64 < 1024) + pr = 0; + else if (pr == -1) + pr = 1; + fv = (double)(stbsp__int64)n64; + goto doafloat; + } +#endif + + /* convert to string */ + s = num + STBSP__NUMSZ; + l = 0; + + for (;;) { + /* do in 32-bit chunks (avoid lots of 64-bit divides even with constant denominators) */ + char *o = s - 8; + if (n64 >= 100000000) { + n = (stbsp__uint32)(n64 % 100000000); + n64 /= 100000000; + } else { + n = (stbsp__uint32)n64; + n64 = 0; + } + if ((fl & STBSP__TRIPLET_COMMA) == 0) { + do { + s -= 2; + *(stbsp__uint16 *)s = *(stbsp__uint16 *)&stbsp__digitpair[(n % 100) * 2]; + n /= 100; + } while (n); + } + while (n) { + if ((fl & STBSP__TRIPLET_COMMA) && (l++ == 3)) { + l = 0; + *--s = stbsp__comma; + --o; + } else { + *--s = (char)(n % 10) + '0'; + n /= 10; + } + } + if (n64 == 0) { + if ((s[0] == '0') && (s != (num + STBSP__NUMSZ))) + ++s; + break; + } + while (s != o) + if ((fl & STBSP__TRIPLET_COMMA) && (l++ == 3)) { + l = 0; + *--s = stbsp__comma; + --o; + } else { + *--s = '0'; + } + } + + tail[0] = 0; + stbsp__lead_sign(fl, lead); + + /* get the length that we copied */ + l = (stbsp__uint32)((num + STBSP__NUMSZ) - s); + if (l == 0) { + *--s = '0'; + l = 1; + } + cs = l + (3 << 24); + if (pr < 0) + pr = 0; + + scopy: + /* get fw=leading/trailing space, pr=leading zeros */ + if (pr < (stbsp__int32)l) + pr = l; + n = pr + lead[0] + tail[0] + tz; + if (fw < (stbsp__int32)n) + fw = n; + fw -= n; + pr -= l; + + /* handle right justify and leading zeros */ + if ((fl & STBSP__LEFTJUST) == 0) { + if (fl & STBSP__LEADINGZERO) /* if leading zeros, everything is in pr */ + { + pr = (fw > pr) ? fw : pr; + fw = 0; + } else { + fl &= ~STBSP__TRIPLET_COMMA; /* if no leading zeros, then no commas */ + } + } + + /* copy the spaces and/or zeros */ + if (fw + pr) { + stbsp__int32 i; + stbsp__uint32 c; + + /* copy leading spaces (or when doing %8.4d stuff) */ + if ((fl & STBSP__LEFTJUST) == 0) + while (fw > 0) { + stbsp__cb_buf_clamp(i, fw); + fw -= i; + while (i) { + if ((((stbsp__uintptr)bf) & 3) == 0) + break; + *bf++ = ' '; + --i; + } + while (i >= 4) { + *(stbsp__uint32 *)bf = 0x20202020; + bf += 4; + i -= 4; + } + while (i) { + *bf++ = ' '; + --i; + } + stbsp__chk_cb_buf(1); + } + + /* copy leader */ + sn = lead + 1; + while (lead[0]) { + stbsp__cb_buf_clamp(i, lead[0]); + lead[0] -= (char)i; + while (i) { + *bf++ = *sn++; + --i; + } + stbsp__chk_cb_buf(1); + } + + /* copy leading zeros */ + c = cs >> 24; + cs &= 0xffffff; + cs = (fl & STBSP__TRIPLET_COMMA) ? ((stbsp__uint32)(c - ((pr + cs) % (c + 1)))) : 0; + while (pr > 0) { + stbsp__cb_buf_clamp(i, pr); + pr -= i; + if ((fl & STBSP__TRIPLET_COMMA) == 0) { + while (i) { + if ((((stbsp__uintptr)bf) & 3) == 0) + break; + *bf++ = '0'; + --i; + } + while (i >= 4) { + *(stbsp__uint32 *)bf = 0x30303030; + bf += 4; + i -= 4; + } + } + while (i) { + if ((fl & STBSP__TRIPLET_COMMA) && (cs++ == c)) { + cs = 0; + *bf++ = stbsp__comma; + } else + *bf++ = '0'; + --i; + } + stbsp__chk_cb_buf(1); + } + } + + /* copy leader if there is still one */ + sn = lead + 1; + while (lead[0]) { + stbsp__int32 i; + stbsp__cb_buf_clamp(i, lead[0]); + lead[0] -= (char)i; + while (i) { + *bf++ = *sn++; + --i; + } + stbsp__chk_cb_buf(1); + } + + /* copy the string */ + n = l; + while (n) { + stbsp__int32 i; + stbsp__cb_buf_clamp(i, n); + n -= i; + STBSP__UNALIGNED(while (i >= 4) { + *(stbsp__uint32 *)bf = *(stbsp__uint32 *)s; + bf += 4; + s += 4; + i -= 4; + }) + while (i) { + *bf++ = *s++; + --i; + } + stbsp__chk_cb_buf(1); + } + + /* copy trailing zeros */ + while (tz) { + stbsp__int32 i; + stbsp__cb_buf_clamp(i, tz); + tz -= i; + while (i) { + if ((((stbsp__uintptr)bf) & 3) == 0) + break; + *bf++ = '0'; + --i; + } + while (i >= 4) { + *(stbsp__uint32 *)bf = 0x30303030; + bf += 4; + i -= 4; + } + while (i) { + *bf++ = '0'; + --i; + } + stbsp__chk_cb_buf(1); + } + + /* copy tail if there is one */ + sn = tail + 1; + while (tail[0]) { + stbsp__int32 i; + stbsp__cb_buf_clamp(i, tail[0]); + tail[0] -= (char)i; + while (i) { + *bf++ = *sn++; + --i; + } + stbsp__chk_cb_buf(1); + } + + /* handle the left justify */ + if (fl & STBSP__LEFTJUST) + if (fw > 0) { + while (fw) { + stbsp__int32 i; + stbsp__cb_buf_clamp(i, fw); + fw -= i; + while (i) { + if ((((stbsp__uintptr)bf) & 3) == 0) + break; + *bf++ = ' '; + --i; + } + while (i >= 4) { + *(stbsp__uint32 *)bf = 0x20202020; + bf += 4; + i -= 4; + } + while (i--) + *bf++ = ' '; + stbsp__chk_cb_buf(1); + } + } + break; + + default: /* unknown, just copy code */ + s = num + STBSP__NUMSZ - 1; + *s = f[0]; + l = 1; + fw = fl = 0; + lead[0] = 0; + tail[0] = 0; + pr = 0; + dp = 0; + cs = 0; + goto scopy; + } + ++f; + } +endfmt: + + if (!callback) + *bf = 0; + else + stbsp__flush_cb(); + +done: + return tlen + (int)(bf - buf); +} + +/* cleanup */ +#undef STBSP__LEFTJUST +#undef STBSP__LEADINGPLUS +#undef STBSP__LEADINGSPACE +#undef STBSP__LEADING_0X +#undef STBSP__LEADINGZERO +#undef STBSP__INTMAX +#undef STBSP__TRIPLET_COMMA +#undef STBSP__NEGATIVE +#undef STBSP__METRIC_SUFFIX +#undef STBSP__NUMSZ +#undef stbsp__chk_cb_bufL +#undef stbsp__chk_cb_buf +#undef stbsp__flush_cb +#undef stbsp__cb_buf_clamp + +/* ============================================================================ */ +/* wrapper functions */ + +STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(sprintf)(char *buf, char const *fmt, ...) +{ + int result; + va_list va; + va_start(va, fmt); + result = STB_SPRINTF_DECORATE(vsprintfcb)(0, 0, buf, fmt, va); + va_end(va); + return result; +} + +typedef struct stbsp__context { + char *buf; + int count; + char tmp[STB_SPRINTF_MIN]; +} stbsp__context; + +static char *stbsp__clamp_callback(char *buf, void *user, int len) +{ + stbsp__context *c = (stbsp__context *)user; + + if (len > c->count) + len = c->count; + + if (len) { + if (buf != c->buf) { + char *s, *d, *se; + d = c->buf; + s = buf; + se = buf + len; + do { + *d++ = *s++; + } while (s < se); + } + c->buf += len; + c->count -= len; + } + + if (c->count <= 0) + return 0; + return (c->count >= STB_SPRINTF_MIN) ? c->buf : c->tmp; /* go direct into buffer if you can */ +} + +static char * stbsp__count_clamp_callback( char * buf, void * user, int len ) +{ + stbsp__context * c = (stbsp__context*)user; + + c->count += len; + return c->tmp; /* go direct into buffer if you can */ +} + +STBSP__PUBLICDEF int STB_SPRINTF_DECORATE( vsnprintf )( char * buf, int count, char const * fmt, va_list va ) +{ + stbsp__context c; + int l; + + if ( (count == 0) && !buf ) + { + c.count = 0; + + STB_SPRINTF_DECORATE( vsprintfcb )( stbsp__count_clamp_callback, &c, c.tmp, fmt, va ); + l = c.count; + } + else + { + if ( count == 0 ) + return 0; + + c.buf = buf; + c.count = count; + + STB_SPRINTF_DECORATE( vsprintfcb )( stbsp__clamp_callback, &c, stbsp__clamp_callback(0,&c,0), fmt, va ); + + /* zero-terminate */ + l = (int)( c.buf - buf ); + if ( l >= count ) /* should never be greater, only equal (or less) than count */ + l = count - 1; + buf[l] = 0; + } + + return l; +} + +STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(snprintf)(char *buf, int count, char const *fmt, ...) +{ + int result; + va_list va; + va_start(va, fmt); + + result = STB_SPRINTF_DECORATE(vsnprintf)(buf, count, fmt, va); + va_end(va); + + return result; +} + +STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(vsprintf)(char *buf, char const *fmt, va_list va) +{ + return STB_SPRINTF_DECORATE(vsprintfcb)(0, 0, buf, fmt, va); +} + +/* ======================================================================= */ +/* low level float utility functions */ + +#ifndef STB_SPRINTF_NOFLOAT + +/* copies d to bits w/ strict aliasing (this compiles to nothing on /Ox) */ +#define STBSP__COPYFP(dest, src) \ + { \ + int cn; \ + for (cn = 0; cn < 8; cn++) \ + ((char *)&dest)[cn] = ((char *)&src)[cn]; \ + } + +/* get float info */ +static stbsp__int32 stbsp__real_to_parts(stbsp__int64 *bits, stbsp__int32 *expo, double value) +{ + double d; + stbsp__int64 b = 0; + + /* load value and round at the frac_digits */ + d = value; + + STBSP__COPYFP(b, d); + + *bits = b & ((((stbsp__uint64)1) << 52) - 1); + *expo = (stbsp__int32)(((b >> 52) & 2047) - 1023); + + return (stbsp__int32)(b >> 63); +} + +static double const stbsp__bot[23] = { + 1e+000, 1e+001, 1e+002, 1e+003, 1e+004, 1e+005, 1e+006, 1e+007, 1e+008, 1e+009, 1e+010, 1e+011, + 1e+012, 1e+013, 1e+014, 1e+015, 1e+016, 1e+017, 1e+018, 1e+019, 1e+020, 1e+021, 1e+022 +}; +static double const stbsp__negbot[22] = { + 1e-001, 1e-002, 1e-003, 1e-004, 1e-005, 1e-006, 1e-007, 1e-008, 1e-009, 1e-010, 1e-011, + 1e-012, 1e-013, 1e-014, 1e-015, 1e-016, 1e-017, 1e-018, 1e-019, 1e-020, 1e-021, 1e-022 +}; +static double const stbsp__negboterr[22] = { + -5.551115123125783e-018, -2.0816681711721684e-019, -2.0816681711721686e-020, -4.7921736023859299e-021, -8.1803053914031305e-022, 4.5251888174113741e-023, + 4.5251888174113739e-024, -2.0922560830128471e-025, -6.2281591457779853e-026, -3.6432197315497743e-027, 6.0503030718060191e-028, 2.0113352370744385e-029, + -3.0373745563400371e-030, 1.1806906454401013e-032, -7.7705399876661076e-032, 2.0902213275965398e-033, -7.1542424054621921e-034, -7.1542424054621926e-035, + 2.4754073164739869e-036, 5.4846728545790429e-037, 9.2462547772103625e-038, -4.8596774326570872e-039 +}; +static double const stbsp__top[13] = { + 1e+023, 1e+046, 1e+069, 1e+092, 1e+115, 1e+138, 1e+161, 1e+184, 1e+207, 1e+230, 1e+253, 1e+276, 1e+299 +}; +static double const stbsp__negtop[13] = { + 1e-023, 1e-046, 1e-069, 1e-092, 1e-115, 1e-138, 1e-161, 1e-184, 1e-207, 1e-230, 1e-253, 1e-276, 1e-299 +}; +static double const stbsp__toperr[13] = { + 8388608, + 6.8601809640529717e+028, + -7.253143638152921e+052, + -4.3377296974619174e+075, + -1.5559416129466825e+098, + -3.2841562489204913e+121, + -3.7745893248228135e+144, + -1.7356668416969134e+167, + -3.8893577551088374e+190, + -9.9566444326005119e+213, + 6.3641293062232429e+236, + -5.2069140800249813e+259, + -5.2504760255204387e+282 +}; +static double const stbsp__negtoperr[13] = { + 3.9565301985100693e-040, -2.299904345391321e-063, 3.6506201437945798e-086, 1.1875228833981544e-109, + -5.0644902316928607e-132, -6.7156837247865426e-155, -2.812077463003139e-178, -5.7778912386589953e-201, + 7.4997100559334532e-224, -4.6439668915134491e-247, -6.3691100762962136e-270, -9.436808465446358e-293, + 8.0970921678014997e-317 +}; + +#if defined(_MSC_VER) && (_MSC_VER <= 1200) +static stbsp__uint64 const stbsp__powten[20] = { + 1, + 10, + 100, + 1000, + 10000, + 100000, + 1000000, + 10000000, + 100000000, + 1000000000, + 10000000000, + 100000000000, + 1000000000000, + 10000000000000, + 100000000000000, + 1000000000000000, + 10000000000000000, + 100000000000000000, + 1000000000000000000, + 10000000000000000000U +}; +#define stbsp__tento19th ((stbsp__uint64)1000000000000000000) +#else +static stbsp__uint64 const stbsp__powten[20] = { + 1, + 10, + 100, + 1000, + 10000, + 100000, + 1000000, + 10000000, + 100000000, + 1000000000, + 10000000000ULL, + 100000000000ULL, + 1000000000000ULL, + 10000000000000ULL, + 100000000000000ULL, + 1000000000000000ULL, + 10000000000000000ULL, + 100000000000000000ULL, + 1000000000000000000ULL, + 10000000000000000000ULL +}; +#define stbsp__tento19th (1000000000000000000ULL) +#endif + +#define stbsp__ddmulthi(oh, ol, xh, yh) \ + { \ + double ahi = 0, alo, bhi = 0, blo; \ + stbsp__int64 bt; \ + oh = xh * yh; \ + STBSP__COPYFP(bt, xh); \ + bt &= ((~(stbsp__uint64)0) << 27); \ + STBSP__COPYFP(ahi, bt); \ + alo = xh - ahi; \ + STBSP__COPYFP(bt, yh); \ + bt &= ((~(stbsp__uint64)0) << 27); \ + STBSP__COPYFP(bhi, bt); \ + blo = yh - bhi; \ + ol = ((ahi * bhi - oh) + ahi * blo + alo * bhi) + alo * blo; \ + } + +#define stbsp__ddtoS64(ob, xh, xl) \ + { \ + double ahi = 0, alo, vh, t; \ + ob = (stbsp__int64)ph; \ + vh = (double)ob; \ + ahi = (xh - vh); \ + t = (ahi - xh); \ + alo = (xh - (ahi - t)) - (vh + t); \ + ob += (stbsp__int64)(ahi + alo + xl); \ + } + +#define stbsp__ddrenorm(oh, ol) \ + { \ + double s; \ + s = oh + ol; \ + ol = ol - (s - oh); \ + oh = s; \ + } + +#define stbsp__ddmultlo(oh, ol, xh, xl, yh, yl) ol = ol + (xh * yl + xl * yh); + +#define stbsp__ddmultlos(oh, ol, xh, yl) ol = ol + (xh * yl); + +static void stbsp__raise_to_power10(double *ohi, double *olo, double d, stbsp__int32 power) /* power can be -323 to +350 */ +{ + double ph, pl; + if ((power >= 0) && (power <= 22)) { + stbsp__ddmulthi(ph, pl, d, stbsp__bot[power]); + } else { + stbsp__int32 e, et, eb; + double p2h, p2l; + + e = power; + if (power < 0) + e = -e; + et = (e * 0x2c9) >> 14; /* %23 */ + if (et > 13) + et = 13; + eb = e - (et * 23); + + ph = d; + pl = 0.0; + if (power < 0) { + if (eb) { + --eb; + stbsp__ddmulthi(ph, pl, d, stbsp__negbot[eb]); + stbsp__ddmultlos(ph, pl, d, stbsp__negboterr[eb]); + } + if (et) { + stbsp__ddrenorm(ph, pl); + --et; + stbsp__ddmulthi(p2h, p2l, ph, stbsp__negtop[et]); + stbsp__ddmultlo(p2h, p2l, ph, pl, stbsp__negtop[et], stbsp__negtoperr[et]); + ph = p2h; + pl = p2l; + } + } else { + if (eb) { + e = eb; + if (eb > 22) + eb = 22; + e -= eb; + stbsp__ddmulthi(ph, pl, d, stbsp__bot[eb]); + if (e) { + stbsp__ddrenorm(ph, pl); + stbsp__ddmulthi(p2h, p2l, ph, stbsp__bot[e]); + stbsp__ddmultlos(p2h, p2l, stbsp__bot[e], pl); + ph = p2h; + pl = p2l; + } + } + if (et) { + stbsp__ddrenorm(ph, pl); + --et; + stbsp__ddmulthi(p2h, p2l, ph, stbsp__top[et]); + stbsp__ddmultlo(p2h, p2l, ph, pl, stbsp__top[et], stbsp__toperr[et]); + ph = p2h; + pl = p2l; + } + } + } + stbsp__ddrenorm(ph, pl); + *ohi = ph; + *olo = pl; +} + +/* given a float value, returns the significant bits in bits, and the position of the */ +/* decimal point in decimal_pos. +/-INF and NAN are specified by special values */ +/* returned in the decimal_pos parameter. */ +/* frac_digits is absolute normally, but if you want from first significant digits (got %g and %e), or in 0x80000000 */ +static stbsp__int32 stbsp__real_to_str(char const **start, stbsp__uint32 *len, char *out, stbsp__int32 *decimal_pos, double value, stbsp__uint32 frac_digits) +{ + double d; + stbsp__int64 bits = 0; + stbsp__int32 expo, e, ng, tens; + + d = value; + STBSP__COPYFP(bits, d); + expo = (stbsp__int32)((bits >> 52) & 2047); + ng = (stbsp__int32)(bits >> 63); + if (ng) + d = -d; + + if (expo == 2047) /* is nan or inf? */ + { + *start = (bits & ((((stbsp__uint64)1) << 52) - 1)) ? "NaN" : "Inf"; + *decimal_pos = STBSP__SPECIAL; + *len = 3; + return ng; + } + + if (expo == 0) /* is zero or denormal */ + { + if ((bits << 1) == 0) /* do zero */ + { + *decimal_pos = 1; + *start = out; + out[0] = '0'; + *len = 1; + return ng; + } + /* find the right expo for denormals */ + { + stbsp__int64 v = ((stbsp__uint64)1) << 51; + while ((bits & v) == 0) { + --expo; + v >>= 1; + } + } + } + + /* find the decimal exponent as well as the decimal bits of the value */ + { + double ph, pl; + + /* log10 estimate - very specifically tweaked to hit or undershoot by no more than 1 of log10 of all expos 1..2046 */ + tens = expo - 1023; + tens = (tens < 0) ? ((tens * 617) / 2048) : (((tens * 1233) / 4096) + 1); + + /* move the significant bits into position and stick them into an int */ + stbsp__raise_to_power10(&ph, &pl, d, 18 - tens); + + /* get full as much precision from double-double as possible */ + stbsp__ddtoS64(bits, ph, pl); + + /* check if we undershot */ + if (((stbsp__uint64)bits) >= stbsp__tento19th) + ++tens; + } + + /* now do the rounding in integer land */ + frac_digits = (frac_digits & 0x80000000) ? ((frac_digits & 0x7ffffff) + 1) : (tens + frac_digits); + if ((frac_digits < 24)) { + stbsp__uint32 dg = 1; + if ((stbsp__uint64)bits >= stbsp__powten[9]) + dg = 10; + while ((stbsp__uint64)bits >= stbsp__powten[dg]) { + ++dg; + if (dg == 20) + goto noround; + } + if (frac_digits < dg) { + stbsp__uint64 r; + /* add 0.5 at the right position and round */ + e = dg - frac_digits; + if ((stbsp__uint32)e >= 24) + goto noround; + r = stbsp__powten[e]; + bits = bits + (r / 2); + if ((stbsp__uint64)bits >= stbsp__powten[dg]) + ++tens; + bits /= r; + } + noround:; + } + + /* kill long trailing runs of zeros */ + if (bits) { + stbsp__uint32 n; + for (;;) { + if (bits <= 0xffffffff) + break; + if (bits % 1000) + goto donez; + bits /= 1000; + } + n = (stbsp__uint32)bits; + while ((n % 1000) == 0) + n /= 1000; + bits = n; + donez:; + } + + /* convert to string */ + out += 64; + e = 0; + for (;;) { + stbsp__uint32 n; + char *o = out - 8; + /* do the conversion in chunks of U32s (avoid most 64-bit divides, worth it, constant denomiators be damned) */ + if (bits >= 100000000) { + n = (stbsp__uint32)(bits % 100000000); + bits /= 100000000; + } else { + n = (stbsp__uint32)bits; + bits = 0; + } + while (n) { + out -= 2; + *(stbsp__uint16 *)out = *(stbsp__uint16 *)&stbsp__digitpair[(n % 100) * 2]; + n /= 100; + e += 2; + } + if (bits == 0) { + if ((e) && (out[0] == '0')) { + ++out; + --e; + } + break; + } + while (out != o) { + *--out = '0'; + ++e; + } + } + + *decimal_pos = tens; + *start = out; + *len = e; + return ng; +} + +#undef stbsp__ddmulthi +#undef stbsp__ddrenorm +#undef stbsp__ddmultlo +#undef stbsp__ddmultlos +#undef STBSP__SPECIAL +#undef STBSP__COPYFP + +#endif /* STB_SPRINTF_NOFLOAT */ + +/* clean up */ +#undef stbsp__uint16 +#undef stbsp__uint32 +#undef stbsp__int32 +#undef stbsp__uint64 +#undef stbsp__int64 +#undef STBSP__UNALIGNED + +#endif /* STB_SPRINTF_IMPLEMENTATION */ + +/* +------------------------------------------------------------------------------ +This software is available under 2 licenses -- choose whichever you prefer. +------------------------------------------------------------------------------ +ALTERNATIVE A - MIT License +Copyright (c) 2017 Sean Barrett +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +------------------------------------------------------------------------------ +ALTERNATIVE B - Public Domain (www.unlicense.org) +This is free and unencumbered software released into the public domain. +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this +software, either in source code form or as a compiled binary, for any purpose, +commercial or non-commercial, and by any means. +In jurisdictions that recognize copyright laws, the author or authors of this +software dedicate any and all copyright interest in the software to the public +domain. We make this dedication for the benefit of the public at large and to +the detriment of our heirs and successors. We intend this dedication to be an +overt act of relinquishment in perpetuity of all present and future rights to +this software under copyright law. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------------------------------------------------------------------------------ +*/ diff --git a/tcod_sys/libtcod/src/wrappers.c b/tcod_sys/libtcod/src/wrappers.c index c4abe5519..c9ce37b78 100644 --- a/tcod_sys/libtcod/src/wrappers.c +++ b/tcod_sys/libtcod/src/wrappers.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -352,7 +353,7 @@ void TCOD_namegen_get_sets_wrapper(char **sets) { } } -#ifdef TCOD_SDL2 +#ifndef TCOD_BARE int TCOD_sys_get_current_resolution_x() { int x, y; diff --git a/tcod_sys/libtcod/src/zip.cpp b/tcod_sys/libtcod/src/zip.cpp index a36273532..cfb5b8661 100644 --- a/tcod_sys/libtcod/src/zip.cpp +++ b/tcod_sys/libtcod/src/zip.cpp @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/src/zip_c.c b/tcod_sys/libtcod/src/zip_c.c index a6a08aa7e..583865fbf 100644 --- a/tcod_sys/libtcod/src/zip_c.c +++ b/tcod_sys/libtcod/src/zip_c.c @@ -1,6 +1,6 @@ /* -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,8 +10,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/x86_64-pc-windows-msvc_bindings.rs b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs index 2fbdfe59f..84ff5ec35 100644 --- a/tcod_sys/x86_64-pc-windows-msvc_bindings.rs +++ b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs @@ -490,10 +490,10 @@ pub const PRINTF_UINTMAX_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; pub const true_: u32 = 1; pub const false_: u32 = 0; pub const __bool_true_false_are_defined: u32 = 1; -pub const TCOD_HEXVERSION: u32 = 67075; -pub const TCOD_STRVERSION: &'static [u8; 6usize] = b"1.6.3\0"; -pub const TCOD_TECHVERSION: u32 = 17171200; -pub const TCOD_STRVERSIONNAME: &'static [u8; 14usize] = b"libtcod 1.6.3\0"; +pub const TCOD_HEXVERSION: u32 = 67328; +pub const TCOD_STRVERSION: &'static [u8; 6usize] = b"1.7.0\0"; +pub const TCOD_TECHVERSION: u32 = 17235968; +pub const TCOD_STRVERSIONNAME: &'static [u8; 14usize] = b"libtcod 1.7.0\0"; pub const TCOD_KEY_TEXT_SIZE: u32 = 32; pub const TCOD_NOISE_MAX_OCTAVES: u32 = 128; pub const TCOD_NOISE_MAX_DIMENSIONS: u32 = 4; @@ -3455,6 +3455,15 @@ extern "C" { needle: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } +#[doc = " \\brief A callback to be passed to TCOD_line"] +#[doc = ""] +#[doc = " The points given to the callback include both the starting and ending"] +#[doc = " positions."] +#[doc = ""] +#[doc = " \\param x"] +#[doc = " \\param y"] +#[doc = " \\return As long as this callback returns true it will be called with the"] +#[doc = " next x,y point on the line."] pub type TCOD_line_listener_t = ::std::option::Option< unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> bool, >; @@ -3481,6 +3490,7 @@ extern "C" { listener: TCOD_line_listener_t, ) -> bool; } +#[doc = " \\brief A struct used for computing a bresenham line."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct TCOD_bresenham_data_t { @@ -3980,6 +3990,7 @@ extern "C" { extern "C" { pub fn TCOD_bsp_remove_sons(node: *mut TCOD_bsp_t); } +#[doc = " \\brief An RGB color struct."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct TCOD_color_t { @@ -4034,7 +4045,7 @@ extern "C" { pub fn TCOD_color_RGB(r: u8, g: u8, b: u8) -> TCOD_color_t; } extern "C" { - pub fn TCOD_color_HSV(h: f32, s: f32, v: f32) -> TCOD_color_t; + pub fn TCOD_color_HSV(hue: f32, saturation: f32, value: f32) -> TCOD_color_t; } extern "C" { pub fn TCOD_color_equals(c1: TCOD_color_t, c2: TCOD_color_t) -> bool; @@ -4055,34 +4066,39 @@ extern "C" { pub fn TCOD_color_lerp(c1: TCOD_color_t, c2: TCOD_color_t, coef: f32) -> TCOD_color_t; } extern "C" { - pub fn TCOD_color_set_HSV(c: *mut TCOD_color_t, h: f32, s: f32, v: f32); + pub fn TCOD_color_set_HSV(color: *mut TCOD_color_t, hue: f32, saturation: f32, value: f32); } extern "C" { - pub fn TCOD_color_get_HSV(c: TCOD_color_t, h: *mut f32, s: *mut f32, v: *mut f32); + pub fn TCOD_color_get_HSV( + color: TCOD_color_t, + hue: *mut f32, + saturation: *mut f32, + value: *mut f32, + ); } extern "C" { - pub fn TCOD_color_get_hue(c: TCOD_color_t) -> f32; + pub fn TCOD_color_get_hue(color: TCOD_color_t) -> f32; } extern "C" { - pub fn TCOD_color_set_hue(c: *mut TCOD_color_t, h: f32); + pub fn TCOD_color_set_hue(color: *mut TCOD_color_t, hue: f32); } extern "C" { - pub fn TCOD_color_get_saturation(c: TCOD_color_t) -> f32; + pub fn TCOD_color_get_saturation(color: TCOD_color_t) -> f32; } extern "C" { - pub fn TCOD_color_set_saturation(c: *mut TCOD_color_t, s: f32); + pub fn TCOD_color_set_saturation(color: *mut TCOD_color_t, saturation: f32); } extern "C" { - pub fn TCOD_color_get_value(c: TCOD_color_t) -> f32; + pub fn TCOD_color_get_value(color: TCOD_color_t) -> f32; } extern "C" { - pub fn TCOD_color_set_value(c: *mut TCOD_color_t, v: f32); + pub fn TCOD_color_set_value(color: *mut TCOD_color_t, value: f32); } extern "C" { - pub fn TCOD_color_shift_hue(c: *mut TCOD_color_t, hshift: f32); + pub fn TCOD_color_shift_hue(color: *mut TCOD_color_t, hshift: f32); } extern "C" { - pub fn TCOD_color_scale_HSV(c: *mut TCOD_color_t, scoef: f32, vcoef: f32); + pub fn TCOD_color_scale_HSV(color: *mut TCOD_color_t, saturation_coef: f32, value_coef: f32); } extern "C" { pub fn TCOD_color_gen_map( @@ -5095,18 +5111,31 @@ pub enum TCOD_key_status_t { TCOD_KEY_RELEASED = 2, } impl TCOD_font_flags_t { + #[doc = " Tiles are arranged in column-major order."] + #[doc = ""] + #[doc = " 0 3 6"] + #[doc = " 1 4 7"] + #[doc = " 2 5 8"] pub const TCOD_FONT_LAYOUT_ASCII_INCOL: TCOD_font_flags_t = TCOD_font_flags_t(1); } impl TCOD_font_flags_t { + #[doc = " Tiles are arranged in row-major order."] + #[doc = ""] + #[doc = " 0 1 2"] + #[doc = " 3 4 5"] + #[doc = " 6 7 8"] pub const TCOD_FONT_LAYOUT_ASCII_INROW: TCOD_font_flags_t = TCOD_font_flags_t(2); } impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] pub const TCOD_FONT_TYPE_GREYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); } impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); } impl TCOD_font_flags_t { + #[doc = " A unique layout used by some of libtcod's fonts."] pub const TCOD_FONT_LAYOUT_TCOD: TCOD_font_flags_t = TCOD_font_flags_t(8); } impl ::std::ops::BitOr for TCOD_font_flags_t { @@ -5136,17 +5165,33 @@ impl ::std::ops::BitAndAssign for TCOD_font_flags_t { } } #[repr(transparent)] +#[doc = " These font flags can be OR'd together into a bit-field and passed to"] +#[doc = " TCOD_console_set_custom_font"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub struct TCOD_font_flags_t(pub i32); #[repr(i32)] +#[doc = " The available renderers."] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum TCOD_renderer_t { + #[doc = " An OpenGL implementation using a shader."] TCOD_RENDERER_GLSL = 0, + #[doc = " An OpenGL implementation without a shader."] + #[doc = ""] + #[doc = " Performs worse than TCOD_RENDERER_GLSL without many benefits."] TCOD_RENDERER_OPENGL = 1, + #[doc = " A software based renderer."] + #[doc = ""] + #[doc = " The font file is loaded into RAM instead of VRAM in this implementation."] TCOD_RENDERER_SDL = 2, + #[doc = " A software based renderer."] + #[doc = ""] + #[doc = " The font file is loaded into RAM instead of VRAM in this implementation."] TCOD_NB_RENDERERS = 3, } #[repr(i32)] +#[doc = " \\enum TCOD_alignment_t"] +#[doc = ""] +#[doc = " Print justification options."] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum TCOD_alignment_t { TCOD_LEFT = 0, From 24b300d35e689476a72a861cdcfc10c4ea08dc33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sat, 27 Jun 2020 15:00:40 +0200 Subject: [PATCH 09/27] Update bindings for x86_64 Linux --- tcod_sys/x86_64-unknown-linux-gnu_bindings.rs | 125 ++++++++++++++---- 1 file changed, 101 insertions(+), 24 deletions(-) diff --git a/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs b/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs index b0e03c6dc..215504dbc 100644 --- a/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs +++ b/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs @@ -628,10 +628,10 @@ pub const PRINTF_UINTMAX_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; pub const true_: u32 = 1; pub const false_: u32 = 0; pub const __bool_true_false_are_defined: u32 = 1; -pub const TCOD_HEXVERSION: u32 = 67075; -pub const TCOD_STRVERSION: &'static [u8; 6usize] = b"1.6.3\0"; -pub const TCOD_TECHVERSION: u32 = 17171200; -pub const TCOD_STRVERSIONNAME: &'static [u8; 14usize] = b"libtcod 1.6.3\0"; +pub const TCOD_HEXVERSION: u32 = 67328; +pub const TCOD_STRVERSION: &'static [u8; 6usize] = b"1.7.0\0"; +pub const TCOD_TECHVERSION: u32 = 17235968; +pub const TCOD_STRVERSIONNAME: &'static [u8; 14usize] = b"libtcod 1.7.0\0"; pub const TCOD_KEY_TEXT_SIZE: u32 = 32; pub const TCOD_NOISE_MAX_OCTAVES: u32 = 128; pub const TCOD_NOISE_MAX_DIMENSIONS: u32 = 4; @@ -5280,6 +5280,15 @@ extern "C" { n: size_t, ) -> ::std::os::raw::c_int; } +#[doc = " \\brief A callback to be passed to TCOD_line"] +#[doc = ""] +#[doc = " The points given to the callback include both the starting and ending"] +#[doc = " positions."] +#[doc = ""] +#[doc = " \\param x"] +#[doc = " \\param y"] +#[doc = " \\return As long as this callback returns true it will be called with the"] +#[doc = " next x,y point on the line."] pub type TCOD_line_listener_t = ::std::option::Option< unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> bool, >; @@ -5306,6 +5315,7 @@ extern "C" { listener: TCOD_line_listener_t, ) -> bool; } +#[doc = " \\brief A struct used for computing a bresenham line."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct TCOD_bresenham_data_t { @@ -5805,6 +5815,7 @@ extern "C" { extern "C" { pub fn TCOD_bsp_remove_sons(node: *mut TCOD_bsp_t); } +#[doc = " \\brief An RGB color struct."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct TCOD_color_t { @@ -5859,7 +5870,7 @@ extern "C" { pub fn TCOD_color_RGB(r: u8, g: u8, b: u8) -> TCOD_color_t; } extern "C" { - pub fn TCOD_color_HSV(h: f32, s: f32, v: f32) -> TCOD_color_t; + pub fn TCOD_color_HSV(hue: f32, saturation: f32, value: f32) -> TCOD_color_t; } extern "C" { pub fn TCOD_color_equals(c1: TCOD_color_t, c2: TCOD_color_t) -> bool; @@ -5880,34 +5891,39 @@ extern "C" { pub fn TCOD_color_lerp(c1: TCOD_color_t, c2: TCOD_color_t, coef: f32) -> TCOD_color_t; } extern "C" { - pub fn TCOD_color_set_HSV(c: *mut TCOD_color_t, h: f32, s: f32, v: f32); + pub fn TCOD_color_set_HSV(color: *mut TCOD_color_t, hue: f32, saturation: f32, value: f32); } extern "C" { - pub fn TCOD_color_get_HSV(c: TCOD_color_t, h: *mut f32, s: *mut f32, v: *mut f32); + pub fn TCOD_color_get_HSV( + color: TCOD_color_t, + hue: *mut f32, + saturation: *mut f32, + value: *mut f32, + ); } extern "C" { - pub fn TCOD_color_get_hue(c: TCOD_color_t) -> f32; + pub fn TCOD_color_get_hue(color: TCOD_color_t) -> f32; } extern "C" { - pub fn TCOD_color_set_hue(c: *mut TCOD_color_t, h: f32); + pub fn TCOD_color_set_hue(color: *mut TCOD_color_t, hue: f32); } extern "C" { - pub fn TCOD_color_get_saturation(c: TCOD_color_t) -> f32; + pub fn TCOD_color_get_saturation(color: TCOD_color_t) -> f32; } extern "C" { - pub fn TCOD_color_set_saturation(c: *mut TCOD_color_t, s: f32); + pub fn TCOD_color_set_saturation(color: *mut TCOD_color_t, saturation: f32); } extern "C" { - pub fn TCOD_color_get_value(c: TCOD_color_t) -> f32; + pub fn TCOD_color_get_value(color: TCOD_color_t) -> f32; } extern "C" { - pub fn TCOD_color_set_value(c: *mut TCOD_color_t, v: f32); + pub fn TCOD_color_set_value(color: *mut TCOD_color_t, value: f32); } extern "C" { - pub fn TCOD_color_shift_hue(c: *mut TCOD_color_t, hshift: f32); + pub fn TCOD_color_shift_hue(color: *mut TCOD_color_t, hshift: f32); } extern "C" { - pub fn TCOD_color_scale_HSV(c: *mut TCOD_color_t, scoef: f32, vcoef: f32); + pub fn TCOD_color_scale_HSV(color: *mut TCOD_color_t, saturation_coef: f32, value_coef: f32); } extern "C" { pub fn TCOD_color_gen_map( @@ -6920,26 +6936,87 @@ pub enum TCOD_key_status_t { TCOD_KEY_RELEASED = 2, } impl TCOD_font_flags_t { - pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = - TCOD_font_flags_t::TCOD_FONT_TYPE_GREYSCALE; + #[doc = " Tiles are arranged in column-major order."] + #[doc = ""] + #[doc = " 0 3 6"] + #[doc = " 1 4 7"] + #[doc = " 2 5 8"] + pub const TCOD_FONT_LAYOUT_ASCII_INCOL: TCOD_font_flags_t = TCOD_font_flags_t(1); } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_font_flags_t { - TCOD_FONT_LAYOUT_ASCII_INCOL = 1, - TCOD_FONT_LAYOUT_ASCII_INROW = 2, - TCOD_FONT_TYPE_GREYSCALE = 4, - TCOD_FONT_LAYOUT_TCOD = 8, +impl TCOD_font_flags_t { + #[doc = " Tiles are arranged in row-major order."] + #[doc = ""] + #[doc = " 0 1 2"] + #[doc = " 3 4 5"] + #[doc = " 6 7 8"] + pub const TCOD_FONT_LAYOUT_ASCII_INROW: TCOD_font_flags_t = TCOD_font_flags_t(2); +} +impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] + pub const TCOD_FONT_TYPE_GREYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); +} +impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] + pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); +} +impl TCOD_font_flags_t { + #[doc = " A unique layout used by some of libtcod's fonts."] + pub const TCOD_FONT_LAYOUT_TCOD: TCOD_font_flags_t = TCOD_font_flags_t(8); +} +impl ::std::ops::BitOr for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 | other.0) + } } +impl ::std::ops::BitOrAssign for TCOD_font_flags_t { + #[inline] + fn bitor_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for TCOD_font_flags_t { + #[inline] + fn bitand_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[doc = " These font flags can be OR'd together into a bit-field and passed to"] +#[doc = " TCOD_console_set_custom_font"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct TCOD_font_flags_t(pub u32); #[repr(u32)] +#[doc = " The available renderers."] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum TCOD_renderer_t { + #[doc = " An OpenGL implementation using a shader."] TCOD_RENDERER_GLSL = 0, + #[doc = " An OpenGL implementation without a shader."] + #[doc = ""] + #[doc = " Performs worse than TCOD_RENDERER_GLSL without many benefits."] TCOD_RENDERER_OPENGL = 1, + #[doc = " A software based renderer."] + #[doc = ""] + #[doc = " The font file is loaded into RAM instead of VRAM in this implementation."] TCOD_RENDERER_SDL = 2, + #[doc = " A software based renderer."] + #[doc = ""] + #[doc = " The font file is loaded into RAM instead of VRAM in this implementation."] TCOD_NB_RENDERERS = 3, } #[repr(u32)] +#[doc = " \\enum TCOD_alignment_t"] +#[doc = ""] +#[doc = " Print justification options."] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum TCOD_alignment_t { TCOD_LEFT = 0, From 8232a9d4f8f2bf8601b72a256b8a31a46a9d0314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sat, 27 Jun 2020 15:21:20 +0200 Subject: [PATCH 10/27] Fix type issue Bit of a kludge, hopefully will find a more permanent solution in the future. --- src/console.rs | 6 +++--- tcod_sys/build.rs | 12 ++++++++++-- tcod_sys/x86_64-pc-windows-msvc_bindings.rs | 2 ++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/console.rs b/src/console.rs index 50d7e5675..7394ac4bf 100644 --- a/src/console.rs +++ b/src/console.rs @@ -391,7 +391,7 @@ impl Root { ); ffi::TCOD_console_set_custom_font( path.as_ptr(), - font_layout.bits() | font_type.bits(), + (font_layout.bits() | font_type.bits()) as i32, nb_char_horizontal, nb_char_vertical, ); @@ -1279,7 +1279,7 @@ native_enum_convert!(Renderer, TCOD_renderer_t); bitflags! { /// All the possible font layouts that can be used for custom bitmap fonts - pub struct FontLayout: i32 { + pub struct FontLayout: ffi::TCOD_font_flags_t_type { const ASCII_INCOL = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_ASCII_INCOL.0; const ASCII_INROW = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_ASCII_INROW.0; const TCOD = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_TCOD.0; @@ -1287,7 +1287,7 @@ bitflags! { } bitflags! { - pub struct FontType: i32 { + pub struct FontType: ffi::TCOD_font_flags_t_type { const DEFAULT = 0; const GREYSCALE = ffi::TCOD_font_flags_t::TCOD_FONT_TYPE_GREYSCALE.0; } diff --git a/tcod_sys/build.rs b/tcod_sys/build.rs index 8d607f8d3..abb3886d8 100644 --- a/tcod_sys/build.rs +++ b/tcod_sys/build.rs @@ -108,9 +108,17 @@ fn build_linux_dynamic(dst: &Path, libtcod_sources: &[& 'static str]) { #[cfg(feature = "generate_bindings")] fn generate_bindings>(dst_dir: P) { + let target = env::var("TARGET").unwrap(); // Tell cargo to invalidate the built crate whenever the wrapper changes - println!("cargo:rerun-if-changed=wrapper.h"); + println!("cargo:rerun-if-changed=bindgen.h"); + + let font_flags_t_type = format!("pub type TCOD_font_flags_t_type = {};", + match target.as_ref() { + "x86_64-pc-windows-msvc" => String::from("i32"), + "x86_64-unknown-linux-gnu" => String::from("u32"), + t => format!("", t) + }); let bindings = bindgen::Builder::default() .header("bindgen.h") @@ -118,6 +126,7 @@ fn generate_bindings>(dst_dir: P) { .default_enum_style(bindgen::EnumVariation::Rust{non_exhaustive:false}) .derive_default(true) .bitfield_enum("TCOD_font_flags_t") + .raw_line(font_flags_t_type) // Tell cargo to invalidate the built crate whenever any of the // included header files changed. .parse_callbacks(Box::new(bindgen::CargoCallbacks)) @@ -131,7 +140,6 @@ fn generate_bindings>(dst_dir: P) { .expect("Couldn't write bindings!"); // Copy bindings to $TARGET_bindings.rs - let target = env::var("TARGET").unwrap(); let target_bindings_file = format!("{}_bindings.rs", target); std::fs::copy(bindings_file, &target_bindings_file).unwrap(); println!("cargo:rustc-env=BINDINGS_TARGET={}", target); diff --git a/tcod_sys/x86_64-pc-windows-msvc_bindings.rs b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs index 84ff5ec35..c88618fca 100644 --- a/tcod_sys/x86_64-pc-windows-msvc_bindings.rs +++ b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs @@ -1,5 +1,7 @@ /* automatically generated by rust-bindgen */ +pub type TCOD_font_flags_t_type = i32; + pub const __llvm__: u32 = 1; pub const __clang__: u32 = 1; pub const __clang_major__: u32 = 10; From 5f3e835e49a79a5b3387453db489bcd10fa34caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sat, 27 Jun 2020 15:38:52 +0200 Subject: [PATCH 11/27] Update bindings for x86_64 Linux --- tcod_sys/x86_64-unknown-linux-gnu_bindings.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs b/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs index 215504dbc..68401dd85 100644 --- a/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs +++ b/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs @@ -1,5 +1,7 @@ /* automatically generated by rust-bindgen */ +pub type TCOD_font_flags_t_type = u32; + pub const __llvm__: u32 = 1; pub const __clang__: u32 = 1; pub const __clang_major__: u32 = 10; From e6b14b468e1b3b7850a78dfae653255bc4abdbc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sat, 27 Jun 2020 15:45:25 +0200 Subject: [PATCH 12/27] Add some files I forgot from the 1.7 update --- tcod_sys/libtcod/CHANGELOG.md | 805 +++++++++++++++++++++++++ tcod_sys/libtcod/LIBTCOD-CREDITS.txt | 21 +- tcod_sys/libtcod/LIBTCOD-LICENSE.txt | 9 +- tcod_sys/libtcod/README-linux-SDL2.md | 2 +- tcod_sys/libtcod/README.md | 4 +- tcod_sys/libtcod/libtcod-CHANGELOG.txt | 582 ------------------ 6 files changed, 825 insertions(+), 598 deletions(-) create mode 100644 tcod_sys/libtcod/CHANGELOG.md delete mode 100644 tcod_sys/libtcod/libtcod-CHANGELOG.txt diff --git a/tcod_sys/libtcod/CHANGELOG.md b/tcod_sys/libtcod/CHANGELOG.md new file mode 100644 index 000000000..670e9b774 --- /dev/null +++ b/tcod_sys/libtcod/CHANGELOG.md @@ -0,0 +1,805 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) + +This project DOES NOT adhere to [Semantic Versioning](http://semver.org/). + +## [Unreleased] + +## [1.7.0] - 2018-06-12 +### Changed +- `TCOD_console_is_active()` now returns keyboard focus, its previous return + value was undefined. +- Load font debug information is now suppressed when NDEBUG is defined. +- Error messages when failing to create an SDL window should be a less vague. +- You no longer need to initialize libtcod before you can print to an + off-screen console. + +### Fixed +- Fixed a missing space between a literal and identifier that causes problems + with some C++ compilers. +- Fixed implicit definitions that could potentially crash formatted console + printing functions and image saving functions. +- Fixed including libtcod gui headers. (Fabian Wolff) +- Fixed memory leaks when lexer creation fails. (Fabian Wolff) +- Avoid crashes if the root console has a character code higher than expected. +- Fixed `AttributeError: module 'urllib' has no attribute 'urlretrieve'` when + running SCons builder with Python 3. +- Fixed `UnicodeEncodeError: ordinal not in range(128)` in places where + libtcodpy says it wants an ASCII string. +- libtcodpy now escapes the `%` character on print functions. +- Fixed libtcodpy print functions not supporting Unicode for Python 3. +- Fixed libtcodpy missing definition `TCOD_console_print_utf`. + +## [1.6.7] - 2018-05-17 +### Changed +- Renamed `libtcod-CHANGELOG.txt` to `CHANGELOG.md` +- SCons builder now outputs `libtcodgui` instead of `libtcod-gui` to match + Autotools behaviour. + +### Fixed +- REXPaint operations now save/load as little-endian on any platform. + https://bitbucket.org/libtcod/libtcod/issues/91/fix-the-libtcod-types-endian-support +- `TCOD_console_map_ascii_code_to_font` and related functions can now assign + character codes that were not automatically assigned during initialization. + Previously you could only assign codes up to the total number of tiles in the + font. +- Fixed including libtcod from Autotools installs, the `console_rexpaint.h` + header was missing. (James Byrnes) + +## [1.6.6] - 2018-04-06 +### Added +- Added `libtcod_c.c` and `libtcod.cpp` source files to assist with static + linking. + +### Changed +- REXPaint functions now have their own header file: `console_rexpaint.h` +- `TCOD_color_set_HSV` now normalizes bad hue/saturation/value parameters. + +### Deprecated +- Non-reentrant line functions `TCOD_line_init` and `TCOD_line_step` are now + deprecated. +- `TCOD_line_mt` is deprecated. `TCOD_line` is the same function with an + unnecessary parameter, and should be prefered. + +### Fixed +- `TCOD_line` is now reentrant. +- `FOV_BASIC` (`fov_circular_raycasting`) implementation is now reentrant. +- Fixed `external/pstdint.h` header not being installed correctly by Autotools. + https://bitbucket.org/libtcod/libtcod/issues/121/include-of-external-pstdinth-fails +- Autotools libtools are no longer bundled, these are automatically installed + via `autoreconf -i` + +## [1.6.5] - 2018-02-20 +### Fixed +- Resolved header issues that were leaving some types and functions undefined. (Kyle Stewart) +- key.c is no longer set when key.vk == TCODK_TEXT, this fixes a regression + which was causing events to be heard twice in the libtcod/Python tutorial. (Kyle Stewart) +- OpenGL renderer alpha blending is now consistent with all other render modes. (Kyle Stewart) + https://bitbucket.org/libtcod/libtcod/issues/99/opengl-renderer-looks-poorly-compared-to + +## [1.6.4] - 2017-11-27 +### Added +- Added support for loading/saving REXPaint files. (Kyle Stewart) +- Added documentation to guide people in upgrading from 1.5.x to 1.6.x (rmtew) + https://bitbucket.org/libtcod/libtcod/issues/88 + +### Changed +- Upgraded to `stdint.h` source code typing via `pstdint.h` (rmtew) + https://bitbucket.org/libtcod/libtcod/issues/91 +- All libtcod headers are now self-contained. (Kyle Stewart) + https://bitbucket.org/libtcod/libtcod/issues/93/header-organization +- bool type is now based off of stdbool.h (Kyle Stewart) +- SCons builder defaults to debug builds, now builds with OpenGL, and uses link + time optimization on release builds. (Kyle Stewart) + https://bitbucket.org/libtcod/libtcod/issues/92/tcod_renderer_glsl-not-working +- SDL is no longer initialized at module load time. (Kyle Stewart) + https://bitbucket.org/libtcod/libtcod/issues/107/sdl_init-on-library-load-libtcod + +### Fixed +- Text input events now include correct modifier key values. (Kyle Stewart) +- Fixed touch support compilation, although it is still an experimental option that may change (rmtew) +- Console objects should be safe to create and use before libtcod is fully initialized. (Kyle Stewart) + https://bitbucket.org/libtcod/libtcod/issues/17/offline-libtcod +- Fixed TCOD_list_reverse. (Kyle Stewart) +- Fixed simplex noise artifacts when using negative coordinates. (Kyle Stewart) +- Fixed the GLSL and OPENGL renderers on all platforms. (rmtew) (Kyle Stewart) + https://bitbucket.org/libtcod/libtcod/issues/92/tcod_renderer_glsl-not-working +- TCOD_image_blit_2x no longer alters a consoles default colors. (Kyle Stewart) +- SDL renderer is only created when using SDL rendering (wump@bitbucket) + https://bitbucket.org/libtcod/libtcod/pull-requests/74/dont-create-sdl-renderer-when-using-opengl + +## [1.6.3] - 2017-02-26 +### Added +- Added SCons build support (HexDecimal@bitbucket). + https://bitbucket.org/libtcod/libtcod/commits/92c5a1b530049f15d1ed36375b12781554272f17 +- Exposed clipboard API to Python (rmtew@bitbucket). +- Added TravisCI integration tests (Kyle Stewart) https://bitbucket.org/libtcod/libtcod/pull-requests/61 +- Added .gitattributes and .gitignore files (Kyle Stewart) https://bitbucket.org/libtcod/libtcod/pull-requests/61 + +### Changed +- Updated restrictive FOV code to match MRPAS v1.2 (mingos@bitbucket) + https://bitbucket.org/libtcod/libtcod/commits/28a19912ac7fef6e68164fb8970230517888c9ff +- Per-platform clipboard get/set code has been removed, and the SDL2 API is used instead (rmtew@bitbucket). + The clipboard encoding is now UTF-8 on all platforms. + https://bitbucket.org/libtcod/libtcod/issues/81/ +- Documented and undeprecated TCOD_mouse_get_status() as the state is awkwardly exposed via check/wait event calls anyway (rmtew@bitbucket). +- Switched Python tests to use pytest instead of unittest. (Kyle Stewart) + https://bitbucket.org/libtcod/libtcod/pull-requests/61 + +### Fixed +- TCOD_path_walk now considers negative values to be blocking the path (HexDecimal@bitbucket) + https://bitbucket.org/libtcod/libtcod/commits/fc8c88ec9b5d7b113ba3a7906f526daba81b543c +- Fix key handling in name generator in C sample (reported by Chris Hamons@bitbucket) + https://bitbucket.org/libtcod/libtcod/issues/83/ +- Fix for broken SDL callback (reported by grimstain@bitbucket) + https://bitbucket.org/libtcod/libtcod/issues/78/sdl-callback-null-pixels +- Fix for memory leak introduced with the foreground/background image change (Aaron Wise). + https://bitbucket.org/libtcod/libtcod/commits/275e8bd97000599e9d87bfa138fa72c066b1cae7 +- Fix for bug in Slider::setFormat() which left a dangling pointer (reported by Kai Kratz@bitbucket) + https://bitbucket.org/libtcod/libtcod/commits/07c1214077d121107c5ad8ee38c589ad677f5e76 +- Fix potential wavelet related memory leak in TCOD_noise_delete() (HexDecimal@bitbucket) + https://bitbucket.org/libtcod/libtcod/commits/a03a79814fd734e05e5d72801376b2af6b315373 +- Fix libtcodpy return type for TCOD_console_put_char_ex and TCOD_console_put_char (HexDecimal@bitbucket) + https://bitbucket.org/libtcod/libtcod/commits/a03a79814fd734e05e5d72801376b2af6b315373 +- Fix libtcodpy arguments for TCOD_heightmap_add_fbm and TCOD_heightmap_scale_fbm (HexDecimal@bitbucket) + https://bitbucket.org/libtcod/libtcod/commits/6f34ffa3d17af39cc274c048ff633be8609998f8 +- Fixed creating a libtcodpy pathfinder with a callback would crash on 64-bit Unix systems (Kyle Stewart) + https://bitbucket.org/libtcod/libtcod/pull-requests/61 + +## [1.6.2] - 2016-12-28 +### Added +- doctcod command added to VS2015 solution. +- Python (PTVS) project for samples_py added to VS2015 solution. +- Console foreground and background colours are images. + https://bitbucket.org/libtcod/libtcod/issues/51/console-image-unification +- Python unit tests added (Kyle Stewart). + https://bitbucket.org/libtcod/libtcod/commits/7a66ad5d66832686c0071e3938b85ebad8e7cebb +- Added TCOD_console_get_background_color_image and TCOD_console_get_foreground_color_image API for C++/C/Python. + +### Changed +- crash bugs fixed in documentation generation. +- libtcodpy when loading a DLL now explicitly compares the architecture of the Python version uses, to the architecture of the DLL and exits outputting any difference. +- libtcodpy now uses more wrapper functions on Windows to cover ctypes limitations in passing and returning struct values. +- libtcodpy now inlines more ctypes argtypes and restype definitions in order to work better on x64. +- libtcodpy partially rewritten to support Python 3 as best possible and resolve outstanding 64 bit problems. +- samples_py partially rewritten to run under both Python 3 and Python 2. +- Adopted strict prototypes / void in C parameterless functions (Kyle Stewart). + https://bitbucket.org/libtcod/libtcod/commits/5353098a70254b59b740865a875cccf1d6d84c27 +- SDL2 supported revision updated to release-2.0.5 AKA changeset 007dfe83abf8. + +### Fixed +- C++ TCODParser memory leak fixed. + https://bitbucket.org/libtcod/libtcod/issues/27/tcodparser-memory-leaks +- Frost sample fixed for a non-initialised data structure crash. + +### Removed +- Removed SDL1 support. +- Removed C/C++/Python API functions TCOD_sys_set_keyboard_repeat and TCOD_sys_disable_keyboard_repeat. This was SDL1 functionality, and not supported in SDL2. + +## [1.6.1] - 2016-09-23 +### Changed +- Python libtcodpy is now better at finding DLLs on Windows + https://bitbucket.org/libtcod/libtcod/commits/eda0075 + +## [1.6.0] - 2016-09-16 +### Added +- added support for autotools builds + https://bitbucket.org/libtcod/libtcod/commits/41e1c24 +- added support for Visual Studio builds +- added Visual Studio build script that can fetch and build dependencies, the project, and package up the result +- hooked up Visual Studio build script to continuous integration service to run on each commit +- libtcod is now reentrant which allows the window to be resized among other things + https://bitbucket.org/libtcod/libtcod/commits/14bad22 +- added new TCODK_TEXT event to cover the SDL2 SDL_TEXTINPUT event. + https://bitbucket.org/libtcod/libtcod/commits/7a8b072 +- lmeta and rmeta modifiers have been added to TCOD_key_t + https://bitbucket.org/libtcod/libtcod/commits/e386362 + +### Changed +- upgraded to SDL2 +- upgraded zlib to version 1.2.8 +- upgraded lodepng to the 20160501 release + https://bitbucket.org/libtcod/libtcod/commits/60c127e + +### Fixed +- fixed compilation warnings in pathing code + https://bitbucket.org/libtcod/libtcod/commits/4045633 +- fixed memory leaks in pathing (Paral Zsolt) + https://bitbucket.org/libtcod/libtcod/commits/4c4af80 +- map numlock key for SDL2 + https://bitbucket.org/libtcod/libtcod/commits/83d481c +- reset the cursor in text field when the text field is reset (cottog) + https://bitbucket.org/libtcod/libtcod/commits/6673e6c +- remove superfluous calls to SDL_PumpEvents + https://bitbucket.org/libtcod/libtcod/commits/1edf96d +- alt-tabbing back to the libtcod window would leave the window blank + https://bitbucket.org/libtcod/libtcod/commits/73fdf51 + +### Removed +- removed support for mingw builds because no-one could get it to work + +## [1.5.2] - 2012-09-07 +### Added +- added mid point displacement algorithm to the heightmap toolkit +- added TCODConsole::hasMouseFocus() and TCODConsole::isActive() +- added TCODParser::hasProperty to check if a property is defined when + using the default parser +- added `TCODText::setPos(int x, int y)` + +### Fixed +- fixed TCODConsole::waitForKeypress returning for both press and release events (returns only on press) +- fixed dynamic font switching not working +- fixed TCOD_image_blit_rect not working with odd width/height +- fixed TCODK_RWIN/TCODK_LWIN not detected +- fixed TCOD_sys_wait_event not returning on mouse events +- fixed mouse dcx/dcy fields always 0 when the cursor moves slowly +- fixed crash in Python console_map_ascii_codes_to_font + +## [1.5.1] - 2012-08-29 +### Added +- added support for python3k. The samples run with Python 3.2.3 +- added support for colored tiles. Standard font characters MUST only use greyscale colors. +- added native support for .ASC and .APF file (Ascii Paint format) + * TCODConsole::TCODConsole(const char *filename) + * bool TCODConsole::loadAsc(const char *filename) + * bool TCODConsole::saveAsc(const char *filename) const + * bool TCODConsole::loadApf(const char *filename) + * bool TCODConsole::saveApf(const char *filename) const +- added mouse wheel support in TCOD_mouse_t.wheel_up/wheel_down +- added TCODSystem::fileExists function for checking whether a given file exists +- added dice to the TCODRandom toolkit +- added support for dynamic property declaration in the parser +- added TCODList::reverse(), TCODPath::reverse(), TCODDijkstra::reverse() +- added weighted Gaussian distribution RNG +- added Gaussian distribution RNG with no minimum/maximum bounds (using only mean and standard deviance) +- added clipboard support in TCODSystem (on Linux, only X clipboard supported) +- added GLSL and OpenGL(fixed pipeline) renderer (FPS increased 880% on true color sample !!!) +- added libtcod.cfg (allows the player to tweaks libtcod overriding the game presets) +- added more TCOD_CHAR_* constants +- added TCODColor::scaleHSV (saturation and value scaling) +- added TCODColor::shiftHue (hue shifting up and down) +- added a TCODColor constructor for HSV values +- added TCODColor H, S and V separate getters and setters +- added TCODColor::rotate90 +- added native Mac OSX support +- added support for quote-less HTML color values in the parser (col=#FFFFFF instead of col="#FFFFFF") +- added color control helpers for C# (TCODConsole.getColorControlString/getRGBColorControlString) + +### Changed +- TCOD_console_wait_for_keypress, TCOD_console_check_for_keypress, TCOD_mouse_get_status + replaced with TCOD_sys_check_for_event and TCOD_sys_wait_for_event +- source width and height can be 0 in TCODConsole::blit to blit the whole console +- Some of the parser-related functions now can be chained. +- The RNG API now has less functions that choose the distribution based on the set flags. +- The noise API now has less functions that choose the noise type based on the set flags. +- Console default and cell foreground and background colour getters and setters renamed to more intuitive names: + * `TCOD_console_set_background_color` => `TCOD_console_set_default_background` + * `TCOD_console_set_foreground_color` => `TCOD_console_set_default_foreground` + * `TCOD_console_get_background_color` => `TCOD_console_get_default_background` + * `TCOD_console_get_foreground_color` => `TCOD_console_get_default_foreground` + * `TCOD_console_set_back` => `TCOD_console_set_char_background` + * `TCOD_console_set_fore` => `TCOD_console_set_char_foreground` + * `TCOD_console_get_back` => `TCOD_console_get_char_background` + * `TCOD_console_get_fore` => `TCOD_console_get_char_foreground` + * `setBackgroundColor` => `setDefaultBackground` + * `setForegroundColor` => `setDefaultForeground` + * `getBackgroundColor` => `getDefaultBackground` + * `getForegroundColor` => `getDefaultForeground` + * `setBack` => `setCharBackground` + * `setFore` => `setCharForeground` + * `getBack` => `getCharBackground` + * `getFore` => `getCharForeground` +- `TCODConsole::printLeft/Right/Center` replaced by + `TCODConsole::setBackgroundFlag(TCOD_bkgnd_flag_t)` + `TCODConsole::setAlignment(TCOD_alignment_t)` + `TCODConsole::print(int x, int y, const char *fmt, ...)` + `TCODConsole::printEx(int x, int y, TCOD_bkgnd_flag_t bkgnd, TCOD_alignment_t alignment, const char *fmt, ...)` +- added `TCOD_BKGND_DEFAULT` as default value in rect / putChar / hline / vline / setBack + the default background flag for a console is BKGND_NONE + Warning ! That mean the rect/putChar/... functions now default to BKGND_NONE + instead of BKGND_SET, except if you call setBackgroundFlag before using them. +- `TCODConsole::getHeight[Left/Right/Center]Rect` replaced by + `TCODConsole::getHeightRect(int x, int y, int w, int h, const char *fmt, ...);` + (the 3 functions were useless, the height does not depend on the alignement... X( ) +- `TCODConsole::initRoot` has an additional renderer parameter: + `static void TCODConsole::initRoot(int w, int h, const char * title, bool fullscreen = false, TCOD_renderer_t renderer=TCOD_RENDERER_SDL);` + Possible values: + - TCOD_RENDERER_GLSL + - TCOD_RENDERER_OPENGL + - TCOD_RENDERER_SDL +- `TCODMap::clear` now sets walkable and transparent status of all cells: + `void TCODMap::clear` (bool transparent = false, bool walkable = false) + `void TCOD_map_clear` (TCOD_map_t map, bool transparent, bool walkable) + map_clear (map, transparent, walkable) +- cmake compilation works on FreeBSD thanks to namor_ +- Restrictive FOV algo updated to MRPAS v1.1 (faster, better-looking, improved symmetry) +- Gaussian distribution in `TCODRandom` now uses a more precise Box-Muller transform algorithm +- More default values for `printFrame`: + `void printFrame(int x,int y,int w,int h, bool clear=true, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT, const char *fmt=NULL, ...)` +- hardened fov module +- extended list of colour constants (the old names can produce slightly different colours) +- `TCODMap` memory consumption divided by 4 +- now mouse wheel events are properly detected + +### Fixed +- fixed namegen crash if generator list is empty +- fixed permissive fov when light_walls is false +- fixed possible crash when clearing an offscreen console before calling initRoot +- fix possible crash when printing a string containing ascii codes > 127 +- fixed TCODNamegen returning integers in the Python version +- fixed TCODDijkstra segfault when diagonal movement cost was zero +- fixed setDirty() not working for the last row or column of the console +- fixed Python samples not compiling if numpy installed +- fixed Python TCOD_parser_get_list_property +- fixed TCODDijkstra destructor crash bug +- fixed TCODColor::setHSV bug when using hues below 0 or above 359 grades +- fixed some rare issues in A* pathfinding +- fixed issue in TCODImage::blit2x when blitting only a subregion of the image +- fixed memory leak in TCODImage::save + +## [1.5.0] - 2010-02-15 +### Added +- added text field toolkit (undocumented) +- added functions for fast Python full console coloring: + - console_fill_foreground(con,r,g,b) + - console_fill_background(con,r,g,b) + + r,g,b are 1D arrays of console_width * console_height +- added fast Python rendering sample (Jotaf) +- added TCODConsole::resetCredits() to restart credits animation before it's finished +- added TCODConsole::setDirty(int x, int y, int w,int h) to force libtcod to redraw a part of the console + This might by needed when using the SDL renderer +- added TCODSystem::getCharSize(int *w, int *h) to get the current font's character size +- added name generation module (Mingos) +- added Dijkstra pathfinding (Mingos) +- added approximated gaussian distribution functions in the RNG module + `float TCODRandom::getGaussian(float min, float max)` +- added subcell resolution blitting function TCODImage::blit2x +- added more portable filesystem utilities: + - `static bool TCODSystem::isDirectory(const char *path)` + - `static TCODList TCODSystem::getDirectoryContent(const char *path, const char *pattern)` +- added TCODConsole::putCharEx(int x, int y, int c, TCODColor &fore, TCODColor &back) (at last!) +- added waitThread and thread conditions support in (undocumented) threading API +- added unicode support and 4 unicode fonts courtesy of Mingos. Functions with unicode support are : + - static void TCODConsole::mapStringToFont(const wchar_t *s, int fontCharX, int fontCharY); + - void TCODConsole::printLeft(int x, int y, TCOD_bkgnd_flag_t flag, const wchar_t *fmt, ...); + - void TCODConsole::printRight(int x, int y, TCOD_bkgnd_flag_t flag, const wchar_t *fmt, ...); + - void TCODConsole::printCenter(int x, int y, TCOD_bkgnd_flag_t flag, const wchar_t *fmt, ...); + - int TCODConsole::printLeftRect(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, const wchar_t *fmt, ...); + - int TCODConsole::printRightRect(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, const wchar_t *fmt, ...); + - int TCODConsole::printCenterRect(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, const wchar_t *fmt, ...); + - int TCODConsole::getHeightLeftRect(int x, int y, int w, int h, const wchar_t *fmt, ...); + - int TCODConsole::getHeightRightRect(int x, int y, int w, int h, const wchar_t *fmt, ...); + - int TCODConsole::getHeightCenterRect(int x, int y, int w, int h,const wchar_t *fmt, ...); + + C versions of the functions have _utf suffixes. Unicode fonts are : + - fonts/consolas_unicode_10x10.png + - fonts/consolas_unicode_12x12.png + - fonts/consolas_unicode_16x16.png + - fonts/consolas_unicode_8x8.png + +### Changed +- the random number generator module now support two algorithms (Mingos) + Mersenne twister, used in previous versions of libtcod + Complementary Multiply With Carry, 2 to 3 times faster and has a much better + period. This is the default algo. + You can choose the algorithm in the constructor: + ```c + typedef enum { + TCOD_RNG_MT, + TCOD_RNG_CMWC + } TCOD_random_algo_t; + ``` + - TCODRandom() => CMWC, default seed + - TCODRandom(uint32 seed) => CMWC, custom seed + - TCODRandom(TCOD_random_algo_t algo) => default seed, custom algo + - TCODRandom(uint32 seed, TCOD_random_algo_t aldo) => custom algo and seed +- TCODConsole::printFrame now takes an extra argument: TCOD_bkgnd_flag_t +- renamed libraries on Linux to improve portability : + - libtcod++.so => libtcodxx.so + - libtcod-gui.so => libtcodgui.so +- new compilation system with a debug and release version of the library +- makefiles have been moved to a makefiles subdirectory +- libtcod credits now use subcell resolution + +### Fixed +- fixed wrong ascii code returned by check/waitForKeypress with AltGr+0-9 combination +- fixed RNG going mad if you delete the default RNG +- fixed wait_for_keypress not working in Python +- now the parser can handle strings/identifiers with unlimited size (previously limited to 256 chars) +- fixed TCODZip module missing from MSVC release +- fixed issue with TCOD_COLCTRL_FORE_RGB and TCOD_COLCTRL_BACK_RGB when using 10 or 37 in rgb values +- fixed issue in color_set_hsv Python wrapper +- fixed bug in console blitting when destination coordinates are outside the destination console + +### Removed +- TCODRandom::getIntFromByteArray has been deleted +- removed bitfield from TCOD_key_t and TCOD_mouse_t to ease wrappers writing. + existing working wrappers might be broken, though. + +## [1.4.2] - 2009-10-06 +### Added +- added possibility to use SDL drawing functions on top of the root console with TCODSystem::registerSDLRenderer +- added Mingos' restrictive precise angle shadowcasting fov algorithm as FOV_RESTRICTIVE +- heightmap: added missing `TCOD_heightmap_set_value` function +- new consolas, dejavu, lucida and prestige fonts from Mingos + +### Changed +- `TCODConsole::blit` now takes 2 float parameters: + `static void blit(const TCODConsole *src,int xSrc, int ySrc, int wSrc, int hSrc, TCODConsole *dst, int xDst, int yDst, float foreground_alpha=1.0f, float background_alpha=1.0f)` + +### Fixed +- fixed R/B inversion in color operations in Python +- fixed a crash when saving a TCODImage before initializing the root console +- fixed a crash when destroying an empty TCODZip (file not found) +- fixed torch effect in C++ sample +- fixed ASCII_IN_ROW flag not working +- fixed path_new_using_function not working in Python wrapper +- fixed alignment issues in `TCOD_console_print_*` with strings containing + ascii codes > 127 +- fixed color controls not working with autowrap +- fixed fov post-processing step to handle opaque walkable cells (for example bush) + +## [1.4.1] - 2009-03-22 +### Added +- added Python wrapper +- added arial, courier fonts courtesy of Mingos +- added some non portable filesystem utilities in TCODSystem : + - bool TCODSystem::createDirectory(const char *path); + - bool TCODSystem::deleteDirectory(const char *path); + - bool TCODSystem::deleteFile(const char *path); +- added multithread utilities in TCODSystem : + - static TCOD_thread_t TCODSystem::newThread(int (*func)(void *), void *data); + - static void TCODSystem::deleteThread(TCOD_thread_t th); + - static TCOD_mutex_t TCODSystem::newMutex(); + - static void TCODSystem::mutexIn(TCOD_mutex_t mut); + - static void TCODSystem::mutexOut(TCOD_mutex_t mut); + - static void TCODSystem::deleteMutex(TCOD_mutex_t mut); + - static TCOD_semaphore_t TCODSystem::newSemaphore(int initVal); + - static void TCODSystem::lockSemaphore(TCOD_semaphore_t sem); + - static void TCODSystem::unlockSemaphore(TCOD_semaphore_t sem); + - static void TCODSystem::deleteSemaphore( TCOD_semaphore_t sem); +- added some image utilities : + - void TCODImage::clear(const TCODColor col) + - void TCODImage::invert() + - void TCODImage::hflip() + - void TCODImage::vflip() + - void TCODImage::scale(int neww, int newh) + - void TCODImage::setKeyColor(const TCODColor keyColor) + - int TCODImage::getAlpha(int x,int y) const + - bool TCODImage::isPixelTransparent(int x, int y) const +- can now dynamically modify the content of the font bitmap: + `static void TCODSystem::updateChar(int asciiCode, int fontx, int fonty,const TCODImage *img,int x,int y)` +- added C and Python code generation in the heightmap tool +- added function to calculate the height of a printed string + (with autowrapping) without actually printing it: + - `int TCODConsole::getHeightLeftRect(int x, int y, int w, int h, const char *fmt, ...)` + - `int TCODConsole::getHeightRightRect(int x, int y, int w, int h, const char *fmt, ...)` + - `int TCODConsole::getHeightCenterRect(int x, int y, int w, int h, const char *fmt, ...)` +- parser : now strings properties can be split. The parser concatenates them: + ```c + myProperty = "string value can use " + "multi line layout" + ``` +- parser: added missing `getCharProperty` when using default listener +- heightmap: added missing `TCOD_heightmap_get_value` function +- now support fonts with unlimited number of characters + (was limited to 1024 in 1.4.0) +- added callback-based atomic bresenham function + `static bool TCODLine::line(int xFrom, int yFrom, int xTo, int yTo, TCODLineListener *listener)` +- added `TCODMap::copy` function +- added TCODList fast remove functions (don't preserve the list order) + - `template void TCODList::removeFast(const T elt)` + - `template T * TCODList::removeFast(T *elt)` + +### Changed +- Default colors have been changed/added. +- `TCODMap::computeFov` changed to support several algorithms: + `void computeFov(int playerX,int playerY, int maxRadius,bool light_walls = true, TCOD_fov_algorithm_t algo = FOV_BASIC)` + available algorithms : + - FOV_BASIC: classic libtcod fov + - FOV_DIAMOND: http://www.geocities.com/temerra/los_rays.html + - FOV_SHADOW: http://roguebasin.roguelikedevelopment.org/index.php?title=FOV_using_recursive_shadowcasting + - FOV_PERMISSIVE: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View + - light_walls: if false, wall cells are not put in the fov +- `setCustomFont` changed: + defines the font number of characters instead of character size. + if not specified, it is deduced from the layout flag + (16x16 for ascii, 32x8 for tcod) + `setCustomFont(const char *fontFile, int flags=TCOD_FONT_LAYOUT_ASCII_INCOL,int nbCharHoriz=0, int nbCharVertic=0)` + The flag values have changed too: + - TCOD_FONT_LAYOUT_ASCII_INCOL=1 + - TCOD_FONT_LAYOUT_ASCII_INROW=2 + - TCOD_FONT_TYPE_GREYSCALE=4 + - TCOD_FONT_TYPE_GRAYSCALE=4 + - TCOD_FONT_LAYOUT_TCOD=8 +- pathfinding: you don't need to provide coordinates in x,y parameters of + `Path::walk` +- improved double/simple walls special characters in tcod layout fonts + +### Fixed +- fixed SDL dependent features not being available before initRoot is called. + If you want to draw on an offscreen console without calling initRoot, you + need to call at least setCustomFont to initialize the font. Else characters won't be rendered. +- fixed standalone credits page erasing previously fps limit +- fixed special characters TCOD_CHAR_DTEE* and TCOD_CHAR_DCROSS not printing correctly +- fixed heightmap tool generated code not compiling +- fixed parser C++ error function not prepending file name & line number to the error message +- fixed memory leak in pathfinding +- fixed fov issue with walkable, non transparent cells +- fixed numerical stability issues with heightmap rain erosion +- fixed calculation error in heightmap kernel transformation function +- fixed TCODConsole::renderCredits being able to render the credits only once +- fixed mouse cx,cy coordinates in "padded" fullscreen modes +- fixed mouse cursor hidden when switching fullscreen +- fixed mouse coordinates when going fullscreen->windowed + +## [1.4.0] - 2008-10-16 +### Added +- added pathfinding module +- added BSP module +- added heightmap module + heightmap tool +- added compression toolkit +- added possibility to pre-allocate TCODList's memory +- added support for PNG images + antialiased fonts from PNG with alpha channel or greyscale +- added ASCII mapping functions to map an ascii code to any character in your font: + - `static void TCODConsole::mapAsciiCodeToFont(int asciiCode, int fontCharX, int fontCharY);` + - `static void TCODConsole::mapAsciiCodesToFont(int firstAsciiCode, int nbCodes, int fontCharX, int fontCharY);` + - `static void TCODConsole::mapStringToFont(const char *s, int fontCharX, int fontCharY);` +- parser : now strings can contain octal/hexadecimal ascii values + - myStringProperty1 = "embedded hex value : \x80" + - myStringProperty2 = "embedded octal value : \200" +- parser : now can handle list properties. + ```c + myStruct { + myProperty = [1, 2, 3] + } + ``` + to declare: `struct.addListProperty("myProperty",TCOD_TYPE_INT,true);` + to read (default parser): `TCODList prop(parser.getListProperty("myStruct.myProperty", TCOD_TYPE_INT));` +- added color map generator. Interpolate colors from an array of key colors : + `TCODColor::genMap(TCODColor *map, int nbKey, TCODColor const *keyColor, int const *keyIndex)` +- added random generator backup function. You can save the state of a generator + with `TCODRandom *TCODRandom::save()` and restore it with + `void TCODRandom::restore(const TCODRandom *backup)` +- added simplex noise, similar to perlin but faster, + especially in 4 dimensions and has better contrast: + - `TCODNoise::getSimplex` + - `TCODNoise::getFbmSimplex` + - `TCODNoise::getTurbulenceSimplex` + Simplex should be preferred over Perlin for most usages. +- added wavelet noise, similar to perlin, much slower but doesn't blur at high scales. Doesn't work in 4D : + - `TCODNoise::getWavelet` + - `TCODNoise::getFbmWavelet` + - `TCODNoise::getTurbulenceWavelet` + Noise functions relative times: + + | |2D|3D|4D| + |:------|-:|-:|-:| + |simplex| 1| 1| 1| + |perlin | 4| 5|17| + |wavelet|32|14| X| +- you can capture a console to an existing image without creating a new image + with `TCODImage::refreshConsole` +- non rectangular offscreen consoles: + you can define a key color on offscreen consoles. + Cells for which background color = key color are not blitted +- added libtcod credits function. You can either call: + `TCODConsole::credits()` to print the credits page at the start of your game + (just after `initRoot`) or + `bool TCODConsole::renderCredits(int x, int y, bool alpha)` to print the + credits on top of one of your existing page (your game menu for example). + Call it until it returns true. + +### Changed +- Noise functions renamed: + - `TCODNoise::getNoise` -> `TCODNoise::getPerlin` + - `TCODNoise::getFbm` -> `TCODNoise::getFbmPerlin` + - `TCODNoise::getTurbulence` -> `TCODNoise::getTurbulencePerlin` +- Some special char constants `TCOD_CHAR_x` added/removed +- `setCustomFont` changed: + `setCustomFont(const char *fontFile,int charWidth=8, int charHeight=8, int flags=0)` + flags: + - TCOD_FONT_LAYOUT_ASCII_INROW=1 + - TCOD_FONT_TYPE_GREYSCALE=2 + - TCOD_FONT_LAYOUT_TCOD=4 +- improved `TCODConsole::flush` performances: + frames per second for sample "True colors" (terminal.png font) on my + reference computer (windowed mode): + - libtcod 1.3.2: 130 + - libtcod 1.4.0: 300 +- `TCODNoise::getTurbulence` is twice faster +- improved mouse click detection. Even with a low framerate, mouse clicks will + always be detected and reported in the `Xbutton_pressed` fields of + `TCOD_mouse_t` +- you don't need anymore to provide values in `TCODLine::step` parameters + +### Fixed +- fixed memory leak in image module +- fixed DELETE and INSERT keys not detected +- fixed a rendering bug when using a white background color before any other + background color + +## [1.3.2] - 2008-07-14 +### Added +- added documentation for the generic container module `TCODList` + +### Fixed +- fixed not being able to open and close the root console more than once +- fixed parser not being able to attach a sub-structure to more than one structure +- fixed TCOD_image_from_console not working with root console on C version +- fixed TCODParser::newStruct, addFlag, addProperty handling only static names +- fixed web color parser (#rrggbb) in the parser module +- fixed TCODImage constructor / TCOD_image_new crashing if root console not initialized +- fixed mouse status not updated if the keyboard events are not read with checkForKeypress/waitForKeypress +- fixed fbm, turbulence functions returning NaN for high octaves values + +## [1.3.1] - 2008-06-05 +### Added +- added default parser listener for basic config files. +- added fields in `TCOD_mouse_t` to easily detect button press events: + - `lbutton_pressed`: left button pressed event + - `rbutton_pressed`: right button pressed event + - `mbutton_pressed`: middle button pressed event + + and to get the mouse movement in cell coordinates (instead of pixels) +- added functions to retrieve data from TCODMap + +### Changed +- now TCODConsole::putChar/setChar can use ascii code > 255 (ok, it's no more an ascii code, then) + this allows you to use fonts with more than 255 characters. + +### Fixed +- fixed const correctness in `TCODConsole::print*Rect` functions +- fixed a bug in fov toolkit if TCODMap width < height +- fixed `TCOD_struct_get_type` returning `TCOD_TYPE_NONE` instead of + `TCOD_TYPE_BOOL` for flags. + +## [1.3] - 2008-05-25 +### Added +- added mouse support +- added the file parser module +- added TCODColor::setHSV(float h, float s, float v) and TCODColor::getHSV(float *h, float *s, float *v) +- added TCODColor addition and scalar multiplication. All r,g,b values are clamped to [0-255] : + - C++: `color1 = color2 * 3.5f;` + `color1 = color1 + color2;` + - C : `color1 = TCOD_color_multiply_scalar(color2, 3.5f);` + `color1 = TCOD_color_add(color1, color2);` +- added `TCODConsole::setKeyboardRepeat(int initialDelay, int interval)` and + `TCODConsole::disableKeyboardRepeat()` +- added `TCODSystem::getCurrentResolution(int *w, int *h)` + +### Changed +- C++ : colors must be initialized by constructor: + - 1.2.2 : `TCODColor mycol={r,g,b};` + - 1.3 : `TCODColor mycol(r,g,b);` +- TCOD_console_check_for_keypress now has a parameter that indicates which events are tracked + - 1.2.2 : `key = TCOD_console_check_for_keypress();` + - 1.3 : `key = TCOD_console_check_for_keypress(TCOD_KEY_PRESSED);` +- now `TCODFov::computeFov` takes a maxRadius parameter. + Use 0 for unlimited range (default) +- the mouse cursor is now automatically hidden when using fullscreen +- fixed closing the window resulting in a fake 'Q' keyboard event +- fixed `TCODConsole::print*` and `TCODConsole::rect` functions crashing when + printing out of the console +- fixed `f` parameter modified when calling fbm and turbulence noise functions. + Now `f` is no more modified. +- fixed wrong ascii code in `TCOD_key_t.c` when pressing Control and a letter + key. + +## [1.2.2] - 2008-03-18 +### Added +- added helpers for real time games + - `void TCODSystem::setFps(int val)` to limit the number of frames per second. + Use 0 for unlimited fps (default) + - `int TCODSystem::getFps()` to return the number of frames rendered during + the last second + - `float TCODSystem::getLastFrameLength()` to return the length of the last + frame in seconds +- added `TCODImage::clear` to fill an image with a color + +### Changed +- `TCODConsole::hline` and `vline` now have a `TCOD_bkgnd_flag_t` parameter +- now the `TCODConsole::print*Rect` functions return the height (number of console lines) of the printed string + +### Fixed +- fixed TCODConsole::print*Rect functions not truncating the string if it reaches the bottom of the rectangle + using a rectangle height of 0 means unlimited height +- fixed a color bug when drawing text using the black color (0,0,0) +- fixed TCODConsole::waitForKeypress(true) resulting in Alt/Ctrl/Shift key state not cleared + +## [1.2.1] - 2008-03-09 +### Added +- added TCODImage::blitRect to easily map an image on a specific part of a console +- added possibility to generate an image from an offscreen console +- added TCODImage::save +- image toolkit now support reading 8bpp bitmap files. + +### Changed +- Random number generators now support inverted ranges instead of crashing: + `TCODRandom::getInstance()->getInt(10,2)` + => return a value between 2 and 10. + +### Fixed +- fixed image toolkit replacing the green component by the red one when loading a bitmap from a file +- fixed console print*Rect functions unnecessarily splitting the string in some cases +- on Linux, you don't need to link with SDL anymore when using libtcod/libtcod++ +- fixed linker issues with Visual Studio + +## [1.2] - 2008-02-26 +### Added +- new 'image' toolkit replacing some of the features previously in the 'system' toolkit. +- now windowed mode works even on 16bits desktops +- improved custom font support. + You can now use fonts with characters ordered in rows or columns and with a custom transparent color. + This allows you to use most existing character sets with the doryen library. + Font characters with grayscale are still not supported. +- new time functions: + - `uint32 TCODSystem::getElapsedMilli()` + - `float TCODSystem::getElapsedSeconds()` +- new background blending modes (see the line sample for a demo) : + - TCOD_BKGND_LIGHTEN : newbk = MAX(oldbk,curbk) + - TCOD_BKGND_DARKEN : newbk = MIN(oldbk,curbk) + - TCOD_BKGND_SCREEN : newbk = white - (white - oldbk) * (white - curbk) // inverse of multiply : (1-newbk) = (1-oldbk)*(1-curbk) + - TCOD_BKGND_COLOR_DODGE : newbk = curbk / (white - oldbk) + - TCOD_BKGND_COLOR_BURN : newbk = white - (white - oldbk) / curbk + - TCOD_BKGND_ADD : newbk = oldbk + curbk + - TCOD_BKGND_ADDALPHA(alpha) : newbk = oldbk + alpha * curbk, 0.0<=alpha<=1.0 + - TCOD_BKGND_BURN : newbk = oldbk + curbk - white + - TCOD_BKGND_OVERLAY : newbk = curbk <= 0.5 ? 2*curbk*oldbk : white - 2*(white-curbk)*(white-oldbk) + - TCOD_BKGND_ALPHA(alpha) : newbk = (1.0f-alpha)*oldbk + alpha*(curbk-oldbk), 0.0<=alpha<=1.0 +- The samples can now use custom bitmap fonts / screen resolution. Use following syntax : + sample_c[pp] [options] + options : + * -fullscreen : start directly in fullscreen mode + * -font (default "terminal.bmp") + * -font-char-size (default 8 8) + * -font-layout (default 16 16) + * -font-in-row : characters in the bitmap are ordered in rows (default : columns) + * -font-key-color : transparent color, r,g,b between 0 and 255. (default 0 0 0) + * -fullscreen-resolution (default 640 400) + +### Changed +- headers renamed from `tcodlib.h*` to `libtcod.h*` +- on Linux, the library is split into `libtcod.so` and `libtcod++.so` + allowing C developers to use it without installing g++ +- the font name is no more a parameter of `TCODConsole::initRoot` +- `TCODConsole::setBitmapFontSize` renamed to `TCODConsole::setCustomFont` +- `TCODConsole::printFrame` is now a variadic function, like the other text output functions +- some background blending flags have been renamed: + - `TCOD_BKGND_NOBK` replaced by `TCOD_BKGND_NONE` + - `TCOD_BKGND_BK` replaced by `TCOD_BKGND_SET` +- the fov toolkit now uses two properties per cell : `transparent`/`walkable`. + This is necessary to fix a fov issue with window cells (transparent, but not walkable). + `void TCODFov::setTransparent(int x,int y, bool isTransparent)` has been replaced by : + `void TCODFov::setProperties(int x,int y, bool isTransparent, bool isWalkable)` +- improved const correctness, added some default parameter values in the C++ API. + +### Fixed +- fixed the window size when using a custom font size +- fixed `TCODK_PRINTSCREEN` key event not detected +- fixed crash in printing functions if the string length was > 255. + Now they can handle strings of any size. + +## [1.1] - 2008-01-27 +### Added +- added the noise toolkit +- added the field of view toolkit +- added customizable bitmap font size + +## [1.0.1] - 2008-01-19 +### Added +- added C/C++ samples + +### Changed +- `TCODConsole::waitForKeyPress` now has a bool parameter indicating if we + flush the keyboard buffer before waiting. + +### Fixed +- fixed a color bug when drawing text using the grey color (196,196,196) +- fixed wrong key codes returned by wait/checkForKeyPress on some keyboard layouts + +## [1.0] - 2008-01-05 +- Initial release diff --git a/tcod_sys/libtcod/LIBTCOD-CREDITS.txt b/tcod_sys/libtcod/LIBTCOD-CREDITS.txt index 2d530edb3..cfbcea982 100644 --- a/tcod_sys/libtcod/LIBTCOD-CREDITS.txt +++ b/tcod_sys/libtcod/LIBTCOD-CREDITS.txt @@ -6,23 +6,26 @@ Products : http://lodev.org/lodepng - SDL 2, by Sam Lantinga http://www.libsdl.org +- stb_sprintf, originally by Jeff Roberts / RAD Game Tools, 2015/10/20 + http://github.com/nothings/stb + (modified to compile for C89) Many thanks to everyone who provided feedback and patches, and especially : -- Dominik 'Mingos' Marczuk for the restrictive shadowcasting fov, djikstra - pathfinding, name generator, documentation skin, lots of bitmap fonts and +- Dominik 'Mingos' Marczuk for the restrictive shadowcasting fov, djikstra + pathfinding, name generator, documentation skin, lots of bitmap fonts and being the #1 libtcod user, supporter and contributor. -- Joao 'Jotaf' Henriques for his long time support, priceless comments and +- Joao 'Jotaf' Henriques for his long time support, priceless comments and suggestions and the awesome Python tutorial. - Chris 'donblas' Hamons for libtcod-net, the cmake system, the swig wrappers... - Jonathon Duerig for the permissive field of view algorithm -- dividee for polishing and optimizing the Python wrapper. +- dividee for polishing and optimizing the Python wrapper. - John Klimek for the early C# port and valuable bug fixes. -- Kyle 'Hex Decimal' Stewart & Emmanuel 'Altefcat' Dempur for their contribution +- Kyle 'Hex Decimal' Stewart & Emmanuel 'Altefcat' Dempur for their contribution to the Python port. -- Antagonist for the awesome SkyFire GLSL roguelike engine, hence libtcod's GLSL +- Antagonist for the awesome SkyFire GLSL roguelike engine, hence libtcod's GLSL renderer - Sandman for various tricky bug fixes. -- Joe Osborn for the OSX port, bug fixes and the bresenham 3d routines (still +- Joe Osborn for the OSX port, bug fixes and the bresenham 3d routines (still to be backported from the old 1.5 branch...). - Paul Sexton for the common Lisp wrapper. - Bernard Helyer for the D wrapper. @@ -31,13 +34,13 @@ Many thanks to everyone who provided feedback and patches, and especially : - Matt Sullivan for the py3k support - namor for the FreeBSD cmake support - Anylo for putting some of the demos in the cmake compilation -- Michael De Rosa, Killer_X and Joe Rumsey for their work on OSX port +- Michael De Rosa, Killer_X and Joe Rumsey for their work on OSX port - Denis Belov for fixes on the heightmap toolkit - owners of projects using libtcod. Fonts : The celtic garamond and dundalk fonts are from 1001freefonts.com. The caeldera font is from blambot.com. -Other fonts are included in windows. +Other fonts are included in windows. The celtic_garamond, arial, courier, dejavu, consolas, prestige and lucida 10x10/12x12 bitmap fonts were created by Mingos. diff --git a/tcod_sys/libtcod/LIBTCOD-LICENSE.txt b/tcod_sys/libtcod/LIBTCOD-LICENSE.txt index cdc961b83..b8a320974 100644 --- a/tcod_sys/libtcod/LIBTCOD-LICENSE.txt +++ b/tcod_sys/libtcod/LIBTCOD-LICENSE.txt @@ -1,5 +1,5 @@ -* libtcod 1.6.3 -* Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew +* libtcod +* Copyright (c) 2008-2018 Jice & Mingos & rmtew * All rights reserved. * * libtcod 'The Doryen library' is a cross-platform C/C++ library for roguelike @@ -14,8 +14,9 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote products -* derived from this software without specific prior written permission. +* * The name of Jice or Mingos may not be used to endorse or promote +* products derived from this software without specific prior written +* permission. * * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/tcod_sys/libtcod/README-linux-SDL2.md b/tcod_sys/libtcod/README-linux-SDL2.md index 823c4c861..c661a50bb 100644 --- a/tcod_sys/libtcod/README-linux-SDL2.md +++ b/tcod_sys/libtcod/README-linux-SDL2.md @@ -41,7 +41,7 @@ Download the latest libtcod version, build it and install it: $ hg clone https://bitbucket.org/libtcod/libtcod $ cd libtcod/build/autotools - $ autoreconf -i # if building from hg + $ autoreconf -i $ ./configure CFLAGS='-O2' $ make diff --git a/tcod_sys/libtcod/README.md b/tcod_sys/libtcod/README.md index 958ee65c2..3d31eaeeb 100644 --- a/tcod_sys/libtcod/README.md +++ b/tcod_sys/libtcod/README.md @@ -4,7 +4,7 @@ libtcod is a free, fast, portable and uncomplicated API for roguelike developers providing an advanced true color console, input, and lots of other utilities frequently used in roguelikes. -1.6.3 (pre-release): [![Build status](https://ci.appveyor.com/api/projects/status/6jh07hq205iy0mlh/branch/default?svg=true)](https://ci.appveyor.com/project/rmtew/libtcod/branch/default) +Status: [![Build status](https://ci.appveyor.com/api/projects/status/6jh07hq205iy0mlh/branch/default?svg=true)](https://ci.appveyor.com/project/rmtew/libtcod/branch/default) ## What can it do? ## @@ -49,7 +49,7 @@ MacOS users with a working Homebrew installation, can install the necessary depe ## Getting Started ## -The latest documentation is updated with every significant change made to libtcod. You can find it in [the doc directory](https://bitbucket.org/libtcod/libtcod/src/tip/doc/index2.html?at=default&fileviewer=file-view-default). Similarly, [the changelog]()https://bitbucket.org/libtcod/libtcod/src/tip/libtcod-CHANGELOG.txt?at=default provides a high level overview of the things you might need to be aware of when later updating libtcod. +The latest documentation is updated with every significant change made to libtcod. You can find it in [the doc directory](https://bitbucket.org/libtcod/libtcod/src/tip/doc/index2.html?at=default&fileviewer=file-view-default). Similarly, [the changelog](https://bitbucket.org/libtcod/libtcod/src/tip/libtcod-CHANGELOG.txt?at=default) provides a high level overview of the things you might need to be aware of when later updating libtcod. libtcod comes with a sample application, implementations of which are provided in each of C ([samples_c.c](https://bitbucket.org/libtcod/libtcod/src/tip/samples/samples_c.c?at=default)), C++ ([samples_cpp.cpp](https://bitbucket.org/libtcod/libtcod/src/tip/samples/samples_cpp.cpp?at=default)) and Python ([samples_py.py](https://bitbucket.org/libtcod/libtcod/src/tip/python/samples_py.py?at=default)). This provides a decent overview of the basic features, in an interactive fashion. Each should be identical for the most part, so if you are using Windows, downloading the precompiled binaries and running the included `samples.exe` which is compiled from the C source code, should be representative of the other versions. diff --git a/tcod_sys/libtcod/libtcod-CHANGELOG.txt b/tcod_sys/libtcod/libtcod-CHANGELOG.txt deleted file mode 100644 index a4efd155e..000000000 --- a/tcod_sys/libtcod/libtcod-CHANGELOG.txt +++ /dev/null @@ -1,582 +0,0 @@ -X API break -+ new features -% modified features -- removed features, fixed bugs -This project does not adhere to Semantic Versioning. http://semver.org/ -========================================================= -1.6.3 : 2017-02-26 -+ Added SCons build support (HexDecimal@bitbucket). - https://bitbucket.org/libtcod/libtcod/commits/92c5a1b530049f15d1ed36375b12781554272f17 -+ Exposed clipboard API to Python (rmtew@bitbucket). -+ Added TravisCI integration tests (Kyle Stewart) https://bitbucket.org/libtcod/libtcod/pull-requests/61 -+ Added .gitattributes and .gitignore files (Kyle Stewart) https://bitbucket.org/libtcod/libtcod/pull-requests/61 -% Updated restrictive FOV code to match MRPAS v1.2 (mingos@bitbucket) - https://bitbucket.org/libtcod/libtcod/commits/28a19912ac7fef6e68164fb8970230517888c9ff -% Per-platform clipboard get/set code has been removed, and the SDL2 API is used instead (rmtew@bitbucket). - The clipboard encoding is now UTF-8 on all platforms. - https://bitbucket.org/libtcod/libtcod/issues/81/ -% Documented and undeprecated TCOD_mouse_get_status() as the state is awkwardly exposed via check/wait event calls anyway (rmtew@bitbucket). -% Switched Python tests to use pytest instead of unittest. (Kyle Stewart) - https://bitbucket.org/libtcod/libtcod/pull-requests/61 -- TCOD_path_walk now considers negative values to be blocking the path (HexDecimal@bitbucket) - https://bitbucket.org/libtcod/libtcod/commits/fc8c88ec9b5d7b113ba3a7906f526daba81b543c -- Fix key handling in name generator in C sample (reported by Chris Hamons@bitbucket) - https://bitbucket.org/libtcod/libtcod/issues/83/ -- Fix for broken SDL callback (reported by grimstain@bitbucket) - https://bitbucket.org/libtcod/libtcod/issues/78/sdl-callback-null-pixels -- Fix for memory leak introduced with the foreground/background image change (Aaron Wise). - https://bitbucket.org/libtcod/libtcod/commits/275e8bd97000599e9d87bfa138fa72c066b1cae7 -- Fix for bug in Slider::setFormat() which left a dangling pointer (reported by Kai Kratz@bitbucket) - https://bitbucket.org/libtcod/libtcod/commits/07c1214077d121107c5ad8ee38c589ad677f5e76 -- Fix potential wavelet related memory leak in TCOD_noise_delete() (HexDecimal@bitbucket) - https://bitbucket.org/libtcod/libtcod/commits/a03a79814fd734e05e5d72801376b2af6b315373 -- Fix libtcodpy return type for TCOD_console_put_char_ex and TCOD_console_put_char (HexDecimal@bitbucket) - https://bitbucket.org/libtcod/libtcod/commits/a03a79814fd734e05e5d72801376b2af6b315373 -- Fix libtcodpy arguments for TCOD_heightmap_add_fbm and TCOD_heightmap_scale_fbm (HexDecimal@bitbucket) - https://bitbucket.org/libtcod/libtcod/commits/6f34ffa3d17af39cc274c048ff633be8609998f8 -- Fixed creating a libtcodpy pathfinder with a callback would crash on 64-bit Unix systems (Kyle Stewart) - https://bitbucket.org/libtcod/libtcod/pull-requests/61 -========================================================= -1.6.2 : 2016-12-28 -+ doctcod command added to VS2015 solution. -+ Python (PTVS) project for samples_py added to VS2015 solution. -+ Console foreground and background colours are images. - https://bitbucket.org/libtcod/libtcod/issues/51/console-image-unification -+ Python unit tests added (Kyle Stewart). - https://bitbucket.org/libtcod/libtcod/commits/7a66ad5d66832686c0071e3938b85ebad8e7cebb -+ Added TCOD_console_get_background_color_image and TCOD_console_get_foreground_color_image API for C++/C/Python. -% crash bugs fixed in documentation generation. -% libtcodpy when loading a DLL now explicitly compares the architecture of the Python version uses, to the architecture of the DLL and exits outputting any difference. -% libtcodpy now uses more wrapper functions on Windows to cover ctypes limitations in passing and returning struct values. -% libtcodpy now inlines more ctypes argtypes and restype definitions in order to work better on x64. -% libtcodpy partially rewritten to support Python 3 as best possible and resolve outstanding 64 bit problems. -% samples_py partially rewritten to run under both Python 3 and Python 2. -% C++ TCODParser memory leak fixed. - https://bitbucket.org/libtcod/libtcod/issues/27/tcodparser-memory-leaks -% Adopted strict prototypes / void in C parameterless functions (Kyle Stewart). - https://bitbucket.org/libtcod/libtcod/commits/5353098a70254b59b740865a875cccf1d6d84c27 -% Frost sample fixed for a non-initialised data structure crash. -% SDL2 supported revision updated to release-2.0.5 AKA changeset 007dfe83abf8. -X Removed SDL1 support. -X Removed C/C++/Python API functions TCOD_sys_set_keyboard_repeat and TCOD_sys_disable_keyboard_repeat. This was SDL1 functionality, and not supported in SDL2. -========================================================= -1.6.1 : 2016 Sep 23 -% Python libtcodpy is now better at finding DLLs on Windows - https://bitbucket.org/libtcod/libtcod/commits/eda0075 -========================================================= -1.6.0 : 2016 Sep 16 -+ added support for autotools builds - https://bitbucket.org/libtcod/libtcod/commits/41e1c24 -+ added support for Visual Studio builds -+ added Visual Studio build script that can fetch and build dependencies, the project, and package up the result -+ hooked up Visual Studio build script to continuous integration service to run on each commit -+ libtcod is now reentrant which allows the window to be resized among other things - https://bitbucket.org/libtcod/libtcod/commits/14bad22 -+ added new TCODK_TEXT event to cover the SDL2 SDL_TEXTINPUT event. - https://bitbucket.org/libtcod/libtcod/commits/7a8b072 -% upgraded to SDL2 -% upgraded zlib to version 1.2.8 -% upgraded lodepng to the 20160501 release - https://bitbucket.org/libtcod/libtcod/commits/60c127e -% fixed compilation warnings in pathing code - https://bitbucket.org/libtcod/libtcod/commits/4045633 -% fixed memory leaks in pathing (Paral Zsolt) - https://bitbucket.org/libtcod/libtcod/commits/4c4af80 -% lmeta and rmeta modifiers have been added to TCOD_key_t - https://bitbucket.org/libtcod/libtcod/commits/e386362 -% map numlock key for SDL2 - https://bitbucket.org/libtcod/libtcod/commits/83d481c -% reset the cursor in text field when the text field is reset (cottog) - https://bitbucket.org/libtcod/libtcod/commits/6673e6c -% remove superfluous calls to SDL_PumpEvents - https://bitbucket.org/libtcod/libtcod/commits/1edf96d -% alt-tabbing back to the libtcod window would leave the window blank - https://bitbucket.org/libtcod/libtcod/commits/73fdf51 -- removed support for mingw builds because no-one could get it to work -========================================================= -1.5.2 : ? -+ added mid point displacement algorithm to the heightmap toolkit -+ added TCODConsole::hasMouseFocus() and TCODConsole::isActive() -+ added TCODParser::hasProperty to check if a property is defined when - using the default parser -+ added TCODText::setPos(int x, int y) -- fixed TCODConsole::waitForKeypress returning for both press and release events (returns only on press) -- fixed dynamic font switching not working -- fixed TCOD_image_blit_rect not working with odd width/height -- fixed TCODK_RWIN/TCODK_LWIN not detected -- fixed TCOD_sys_wait_event not returning on mouse events -- fixed mouse dcx/dcy fields always 0 when the cursor moves slowly -- fixed crash in Python console_map_ascii_codes_to_font -========================================================= -1.5.1 : 2012 Aug 29 -X TCOD_console_wait_for_keypress, TCOD_console_check_for_keypress, TCOD_mouse_get_status - replaced with TCOD_sys_check_for_event and TCOD_sys_wait_for_event -X source width and height can be 0 in TCODConsole::blit to blit the whole console -X Some of the parser-related functions now can be chained. -X The RNG API now has less functions that choose the distribution based on the set flags. -X The noise API now has less functions that choose the noise type based on the set flags. -X Console default and cell foreground and background colour getters and setters renamed to more intuitive names: - * TCOD_console_set_background_color => TCOD_console_set_default_background - * TCOD_console_set_foreground_color => TCOD_console_set_default_foreground - * TCOD_console_get_background_color => TCOD_console_get_default_background - * TCOD_console_get_foreground_color => TCOD_console_get_default_foreground - * TCOD_console_set_back => TCOD_console_set_char_background - * TCOD_console_set_fore => TCOD_console_set_char_foreground - * TCOD_console_get_back => TCOD_console_get_char_background - * TCOD_console_get_fore => TCOD_console_get_char_foreground - * setBackgroundColor => setDefaultBackground - * setForegroundColor => setDefaultForeground - * getBackgroundColor => getDefaultBackground - * getForegroundColor => getDefaultForeground - * setBack => setCharBackground - * setFore => setCharForeground - * getBack => getCharBackground - * getFore => getCharForeground -X TCODConsole::printLeft/Right/Center replaced by - TCODConsole::setBackgroundFlag(TCOD_bkgnd_flag_t) - TCODConsole::setAlignment(TCOD_alignment_t) - TCODConsole::print(int x, int y, const char *fmt, ...) - TCODConsole::printEx(int x, int y, TCOD_bkgnd_flag_t bkgnd, TCOD_alignment_t alignment, const char *fmt, ...) - added TCOD_BKGND_DEFAULT as default value in rect / putChar / hline / vline / setBack - the default background flag for a console is BKGND_NONE - Warning ! That mean the rect/putChar/... functions now default to BKGND_NONE - instead of BKGND_SET, except if you call setBackgroundFlag before using them. -X TCODConsole::getHeightLeft/Right/CenterRect replaced by - TCODConsole::getHeightRect(int x, int y, int w, int h, const char *fmt, ...); - (the 3 functions were useless, the height does not depend on the alignement... X( ) -X TCODConsole::initRoot has an additional renderer parameter : - static void TCODConsole::initRoot(int w, int h, const char * title, bool fullscreen = false, - TCOD_renderer_t renderer=TCOD_RENDERER_SDL); - Possible values : TCOD_RENDERER_GLSL, TCOD_RENDERER_OPENGL or TCOD_RENDERER_SDL -X TCODMap::clear now sets walkable and transparent status of all cells: - void TCODMap::clear (bool transparent = false, bool walkable = false) - void TCOD_map_clear (TCOD_map_t map, bool transparent, bool walkable) - map_clear (map, transparent, walkable) -+ cmake compilation works on FreeBSD thanks to namor_ -+ added support for python3k. The samples run with Python 3.2.3 -+ added support for colored tiles. Standard font characters MUST only use greyscale colors. -+ added native support for .ASC and .APF file (Ascii Paint format) - * TCODConsole::TCODConsole(const char *filename) - * bool TCODConsole::loadAsc(const char *filename) - * bool TCODConsole::saveAsc(const char *filename) const - * bool TCODConsole::loadApf(const char *filename) - * bool TCODConsole::saveApf(const char *filename) const -+ added mouse wheel support in TCOD_mouse_t.wheel_up/wheel_down -+ added TCODSystem::fileExists function for checking whether a given file exists -+ added dice to the TCODRandom toolkit -+ added support for dynamic property declaration in the parser -+ added TCODList::reverse(), TCODPath::reverse(), TCODDijkstra::reverse() -+ added weighted Gaussian distribution RNG -+ added Gaussian distribution RNG with no minimum/maximum bounds (using only mean and standard deviance) -+ added clipboard support in TCODSystem (on Linux, only X clipboard supported) -+ added GLSL and OpenGL(fixed pipeline) renderer (FPS increased 880% on true color sample !!!) -+ added libtcod.cfg (allows the player to tweaks libtcod overriding the game presets) -+ added more TCOD_CHAR_* constants -+ added TCODColor::scaleHSV (saturation and value scaling) -+ added TCODColor::shiftHue (hue shifting up and down) -+ added a TCODColor constructor for HSV values -+ added TCODColor H, S and V separate getters and setters -+ added TCODColor::rotate90 -+ added native Mac OSX support -+ added support for quote-less HTML color values in the parser (col=#FFFFFF instead of col="#FFFFFF") -+ added color control helpers for C# (TCODConsole.getColorControlString/getRGBColorControlString) -% Restrictive FOV algo updated to MRPAS v1.1 (faster, better-looking, improved symmetry) -% Gaussian distribution in TCODRandom now uses a more precise Box-Muller transform algorithm -% More default values for printFrame : - void printFrame(int x,int y,int w,int h, bool clear=true, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT, const char *fmt=NULL, ...) -% hardened fov module -% extended list of colour constants (the old names can produce slightly different colours) -% TCODMap memory consumption divided by 4 -% now mouse wheel events are properly detected -- fixed namegen crash if generator list is empty -- fixed permissive fov when light_walls is false -- fixed possible crash when clearing an offscreen console before calling initRoot -- fix possible crash when printing a string containing ascii codes > 127 -- fixed TCODNamegen returning integers in the Python version -- fixed TCODDijkstra segfault when diagonal movement cost was zero -- fixed setDirty() not working for the last row or column of the console -- fixed Python samples not compiling if numpy installed -- fixed Python TCOD_parser_get_list_property -- fixed TCODDijkstra destructor crash bug -- fixed TCODColor::setHSV bug when using hues below 0 or above 359 grades -- fixed some rare issues in A* pathfinding -- fixed issue in TCODImage::blit2x when blitting only a subregion of the image -- fixed memory leak in TCODImage::save -========================================================= -1.5.0 : 2010 Feb 15 -X TCODRandom::getIntFromByteArray has been deleted -X the random number generator module now support two algorithms (Mingos) - Mersenne twister, used in previous versions of libtcod - Complementary Multiply With Carry, 2 to 3 times faster and has a much better period. This is the default algo. - You can choose the algorithm in the constructor : - typedef enum { - TCOD_RNG_MT, - TCOD_RNG_CMWC - } TCOD_random_algo_t; - TCODRandom() => CMWC, default seed - TCODRandom(uint32 seed) => CMWC, custom seed - TCODRandom(TCOD_random_algo_t algo) => default seed, custom algo - TCODRandom(uint32 seed, TCOD_random_algo_t aldo) => custom algo and seed -X removed bitfield from TCOD_key_t and TCOD_mouse_t to ease wrappers writing. - existing working wrappers might be broken, though. -X TCODConsole::printFrame now takes an extra argument: TCOD_bkgnd_flag_t -X renamed libraries on Linux to improve portability : - libtcod++.so => libtcodxx.so - libtcod-gui.so => libtcodgui.so -+ added text field toolkit (undocumented) -+ added functions for fast Python full console coloring: - console_fill_foreground(con,r,g,b) - console_fill_background(con,r,g,b) - r,g,b are 1D arrays of console_width * console_height -+ added fast Python rendering sample (Jotaf) -+ added TCODConsole::resetCredits() to restart credits animation before it's finished -+ added TCODConsole::setDirty(int x, int y, int w,int h) to force libtcod to redraw a part of the console - This might by needed when using the SDL renderer -+ added TCODSystem::getCharSize(int *w, int *h) to get the current font's character size -+ added name generation module (Mingos) -+ added Dijkstra pathfinding (Mingos) -+ added approximated gaussian distribution functions in the RNG module - float TCODRandom::getGaussian(float min, float max) -+ added subcell resolution blitting function TCODImage::blit2x -+ added more portable filesystem utilities : - static bool TCODSystem::isDirectory(const char *path) - static TCODList TCODSystem::getDirectoryContent(const char *path, const char *pattern) -+ added TCODConsole::putCharEx(int x, int y, int c, TCODColor &fore, TCODColor &back) (at last!) -+ added waitThread and thread conditions support in (undocumented) threading API -+ added unicode support and 4 unicode fonts courtesy of Mingos. Functions with unicode support are : - static void TCODConsole::mapStringToFont(const wchar_t *s, int fontCharX, int fontCharY); - void TCODConsole::printLeft(int x, int y, TCOD_bkgnd_flag_t flag, const wchar_t *fmt, ...); - void TCODConsole::printRight(int x, int y, TCOD_bkgnd_flag_t flag, const wchar_t *fmt, ...); - void TCODConsole::printCenter(int x, int y, TCOD_bkgnd_flag_t flag, const wchar_t *fmt, ...); - int TCODConsole::printLeftRect(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, const wchar_t *fmt, ...); - int TCODConsole::printRightRect(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, const wchar_t *fmt, ...); - int TCODConsole::printCenterRect(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, const wchar_t *fmt, ...); - int TCODConsole::getHeightLeftRect(int x, int y, int w, int h, const wchar_t *fmt, ...); - int TCODConsole::getHeightRightRect(int x, int y, int w, int h, const wchar_t *fmt, ...); - int TCODConsole::getHeightCenterRect(int x, int y, int w, int h,const wchar_t *fmt, ...); - C versions of the functions have _utf suffixes. Unicode fonts are : - fonts/consolas_unicode_10x10.png - fonts/consolas_unicode_12x12.png - fonts/consolas_unicode_16x16.png - fonts/consolas_unicode_8x8.png -% new compilation system with a debug and release version of the library -% makefiles have been moved to a makefiles subdirectory -% libtcod credits now use subcell resolution -- fixed wrong ascii code returned by check/waitForKeypress with AltGr+0-9 combination -- fixed RNG going mad if you delete the default RNG -- fixed wait_for_keypress not working in Python -- now the parser can handle strings/identifiers with unlimited size (previously limited to 256 chars) -- fixed TCODZip module missing from MSVC release -- fixed issue with TCOD_COLCTRL_FORE_RGB and TCOD_COLCTRL_BACK_RGB when using 10 or 37 in rgb values -- fixed issue in color_set_hsv Python wrapper -- fixed bug in console blitting when destination coordinates are outside the destination console -========================================================= -1.4.2 : 2009 Oct 06 -X TCODConsole::blit now takes 2 float parameters : - static void blit(const TCODConsole *src,int xSrc, int ySrc, int wSrc, int hSrc, TCODConsole *dst, int xDst, int yDst, float foreground_alpha=1.0f, float background_alpha=1.0f) -+ added possibility to use SDL drawing functions on top of the root console with TCODSystem::registerSDLRenderer -+ added Mingos' restrictive precise angle shadowcasting fov algorithm as FOV_RESTRICTIVE -+ heightmap : added missing TCOD_heightmap_set_value function -+ new consolas, dejavu, lucida and prestige fonts from Mingos -- fixed R/B inversion in color operations in Python -- fixed a crash when saving a TCODImage before initializing the root console -- fixed a crash when destroying an empty TCODZip (file not found) -- fixed torch effect in C++ sample -- fixed ASCII_IN_ROW flag not working -- fixed path_new_using_function not working in Python wrapper -- fixed alignment issues in TCOD_console_print_* with strings containing ascii codes > 127 -- fixed color controls not working with autowrap -- fixed fov post-processing step to handle opaque walkable cells (for example bush) -========================================================= -1.4.1 : 2009 Mar 22 -X Default colors have been changed/added. -X TCODMap::computeFov changed to support several algorithms : - void computeFov(int playerX,int playerY, int maxRadius,bool light_walls = true, TCOD_fov_algorithm_t algo = FOV_BASIC) - available algorithms : - FOV_BASIC : classic libtcod fov - FOV_DIAMOND : http://www.geocities.com/temerra/los_rays.html - FOV_SHADOW : http://roguebasin.roguelikedevelopment.org/index.php?title=FOV_using_recursive_shadowcasting - FOV_PERMISSIVE : http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View - light_walls : if false, wall cells are not put in the fov -X setCustomFont changed : - defines the font number of characters instead of character size - if not specified, it is deduced from the layout flag (16x16 for ascii, 32x8 for tcod) - setCustomFont(const char *fontFile, int flags=TCOD_FONT_LAYOUT_ASCII_INCOL,int nbCharHoriz=0, int nbCharVertic=0) - The flag values have changed too: - TCOD_FONT_LAYOUT_ASCII_INCOL=1, - TCOD_FONT_LAYOUT_ASCII_INROW=2, - TCOD_FONT_TYPE_GREYSCALE=4, - TCOD_FONT_TYPE_GRAYSCALE=4, - TCOD_FONT_LAYOUT_TCOD=8, -+ added Python wrapper -+ added arial, courier fonts courtesy of Mingos -+ added some non portable filesystem utilities in TCODSystem : - bool TCODSystem::createDirectory(const char *path); - bool TCODSystem::deleteDirectory(const char *path); - bool TCODSystem::deleteFile(const char *path); -+ added multithread utilities in TCODSystem : - static TCOD_thread_t TCODSystem::newThread(int (*func)(void *), void *data); - static void TCODSystem::deleteThread(TCOD_thread_t th); - static TCOD_mutex_t TCODSystem::newMutex(); - static void TCODSystem::mutexIn(TCOD_mutex_t mut); - static void TCODSystem::mutexOut(TCOD_mutex_t mut); - static void TCODSystem::deleteMutex(TCOD_mutex_t mut); - static TCOD_semaphore_t TCODSystem::newSemaphore(int initVal); - static void TCODSystem::lockSemaphore(TCOD_semaphore_t sem); - static void TCODSystem::unlockSemaphore(TCOD_semaphore_t sem); - static void TCODSystem::deleteSemaphore( TCOD_semaphore_t sem); -+ added some image utilities : - void TCODImage::clear(const TCODColor col) - void TCODImage::invert() - void TCODImage::hflip() - void TCODImage::vflip() - void TCODImage::scale(int neww, int newh) - void TCODImage::setKeyColor(const TCODColor keyColor) - int TCODImage::getAlpha(int x,int y) const - bool TCODImage::isPixelTransparent(int x, int y) const -+ can now dynamically modify the content of the font bitmap : - static void TCODSystem::updateChar(int asciiCode, int fontx, int fonty,const TCODImage *img,int x,int y) -+ added C and Python code generation in the heightmap tool -+ added function to calculate the height of a printed string (with autowrapping) - without actually printing it : - int TCODConsole::getHeightLeftRect(int x, int y, int w, int h, const char *fmt, ...) - int TCODConsole::getHeightRightRect(int x, int y, int w, int h, const char *fmt, ...) - int TCODConsole::getHeightCenterRect(int x, int y, int w, int h, const char *fmt, ...) -+ parser : now strings properties can be split. The parser concatenates them : - myProperty = "string value can use " - "multi line layout" -+ parser : added missing getCharProperty when using default listener -+ heightmap : added missing TCOD_heightmap_get_value function -+ now support fonts with unlimited number of characters (was limited to 1024 in 1.4.0) -+ added callback-based atomic bresenham function - static bool TCODLine::line(int xFrom, int yFrom, int xTo, int yTo, TCODLineListener *listener) -+ added TCODMap::copy function -+ added TCODList fast remove functions (don't preserve the list order) - template void TCODList::removeFast(const T elt) - template T * TCODList::removeFast(T *elt) -% pathfinding : you don't need to provide coordinates in x,y parameters of Path::walk -% improved double/simple walls special characters in tcod layout fonts -- fixed SDL dependent features not being available before initRoot is called. - If you want to draw on an offscreen console without calling initRoot, you - need to call at least setCustomFont to initialize the font. Else characters won't be rendered. -- fixed standalone credits page erasing previously fps limit -- fixed special characters TCOD_CHAR_DTEE* and TCOD_CHAR_DCROSS not printing correctly -- fixed heightmap tool generated code not compiling -- fixed parser C++ error function not prepending file name & line number to the error message -- fixed memory leak in pathfinding -- fixed fov issue with walkable, non transparent cells -- fixed numerical stability issues with heightmap rain erosion -- fixed calculation error in heightmap kernel transformation function -- fixed TCODConsole::renderCredits being able to render the credits only once -- fixed mouse cx,cy coordinates in "padded" fullscreen modes -- fixed mouse cursor hidden when switching fullscreen -- fixed mouse coordinates when going fullscreen->windowed -========================================================= -1.4.0 : 2008 Oct 16 -X Noise functions renamed : - TCODNoise::getNoise -> TCODNoise::getPerlin - TCODNoise::getFbm -> TCODNoise::getFbmPerlin - TCODNoise::getTurbulence -> TCODNoise::getTurbulencePerlin -X Some special char constants (TCOD_CHAR_xxx) added/removed -X setCustomFont changed : - setCustomFont(const char *fontFile,int charWidth=8, int charHeight=8, int flags=0) - flags : - TCOD_FONT_LAYOUT_ASCII_INROW=1 - TCOD_FONT_TYPE_GREYSCALE=2 - TCOD_FONT_LAYOUT_TCOD=4 -+ added pathfinding module -+ added BSP module -+ added heightmap module + heightmap tool -+ added compression toolkit -+ added possibility to pre-allocate TCODList's memory -+ added support for PNG images + antialiased fonts from PNG with alpha channel or greyscale -+ added ASCII mapping functions to map an ascii code to any character in your font : - static void TCODConsole::mapAsciiCodeToFont(int asciiCode, int fontCharX, int fontCharY); - static void TCODConsole::mapAsciiCodesToFont(int firstAsciiCode, int nbCodes, int fontCharX, int fontCharY); - static void TCODConsole::mapStringToFont(const char *s, int fontCharX, int fontCharY); -+ parser : now strings can contain octal/hexadecimal ascii values - myStringProperty1 = "embedded hex value : \x80" - myStringProperty2 = "embedded octal value : \200" -+ parser : now can handle list properties. - myStruct { - myProperty = [ 1, 2, 3 ] - } - to declare : struct.addListProperty("myProperty",TCOD_TYPE_INT,true); - to read (default parser) : TCODList prop( parser.getListProperty("myStruct.myProperty",TCOD_TYPE_INT) ); -+ added color map generator. Interpolate colors from an array of key colors : - TCODColor::genMap(TCODColor *map, int nbKey, TCODColor const *keyColor, int const *keyIndex) -+ added random generator backup function. You can save the state of a generator with - TCODRandom *TCODRandom::save() - and restore it with - void TCODRandom::restore(const TCODRandom *backup) -+ added simplex noise, similar to perlin but faster, especially in 4 dimensions and has better contrast : - TCODNoise::getSimplex - TCODNoise::getFbmSimplex - TCODNoise::getTurbulenceSimplex - Simplex should be preferred over Perlin for most usages. -+ added wavelet noise, similar to perlin, much slower but doesn't blur at high scales. Doesn't work in 4D : - TCODNoise::getWavelet - TCODNoise::getFbmWavelet - TCODNoise::getTurbulenceWavelet - Noise functions relative times : - 2D 3D 4D - simplex : 1 1 1 - perlin : 4 5 17 - wavelet : 32 14 X -+ you can capture a console to an existing image without creating a new image with TCODImage::refreshConsole -+ non rectangular offscreen consoles : - you can define a key color on offscreen consoles. Cells for which background color = key color are not blitted -+ added libtcod credits function. You can either call : - TCODConsole::credits() to print the credits page at the start of your game (just after initRoot) - or - bool TCODConsole::renderCredits(int x, int y, bool alpha) to print the credits on top of one of your - existing page (your game menu for example). Call it until it returns true. -% improved TCODConsole::flush performances : - frames per second for sample "True colors" (terminal.png font) on my reference computer (windowed mode) : - libtcod 1.3.2 : 130 - libtcod 1.4.0 : 300 -% TCODNoise::getTurbulence is twice faster -% improved mouse click detection. Even with a low framerate, mouse clicks will always be detected and - reported in the Xbutton_pressed fields of TCOD_mouse_t. -% you don't need anymore to provide values in TCODLine::step parameters -- fixed memory leak in image module -- fixed DELETE and INSERT keys not detected -- fixed a rendering bug when using a white background color before any other background color -========================================================= -1.3.2 : 2008 Jul 14 -+ added documentation for the generic container module TCODList -- fixed not being able to open and close the root console more than once -- fixed parser not being able to attach a sub-structure to more than one structure -- fixed TCOD_image_from_console not working with root console on C version -- fixed TCODParser::newStruct, addFlag, addProperty handling only static names -- fixed web color parser (#rrggbb) in the parser module -- fixed TCODImage constructor / TCOD_image_new crashing if root console not initialized -- fixed mouse status not updated if the keyboard events are not read with checkForKeypress/waitForKeypress -- fixed fbm, turbulence functions returning NaN for high octaves values -========================================================= -1.3.1 : 2008 Jun 05 -+ now TCODConsole::putChar/setChar can use ascii code > 255 (ok, it's no more an ascii code, then) - this allows you to use fonts with more than 255 characters. -+ added default parser listener for basic config files. -+ added fields in TCOD_mouse_t to easily detect button press events : - lbutton_pressed : left button pressed event - rbutton_pressed : right button pressed event - mbutton_pressed : middle button pressed event - and to get the mouse movement in cell coordinates (instead of pixels) -+ added functions to retrieve data from TCODMap -- fixed const correctness in TCODConsole::print*Rect functions -- fixed a bug in fov toolkit if TCODMap width < height -- fixed TCOD_struct_get_type returning TCOD_TYPE_NONE instead of TCOD_TYPE_BOOL for flags. -========================================================= -1.3 : 2008 May 25 -X C++ : colors must be initialized by constructor : - 1.2.2 : TCODColor mycol={r,g,b}; - 1.3 : TCODColor mycol(r,g,b); -X TCOD_console_check_for_keypress now has a parameter that indicates which events are tracked - 1.2.2 : key = TCOD_console_check_for_keypress(); - 1.3 : key = TCOD_console_check_for_keypress(TCOD_KEY_PRESSED); -+ added mouse support -+ added the file parser module -+ added TCODColor::setHSV(float h, float s, float v) and TCODColor::getHSV(float *h, float *s, float *v) -+ added TCODColor addition and scalar multiplication. All r,g,b values are clamped to [0-255] : - C++ : color1 = color2 * 3.5f; - color1 = color1 + color2; - C : color1 = TCOD_color_multiply_scalar ( color2, 3.5f ); - color1 = TCOD_color_add( color1, color2 ); -+ added TCODConsole::setKeyboardRepeat(int initialDelay, int interval) and TCODConsole::disableKeyboardRepeat() -+ added TCODSystem::getCurrentResolution(int *w, int *h) -% now TCODFov::computeFov takes a maxRadius parameter. Use 0 for unlimited range (default) -% the mouse cursor is now automatically hidden when using fullscreen -- fixed closing the window resulting in a fake 'Q' keyboard event -- fixed TCODConsole::print* and TCODConsole::rect functions crashing when printing out of the console -- fixed f parameter modified when calling fbm and turbulence noise functions. Now f is no more modified. -- fixed wrong ascii code in TCOD_key_t.c when pressing Control and a letter key. -========================================================= -1.2.2 : 2008 Mar 18 -+ added helpers for real time games - void TCODSystem::setFps(int val) to limit the number of frames per second. Use 0 for unlimited fps (default) - int TCODSystem::getFps() to return the number of frames rendered during the last second - float TCODSystem::getLastFrameLength() to return the length of the last frame in seconds -+ added TCODImage::clear to fill an image with a color -% TCODConsole::hline and vline now have a TCOD_bkgnd_flag_t parameter -% now the TCODConsole::print*Rect functions return the height (number of console lines) of the printed string -- fixed TCODConsole::print*Rect functions not truncating the string if it reaches the bottom of the rectangle - using a rectangle height of 0 means unlimited height -- fixed a color bug when drawing text using the black color (0,0,0) -- fixed TCODConsole::waitForKeypress(true) resulting in Alt/Ctrl/Shift key state not cleared -========================================================= -1.2.1 : 2008 Mar 09 -+ added TCODImage::blitRect to easily map an image on a specific part of a console -+ added possibility to generate an image from an offscreen console -+ added TCODImage::save -+ image toolkit now support reading 8bpp bitmap files. -% Random number generators now support inverted ranges instead of crashing : - TCODRandom::getInstance()->getInt(10,2) - => return a value between 2 and 10. -- fixed image toolkit replacing the green component by the red one when loading a bitmap from a file -- fixed console print*Rect functions unnecessarily splitting the string in some cases -- on Linux, you don't need to link with SDL anymore when using libtcod/libtcod++ -- fixed linker issues with Visual Studio -========================================================= -1.2 : 2008 Feb 26 -+ new 'image' toolkit replacing some of the features previously in the 'system' toolkit. -+ now windowed mode works even on 16bits desktops -+ improved custom font support. - You can now use fonts with characters ordered in rows or columns and with a custom transparent color. - This allows you to use most existing character sets with the doryen library. - Font characters with grayscale are still not supported. -+ new time functions : - uint32 TCODSystem::getElapsedMilli() - float TCODSystem::getElapsedSeconds() -+ new background blending modes (see the line sample for a demo) : - TCOD_BKGND_LIGHTEN : newbk = MAX(oldbk,curbk) - TCOD_BKGND_DARKEN : newbk = MIN(oldbk,curbk) - TCOD_BKGND_SCREEN : newbk = white - (white - oldbk) * (white - curbk) // inverse of multiply : (1-newbk) = (1-oldbk)*(1-curbk) - TCOD_BKGND_COLOR_DODGE : newbk = curbk / (white - oldbk) - TCOD_BKGND_COLOR_BURN : newbk = white - (white - oldbk) / curbk - TCOD_BKGND_ADD : newbk = oldbk + curbk - TCOD_BKGND_ADDALPHA(alpha) : newbk = oldbk + alpha * curbk, 0.0<=alpha<=1.0 - TCOD_BKGND_BURN : newbk = oldbk + curbk - white - TCOD_BKGND_OVERLAY : newbk = curbk <= 0.5 ? 2*curbk*oldbk : white - 2*(white-curbk)*(white-oldbk) - TCOD_BKGND_ALPHA(alpha) : newbk = (1.0f-alpha)*oldbk + alpha*(curbk-oldbk), 0.0<=alpha<=1.0 -+ The samples can now use custom bitmap fonts / screen resolution. Use following syntax : - sample_c[pp] [options] - options : - -fullscreen : start directly in fullscreen mode - -font (default "terminal.bmp") - -font-char-size (default 8 8) - -font-layout (default 16 16) - -font-in-row : characters in the bitmap are ordered in rows (default : columns) - -font-key-color : transparent color, r,g,b between 0 and 255. (default 0 0 0) - -fullscreen-resolution (default 640 400) -% headers renamed from tcodlib.h* to libtcod.h* -% on Linux, the library is split into libtcod.so and libtcod++.so - allowing C developpers to use it without installing g++ -% the font name is no more a parameter of TCODConsole::initRoot. -% TCODConsole::setBitmapFontSize renamed to TCODConsole::setCustomFont -% TCODConsole::printFrame is now a variadic function, like the other text output functions -% some background blending flags have been renamed : - TCOD_BKGND_NOBK replaced by TCOD_BKGND_NONE - TCOD_BKGND_BK replaced by TCOD_BKGND_SET -% the fov toolkit now uses two properties per cell : transparent/walkable. - This is necessary to fix a fov issue with window cells (transparent, but not walkable). - void TCODFov::setTransparent(int x,int y, bool isTransparent) has been replaced by : - void TCODFov::setProperties(int x,int y, bool isTransparent, bool isWalkable) -% improved const correctness, added some default parameter values in the C++ API. -- fixed the window size when using a custom font size -- fixed TCODK_PRINTSCREEN key event not detected -- fixed crash in printing functions if the string length was > 255. Now they can handle strings of any size. -========================================================= -1.1 : 2008 Jan 27 -+ added the noise toolkit -+ added the field of view toolkit -+ added customizable bitmap font size -========================================================= -1.0.1 : 2008 Jan 19 -+ added C/C++ samples -% TCODConsole::waitForKeyPress now has a bool parameter indicating if we flush the keyboard buffer before waiting. -- fixed a color bug when drawing text using the grey color (196,196,196) -- fixed wrong key codes returned by wait/checkForKeyPress on some keyboard layouts -========================================================= -1.0 : 2008 Jan 05 -Initial release From 38f8b816df15bf899637d2871e32f12d666218a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sat, 27 Jun 2020 20:32:57 +0200 Subject: [PATCH 13/27] Upgrade libtcod to 1.16.0-alpha.12 --- angband16x16.png | Bin 0 -> 172695 bytes examples/custom_character_mapping.rs | 2 +- src/console.rs | 4 +- src/pathfinding.rs | 4 +- tcod_sys/bindgen.h | 2 +- tcod_sys/build.rs | 142 +- tcod_sys/libtcod/CHANGELOG.md | 336 +- tcod_sys/libtcod/LIBTCOD-CREDITS.txt | 99 +- tcod_sys/libtcod/LIBTCOD-LICENSE.txt | 30 - tcod_sys/libtcod/LICENSE.txt | 30 + tcod_sys/libtcod/README-linux-SDL2.md | 50 - tcod_sys/libtcod/README.md | 150 +- tcod_sys/libtcod/include/bresenham.h | 80 - tcod_sys/libtcod/include/console.h | 140 - tcod_sys/libtcod/include/console_rexpaint.h | 50 - tcod_sys/libtcod/include/external/pstdint.h | 919 - tcod_sys/libtcod/include/fov.h | 63 - tcod_sys/libtcod/include/fov_types.h | 62 - tcod_sys/libtcod/include/howto.hpp | 155 - tcod_sys/libtcod/include/image.h | 78 - tcod_sys/libtcod/include/lex.hpp | 75 - tcod_sys/libtcod/include/libtcod.h | 56 - tcod_sys/libtcod/include/libtcod.hpp | 53 - .../libtcod/include/libtcod_portability.h | 184 - tcod_sys/libtcod/include/libtcod_utility.h | 39 - tcod_sys/libtcod/include/libtcod_version.h | 37 - tcod_sys/libtcod/include/list.h | 65 - tcod_sys/libtcod/include/mersenne.h | 60 - tcod_sys/libtcod/include/mersenne_types.h | 54 - tcod_sys/libtcod/include/mouse.h | 51 - tcod_sys/libtcod/include/mouse_types.h | 54 - tcod_sys/libtcod/include/namegen.h | 59 - tcod_sys/libtcod/include/noise.h | 64 - tcod_sys/libtcod/include/noise_defaults.h | 36 - tcod_sys/libtcod/include/path.h | 71 - tcod_sys/libtcod/include/tree.h | 47 - tcod_sys/libtcod/include/tree.hpp | 53 - tcod_sys/libtcod/include/txtfield.h | 59 - tcod_sys/libtcod/include/txtfield.hpp | 55 - tcod_sys/libtcod/include/zip.h | 79 - tcod_sys/libtcod/libtcod.cfg | 32 - tcod_sys/libtcod/src/README.txt | 92 +- tcod_sys/libtcod/src/bresenham.cpp | 49 - tcod_sys/libtcod/src/console_c.c | 2620 --- tcod_sys/libtcod/src/fov.cpp | 80 - tcod_sys/libtcod/src/fov_c.c | 150 - tcod_sys/libtcod/src/fov_diamond_raycasting.c | 207 - tcod_sys/libtcod/src/heightmap_c.c | 562 - tcod_sys/libtcod/src/image.cpp | 134 - tcod_sys/libtcod/src/image_c.c | 866 - tcod_sys/libtcod/src/lex.cpp | 106 - tcod_sys/libtcod/src/libtcod.cpp | 160 +- tcod_sys/libtcod/src/libtcod.h | 32 + tcod_sys/libtcod/src/libtcod.hpp | 32 + tcod_sys/libtcod/src/libtcod/bresenham.cpp | 53 + tcod_sys/libtcod/src/libtcod/bresenham.h | 85 + .../{include => src/libtcod}/bresenham.hpp | 58 +- .../libtcod/src/{ => libtcod}/bresenham_c.c | 382 +- tcod_sys/libtcod/src/{ => libtcod}/bsp.cpp | 340 +- .../libtcod/{include => src/libtcod}/bsp.h | 60 +- .../libtcod/{include => src/libtcod}/bsp.hpp | 64 +- tcod_sys/libtcod/src/{ => libtcod}/bsp_c.c | 436 +- .../src/{color_c.c => libtcod/color.c} | 1250 +- .../libtcod/{include => src/libtcod}/color.h | 118 +- .../{include => src/libtcod}/color.hpp | 185 +- .../src/{color.cpp => libtcod/color_.cpp} | 707 +- tcod_sys/libtcod/src/libtcod/config.h | 114 + tcod_sys/libtcod/src/libtcod/console.c | 507 + tcod_sys/libtcod/src/libtcod/console.h | 468 + .../{include => src/libtcod}/console.hpp | 3614 ++-- .../src/{console.cpp => libtcod/console_.cpp} | 904 +- .../libtcod/src/libtcod/console_drawing.c | 111 + .../libtcod/src/libtcod/console_drawing.h | 117 + tcod_sys/libtcod/src/libtcod/console_etc.c | 1406 ++ tcod_sys/libtcod/src/libtcod/console_etc.h | 115 + tcod_sys/libtcod/src/libtcod/console_init.c | 141 + tcod_sys/libtcod/src/libtcod/console_init.h | 187 + .../libtcod/src/libtcod/console_init_.cpp | 53 + .../libtcod/src/libtcod/console_printing.c | 1445 ++ .../libtcod/src/libtcod/console_printing.h | 285 + .../src/{ => libtcod}/console_rexpaint.c | 107 +- .../libtcod/src/libtcod/console_rexpaint.h | 46 + .../{include => src/libtcod}/console_types.h | 597 +- tcod_sys/libtcod/src/libtcod/context.c | 140 + tcod_sys/libtcod/src/libtcod/context.h | 196 + tcod_sys/libtcod/src/libtcod/context_init.c | 172 + tcod_sys/libtcod/src/libtcod/context_init.h | 107 + .../libtcod/src/libtcod/context_viewport.c | 61 + .../libtcod/src/libtcod/context_viewport.h | 106 + tcod_sys/libtcod/src/libtcod/error.c | 66 + tcod_sys/libtcod/src/libtcod/error.h | 171 + tcod_sys/libtcod/src/libtcod/fov.cpp | 84 + tcod_sys/libtcod/src/libtcod/fov.h | 71 + .../libtcod/{include => src/libtcod}/fov.hpp | 516 +- tcod_sys/libtcod/src/libtcod/fov_c.c | 208 + .../{ => libtcod}/fov_circular_raycasting.c | 484 +- .../src/libtcod/fov_diamond_raycasting.c | 230 + .../src/{ => libtcod}/fov_permissive2.c | 516 +- .../fov_recursive_shadowcasting.c | 220 +- .../src/{ => libtcod}/fov_restrictive.c | 590 +- tcod_sys/libtcod/src/libtcod/fov_types.h | 87 + tcod_sys/libtcod/src/libtcod/globals.c | 49 + tcod_sys/libtcod/src/libtcod/globals.h | 59 + tcod_sys/libtcod/src/libtcod/heapq.c | 159 + tcod_sys/libtcod/src/libtcod/heapq.h | 73 + .../libtcod/src/{ => libtcod}/heightmap.cpp | 362 +- .../{include => src/libtcod}/heightmap.h | 61 +- .../{include => src/libtcod}/heightmap.hpp | 60 +- tcod_sys/libtcod/src/libtcod/heightmap_c.c | 581 + tcod_sys/libtcod/src/libtcod/image.cpp | 130 + tcod_sys/libtcod/src/libtcod/image.h | 112 + .../{include => src/libtcod}/image.hpp | 75 +- tcod_sys/libtcod/src/libtcod/image_c.c | 879 + tcod_sys/libtcod/src/libtcod/lex.cpp | 109 + .../libtcod/{include => src/libtcod}/lex.h | 222 +- tcod_sys/libtcod/src/libtcod/lex.hpp | 118 + tcod_sys/libtcod/src/{ => libtcod}/lex_c.c | 1407 +- tcod_sys/libtcod/src/libtcod/libtcod.h | 103 + tcod_sys/libtcod/src/libtcod/libtcod.hpp | 32 + .../{include => src/libtcod}/libtcod_int.h | 1086 +- tcod_sys/libtcod/src/libtcod/list.h | 71 + .../libtcod/{include => src/libtcod}/list.hpp | 90 +- tcod_sys/libtcod/src/libtcod/list_c.c | 306 + tcod_sys/libtcod/src/libtcod/mersenne.cpp | 68 + tcod_sys/libtcod/src/libtcod/mersenne.h | 64 + .../{include => src/libtcod}/mersenne.hpp | 82 +- .../libtcod/src/{ => libtcod}/mersenne_c.c | 1094 +- tcod_sys/libtcod/src/libtcod/mersenne_types.h | 59 + tcod_sys/libtcod/src/libtcod/mouse.cpp | 48 + tcod_sys/libtcod/src/libtcod/mouse.h | 55 + .../{include => src/libtcod}/mouse.hpp | 62 +- tcod_sys/libtcod/src/libtcod/mouse_types.h | 51 + tcod_sys/libtcod/src/libtcod/namegen.cpp | 56 + tcod_sys/libtcod/src/libtcod/namegen.h | 64 + .../{include => src/libtcod}/namegen.hpp | 592 +- .../libtcod/src/{ => libtcod}/namegen_c.c | 1289 +- tcod_sys/libtcod/src/{ => libtcod}/noise.cpp | 148 +- tcod_sys/libtcod/src/libtcod/noise.h | 81 + .../{include => src/libtcod}/noise.hpp | 58 +- tcod_sys/libtcod/src/{ => libtcod}/noise_c.c | 1616 +- tcod_sys/libtcod/src/libtcod/noise_defaults.h | 40 + tcod_sys/libtcod/src/{ => libtcod}/parser.cpp | 386 +- .../libtcod/{include => src/libtcod}/parser.h | 73 +- .../{include => src/libtcod}/parser.hpp | 58 +- tcod_sys/libtcod/src/{ => libtcod}/parser_c.c | 1873 +- tcod_sys/libtcod/src/libtcod/path.cpp | 152 + tcod_sys/libtcod/src/libtcod/path.h | 91 + .../libtcod/{include => src/libtcod}/path.hpp | 1112 +- tcod_sys/libtcod/src/{ => libtcod}/path_c.c | 1367 +- tcod_sys/libtcod/src/libtcod/pathfinder.c | 279 + tcod_sys/libtcod/src/libtcod/pathfinder.h | 96 + .../libtcod/src/libtcod/pathfinder_frontier.c | 106 + .../libtcod/src/libtcod/pathfinder_frontier.h | 99 + .../libtcod/src/libtcod/pathfinding/astar.cpp | 32 + .../libtcod/src/libtcod/pathfinding/astar.h | 107 + .../src/libtcod/pathfinding/breadth-first.cpp | 32 + .../src/libtcod/pathfinding/breadth-first.h | 85 + .../src/libtcod/pathfinding/dijkstra.cpp | 32 + .../src/libtcod/pathfinding/dijkstra.h | 189 + .../src/libtcod/pathfinding/generic.cpp | 32 + .../libtcod/src/libtcod/pathfinding/generic.h | 179 + .../libtcod/src/libtcod/pathfinding/graph.cpp | 32 + .../libtcod/src/libtcod/pathfinding/graph.h | 121 + .../src/libtcod/pathfinding/hill-climb.cpp | 32 + .../src/libtcod/pathfinding/hill-climb.h | 75 + tcod_sys/libtcod/src/libtcod/portability.h | 131 + tcod_sys/libtcod/src/libtcod/renderer_gl.c | 178 + tcod_sys/libtcod/src/libtcod/renderer_gl.h | 69 + tcod_sys/libtcod/src/libtcod/renderer_gl1.c | 321 + tcod_sys/libtcod/src/libtcod/renderer_gl1.h | 59 + tcod_sys/libtcod/src/libtcod/renderer_gl2.c | 434 + .../libtcod/src/libtcod/renderer_gl2.glslf | 44 + .../libtcod/src/libtcod/renderer_gl2.glslv | 16 + tcod_sys/libtcod/src/libtcod/renderer_gl2.h | 60 + .../src/libtcod/renderer_gl_internal.h | 245 + tcod_sys/libtcod/src/libtcod/renderer_sdl2.c | 666 + tcod_sys/libtcod/src/libtcod/renderer_sdl2.h | 153 + .../src/libtcod/sdl2/console_grid.glslf | 16 + .../src/libtcod/sdl2/console_grid.glslv | 22 + tcod_sys/libtcod/src/libtcod/sdl2/event.cpp | 64 + tcod_sys/libtcod/src/libtcod/sdl2/event.h | 90 + tcod_sys/libtcod/src/libtcod/sdl2/gl2_ext_.h | 68 + tcod_sys/libtcod/src/{ => libtcod}/sys.cpp | 487 +- .../libtcod/{include => src/libtcod}/sys.h | 327 +- .../libtcod/{include => src/libtcod}/sys.hpp | 1144 +- tcod_sys/libtcod/src/{ => libtcod}/sys_c.c | 1106 +- tcod_sys/libtcod/src/libtcod/sys_sdl_c.c | 1258 ++ .../libtcod/src/libtcod/sys_sdl_img_bmp.c | 69 + .../libtcod/src/libtcod/sys_sdl_img_png.c | 127 + tcod_sys/libtcod/src/libtcod/tileset.c | 396 + tcod_sys/libtcod/src/libtcod/tileset.h | 188 + tcod_sys/libtcod/src/libtcod/tileset_bdf.c | 349 + tcod_sys/libtcod/src/libtcod/tileset_bdf.h | 89 + .../libtcod/src/libtcod/tileset_fallback.c | 70 + .../libtcod/src/libtcod/tileset_fallback.h | 65 + tcod_sys/libtcod/src/libtcod/tileset_render.c | 136 + tcod_sys/libtcod/src/libtcod/tileset_render.h | 71 + .../libtcod/src/libtcod/tileset_truetype.c | 231 + .../libtcod/src/libtcod/tileset_truetype.h | 54 + tcod_sys/libtcod/src/libtcod/tree.h | 51 + tcod_sys/libtcod/src/libtcod/tree.hpp | 57 + tcod_sys/libtcod/src/libtcod/tree_c.c | 49 + tcod_sys/libtcod/src/libtcod/txtfield.cpp | 75 + tcod_sys/libtcod/src/libtcod/txtfield.h | 60 + tcod_sys/libtcod/src/libtcod/txtfield.hpp | 55 + .../libtcod/src/{ => libtcod}/txtfield_c.c | 1379 +- tcod_sys/libtcod/src/libtcod/utility.h | 43 + tcod_sys/libtcod/src/libtcod/utility/matrix.h | 248 + .../libtcod/src/libtcod/utility/vector2.h | 225 + tcod_sys/libtcod/src/libtcod/version.h | 48 + tcod_sys/libtcod/src/{ => libtcod}/wrappers.c | 744 +- .../{include => src/libtcod}/wrappers.h | 67 +- tcod_sys/libtcod/src/libtcod/zip.cpp | 139 + tcod_sys/libtcod/src/libtcod/zip.h | 91 + .../libtcod/{include => src/libtcod}/zip.hpp | 86 +- tcod_sys/libtcod/src/{ => libtcod}/zip_c.c | 792 +- tcod_sys/libtcod/src/libtcod_c.c | 131 +- tcod_sys/libtcod/src/list_c.c | 201 - tcod_sys/libtcod/src/mersenne.cpp | 63 - tcod_sys/libtcod/src/mouse.cpp | 48 - tcod_sys/libtcod/src/namegen.cpp | 52 - tcod_sys/libtcod/src/path.cpp | 139 - tcod_sys/libtcod/src/sys_opengl_c.c | 688 - tcod_sys/libtcod/src/sys_sdl2_c.c | 527 - tcod_sys/libtcod/src/sys_sdl_c.c | 1768 -- tcod_sys/libtcod/src/sys_sdl_img_bmp.c | 70 - tcod_sys/libtcod/src/sys_sdl_img_png.c | 123 - tcod_sys/libtcod/src/tree_c.c | 45 - tcod_sys/libtcod/src/txtfield.cpp | 74 - tcod_sys/libtcod/src/vendor/glad.c | 1321 ++ tcod_sys/libtcod/src/vendor/glad.h | 2656 +++ .../vendor/khrplatform.h} | 20 +- .../libtcod/src/{png => vendor}/lodepng.c | 280 +- .../libtcod/src/{png => vendor}/lodepng.h | 24 +- tcod_sys/libtcod/src/vendor/stb.c | 4 + tcod_sys/libtcod/src/vendor/stb_truetype.h | 4894 ++++++ .../libtcod/src/vendor/utf8proc/utf8proc.c | 754 + .../libtcod/src/vendor/utf8proc/utf8proc.h | 699 + .../src/vendor/utf8proc/utf8proc_data.c | 14386 ++++++++++++++++ .../libtcod/src/{ => vendor}/zlib/adler32.c | 21 +- .../libtcod/src/{ => vendor}/zlib/compress.c | 42 +- .../libtcod/src/{ => vendor}/zlib/crc32.c | 41 +- .../libtcod/src/{ => vendor}/zlib/crc32.h | 0 .../libtcod/src/{ => vendor}/zlib/deflate.c | 802 +- .../libtcod/src/{ => vendor}/zlib/deflate.h | 35 +- .../libtcod/src/{ => vendor}/zlib/gzclose.c | 0 .../libtcod/src/{ => vendor}/zlib/gzguts.h | 23 +- .../libtcod/src/{ => vendor}/zlib/gzlib.c | 31 +- .../libtcod/src/{ => vendor}/zlib/gzread.c | 156 +- .../libtcod/src/{ => vendor}/zlib/gzwrite.c | 332 +- .../libtcod/src/{ => vendor}/zlib/infback.c | 4 +- .../libtcod/src/{ => vendor}/zlib/inffast.c | 85 +- .../libtcod/src/{ => vendor}/zlib/inffast.h | 0 .../libtcod/src/{ => vendor}/zlib/inffixed.h | 0 .../libtcod/src/{ => vendor}/zlib/inflate.c | 123 +- .../libtcod/src/{ => vendor}/zlib/inflate.h | 11 +- .../libtcod/src/{ => vendor}/zlib/inftrees.c | 26 +- .../libtcod/src/{ => vendor}/zlib/inftrees.h | 0 .../libtcod/src/{ => vendor}/zlib/trees.c | 99 +- .../libtcod/src/{ => vendor}/zlib/trees.h | 0 tcod_sys/libtcod/src/vendor/zlib/uncompr.c | 93 + .../libtcod/src/{ => vendor}/zlib/zconf.h | 41 +- tcod_sys/libtcod/src/{ => vendor}/zlib/zlib.h | 452 +- .../libtcod/src/{ => vendor}/zlib/zutil.c | 49 +- .../libtcod/src/{ => vendor}/zlib/zutil.h | 52 +- tcod_sys/libtcod/src/zip.cpp | 132 - tcod_sys/libtcod/src/zlib/uncompr.c | 59 - tcod_sys/x86_64-pc-windows-msvc_bindings.rs | 7813 ++++++--- terminal.png | Bin 4903 -> 3429 bytes 269 files changed, 67357 insertions(+), 30204 deletions(-) create mode 100644 angband16x16.png delete mode 100644 tcod_sys/libtcod/LIBTCOD-LICENSE.txt create mode 100644 tcod_sys/libtcod/LICENSE.txt delete mode 100644 tcod_sys/libtcod/README-linux-SDL2.md delete mode 100644 tcod_sys/libtcod/include/bresenham.h delete mode 100644 tcod_sys/libtcod/include/console.h delete mode 100644 tcod_sys/libtcod/include/console_rexpaint.h delete mode 100644 tcod_sys/libtcod/include/external/pstdint.h delete mode 100644 tcod_sys/libtcod/include/fov.h delete mode 100644 tcod_sys/libtcod/include/fov_types.h delete mode 100644 tcod_sys/libtcod/include/howto.hpp delete mode 100644 tcod_sys/libtcod/include/image.h delete mode 100644 tcod_sys/libtcod/include/lex.hpp delete mode 100644 tcod_sys/libtcod/include/libtcod.h delete mode 100644 tcod_sys/libtcod/include/libtcod.hpp delete mode 100644 tcod_sys/libtcod/include/libtcod_portability.h delete mode 100644 tcod_sys/libtcod/include/libtcod_utility.h delete mode 100644 tcod_sys/libtcod/include/libtcod_version.h delete mode 100644 tcod_sys/libtcod/include/list.h delete mode 100644 tcod_sys/libtcod/include/mersenne.h delete mode 100644 tcod_sys/libtcod/include/mersenne_types.h delete mode 100644 tcod_sys/libtcod/include/mouse.h delete mode 100644 tcod_sys/libtcod/include/mouse_types.h delete mode 100644 tcod_sys/libtcod/include/namegen.h delete mode 100644 tcod_sys/libtcod/include/noise.h delete mode 100644 tcod_sys/libtcod/include/noise_defaults.h delete mode 100644 tcod_sys/libtcod/include/path.h delete mode 100644 tcod_sys/libtcod/include/tree.h delete mode 100644 tcod_sys/libtcod/include/tree.hpp delete mode 100644 tcod_sys/libtcod/include/txtfield.h delete mode 100644 tcod_sys/libtcod/include/txtfield.hpp delete mode 100644 tcod_sys/libtcod/include/zip.h delete mode 100644 tcod_sys/libtcod/libtcod.cfg delete mode 100644 tcod_sys/libtcod/src/bresenham.cpp delete mode 100644 tcod_sys/libtcod/src/console_c.c delete mode 100644 tcod_sys/libtcod/src/fov.cpp delete mode 100644 tcod_sys/libtcod/src/fov_c.c delete mode 100644 tcod_sys/libtcod/src/fov_diamond_raycasting.c delete mode 100644 tcod_sys/libtcod/src/heightmap_c.c delete mode 100644 tcod_sys/libtcod/src/image.cpp delete mode 100644 tcod_sys/libtcod/src/image_c.c delete mode 100644 tcod_sys/libtcod/src/lex.cpp create mode 100644 tcod_sys/libtcod/src/libtcod.h create mode 100644 tcod_sys/libtcod/src/libtcod.hpp create mode 100644 tcod_sys/libtcod/src/libtcod/bresenham.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/bresenham.h rename tcod_sys/libtcod/{include => src/libtcod}/bresenham.hpp (69%) rename tcod_sys/libtcod/src/{ => libtcod}/bresenham_c.c (75%) rename tcod_sys/libtcod/src/{ => libtcod}/bsp.cpp (70%) rename tcod_sys/libtcod/{include => src/libtcod}/bsp.h (54%) rename tcod_sys/libtcod/{include => src/libtcod}/bsp.hpp (90%) rename tcod_sys/libtcod/src/{ => libtcod}/bsp_c.c (70%) rename tcod_sys/libtcod/src/{color_c.c => libtcod/color.c} (91%) rename tcod_sys/libtcod/{include => src/libtcod}/color.h (83%) rename tcod_sys/libtcod/{include => src/libtcod}/color.hpp (87%) rename tcod_sys/libtcod/src/{color.cpp => libtcod/color_.cpp} (88%) create mode 100644 tcod_sys/libtcod/src/libtcod/config.h create mode 100644 tcod_sys/libtcod/src/libtcod/console.c create mode 100644 tcod_sys/libtcod/src/libtcod/console.h rename tcod_sys/libtcod/{include => src/libtcod}/console.hpp (91%) rename tcod_sys/libtcod/src/{console.cpp => libtcod/console_.cpp} (63%) create mode 100644 tcod_sys/libtcod/src/libtcod/console_drawing.c create mode 100644 tcod_sys/libtcod/src/libtcod/console_drawing.h create mode 100644 tcod_sys/libtcod/src/libtcod/console_etc.c create mode 100644 tcod_sys/libtcod/src/libtcod/console_etc.h create mode 100644 tcod_sys/libtcod/src/libtcod/console_init.c create mode 100644 tcod_sys/libtcod/src/libtcod/console_init.h create mode 100644 tcod_sys/libtcod/src/libtcod/console_init_.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/console_printing.c create mode 100644 tcod_sys/libtcod/src/libtcod/console_printing.h rename tcod_sys/libtcod/src/{ => libtcod}/console_rexpaint.c (80%) create mode 100644 tcod_sys/libtcod/src/libtcod/console_rexpaint.h rename tcod_sys/libtcod/{include => src/libtcod}/console_types.h (63%) create mode 100644 tcod_sys/libtcod/src/libtcod/context.c create mode 100644 tcod_sys/libtcod/src/libtcod/context.h create mode 100644 tcod_sys/libtcod/src/libtcod/context_init.c create mode 100644 tcod_sys/libtcod/src/libtcod/context_init.h create mode 100644 tcod_sys/libtcod/src/libtcod/context_viewport.c create mode 100644 tcod_sys/libtcod/src/libtcod/context_viewport.h create mode 100644 tcod_sys/libtcod/src/libtcod/error.c create mode 100644 tcod_sys/libtcod/src/libtcod/error.h create mode 100644 tcod_sys/libtcod/src/libtcod/fov.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/fov.h rename tcod_sys/libtcod/{include => src/libtcod}/fov.hpp (85%) create mode 100644 tcod_sys/libtcod/src/libtcod/fov_c.c rename tcod_sys/libtcod/src/{ => libtcod}/fov_circular_raycasting.c (72%) create mode 100644 tcod_sys/libtcod/src/libtcod/fov_diamond_raycasting.c rename tcod_sys/libtcod/src/{ => libtcod}/fov_permissive2.c (74%) rename tcod_sys/libtcod/src/{ => libtcod}/fov_recursive_shadowcasting.c (52%) rename tcod_sys/libtcod/src/{ => libtcod}/fov_restrictive.c (68%) create mode 100644 tcod_sys/libtcod/src/libtcod/fov_types.h create mode 100644 tcod_sys/libtcod/src/libtcod/globals.c create mode 100644 tcod_sys/libtcod/src/libtcod/globals.h create mode 100644 tcod_sys/libtcod/src/libtcod/heapq.c create mode 100644 tcod_sys/libtcod/src/libtcod/heapq.h rename tcod_sys/libtcod/src/{ => libtcod}/heightmap.cpp (73%) rename tcod_sys/libtcod/{include => src/libtcod}/heightmap.h (67%) rename tcod_sys/libtcod/{include => src/libtcod}/heightmap.hpp (93%) create mode 100644 tcod_sys/libtcod/src/libtcod/heightmap_c.c create mode 100644 tcod_sys/libtcod/src/libtcod/image.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/image.h rename tcod_sys/libtcod/{include => src/libtcod}/image.hpp (91%) create mode 100644 tcod_sys/libtcod/src/libtcod/image_c.c create mode 100644 tcod_sys/libtcod/src/libtcod/lex.cpp rename tcod_sys/libtcod/{include => src/libtcod}/lex.h (60%) create mode 100644 tcod_sys/libtcod/src/libtcod/lex.hpp rename tcod_sys/libtcod/src/{ => libtcod}/lex_c.c (83%) create mode 100644 tcod_sys/libtcod/src/libtcod/libtcod.h create mode 100644 tcod_sys/libtcod/src/libtcod/libtcod.hpp rename tcod_sys/libtcod/{include => src/libtcod}/libtcod_int.h (67%) create mode 100644 tcod_sys/libtcod/src/libtcod/list.h rename tcod_sys/libtcod/{include => src/libtcod}/list.hpp (90%) create mode 100644 tcod_sys/libtcod/src/libtcod/list_c.c create mode 100644 tcod_sys/libtcod/src/libtcod/mersenne.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/mersenne.h rename tcod_sys/libtcod/{include => src/libtcod}/mersenne.hpp (89%) rename tcod_sys/libtcod/src/{ => libtcod}/mersenne_c.c (87%) create mode 100644 tcod_sys/libtcod/src/libtcod/mersenne_types.h create mode 100644 tcod_sys/libtcod/src/libtcod/mouse.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/mouse.h rename tcod_sys/libtcod/{include => src/libtcod}/mouse.hpp (54%) create mode 100644 tcod_sys/libtcod/src/libtcod/mouse_types.h create mode 100644 tcod_sys/libtcod/src/libtcod/namegen.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/namegen.h rename tcod_sys/libtcod/{include => src/libtcod}/namegen.hpp (89%) rename tcod_sys/libtcod/src/{ => libtcod}/namegen_c.c (90%) rename tcod_sys/libtcod/src/{ => libtcod}/noise.cpp (50%) create mode 100644 tcod_sys/libtcod/src/libtcod/noise.h rename tcod_sys/libtcod/{include => src/libtcod}/noise.hpp (89%) rename tcod_sys/libtcod/src/{ => libtcod}/noise_c.c (88%) create mode 100644 tcod_sys/libtcod/src/libtcod/noise_defaults.h rename tcod_sys/libtcod/src/{ => libtcod}/parser.cpp (68%) rename tcod_sys/libtcod/{include => src/libtcod}/parser.h (74%) rename tcod_sys/libtcod/{include => src/libtcod}/parser.hpp (95%) rename tcod_sys/libtcod/src/{ => libtcod}/parser_c.c (88%) create mode 100644 tcod_sys/libtcod/src/libtcod/path.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/path.h rename tcod_sys/libtcod/{include => src/libtcod}/path.hpp (90%) rename tcod_sys/libtcod/src/{ => libtcod}/path_c.c (84%) create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinder.c create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinder.h create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinder_frontier.c create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinder_frontier.h create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinding/astar.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinding/astar.h create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinding/breadth-first.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinding/breadth-first.h create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinding/dijkstra.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinding/dijkstra.h create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinding/generic.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinding/generic.h create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinding/graph.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinding/graph.h create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinding/hill-climb.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/pathfinding/hill-climb.h create mode 100644 tcod_sys/libtcod/src/libtcod/portability.h create mode 100644 tcod_sys/libtcod/src/libtcod/renderer_gl.c create mode 100644 tcod_sys/libtcod/src/libtcod/renderer_gl.h create mode 100644 tcod_sys/libtcod/src/libtcod/renderer_gl1.c create mode 100644 tcod_sys/libtcod/src/libtcod/renderer_gl1.h create mode 100644 tcod_sys/libtcod/src/libtcod/renderer_gl2.c create mode 100644 tcod_sys/libtcod/src/libtcod/renderer_gl2.glslf create mode 100644 tcod_sys/libtcod/src/libtcod/renderer_gl2.glslv create mode 100644 tcod_sys/libtcod/src/libtcod/renderer_gl2.h create mode 100644 tcod_sys/libtcod/src/libtcod/renderer_gl_internal.h create mode 100644 tcod_sys/libtcod/src/libtcod/renderer_sdl2.c create mode 100644 tcod_sys/libtcod/src/libtcod/renderer_sdl2.h create mode 100644 tcod_sys/libtcod/src/libtcod/sdl2/console_grid.glslf create mode 100644 tcod_sys/libtcod/src/libtcod/sdl2/console_grid.glslv create mode 100644 tcod_sys/libtcod/src/libtcod/sdl2/event.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/sdl2/event.h create mode 100644 tcod_sys/libtcod/src/libtcod/sdl2/gl2_ext_.h rename tcod_sys/libtcod/src/{ => libtcod}/sys.cpp (67%) rename tcod_sys/libtcod/{include => src/libtcod}/sys.h (57%) rename tcod_sys/libtcod/{include => src/libtcod}/sys.hpp (90%) rename tcod_sys/libtcod/src/{ => libtcod}/sys_c.c (63%) create mode 100644 tcod_sys/libtcod/src/libtcod/sys_sdl_c.c create mode 100644 tcod_sys/libtcod/src/libtcod/sys_sdl_img_bmp.c create mode 100644 tcod_sys/libtcod/src/libtcod/sys_sdl_img_png.c create mode 100644 tcod_sys/libtcod/src/libtcod/tileset.c create mode 100644 tcod_sys/libtcod/src/libtcod/tileset.h create mode 100644 tcod_sys/libtcod/src/libtcod/tileset_bdf.c create mode 100644 tcod_sys/libtcod/src/libtcod/tileset_bdf.h create mode 100644 tcod_sys/libtcod/src/libtcod/tileset_fallback.c create mode 100644 tcod_sys/libtcod/src/libtcod/tileset_fallback.h create mode 100644 tcod_sys/libtcod/src/libtcod/tileset_render.c create mode 100644 tcod_sys/libtcod/src/libtcod/tileset_render.h create mode 100644 tcod_sys/libtcod/src/libtcod/tileset_truetype.c create mode 100644 tcod_sys/libtcod/src/libtcod/tileset_truetype.h create mode 100644 tcod_sys/libtcod/src/libtcod/tree.h create mode 100644 tcod_sys/libtcod/src/libtcod/tree.hpp create mode 100644 tcod_sys/libtcod/src/libtcod/tree_c.c create mode 100644 tcod_sys/libtcod/src/libtcod/txtfield.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/txtfield.h create mode 100644 tcod_sys/libtcod/src/libtcod/txtfield.hpp rename tcod_sys/libtcod/src/{ => libtcod}/txtfield_c.c (88%) create mode 100644 tcod_sys/libtcod/src/libtcod/utility.h create mode 100644 tcod_sys/libtcod/src/libtcod/utility/matrix.h create mode 100644 tcod_sys/libtcod/src/libtcod/utility/vector2.h create mode 100644 tcod_sys/libtcod/src/libtcod/version.h rename tcod_sys/libtcod/src/{ => libtcod}/wrappers.c (63%) rename tcod_sys/libtcod/{include => src/libtcod}/wrappers.h (74%) create mode 100644 tcod_sys/libtcod/src/libtcod/zip.cpp create mode 100644 tcod_sys/libtcod/src/libtcod/zip.h rename tcod_sys/libtcod/{include => src/libtcod}/zip.hpp (81%) rename tcod_sys/libtcod/src/{ => libtcod}/zip_c.c (81%) delete mode 100644 tcod_sys/libtcod/src/list_c.c delete mode 100644 tcod_sys/libtcod/src/mersenne.cpp delete mode 100644 tcod_sys/libtcod/src/mouse.cpp delete mode 100644 tcod_sys/libtcod/src/namegen.cpp delete mode 100644 tcod_sys/libtcod/src/path.cpp delete mode 100644 tcod_sys/libtcod/src/sys_opengl_c.c delete mode 100644 tcod_sys/libtcod/src/sys_sdl2_c.c delete mode 100644 tcod_sys/libtcod/src/sys_sdl_c.c delete mode 100644 tcod_sys/libtcod/src/sys_sdl_img_bmp.c delete mode 100644 tcod_sys/libtcod/src/sys_sdl_img_png.c delete mode 100644 tcod_sys/libtcod/src/tree_c.c delete mode 100644 tcod_sys/libtcod/src/txtfield.cpp create mode 100644 tcod_sys/libtcod/src/vendor/glad.c create mode 100644 tcod_sys/libtcod/src/vendor/glad.h rename tcod_sys/libtcod/{dependencies/SDL2-2.0.7/include/SDL_opengles2_khrplatform.h => src/vendor/khrplatform.h} (94%) rename tcod_sys/libtcod/src/{png => vendor}/lodepng.c (96%) rename tcod_sys/libtcod/src/{png => vendor}/lodepng.h (98%) create mode 100644 tcod_sys/libtcod/src/vendor/stb_truetype.h create mode 100644 tcod_sys/libtcod/src/vendor/utf8proc/utf8proc.c create mode 100644 tcod_sys/libtcod/src/vendor/utf8proc/utf8proc.h create mode 100644 tcod_sys/libtcod/src/vendor/utf8proc/utf8proc_data.c rename tcod_sys/libtcod/src/{ => vendor}/zlib/adler32.c (92%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/compress.c (74%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/crc32.c (91%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/crc32.h (100%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/deflate.c (75%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/deflate.h (92%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/gzclose.c (100%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/gzguts.h (89%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/gzlib.c (95%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/gzread.c (85%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/gzwrite.c (63%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/infback.c (99%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/inffast.c (85%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/inffast.h (100%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/inffixed.h (100%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/inflate.c (93%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/inflate.h (94%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/inftrees.c (95%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/inftrees.h (100%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/trees.c (95%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/trees.h (100%) create mode 100644 tcod_sys/libtcod/src/vendor/zlib/uncompr.c rename tcod_sys/libtcod/src/{ => vendor}/zlib/zconf.h (93%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/zlib.h (82%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/zutil.c (86%) rename tcod_sys/libtcod/src/{ => vendor}/zlib/zutil.h (88%) delete mode 100644 tcod_sys/libtcod/src/zip.cpp delete mode 100644 tcod_sys/libtcod/src/zlib/uncompr.c diff --git a/angband16x16.png b/angband16x16.png new file mode 100644 index 0000000000000000000000000000000000000000..a837ebdb6237548459e59f5a2c7401d03aff1a88 GIT binary patch literal 172695 zcmb@scRX9)9|wFBF=Ef!#3)LUqO~RVEQ+>j6fLF0DpfnN)rvi8#VB1$janr^?b=$c zsy&NZL9FEQ{eFMX`s4ZU$vyX+`#I-x-sk;3uiV`8Ik_*)P4yXQd1wIuU@$b$u>b(@ z`6UIOhT^>NRld@5UVwZo^tFHwgM4e}2E*3K_G_=&l!ZD z=Yu(Lat<&!2n><|^0_$(A0)%cWS5*Amz+VD9J0$`jte=*WpL1CknBPpbRm=f$LRkQ z`LEz}<^K)%pN8{c|B?MKuYUyptN))V_=n)R{{J_rf7Skv_&>7$$8sMGk^j;3kFs<7Kd1ln{YM}8PvXB=|4I3$|GC_Mgbo7abFBYK z|Gy-Uz+<=ksbO(Vyt-KkMtE2n+QU`3)RA-Yn(!P+i z|Lz3{%gM{VLnRk4I`o@8zuB3_!p+Sx#5T02s&l&J-h(yP?QNltUy_4ajFGpw{X?oR9V&r7KE8`4=={F)=mgGp(tz@$B1tLUwJ zoJROw!Tv&WEzSEm<(&`jb-rHtb89R}!faMolZ%p`Ql_tD$~>Uxp25ee-|#iPQ%sY6 znP>g&NvH8lg33+XQK@mkwHvt^Rk^Fok47?%6OJ$@)+pFJ#3S}ZOLm1NveIaUHD2L9 z<5+^Sn(WC0&S-~yuMKCI+2Ne4Em!B5x&-fiI@Jt_Ix5<-&HR?JDT%)q^Bb^3`cMf? zQoQG})Y}%knATh8yt@N&S2$9lydn@mzRitjeTi-# zcHjLflzz8iHpY^k+HWN(!t;BBRyPa`}dTabKdP4Znu#vQ= z=0D_VpqUP*?g42$p`bx~C%vYP;s9WRYbEDqyI`s&shfEfCi^&tVlm6bGPf`3W~3H~UeCpFIM$`wF0 za4jeJv-jh?yAc|={T+X$CJno04S})=J&`iZt>_zSIu-_6iZ*MEo_FOz$vL^&b$+v$(xKU5j ze)s_*mpC{01x1w`h9p2o0)FgscA5?D30_iX+Aw3|>*S=wYpY^gO(Lqb0DS0=YqUq! z5Ok(xgnR7ZkY76L>CZSla48V^uGS-kGfY?Ji2!56YW}rmwG5N+NJICj8o-=5lG!9Q zys>d=e@TW`LM;8d-f|5cHUgPd(gaT@8l_@b+LmY6*dyKzFRichu0KpIs~=7m#8j3| z=$9Pob@&nrN*!KAOG#-r0LhUa&-3o)+u?eNy{qbF)P*B)>EHvK(*{#KiLa>^>?X=r z^65faQlV+{w0r%6>Eg3N#(99j+I6KIx=M6+X7!8CcXY{)>~JWs52L)YuSq%Vr0s0^ z0ilZcifBTpqun+x-LmHcpBAgzi|KNahi|QpB(qf&l6$#K^eC2L6ZoeOU72HbPHJ3= zJh!_ehT#JAoW#W@q42)-CJ#kXC=|PFygifQ(+mwnQXYDM9rbjxiZw@UlD#Dz$H9Nb zJ2)rN{DK2r8ewI~?k>dSeYqSR!4g|@1qs-2*zb4SEUN?8hXv|Aej8~Nz|3|7C!AS-oIzyNxOPg&x|d`~n`MCGO&? z%iCwB=oX||&R?%e{8NQ7Y|4IsO-#Eql<(9q3XRU^kj!`;A4*#=#!=du^>+O@UNKwe z(mHgxgBM*ZMFW6x@X9s-%{5v+cC;9tD=hXEC(U8+RSLGu1O1T{YTB?-dG&s--AQvW zGhonIWKVfT@AEi!R?N{6ff8K-l9J%bpf6*?Tf7LKZ-2s|cY}0k-F)7B{NdBh$?kEA zUTy_3c9ie(*PA006J79q^O)Ee+GN6Q+4uH=EBSPSOqC*MM)l3r)d&4bcLO{PIMC;9 z=(Bp+DS^A?Ta-fjS37fDUDs4L$R8*^&6j+>ViaALCImhyE_Fzv_NL}9SSvzC`2F&v z_OLIf9uxAGGKU0&=tQj_C$sFD=>kLo#sxb{seSXZ`jP`P6e%l;P33@dl0X#IjU2)~}F@Z<_ z86W9Y+T1JStnV_o=ONiimEJ_ovt1lnP9U6IMPY(~kUixEI&|G`+VN**y1%#=^&ukK z7tXA6sQ;1m?ZeD?KFxq+fqWF4_;9LC38o_(zHHTsqA37sBkmm!-g(4l1Lgr}8VM+` z>=oC2YHQRj%R`ixpdsF=`U1+J%wM!uICX^q?4Aad!9{V!fJB~!Q3B+~ z)m?{Hq9Tc_qX|kbYAI?fdB;U%l=f^XEi}RDw=_w7eLW4*?&VIL4tku7u3JwHr5AT> zIG8~-USJxTg^n_L;uM>p@?QKr3m5dasDGS{&W)sNL7t zY2{x6d8&%mbB@fkSOMR31Q*dgk5ZM#uh>bPw6y78;bSFv|BrluIctxNC2CQBCY%)+ zQaD{KD(b8hrHwz($>NMcR%r^sY8k-_yrmiT)>v3``?G=2(P4nuT&~c41OMe=7KG!$ zHFi{0q%dBxor2NPU7Q_ssid!i+jVAktsS9fo?u8wF#wY4S*_?i)Pqw?ycr<(gJa+(Z>q3 zn&C$FsPRWW#L_f=g=sadfQIokEUHAU6Jcb#sBR%N5Pz!JEd0(;o8pkOuy7f>s_ zkI;~y?_?cF9Gzv0+Vn?87piiKs5Sxaf?|OFqydv)x%}slgN@0?_{UOih=aY-c#HL# zpX+zLYwO-1f+M}t+u6p$(K67Tw7J*Yg0Q3HbhRFOkT;>Jrol%qDie2ZXucO}}c)=BDfvEU)C>A!% z&c%SNc!P8N&JuoN79!&TyMyAm@nk~cH#X66$jsB-1UsH0uuSR-Dyge6!F)t;F@daK zs5-a#hZA!@`Y{74?_ZK>3^0!^rhtf5#k8lDqO#eY`1_hzr%|FG zCzk1lEoooYGIXT)k#VKnxb5yHsCfN81Z`#CfLfFGTk;Nce@gc^zOe!i&7(uQ1$GQD{@+udgPc`Z-IMVTmrEH>iiqe*i<+;y zh|GKIgnY(P%jRlK^}8a<-Ul}*lo%@bv~GUXaIW1(*}XyByCjg#GKcEBCc54hd~|Op zBU%B`{#1|KS^6&N5}u&+zD6rC8xhkW!Mw_>c?%sJInVacoX;aL+1NVQBWvxS)uTbg zyx>%ZAM=D+Iy#f$X<_~am6V6WmlqyyLo5l8eb0I!;)QGN<=`-SEb_{M+3e3EhYr$A zQ=Q>4hpFlg)9t7TOGBnxPrc&)GO;)Yl**4$=!`w|%*c0OZ`@AVdw47Gn&j!VIN6un z3)XxkvNTXijIxdFpN_rjXCP4>hSwk+sGBm9E!D7H0(?C?1mdP8&=p0jgz}2rVU#v8 z=>8HAxGeJXC4nHXP%&n%klk{i{RE#Vq3vpp=KgUWeq}o=n^g0iJEvWaISs8x*WL}!8|JR=60i}`k+TU%WY7#zkIXx>+H3xBh2Z2i8lT()1(tvrm78JK z#00Yh94z74e1*3Ia5?!uXy3j~2#}}tgoL*!+hJ4;?{W$;Vm@eU5m1_3N0m@#+N`xm zkH(nbeyqzH1>OxO3)8MH-!UZQNZQ4>9l&F?&ma9wcCD8@ zFiPzg2u}~;+u$Hs4DA(i>fgKK_c+!zg75vDAk+^pm<+6b8h^3vdLFV4znGoMWlIL% z7t|7ht<7ybemRY>$Z4yzps`-Mlj+%OCG*^({c9SJ0?l-)ptShr)iM`@H`iQT5?^SF zw0PZ1e8`>3m?#s>#n*|m(p}Zlc8;N)}}emc5&8b*Vz8iS87BydtS+E8V84bNYrW4iu1uS-(_W$tq; zOS$g_5TrXhf?#tjb%CHiJ6z*Iqxy*|Yc0L;MKn(69RXtDLo^pucCNmKN*$e<^s6t3 z6NkO1eiZrwmkz$Nn%LnWLf3nvbnkQJRix!lkr2+7qxBi$@dWwrx&lP3WgBNu`7pnL z_P+Pdrmg|nl!;NhrgE+@>wZe-NGHskEg7Q}NgtU-LMs4KcP0bJ2phv<1#7*JojwY5 zI)2U_Nu7?%I`xL1xb+n;F^k`Eb}qgcl^|Y!G(cdd9;Pt|Ctv)5V=XA6U)`-asjO3f zZI$18_MzMWXRM0ft%RC=*P*LIM1&**yL{1ng60k~U1~?D&aJ1~e5ixa1=m zC)`pNPgp(k)P^J%DE^uU)Po0X*`)BId582j6T;~7kUdVPpLSEKo2wd-?!|dmYm%GUEh(p5ohb%R(DDrK?uBg~vUx;5*7NHl?mh#3Y zwlYEe(~PhTP-Kp2u|BRbK`u=1c>Ajn^IhvUWvOJ~f}qjt=tU=7dLf~CEBt|a>8YFN z7vtnf+Xgd!!2ZK)T4czk*Vf}0CTal=fc{uf0@Q+Amwn_ednz-!;+rXO<^TcKTHw3w zbuvHrf*P67BOZ}eM8F(0_v-KDE3Rwz+~XW>23vr(f6_<(b2F?vgYxwP-#?JULg$#$ zIChd-m zSpXh)m3)@L97tv@+U)l&eh;tn(!Y^ieQsDIX)(aHGw(~`wbHX$`3MS(P^{qM5ODzM zcrlcTYIdtNjO zDI-RFUT0HbS=CuCeijJV z&Nk6=K7EcyrnScETMO?K#LHhXe{x$iPjU?$OnC$kc@f=(yz|s6P)C8BE8a;7u}l$p z4|>QBGI<3=w&if704(Th%L zXQbXT_a*r3*lsUD6eD5Fd0=C@2*`?T zsG#8X%+-I!ZZy?^P&I;YjJq#!J> zpKp@d<+FSC^p>if!Il8#P`77uWQP%Jyq>GLr=D0dDap zOtff^z=yoot6n93dJqAJNrjY#gHc)H8(9Pco0(UCQtcox`bp~cBvJjqMST~HL)zW3 zUCqF*jyU7br9;Yklz0N=0D)3pkp*acDFozIy#Vmzg$lI%Yi$^fX{HcI8|eVv}d`knz&$Fk=e<7KAH9Vh8b*?@ofWwIZ!R0H|ngHC(2 z%KfOL5-bcd0c&O%O7qBKU83zX)4R1Og{walptPnlJ_Ib zo~%khouZ$MsV^uR3$7A2$iz95m;zAT`SgM$fIwk`W9Gh+a*&XSFZ;8Q`nD|-K<<3e zko_eX^6#oaKa=m^%OwU_p)JqyY*8&Y=Vhf-=X*>=&vPEW25uV8cZ z81~`@iO1x=9vUnvL?(78n~Fz-@JH5*J&))a#Mb)+DjfzKC-X$q&Eo9hzh*ff^CHaY zh*`OmG$DR_!2jo>NKQ-vp{xT=ZZ92A*0~`1iZbmo_1NMcup^JA5lZ=yzkgu4?2TU%E<+k*GKS5Ko^rWd&|On z2F~0fo96D-a_Pp$4iy7B$fyO1uIc+GwSB#w zbn&;?Vfqzc>G+kjE6_)oqQMa1wWpIQ@A{i*yepuO5dwQ}7y@YEyPr7^1*cX90;k)~ zPFg}5rs;gBUB4w*P_HbHU!LUMk%jnZqKS?UvzsVCa*fZ);ZOka>n7^fX3&$F`!y#A z1CqfH4%IWesa2+}L}Fw-K`C@}%z#%b3wr7FoA_+@RH7(LWW4>UF0tDHQWu{p`eeeU z&M#L=N?98cco@Nyx%wzrQymCJzQOMJa>+!=mS~3?S0NB?$C%3SjNHbR9U@x+!m;ZNFV*3Uu zgj$Hohgt|E|7Vs?-lyi=ibc)M^3AUt;Jn~8J>zF5g_K!4EhrB}HfbQ_L?D8F`>~(k z0=W`nsMfl2ko#!SvCW;Ub;YZP%*+aW4<}D<$4bK6hwbT=sdO!OTvJ-g?I{qpbv6|P z7gI`Y>wY&sS53+qVN$8fTwve16?o^?D@yP#{@O9Un*`r%(x|c2o!50o_?xzwR!(`K zOWSs#O2$1uQ*2bNHa)CGvKkX1N*H>f+r*W5JsHL?x(%X?O=26n+-~p!;~pZKNSxhh zd#M<2s&UdzNA2pMv5IhQZ`7P;y8-)(exDEEW+({Fl_C_^$;g<#-{~u_B{9) zB7f3)DRA~<$cg{Wz%Gf`li6!{$>yxOMBM=G1!fT~o8MSR$Oz>EE|`(9(frw7Im z{7z(ORWwW^Aox-U_F^>qv7^5t0e*c<)sU%Wki;`>NNUQVMXz1;XJC5kHym0upiE6^ z&%_4g<7MGz@zX|}F-=m;(ZJ~nxb16IGTBauc0s0Jm_ma>_HpFW!*GdR7>LvsL7c{s zJ0qyoDWNcR3OeB69bk9J6uv`!h(i;RDlH=bI>rFswQ?9gzS9mK0pLbXfR#} ztQqb;zK&+&a<&M$#$~opXb8~fz!e^AS)(kv_5-6W} z*DJ=?ATWD3;FN!?BvlXm7l!(6LMiaR?zhb^ippOb2S#p`FCPJ;*oC5ti)%ZdsMW`o z#_-M>>UTq)wZ;p+ouI#s$n3E z5PX0dG+I0@haefES(*{IQSlPaJS~G_@9VnRhNW@S;j~zQ#vOv@L5``kyiAV1@dPtZ z>`ENlVer-TH7L?o%N%hZR-9MrbAw-=Uy7cSOMJwu+$~}!8_zjIKXpan*Ii?zcdN{Y zBK-z6&BetNNIai7ZeLY zUU2@PlM1HkI4Y6t{|Hb~jND_bR{n`SjZx+J{)fU1Z7w!t5Kjrif<*;>417sON8a^z zkL*H(kO+x9i($17x)X2cMVw(_%F$iDPt$KXf`^VoyX2``s%sfc!LT}mGP%F*B$w^2RcfvH& zCJr@Y65_xw2VD9QLv$5PBXYZ;Js&f`V(8(q&7T=`K|G){CEu+yXR)unUfC1LDCVypp^qLBG2 zqmwaY_V-?i%6o-1-UjAuKarB3n)-&SnC^YnyJjYUn;V*NP44S_Th_NdM@$igMwiGp ziNT4btAtpYev8XTHS^c(ye8azBmgsJZIBUgQ8OBn9s!5!U14_&9=^qr2heZ?wq%3o zpSLY~&2hcYZP5;1nP>();ljLeh&@<&91I?*%VIZupOWA@$=O%`m7bv zFThAwRak-!d4`JS0d4_ZjD6!`uxhIMUj~4@_UYZD3fCSiE%wF!ahjypAA|GU(vtW&p*G`Kk4-dbuc>MmvSX>WQ^9XOe#39^hoM3BgN=F?hoSkLvndK6IIJDji#h=9 z@*Q+8GT9@K{KK4xKp-Ozvn%tZr%)iw2^NI7Y{TxQ@w#8Y{%}3?F>~VjRVBO=-5*I# zU~T8B!w)6~?8AHw^X9n>%8f8Z4~Yq7^|$&jhI0UCfXSFA_ z`$QJAZOtT>krR%E9Xi26dy2uoDv4^{Ab8#?JUEHto{~U0pODV|^jJ&qQx>jLQ2rAn z4^OQuNCbF>f)5v=Ni(6_sLV9Lr>18001j$C<2D6<9sK%ZXGr+2T>jpb*TZ+w&MLMP zn-6%h3evCKzbXG|YvQ74^6i*X^TTzHzNh z3qE^CK9~_R)f-cbARCQ^)hC6%AaPN49z`6_P7Pc>dtJx4y8dzb+A8r|j~i*8VvFf3 zH3M`uruz}C%qAzdM}J2dA1D&~fd)GJME$B*Fdz^`zYDq+Il@k$2w!-Y|~a>L?F4)y=4-a)X{n zcS5H#XV|2nvHLU{UF94nt=UH^21TA<1c(m9A66!Jlu)Y?@!Xpm%U^66c#v+iNbRe` zDUs1YJQ%qdw>M{5QP98Vpz{6E3o0%%)i7Uz4s_d0P0Nc)fkQYqvIZUOk^M<7`Ddx< z>S#-cS0S6`HqdbMl>s0gJ`0L`68$&Zwl2Xtla53A^|#1{RK%)^jio5?D$`#ns{MSA zjBjJz;Sq5D4G;m52ET4At%Pqg2r)C@?To=)kAHxpODF^*)Q}IrLSO~bJRR+?05L1D zJng;-EE?F=X2T0yL~qGT7Vu!jc#x}2mgNfLf100tE}cmvK;0zvnlLv6iM;g#14H80_Ty!BxZTF!@S3D zewcY`TLIFm(763wvfgx3d?3#M&gU&Hs6R+)>oH6A0?d;!uk!rj_u&u4Zd)LunZP5~_9gFebrjaXJxOnzA3;{)UK(%8QdqAiW(I3$tToncdqd(uhAp1tT zDY*55`@!&hu>JJ)QMw7~*ey;kMj8iEECUQu3!aC3YOEWhg<$!qWPH`@RP}g+t?lRm z^#>lutoSRl@Z=A;0)}E9nr6O&;p9W&bkv zbe&gIfz4TcY?#!~oKhkC+fwU^C!G598hz??xBqX3EA)gnAhjg$8l5A=fB~ySTPj;c z{u!1Oqe|SkPeUW>%KsL9x`H6n&;s1Dr{eE@RnXD&oJC(?RIk}2O(-sIQa1|}Pgfni zJOLi^JM=H?5tM{5uf%tfd7Ss+`g&*6i3B7I_>=8p*fIW~Cx zOw0vj`yF53Y0k-&cOfUq%nPB%VPYD?JI{mV4O|(O%+z;ROU%?KiF@S*kJOIYLj}(M z;lH}VYo>ARwy=k}RuHTsVC!}{w8GneXWQx2+*l#JgUC7HB!fi}`7aAFUWn-2h6l$u zdV9Z(G1Q_f&QF6$!L&Q62+Mi`{QXCjibf1M13B!P{tY5 z!DS_sgBThdk>up->7(I9By)7oAnMnc*yB(ineL^gg(nGb-C9sg#Q$gN{I8LqiK!# zVHTf0!!3qJ5m5~G9W;GJTTB|B~rGiI6q z4|5peaWH8J2EnMs707N-lbxU!8lR4MA>={6LU4L^|VvBHZ}60&&5~g^`nM?&r;!`KA`O^ z)6b#phgn<~NQM4q3Tt*irfHs1*w%GQWC}Uyv9!!>=!bUln|PMDxqBKziN<3UdB43v zJ0X<0%i6(*h+KS``9SERlFtCyYn)F43-_xnKuMImTADErCw4Iq^M%0-uTk)$UVR>h z)$k5xiq$ZE(niXVBF`{o;!w%2h?80}YxrgJy$+Xj+3olzF#=f0Sv=@_VepEgYw|3Y zH+j%k{W?|XOA~+8odVmY?8N;_kHFwXf+?FOg>CWxKbO#*M&3p^9 zoFI5|dubf0A69h3s4$we0*`ran1`xW>wbc~(kro!bi~_0^%Olmc{B+F7y&UX6%Xd` zPr9qf8VsVRV?`5nx51M*6GZh0O$(Ih0D%DHjv3B82*jWiwtB<`muc0xUe)uv(dzZV z#-nQowOXy80TG8Gj>#Rnzph&W_GYWH&(seRHviX&&I!$ zr%5XSWYfzpM3A7__cUv%OkP@F9BqJD6>+)RIIA1smCw8oh9+!Mb${}kSAVOm1XQsN z1Jgf@9ST+r3RoceX^8~Y6h*2RteMsw5BuI&&?&KwhY99C%@fQ&PGQ!;4WF^!BYnM! zdE40iawhfuEO{W8-ko+S36c!M~AFcRw>4ARc^FysW$Zn@q2s{BTY1%pd@9Jn~U6;LkYsXwS#3H>F&Qkq2tk4>;0@PYAQg@V&Q%b;xrOEd^} zhHk;6k}K)h_noZBs%Rt&Dy4kA&Pl()TO?En(0m@XUfFOPzH+OS^+J#DDryFG772L+`a*~1 z&4vQRO5O8cjU^;5930S%qR#B#gDRTyxaC4}%R=NTsi&has32$ElQPh>*f zFHSvAK?a^ALj_8Y`z<%ytewhPl5b?@Zfeq^kOu1rYPr=%c+QVMsow-P=RcB_! zHHdvqGj(0{ZHaWUNDu5%$Drt0V|5RaEjHxdD4kZ|I8GlqCW)_BU_WI!^rvHL4Y0g z6w|MlWJgylKBQGO`E=&|MOn`yH_)&oK88WU1bqZ7*Mi?NUcQ9dP7*Of-u;9GA#bg( z5B^bp=E0$dJR=-zYR{qsF8~kz)SqdLqX&_%a77(Wq+BZuRo2RlOWQL8M(?IX&w6ea zB=?x2zIcD)~dp z4(q1n2~-6vq=*PU+EE5)3c5XAN~HR*Q|aFcE%e{n>)%B_a*n8|P#!XJ$Fu#Uaoj0V zo^ng2$wz|Bfp#yoznID-A&4*#ETtuH^TL@;^zZXu*T+HwuSPLHkpYI!#>rjO=)dCR zC2>X2>65<{_|m7-*w)&`<9AkID}82=Vu}#(c)eX$skX^CNd{T_SMN+A{CP2!A{(~! z_jI5qu~iUCJ$@?ZVAm~g$V#I%wpN{6lDakaKnI(2X3&U`6keq?;p-I;z@yCntkx$z z5D+P{^AbGe%xGgN;-C&gW|h-(y@b+I0&Lqow*^AjZD!weFo%^3hAi$C&YT<#Y164q zqG>kT+?c;Rv|b1rhwxFQqHGvuvyKJXtuHO3+30Im5a6axT?39}Rq%PY!p-#YL)H?@Tth-jNr4jVZ;jhRG5Jrs}M8q%a!s+ME5x zo#+tvH19$*S{NMdXCslk1B8_y{+*M+YEo9MNSSHWQ7dfVMXZ3J1C3obrdC9gMuRLX zjBn*EPESGw?VfO}Y}eHUTlz~|QC4pph@YzFxvr=w8^e3?TD}VZeP;>X-z7(r?`?af zHINk1Rhss5^{r+i(ahHXR0CC*zbV7})fJSlG;NPz(_TCS(%w6X9waS@RKel%9<*gC zBOMx_El}>J`9s0SPyb8-^ih7vkxx7pb6;KpYj^O>VoMcI&6{2;rIjFQ(yr2&uO4rM z2nxxP(I}p65T4xYDdddxCDEjpMNH)?lgo?J3#j0t*xG7XYxRm0Mj-Tfd#+L~gxD)y z7`WTp5_HhM9|XCN3`QLHhz!xJa4J(p@*0r(M_FV9A>=uTWJ{9O5VUwuj*hvVMf9XZ zcUonS@VK}k_k1Hq4-gJRVcfq^XbM-pn9o;`>GUdM`*3hc8nEywe)j68?y|`c(Ji8jZ4oYFyHS+Kq#FcM2QgwT27;%- z9`;8vE8yj~!AzEnN<5B;a#1(USq4C!1HTJeJ%~|;LJoXXXfyy|ok3nwGGG0NcjK{5 z9Hn?NE8ZpJ!&I?O@G>i8Y|l6@TqP%^Ig2t$Syl5J3mjT_*+f^`l`?n%RBC3M&nq4r@~5d4(x;N?#U6JAM56c4uJ!g|dWayuzF)-(F|%4LJcb30IA1Yq@f&OA<0~ ziff%kt;VGps>&9m2yYt$9${|{WkEtE1+Kz1+r)e?lHZ)t`T@D=m3a>P$K7|O@*Sf7 z1s}9i;G2%_MV+^m#`JgBSZle42tG|C`sA4{HgIx~y1Z?$w_syMcL29eP zvE;M-)9=ps7#rm@YO4OCSf;U>4r2wXCINrJ$V+OVO`7Ci!RpODKxmVFN|>+6JS|5z zD$nO0izuv+$K2piJ#4M#ktRo-)D8#FMwP8~#kIV>TZ%bx81^qenDK;to~6^nrN`-e+VekJNgqG?JmQ6#&oJcS6gQC72TyA^tXYSVdnKpJ(h1=_^Y;x|}5Vjk+}xpa*^KIb=gQ zmhIil-rjF05Z?i{UoxHhZa`cvk}w(bt-g{;FC^~8QsM?C#RqSHWIv4GuM&vvbhdQN zp}6;Gy6SbDUWP|Hr5w&XWw_2W6FZ<9=o zrlolP#nl@0l=X8hQT6~QQM6HWF9R6;cK1VU_B!q$6AErNI^{$^vw6|zM7LqabQGiG zJnW~fIBxP+2rtS}tHi9tr zf?A7m1*HKKV3=NKbmd5HM>LF*Ig5$?d1A5hiYXaBXj zdE8D8!9Xtz@5pIHP{z%Ihoyxh+UA;wXvZo6TogN6SO6;Q5mxRq%diK_Db+Gkdrr(T zsm=OExnh54o@MGd!IghPw7)-*4(<^;)fP-@HxXjKn@q0|@ouMdr+XqgHB%(=hJN(Z zX0f}^yi4gYtf%_c>0d%lg*26H-v7Ce$wJ`yBs%3m2<}Tx?a5mG1B8S{&U$etVk<3C zJF-(9&7R|CfaOCZTD(_oQK27YO8c8U5;E0&o&>4pRdGRqf`yQ8RNqDVz#r8!7_G*( zbZ&pNJdUDd8#d4{2_C4Jb^i3=`>aPLO3=mRYSk3>6P$YqgJAncP#w7$y^&4YBtHaG zecNXv6F)-TrZ)GtO5z?-+`fur%_?VjxAweLib-}Wy|ow=Ze{j(@%1A#|E{qCl@9iNswLjP4;v$H zKGcwL4G;I@%X-jNEUEqOsO9Vv)D0GL3759%X9#|~RI%Kh^&xk*%skETz!`(2{JijZ z?#od%WPGyQ#Nd7zDI5wN*T$&bGe+;O-=u2r3v2x5ycU@F*z*V5;3KcUxU45$>sA3X zZ^*xJ0&tBAr~QS%b#AgDo0)wp)qs?Un>3G(<+^JOOer1VwNy-SVqkLryjVf&w- zlEPZ+bLKV|>Wx{GN!58Xhys-!GkW;|`)BCDYIBwA%8; zwvLBB>+qO!BgOv4kIZ$%3tI1Z|2p)vp`=M)aOuy2+~{lJe0rG=5qgTUQGp*X$)b*0 zGiGuu&tv+V#*{iUN1o(O)mOWO%Je=qjNZY~O#|xMJib?-@oN3z<{vyS9B|h@+RUr~ zKd_&;26{B1&7|%rUwW%@C1{o65tXnb6#b|><#$PX^C8DcV6fd$o-|N5`7uq*K;jVD zJ1>!i`NIoFlDr$cZzX%2?_%8wSD@Dl%7m-e(?WZg&}0niq01|SW}C^f_*C?^CkAG2_~ZJUt$)X1~2%pWy%vB;-24Czf<-ttncU|6W+U@ zuJ|n=zv{eXShjX?xD(XFwm?T}_Q@caoxd7&;rBdgLzhh=%QU|=M|bwL)R#2fLg$HV zaqN8FcT{gyaMX=bv)rEfeY24?#-SoJVkyBJTx5L4B5ke0O^Xe#nOI6Z2KPw^ps{;r zjSx3!UDlUnc7< z84mLAHTSPyFLY>~HvJ)l(#c}oK<+KyYgDf{!+d{f>M{0huY4@)*NMkoZX6CH_cpPH zt%a>@bml&l>QcSs!SkS_|JIoQ%ZU!q&actYp}S>xizpe)0KaS2PsTtgc6nExjE{@s z`<#9fW>;~`jK2FfqD~}4jQZ)JVlIIX>rCn;x59qjG{n6-J&j$c%vk7;__el<3ixQk zG?=+|@J;Ub=W6xeGDCWqj(&{;H!?cE(ehhG;!Yi>75?5jct?z~ypfVdXUrE1M6@W@1sz8f^0%uFJjVNEGLqA`c zy?m)c$CW$oHmdhZt94&GZvqD8nN0|LCB0fS0fX|bP@q!xu=0Gum(80qG7Qd|fI++T z1{T!4(ss=X-7cQR-xASASt={H1Gr1H32C(2WqMa7eWOB8DS!%pqDuNNf459muisuN z)6HL3=!yb}x0wrf-12e@6s|0-Zbb#SL1iwyq5|Aq6}qAVR7C~2rF+AmE9TEVSE0{T z=%n1`r|9jMg9y^9P*&*k6?(Zs&sXTh3LRJIsurwXf1yIZTcNAvd%i-yRH35^U4p8p z098=|s-gl^#r~;^3Q!dlpeiarRaAhgr~vil@`^9D`mPCSsCN0KI;x@qR7C}-omD`v zg94cH0CrFSRk~_{-O3DQ^?Fktzzzx^s3?HoE<6C>?o~kL_S7G{3Q*-OWgwC!V4x~S zPzB`*sLBYSY6R^afru(M^4%c}RAot^D))ft@|kxNWSF8WM!E_WRl3ZMDxfR?(<-1s z@2CRGYfjadE9Vb>X+j#R;svPYuT4lpHLsYEhT8UiC{W#IPj9YJK=ygE(5h_BTlIn( z6}svH%67RHs*7;HToEAsdZGgDt0rL3eBJ~MnlG7v!FH=51gbIyQN`_gfvRZ0T15k@ z`3k+OLRT8Bssg62S1bn*sEP)hO8~^RshxWD_*dw zi~!V?O8KkwPW(rbN|`=uy6OXc+WGH9ml0GIKhVP>9Mux_`5|%O;V@wwC*M-Z?C*P zlrL}H-vZn(-vsXr>O6*RcXvt!VHjB>vF$GJR_3U(x5Z^}zgU(4*Dp(eyIRiNtw?~o z(;SQ%_{B!>gyK62O_)$&l9uRXqqMOv-&mY&`YSjs|64<)ll8P?h%GTtd^4^fNOsa= zXd-(n)PC5v&RF6$MN{$-R%U-K2=B|2uS z0+fEOehyWU0Obx!FN{-e<*BWT(y!7}aQ(VldT@}>rKy6$%2l8XaaL~Fb(PKWpquE8 zp$*QTzxXS=gGc|*^b7xB!hmuQg+b+h>7hYIv4Q_NOM_Th<;f7)PtTCO#bg=ZbLSLy z6J)>qss!*w;I;&C|8o;WVv&G?XUG6q-n3iN9@w0-(;}Hwvt z&Xp7hs>C1J!`q-@~{yV0l!D6$%gGytIF;e8QLdK>lRnXUad6! z?2HL%s7JnGLIvPSnJG4iK{+I}eTCx-3Y`i@Xplz4Yp zeuCSd&=BJ0W~ge6sgc0cd{KGTma0g=^sXcK@rQ-Gb^|IBIb{_7sN8`2xC7YRg5Aew z3+Vspfx({=s;hv1@7Vs{5MoOShCAI+zRUZ~Q~7(raB3iT=a9Tg8UBuuB3 zx;1VE)dne}BY)easDLTAO+5@FJHDe%oGSX=i4CDL=L6X%o^=rCX{UXXq*^ zvO$NpE-cbf$6w-4j?TrK9e9Dc5>Usickc20{V$YdtoO1BXbhJIcPWCOBEmF@28Rac z^m|@61K8g!zpaPwjm&|DKd?;Q-zoii5<$NCkY=MJ6ARDcQ- zs01A*$o?d;?&or2yVTMNLnjKMLJB5zxOcUsP=>1~POp|&h)!lgf|=R5+5IMrxWB^p z(eg`-ijyr1g6J5Jl`0hD{%U$T~zfB~*+z4j6UFk{dCDR<99cJ@r~SZiFAs~)nq$Hx%ab*&av zorNc!c&QLc<(_cei+2tVWOTqVN<&CMVgv#TItck@$c#nMkkA0=zR<<_x`?##{1?4RAA zE9pOfVEX}O&24ks#_B`U2OaSjlnlPa{u3J($ zrFc+(9k}-9$jsja1!}qFmNv&8&U#jdhY1Kud*iy5&Ar#wT=vmS22_2Zpi>Otx)Jyr z+FqGIvbWZSys9*@*5L&>2S2H?+iFm&qst%C0x*uC48#VUJ11wT1ojmYV75bt0th{> z-^f;ZDfQi^=LKU3fZ;IIeM%FsZrV(BJeq*K0IK6Joqz_&o1oVEVypFP{%Tru&<9Ey z;K@CY?D?y|%5^lPUo?QF6wCYqU7qEDyxt{k-K+^BX7|NAb=_@zmSg3nLh<+(F1fT{DFwizY zjo|@92S5U}3E)oHlmMdvTu6ZDh42E*1KCP7Aps%)CO;Sa*G_;27l1&DavcSI1{JWH z>1gGCvDTsr$RF8P;Q!3*>|92=kL-E+>HjU$0B9X*0DozzlZ#NPd4VeZS);x99*;h^GXEAq2pz8c}ZZ%cxQg=?0_gfU4!(I>13*}LDt?S#1MRY#CO|uZAd@ zh|D-Z`aCn{I51Si+{^Wr^>RW5vz!KZ%pajstvJT-`^?@O!B3N@n5VA7W zgj^_m2@+g{iR(cJ7^RQ+()A!qa0Dp91fJ)m0w*Xv<-zEQXLG$~EitSfz-^ZUmRCe=#4sTgp4<3ABp9y|CP;}9( zYmhGQqT^TJmj0O{2*Pk2RyPCBp&xX%-|KjHNMuSW{HU^V)HcY>gJmY{+xd3@Cf@pl zJSGdE|GU0<_bNswl{*h}4;(zWy##doT!v#wPH%4 zpG~Ypq06Q68)luV8?@na^WBkVt0q3o3p&i!u~unE)A>$xmH04EvM>_xLrF0_+!7C_c%O{sJhN_O*fAHCFzmR3vaX1Ij z&-2G1TT%}5$t>RRZ<+R&?r*CA<<9JzyJ!fF(#=BE?}v@?7(#7mKLr2lA^yz~*LOj< zHPeIC<30r>&en*4uK8}P42|NoV$k`^R>J`5IT}Y9!=VC#AQ%T-^PCLgRj@IJA{RP} zf-oXI);*f>8{-X}uj5r1dC(|%dgXdx@J1MAGm+f@934mNlQFw+vYem>+!!ud7Ap{% z_>Eg*?q{k(6)B5$)X^`fm%^9RFC6`d$;aWYm%5Ozk2dyrq5_(`c0HeLY&4tcuB<^G z5+BiO)G&w=NPs55&#!Rb&VM?db5!m|-prZOIeBdPqj7qc}RLwS+y z%f*rn=wpP3t9b^>t*KhJ3|q=#u~@mQCoVz>7!py?*KRFO0s-hRjK}%Is4DiM10Vvf zuX$YaRV#*$$sWU2yT90m0Avb)G+CZsA9?%r*qSU3qwyr%$oJ-h_5kxY#_g^g3C3=K z-VXT?hM`9rI`V{e(LF)qeADB{E~t%3;2Ij%MulPSl|aJ;UeKMa>nFb5gmaDoUwNSU zpSm6tesT+f79mNPhF*a9jY%T3v-py`s9t_)Bk0~@`tgPvG{cWR+IY#0#0vZa;1Ps6Y*FQY|Psjf$YOLjU#-(OlC4008t+bu z7S@HL#uv*R_PdaP;$dVzhB)~?jJhj#b!!O22dKIEGrsPF^)|#r6F`Ng1hh)=U`W>g z0jPkWz2XJ>1+sJxbiBSljJ~RA*A3`=>G(e4_01#FT;CBg8##cckD`fvuZQacCT7J5 zq9d6YHcns^cw9krYkj>7$(*=C2SJjAq(evbQuhl-zwpt^N{I@Hpc=hKFL? zcQupW{04r(^F{#Nhw<%td5d=<-j0R}NHl|#`<1_5_{Q;<{z)j1$DjeY3yI;M>Kua! zc=fGQhQ-RAg$a1!+osR*UFQ8>|K)tm1|;5J@&^}-&2>0guWH$vCMk#|0cx;+W(Izs zXcQ`X{p#IJV*7nuz;*LAcJUf?#OgT+hZqI2)8*<9(Amm<^&rHCbdS83F-_MtA!pJW9OM}&mmH-^Ax3WiZv}#A8O_LA& z!NIv%ihwNv{L%4y7oZRt3;k|(cNGlsS69QV2ZQl0oILwcE*D;*^)_>%EsiT^x2=JA zJ$(<@0CD1RxZ(tixk5zZ(axYFo_o%LtEYDgf%EA4=eYZV76>HL>2-2u=b|g;{3nf0 ztL+B?hMYL}u4g2G8b-%c&JYO=fP+a8Kx~*Gh0kirvmp|o+}=ws<(mk(QRKS2c72}; z!DI;y@KCA8$$|v%-;_x-!0~Uu2QV~r05w2n!nFo~7g%U?_yEs7n>CsHwFXSU%f-4~ ziiUV=j0FeMxPYyx?SP92h19$(vxw+Zd8Ib^KdPL{%?-ollBKUV_u z19O`WD0l((-LD#*0PA*7jb31pKsgWQLk5BJECUG=jowD@m1AHCX&QK4G?s@ncfFB# z2neMC0w7F4R)hooqx} z;1qRzAVdFR%k)JIF*5;*Hk8}^{;sCyX0HiRL-OAmwowOw|Je;_r8-}M4^S-I1dnI~ zifH#(>)6R<>;CiH!MSHMuMGnDHSqsGSzCs5T$%u!s7Y9WgJJ{V1)z0Ivt%MUaAyzh zg9JbXGB-e9Ie%13sYZ994+$_d)Eq{EmIRP4#`O@YdMiF>sQ};i-J0bDU`&!VodBIB z?~kBR#O0L@9AP3+1?Wtq4UihcfXsuE_-5&yEG|ZDR(jQ<4`9hF1VlTSgo5**EU&oH zG9>`+9ypI-fQ%(5031DFP!W-40$%SW^?hrdd{-sOOL+mn>hAY=7rd8yUCI~1v01FEX#ZVBQe{A>SGL2yYhKRNN@g@x5Oh}$0tr+;imWFeIP%xCIvOgROg8i=U!X#mz|va>xkS}KMH37KCo7H%GoX(o zQP`d2yGdg70gnwbmv6kN!k5DDXG;pvqAzW9Vbu#2q|y(=&=!C)zXT;3vD+sAwuuI> zATNg43@zw?d|EsS9b2ElUx9L8ICu~e02#<911eA$2QD-k3;A3yG(hQ+Wt!p*4V0IW zv|QBCw8^Ckz}vEOgFuwt00BA-fc}KbN8mRaC?CcP|6%rXougj*!p2J*+0?&w6}a>@gBoKDvhjUGX_PKs1+Ttsf*rB# z>F8~(RwiLoxBQVWePk9I;Na{mxKwC>3K|Oyj0GEo7g!P4GF{RhK$Yf!%IP-$LGpHh zA%H0Xsn8f1j7ti>8b5VCu-61Z=q_P(2;NBM=*P` zArHTQu>Pe65adVH!CB$oW{C_$$7~tMuVcu_BH{EwH+Y&{=M4nsbmDvzgST|fK%!Q|wtyMNGXy{hk4&CX)T z&?&fb`$H{J?Hg_Q&8mCjsubas$t$n^=m)JmkLl|_{`j#Ub{_uR=MJ1* zjMjg`BcBSUjC6$?6zMW546JM`2mY5g7X>!y^f{osOSdcF;#BxwIh#I^eMrVp$U$u? z0f;h*Rin4jYczV01H*s#kn8EX=kW=3(w^abR-9K`tuMU_oDAe~)R_k!nB6}&H@DyL zA6=(4@N2bmztYc2DEIu*>bZ00Hr`*-{0{t8|K`n`YqxL0a`ON(o|zBBng7_FA+6L0 zSFVKNmD^YJ+dtKEdjxstMptzMy!y(Q_wLzs;IVH#_82G(snrjkJMcNjdGnd?Z^!>) z9_SOno~k9>iW^;JX7TuWhM#&>39vQxlrU7gv%ABdImn=Lf;qt58Om>>H|ewp@K(** zcw=KD<3A6L$D{T2QT{@ENWe^SyG{L|<*%-uKYvm`j;tPd;DNbAKmF-**|TVHNA<(8 zhIAiXT3uSb{r)+*7XpU6J~H^#?ICx8A-Lbf0}sqJ=N~Y1_`#JAKfHbA1F12z%W^vi zy3xoCbKEcQjn~%J*B|?qP;U76Yp*?b;J}+d{K;Z*17#Z7Mx{AQ&4tD&(bH~vg?5!a zJ3Q6;q#BQQ*1r(5#BJCzz*FU9{pB{|@pz+GJYkO} z?+!0tzMMa-HZxPNck-DnwY%l}gVj~df25vyV0Qk{fBW0nLICP~Ha1)3sU93GUA%ew z95P@QLEyRmJ4|ACa!A+w;H8(cxl@ecPX?nX(FTC@Q$f6z zuI)0Ed+djAzWL67ee)+SvbLB~hT74Fn_rE}yTnyk@h+pZn5!k=GLuZ(+8RlKG-5ac>>zef;1|}n@O4iQBu|^yoY1i^vd~RDr5TsQL#UT zMp#Y&{+CbSGNCL>G_aNc4Jk;@O-8%00ru%&LD)H)U6K6h)X!!e8V7doh7B-;oIf*n z=uq*tXq*lYFyA{D34ee?DWZIt;_eIJURTCp+lN=JB$*8~Mov0zLfYk_Qp z75+oo*R6|G&JQ;#8Yr5SJr0zxtbisJ{&(S-=SLdKeJG>^Xc1t^rSxWj3>v%<1ceI# zz~fvQ<(H%;QFS+0>1y{6-~;@?kUZa=-L-4iY<5BL-_HkufO0SX>R0)01mJq?wfsxJ z$~1sd?f7$h7eJT}tQ!57-izZ8atS~RPp#zjQSKnfpPmmO0MQTMaX$CXPdd2;nCjqs znVZG2>KglMcbz^^Y2RuGM+Y_`jcPnyRTC6|E_L~hvc*Wt{12k_>i9M(i74VrCqTSP z88#N&KMxlgo>2mMOPDkm2#kZCEdeTBA6?G2wPFW^4(Me2x~U)h;MLu${;NO8L;w;n zGdus>-_DyYDU|YC@Bs=Fz(GK!55T0b5jpa&jpCMFP#g@D4Cj76SUfJrq zqJO6}N;N*59ugs=cUsF^luZ)5T=$mv;UirL1;f*PCy6zd8!sHM-W`i z{ZtCT1_pwL!~vCtm*e8uHA(>dK&=9l7J&1+e~@_rIJ9eac7Fajvn`R^YPsirH8^J^ zK&`I&_0@B~GTcEw4_ia`;>Gx;^!OlfW9M^wQR-X*K4>=M_u{6~!$4eqIf%O1iZ9TA z^H`j&@6o+12$rKCwjX{167Wo+0rXD+d$|TsiJwkxelw_Y|AmWY0tQu=uN;p7ytUwq z;xQ@F=$XQR<^REe zmk$t-07#+)UGToFAbL-)ZCDE&U@*hWmqY6%sEP^zzjB&-^;NFy$8Ww0bY_O^*ZgMz zs50;+0ziT*0GIMTG%)z{hZo!L=y^X}_jBRr_S!ERYcs)}QjRoc#j3j;JtUs0{f=Y>?Lw zBZ2U9WeG3=0c=291^Gl2;<67(xBy(yq12l{+=Bm=?Cu^roqmtmmn5db{~)QpVKv1N z(MnT#`ySXE2IT<@LH1Ju#G9-1enGW?HeuLir&+j%CPw|B6J$uZ6;Pb5FVDg%c$Q`i z@ka>TVw9Z&$isB4N^KogrEgPC!1nXsb^`z4AZzSPuOb41>HxihsrZU_R-k$(O=GA0 zt0>%}&kR#H5r1!}$|8{u?c^~;gQ!Gh2zR(Oi(YS^)%MyGdDO~AVD$|YXR1VYyr4S& zk~6H>Xw}Bl`8yyeMstx2LTrI3Z~39)1%6zSo2k~anC|;qza;yUW9Mp4caX3=bQR>U z#lfiBa!tey35tF01VMRhTLGG0xw{R)o)6|n59jYCGssuA0&q%kB|{igy|L;Q3mJqb zKHas#+&d3KE=ey=-+~846*2U}w=Ls(o6!t9ULz{MkUsFL(?s_B#o;>JtM@(?xcU*B zZ4s4+s%QdBgbftNb~+>-C(n}$U;~JRTk>Bp+A*OV#irYwmT@0^&`>~oIeOxUPgG{; zl9F)@6IGcYtyZhVfAAwI+@UB+2Bi(LiJbpQ7!7>hPBAdup_;zfuGdMUa{iE2KBARF z;x#tXsAVsC>V{Pb7}%t04JxC~41Rgj3&&}-9+%&N^)`fQU<5VU-hm@RNI}Aac zIsc)&;gaXYj9j>-3d7wJKcb{`RY(Y0*jz%-#1#sF0^s~`^23Kp8emZJXH?bSbxxE? zC$imN6{PmkZa$x9p2shcM{}eK9gzzFM(XgFt6CBK&(BDq!|Y|KDcEd+f>Z@Yd_(T< zVM#zY3S9BVbH5htYM;B63h)Ph_U=`UTI+F{%wJnu8)ymGOb$4OQspGGsmKIZ6_@Jk z)+&R=qW?Q;ov%MAo_vsDc6Bxa95+FL>z2JhE&-20x6Fgq{W*95(Zm1cVP)HZGXM2O zY?O9{2TJ^BJC+Q*>$j=`U`ML~cZ@Yem_WeYuIv(Cz~(=ZZ7oYgDK1{_G0MgG4UA1O zXy@w*%wcFI)C*@8_wx~Fvm9wRlYkcaZx^7}`l6o9U0d^g7Y1%^vv**C&lOe^a;S9N z4Y&t|h04=$j!FvtyP_S+`BqoVC~Nr2#}{!HPGc6?#Kms=0&V344@b&!1FI`)%J<)= zx7FMUjBJl2r1n^26@0CTmCl15gd3Y9A~~7|MwHZNq=P0@Xq#zB;|i z`Dj}!ql=eHT=5_2r{zUfe8L;2+bZ!G+Smj&KotyE3i*{1z{yqOMwv3?@6j?BR;|1^ zeC1@x2((6M;_LuII3q%l^oiUUBn*Sv<51CZM7eA1`PK4ez){4Mm@QxBgF&S|stka? zTuERS6=kR@06X(c7w8irrF+_LdxZuI!<)XD0Mx7euPA`Z)e)WTCZHkBTQVB;vbhEW{9phH$PRFep+T#jKQA6Z zAiP=-gc-v*zqg6*w^5c2?R=mL7LTUfgj$IM_3Cnl5`%&2%eG6=N|o+r>C)`Bn^Zll z7q4&4|MLB~DgFo90yqup?GOg4^n(1U^Yg_H8oF~7X;fu}-xU9Ce+SU=Rq2!EcjB}bIBQjiz>X47Vu)1F);ZN1|Y>rnaHuusuOiT`dz zUjuN$iV{`N=NV-Uz%&J_>35{3Rs?JC31}14D7YevsEQ>tpa)!eYdiy}5-UfgYOnxF zV)Gv&gRkwR08X|E0cC|?l_Q5W2B`b+r%X6UGz=6Sbh5%<+ z^1>`k2!L=@@`H?-5Y*`={4bvmvYccp{nP=smd^sZPKp2ZV!FXXkv{^J`0|Vc`qK3I z7Kf+L$AL=uZB)~v@9aQt(f@&IzD+aI0;;l;W-oxDguity0QAc0Kq|*{xe67Iw%IJ( z%E3yK@`!5_SS?;Tb#wmPRjb73yNPLR+W$%%-XwnNm|eYc+>ZUfG`(?eFiUFg5Syrl z5+DJ#4%il3*Z(s>x!jvo!{+}~JO;=nB-o-E@`F1yQx(`}Lf*%p8mjZdl_dlD?xXkdr-5RDj7D_<#qW{f)?H%3C!ni`eqRVU zb2&9Jwgak#*NZ$qWfU(uG$^~*kcWG4Bdh-G-O+8Y-L@OS(D{)q;&YJZp#t|%9xh=H zIJxzSXg(UpEsaQ9Qn3B?QTPSBK4zJ>p*{f`0z()~&G%Qx>ho?K0&jz|`e-e+fFc7B zI8vgk@dXWD9^;lI#|#UFe(kj~{pwPMw$iuTHRM*~xVaAdEHq4f>MwykI!p-tmxcg@{)P@y zd;G<}`RZ4{`gL0Z2GjGW6@i$#AzYG>q_TrTP+DWyT0MV$)mjz>_MdOr^!cUpOC@@B zDNB#)qyFbtUp*E}{e^yQ>HI2a9uRs}(_5sEYpvJ7f27wf$fqgSQ)>ZFgaZ?sM(lct z<`F}azv~+t>#4cTEp(EU=yYQP{3k8^pRA`F>yv~^K=c3Ich6tknB+=gs(s4!UoiEP zjZpcV-^>%_f4q=&;-~iX`g`^i=Rei!HTnhJct7$| z0&rrpS;WeLu=0FlSwK|aB_#=Ptql|u`XB1Ewq~YdL6iSBU5-b8u;{ir_Uh{SSC4_# z90!dCvT3$oDSiq3FK9>jfBt+;i-ZcJCnf$>>m_|6c_EHI4jttbbO&1(v^|T2CAW|1Vsq9ndU%WKX}>*s~@K zHgvz2(+%?fum18IYw=%FU>c1c`2Y34`uYdM?`Z)#;SZ|ID+Q%vVR?xsk;U_-B{x4U z4GQhacaLYvVzP|&S5^WcuQW>$wq}v$~5?|X~+X#$FuS7#Kcdx$7c1{ z^^-R?NPMkz^JdFg-~-?4k@h2v#-7WU8`=g4-OK3)Xjp)6{Ojev+yln}^k209&A<8T z*M}c`PiUNQV!Hc73zY?6+5nVK+Ij|5DYphCjQZ#lcR;t=G3#HUU*!X!pNNJLApccN z4FEc5#{u}6=l=<4@>gm8-5m}0&yB)30sob3i2(Xe>wlaYz|i2oIzSBo`jK`_e&^|J znhykm{>J5h{Yw?nX#o8far|$FSH7ouK|>Y=Y{t7|<&6=Osg>o&N-Mf5vM*{f{qb4IuP|n&!Wz zABoot|En|~3Kp9D2b(ng7sC&}s(K+LKoU*kSSx>plVB4Cu+t5{0?-a9a*@GZ(rrV7 zpR#7~lhNS6p>_V2i~ot}1mie3bf18R4&WkuJ``=m?_B?d1zmphVbI|Jg4WKgFGaFk1moy=byQJ9!QhDLuUDIu$<900VM}RgV zjZZ*>oy9=@4r#3svYrVj8uC?=;NK`6+Ngkgpw^!D0t>3yOAM-uFHJ+rClyi-@@Y%SvvA#j9^JiV& z9(y0ZLy-ORM+J2HC;-18{jW#=6(SIb0L&l7k$J=e;Oq+jRyys4cmX_L$izTL#L4J5 z#DMYbmAKo!wJrhxOvrxlA8b!=f%{|10C#=9WlMl5)_wf0;CWy!c}y{Y7JvfySJM9q z`WJE!Xr8P$@j;LrkK0KsG9WzHA&P>~@!Ro2XC;OrARV2FH*VcRFBd7eHQ~=>oZ@pU zg&s&D4B-DQ&3~;5OtJ3ccLgs1+vgz#)C8~t3N&>8{88{8G_3*H&mcuXGyoYc-Mu4v zpC1HP+C%=tZx109{BEx-$I08^Jy;CpQUdTpJupW9r~0P^km*JR$d4)3XMj6)U@M?E zd>8KTmbgbR^t18@z4>{to&o>^aCF{N{6GYbDxpOR$b0sFdIHCx+JSIcn|bJiwj5cB zmk?T7X?Ol%7$Nizh=;?lEb9N(1k6R}2lG?d0BV020onj)fE?>o0j5|xVw-`aAREGJ za0oMBI|2#baO;aIAJU*lYcy=9f9URxa|9HGGINomiaR>#_flYuFKw*c7he8N%p=09@ zW`Is0EdP2+FOUKN5r8cq>y0A7_nrCx`#OXnfC?S#`{t1&N4{w&Czzl6<~P6ft#8g7 zx^%x>VA0@s_5S$u{cu-MoL{2B>4zVB=;8bUBJds*>HLJH!Rl)9HhRz?tqslFCr-S& zdiu1XoOb*5^QX@jwBxk=7$~kkO|K2stS1)y0k`ES=mN9=;s^4Z>K+V-3ZMx<*BA9q zXbk`Y4nVt|z{*E4zMc?4AlFw`pc5bn?F7Ss@rr;VA_5@1g#@tkLjd3e`Nn{V#Rd+^l#^{wxpYyMa6hr16y z@x;T{X1@ne-0-vg7I~xWn_V>BY!L{sV-uuA)dQJyw-~5py2fsPLrd2?o=Jx%~ zKJb6dNWdod*NLs}pHJTp2dBYq)ixYgE{jl>e`QLt6OMv?j;{VIT4}sPP4FA^* zM?epp)@nhYSUvsft0zvZQ39a<)$8ZaJI?vn*G`+eMdL!hiyjPYns3Be z8{~8e()BqMpcr`c^}&6Q0)THtS~@;Q0TPJ2%i(ge9K~;w<1+ML4xs?x5{d-C{W~5< zXD|+Ix37u@fcq!iTZRG?cmwH}0WAvR14#d;4{&G0K((vA3nFmva>oD7==pEXUp6K{ z&9&$D?R#wB<&6J#b^m;m`{B~F$#31Cr|5^&L(aqC|3iFAO+h@A7=-piOp8yey~MqU zFPk1ux;0p}=@TbbS5I6%A?$9e*W0IC=>L~b>m7-Bf1Uilob&rm=mBVbFQ*JR{?Pdp z0FDD725|h*_aO%y2OOmx5bhtPD!`{r4X_Lyk51n19LIm$flAb!uzW=Z z{KujCmpV@{W~sgM#LDn0;yDut0RYHa8UhFb{5}`}s(^Gt9l+7Q_5%cWqygY=?TXjt zb^W%XwZay9E?y)5wFH3P;fq z;P`;PpPmC8gv(+GI_-sJ4g_Ktgye0+Co5wJ2SrAxNPDFdW1{fJ8cBq;Ot; z-}hAZ%MQJlH|=y*9HGkg(CjW@1M*0Q}@GjephMsanj(n)&Rl*aT+ok!FX%a zxGm^xc>r&&x=XLC<>gEQ7;i0#y+e9a{+pRV4-$Y62LPJ>*I#HFXMqkw#N!h}1BjZZ zz8|#XC%|v~(G85z{V5MC?d8tfBZ-HfxY8#3^*kVL065QSK=7aAfHA#6&3WSo-nzqk z0jQD*X>3LpwM8{Jt!3Cp+`;*1u6*E65g>i1_rpQ*eF6C~FhFSQz_#bhdH^_l!ft#E zz1;RR|A8IO-;CaB7K6TjV5R}+3@DJK|JBf}H&nmGgZ}~hI2eu}s{fDyP`;tz2tpE) zgol&SLfmPyyXzsK9tdy>Sh_xM3UC<65dt|+{%=gZYv|Jfn2-9S|8L#~I|FTia|?;s z5$N{0N?@Qw-wD9#jN1f-f$X=BeLCO>0BjaT&v5`mSI+}znu2fqKs^*}uY_%k11JdW z=Is0Uf2Bhkz_B3wL0E|)f5#jtkmm0yrXo6Q~6M+Ce1XGrAi{zHO=i z|CsRUGoJv@1yK6}C<}ft07L*G@LT`^5KzS*$4IZ8!1PlH_pKp!jJ5Z95lmb)a*z2(ez5V5=Em3KU3Rh7sy}f^M?Un{sxLij%fL;{5W{ixsnb-&;2vl)c{qtWG2 zbOsV&PMX5}XjI(k`7CgE0w&DgRtG=={DEB^NPzXIlH0#htt+)gzCXA|`Sp-tKk0uu zObXYymvHf7TTNFV#@-HEV9F;{UOJGW6AJs^qX=-E)eOo0U*G!mulqu;gwYwW|MF-w z5?W*Jc4e#iT}Msevq3s4-b_nGlZ`F+Fav7N>r2}UfTLQ2vKc77oE!3SrDF8pj#b~+ zSn8C0=*=s4!J}!Ux=j_hhk;|_nV0C4Y4Z||PEy=^B}&iPrEAJ{-K5h=vqa(AC`>nf z9482e5xD=}S&@Ja%stqD<=40Rx2`|}nxI$CfcHiMG8M2k@CWaeL}32z6hQS|7CT~8 z)&N0NeVuO!HUGq5$$k_`!y28dmM&q36N2U~cF=AI*H45_+$3?5HU6ZD#1rd7dAWvAom6!& zd`LT}lFo6M4&9-P3J6t3K>dIA{r7L*e*Y{azzdqt{=dF;>q9L8Ua%6aj4qS^A^~Q< z*xPIGy?1-HxSi@8-E}uAAok;U&AOXPR0N3k*R2FmT2^2vSZVD_)j0cu)%?Aa1!@I{ zRegY#wIqP+MT+~&DokCsBmwm(bgeF=0#$xvI}h~je(1lsYy$OG3q8`>#4%2X@0CQQ za5D12+(V_ka|8Kwl9+W`nHGcvA_xm6A`?va6ejR!%(*56mA77U*pE1Qo^4qJn zj-6j#{?G(9RJ_^iNHmns`=@JbRxj9fVE)Jv6Gj7#))0>`L!%BsRAP8KD$%MsMoE?i zC8Y?|?dfBspQO#rz7l&`Xb6=y(b85Ht@4JH7^|nHA%PqyOoAW385cJLkT3p64t%YlvAYgB9t)Xdi)W}DU3j2*dFkwNVAk?x_@tbchPhFwd#xo7j z$?XD%?^%gE;G$9^aBnSr&jIh&_$G=3$3P?9dIDj9OJL~4^T2xuh^wO^C?iNVqC46o z@L1|?(f?rrpa9+*p1lnNFdV`MfCOCW_aOj%_<`^Nr~#+~#0F$Oz|!jNi{~s0u&Zh=pYz#4S;94hp};d+>^ ztM{lC_$CpIHsBG!EuheK^owA@Vh>#&0dGy-sg@`x1f2t#g5BM!)#kllKp)^e(ExA( zXadmjZ@~h5cnc%JK1={L0J#sYAYRTp+nn*8~4;od^wJ3xJBaBBvw($i$Waf09`8Sz$l=YjsoQl0L4=M^#*=_9vcF z5Na7J-4c1t38R8o-Jr}7Wd;BMm`cvWVpE^%Gx>rwm8MYXAd-yD2#6O#_Jdrv3|iIv zZG%9(z~R}mXQ2lYXaIVFZ~@^3T={hZ4FE4Nmw@DqXaLk;>EcCQ3<5N7Xcq?ni+viU z1CW5ShS-I(l~Dmuf0xVe>u^0ff%y^T#wA(Z4=JHjmZfH|A0M?B|qWr3k z)|9!hAI&DF6a))X^u8QQcL6k)D$P3KP$w@t_z%l%cxsNq7XW3(aYel$Gz_ol1NmXV z4(|lo0L}t%7|5x>pnnDK|F7W){<_bpK(PUo060w zXuJ*IbBWe{ezPhQTO7Vqbi@k;BK)C)Hv@2=B5>u`5ywF*^a4fy!vYu=pu(UE!|oZC z{Hpm^=_x=!p#gF(Rui}CRgPkOV4-Zi*k4U>E9?}12Pn!|ye+lB-Kg}tMc{O_2t@4v z9nejR0RH;@AZ&tO(IOBH(f?P>StWc5_1_lN{CDIB6x22viBmu(sG)~|1+3`+VtZlx z)KM`GzXQMv;C~qKUuZ}`vv1KW{Lkq>d~B~FDh40;9kX}`{O$__M~`25HxL@#-;h)B z_wfgS>de;`_yDv(OTWx|ELY5Jk0SoFSxIxxutu%Fd)(n>9g=9Xl);^?&(JDdhs(G( zJ=2yAbPTa2vPG3ez{0(5R&vjxz0dr9Lfq^1?_j&0Tu7!<1|A=n-JuYO7p=XS<({^K zcL(ynyqh**(G(FRkRy^-j^?rTcd6+h=oiio-mx%N*T>1jj&f?DM{-PD%>rSG&YzMX_uC+W zoa4((VRQtJ3Smf~;r05q3P5$M+YmOoeMw~3wt#epRVS=Uc5NNeJZdLr=YAVJH6*JK$O|3JF-cK~2now( zkpJ(|1_(itYj$Z9440|&W2DIH9LMji;gF#KB@a#+0;q1E!6TN4AbHsgfWfCv77Qi( zPoC5wpbvQMlcz}w1rxA*^7KiP*%^(-m0aW-P6&k%LMK=<(db=?ETIS4D@j1p>*XyP zfZNUHhcB13a`19VLV_!0iP`tu-yX=lfPLQlf#=BL%-Eyz%Yg$zQ3K3Bcfb-DD1f6~ z6C}{|UHn;04#J~WX#%I)EUApfGauxAn#^8!<{A83HEcX{r6AE%Lgvw6?`?EyBLUz( z*VjM{vb|=(>@_6FN&uHJzK!_2M4alf=E__>w{MGtNQemo6%rghc@YdX1o->f>laVI zuJt^RpvyDfQV2XDBY{TvkyTmnzyHydejkcHJJkIsvMNlI@li6n8-GYXCzmjPHu>YB77T^Bh%G-;O0#io_h@~Oqgb$v{Y4E>b zCSZc-j1F z?DL+R&-e+xi$%x>2D|pnKUatYK?#6LFcc8lR$Y7CS&t-wlFBE7z}6XM1urrH?&FX? z1{a~ke;#=TUV|ZE?xEl_3r~*#HUaDh|D^~x0BILy#W-f` z1AT@?gVo{$8Vc^62Zf(An6VTGAp{`AZ!{z-)VJ%0dZX^SQ6T^G=Fxz8DEW=eDX-4% za6!M?{yb)#0bOr(aLU60%7LMv`{(Ht7?OZZn18M~5O}tRHz5CLS_c5x0Z%J~yuXWx;E*L0n~ehUBMtQaO0?DzCJZ#U9R+MYMk_l3 zyY}Ti0Df&|Qxr;;(}sE_~&ib#G4%$%-b zhN|=nc+5K9GryamRCNob<0YrQ1T7EMScrsu$g($6*d{6ixM@P0VAJ~ZusKdHm~EIW4j)BC)kSn z#HMjPXhoD;_ioYfwwngpLI8j)f*rnOT_bBL=Ke`2q z_?=SzUhw-@;rF<7?cNv|IPRTfpiSO%N_a5EG{%<5{hUo5o_iFFdlcY%cH-_C_H#O0 z!lb#Pe{7f`>m8yx=EB+T=B{oD+2eOiT29?werwZ_N)GTG3G~breyk}h1M}eL9bq$B z*~){vL)_c_{7(VBJE%ah#lpXoA72N+lbsouVLGK!pW9J{f*_mg3TCr85)E?q)Uw4? z9uRS`4uR{ZPU`UT@+l;?^+4M>X;E7t7ZL=jsqaJp@*+<)R%IS%Q*3uX|K1V&%MQ)& zIG3$DRucz~eKT!y*uzIZA zZ=E!A9qp5Eo#L&meCh*f->PzS3hlQ{fEhR^ZTUfcDti=70nt_yRa#4VYPKQ)Q~b4M zq9Jk_`z=Sl~UfE`Z zqiGJ5j|6?IPC>sc0?IvDx>>W?{d`MAlsj8B13N!zQnK+=2LH&Fz}isdUxFa`7kj%6 z90`lZ{egj!&vp}o(EX2l zO_*r6-@5Tu!BBAj)LU;Yza>i+|sNE#2wST~9LJQV6GT!YO<9 zdpTF|ZLr&UYuSUL$aqf4d8;B5umQ%UAcA5q3DiCsB{$PilrJekRd1Ho6QHqfT4Y%R zko~gvZNA&gKWG^RL=vhSNlxx@O(~!fzHNAOpod!WtE_l$;pZ)n|L5#fn3gd}st+C++4+0KFaj%$U8| z{d`D+r4RHOC5hNU15`RZP*Dm0f*xsti0kD|rEvsWVamwZP9bWXGm8x%Rksd+E+_&N z+8{qxIvqirV9QH|{RGk!H^AE`+i$&9uov!KWjzB`0lI7s3d705Ye4@lcW*M-W_jWN z<$xb(LPQ9KXMzG<-t17&FV#;Yux^0fmwt3je*KWdM?y{^V z+=*tsj9gaPtlVLK%xSTyzrdZ^oeJgF^{-=BsSw8q>5NTY_O~}-gZgeI83cJpK$pv!yY z%<#zY%>2B);p%6p!!Yo^Gc6`9xCz?vofog1lJzFd9JuMjWe= zl^kd5$u`zUTsX9Jicn9O9)uX9cDtOsQl1%?OZougg=OAKICbjUHBL1wd&@s2`<4j(>@>(B8q4cD1F;2c0sxRfjaA=b5?MQUDo9Li9Co1nksL&L|JV@qm+Nd=f83gCiTThcj6a126FS(1lKqYX`ydskg43 zdh0FTT7U>}df~@!EgwI5@{NC338dBOJb z5tPpmIm!pn)%Dy8w1qXvvfS3}Cm;b{*yvxm((hmSs2}yi2p0-p9^URp(aRt9`_0g4 zs$Fvj4)9?=fDZ!*@7bHezUMUqdEmf<08j+@tVTE-UcWrLdinD0(I|15r$^MV3GBbA3z=K42+)f+mADEqylLGJLHM0NOjceCVom@WUd2cQM_~glx z_`Crn@Z%r1SI%_%{iEIPS`mjLIgsD*>n`hLkH`p}K~qL=bj5>MB$Mhk_9D$`TjJ+wFKh zwwQ`8uI0fxget^l=43f$;!F=LLj!>Mr%#Ijw9z_{0F7udY=q6`?SB8|mp^>@Wxn#l z+qG+czH^{6-|2J?%pX9hzC8vFzHgC z%XJA<1YLat?B>qUS$(q(N}YlMy8AF+ZLHx1r`Z3mK>%(-0@`oUfRX+D!|z+|_Da(K z{`dRQ`$-ga8;2XX*c@a4;xi{UAPBnSagyAE1SDoINOX+&0+5C1+t)_#|NQ#(pI?9R z#cRVO(5&D*xPKgflmIEl6pS+29z~MsyqXF*0i7{adrIgC+5Dw^Lq>GR2c>+!d_Q`5 z{s`Z3FJUlN?#IWVt>U(0Cdq@v{dnR3>C@*$0NP&I?Oyrl%18LW(t{;v+-~;Y@00x> ziVhg=+9%w9ZvMy-h`=r|(1QtpYy^E8R`4HOUw{Pg11*qT9$rpm`~2&duU{V~)|4xn z9Rk4JS^fq7Ay}UF;bfq3g#Tm@gn;Rr4?7Q12xia=p!mUk^#2?9;#?vWz>iP9^<(n? ziLEX^o8uSP+AU= z=D>2i{Iesu8;Bwsjb&IY{r||%a{haifXogo3;R!>KQAf(Iu6<&{0G49-bdchdpWxK z;mfx_{18HLGrXyG%^!HK^Bmca&%6q_QX!0f4GjQqA=1y~{p1<^%fp$T@Soe^Qv%=! zmIMGMp#M=S_b$6>H{~7#G${}Ubl;>41t9B?99k4u1lYamElUtMIZ~y(#=CGrlSMCFj`@jRZ-kh3aS;_u&iU8FN%fneP5d#<; z@*nK~=i9e`{_*AEnIoG2$A5x9N`Nl-6gJ)Aq;#mf2@jInvE)BJB29(j^~yj=9{`ZT zb`wL_gU!gqgD$|&j%1}<27j01BVaMN7?49?x$xf;J|$6$i7`3>K^f}Ncd`s1rP}U|9^tNhBv%S-ZO*S zx36O~APt=X)pYtjboTB?-4DCnBPpup1xXiuvm13`SRevmp7S8E8)jhERnY%nJ^=xs z1keKf_$^TZZ=L+{^3B_mwf83<00062A0SM7QF?g;Z11z- z5;&g_0Jv!o0HmLFoYw9ye(7Onw&{8p{;~Um|M-SK2)qB|AO9Eu{+>K}{O0=gL>Qb# z(eSJnptqwbOb@57cU`Ihu-_z75CAfCh*&6M$&QM`6FHIOCr!iv)-ZKm}l&fL^1|F#z~~rPq%djZPCD z;L9)oFabA*P0ynWcurKnbDjBpDnwPnez*T?ZiP(0g&x3ym;jj#NQT49*R=#(7Y$%b z05t%a-Rs`&CNRhm2Y~@4fKEEB0sfHwfrp)kSD$#onL+xKlmKBrey>62V+be;05*WO z;5vH!`2BQ}M#<5m7f0?Slo+?5d`~ayAMuFl4$cGxBm-bVtfBJwQH9T+lGHk$y z90%NNzT9kbgP-R*+~46j{Osa;2hi`E5cxi30pmbX0o+}H% z0RTT;&dVfJ_#vD?4g={F!U^am0c-$73dv_?o+|Z!GE$i z7fu-k2r~YA9QGMP0K$Vrh|-X00P_BI+5n{MH~M4f0QUc|w-|W0Wef-*fGv1=$PJ$k z9GIVn7Qko_E`ZmA8wedhO8_5$^T&D=Xhs3tIQuGC|Nix>SBJyv3F?_ifOtBNgYjSZ zKf`VsLgBOB!ft>u0Q>^!LLx6SS!2QOz4aED5Bq=Z+FRGS&{#7b1A&u2z6Kv4obSZ( zN;1J9;JKsS1~P>1$3PHOdGR+G2LAl& zi!86l#$<;Q{%<`BFo8``sDcvmgOEaK{L;9t0_gi(8M)y{Xtx`=Fm5f!R;d9aECXhV#Je zQ#5pv9FW0Wuq<96hJvTw;!L1NA3$_JKU{};^e6-%N-*REf7>1m0Ifd_f&2XP?g8W; z!M_;uBU6qU`{@p16dNW-P~P9X_#(^uB1{0aB|e7#rDiOEQk&2w*doe09ENC#O&Kh( zmA?h+C^~tG!w7Ff5+VW;fN<0MW$u*?f6;8-l(| z!3yl79>BNS#n}pvZ$g3ohdqD>Am8~fwxAJ4!x5Cg2n^vS`m8BBwfq|ma3lzz1fciz z+h?iwL#lt&57!S0lfgjn*2z<3{VDYSYbUu7jYa_6=U|XbilXO_&d)ca_pT3{%`jR~ z&9DWN?+~cw z7CoHUS~3b0-F+IG{aeMeUJwEJ4O(r`B8Rf6klA<&{%vQ-Nnm&bEDUc2!4Am%Ahk=X z4rX~Cnp<}RvfhAuu<%W)@B^-+`(xaN2InM(Fa)xI)+h6k!#vFg+MBuY!>pv{T#-yB z@hsj8@Rm=W;thdor?^)9EjU0wUKSg${A1MRWYX>Rn$6}~5@A3BOX9e52b7wFU-b*^ zeo$7)efed+;5(!5H7W0zVRA%n2C?m>b+ow#)ogcT`Kc;=QK@)oI(5~mLEE$yoX|%?go^Th+mttN9Njvf5yI*_n?6gRMFZaF`4mxouWZXNzbO!WC@pQA zeh=*wEdJar{8;RTQ+=7)PLPxC4kAnZI-q~d;VSHxELK5Igi(3rxZ?Zz%^pOIQ14#U z#3#YDXt_?3tc$=G$SSX^u#vxZ%b;bwtCA-kvtJ|U)c)S)Xb|}NC3bR!2+pMAjN&vZ zM4+60Q|P4_`g>=T$_xJMy5+5Y{J05h0p+jqjG{%XvQ|+fBFOgO0Nlv~@Gl_*=5Pru zr*-IsttCK#_h_(EzN_(tLTJ!_@5VO_VWC`-ZBTPoMx*@wL<&Au=*NDto{Y?))NxyR z0rgZ!UaodOu~y7E|{=|J63S2 z=8Z;q?M6cw?9T9dm<)5Nf(Yi9;~M+4TN>E95P+O}(zlQKpwZI=qc25%8pk>X62@-^ zz86gN)YE7bLIng6gHe{p=u3XAiWk{dkxRgxc7I54vna2x6@Wi*TKZj@eyimkfAa~y zP!dM{mp=nX=|da}w5_n7GgfaWJk{dfIZT?@eRR_i!K zAj!>uD%l^kpC_&!}ZbR6tG{zjS$K<$h8%HL=0LjYQQ zGolint1wM#enK8+h?XJlXf{oxP6Xj^p$ifLyMNSa$DK)Z6n=mlbS7Mnp@S?DB)|*J zi%vHIdOz<5#W{be62d@bTKk4SqYj12zmRL}C>)J83O_}q;hF4B^n|axIQICCY{AM3 zoXjX`uSkBKj*NQ)TIit`0E~bzzK^mVeXtqUTgB=F^w^dPTPm`;Ecl=GqS46n9(=Gy z+OQWqLHS*X0?xQ`gG-%oIfz1*!N@~;&++p7Z1V@~-|y|8#jiCz?i~85320os%6S_B zxX=EtjKKP}S}UeC_G@uwW{$UNQ1gWV?8aB?=jN(>C1%ZcQGNwufToBNujSX+jd_L6 zveS8Oxs@voh%$OV40KJdF9HA+5XVO+umENQ>~IoY$|b;u4d7hgb{gAtU6|oa0!AKa zoT&Y-3-Qd1`z}TWIYu!uOpMJX8K?^vz|pKhV_eM*6C*%0|B4eGD^h|XPt$WSouSwO z?Xa^)X%T3)YH3~V&hJ*lBlH#(?uH|gvkb@ziw^%_4Iolu*L~eds^{1#q;}RtKU<1VRo@ zqUh3EHgR;wcfuq>i*GX&)IEl!A{0yjECxs|0e;=k25j;$bye<{!^(Ogd@Mu4e+a`g z2~G9s|MNzdY48qpS>Vyd80nYjvcX^@7$kyzoppQsU^Wnly&B_<(G$Q1fXc4##!vvU zUoaE}n3!ocr~znxJy@0la3Np=klqpil?=dRLxBHh&w~B?pDmn#L#?_A39fo#!fqQ< zc|IK??FcfX7W5~W*2)9``q~}{)^_hk8unl+NwOUYC=^Rt079yGWSFbi8Z|-=R{I?iZco5g5PQAx%J!z)EMujg#h^R zZtVeR!0Oht9??*78~J5#)Sv*s3*-yRg{A;dJ)<;Pkq1%Yr+N9E{hfgw_Qe__+pyqps*Fp$g=!3Kb68=Ih zZz}@w0u3PT0TU1%2vJ-7Mp^)PqiyX{`;u-U$XJN}AM(}oTa5+5e`W6z2ih&@Lv>Bt zX9q#noEoleF4@7A@{0Hn{BY34voy-@C=3J*h4|R_z(gYfK^?M`hC$Ki!VwsbfxIEX zL*LnLF&w-^>yB~(i6H=?^X8i-#b^{EL5xf56NGwAbEmUux&WssytB0a)nUEXKj#4wNZI2;EOM!UmAFal8c^{hd_00Mlmkhf=r_oYD~IckCe_*6+T z5Zu%Bau)!+BxeR90Qv|}nF)jk3KSyHVvlbXBE{E>+x?3YXsZCkc^ruYu(ojh!Z_+u z0E`J(1ON4m8WFFH0t@TyF(h+^M?n5( z7g#v%yxHhvEMzd`~a zi{7^US9M(5b@L?Bo*0;FigX=x;RY!+is5F*BYlE$MrN4k(N^0DM$L4#mDj7ZlU*O)mP6lPAPbSIn*JXbm*t%2-`x{ zYA*D!MmUi( zcJPBk{Df2>5CEnp*J%U}a3veU`W)^5nJy*s3nE}ymL(wbIxdZGUE+++G%D#D=vu3; zMF9CQFEpsmkEOHoRxVnHC)A|C5=mMoQR+GcfaqWp00dzqWEe$~4azI!foIKVkadZ# z<1p#nyCDF;Zb|@w#sgp0`eF;`0jp%d1%u2M| z8S>1mG`JqxOZd+NycGl`fd0>Wfkpr*hpYu9Kt+DU`r#+5Q3WV4lLK4PPyiMU*kPf{ z`Bq}9DM)El$Sh5EeduXGhgkT{(wk78J^3#O?AmG?Bf^nH5hjM1Iv|JeF$75yAgrPk zkSy|}QUMbNK)BQbhLrp$GWrlCd}*mj&r=CQ3d$rq3V!q<@EqX1U>WHe4N!qTzmn;l z!Ol?Yl}{gm7m(3h&r>abn}_Fhv?SO9JwDW>q1&K;MGi2$+-7thuVLahM{qds4m%E4 zblyEgt-Qj|8w|;QlBVVCC7nAoCRv3fJ2$yuysU`kk2zdLf4oh7iT;?aRh$kQgq}=c zDHy+Ouk5}{Y{!5O7~CI&zX+HTv_HW0faQ$;y>k-EOV}UVZ|Pa6{e8{k7mhBY75Z}D zCjbHdFD!tB5G)p_^y2kQ|4*ZLIB>{+=kOLCY7;bcc>(16iXLEK*b_U;XTbLM@#APZ z21N$gj0|kO#!op*NM@}8V*A^8II9cU9yDS8o6R6BJ?&wm=Ut5Gq!uHe3VLD>3jq?k z8_ND>T#MLyH+I_bjcSSSxP9#P0LZ=H!?6EKU+In7&Xt6Hp0uXfWLA8Y1fyo_G%g;7Wgy zg$+ z4;9{f{LLp8+6V$*{_^ta<@WOFEhRv~v0U<2(~IT~jOxp6vy}z8CCDLOnwlrpgYfw# zWT5|Ra32ACeo|u;IsINQRDG`>g!=^gf4tf`Q zs&_61|4}}p0TysN`n4ud(EdVWp?~FqT(cKj`NzTXJCJ~dJ$v>nE-v=3TtO)V&%|G$ z{=^yF6M|>v^9lrvr+P|PLM+soxnlEGl8pTT7=q;{5i1adFXV~v4Xk+kCD>l{d zHF}c2F1piR{9xQzUEK4*`7W&wJ-G3zlrPJ_$MWO?HAY^@0$NMjt6$^~M<9OZowpIa zXA$`z&ruWJ#y}pO}Sjy+YFvQ>O zI7>CS0ZWGeE3EH|z8Vg-pJ>%;#tR6V{XX~~MUa5Legrh|ein3o=KRbQK16Y(eexbt zMV6p%Y#wywm6$XiyFr6)l0maS8uhOrXYgC_e{p4zz0CkU6#QD$0?_H8 zX>o)M)QcQ?eFX_X{t{3AIKrOf!=f}X4k8hxj6V$tE2M1rG3xf7X@M6n(KSMM)gMg7E@sBK3shv|0}>$e=E0MtwdQ`RiZf3yy#s3x0N_lkp!NLcyRR zwaS~Uf(!kwB*^&-2@o1t;D3`0&~gp*NGVj{p?E8>$yZh~C%)g0(7uJZASrvDK3&up z2F6l+tHML=Ssnuna458I$T+i$`-NK1E6YBKdGTod+9Ll zWqJ3qOs}l;_PV_V#`Rb9Y&Fb4Z?7pCRe;#a*qgj75kn)-^%OUkM1#+8vOYQT@D5F=hkxv`)R(h_hwHy3>9DfAHXDU=l zIdP z;Xoh<1Sa`R|!k zl;FR!+uZjuDD$WN5KRD_0A>)7?M*%$4F!-10QleendMfpeTws^pgi4xhQtB22X!_C zQON)n!gj)N!ph>ZHO`M4o@%)H4d&j3MHs<;s%bcW%I_>J_7{r`tm{iFfqrvQ2L%h` zb9VW_u2Om76!sUc^t`rtDF6i2%75>|+ix%IRePh1|CM-xcWN>QtHVd%a~h9Wu^n&| z94PJwO8rcj^Q+D~jSR^mH9M=PI2Ny$T*SG1#cNVSY>Olam6e>VnD3`Z4 zzOv95_q*@|*-G>{ars4E0DrU>0E6+ZvoP`S2MnO1pyIRg9c~PnwXFkS9tsOFT|c^k znE*I%yzvI>`{jkcRsasSJ)(i>7ZuXFztEZFe6flesL7&&4AMTG*D{I%;IuFfq!SQ? zAzVLhkVFA68i2!F>xC{0XrKPrlISXspeGGjqKgxzGr-uUk*ff;xDvs~%^E~0v=6(y zK0va+hz>+&QXi?V2axME?CXE<&f>U`0LGsi_wp`ZDK9&i=TYtIGgQ1l8Xy(NdKrj{ z%@Ri(vg0|<jPBOQC@L;wks|;L$>GM+zy^sk^H6B1X z>#jg43YezKDM)E(GS5GwFWF=spIvdPJPZ^x7;e@R$dds4h5(S3XhLFb+Wcyms8WJb ziZX@r(8C}!`3fXJ6Gb{Srd0%nC?YzMK5l-5!8*nyo~kcJgh5S$=Ri~T%OvDr86(B{ zPPB(6|0IzX4@=5UPfn7S9^SK7aOxTVq<9XY3e$$0HRYY+eC7AkNB&q=z8+vv|CqxT z?yMqK3ki0j?-rBF`IE{4oqspKg;c&dvdQ&}{Q)4@Y3=Xx_u#=2hE5WXV(ZpNlBScQ z#qgEH>#^;1mmn$h427Ae*coUiSkIu!>T?&9qYZkpiH+zOCm~@8MC*wi_5->OnW%61Mt~XiU zR2r1f<+C9B0|+1he3&{7&BLhS<AqeBOO*o)=ucaX4Uvgbn zCTq0BJVt8}CAkKL+6VU+uYmhkpaQ1y54hJ$a>V~7GZbN%0$Cl!QED+<=x(kxLEk`p zkVLr{QZ+#wXV?} zu{?$#Ql6kg-YDcWY6z>&@&=H#Buc_KO*1nO_d1NdD7|pw#*GNlf@s9!`kU4v2s>x- z({cE{8KSGG-_@(ApB8`wBQUi~W##P*hn>?=diu4CgN~WdUr&z*?(wb{uN_~@oHxR_ zagn0}6|JLanF(ND06+33>qf7d>S_cL)R`6$(Ey8!A6!|Cr~&lggbk6kcCd=d z9gy(p(H^p#H(#OzVvsi?0n&t=j;GFc&UR)?8lad5PJ>Aj-oBdGFWHqu zaKlY`PY;KDax_{!f3a?Mi0P)$8{Y9ZAeEEjv6%)C)|v?+Zgv|*lS!u4k!6?&KMWJW zkL75cPlp&l;)6i9ht>f74>;X~kj^4N)8r->wd{6%v__iRiw+8auTg^b>}CuHC3L2M z_-5!X>EdCdXf!J2m7cMR*PTp~812Ji5D;XD7`UwIP6wX)WDG9pxjsZ!Z7fc>7&A}i1E69RxLpw|maVHTCgU75R4ilLY(H6IrB zf+)##UVw2#RwLCpJ5#Ufe`|jL@G88j^7@4sf_ZLM-qkwzj4Fk}`CtM8I1X`!6T-~X zb?IUhfbcYX=;OTaL%51UUAWSY?D9A|w8yjY~BUeT! zstUZwnP@{k^uQ4sG5vgK>?hgvHKMMgua^}!O3y{-3jRR5;|uzezMVd#oChCND%5I; zS#felh64_#0hQvW%&-Lc1B{GE`I78urX<}}tT1t$dgrWy1QaX@(?f?2rMVVB{Zw(g zmCuQhkn*DEqvx{r`f|t7@(^LUvQ|ltKQ3lJLLd_WNI+IQT#E|9=Eura(%#j)kD2QU z$aFBDi&TI>3jo>w4|+U|V&M}cTy3y9|4{*HkfOFR80K2^B=XcbdygOpbif{%@jM!L zQ|_~CfRx;M*HBWAiSjTulZQk*L(hc(jMH(XpATiJ)TPxtJ)1&bFEa|!syb(N5CDyY zWNceO6jALK5B#FJ6nYysxrqbM>+(^mY#xOO_`EtYh!0$2 zQ3MgU#mRt-TxlgHyEO`yB1R3-MiuJ;d+6-DJ+15;#;zWu7q@3 z{9v<@AGr#^srq_ExCq`yi~TE50PqH~vsSJJ*RB;}g6rquO+gK5g3>A_IvSxu7M-Tt za!EPa8q+lO!YB!BHzml&sRG!8oLNH;joSqSJuhDmP`(~8MK6_TS^(>6up#jIll*yB z@IO?v2hIBD1eJIQ~=p3QCy81m{=vK)DL|!dz^mI z@!@8|D?m-_oCqNQF$AT!Y3zpXnoJ%?3+4&{*HK`r4pVR0^=BiI&TgJz+>h#I*9*vY zI00G%hybA2!OA~mOI-=nx2(de2qs}kJ?ub_Affh<@{Fq>!;b9+U<_e`KsbTQ&r~MY z14PPmU051@YUW>)}CtW`gjmrryHe8*WrZ6R;jAi$Zd!^g=opfaF)f)0@15GFT+ zY!UzsyJ>sm13`=xitFi7AYYh+pKLvVw?ZE`vA>3uPz*yV(YFowo(HfHrjP&=uGSA=>#D50rw85=C9=pp zS;r6>cF2%yKB#c(1r5r~18QoM`d?i>Q=+Zwg@KrWMOXm2D6TR zBSk*y*pUXqWe{dEgo6@|$NGs?lDxACg-kYpgu9Zk`{OGf$xSY<2cYsR_6OMM`sXI^ zgMQyUCc~_`qjo}x!XNUd0I;7+cI@jeU;6_Q;DJ%h4MVIbCOu2om>yhhJ0g@%clH~u--T(c@apZZTXdW`b199lT&i+6(N<$2$V;@>{6o&?^Noo7Q6we1r|0aR`<0j#5g8f3zMuGh zzY!T3!Di785PD#M4l&>+38xSX9I=0*6+Oc>L=xmP(jl^j@misF}L0U6F};N!4Nv2ydHp? zuIU7k0Pw{&9gTQj(i^M)+LN*N$@7y}LHa#VE&-UWDK6uqrI5GJbq6}IM2x|Fv--Wj zFCj%Q{N;qleVU9HWCB3i_YL#U12QW3^gU3%9sn*h(6jw#sl;+!IAwNP?t&yfD1X=z zZx+%lI6>pS@%C|cN(F`^87`l>9zX|3n0U{u|LK14Tv*S4Bpq5LLra60D@E=JpY=8B#nMESoqf7Dp{BzC=_y*}g9~zesH_|drLoZC>`BYvH z0282^267gQCT@LaoSMe6Q&+~zQ#dam?K^Ie262$RvJT|Hh&&BSTVg!tdN6!30w9*Z zMXifSsaXCO*m3=OF~$j8iMq;2Ic{;90hBMH7E;d3FY9IE?Dm)9ORhW5{o>A$0LuB$ zZp?lL1>@%djQLTbF%Eo7Dx4PpegI(ipTeBY8+eSt$j{CLYbun7A9Sk1c>&P*5!VBl ztzu#H!?;WPvZIt_fDt#X&U8P`)Sw^8B+;LeX6sTzT;}G<|H|B4l#eCNk`PMHS7nf}|Z17*eGLA)0gpQTboGG)(|p;!c4Qc#%8~^nO3QU)+7eb>d=speBv=V*BW}l>Fqp0Q%hd{Jem1a-G_9 z#hKhI)JUR6e4n8S{s~BIr6Mb2UFW=UokE;$5piqZwaJ^etiO{POd7r1#@O2jT%4a~LSk zpGJ5*ln1nzG+suDB*d~P=g;hRvF_X)xIaHv5fli`z=GkD5bXn90RZH2od%fy>8D{1 z$nm_Aj=QdkJ=i@brwo#!OY`Xe(`?oG{Ja2AL1aX1%mP2hi2MB^OWZf#O29+EYb^@b z;nBDBXC*`2lEiX5okFS6{?hU`M|t-O_=rdPKW_1+PLO`M=@bJ0Un={rOd^pi038Ad z$nS#`M%l(mLKa9~m<|F0(D7Zza|Im~Q6hYbTZJ;dF0NdQiIK*;k6YZ~Ct`Nszj>a# zpRZIrzV#4tzk~Q(5~3r3L?{~2*Q#KXTxSfeS0AILC@m;49fGKMm5!AjnT z!5y?KU1_Y#!@v{Dw|y zKP_nR>$;x)HlWW^Km*{>N#&Gww?Z$6)j0A8!Fn?ms z@zDOJM&G$2^@D3s3jt_=s@lx%qb-+x;HfWLn+YW&*eyy~Ljcb>%w81?MUvS9ReU)W<<}U={J9A-f`tH zU9AF=#B2Q8u@JzcE)c-zXArmp{cb!GQT+A+7XqN@2c0_)RArMKgn*5Y2W57zKfgg#1;xAq= zm49r^i@pzDH7o)Uufz`!%3l~1y?jppa_>x!8wGO|p!qKV;DWJ&0N{Zn(tf2R%Y=K> z(#ALLpQylD@Vn>Eqle}-S`(*LN_3T)pUJ^nsFL_mPQkSfD5!YwpArC4#t`}o?{f}a z6Ql$F3LJodhaAoFv?pO__rZF!m6Zw}j~Yg!h(|~cKnr~P{ua@)yhsgJDLXHKsxait zs?h?j;{&nxsh}dOVaR# z8tJ(C6JzB;W3Zk*v$6Lw@M=P7+#- zN*cPtWCOpROQ&D>uWHs$#+-u@$bA4Xb1B!k}IAU0NHHL3(!IuPG*LySr5Rl zLi$V|Du5?0AQuLT24H#g8oIO23%K$fU4Zlv0+Bravq|~#S9Tre*+JyL%kxk`+iRi9x0y}Ak9=o{d5F#V9actj|fdnpm-A%>y`R_PiBDtHJ=t4?Q#eT zMo>Jyf(5>xzps~C(cwCNtJP@KYGQ-t34-`e7&(&b6amwv^#EgWb%Vg6Tc}LPDnBoP zm1871E&#RAl?4J^pQlPNRk^Tt>bL2V0P2*mq*qEFyO>_ z0eY@KJ1+ok4yyoEu18RA9Q7j%1HpfDUO?g90H4=rK+2Mfb_*ec@_7OJm)j9YE{;>j z!%7JPSYt+^P+?M8`4_KWhb3s5fB}rjKevJMuo=?(TrgwfFLRLy{7U(a`#gGpiD@#w zk}2N>@VtO&yJ5V(hsR8Go1O}`+FMx?C3^9B0dmd!;x;a!;w_<)m!5JA`ZQ_p*m(q| zg$w?%^5j(T>3i^l;S#|1F+q^mF*-fDg81xldHgH|<2#i~cO_*8WDn87B>0<$SW+%I zuQ(8}1Sc4yOGwUI(l=dUz4elcZcSMP@Emk0nilpKR6s_`Z7Z-|6?dKbAB3KJ`tY}; zv5}P@_>lTMUy)RqLMNCLXNfe_{u#(@^Jj+@jE`Qqf0M6D8<1lm}C#n5$ zbPDnm4-M^}zDP}|bRIuwynJKp0o2%n0KN_e_hqWDQkeq(p%>=o^-WDslxP%Q?+w2Q7aty!QG#l zn}a`{pD)&lC;pUP28@$%#QP=)KzWbsp>ZUj&ja|9_u{0GP9d80O}6pv}lYBRU6P(g*BE-WnM2q;d=2VFHRz6~BP9}fr1_Xl8twYgz1Tw1cp%~t@4 zAI*D}*O6*Jotgp!`t$RtIXs*+QB99DK29gi!Jsf!Jex3l8tG$WHNnc%k7WlPay5W) zW>k8c=JV{?VguhFIwkqY7fbd5RaNr1%Tv;Zdk%{#Ogf9G*t#U%5b2L2WHuvYlyRjw@zTuzzmBB(hWqDuwo_R{hzk zpBJdgQw#ItQXfOWfCp%6TBsqxbZM!!q?4O}9SC^+N3Xv=|GJC<10rC4z92;cXoWPG zC>X8URdG-0RzN9=WBND_5@A?*gFRcraegN(2c1 zCFERK(d5j#jrjr~;K+J9h5%uD?b_?FPrv>;5P%w!A}$osPT~LDWq*GDYy_lpQ{ad3 zfcoOkyGMTxL!N>kEJ^c&T7}Gj$P(_`V;oU{+ENW;t|c=O1n#?2PKDjyh=8D0sRa44 zlxnV0t$im$2g(;f!e_UG)N}lqnQC@=@LbKU%~b#}5drC=pi-H4D)SZcAJ3-!KD59* zT@sxsOjM>OKn2A!MxN^WwWiUv< z9Sv+=27&!Exx5FGs~7|aephv=C!RV+4% zSJy86>KY`0=K6gvivKD@z-9C}V4wm7oMBn?*%=G{Bc;EZHxB%M(GN<~qQr3AJ9kP5 znCc@<<90BLo~i{?f$pGWtm1+h__Wwb(M1Bt2O~Mv+(HHYUoFg81oY87-D3Gt@E`p} zmx$P?)M{vy8k6hyD-{fb_(k z98RiFz^bVlC6GD?QH{>@)mi_i}|zMZ5aI28eD zT6J9rW&1W7?c*LGzHRY-P=#L=4%>yu%@sIlVSm5qg$P-I-DNyA8Du> z;|vb6o%vf@UiPbV)rlEz!7K=n^3{ZInletxMS|sVai%H2<`H87HocuD+4TVb=CA(sUtO}h zMXQYMWvQJJ8l+|hu0m*6@tY3PPlMXj+(M880Q|4bEzISZ?9&d*ZsQ4H-nCPO{WVY3 zDpN~dO=2|oxpS?{4Ek9gFXkUP)yc|15(Gb zxPED3q8LIoV4S4t`~vrzGQ{@cuX!6-#D?Rh>sWr1lM9sv`>ssN=krwdoS^Wj^D`Sxr0 z);Y!i!9*>{TV!E=zF-6S)fDVkg#z7$5-kb7JqyZ@Opgh{c9HifNV`*oC|<= z7raVRQR;aJ;J^$2jR#cr2Vid%BA^ffR-1s*Qai6gI?+@-JDcYW`jR zH(n5o+WfQt9vzM6Q77sEt_OJi+OJ~<&3h|iq+K8Y#3Q6jZXdvXJTU!kt^{g$^!LUMLOzn8c(@)Q zzW6%Effw`j0M1{<-d|-yMZNPu={$llQeE`WLJunYgDMyTyKF%=^A;jAbA~DvhRQD@ zpa#3o-d9ure0h;Qu3!CTHn!vkHDU9sA*<>nx?z@`0`nmPj1R0824@IRS0ueFc0GXY z`WSuk2iku^x+f68AMiim%XBZ#z*(5`EPsM-7Y0Dy7^JC7o>%Phs9&uBXnEIwKZ5{) za*kd{NoOwU06vf-Admv*c`|B2VsK(>>_Z`)AF;yq0LjG|>R)dcEw|D6^GRVdH*_}t z`98I#+?qLl|Al@8$oqbIKTEHhroK{8u-W~p@47~7yKcX4)&uC-K&9^Et|V&q2PmhH zU%uY2!Yt71GeD z*35zcCW%B)9XJE79n{W@)Epkj)&n4gLj8nT{t4SYdS3vM0wkpt7P&h?ZexI^5XBe` zh#~4vb?@o~l@GuucRp+X`G#`Wa}_|UAiqQrapd~Nix;n58e0#Lk&1aLzrv3R7$X!7 zb?3WDzHxuCA0hI=KR^4|&BWGZ4s?^?l=rtmY0eBq3BCaM4zVNpBF>}ccWxx|m4?Q4H5B|n|*X=ae zR*a6c!AjiM+eD$$Uy3fq=>Ns_04$$zAup*df3i9hi77IE_QVVPps{pH_k_kHmt)YU zN&8NuFYPM?5ALHc7!OI@n#Kd@Ik6sq-wKMKQ-V53B52Yc8&~^G1QP-(x=F>GC(4h+ z^a^BfQwQJ&{>9=$E?H=D<+GB8zICEK;LLB2-v`e@b~(r?5&#eIVlz97#$P|a$p39A z-%$uOjJ*?^R&`5z>zB6e6B-ZE141Q+o0r1c$;d%h$$D_wcpzjWo#BRQ<3h_@8+tDof z{Kia^^$WH_JA3jSP?~>;#q$D&$HsGlaHDs?7dXZbdQpe_i1(SFuzeNkUp9(8O#%o( zpYZ35RFkpS!HKg~^6Ty5zj0%npd)9v*3aOh;=zy`{11=vy{DbnER8i3b3H)Lao#T% z2nq1VNPs@mgJOp>NggKYkmmu|FRc5?@c{mG`0QDlAs{I16MceWh$vxU5wy>x;|ukS z{Z4Oh52Fl7wDdC*BCmrNiv#fz{M5kd_43|}gk(JcDC1{wJpkyVm?Fzr9%E}~I?c>IhA zV30$E1jl7a}o?WB890XqjyYSda1x!1Rc*OOcXfd54mrFu7d z4|5%;9Php~cg{`%Kp3uR6#`IOk?jATJ}-bG;B?5oGptsF<9E)iOxho%qk@Fh{z8`= zyH6INfMrOOD5kW{o<`F`-dt>J99&>&8KOQmrh z5T&snL~&qCfW#mOkK|?6jjdkqA@_ki<{%JtdDiEieuLzA2q~fWI8XcV56%PtcjE?V zW2b$#lqkvbcB?hJ)w2SBCrw+)aO=CD9ft-1!-OA)53lDU001b;fSsM*!>_mGpb_r6 zcpN8Qaty2*iH_FnjE)NeU@$`QwU-hgQqkv!vQcE=ya3#?#lL)cI0y#Em)|k|GNC*5 zk>V)tVsYPt-^(_Hhxjku2l0J>NeGM!2()ny#(tQ@@zFrf6sh|S#~maIWw7}iD&_GW zN5c$p-Ch^`H}6&;2>NNfHQegu1qjl3raF@?nMe^S8M!G-lu!aFq&LzZ+(Y&U{lIJn zZw!OJ0~vIj=XZjV*iD9M3{%AfsIm0`(UY%HJ z#Ux3tf9PD#y9~NNH^m@<$ve)C-oXKlMlf9M92_U3!SN{J4y%HI25L7d?D4{FGLKF3 zQUa_-&Ci=7ZWNlI7Z9a(w|+F2uJ6?4^7NJ^Zg|M5S{}l$4>O0=M1KlF&HMZ{l*Ijh zY1w9c=MKEK%LmF!Q!n40d5xP%4?;ON(uo@w9&N#o#?c3%BmrkDXcy22z}C069zL|6 zehmiwSl=%|kVal+=;1Lp8KKi09VJdY>K!HAn{vxZA2Go+py*EuXJs%H`HyW8Qs~p% zd(_b0HXMyhpvC4 z2ln6KW>)S_@7NO?7hO|xxp5O%%-)=#f2(9Lf|ljoh-U>QgJ^Wz%q0L2kUY&Qz$r%7 zw=mauf)O#dpAU1r2R*I z7#9!%MGfn)^GqHf=b}{x7G=Kpn2l$;n5Lw(9-z17x?2y82Yt(f#CB#4f^M|HNVJdR zggpXa@w(Zhs6bW3G23lKJrr#VN`Phq(uC|uyq#WY4d;CYtJIEoV&tQ^N$QANVm0Pr z5%J)7AiKqC07Ooj?pdo+*uHbXLFt(Y7{yaGn zK!D$;4~+^~>D!MF&Y2;lhwU@q!#oNuKLQuk3QJLh3X zGMZ$gU{rsQ=yT&3rktm+i=RH#5&2@C^@We$#+*tJD22VMU*v}??j7K2f|4QFe>Ak) zDT7N}5Lv@5C=wmQW4#7LyB;7pVuK8hVD{NGAqs{TE|B?5E^!M+X6ZgCNN2JYfuJ}_ zU4HV3aRCStG9E-cr$%nFd`GYmP(thH-r_N=!aRpy=o_O7sSWmG-TkvFFL5p*fBW;q zO}2VN$E*mE>Jv{A|Aqtpw{~{G(iX)!x&xy`g&_cxzvpa%-*zByLreuq0z*8qr3iqy z5s$d#NJiPl!r6HNBOYiCH-iRI1OX7m*(d_-2N`9#agxAafX;Y8FY>bh1&N6k?L9nz zM94xCi1=QfUmQZaKz`dMR!Kt*3g5%WX+nW+*bxc8kBXxX9`cBRyz#*wI5YW7kK=;* zu519MDISEeinq752uV|n`M~4+*eQ`#0HN`MV!p*UmZwF3a$xUusYbviVFq=R8aNd|aTN7jFs670xlI9p%e$e7NO7us*F;izoR z3p7%Z-9CmkAY}mei*IVPAdbAJ(bM9*((tkeEmf%R7|E@|koQG?)HYE?v&KjmOK97e zyEz-L-ashKzYJ->4vh7AF+yVf6;|k~dWk!b;c^u>X*_-}^*qiM7~1B+0kC=WI56lx z)91%qn*k&@@|g)V{_a7(UWI%q)CPpwm1TGwEA|RQv%Hr@xUqAi<@MP6jSWaMz%vVi z4SDGN_-~}b&JIPujf1c4L>^CrC^i5)f6VJTk=W^f?}Q%l|A6JS@O0u+ghG?qvx?t7x+I007G(6gxkY7z{O7vVNL@Ujt=c` z!mFVAxtD=0VBx#~u-_^U?h>P2q^Zk%Id%DRUf%*Kc@xf8Q}{XEU*qTT@Y^*$s-H5z zHmq{{l)ints2Gn7V?>CDl#{2e2Warsl$)Oya3t@yU=r#KRM7Phzzz51K97follu+G z?Xmp@8%EtkYC;@Pv|CpRf%F?Ire2PL}c0WA}0TMlX6 z6lm=3cntb9jd^XH(t3as_l=vB`3s?7xco|MgTQt&8YGctY2;Am2JoKe}u?YVFF|q|D zh+lxmX{2X%^N&5wB9YCec%&$Ouy-!o;tm9@Q@DK!Q7%WizCwul{0A8I6*dj3qnVHK zU%ej10D(j}Nu~BVh0JGi=J}DcMSnEtTSUq6@&5z_#B2TR?I3hm6k|-*Y&OqKQPu;1 zG{YcoBd!OCq6J$)Bw$=19u|P~G9xrlH29k6^oZVn7US{sS=#LPb3g?{IbrHd(z369 zP5YihT->E(J%GV?w0HhNBXZ84f7Pt(Mn0!~9$qBnEEf+E8#>7?3<9#k;{Gs$E^;`E zoSVr@h|qxq0O#xScddS{eue~a>;H@Mzi^G(>BMlErbWk*07p;TMtyzQW9ZZmQgo-n ze%6SJi-}!Y%5nx_1YjZEzYnveasO%3%+~{qli432+|Z4H++;3b;a$loiR-Pj-^?)G z54>S8%3c-$40YIhO}+anOaLGt?R(9B$`&J~aRR_RuXlr)(F?o(BK|4F0)OfdGZGeg z>E5dzB$45MhdupD-@b^x3WI@kTsI z^-K|vx=GTk?>p(feyH!&9puNJ9Z}9aQ)sVDRJ)sxsvMZxU%6xzT=$-I!K0_v&6 zFok-={UGol0upG6u=B|_)m$II!1K8hDe~WOz<5a0d-bWTPohH?=YdAf;K|nmhwHro z0X18n1>S~cJ;1p}7@mvkDr$P(ISqhC3{_=4fF&LnkyRbcj9`&0XZ|p1Pa2dt0oW3rV6M>sJpkEK!gAVtV!ey+{UjRExu)SBaco;`^cKPQ)r)s zfJ%f2we6cTH0<=Bg=o=?!BM^MaXmm{nv0Ac_DeGI}t;zWaY8}_Vbpa~KI55Rr82-s(f88?ZllsoEa0u!VZ z`J++PPr=VzBt(5r-MLfPYFHMGG;M@6*b_+KHR}PWJhbWTH2S9;WfY+$At7XpAUU%< z@Z>SGIel#i#u(7)dUqh?^(qmJv2jg<00n_bz-PT6*#6{`jtBV@e|qrCIGR`K2hfgY8UMdBxnF!mz_ybo9owgH&)e| zs@e)f5CFBzcDc@8DtEK(v4;7f6v}NC$53cY<-GJ=-mXVY2pgWpUQaL(kTOJrd%ynm zy@5a=f?)LQm+R~YrxMaDi3eDdnaYt|;=*DPb_+mU6-EX9*ozA)RjXKoK%p2S#M2vv zNv}tX4xl4WRRJKiWk0Mk1c99wfK&M%aikge2pS7@r_xL}QqKNSU^OX{f&hx&^LU^P zdc5bQ+o2xlBs^|gWDCj?uc~U;--u2w;Th*Af2zT0aseRJgi*&Lowv-{l005Hcqxl(AeOR37(p zmLvHj^Y%SdNG39D8%Y7pdVu?01BHqp<@5ak#z+mC5CO(Rf_19my{(D(Y??DelyeTnMTk20s!nndHUM;h*ST|t(sUS810ck4cIfAe&v==A zSKBN|Le*&nh+AkGRzOx3kjEk2ISd4)WUx2b{lR1d03`J520%ckOXw$oANyqvmI>U> zyF9#b7xO1Di+;u^&s3nMP_o9uGo7~Dc8~z#dH}Almi7=82@PN9(&JP=#54HIh4by2#9HMr2Pc?O8iMPL{n~W>pe!mdcODz08-0iLARM}lPg9w$%PAMK^^&Ty0eaA zsGtKVGK~|YpaJp@bM9QyJa_I~Gj5!FRfljK$R234=@0`lr6S7z9bI6~`xU4DV(6IS z_T>@4l2so9AmRZ(Jf{Y?I0it2!UlvXpht1+|B*fY8bL8%qz3-k4K73UTmp!JrMN0W zlcK#=`nt3}q@89wAOM~c*HV;-*vUiI);zDU9>C1PmLOH2@%&i_ke9{Ryw6MlI1xYp zuwa``JYv@an8l;{dH|j|g=?WgP|-O4(9L;(7~@3g|8XV(ApNov zBOFIQWX^UiJV{cyx}Emb!Y5}i1S+pZh6fn7=HHshdVtaiOlbstYpX9S0YLeB0O>6y zL=|Z~f7@5H_+}+Qz8>HT?fk%eO%0vEWdNWv*8@Nu;Q@48`vfFFF5&d>zsP@>fn)0d znsq#$Jt5|RZ9njzrXNiK9U%M%WurhIHQ+fIyHw4d3K1uPvLmuUW9tE=y|jI&i77(| z5CNPAhJLC;06^Glv5yP?XZfSa2!evYOsbZ^21E-;x_{JqfK(}7#EUU8-^|0hHU72! z8o$RrYdyd?mGj2~&tDIK{J+D`!+pE8;)~Y<)a8wDVLiZw3(CE)s#Cwld(gt>7Rjy$ z&_Qe=UaGds$0K<{-r|%0jHj~K0cJgb>wdV%=TDv&pxgv_QuSpXKPEJ`9-y(z_Gol& z@;(#iCNW^~xtEYGxsJZS3_Cq8tOqC%+J_r1@K6O4QYIvxpBKOk{>keBFhpQ_xbk`4 zq!&N>Zh1X`JW`|+`9FU>0E-g{Vz{Y3<6|5k_X$z44Nj~F&;aI1L%PY;1$uQ+U^43R z${_#}V%Gzh2s{aa5xCp1+>QrQUoI13d7%Fh=N$gYBYHgmV89gtk_Io5oxTnJFE6|9 za#J5W02*5l!2JQT^#HhV{RG4!@COlqP7ehYFY{%fl>mq-Sqq7SHR6wij1&5z&R5?y zu0jGJe(-MmB#Ds`BN%6qOdx;CG3e7|0>(&gvke}SQR?~QS3JK~cuJMOqM^7J1 z_oO@I5qzHORFhD8tR}O+#|!Bj#A0@)yma!l zTM&j$q2pG|3c__tepTHppClQZ_06ZR_uY#mLC-P+EnD5HvDY*^6m?Tc8{3h8RHDXAVMic`CCb&c}SqfkrBbEw3 zo0$#I0x0Je{drMkJwTSL4jD06mEAsblQVu51o12 z4D6Nj|6+OCo<%^20)`&z#4KlKQ2tH7H3MI#-)HZ~m=8j0gKxF_Kmh$MU%y_XR&as? z`cEq_!X%j0dp`e#LKIi_2N07EovE|I)uM`fS7e7;a6N#CfK5a|{H!GnDJQ;zR?!|w ze`jpD%J_@Zn~7h^0aV$a``EA&kl+GOJ;u(Q?95rUE<8cIffE0Of_-j(&Y>%V$6E(}03{4xQizbg%nXi`0Uet1wahLz zWTM-ruEWvUWOatGNc(I;d~MwBwox(#IpFK^Dj1E|x6xvq&FdSIzF~EqI0j9Lk&&TS zbwZ`>ft<>-rmpkE?ib;hAC_#dWjUQb<`aAVbc%kZCVEc6HkU+Ovx4Zt8Nx!#Vg(xtOTzA~-Rpnh@6cHdV zfr^CY^jmtG1K9%siI*6D7-|%m2c#ru0x2-mK1YS}b^r*_1!hvQ&Kg&(Y+)pwYRCbP ze(L(@GyC#HXMfX4Ss?iLrM<$=K6RM0Z~6;ct$HiXbvT2w2GLZ#Rg`ml!1u#7@DssY z55NGzTIG)zV*kLCyp5iq5opS@wQs(jOFc++-;t>(q{wO^{TW7Lw)+^LqJOIpU7mx2 zfD;xNG-6Ol^8m#9AcG&@FlNa8y zUO|^fZ?}Lpgi$|(4kczFLor5-VB0`?E`);4pNgk|HA&ZXi|;0jyE^4hu&DS02S8*NYdeTB7pVt;AA2?0$oVJ zZwvpc>(y$vOSOp`*UfqW{lDXELK^$oxQH(is(ka|YZ1Uwpnbh?s3YiwAWH8Vj$b_` z4jCYsUV@%u$9G`>q}6R5X_S!v(n_X5q@_9DJDuFB%Wjn2hCegnSRk#B^xBZlE#wQi zlD$6x0*D9bY^^@g?+_g|OvMZ4DYO_RL$+T=wN&;lqQ{s#~fdT}m=AtH3rzLp5e;r;+&pnY=_4tr8@rO;AU z_BWOsH*P)A^?P!CgY)|+qt(~A?{~#cnVe*qFp@#y*B6l=1&lmSkqdd`>slC631J}b zd*l%*uznw;S<2^i>4g7PsPuIa0Wqx0v@!2M0;F^@3~6+BZXtR62X8jnLTn#4{prNL zn5FoZpwY8BA((Ce4(Z|o1dzZJp|I1Z^-%T0ebbykJsL@Xwq|v;1&M$R+~q+>$@2S_vRjHLINzEo6)e z!GC%y&Ylyo`y2kF19JG zCE-AS2o+FbKa2p51B?g|{(I$dJMn5a2td2T;&IkDWgrl3``c*>4KUwG{p~8tj9kK< zjza{niN%yhhJc)J&H8ad1C^%VOBvffKUN;T35JcYi!8YYuwY;(6$+pcLw~A|aYGkR4@?)}A~A(Qf+-*u zXK56HB6NSga0gi#-C$}^0y=pS{H&i014%4hRz!^bs*rBg)|Iv&>iqb$u9SJ8ijk|H z9Mr_!e+#dBtIi}N1C_kTl#>T_0gyofV-d^?w`2jb09DVHmOreY zc^G$bKWiVKyFaw9c$7f4f_6QCrK;d7Bi$T@`={*>kaZQb8}6YICBrC=!TNcc0F6d$ zhJhPlHcCOo<=rDCRyM95C)ur{(BR_EEM$yGcr8W%7_|u|q?{JyTTy1I)bs5A0Pum~ zd>3I6p_3{jsz5qcp*hCNg96EqeVY!#AQXw(N01+X3<9h2+M27u@}X3f?~Ygt<45ac z0F9us;Nx=YoR&N<$1_rUg8JG0LCWpJ;YiiL!neJ7{p3~#F;_H5q4u(t#Lrfg09dS9 zRy*e=!BCtFr1rm~(~Bdpz0sJ43Xrz~3=`uye;mUl`OOeKPGk*4PSzeJKV9-R5dro- z?ug%b;qvLt7))lMi^%u#daTFSnY^R#BDQ2eww)wq#QbDxfizY=g%Q8JkK_0WLHO@i zk-y&(k!FgeZ3xlVZ2N7x#t(J83I`FY#6N?9j4!C+-Gr_sH_KABLMVz0E&R= z(t3b0r)jYxd&94BV$pO2d1sLOMb1lxY;Fd~eTKl#0P#xg=@$=(E(Ec{@;qEb1&SnJF3$}3FOS>x0E{TfNdvj*zMKc3f_-^0oI3v4dH^=Q#OGJ~ z^qTzv0C6QHxJO?$RX<`5A>j44+hu-~{Cs^rcK_SbT3>$_ zWXP`uDNn~ell*Y`tn$d}WB-Qm-mXMua+Bbw%=xB$*nMd~v)cFfc}g$_h0pY&7Ks!L zpMwDQe3{Dm#^hh9=jC0H1=-}ic0mUO-ERJAD2z&2HyAER34$#=UJcp-Uv+MoRP1>H z8I7$6_(%o@By@YQ|I&N!5dx>L2iQY}17`tAr`ba4A_W-61OP!!eP;`;X4e1(7;wsh zkbes0>kXLT{aT|@yZ;=iV)h5fRze5;e#S3yt|hGJdDdj7UrmDHWKad~5!y$Ecp$f7 z;Qq6IEr4Md)C>af#AFo`pnM*Ff#lR!H7(J5d<4czYqtSbGyjOU{ z(q4)oMeyExEYzt0sIt8}QeQciBiM!lh2P)SO#pRW3p!eaWHjbIL6Et|1;W65EzBAe zsrij({riwgXCc6!nPqg}E|s_C(*)*9`Q(6lAj7YMp+0I+B}&pqY*`*VCUxA8{&3$sQ*V0PkJ8 zG)m$Te(+x+@JsyA2{l4e#ncyQb>(w2CF1Gj+h{TfT6)p4@CVXJaz8*Nwu7ad1E`h# zD8N!sXsZA!gZFimwZ8JJT$ELin3_|aFD7P|!A?CvMKa|xM8rz@ z)M1~(S^|qB-cT3-e z1z$VCldrSlpyOA;eA`|S0Pjw}%m0mg_t5JAJiq2%-)1+G`1~{!19<>I<^xp_D4+cI z74!hC`(d2K-r)ZIC^5S|4{rkQjZhzuG{6u?D#l0f6M^}c-W$d7kT}p=Oo!1Z4AXEV zvjIpAje$ZS{#oDRfPRj~L%r#gcKtcuon>`I6BZ5w#>g5X8MV#v)V_0vTVo1AAN$

2n@E;5?E|9++Rz1(m48c1S$o>F&i-6z>>i6V{m4O%PJ~*1U z*FwX2_g(MZd*Q-@$Zepn>RfS)pQ=bC8rOc9_(58o z?Cw4!(@vFO8Q0A(h$UB^ZQ5Q6v}8q~tzXwz zu@|abkp|N7scN0d!mq*nj~j&zQ8xep|MW>jK~x`05crn~GsHqX<;+~kk_X9GFUBn- z)?7X_*vMYJ0Z?K;K&DD{EZ9~W(*SrW|v2kVO zEd|yRBrhpewNGLP?Hg7Lkn?CEL@*g<@v=t16VEXK@Q3cNJs|LZQp#7&C3d-d6ad8o z_@Q&aAk;>W67;)+;_2w%J;9kh0q=BSe*k~4XcDtTs4jSU=XyuFGdGoiWMYcN);X>G+4Pjx_lYK z#>%I4de+InfBch=MF{}(Wvbz#)mHU^sVp@R<7e&a`~AIQ?jV>DxEPPEUl7>$LFMwi zyD(76w+1a>e4HCEO*M`;AGKD2qY5U4Up#$# zj7}@hbIJ$)Q_tEAl%G-pFhu;|6gg1q%2Evy?m=c`B4d@Y1FvdyfbUheVMm@l0w8Vm zAQNo~q&yk_(Cgn_a2D`q2xbWG7TObLfNf#2_U(T z29#k#hJXvS0j$SYp2+J==7NZ!lDAYpQy!f=Pkn!vsy{#e9m0qDq9B2^7|*(l!A=2k zPyt1QO$LCOK*9JC0?gzd#o+&?WB?67C>Rxxmfi=)i4Q|HDDJURB;UWn+M7{~@w3&$ z$KrutQNa*0K?vaq1er+&1i)s__^(aIT20qjQ6ht%GZ}-VIhmf#p-hrL#>l1e@MHQj z%Eu9a3^c$8`jy!qz#;$!5v$;(`}?V$fmLY=3{cp(696hE4gsL=6eA?X{Q(+sKxRG}NdBWiB^8+mmWhB%GApcOP0Q1R?J9W+dm;{E^)<--JBmu(f12L%8|9{e6quLnTS zPmJ{&>$@-5<{a%igX&3(%nNNAT20e3W$UV z0!j=mKf0v5rF*EEm;d_>&b7}z*V+47Yu(F2+>$-={Iy3CeZ^YF_4MYsdmfvAIFR(X zEeW%f@#Qt17?ccUcID7`9d-*!1J9C)4y3M+^~gcr!8Mky1D}EChKL1FQ zcGQqJRjMfJ;j{?GJItpgM5Z{<5^y|SBZ7wOFaN&Rn35#z$0dC6o9`%(I}Sx_vJ~VJ3xU1o`K9wh zC1*>ZsxB9FRIl`^MGCX0hx{eOSm{G>>^s9GE< zFGZ3`+4{T$_pKB}$9)Op1)+HDhHx4%1ALecl1j9utt#Bz~@)*Pb<@FbWM__O_MT z8yggJ@n5kse?#=6bx~@OC_Lpf4#Btg#*lMa1|Q9!N&9E^IOePTiu`xV`Vj)aby91$ za1?Wee*EI%>Yq;=YUhg)%^mQ#q4uaW^~MVK*{$G5HakD=bM_;qF1%%|W4~C3ucvO~ zq~kA;Ho~N>(#Hf+puDhH~Oid{9s4R^x@VYT$MEn zrP!85X6fP9#TdqmyzckcT*I#oE}E7f2r+_E5~^B_>rB2_@&nOYxOlw<88ne3$j3fZk2)<_c|LDf14$|K@@{I)T1Q(kRO+D3YHI zQLhQX@}$K)-u~c}{4<<>Lopjd0J=rwYL{G^vL$oR>#UY}I^I7jwEIGNrB}z8k?BH8 z){yruCU{H5QBdXfu5gP01Lt!^!6oz5`piaL4ZF+=A;rBb+A}sE$hLGD6m+K@R;>ej zbZ*H}hy``MH8p3dcTnHI(NK+!g3#5f~Pkz0hpP`p*%7niza)Cjvg_A8q!&2N4NePuZaX5(Q=@AVEo(VrQbS`2J1)c_ zoQAtJlIqT!HaiK^^5~>sig2XL2j$h4D`H**m_Fg@ilSj2T8CZX&d*{S*8NTuA}w~R zGIDy#bw!rw7UD=;TF>nXxAOI1^Nhwk-` z5BkO%{3GdZ#>8HR`=YMMqc$SAOG(pU6Kx$-!!fJXk>s4LRB@{1xsRe^A@;1S!Crq- z@zxKw{xJ29^nO9h=T`>8l^%(Tx$!(!g`u5K01eergQMBptu{m1FuX zx~E`gvVNa85((q48k|#T1Q2dZ(E)`urC;srlnNZ80CXe=6% zxO(EP#XA3c0&%?v)2Bnd+=EfJ8u>RyZdB7qho4$fD5YSHFMTVE+=!QLk6M%#Yl2Jh zJU_^WtWZ~&j4$W&P6@_`I|kdVu-2||X=-Zz#hvk9#Xp;Stwf~I|82Gk6cpZocTPXfB$fz!h*0@&u z??lKPSc^A$#uucqUI;u?Ok(K%Oa!CLGZG2YEZYnxr{Z#sqW2wsu}8In(2gxH`gQ+q zw9GITzOn+QS~C)iGO>rAUGMwEojuz8Rk_eS@5UrCJH-xj>T6aHJw^=+5H*_g=kn3>0K*md z{sO+VWf`qZEpO)#jwor--yLIM)N=QNFo?1oFOJZ*@j0kQ0l0WG{2EoQHf=*-E1?u* z^NyIptv)Jqge2#Oyk)DrUIT%pI@w*^^Iw$^S&y*W#}l`N=z|_Ae74b z#;gw8t)3)yRF)3ojhL??kKR!gR8xT5YzYy5hy0o_zvR}3c#(M;qrT64x21Z*>bf8* z#Ab4MPbOgOe+2g^-RHw!5N5dLdy^CZk+)3R;|I*^uqf~h&lk7=Fvib&spp%3d{EYQ z3mS(1U>wE@4?^?+YDQ{q>$a-8yxX79%YSYNHIN#)~9Yz^C>s2El{EF{dQAqAedF8k#&F5W!ga4m2Ca6lA8II2y! z{@qFfGB0Pq``;jmu2JAax<6@f?^f@Ri_{Khtmi*}jvD;M<5gc^eSMG&ysL%I|IYlDmeoU<;OF?jYCMp$kGJY@=^+cTeF@E}eC= z0f4#Q?~_qx-OA?JnRnuK``k9q#$ z*;lU%k7ZAnzN8(a~AR$hu$o zqpG|pOu5lZa3e{PX>cOqS!b<&4KpeZ{FFHGX-(?p2k_24I)I*>bJ*+037B*6Zmc{R zDXECkd$;@ct}cGGr@|(D^vTt;idTz`@gq}ypb`ulKpd<)BG}?S%Cn#H|JXWi z>-c`HfNK>$cScyg-5oM=^zI>1ch-5L6ds8jXcFRv0oL4IP`3LaJEC?nsgp_zNK9b6 zc0Ad_e6=JN)DxNF-Hw^!vlEy#+5^?G5V#;Acip1)fpnr?wXwiy`ESw=~>J zPinUu+?*q>=-(M%qC()KTwWqt(22ptVZJF%p1VTlQ3{#D>UD?YSR2Z8I9y@r)f1)?hk#zFG#8?-)3!7C^-Q2v5QRDN&nWUBJ9!?vy z!#Y=_Hs;}fc=Q0F#R7CW&0*u)R6P+BAFSwn3{0vzT63u>z3#dFGlX7-Z`gPR!jQ8nkcrDZ7zb}MGp#K7_{^Ni2EzS&cFt^6~idx|8 z4Tf&A%7WwKWstu#Z~4f|8C=lPxa{g@kT%Z*C(!9WiJd-WKuOH>EQ#+1)=_+fqZKChdI zdOpxOo$SQi{Njp!Kx(dI-xX@3uqlt!h&I)FYFvr?U&+%D(Iv0fzgv%b4{)pM{6Dq@ z093&PO_~DFrXf*kxD5sK@gl9U1r^rJMSJNg8ZP9ou`E*`^q`=I6&014D({Q_{5TDF ziw$o+9XtpLvHN^EbGCONhurk-$z{d%gmu;c}k2m4CMBy-c1=yj9aXF%kP~K@GB(6~1P){Xi>8mt=ns zxnVlhPcbZOZesG7E^DAeN8xrnVm;!^w6Vp!Oy=I(xt3;1HU4Yavr1FNM~;NI1L%WSdVxwQ%kvaks_SH~{ahF%%uOyErURQIZ`wjqvBZ6NLQhUy zc8i9p%#A~-Q&)juOYU15dhj+647;j6@L_s_rW7@y%(H(%H*ou*L)Ao`zRQ9PB1iW{ z=;7GG^DjFPf~KgNPd4&f60O)@kH{6Syy$7E9~1A#>l&dpg{w$WczX~wT<^{@7L=b zX;-?orP)0{5-D9ldlh6k_CHOkq^`H@>3o~KYpZdUKm0cnek2|BI8;_vu(JML2ac-4 zzu1LXOaS)chV~!WQGN5f_Z~XUS>7_^{4uj(#h&cms12e2E{&9UDa|mf8Bb`LJH!9a^24QgaVKEz%mi;Q}T8k`P1f>jfctZh;hF62q8Pzaw7RE zDDIS=sGl7aW6cusbHV(nFd$6FTT3fT?cxLv^LJ{4{;(BOy#DKj7ddN>p*fei^<9NQ^NG>7U%bucEn zIL)7|sqv7p@0zjiv~A|UH~X=ra~m_P_@*V{4OML~!kN~u2Zumm;d$3Nc_Gn{@q(QW ztWN+1ncvlnS7N(2`T=Z*J%4>xGg{MhmTtbT;*K+zWdCAJ?=dcwFIt3?AvXKE!xfKb z7cH5l>PhTP248t^IYX4wfSt6nXs%eVU*6k5IQ+4No62Hh{2L z=;FGiT#V&7!>ify*s1z3vl-rUR^_(VF?9L}&Ghkr5-)z`Qq0L2zZ?Yg>YoKI9>Wt| zoqyG`t4><+?*56+9tUFy4z*X|j!QmPZ4@ZY(U`)vy2TAV0cy>e9^zrQFs}CmHyVyb zaQz=u4_`d6hdu^-Tgi+Hm=;&=IxNtaR8>a2F(%c&$WITeJ1cV8wIsf{}mt z)0U_E4kWVA3?tSI?=+w@`YBJl(B~T7PD4{jGVXVXFb^b6Zef=9&F?X^Hp~r%LcjG3 zwfux)U2y8}bbrB8zTd{Oj6U>ue_g{V$+3cuG45|!cy&u5P}Awvc1ZG1;@KSRArZ3H zl^T7CP|D;c#0WQeAn-6|M?;~{sliN^)6@o=%(09AIr~xkHVe33DE>u zgO*7Dwc>+2`8v--S8nw}xn3(pB$A&9i>75pYT3(jE(klB`-G}}bSo+^t((xc$K5L{ z;(|{jYpw{p>#*hqk7a)_;N;~d1>r9+-eJ_!a;QdGP zLtguPaP})24&4BS8|%FQah6q->gUodNc2v zJOTLW@XGIK{@;m4H4;j{nyjVe3VO(+kTDj^tws98c8I4R(=*=-P$wpr;3>w%1uDED zII`A44i)nIUntGLY^-m-@>y=z=PNW*0S$GTkPEh+0$xhwKp$U zy-EHyori-L`2%YUd=EJZ@X}d+wOEGBD97B;QKC@N?6`-}ZyxfRn!sh=JCWM{|5nWS z6EzV+RE*W{pj$LE3Xe2H5`ei$B6@|7L?n4+LR^KBHMEx12U%$(!9|JIwJKE$aDd%g zv{U%tf3AH9`tN35mAvuo%@H0RknWPPKDKalT+=%8wQ5_t*x(mjoI{wgFa@|<-5~>DT zW!hKIF7fq+G<8xZ$T_>AlxQoJYO*b%!NGRiNUR#tJETj4Ph(6K3P7f5lj+h{xW5aI zXu2;lX3>R?B7{w0C@AcwKa4g2#)<(kX&f)UzWXwG{v)}5*V{+pw;+^9xAdik6@U;~ z4-%)aaAQc|xq$ESvChr}^vS@$Q7pwA+zh7s4c=rR8iz?e=Dp~EapGTu!{mqa_2a6E z5gwc->-92O6=VqX{r^R+L*qoh3=VjSKp{SM{U8RvpmpW@1Gs)*IZaqC>}c^gC+PzK z9f~74S}{ug9_Kwu%FMHd#!Pc`w_^0BVWYtmbB5-qC-ulxdGhNxn^T7epx0pVlX@qt zWY4|z?+@)mw(k%qym#BrTqj4oyE%u2!KHSBpw`rQ||t9(q9S9=q8 zJ|fY)076kHC|%X)E5<}KbZ}2?vysU*|KQl9&D@;x*c4O54Lz;nqR;YtgQwJ$Zf?BqX#Cwn#zXq@N9mhSZ>|K*1)!&aue6izjcwQ{9zP->8Jc%5 zMjj0_+;+cfWezUmYO@!KUuk9N9u#31>VH_Qa~aS&j~vA_eGe=36aRt^^80& z0C}8399OD8<+MeGK(t@0HKej+8Phps2EdjCDI_ zY>hNhGax|2%A3V4ilzH?L6kBBosG)v%zcW(bVcOb^tX0h@2YOEL#iq)?*Uk;{ZHg^ zxm`hf-@3)q1Ofbx)-{~;J}mJa%07)W3W7`{#SxeyEm3C*whHMo5dq&BianwPlFr}E z8PJ5MpnCwWxot1>6$>hVa+VFS^ceJbaG6I2dTg*nrm^rMq@At0X$O(qai5iW{@FLs zR_=`HRqY-#LW!B*W!i7f+@0!!y=Z>ndXMJFb-4Xu{Zmt4;rDjN4}3mtawp;D6s*Q9 z*1p&B%(_&OO-9A)drVPMB9Cy#r}!G6SWr?MLqGFnB<{V`f^p2MlnObtO^MZ*2)U!< zO+Z>xp_pUSnm6H3&EqzDLna=Om#5R!!C8jW3ObYu$G8Bf<)!JK!4d0iUIu$E3i8?c zb64MSZtyt-ApE_(-?neZ2rPH=4^AzHx_#)Dov2Os`e{eV~@oqU1;9Zp6 z`SKTfJ-WpkMfujjJg5H6B2NRFE!8>E1N`lN>)DU2qK@LWvbN%1VFcd9KBXRSz%NdJ z+D`1{d0_76vSV6&7oYfGMQyOn6(AO899 zY(9}(xmGa3mooHZu#x@!h^4xCg&vG(IhS7tToi#n ze{Z7FNc!@+L)vx+sD;rfsrs;dqwE+U0VvJP(_ zdR7*)Xc0(MIE5s-ZGT@#1^LYjNeE0aBigwEfQ6!m8co!&)PC@bYV}Z z4o%zoUgD9V5Lc;Ajpr+QLxYQ->E0OtO1R#8TPIU}Am9SKLua+M|IOfb!A0SAZxMSw z*3&w2n;fr$&?Eykgu=IsGsSLtM0CbuE|>htl)7G;4-8BWU+0+IG{3bqqBJ+o1f8oN zF}WatCYw9(1=IVPuw*I31n#&`I26@%&Dmj-t~7dz0MT!B_Gpmz>)7si-6RqgK_jsf z$v&s$Y?LU@4rd>VD8MTwojBSiq6MxDFn1D)#)Ejwt$LDz@zB$AH^p^Cs6(a(4)pUk z&!_k(K)pvXHwSnChzpR0VXsBNGK7SW9zEj2dfx#zU?!0{R;hMe)c z_;NzY+d>iw+2(yj+2g%^6jnnAzAIC7>P?xtI5~6wch)}e_e$pO*xF6LOG^*-&F#i< zNImoh0n~KOt^ZEYAM&H#FhNP`A0k^+3m%7?E5IUW6~GMhR>MZKchTtJpb)OzOAgj z+Foeppau|^0NvboWgSGJ((0bhIv2^DM8&NPvqdwac=D8+CCS79zNc2hXZYK~FI8L6Koe~% z?x4zVfeDxEk++Mjn`v)uYku1+0w6)Um@6?83yZp0L2LT0=j9;3j-Q~yD7+`27krGm zfnAnqH;fb7PS0rLmT=Of+SPBVZw=$s(U`Rx*8?5@!!i-~z5(f4q~)8Aik{K0E9Xc333 z-k0YX$*j4RHX>P5Ht&YyZnuZWXI~Uj ze=W?ZBG8!O*Am31_X%%&-zbL>d;yxq=;kIDz+j<|lO&?<`N|=1QlJS2++4q*4DJQi z!*K5#K!7n6b%{bg2Ab-w3@x*5cIiBy$U< zM)Av>+3sgPu{E2(#Eg?v(#xF{P7^R>E|e4`jlbQlVm#w`ps&uUzEAbEGyp1ZdKE?) z)e+EP6V$7PH6#~fA#D=^Bj6@Kf3x-g-a~>x`alwws*+N688hz(S85GTeo}Cn&7(hu z_YD2+OdN zJ3#*YW}FErBO%MTAm3GRDGEQb{zpMDhh3Mw6pBK97V1=x`cC^Kjm|)>HM13Y`l)bp zr8;Sz_9(ITa`rB}0t>i86m(UaYB0)(i9P3@ff5k3@aFBe^bRlwba(f2;i$3VbE+ zoP3)xGrNuaErue+vjHsQ3N@1eR-@K?BBCN9Nfot`futaOaQ6_eICw8eFX%Bjzyk)7 zDpdhidNS-)YoRmqV0fDdLG)v48*zlss_zBxErPPN$S42WMvhd{8cfA55=5n=vlpJ;gt4CM*HPR~>#;)p&9T)jj_lgY%{JMnyD)LO?q+AS<+&f*Apadl+B(|ShgJ66u37}Vh&-rkWNSEJq-49{QR&wJUFd%N zhQIZ?bRz7A+Hx?W<9RgnliH9*Q1QEae``48UbHPK2U;iOp#x&^oK z{SON3Jm38ZAO(-(pQtT(isK1;KHnciSb6o5O~ib5|NO~1;#IUP4ZqH4w+je#^NoBP z1WNhf&I%`kzvPYoM)^S*ZKFi{lAd>j4>&9j5g~ue_Hjo}IRShm9S=l=zieQqH2%b4 zPyO*-kG}Pfsz|s!;V*^Ousv5Vl)#&45TckD+F8I*D!204ssvUQJftxiY9zlYAZd_Tzazx$A4o=G&LcpzX`dYv_av zFg%#Qm46#sv?^bLmxZ zZC!1a;)-Iv|G_vb!h(iH!~gAWzZTO@Wwpb!hl9(3T4TR8esN5{<7i!V^~!C=^75o| z#f$7_oL|8oCDW0H@PH%66PTRvu8f>XRa9%X-V8|Kb?O>>mQr-Uvq&kIC!Q7wMniWj zrzie1_#LG>{Nea7T%q?=#g0&nLawgjtrhqHK0f-W|wG$<#}~AamM8y3K1UyVN-k zzi3fFfTeZ9cL1eJ`ibn|<^u!THI?qzCfoF=0>1T8!8ao1@yIm4@-M3jg(x;)(X>4YDwL<~|! z^=l|2dk^uy*iX&QK;|LGpEH{L7x2L1kR+Qh&m1g;vZm=f7LCk=#T9d_l4o^$?~c*6 z5xeMn_T;a)+~Z8baM5`uuw@k#7tRAnmofhHVfQ)A#6(2~VOl~fE}oLk^9xJr3H5(nq7^QC|H}dZ&dssBQmNKN>E}Uj zGwzW#?C8tx7FBj$EcF$whMrt4hVMON1ex3Cn^)Gobl7WBHZ?@c|0ea?6?uz<{a+ip+Gb35J!j0!%$ln&^68wn zC8+P+yQjbnNkgLYTzNQ}BQpEq!kwq4cb#m;Cuf_=W;bsxJ#u}p6Sz29@LURuGI>j- zifV`U@4g}M4J`%Qt3V@l4hs2GX#Ud6fR-_u(fzhMg}1! zj{~*7$*w=9(*FF}h3IIbJzF^aaTx=g|6F)Eh`W1)OlE1rNd!*UJUFsxvM_ybG05ae zes7mYMb=LJBp;shqWK~UY2o)Q2sa?L7&wC?dWl&Jp%^FdpA-b68JOK7q%p^sDZikE zSsE%3i6KFfQdh;5iT?#oFBy(K0T6H>XKh>Ei}W0O zXtLXct=f>Qt3EtxeGrRq|H=G0@llZg5;p(O$r%i8CNz_4Vc}{_0^dwP^ZSqhJAzbF zs`1%8&EkR6cVKh)8h1me000mW(Tm<_d6`E1o@Y!|B!Kg_Fu zLhNq;1d)5ti$MhPYuc}b9aZzE zZGPerqK^t$E~8lK53cVnLsF*U+CA^Q$$$PLw7MW?4W2*rJ{wFPP+-Q&R4AOSEKiQy zDBLWLOfQ&XFd2RP3Tl%o6XbQ7uK#)XIiQ?1lN9W{( zpCKq9Zy5j-t_r(|y?JgAQeo)sU^~rH10vqk2i=(v-Ymh#s*ihr&&>Qt;WmotE zU~qli|2R4rH>NC%#cPCshOH7-u>d>LfRYAS3$gu%4BWzXC$9Ad{iGKgX34`_Z4j#R z>6MX+9iXHq4#LsaN;A+$$%6pJ7V=+Y*m`H5(+lD>(64b{X7a92lt+)4>L*?5B`1kK zon_U_RprT>`knYFm~1NqT^%f#C-?aL&bKzQoW480j^xAWnJEFhB{xS$#}|&F&|xaX ztI3Oo0MgD64H}QbE#S=H?wjM&-87$;ny$7id+HfxaIFCPOTuwdCV* z9XCyzLQiqi?L7f-;ik{o4Y(~znf(2TH}-WEmc!)U`9LWItt;V^oK(bzbV8k*X<&#_ z<*!7ECZ#6*{_v`F|Fw0Q_Zj@WiIXLp3`Rn-LukO(_S{5j^!ZePb#Qs4!pHY}LZEz! zLY)#45OPQ*@*sZjWOZYG9dih?Y{p$KpHAw6!xfno;xH~0Fk<1(Y2Lp)v#6AzHQ}&F zE&Bygs!MVpipf^0JMjrgRA3~vB(;m#+U4aC8CD8kkeM=HoSOz|20;oGlm6p`ZC(iW zB}++zo@<5JeFg9JS84!2yu`bI z!G_;dB%GKOY+7a@4&E3(RbmdL1imDEBm1pTnL`_&m!1a(NjV#oYabMhIV;HcHsH%u z@6^?!OP50wCk#`HdkLnm7unDDPs^*YaSCP_qX2ko*ZliaLcteA2&Dl2w}k9Cc)q&N zco)#bV}t^X@kokFF4Qkl@n^tD0PyaD0d|ULLzmmR#%7~2c*Jep;d6F0gMY_rkxhy$ zS|pl1f0p3jI=K8p&tZPS%No&RKs$w96k11)i2wN8gYrmQ!u2>X4YL{s?ry^l{GDQ&J;G8|-%|)v(HSkKB8_63AovwAkQf>Yk^^BCd6U<;7zcw*G zh0xP3auon{D57_Z-3-Ar1=C*?t@HE^r}y>s-unYQ30am;5t#$}ZQcq9s~^=EWXq*H zbwS@M!~`E=k6cHGxzP96fn>a`B0W(_88Qq8wo^s8mp_jC{TD7n zXor`Hv)$R)7#uju8TjiY9F!^VpH^utfMlt@qoURCkl|T*`M}cPyx=AKr8BrqcA7m< zTGm)b6oc|%1AqKd7)T2dfh&Kb3DDVzI;d^Bk5q?954LH$kVGwYs5kF}CcWi;eP^GD zmw%F;6_{A(b0UoEFblafd`j9>*Sy#D=2rc|O&Gz_po>k_o~-@BTjxki=z!3-Jd{Ql zHH!C8O^2=!AEsn24u-0^-+%gXUva^$>fhO!$0qIu=W%q?=#j)ZbXQJ&1RvpP zUZ-eBma_EtT;j6^<@RC}07`f`5ajJPSNx4|A_Q*(w;^hS@QDnWiQ;U#(_0;^Dt?|m zz-ad!yhUP_p}Kg`kzE9?PN#uwXf?$5%?Z$q+t6BUZS?rPDi;*HF>Q896a^Z-18hz0 z5vbG4md{&|qQXG&uSio9T5hO-CH+|<38OMyl8?zKTXHgxV<^~dHTVV%ftI7bDFRo` z_s+;?oGM$VXS`Ahf_Z<{@3I`z=i3Y4!rt=+?XArQ|@t1F!ff5ARc>MYIwV z6UXE!k~)>|e$TjpEKF!&1QhX1>Gtb087ej8;3ZR4j?aA(oMf)C=a-C~@Zwzd<{?-s z_GZ{bGrf6mMvF$Z*ZNZyeRIff7T`hZOIQFFG)@$oZ>iJqG%p8yJ7e`ucQ$2w)Z}h|uQ*can;5D)n92 z7)0{1ElFFO;F%&;M1ZqC(H~p4%ewr{TUYDNr&di=B>{0ZP3K$5MThDuyw*Exi@)l9 zezKm**btT}V);qstnmgF8Mh#`xeFKjk1mKn3cJNwQY;3vPpnzenSR}tS4C9|T1Jvf z6ISxvwjJ#SD}ZQIq?;PaHP_oV@H`PQC<tPbYWA z#=K1MuP-Ohl-0TV9G$8On0z0CfZ?_A#90b1lQ$yF&?KY#h(X!D8!4ff;^%itPF9aU zJ#=)4Q7tN%M&LpTk;c+;FDmD3u)+*mF)%y#lla(}1kluX=0>RN?QaK;;>@_J2Q^T5TXSr$-`0+GQkVrAjmR^aL0X3sdC0G;51ae|W%xUtiJS9u! zNKV{s@^VtDLl}>pc^wcK!&z!!j3Rif|It3jq?*c~7b-Wmb0pB=CSeo&xD`Rt6WU4Z z;8F>4hqsOx3K85A)2&D^>9LAKW&@hN6uCl9d4-V__E}9jrfE9IGP~_T9-y?Z5~i3QvexF2xWZ%nLBvX#@Eu#A6i9_qPC+UH?By=HuU_CMVa$ zzj|kV>yg%_Kw4KL7(-<#_}$%wP&_F2x1g^szp}7M9w_qyw#5O zo&zC$Hm4z?cy$Mm_4lRo)TGud82j94(xg!U53??$kx$-jX3q$D8q2#Zwg#4Kx@&h7 zM(? z4_DP*{EN>p&e6qfA>YjvOre@7978%aeQ&tM3*fs8AX0^+N80 zBS)xUP8S6GJzDoEdne2HN`b?zvXxf?5$g+R+1bb%*knAj(e~1A}?^OU*(T4DD)8C>OQW}JLf~VKg_bEzMQAc zsAU<7&f(qF&Y>0Iayz~OK*!jP0mZld~V2&4Ah{CF_mOFBO%uwXg3R*0|3 zamlqwkR8XB7lot?aYwM1ewXi8hhVG9OVpFbv|42?H_tRwz1NU_Px~m4Gx$o8+KOlo zl`tVPjjM-?+usFG(RoiIJvUaJe-=JZRiS+Vs=io15vMTIuC@$r_fEZ6tVvUO@HTeK zvwa}pN4WcuM_*Era0#p5S%-4GL!DM!nj9}f@UEh;X1D@hFQ3-&Kofaj^Iuo$vRv4W5kN=-rStBV)gZ6yA9{~I|6J4jqOjP;M%jg) zl%Ggn!!MT&)N@v*ro{dC^*SLqeDKPocz?@AJw&wIo7C);dz@Gt)vl+cln?qcXMr2> zUjXkITWJD+9M2YUlYyHvqe*qP9wfAi<>`uQ@ktEp?S5Jcabmg2g#|V@@6523!$fUm) zZqLaft61>juJ@M7t^e-vrs&7WG*M1z%dcOigiyn*a#d^waSWyZd9&oS!tidr=>0lV zGH4R?%jO&CFcmnfDM|zS;j4r$E=uIq!4G^-!_nMzGMFj^{Dp=3w;N%ecfj zFwN)lr-FwHY`BcqO0jH;PT*rJdCPI&;~J|k8YzUAKv2}7=lOPzt5$;=r(OHAb=w9) z9BL)uPI9BLb)>m7_+?BCuy;q#L5PPP6&X8z`sfEgxpy>6bQsM@RJQT)^+&ga)YAiK z_Y2F`i1KvzD6#MKbNvT)OKF+B+eP4w!QazPWxJ9 z#BJU;gnA?>+`xv8p;1T}=iA(k%n1|x7I46s&02QYsQNR2$en3b1`61NZrSjNB_E1$ z(4#1lpo94jW#pZ?dp@xuISPz4!;ie`Lp<)$(moZytaF&XuvQ-jvQ`d760(|@+n*$$ zoY(HIHzLKKxa!|!xcKWyn@6Y!Wvf1RPkR;ZkxDhVDxI-6Ii&6BqYF;TqV8fqp#I_P z27(Q_{DrS{Ixa|YWCzK)>!LCWIQ6D~6m!CdbQ9#wqQH2S1lc3Sq`E!|o=bEdM|+?_ zl(S}(N1h@RRpIL<^wlFvLPzVDcIwp|=%6^THK7Q!(M)2vqj`)E%-OQ_AWTC6hW%~t zSSxkSv_pbbzAM1!4I(Xgqc~$Z8i!;9Y%9&#Af9Zh=AF^>>@5Gh3Y6ylm}Vq${2s_T z)B65I<P}sPGMQyehh~X=Z>+_S$m3`>GmiShiEBGD@5+nUR%#S9~SUDi@v*UBuhl zb1*n3(s(myKDbg*F=P0*4Q zmf>wQ2@*|=T%iDATAvW1w-_7$47}PRD1*`DQ=%9P534~oU}I2zw&`bDh^EE07ntY0 z*JW`GGA<*2*W?cZD3MLDu=2S%^D?15}Chm|g$@1E)Sf>OOcSMmx|G-7D8I|7&h+7212;;~wXR%_7xaX!7$P$ti!- zOqAW=Gd&4i{pLp*{m`>f4B4XjL-f%ZT5Fe^t>F5NJgf~xU*tRVS(Ea1gM`e-Fu~E> z5%#Ol`6A0y7{Uu8tcDgx{OMbEg4=dDB_6F&ItDkCf@<29cF{M9cub{115baWLZdAj zeB9uQrrE;P4x{G0RI%?B@qll&3_UNf7fH^bUkQ3oA$cZX;Eu$Jrp?W`@ z+eG}3*495QNgPcoTZ2zFCIH4Rfp(C95)@?Y5qi+LC(h&okWwH!1tUlhlpsxVb3ZgK z*P|liTix=%G>dL#fuq+yzH06C*Bz8)mG$wS5T#H>N~}H$+wR!WVWkU!in7u5bjLiDifAJfwY3kl&t^qt zMFUw8WO%Hz_t}9M;7X3}I|n{!E^)#LtGL>sC!3ITK$b4JwV4QfH6N>*YVM>+R|KWk z0CC{4RK~#nZmS4YcSlJDY9)?7z3GTa%JU0oiz0wv?x_o5QLy>&ah6fZFnm8+S>EZN zhIm*OF#v?g3VcACpp&B72mhg%{pooiAN!kSqvkqZD;BMS9-GH4__QJF0QP-qBbmyv z!U}D)1d-5$_SxAvFF)>yumvpxwwKln&Xn)%*;9J)W6~C14?c z%N>i`cNWHjBI%7vt7JC~O`NR${t7%lSW2Js>+eR0?}%k%<%DDG1c}q6z|`YcgDCux z@9G8k;mc$uPQQbz`tQH$JJ#7UHv6b#?>T6@!lA}|QO#fiW6LYTy9gbU5?4E2bH$HL z1rQu{tp4rJtg=u<(#?PFKYQNH&PMj7S1-cR7I(QrQX_q30F)8JLn+VkU&%o(1qL3D zo6A?-3(-Re=fuVlk0>2g1xt4s`_VXc;IF-N>#>yn!d zaqtE5{f6PT03TM3;7CyBACn@PO4sTJIHdYeh`dz)a3v%!R2b`NAowZuN>=`05ddt* zd_H8d6rd}s3pBa#Z&J7kp2nhly1{Sp@IdjvQOA=`M2&d`R2+}OTS60~U7o6=VbMM<77C~jbi8pnQcq=qYancc6^FMsor@o{Kn60% zMiZ9m{3QH>Z;r3IZPf&ZMEAc-(9kz5>|VKRS;z=IaUQfR4*wT|PMoa-0jVHt2f=OF znMho!yC+dRLFykR z3_}T*M+bs!faN=*j__7`{^=2qJs5p)UyOb){*Wa#9=x^ZvEw9n;5I-@^f?5MCkuLH zKdBYam_ZSW+qosMfPhVLfcX>$5ga?u? z*AcR-Ytp?BAmb1E_iO557^&x84|_Jh4JuK71(cApq#x6XeASYQVBpUm&dN6?Xj}Sj zRvPr+!X1%)`w8jxb3`a!p6!pyKU*9=Ig1SjHnn2>q+03itxe&*pEv%mGZ;A<$&H{~a#&$ey}K2JP;s*JAc zKjwePmDtYtoV4R*a6gZcP!?yFXm(*~&|N>G`{5acM4i3v)eF-OHHJ)~8rIfT7s&@% z$=g3=5uQn_O8!BkVM%ZeX_lhAl8ic%Wn4d7_mDe*p035yOlKJUV-oaAWkAdBfyl^b zwr73kf+9LWKB{d2pLzzNE5-uZ5Vxb?PC};NS7=3+jQQ2 zzM%vfbH7ObXq)h*{kAY?gVLfWPq9i8sC1=1>=5FB$VA5>mR~BE%R zqEfoLo_@9X#WkU@!NUg%?q1<#s|dNW&%)-r^**Zx3lZIG8gCu>2#4Kh73Gq_=C|9q zpv4K!M-Rxb-UoeEucs?MMvAn}m`pLD2!zKJ<`#o~2RajWtBvTc?epuZEv{1sW~GJY57;hi zT!Zhk0mM*Z%rQvP2Slbn-iQY5)`geaKN~H~0Ltjtz6}KaITrJ0BPp$R--2GsG)VEF z`edU0_E*@QE!3n3FLEY8WPwGcd7y-n;H&9?j?Tj_f6EFC2#)7(O#-3iTDpXv%r&0P z_*e1#cSAGUGKC>sJ%%TC@i_WR`!qTxL-t&6vm^YfgIIRl6|BErn|45OXSwt3m2KEy zZeru;{H(*UM?B923rQB2rnRYX(i_j2l#JthgreP~u^FdhmM0expMwdC*-ZpZ1=*GS zpxx|+;2+Q%8OdbckO3f$;RT_0{%r^vWM|j@R)?jxHV*|rh^J;ccN1ZaL3A)Q8M0N( z?^|vRx&#J$+a3UC{!?gS7KBD%FGByUC;O}Emhe|*et9GMEI#7%t-{7P&h}-A5tldW z;RD3Nc}80vi0bt0u-ep20y@;~*W<_SkcY%yjw%VyJ2WEYp(`tE{e$W6@R4tluX8_s zxwJIJyX{}(#-XO;8bPtgOF~mozHV=Vn{eMlnTeH8NWP=GLEXB1ufHYvxEczzY*>$| z>QgK7H~G-IQ@8Me+2GvU1)uxC0v+~>pw*7sPy|^8yYFk>t7ahV)JBa(RK4~zP=duD`??-=N<+R zj6r!{%{%zgT%SdT73NP9TupazUYzrte1HxH*LSe&Ya~h11_Yu3#r3TNeJDE^;}>V- z-|C#@sE&!-lPjUns+{Z6oS7so^4CU3tE5!)b3J_cdiu4^muK01#0TSGNYBb*_|2~_ zKa&}vHs;z~hEU`6A4DN8z^!u93*HK5?nA5yRnbL|(r-m+IxvnAlQu1``F-R8+@Qmt)Ey82uC(3b>Srsm&d zbCr0qDqmL+WbY8R{mge_)V!)C%g7uo$c~DJG7u-O9Jz*Ot+Fy75vUGp@rQK zW<(Oq5uN>mj)CU1ndAL>(``7Qy<-}?$b;us?sZYrQy6$!H9i_1aX?deSFeZRU+>-$ zdG_*pD_1$j;VO+RjuP1P_)TEy%{(^>Qe?v$)9L|!Zztob5J*nJq7COBopQRx5CBjw z7lZ)b46FRW!LK2U!?VS3p1Vgp3&i4taC={q2Yf=0vPAj!Jl9b2w)_eQwMiq9gnyMZ zWg1w4XjwmGcm}{#YQ#bE(Rp@7t}Z7acK}=|~aIb05vv-}IGg zZf2eYF)(3uaON!BAVyOqLIB1xMN6Dq-PA;01wM07hG;9JAO96&N@4YV=6JtWn-|9m zsKPK_YmY0$jlL-IIf!KxKTCkN3;!N?4*MH!k@adyfDQQd?=jGZtknfELG(MF%V=LX9kB5?$eQpI)_B~WXxDc%wM z^J~TbzuvN@Z_l;3GLzmu)ndCMOzUQEMo|sCZ358$ox^He7Rj1he<(O55xSLr)oaxg zB@LYyxQH~RJewnJwjvZypkNZkbRz&|kLlS{3a2g6r#NRCYQ`euU*gtc>Hep9ithks z9Wv6;`X?m*n%RsXZ~;^tx`+USFL?yF6VpcDa0#4oiS*d{hQA+iH&T3Y|C3RlUb3Gt zFN_1OKeK&ngGAfv5RtJ8=PHL1eRxL0L~|X*h!sX=>|NbmqUF@NC-E&uf`$!qe5z!! zl{A%9Lbfdf2p!zfOy9q#!8Zdv$99t{cqpoVxkFQsAdHtKi`ieIm0_?IV1?}yMnefm z)PG{-uR;a)$4K0+t;*zLKd3=C!zbSOc{ok^D#rj(-;J8yjaAiYp^CwWqvQ$!;;NXR zKi}`X=cPN!t zT3OgX>-T7wAQLx)l#x{NFaYL{iRa2YlJ1E-;OOBb*8^`@jTpIPA3x(vCpk?;X8wswi7!jrhU;AO>*ZxQE9StO2^= zWe5Nu?V-ze=mh^4D@jD;fD-mCd^P!Liiw#xSEQrtMYYw{(C*xxRQcG=xTu{19MYB2 z%O*NV2{EIces^9RsB91LJhG6BA6f?uRHoWg$F_g3x(CMyy%9gGfhgg#0NhPo-1_>^ z_YVnO`FtDa5{tF)4$4M=LPh=bO~G ze*ih<17}4ZFIqzJU&K;??^g=IsX#os>DxUX$ zQXlDtqtHK9@oy7o+~?eRR*nX*?EPpHKxF;FRCsD@~T; z4K1$pG^*6wP98=-&B{B!`$Sn(;~qXLc;T#2wu6L!djJzz6>QZe7ktaYQ8nkv8{1iu zndV6}ND`1~#w(t9&*43V(N)~N@dTQ}iSJijWD2oX6p^^6j+ar_(^aA`$gxs?w9qIn z`q67uJ6&GpZJ20Is45bXkZp&ziBPxq%G_*9kbKmd@1n)!a4qQm{T#-6B$t(|02e-s zsNc^vI?P|5==D&cQ02SO{Wig(0d`-x^)U|6{vp6B@a|+P`5kZI4(t&IT1=O0N0X|r zPZh~(zeZiXBj{UaYt)gUe%2bPP&lHW)iE&UFlN9efTy-&Uxdi1E6Z*p0PK(kQm(%q zC9fN-4rytq1cbcgagqx$Hf)uSMXhTv4s%s=cu}p>3V7LTT&WvNa#ncd$ij1VxVBR! z;ipG$oAu&3CJ2?iSz}b4;!oP&uh$p9)K#s>5rHHY@Zh0$;Qe8M_xop3@4mws2*eS# zk@V@A;S2QYqHav8^W=#=X>sKH1h(lWalswXitB-zw4p^ouOx+=p z8FY4uLn2JP2|~WBY^jj>tf#~WrMdqOgKiybE+QDj*=Z1Cw>4p&yl3!xfwCtR8MzGJ zyBpzkb#)6nHrEl?V^`{R(z87*AE^l+W$hjF@F}p)DQ?O$X8BsI2Cb^XCDT5jDT_Kw zEH0`3dc%N)hJBj;%@V~4&iFg{zc$-rO9P_o9%Fn90)lX~5};T#QT0(+>Vkk{OcNjE z=gifv26;*BcP(CUY{@)Hi2{)9ao0=3bh~qnOf2E=6{Fuq6UzDk9d-8*V$JD;)M5tq z!t`?QPeTn1|8jR8{ChR4!MgHkpcikZ7WT8k@>Kq*&fvA}bQ!*B3c}O!cQUNBqhIs1 z?F33ukX<>hqdq^LrxkY!LhoYL6*m_(!moJiN)v?$>4MKCXKpB@w3DKeSiNa zC{XYB`=VDU1_onrWRPy|CIhg+cm2zBKXNn7vvPC4BgoVgub#FZ)#X;Hl7Wa5U&S3* z+`M;moFa|BD`3@uXeRu7-!$xG{SiKzZSAbB=mv-=IEl*l=axOWiNCj0APwf=#N#fX za*5B(TAAXyQ6~W!Ng#fecqQ8#8iZo%@ttj8DCRcMr-^_AW1q9e(mVHt9MVn@g1XPg zIRSn^H#2K*zzU$z6;p%dx0v+Xyht{3Slq{76a1#tMV;~g76Qwxxqnvr|0l`lf!R7x z^F(JW!JZzJ?sM3PeP!BG?`HRCoSg>)0rI{T(_2c$p<#UQL(TI}wrNE|5JyRc6!(Q= zX>Hz~-Y*{gZ_}9p}I*A~kqw|g@{?Gy0)8}#MPhBQ*Z3xTBqBP2f(rg044b}0s_{evjqe}O zdn6Zf{Ji#MBSBl|1<0@Yd}~gGZjQ#-q~O`VrYeL12y_e_$fL-(VI>E?b+BIR74S&Q zumO|p^sn<1HslrPd*rBjRpc*le9dY6pF|@D+13d`V;8-ZHlb+HD^K3N#18@1^~l!3 zSzie^ufnB~$P5P;Ff1d>qFJhe0~Y<{N$_P|?%TuO(clL0b41QWQefNVCQ49GC?tYYr^Ocqob}jzh2Gd zmK%Rog<3)&>-r=I%qLSckWM}M1o2S7`H(2k?P@1)v0--CCD4~>SouC?A!1>E=z=sy z88X({#F_fo;JUkbv{89>oO=rB8fV!m|6$yCo_lzam3AdinoVzf=nSZ34eZSn1v>XD zv7gCqUW@~UfV>0{#vL{|XsjSXqs+EBzPa$zTKsn~nXJh`C?iPirkBG-oS4MzAeflt zrBoH4GOKqE+2$XEoe=|NKZDCVBeq?7HVV-;whdhcMlZ-P1MgVs$gaiSF^X%!k)beK z-0jjA0^}wg|4BfM2G}+?_kyo9>@FG4GOiYtqlnsLjI=2w3;4gg9RN38#oFYZh2a2< zko!$2JuCixHxJ>RMUfE3bCQ|)$oKW@&oeV<9R+;2em(_&V+EcdZaUEFcl_P+%vL)r zd*!c7$El=IIZSeu;cnji6O3|tka5h>Cle9l5cBkQy<4qlI+-K?dT1s;X@NobmaR*r zX98PT5|7iZCjnd6&dz<(R&|QNKl-`N?d0*clrK6cB@sM!G>*}lAuO{uO3qv{wpzjz zYXdRYYov4>Z_O!5-J{g}>}QF+F~Q!!W}c3jtceo>Ba8=j2D?T2ETKDK;0c^k*cjRq zb^Oc54?^6Gvp}&*G7)^yU}eYr)kdLr%=a(vZ*mbJ)tqs9 zeXMRH0X_nj2ZOoKgK=>145$MJ>X|HTc7N~yrl;I7B-wf0cS{&h|C+T*nh;H4dzJ?l z2F|w#caU<}BUtqC@SFbhS4#svnjvTciOqb3Fvu?cGMfuv;C3Mqz#~=)p-n#$#!S#> z&S#t4550H5g9qV!U6UF#Eg%;9o+YmJ<$+@8-8O|EEUdlUNDBx@17TwwM8^P+nVkx0 zG@6eXT>!Bid`PE{+Hb=?_V{{hZJ`Rlxa7S3D;?`~vm%uwb#`SRx1G8rXKb`sSga;4 zS1mzr{U*IZAfS=d2(VXzXWT52qB8szY>^}wsClFg(f83)sBu!582;o+u$X?m2GhoM zE~}@^$@qV(iaLNM2!zxm2M%%HZEizZ^pr$HZpQFvVFN0akmQ*I)3w-~7VBSB=uYSB`W|ENHFG zSJ67v_aI8V3_f+^ZWKTj{pM^TsOT0kA|nNX&e=9NN?qhUkPQo@CZ9Ry*M_oXRtTTO zlm25G?g_oq>e-Q>Wk&ALX`RieL%gr7Hjju^0i>kIw+3l44jg4x$ly55rN3FQ+h!xE z;g%Xe`Xj-cX%`$vi|pVY0&Z~tp@1gLcr*FBmh^+ldiZPW;H=N_&+DnhzyHs1V3dl|82n@=Ivxgg-0zh}d%hkuYO0g$6vfs4`mTtR&rT#R5% z!qtvKiDo~;Sn*US1u{d3=9g>MT@fNOhUj-R6f!V5_$&meb57y67dU#fS}B-S>FT#a5}3Um?D$Y{N#ss-em2>_I41 zR=p<6jo(|`A%h1m~Vk z7z~)BVL;C>#sE5J$xwc~{PNejCu~T8EOl{KWpFY{Psj<0Q4G1m8%S#d&naaNAQEQJ?p@@B!5%LTNB2)*2 zty!gq)GDvX#UB9S|1B5fb|Y_I(6oudAYpWQNo)^T^Q}5hALE@ zj}(7vMGnz)6gaE1zqWVqK_e-gh2H@p$m+zZd+gCsBpML(v1yYf;SMzfjeBkJjO<~| zcXe<2rN={tb@(HPtN>6YH>AWK2Q1{>gYy~+rzh##ZUf)~~75T@)A>$eC5rb~H z4Xp-cNz3|`67QS`-LkfuX1WgGx4inb_LN-65Rc)pnTl_g}1zfv$ijb32f zJf4+8WpDG!T!PLzFFRxQC!4pc5T3_i5TXhHr$V3PJ2Ro++AD9`^g*3KF}mD$x&KaQ zC^S8wjoqvlLqOay94$y%ZyQ28Pl30}uCdhd&y^hASSymG1&IB@b^4O3=SiKNv4T{| z-l_gfNFG2X(t;M>4+P!jyrVpr7rmtdGFpeEn#?AhmRN_DHy}1h(TJFtP$Jqw1_Valu({E%XBu`l$utqDrN+_Rip8jJCsWJ*J&d;J93Xt<`Icd3prKx5m!IS%@lQ6B z^^rZmP)@kRHFALV@jstNeY&zk~gEdt`^k zA5GDxN#~}L-Q*FU`u(pYec6QYtW3mc&fI@mF0yk!^mO#j&R{VA+I6oabBUoVZ*ODE zHWA&Skw0bMBT2Fx)WGpC#R}s335!HybFZX({@V^%qz7Fh$yxE)KP!uKcy{6-z zw_P}t$L&)8IqqKqZmFN4-Nnl4tYTaDK5ePn%YPD|?kKll>`;6P?s7mA;3B&@h;lzD zOlVlVJ)947j|N^9(A}o&FPtP$f1qCPEum5`HlSBxEq+ou=YMpXLUrAKO#Eg4Gr?HtgvO&9$=l}O?<24m%NMOqV05~m%?H_|X5c+jKs4}mYGI24 zP7u<)GWcl$bgma{6HI^;vKf&`HMQJjt(p#rV!@f+ocA}j->k6U8r2@Ixwzhxd%bzv zy8GS_-HaI5B1}XS`+~^}0bN958DgZGt$=!Hh3!lS{+u$^> z81JjUpe-x?FAsl>DNZFJi&en!bE_-a?1ul)T>RqelBt&vK>4RL71grc&hA^}o@V9hBun?N^lX!;m& zKZZJju}*VrpF>pH_ap?gf){e7cI(CV<7+R`>jfgs**P_qk8ZIrkBK+yJt?fi2kODfRI2g?D zOd}P@EJ=ouN^354&q=RKx|MiFrxZL}6E5=cp+YtrYN=UVPNaKKv zF^-=oYr7E%F{#L3pacI>9NY^#!|0t=ZR%-pf&d}tlr-+un;VSoF7Ps7D>t!42~v7G zOAlaBbU;sq1qC?mnNKr=SskMUGCP+uKfzUgYT?BhVkgkgGWFz1!}P0$hJg1~n7KJw z!Y61II@{lReYv9siDmSPYg0CL=pd*c%<0I+B!hf9BjU;d*FRR0sjv0$2Nk zI0kbvb3{y`R8G0^I`Y`d9GpiqWSr`|lhIIC4cLw#3J7Jm8l0p4*^^GaXt-cx4QL8Z?=iZhN~ zjAuEN`g7_fUyZ>SDJA8vhb2=$>HPK`=%9oB&Ens?Sr>#r@{_^*qEPAnOK-E#jQAgE z?v$-odBwAT+xmF!9d8Y!^{-6F&)!~V`99BXWAa9M2isR*{xLA#++YWjzJ-omm8=Wt zTD6{!7)KC1BIFHr`V@jx_}G;GPNP2Zj1MJN8rIZQHgo;6%LaGaPZT3@M=7^!w7y#h z#Md0}z{N1rHj3jbT9)~^E8okTV0v9GuIru8t@a9C$sBmdjL%`jV9jgM6Wpx(w8A%a zWaGl0Z(L}7kB0i`=Eq@QiII5}IL{WDvW}x##?}5dd`Ri+Qs3^ZkI@6^HLJ6~A7=zQ zzM3MDaA1vn|KmTwO9h)WI?kyu*l(rW#qn!`+0LLi{D5l|S_#t|n=aJx5dQ`@l6sec zk@dY5;5W#FSm&Z{c2Vbt*J|z6cU7sptpYi|RTFp{(}CGAXMbb78eHV~0Z&W{NC$oA zn!NoKyWe{JZ>}}-2+#hoDA+9JC@k>bR7MV~L3J{@DmtrL#{hEeyfoioy*wwFQLXHP zzUM7}vG^!Aq`l9Ez=ttF{`^lA+>Zt(+=Qs~gm7qN5@O~<;^Ayy#F4^!y6jU;ZX7+8 zm?H>rS^yXBLn&0R-gMa6>Y(h5keI&9zJ2%E+N0=ccr^!jrt-t=!mR85pX%g(Re+TG zzsbmRjkCo&!Ci0t41*Jpr|J>*AQDA3CJ>NLGB)3;JqBf<%^{d;JmBSSCu#`Cg7dpQ zokkJg$J(rI`wIq6fdO@lOd22#ibIA^Qo3b~JYO5mr_|FiSzpM>%FW7Zma6V;UY5yK zekUE60|i13*)VU@$jA1)^`<|6UKhe`GL-@d4fzh#xDQ}ti zj=I!^trFid5ivM8F8c*n?)%s5BwKc>cdaM_fGrWdqO&%Hac=7JE58tXqOy4+@Sh0x zN_a(i#H0hp+I?9&;AmI!2Xfcx(=T`2LL4+2MSr0NLxe8Q%*+l6bpEVxsNp+9rpN_yeHv%T~8HEn|3_w*+?zYlxRoc<0yCz%@6N(>UEokw{U~9n*B=B0P56$zN(~?%w}>&OwMn|kETvfH zhQ4oU!n4Q1qQN2Pt+I=VV&BCJauYzgJM}xUFunE*NH{H?A^Z+(uQ%59BKMlKY51pd z^kHEU%p1QcGs+qxESPJ=X=T zbF#CR%@WC_B6~?!(FohyHygYDCpdrnhh!fxQ`E#1F2I_*u!1_O@`-B+fe1nZDf&fn z8xF+_Sln4KbRWuYHp|R7f`DMjmcJV=D&YRqJI>Tdbuh>8tF#%gH--WVCQf{W*3?Va z;`f005d`4qZdd+!2XI>fxQU3#$AF^nc99rwCNw7DJp#J<=FYk#%-H;8&YXlIZ~e8H z=5lRXD11O;FWAQ;UFb%ebFQ69jZe?d{gqCQJj{WyrZ~zf(bv@PvB7Y)e-jLS@0^qW zRclc8b9}T*gB8p5>`cmDHQ)WUuE)Q#O9voT!m-Lzh&+b8?bz5*0JZxq>4qNIyu`M0 zZ~_^js~x4%sHapwUCG56b?^bvX~H2(OS=k0YMvU%v$43c{9<7hC4xu^!GOSnC^s}p zY&C>T#fgvt6Z=^(*{X`aqCH$xL%q*f-TrkkG$Q;wwOmO;r)BS?%VvAJ1*>SICC2dto?fV1#4q zW;u~Rm}Xs{NV6==4VtuD%ss6!e;k+y3U;Bjly*jX9T8 zoFUCGL5a5VpY4}CKSMT+@&eb5$k6j@w`iL~9x)m7?d6STdAAtLv&ilxa?SRK*&BJU z_Sp6caW<)9xmw)j<})M?t&#LO*)9T|QyRAIQl3_iI|C6&B^(1u9uRUgS;^rmIvzLD ze*8*v!;oaAy=D>G+?j@3bbu5xP$_Tb&(MR_T#gX4Oxp;4panr`O&kIb#&KpAk)Ryr+U;)~ zH|6DBqgG4hx^=q0R6tUv>z>DE8dPvUwaHCgH|}lEl$`m zQeyFoinG;vqw-a=M&4^9W-g0yF{5!TBRPMFoRY1IPZ&j4R*iVyt@IF{rdtPRg5R4j zzEmacE<2E}NW9&<=iRVm>mY2-r+44e%VXuISZ!3?_+zXpt>XDZP>I0@g=mZMe$UnC z-^Y}atSh=q$N2Tao{ z@RK>P)gh^EWNS^}3rndD4?Du9I=v<4Wbj{KANR${OncxdbWnn+ZV&X*|2N- z%_HAY?-b6G0ic`$hHZHm8RM!VG zj|p8yycks#D1kl!aDF2YhQ?QeAda>9R8P*TE8H(m=8pv$K(Tm}r=@#1&X zAM{8()J3{6tfcJj#{b-zmwMwXU+1VUz0fpm{j-pi)ySZmRZm8N%ww-*4)x?NLHqi7 zjBq0C`lH}7-8BVj%WZehxv}2cS4#A{JlHmHQ9UH##Ap?%n4?DlurdEKNCLt&Xb^27@B!7@w+})f*O-^Uc;4z>V0vSL_mq=o;q^FCYmOhOYuJ0L%DgP zp9?BVNQvN)i|!SQV2|%V*bMl)HIE&G70s>gD^7MQi{0ebJ-v5;!<{ih|6+MF;0W|C ze26qCTP@x1v$U-1xOOOAuVIm{oexc^xL|UQ0lZ;NW8&SZW@n)lJ2-L3RVdeM?qz3; zn^SQI9&l!}zD3zMbbFkBAyCKzvPHv?{n%RnV4Z$~55Lc%y6O4!Q%*YnnO7QC;A^45 zcz0P3UOWgEA+`H`eI|vLo)CPgx4%e=0J+3p1$FfHQi=CG^6&bZ8f~#3;Q3OwY$@3q zhA4#yE~s4xFiv^OibTEg@r9!c=L`9mV2SODjdEDC54uNfzucz9fB{_Tlh^{cc-=XI znq&@hq{J}SvD0@v(A-3Db*b7{&3DUFzol~rjKS{~Ps0~{9iQpp0el#X4Bb^Nf7SzB zn{Q#}-+KT?C8famz^_Km@7hmHH05*?_XdGcz^Z5;w&L2_c63m9jTAR&A+})_bAf*z zJu|qTkWw6DW0x00c8<37>F(WhE+=cWhvI&QSYHZ$0nC`%sUaiAy=4O%FV8=*0b@e) z;?d8DeWi%z%v_|#oijMXW~@LMt4*BwE8fjtVt_*qM;Ut`85e?%lK-+63S02lpcd+q2-)(vt zKntwMxan{;pT1PTf^wi)CTFhcP446#gf9u;{dS#JDv zUZ$}$1}E-$ir%qR0$xDk`}#vcI^~5j3}v4z-UVMytdd5piJMz-Z|=p2#6kTZNzj;P z!hoy7AB07)1K$HuPb_prL|x;ozY=c!Oc?e`2cJzeizjYX_OUZw671dsa6Qer=KZnN z3(Dc86{X2=80`Fg!4S#h+9?v)UG$*8!E8u^X}iWM>8!S5+GCB7TX)AC*RgP-|wLZ zN)tNLFSo2E8$fdYVZ<>7Q>GXy34%#mLPi{wJFH!p8@s ziV=cSaKb?%Bf8u?;SFo$7yg%3bD}%b|D`GGSSNcDB%#lZaI%586~=zgjd!7(1qd={ zZ)&wL5_5-^kb-iEw@G?sv2@FdbmdaE@HA+|kK^j!?i~a?#B;|iFkpXo-V)jJJ;S!e zLbL@SwI!Br$76kc;uaQ6L(@!0aa0Gzh`nOz&0kYjscrpy9jPbw#Qc!7X>=p|sUkgu zbI3mMtT)gmuR^r0wzl@@YHq8~gZSuaMf9TNc*EY*By zW#LV%fGU0>?pO21Yx$UI>+ZL(?gTLAq~X}YRd8=qs44_-o&c`TVnW35RCl7DEAUV9 zVffw9xG^(^%1LNVlXL0;Rdda3d?$T?~#^z7H?dX8w+BT=QAWOB5|SB!FHJ5SA@LpfKclHsd~As^zgE& zVIgKAKrlOF=f6u8;jF6{c#kX5EC)T^tT=Wc3c%hPrQSv#(X#79G;gSGT|b8@rAGEW zUP(>hLH=u^s@bH&65uKyHMax_@%&-?;y?G@e3XPrRaw|X6A)~OJvSK#U=-J^uF#i$ zWOf432CjxgUH=e9JfH}bL63%ERBRm)yAU9mnQ1u$z#Ly%sxbg_4U@o1HyH;IDw;!~ znhHF(PwVxx{LkdMb@QVV+ z=Y;~S656s~yl6-smD9d}CVoUn?pIQ%mtIA`SS7#TaUnsiYxGwJdG0PCk*cCd!)%C^ zi9ugS36g~jMGaMq(_^*jZH4`GiTOG21E3D7hp#$bTo|qas>m4h!@0s|19xFR-GcBh zwsU+IKBq0UTY}*sPp-)k8%0_*nC4}wDa<+|g6I}`(<2O_yfsQNZCYzzJ?l!Y{*VW` zcAOBU0H9c}POsVvQJA}Jb;pAF*~?OZm+We+`v!u3l=wwMi=+Oz94ccNMHmvSaZcJ^ z_?Je00F(rLDHMJx_YIGZMRlDBC^~cUqHM;TjzPp&9BNny*zjIi4729t>!bBWdY`^p zRDT;8?OHwlT{TJSHvZd^MycIch$4T!u*cUb00j805Z;sV=ed2NRQ;Go9`r>LUpF-p znkcE>OVEBdo&jJae(5cuO>24mK#HtWbH-uI;o*y$ zGP?*AIX(pKy6dE(zo=ITRZD&But%SUhyDs@NUT(9^bT(_UwvwzLnIFi{;MQ$Qr|Jt zSCOBJKgv+fJcU`Fy1((aamyGwp z-121}Pg~^n3jq5y7OUW$O4dPPk7J@|mI0`|G#U$d6)21zpEIG)Mkw`R?_jhnc#zA; z`pj;_dznN6;JJLd_UQ`6@(f)ja2^!UC#E$duyp`ig=*xPmc=haIng4Zh-5ddHK9M> z^w=>C#j@zZIxpqIX~XL3!kO>rr_Vr0AQ88!P^G~mPfKIx%${4cwABCm&9m78JWY)= zm3J}M(>*?DV+tLR-{P)Mv$~T`EjhYQ3?%l-^F=|EfLk6&IVFMnl_`3xVCmg3NGBgp zHSYt1&~=dQf>6II#Ef-^v;N1Aj}Y{{O7Qa!w5<*;l}==IKptK6b<@xLJn|uy(xg!i zpG-bNg0_z1*2+!L)IG_`tVb;Bh%Xojph6EUD@n6&{0IkXY;U6T>yQ;9ylBARu=cGa zY*Y%-WzMY5iCLRk`hE#{2n@7lapJo0Eq|S|;9mZAHC)BXXw+*1DdaCo@u)ZzGf72y z10xM^QE;m&=9)u?>?sI+qsuKD6WS*b!*5T@AaW4FVKAlnE_nHdHEfI1u#vAUPhH^zgR3g5;bryJY1xXsXrNiTY&J*9i`#OFga9D`H}lYC zuI`py8!Apk$&ux;s+~&WHhl)bi&`jp!{vgakwIj%77*$1dN8NIVh0;zB3yWlntd;9 z2?2!^BATNBhFzrk@h`XIm*?5V9asJ>*PzLc!camg&=r}!(HQaSN*=^J$nX4T7wAyA z{oq0v#6h4&h`M9nXxq4wo+TarwikfZdk=kk!L(Trj!gg;J9uj@>T&{mP5`Fx>D9&l z&E^zgGLKDhUxXa8nUIfU+JIc`^+VOhZjDDS%FeDWkLI_mX1W2^By78a%z7* zcE(XUE!-KPEit?z_$MNCRZjw&(B2>sP2WfNb<~b))}5jeRobsz0ZSp>qg|89`47`| zg}blT(_GKTzmHfu-u}z#`S$7?cwYyna&0TOqr%94-yzhs=i5oZeF)mDtyKe@A-hhx z9%&f`M+8p>eG0*3gvf{gWl;%v43ThM{j*L;3VRQD94WR*yW+8FKM|+eTgm&v(pEmP ztc8H|BZV4(WU^%Gl3P-Cv(Ub;+*=x)sa_NBSaube62}E^k1Gkh7155sV%Gr4N_Hx% zZLvo(%sZpPc^aL;*l#=NJC|og23%g<8E(BXdnbxLdJ9I+R^nK`n^(C|jR1}a;#m9}YWaOI4aUXI5`>1}*qU#eJz@>P}y}llFbnAaIEc00Acis_$LS`l? zYq_73*M}6?yz9tl}1#Mya8lYuECA zSdd9K0t5;8&fy>&%=!r*LYzG%GpO)`{FN2YEPmEy?grcV_d2IC1pctZq^66fl z@+E3Wm~S4YF~G5r50T)o4owTekSIE0f6@TK z4ay=23=lNgp7oH&_OhnFz6EOm4cR1t{{Dv~Wp>4MEHti!aj-5Oz6@i@WqrHo09!es zUZo1nO7#$5=)eCaCPKOXM<yffRO;>4~o{P4ibbhwYk0*D2W>xRpf$$G1&RPXVCDp*| zfFaXO(pHax`I@v}jwIcP$np^A@nb@OU=x|z?SlK=h{GotqI*eM1E1(sKq>o4u$}}T z0mNRC1Q-1qGHd@%v!JLb-=zA^o=1|M0^A zfLsLE&=}?sk?DpfhfhN^xrc_#N|cBoXQ37cjBw@hCOEY}*$-0zmVmy# z6M5X#CqV!NKwOP4`0PrA_>aMO{NsER5+L`iy~%IXMFeOVKyp-~?Vrt^-u~In9QeO> zC%`}W?>M(Bry&c%RY*C?7w8(^uKv}L!9jk&Up->J#ZH)j7B5ee&Llg*idHZgY~W>K zQK9a09bth22?z+dmicZ7K=$#Z9^zE*oQSrqKA7%lA?uzJNP=WIUa`s!9UIpo5&py~ zH-!OD(g(tU)kxX_%Gnk*%L`;t>p+5+zCP)@QlZjS*aS;DAQ@ENr#soe0fb7Q6@;k- zfdB~jJHAn4nQ8$E>&1k(gPl zH#kLB2ok_=x`2TD7!mOG#4roGuw9aQh2)~PrgaAsH0I#G!NIJx#$Lrk!w;qJWSRil z3?%ijt_>B;K8IwOt=n9@LmHrlw`3C@($BQEBW`fZP<_oikT0}6DVup=D&i#r_YJh< zI}W&kHiVPmsm9cBu#?UZGYrB>NXU%t(wuC;7(~5-6E=Vc=?@Jcqb=-KmQg9L7O$75 z-q~@S_?lDenhd&-7-$68oD+a*e`jN3$^&?((_S<#Wp} z{^5ssk9M}9mYttTX;kjKTRDB_-FNXjy~Z~RoT=Aezx>w!{MOH%x0pO?=i$Rgs?`}h z=m?lm38QF^lb)qhWO8G2V`Bw50<|V51FL!Iv8Ma=uP?){uX6_%p$N=30swbgA&t5y zs_6kR#i81L`%(ZD3f9mB0Fc%rN45aVh&yjm*lGsKLDvB7OiBc2xbVz}&<=#wLx_kF zo!CP~y)%X;#eU4>K1)3;(_ONss(k}q@--&`z&n-2G4dpqt*A)EFPuP>hd#y>Rm-tp z?cZ2ekf>w~n9rMwMUD_7<~A!nB(6A_05GxbKw}ZJ+7ATS96z8O0o(7q|Ni@T?%V_r zv=NwPldcdvV!IP3hEWdJ7tXEL@h>(RNOqT+3+8r+fYYFNLEyhO0VqLcx|h5EGx8*j zWi@z29T^;jCZLax38T5FQV|P4*L)&iMTSIt_pz_n7Z#T53(H?m+f`gLh1kXk{O3P@ zkpH?02>`5p{YL3h5!(|FKdj{}i5;FjjU*X*0BHvBWQIN^KuZH;PN0CtKJ*Za9`CH@ zATire^IHB2q2M@FosxR^k>P$uOKIP}6aYyDHNOb7BLKA`W9g1jvMfq>LHE9K? zNY$V)liUK#ldTr2zZ5Ctf3xY<3kC2$d0;mg`ZXuK9bQ=E6tmy|(7r)y-$M^S%;dF2 zeh8*tB7!OV*-p|Ps_X;+h6n&t@e*!iMIw&`=eKEE%V0DJ(fV^7SJu!ty~$mD4<8sF zPBju~-@ev>o*W<=KtD!~0Kiaz61*>Cgxrd@1QCt)Isu8g3+4+`ICAT`id_IwVo(97 zwKC&Z6aa&+DfuiY0f2jLXvn4-KzdsDhhYQ`4gxJ;#~=hiSc`xi zF#>=9{I9g20YJWAXnx%<`1QxQgXEqRMo#EZ1i-CeqXPiYnFpvf`^ek=%M)rsD_h|| z4rv2`3P4-yh6OmJ`Y$;%Bn6Nrd1)D;rOEctL*RH48#cvQ4pItO>_d80 z0Z27{8VS!B8!Hqz0-o~UV5grVfZr3)!=?l|BW{ki$`@nwY1=kg?42a~N-Hf**RG+- zP%IJ;!3K1|1`I)BKrfp{&I|KR23WK3pwQ@mMx)?fSnwN##rh%{(uowRzUp)Wu7QpQ z;OWyr0QGbr%e z58iXX0J%3MX_W~<1i_h z_PC1p$s-ct&2m|alK_xZ$p195na-B-^&w=bf0$+n3Gun8m$z?VpTsweHZXvvP#7nE z(%Tc+@sJ?eJcNxw(+ey8f2jT%0AWNnz_3mcAm2@~#V$UODqcWLTPBpC6##-Ac;_ZC zzp(}uUztPIpHr%a^V}T!IUUM?R;%a)8Ueolm=9aP!Ab7cX@W~>dKv+mwP^nB z8!R#Ry0wNlhrs(`{N$aYfC}EWgPIKCB8dA@fPY5kLIyJ$j{Gc_WvPSZ2-*$|K1_L< z3kAfNxM@VDkt4_e0RWY}ZULCJ-I9XNPL3F*xrC4~V?E4G^G%Sh?IZ|)2mn=d$D};K zc;wo)*%c_+hr!BWe%h^)BrXmWksw-u@I&f{;6J;9Vqk!k9698jCO;(e(6pH{u21ZE zLPU<{vPk9e(hJD;Kg2oOg6xt4|2b>Q?$YiDF>zsm+#m?3!Bw$pHEICS0SJZzB7iLS zwe^p-rv`v|n!cOK;cacS&tXiO99Bv?`}#pN0fhfTQN(A1Om5&32Z>JJse_~(B)jm_ zDa3LWhhE%Chsy^35}Z%ZxUv9HR<0=rjd^O4WrPqv^Ei@Z*W3pKpy(VSlKnE3+0SZdbLqJ>*4nVR?AFy->8yn!4AoKbL0m287 z|K^dJ7(mj_%%Aky_4MAQl-hoVdXf^75R&m%D%y=l;~+(Mh*CgE12&g}_*i5~5YA*k z;^h^(^Y;iPGF1}L&b%iLghR7W9w8Al#~CJBOajaeq?|L&0jV`vq-dI)l$|UQ&(jkG zY#WwCk{079Hz+&4c1;3f-3s6i6AZa_EspgxHduJzKCfj0<{v<58hi8ezX0j7NJ`{h zN)WaSX?szwfJWv2zYwvGp^D$H!m@`ZN5QkkVaV6p10{q!a~!sF7$ou01&{fagi%R0M?|5(nEn&o_!jLs@Yk*9hWKPdcjf_}R&*EQp z`LbZeFZg8t;w}lm^2sfOt%)-~eHhqgPC7`HtI9{9zgq;195?r#dH$OVc2lWlY^lBj zE;r#Tz~}@5a1jj@-C)ls2+Ff>&MJrfAL@_)cy_j2HobZujbu5392tg_`33-cKw#Ow zo2@;@p_f0smzLgELbRw za~2Tzs8V3YoQ3#!d4F&n|FDXBrdg#)pZCwdExT4PU)q!Zp|$C9(kEwr2jL;ycicHn z{vW3R_*F`P4|!X&svX68ScnQv!L47);W_u+73)0&uIp-qOrhRG35*0&Q_u1ltp1DF z7YGDiwyZ}EJub!dh~NN~8xXjnm#cejBEGl0AYWztWRuKJk(5TxtjPm3GB7k9eW&JOMk<*2DG%uhrB7|q2W3SvsAukP3FY$)?I zUwR;w>Fce_&tJN9zPW5F*{k@OePn0K99TbKak0hnz&;}Hxb-K`Og-}_cL9K}yz(pJ zKl8a;=_$Lmm78YYtS>At)XD!s)YsSN_6Y*g>pcZ7u>>k0q$(AkP5}U3(RI1lsDx=! z*5k%S0=ue8ZEXC&_(^C@atv0xRkd9GYTg3iUg9N_hlPdns%MrxSX(T(G5(OS2?LK< z_2tzm0NyN{`Y#ee5dpJrN@OT5b|~Jy4FnJbJKXKiYVTMf04XzFXTYp>o6Oe$P%fuD za+U-V&+5F8_$nN)k_i(?*l%8f3=j~YWbi9rnz3G;XS$XLtxsJ9;ney$Nsq%zylkNxK;(0fFn(YPAdj z^@UZvxH8l`v?>}`L_j72c2Um-WBtp^kbEXYsHcSd8<;4x9|y}l z3fHQt!P2vmq`I)M{GWRz0N02BN8GHl9ZAp*po{Dl03;G0KyVN=I}fXXelY*p)2AVE zPg}Y*+eSgQ+dCck7#gMfLsV8Z4+PAx)}rF`V|Fg1#6n<_Kp-R1!6QF|l@*aH(jf6+ z1iW+S9fII|^KF0T)fxP^TIEYkNskmB;;;hhKaR)m-o5*$e@XHljXD7b>4ao%DH%`aOFvV2ChIo=`-7Sj$iyN|s(x;HK^yhd?5yD* z2!K3g`)O*&gKR5^SLl@h7TN)ZA^g-bX0^)^M8KfVKklrbhdq@M*dM>{A+wobpf!L< zVODrF0cOjb;6P%C6Cx-@KmY}Bdg|HJY|Vng*LR{C0AOCLTyB?V%Bo$~IdWk8z(9iK z35FyOyWT; z!g22Y{SWW{@JeIFAixe>GlM`Ao&#_4ba=X5N92v6CYWDuE~T6ZD*v(KnC?qZ7}mJK zfei$}hfu}!-_4FIsQUQhh7u414*-CB_EUWT_T!lwKUnvB1VFT%69Dnx%=db(#>Ypd zD_SW~1e{NGfXBr_;+P1qa}t33$5Fc=@#kmf=f91jozNjpd4BftrOP!_BJF2yLlGGM zQ~v*AD{AL@LBM!lujp@k&KK^NgzCPcF+iCAqKrX+gB-`FT69t3E)hfMY?~4^;nm(;mHl_fY(U zA8)MZ_r&1acatp!-2F2%AD@}Yb^FD~kDq!r@hVkc_|MB131bJ3TGmwL~ zCN;cd5X@ehzw~YA+bm`s;(-72mo9%>2TVQdz!XR|S$C)X`psV?%VnUx4wl=oGpG^Z zD2kc_1QEF8zKjHlSpF7uo$h{PhINuU!)149nlOVh*XCSdDsRMAWZr4@XR0al=$|(Te zl3lZWcNsP`5I_$aRCa;A{XAq}C*|Wyp_7dFqtdz6jrAWu%o{IhrPE3IzZ&nK`QD7# zfsF+AA3yTnrkkih04$$h&Yli=;km^a+}9<-DJ_72Ht~g^1LiNOiErn!>`z>}e98W{ zqC|iWd)9HL+F5`0PB(J8J84Jwpi_3Z;g_%rsiQ)ombk8M%LGa(3MS1HB5>MCE}rt;Js~E za755Dnt*SgU$$TizMbfRR~ZRn;8k``Q@69qQIaSK0H^@)f8x*oeC5V&U1E}Q+r5(3P-+;ZM{t=Q#G8=4mFBcGU> znnI&N`!`om{a02l~{;GkVL8-vn_G)?MMiS`noL=q1N0G1QozbBd4$@>EV6BaUhR(pTblx5_j zkmMiK>(gGGQa4E{ZsoO$;tc7VtE)Nnk2_a4A_{|I_A#~{=?Pt=oEB565|8^-WA1N_irfJZJ(dPXn-6Hr8 z_Gd|{6$BV}LOH+rDx-%?#m_VVNM>>FDJpgDd+5R6MoPK;brRkP9mg*-pqcy8d$Zp|!g?8dLcBfgNVZ@yaE;Lav-bUiiHoa+Ok6$}`PCB3 zPROjTV1O`SNzZd02ei@>2!Qc?fASw7KyeWPA&UKLn&lb-x8Hh0PqPS@=Q-5aZqG~c z1@iz<8xlY{ubbtk?-6;SqcgOXN5CJXrBC&jc#gmK?CrL7JCA??XEf=^r6`k+336mO zpYWgKM!p_8mZ0Fq`!}kx4fBmnSr{$|nsLy5^R4IJ%H)-w^@=SoTk4o}4bBLIW@a4c z1RY=E;eOPs!HKM%fF80-{12^C`nBMLYXp8wcMs*NOj2%Djq?s}^tJg=%l<`z#f_)42sfF>lR>^MNtB)x70|gfrZ6QlOyuo7+LK z^*ZNhZMCgW-*^(GuyGeJABYw}wY*LQKxzgz;BNx}83MrhQQzM`uwM^#;U!uverku? z-C|T!*5bm#B24?$+~f$~J>voaCL{=|tsBq->p^w>Ml0xcr^6tce(SAv`thHSch3o} zjnZMYx_nXEZl@i`DIY$OG%7xu;L=OCQY8gn{+qwai-7PyJ^r77fP9F0+qf*N6siNI zx6kf`FPQ*5JXOL5(QzDS5Lh7dH3E2`?NI)9Zv5)mI6iI)>{+UVHovN!UjqPs!Aept z$DgsMlWy_i?i3*@F#<0s!dOA+>k9fkOa^2q`eEn@+ z5HxOV-gy80_ixq{gYT&JtyAY6Mc%xL_Kd|z`(SNSgGpC&!-KZP=xk12Zjg{4j z)9)BbLGXz$FC~e=8=iXUKb^{pfTg#y)f7-Xg9pO5Cw9WL8Hti-h0zf77aEJoeqm!n z&zvOUH@N-BhQI*NzR{WLl!1T~C-rsI{%5D8z^0znR@m!1-L0s$wo@|`BUKyq=;Q5~ zkIUtClwj-cxCeXESqB8@XM+NYes+BILkZ+D{8lCTj73w}38f_%&d<-cUvIw-w|ZSm za^LpjRHlOb_D&~i@6>AB^1WruM%8z_cdf(!LZ^tT`TZO3w{Cx5R-riF1_F4{QvyM8 zT=t0o@IU6tV$6OE`ybiF;(8bZ)N}Jqkr&>)n#ppqCfxhm6uMOJds-2oiH042SMjIbEBt0_{LN^mL{~6 zk8eW)blwh2c>svcOmfiR76)e_1dN~D_qc-*H!^y8>Tx<8C-v$fX$4*%i>iMo?wNav#%J5bz0Z`GWtQ5=Sd0Gt9? z0cZj`(h4vi)Y|f-BrPCdXB*k+bj;wE=c3i^v1alPR$u4;3zj?-A-*b9qwPV`3djn$w< z1VF|}1QL+&Ryds?oZ|*rcH<|0r@VjVn{oW8_5&NX`u53}GX9hDYxT0FnMVXC5*w$` za?hByvQ-I2;7jQfeH0!mOcD?`Jg+#8w@bBv3$z0P$r}R!8<(doOFnQH1WdJKl$iEX z_wRJNQKy{nnt(;GwO(w=;@Tkg06^i%G(;T&;uqHZOX;ne)lN(RQV1ca z#aaOVL-ecH=S@EVHCmPusl5|LJLwdojp?cB&wqNOdpIei>sF(69gQ{d96$cK-<>Lr z;FX*d0UuZU_U|9ykPd0xZLLFpCHeOkT)z-6ECK;(fsK!ySy%)DLDZYpNxUpWx}T)d2z$jz0?<05UTX0M=I2o!`zruO8(_VCAyj zkDVkkfGE&j@Sgn7v7Zc-7-Lf9tblN*JHONJ>Xv{t zxG{Y)j)8zAb*Sc+bA3f4;J9=AGtXA$k$EyD3}tG+10K)=L#%URvr^*Vv|0~0_FWW{ei@jLNGyjqrKh8Tx`FzAHN$&;C( z_`!r!d!KX<0tWToSAOhf&WLNPzt90~GU~-VlDoE)`N!?@;mt{SA zIE)3@G{bZ(FAa%_`;hgMOYgVz_~))4qI;)U(G?;>zBN?42%9U@K0G6CPNfd5njkOOi7@p)pI>ex!vqV1h6PO8|!)xp7m z<*zF>HumXH8^kbe+r9w|&^Lv8KgE+09bhgG0Kh=7_#pcwOqO#;1jX4j3yVns;>1`B zb-{pmC5=rWjMtHC`6G!J*R&0w6Z;+e350-N5_${{2hiepJ1@}vgA_cdTC;Ka-DdP2=r@v zm)!xn1C&XzHl^&hx9qK*Ey)lNiSxpOi{s}H9+W5yVw%E#;Rg7RBXA7_@X>M;1lTAd zz|(>_lpr`HfL9qyKTZPpuYduaywDAZm?VNumhp9fK>&kHa=2ZtYQIFmNeBJIh|fdf zzml|sBsm_9KY7FhKVk2fl7R4b_vPNywG`J!1BRaK;@h@mu?ORovh0ar93)2P^5YUk zuR|{DP4k>akwfCoE|3^50SgOy7BhV&NQmy9J4{GV4CB%y-h70AAnlP(bW@JHcU$O# zhLe61#BF`^r1#y)(XPSF4;tLAJmWYOuEN4k33P)AO+wKadr`Mjb2^=_Q|s(Fy1Tqv z3z99Wenq5_dXJ6!>!O~#%V&|?T_vNddi|A~X?{>jW)%C^K>E?DU%sqMsbJm6rqRS} z)kG_TT+bcSJ2M&zI-MXV4_RAfkssslC0U9$IQ>lU%rn7hARv71r!WVCpS<_pbGl?) z?(8c2Ig!F{C*tbJ;Z`T&+My_uZLYQ4+4>*|^r8{|WY0-mlQOR^;*diTpk0j`O`P(Y z-SA+vE56BTmf?Iq0Rd3FdpIk%wd9JWO1p&X=$?AAJ zURy&e&XC{m{2?~J38^x#z-e z_b1(-y!Ra6k9$bEF25U+_~doy)M}m14!4koVL|?HN3~iv-K}6ZMfb3)Qc8lPuJ7_D zgL!+WSHX*AH|$Nxvdttqcg0_kr(}b|!AcGRoQ_y26%QM)B*3jxWp_gpWLaCb+a z>;?Kk#Foo1Lyr&$>2jd*%~tyTe!SN9<7(UVyQzjh1SSTNLTuF6*7`rkhSy;0DRQ`s=u~otbj(t8}bT6nGpc4K-@cl?79nPhukaM zmV&l5-__p+e`^Y;ino8}bmjEB5CNy(y@NQXGAKuB;tg z>uz-%&c*LWK}5FJz(xZckC!Y9ur>hcpvL9zh<(-wB{| zMn)P@cc2xk`)@CBwow%Hb}h-3D9lXS0u-0btRjsxaa6q3H07Kk)lU@n{1ad8BUG4M+q)PT7)?GokYD0pf0>dry z3WLg>(*VKg${mDs-$RV)_mIkSKfyH!7g-|&kLTW^+*pC%-3G7(Wk7AGTZ_V44G5?O zVbZthCE^KW(;fHNtRt3Pu_}T9uI?=eNJsndV7D;hdKD+#`4R%<%o*bZsUT1lC^h2+ z^<4KNWna7ICOd!t09FSzpcCm8ZTP|sAS4J{twe-3Z2Gku$aTG9r8rse5+OhV>)zbC znegpWvw6PxHZ*|v42lxU-aIyL+cr-&)L3zckW^#Q03qIZ?X`_K4}wR40CkdMHbVNN z-9!PfFl!+S)a>i$^Xp|4CQLPYWkpXkiI6!i?~BsnQFm+T&!4LJMrlfI9&f zVRY_@eFe6w=~-n3Km7^3vZJiwKeb>NjQ~X(peEA0wq1kXjzVrM6$EB9fkVN`WClCP1L!GIb*~=VsZ9%S^NjR-2 zR-x^N9U}yyZJUebtH|bKNC17|+O<%`zEBVVF%U%olcBbVb>i=3_+AH0kC5L zz_}imnm&*u_xFDF1h2>dGE|nzB?$u9nT!((acISrzp)l;^ac^Ih#zj$;=}GA0R|4G z7Jz0wWUwa4{@AAtr~%*+0iF*LAPDHlM~-Y0ce+wZVEl38UzU~}01*``!bCUp)*w=# z1>QYvRoAR%Xahh5%+y) zmpcwIc_Hw>lgWU}NP*v5y7~*YV1xpp5^w`$Auy^?7(&a`_(7d(*S7OYK&c2qE(ORL zxo%{D7eV*AHq1!fR1PDkz(8?DSN%ZR9jG%ajZ}k&*KD+sHaD*^0B{_zy-C+r#gW7i zEIUdlDX5)qJ&%&6Gg;EoxMY@HnrB#eykg}CT5SH)diSzH+_B4oqz!2Je( z_}2iC7GVFOk$zXcsY$-tPes5Qglg>D^N9rTlqdi_jTmfzWybAg2b|4;G;35)zg+dXnL8i}sfB<%;%tryo zqoB64vmF8e+IDZd76gC?JwP7`jf!rRYJo}x>DVaL5yKEuLlOW~MjRU5PPR>tduDt4 z3`Y|aQud9OSrCB4>k0p9IfhYWDnui|ERsfQUNjCN75XvcmP)tCYM}ai_%%`qz*hqV+*qW3!yV#g z`E?kUR1{tV(gOEb-iC<($;{v^kir-jx#pRY-2%005c8%ZZgJgo;7sgvPq40FZu9 zt^YyL{(yt2K0(z9*R0d;29?v#pf!k)=Y9&_cTxYl@0mN$2*lG-3z!kM_@j`$3IZY! z0I;>Q4W&c#PzON(Oly~>(Arc^W*1QV+jhZ8IBZ$~iJfk9K@QI`K5OC38MkxBK9d!C zSPN@FaS9L^w~+H0p`9Yjwg=K%W22re*aY06F4LX<65q@EM#n-c+{Xhg2G1KO{l2^o$^a200^HTZ#>={`%X zIUx>{;_cF|wU}SRsYWASgxr-7+cX9BF-IB!RasC|=|%uqzlcZUsJ)<&RUd_9Ue5r) z&c2`*zmWlJVI{cpE?O2iCWbHsfCUYpJrsXDCVh=C_ISUlb)~mi*;}ClL(8^nTQIdG zN~xww(`HsZ3EWpvI^oFjV2u?Dm63$Sw#Bt9RK@Uzvf8nn#AE}xu=1BP4Is-}<`J;# zy5$udN2;I5z>w^}D+$o-sMiLzW{)18g za6ubb09iW^`U~bp&B*tAt}Bo0dDsOHxnmKGjDY<-!x+#HXf+xDfDGRYt-!ysvLb#D z8USYCzI~OE;-mmT%AOp8ld**x_|Yw1T+G%d;6)wXgz%-r&x1rTS9J_};es>u?~0Ef zoDwAdDnFgYWeosjgY%wkd%o|p#Bo~(#luBp#0W%0ZTrK?4iwbfD5AW!xi1nEB>zvJ zcB*#*Zp(y+*f9SQQ8xml>a!?uf_Vfqv5S$p>uhzmwt(ZU?T+LQdU%WJp$x%)2*9>R zfKpzYC^se^z{kah^|N(UEv<0oFZN^g~O`tgFXAb@qB0LY?)?_F4FHcAN+ko+fum@Jw%N7{bJ0(js0{%C9|{c);3o*UXbJ+hcJQav&h{3k zk-)LFBa()_K*)=PiC-QDK!`v@Alg|>5Y2z>C#M-l!~nhe`iN--=)2SR2Y+g{8r})l z1p&R+B}UF`l4B%3QmPJKhPR|K#BTz!=i{`e37{$Wzz?H*<{p50^M5ai^wDJedL~*z z)BrGgk{J9>)D(~$bo%n*FqmL?X;O9+YFmG zl#}Vz`(F*|3dX-*7d;^Vt-|(=*TUS4`P=e;-0e${|GnA%H&)KHWo6=f}qNOVi{P zLzt{jzr&p7TOSry%P9uNXYu2!9D6(ArEs=05$a`eGl`R`4-&g%;9d6PNq zEtGgaG-0wFHf9h8H9u)S`Bt;BxI!VoH`QPtvHDXTQ0vI}bI?h@2?wq15;l9j=|6;2 z#e8^1>VS;X+CR8|bblE%qZd0S@9h)O4$Qbz1o*4FN3BzO;)&n>%x6CH+s8*flYYr& zS%-h`>8JnZed8h3o4LL)-)|nAxXj{7DfV77u3dEGDjE@C)fudEh~g^qXRhQZ`tfcp zfXo}0q1{4W*Lf*)&-IGM7CSFweFY&S5|R$^4opFa1TZuMK>|33lukK->z!2TnTKK=Ap zzxsY6RKWkGrR0NpZpM4?(4mQ@`P!QlZ)|vZyzqN^&FS)0$XAbFwQP5S;Hstikwacc zY6ulT82vaIXwU@yhrJM(ypn?e+9^`!O(mFgxtKT{W;`;Awv9+gKgR{_EexOn&~B>n zzeYAA4ftc)D64m_UZh?5~~@IT0@g|L0s$>RYp*bBaRmjx8mWKo5b z4(FHF?pWci?yZY?2#oxrQ~;p4-|YecT}lB6e{vrnz@IQo+0)7i!blJRFZsW^vGLk# zcM>Tu@=vFpn*su)J4Suxx50iQVB|CU1=ar1^3$NN{>}eSBVeJvv~>Q`(%Z5;Icmk@ z2M;|yF>!e!;eXuZc<5{Io4#txi`(zC-+AZ#cv7h{gn!^p4hBJI8*0F^4)k+FP8iju zeAs=#H|qR2oo~aM){6kIFqw8ElE8AFbP|&mm-i>b&G=0x>=ZdX3_&S=p*$8q%6#~T zXVxJ9h5v8|vZz&a1qmsd0T6RbmC6W9s{c@82W|)5j%%l5FGB6@$my9QndlQk)vB}B zv!NQhwQ>*{JThZhPaiQpu)lk;r;R;waAeLrUWJ?kXdqyzLCt&qNra659cTf{13QKQ zfCxw+@Welz0zC%|@V(S0KQl6N{5VyB?w>n6Ixu(yDgYwjZ=NOs>I+Q>07761($MiA zKlJ!FzVR220|A#A-)%OD01pro1bANT#c`YTP8^p5DE>h&a5~{OoG3#MnYrBZEM|k@WLy%R1jv{jCx8k18VvMFzmUXV*9pu$@D|C_mHTWmO^np#gT- zLCgTu|JOtUyiWvt@(HN?&j<#90PtLW@`;h(1^^5KfSCQ{KmNb^RRX|WAOZjZAfQ=y zd{qB$JpPUU=Qkd|eEATURA~Ax7>=Lk5dl1F{zDDKS^{jilOeT$wgC=+|KKl>DLE$p zwG_B2EYP8VZkW_K)bWA`zS^mt&_m`rCWO7~LikT!G5o(`vC|WdOoXUNk7y;7GekJF zN%lL2|6n=z-%{2}W3f#c2gvJ@>P!THyVq~zB|zAo?QWZ~6hmlIGJBn0^1V^bU)sT_nAKqvVxN}vm|2@$6#vH7RPwF*zzPEer)08FGk z00k{N;0|QK#uFn?92b2*_1r&2)#n`u8UgzeOr-$+4<0T*{d?u#dm8*NTW-A$04xvy z=a=fr0skKd|Nr6}-*|k2+o{IB>o&=Au9>kBE4x@E|H1rX5k`n}HLODVd#`QK7L+$s zs7lh+NDqZ$6rr6c5D2;HttPpi6gZTAPlaP|WyTFC01rl>kr6Z&1Y7BKOLfBDCNWyd z>4O3i5s-ZO;kQ@(#gz;8b>@{geJAprE?3q-(gKk-RwfzLoE;JTOq<=^807i}){Mg%m0 z02JIoAmGsBfANjSAD7*9JA>oo}h&WTetOaO8pHFMH&RJF>>N6^Af<%ewcy=0nlZR0|^jC4&PGQ zejIx|00QI>?k5KR=}5wVgnjapN{kwu5El__K>#SnwxI$#T{KHr&2$L>0W`sEJCHI%imDn^g8-r+l18k= zqL$DON_jPT#dOl(1{jy{Cs(D;n|7ZN>Id+jl|N$VnE^^~1%dr+3E~7O=%5z2xNohj z7!iQ{umyJD&;gMfO4R~rBO7W76qNB^?QXdYEfC5=jtB|LX!K@E1x)}asIFCU#RS0e zbo6rd5R1X#!K(@g(A^}+O&F9rw{D@5BirzngEIb+KilWU+?RxA0YR0?*yglums2!AOJ$(&_R72mthgJ&RBT|CMg` z2^C>*NMK5MoN?_*cy!28Po_lqexm{YHwt`T;lGqs{{c|}5OI1i(QGS-n*aewU>qa> zenNmdSBeMjpo;79n#Ko0%8((9B-c?a_{X1lJ}x9I*M6M@9UvA4etW%;sk3}pK>^gB zIE5qzNQ#~nGp+xIU}7*xBIhpAmpsrM1VGRP<~jkD-NLANHXJA^oRxxf$2*Dupb@Ae z=>r9UNnO7yiQXhNA>n=�TagC^iRdV8YDjgKVH!vU@rXK7dfX@^D#wLvrE!ZlTa< z0QT$%Vs1t%oVw5tH6R)9%>eEKcl7ii{T7m3_CmsN{u>dm5s64>@oPx|J* zgb2qxN0dEDK=kJ61E@%LaU>}5l6W^!XFSAH#(##$=|L%FWsax!XYa3rK3aZ1ly)cg zA;}9f0+_)d6O^ZqSeo||lh36A3DD#J5DM5AXk1zp00j=ML1Pi74s$f`n;v?6a?XM{ zO)@AHhq*gX8Yn0H1qssSA`j;3M<&?wxnY7H(l0av+aMh)+LLmh_4M>lf_8cT!SrD1 z^)#XHOZSb{kblsJrIX|)w|5U<08A8%0fYm14i5mqqXdI#>>c8=U?^PK09W?Bwq=GU zHHPKWm<&o*DVQjQz`yH_jX9ngE~;UHz@QbV!C-I@M?OzjPpwR=&0r$;rJbgpfc6FB z(9~|P&CcdAkSk&hfHwEV%f5cTms+`xdv|qVKgf8>9&~>dwtLuTPulfNNRC~54QuLc zc;$O$8fFDDolx)nd7pVuWBtd;oZ(`ziY6@CT`W3BeFzB8@rZz8(J!X2%qy+VMMw5BDOVCw=KcPsH;*{FV_9w0M#d zVnmi9PsXUrU)I#g_ma?#ru{6W0bmkHXujRf?`?rc%Emwmsp?e~$OqslxQ`rB{46>p zSg;W{1tvvzJBTu~?WcM=#`ow|jNqX70)=p7P7AMJlr;H!uKR*)k_yYp?#XO8Y z6m1dgFITxMm=pNQ@s$@qsI&cqieCc)Dif87(uAePkJTGzym8k(#$qli2i$kS{XxeW zgftMr-)Cxm+SG{?eM2G}4_9?7U(f+b#GI32g&c_)vlIANU7 z)dD#AUBeF%0En8!=2s`7%1Q`aSB}i_O6PgyFSBInPZop|Z_=~}F}Y5ps=3zz^{jvc z{hE|sQ%#nAaFnl0J8h6p}vR2NogSGs^PybHdA%4rhCzX zHh_S7UC&wMYOY9YZT3GJ1V8|zQ9GqyA0^vHbEcg~K&(G#)#Q4B!&O4!yEy1FiLd71 zVmGW}=y@Ez5UTnM?$xV}*iZP6OS#L|c8Ag3y7ot&-F0jLE0O(OykqBJxmrr6fhbj* z_dAKVwdsU)x3%d;rZ-Q8(P(uPKisGXV8g*9t zt6YE2_Z=JjSNwwlpa$Sz>E-#86#~F}esOWJ@tAk4I844${gZ-E01J3`TlEbO=`IBp zg`AR-6~U0o{_4BNLE5;;*hIkb!9ji3+FUwg0IvxUh=cv|e%zx|JU8}Q^5Gwe^xtv(Iu@07VeH@pytU_GP*t$yAOkQ~Xo^;|CSMo2|mw_>k3abEbqTBmqEDV43dDi_MKC-7#k!Pb8(aHkAVaNKc~| zVGaQxZcVa1exe3M{{sQv#cR=z$3ogh+u52c%65^>u#(+JjQ1;*DY@0;C*=&(?O2<3o0cn2Twu4&DH!E91eH6mTtw)Bx>guTC`T+_e zKxgX6Xp1NT5F~=tXob<#NGgF=8&1f6ne^K^VR@tiuO%{(qfbmt7eHg>$H2+TqFvYV z$#X!UT%7cda*iNOKp2BC1)&5007fa7pN1Bp5=bO9>VIIHMSDsUVQK!Q`Ipa5Oih$v z1dbKYPy(DecEs4!OOv-^jghY|!-Au<#GE9Y=x0A5Xn!Nvvf zUvqxyxL%R?_|3Jc-16zjX*L`&I@5k9-fukCRSw>IDsKp&_J7wnkpQ~)$4eh zdECHv;+H#6AWDDDN6}v>@H2Z=)dJwi;C`E*dg1ZW5x#S4HzXap9I9Tg)02w(&nfB3Hg zAi@H$--r13;Y0f`fDSl0|Lx0XrzfZZsAFLR)X&sC*QJ$jEI=MAwv?||zZpAXfBr^_1@AS8q?FkWlHy%3uU&pOKj?&!}m!E)h0 zqU(iqNpiQ9pF+{W4Mya^{#X3`GqnUEKB%5xNw&C}Fk+d}JX^DD@bG?sxzSKYHa47* zgE)l;lPPUMR1dZ@1XQcMADQ%8x=i64P1WqmIs`ytW%0*WeVw1Uga5h>2yROoz@hz5 z6#z4UBEdT9u=*1O0ULcmkqZl#$$$KVN2TxtB*59q*@)96P!EnBYt)~wpE-7HoL{Gz zHedzSA0{Su1$t;`Xt*%sPfP^;?ABziY}$c=nZ$y+r>5%%j>Jr_2ri_dPRQzsYbCLf+eqqa~CSSJB>(2>Y*9`%P?NI5pheuW9 z1cAe$ZC-`|ID+e~%}`IE>R3|;b$l%XLaS46gi*boke$R4&IEBV8g&BZO4EU9S8$DE+6KpRe@hiL{v{7WD> zPaxn7;XgGsIC9){1)!C}Q&1KGaClT%GvNQIvIj;D0>E$i@GqgORnOHnAW4CzL9|W# z&4h$*V7p$10KWcQ3n7L3Dsr8kM|p< zbMXkKmZKG@e_8+vB7oJOOfObFb_vlY^k5I58Q^)o=M)vp|1u1~A`Wl@Fl+{Z00J?K zgA$ZKT7jjr(=a*}Ob;{x1psHcOP#};2%CY+%>g($(*ab2l?`U3=qzwTD z{)3U_!)0j*{@Cz;Y3XfQwnBmZumo*;@c0xOf-p^3j2wI8Rq`JIIDGg~RHglg1psIS zxU>W47D9vGWBcAv6bDfZhNc{lDVT05^U)A&#Fj7d`4DqCN_!ExcN8svgokJcNKZf_ zmf3o?j;1ENRFQS)o7ScjkH)-Y6Vt^vWWn%OlzOjpI8tLK#dR-k9vB8`Ld#9U`=z%(ld-V z4tz%${#Q!u0xAW-03s<*c~Ampyz%kIV@2|R(D?)~5YP(Xx7Q-{`>eh`NCGpDTSEXA z1sxFoKPb}>EbBF_6uSVdi%Uxvv=PYq59Ln;Km;HI3`DJzvt{jPEH(4!;YU&Z4?ilm zpq1z1m-IU-Mc(tMQ{=`NQLZJ3_Ar>4nScPKV%x$XMq7J0K+V$ZREmq2C|NB-^Dt3s z@BX7zwS255m z2l*5n;!+B%$3Lg{FvLg6IFA+m;o?|v7y<+-4_1Hz_6V~P5TISa0nI)&WcLGt92P=J zK?Engm@omw0646hQML^W@Z#GE`%$=S0)XSkp$5!&0MMD$p8bar=TVA)8Nh%c>T1j< z#hTxE04!qSN0*7d0Dp4bhU}vsCwSqnR;y^M$(dgHTA4@2(*7cjHfjzNz%}GrV?b`V zt4Bwfo+Gu;w%hG_@y@ro!40m%tmgnMEC3<^*N9Bs$Nb?;!yiYz<_9m}mPQ&MG3s2C zg9rV5b3ZJ9@#a%wbTk0gk;MA?I@&+BjQMG1qLu>zXa%w-00{B+fJwX;%`v-k^ul{nZjmx+HpY_2JZIi{zIqoDey_ z?`!8*%jUYt^+j2*>b{g49@Av!5=ba(r(4&Pv5J&>KGh_ctbCYDp~Uea;|94_H`gk;hmuaLggmnZU7CwC z*`jfK(t#)RIbwqW=VV2}2c}jFGCKX5Z+G$G)%`4p121vCo=3|)H@uy0=dH;tWP8$q z^w>>So(Skgzy)o6BviQ83xFuffrr%JkAQ59J}JP2S{Hi#y9x1O;hSZjK<=&$Ogy>& zO#0B?^b2MQ)f|K#;bx}U433y9Cf*+bqoX~eQ+z)Csa@fo+4Vlznyo_i6Xtq12tw|u z-|bB=iJqHE?jAD^O|WP^AU2t#&}Of756xf9i-5Rye48P=Zs>{6SBcyCfOfm+wexAL zU+;Y-SZc-vf*~2JAp1-K+217*6yGt(t;Q{BXX$&pW*O}!#CIHr>%fB|YbT2HA2%Z% z+^-hS+y@{@ZgS=Oh?IHCz_z63C7nNN!iw9&;?$I;r?2bh>kV-=^5B zMKFglIx5U%4`F!`!5Nd1)pXRpJl~$l&tZaInGf?StzM58vuTESHqffyR>*UU^LS(9 z1EJAnCEFFqWiPiakSG- z6)5U%oL`u6H^rm-<8nDE?r7VJJKNh?@sHQXciqpF+sRVOu~&!-Zacqyx!txs^$4T@ zgW`6~erfPC5rS&sfaUvEih$(#iHvK<9UCQ@W?<4Q_+zN1`jLRX%}qGrx+xV=FxDbVr7aOr1Tyqo}{~5z$ujs+3 zAj^dm_nxO%F+A9gI#G9fC$peju+MdS5KyjWUBhiIL15g>46qJ$9;f*^Q|JB0LyEQm zkR<)~c(LHZ49MPxACKAWj-UtS&qf*fnSfqR;7Z$10nl#8cz)YxAc0J({z0}^K>b&# zT8tHh3ahYL?ADHpMMy~mNO{2ii#p%$wi7!rKn?&6Q#UmEJ~Cw7Bw@eTN+dvg9tG0Q z%u=v6bR6l?PH3gRn45*uj^q5E8rGk4#KXzO_mTO688BzW0@u6{pHQ?7{zoZ-F2oM* z$D3*q5XBAv>!fy|ca6($Log%&fB@jvt;z80c83gfG9`XSxn~Lriop00wR*LBHCeg| z8M5sG<6&k3XYu1MMvO`wrm_|qvMNRmq zFWD|x;5ffFHy%*iZs)e0^@@e@Vhfou`9Z{W4=4l9bU+&w3fD~z!FPH86ahd^>^MCL z;O5n`M0Y~a$j}1`OWKwi7;R^Df}G@+&{-XK7wgafnI!}pB3A$)R0-!|vgiuQw+o&D z0DfG%I_Y^sb|?XMvgOy2U)gFxzhJ~o9D^`OMQrS$P9U#Iom2g21LiiQX>XH(i9G}U zFQA$xWWPLFn&Hi10Wf#pRY+x^2^k$ivh1K@*6@x{Lp-DRH&qMg!ukhOOTU(TquFm ztU-;koSuzAv`%J!E~#w|KmzCmITC{9kyUB8?&@7K6T;JblnOKeOn`I^dOLDZhMHeH z+=gF&jwyZ+>;u>>ZlXkB(&+m&hr@^(05)J^gh1bE0b<_ZK>q=*$&gD949q@GhD3qU zyO4jI@?l5-<7WK*`|Z&b0Vw*;Hedi}n#QjC!JssK)Wu$Lh9*Ei-hm&28vqP+!_jg+ z%CLNnpILze`}b!$NZC&Ed?BD63T7y6me2-ZfhRVb&1Pu9YvnR1@1IIQZowlf6iFY`%U)F{&cvcnU2E}k6@aj>V7 zmWd{mA@_1i7zzuB_h$eF{|n@Pn*W#xNxfjchya$VrtR&pmPW??3t(Vw^>wRStQO7m z8=?JWK;F2)b@npB6a?vN$NObt_>_9m*SX0N_z!`MBGw{cbpNQ;^~$-Pp2x`h3;>M4 zRWQV(Eb`wxpZ>|BH{Lg7dtSm)UE1KgFa!s17*#GOf_vW|^{7zPwaWxT{Buoz?E$Hv zhGuq@N&pMh-ihY1_0K9B!k_~cCA~>=>YKmOjd>2Z4LzF0WfOW z06{{W`;qSq*7xU>0Mk!fRXR7uqe+AtCqpq?`CJ!qNEwJq% zQmK%V7Jx8GsMtpBFJ4UiW_l?Ufj&zPl*#}C#4vs`t6wr{yJ)=9ExFa|4^3m9@G87y z5P&Qy4=krRs%L1>iw$zZ5>J@6kUg>I&D zFp2#PI0{ENn&i1Sm^qIUj;jcemOh+pY1+0ds;=W(Z{uKWK=^s$^6X-#vdyZbNvMSX zjPDk3FqV|~(QLN8*vJgVR?Gv3tMIr2uZ94%6frI(Isgb@KoGcLh?ZI+?_AKrf}5m< zjPrX3?E@hJK5xH{V0`j+<_6whUvSUpt^9CjXSBJG0$pHkc0`SXzIVAng@=)yrNqqA-K7iZbm}KRK#=()_tZ0BRW1PjWNPo#U7) zUJlTdcjdP!Ft2&p2D|m^BK9yIHJs!(iNF|pKHnW11wr6rw*L#3b{6p@?Hjz38R2nMR-f#t8R{Ox4b^8B<6#pG_uvO{QwgLp`*yP1NW3*qQaO2|ciXb+@Y z@e}~bdS)43D3uhro09;YIZ&^xGSQACQ zilAikU++g93Vvy&38@SDHc{Agv;6rNkjjBvemfE5bK8&1*QI{D(DdD9T=xrc3OQFd ziPDA<9wBWWW9Vj!YM}a;N>c&Y z+JwSdVPLAYZ8PAVRXRQ1tqB=Vx^2u2W5;5&5v5*-`m^;sKom!oVFMceN88zGf71As z@%u9if6Fo8?pc50u?uJIsAj!$7T1sxDvYv{@o9F0cmkLl^^Dhp^z%b4-U1Vwk}Hhg z;V8I2-|ujqojKX-afv7}-FHDe55!6Xs>_)cZbFX6jqr8B#3DVxFWW3u@Jbn!S$~rc#U(@Xy^ZH=5QtX8=|Kkwp-A%v>0@!Uk z(%*JQVK&;IJfMDNajChmu)viF{n|U-+F3g|+kMA>r;8F1aY<~N=?euI>0Z;kzb4y) zVPxDw((GVmqbJ(dAMK(K%-aTvw*#kPFu<2UDlfWF0J&qDyfIqxVS zfZL1a9}s(8NQRKjA}SKqw>U-D5qZKPr%>?IP2JF9aSk3>JaFi7t>6RsJjz$0?ja!+ ztioa;8(+8p{>bQw{-%)ZKQMBjpOsqI0ko&LBfY-3MgBJ%)^@`kD!2`T7xn%Cx4N`O zoD&oQg!{3@_0`2joX!FtE4cd$V})2NDzyKKanX&n5stTuI{ZhuY9U1j$GeTkDtJR+ zcwb@MgyXH@(S9Li#-oDD(s|663Hrl$wo$j&?Ysb{mI9guDjHJXX%W!Am*9h zt@+wG)v*2sThzucLumCendFC;?^BwXz6>xRNYTO!e5Xu@;Wgq9J2*u$TG*z)@i zeA=-d#`8kE9mgFGcIx3-e}3E<9|ypFYkc0f0`On?wiEOq%yR%KKmw3C5*)Ek6yg(8 zb50Nt0T-;Hp@zSL`fMUw2M<{BfrE#9?ne-GMD*LZIh7x_)rh}u+#naManI;hGDz9| z2l@}Pk1>(R07i6%A_6oD{x>Z=&qb;DqT@$Yf6$E%SkA}@MF4y z4)D)OGf7t&hx51F8ACXm;L{KHKm5oed?2+)eQ^Lcl(bx>?tElHTutbkyS zWgUH10rj%y^$tP-SO=1~Z(l&vGx*71O8^A`H~8;Zg_1Ab%XlCJz=2PWoS3Ev@B+tg zHI-XU1ORT_fAlEM=~#eO%*_J61_pDpRxcfok00reA3@vF_+4cc#@S1y$>X^H3SedY zd~?q4%1@a<;j7S2zVE+g+fE^oH;BLBx(hwy?-0a5fJUp}NB^gKRSL-M)dD2r)-?-~ zNY1#%PeZfx`68c|O>G}0Y00NvASHRAZ#jU&0kqH#rU1~};HHgK1|`v@AX@}vLL<-sxY<5v z6fRPi2k7z;{#y-KLHw6a$cD%LmWp6A9B!X73G2kv3FpL#sUr|=rly*1NFkq}eW6q(yZW*q zAU`o(vos;_C#jKk|3M4?Hu#yoe<8chCII-qvhFnf(g`B~WXil{Z3qDTq8IpHqY-`>jVFDW$KZ#>d< zye;b&9Fl@6dT|`)YBTO|d&b|PEK$BN1yTs;Uagd2hz~o~6ahk^T{r+~h~wwE$W~P2 z0wLzjb$rwkrf8nYPw%7LbPaX`q^}o+UB#M?VlWlnU04~&J^O)#ydtcCGzVzkx?Z|jKP)MBzT1yv5@2XdmVwE# zJYML_0f0g*l$8QglALQ66+E`XGX(=ug@ye1J@}6r-g&3n)VnyD9#uLu6`22Ik|Dyi zRLu}zcx))zhBWEy{_+D7AWbvoR|ol?1lj;8zvgAD44PNE*GQT-&~LgCsEf2z`uBP{ z3$zH3tW5x98HVfNp~tf=spPpdY0b1q#&_#ke0e|fdZ_vRFj|NJ5+lLlDio5}9~~_* zIobez$vGj}QIG%!*b{Vu62L0@s4b201y77nMnLuooYIgkKMm%q3;;n`P_A^B2pIsV zk0oU~R_N>Nv-*Z)p+M5m&=9m{_5#+}kmK}m6&xYWK*JL+nHO?FzX0jXnV#``3;c%w zc;_9h1UTR!!6q46SSVj0K%S3OWs~(D1TZ+s?slyM1k`#F(Emu18c0|E90K|Z+5*&M z%R&$|0%?`%)!$&>pdFXI!c^(R+`rf9@rWl6p^}Q<(4ofzP`6u%s0!)c1J19~LXdf}d3y(aKsLXN5d$7EqZ6p#*!l9wDoK6_(bGTfn@o7Tl zb&~9TP)bE+vwnDb$M0cnbx>sifQ~T((qRobyY85@kMRno%#w`fpNOd1w+#UhISz$@ zfiy0m1t20oNV-Ef30Hf`|MBOKJ)gdhFA_%j5~9GY{wJ@JtT8fmqBJ)(m#%2T*acLH zM6JVr;1EQB@#>5*lCc8dMASk(iLc);MSvzSRkKS*t8>>!#rA0oK?IyAjq(-gSN#+L zCmiVr@Q!(2z2Uiw4O~Wj8bbJ5JZ2}(?|OVUe+V+mb~FP;&dTZ6+Fau;~Heg^qDlaAkO{!;^VJ3xS> zZpODHwxup4Vk>w>DbH<1i-@&KdgP}cs$P%Vgmru3ZxHy zm_&#WNQQ;+IEB2yR1#Q$Xa=4zB0$oIjMN?w{RjIG9eg}_9uB-)t^h*%HkoM*!uxp_ zx|5I}(<{$%fdNd)) ze><5^APw__hYkq>c-=e?9_=S@3u%01U*PkSCo(FdkP^S#uCL?YbsJQ-km3*kxWt&y z8AO04X#1czEaG2;Aa4|+$0V3~Q35hwNJ34BJTDi+koN8N?@kW^`lm^u^zv8tijN>w z6TQACNo11oCHL?4ix;GQAmfwkIEz*JX}G@{B-65Bz;5N^hwnt}!}ap>1P z&iwQwHUMvx6tq{z*HH{f3{vVf?AHGDdg9|X25R<-U(Ryb8ZC$AvNZ~HjFv5#h-zd_ zMoGf=(rt78uZyCt)4hG$>8=_7Mw$yTZlNWNcRIG4_fgz(nuS7#KMv5I6h z!+YqwIcKDAAaTpR99ss0v`@JM= z7iw~fMuBEm({F|kiU4qbVc}fbRIOBIIe9^H#GJyzwFiY|6&@qRNcK@Q4?e%VY@U`b zc?7HkDAypU)#5nrbhmg5(?HV7+84?;UA{9hG4a<^Q+Mx9S;vi~xi=?flGRZ)X`?oH z^{uyN9qT8tD!=(3WjAKs1Dy5&kpE#=Q%g#QMl*`Gmjr0S{}82~ZH@ZtAh0;2NacOq z5DX8^$N(yS1dIGO>}M0llxCj)bmqJ;-7WBo^?#0g9Gsr3$kM7v&$pJA&Yyq#l1VnOD%@!|l*NyO zklf$6b8~I&_HDt8aNn}_4UB%x#@*om*}uPg_iXqlcc-R^Eyj`7jdpc*qg7XPI*~~O!YR60ts-w3+x&|+d%WTH>!J4g z&2FK&4uo-9K@b1amlGM0hk(DZP_H+iKc|;#C;LeN0Qnp7``k{zmS&ej!xe~!wXos@ z&%A5+-vsa9z68<;K%@Zrqf&WBt_Q6A8#mYFz_r+7G$?1%OaQUA}L{p-KKJ8?D) z@BYbDNEIOawr{IsBDr3nI9;UBvbgcRdM)|Xdbajn>^H)0*l1pOZ*3MPq33!nw+PFd zy}dgyK+y050y=B_Bu`@k(FsQJz`h7|*A#d^d1kH*>R^ZXM#!vG{3hJ?Wj>=;q{z z-)!n8iEg;m>!|(B<~J8NSC^24=062Ms8{FdLPBc(ckeQl3Uz@KROa*x`NI8XvkCq) zbz+3vfAh^}-~@&7oei>oCp#A;7{`(0hY+n1*Kbbl%%O`{H znlpKw{M}uZU$RbjdA8xJLZjQldtE5cmLUNOKtRj2+*;J)dbI)ouI~r4R@d>hn(8=f zY1bL-$~Ck%J2Y2+8QP2gK`mu4=(f{=)t@2&%pNlhCRBRL^XA1ryO~vDKXjsC+g#<~S;6D@D@1^a)7j2G{2~AA3w5?lwU^Sr z+5Fbx=H?=k2r8UPh8jaNfDyPuFgKI$-tD6J0@Q!VhDxO~S6PFdxO^UrC-;GZ^CDPK zt-~4+@QerpD_q;SdFRf?#{0L|0E3zZ1WX({bilGl_0q)tUr#uH-Msd;;XeicHvfdf z#u}U{&u~>|VnEohQ2k>$;u*7L+p!8EAnlX?5CC?e*y2zCfuLIr5b|h7fd4XErORy$ z*35SnFcEBJ zHu&$DNxzW(ckxWPH2;-?`o~W^U_E%b@mh?3@s?+2%dyocZ0HTS<$Dd!wF)iEUFB!& z?C@hVlZ%0p|DCS2T|>$#J8*HWqe8XD=H@R!IRTLHq=Ra6J43))jU($gYp)5aX*AR~({0NX0Qsr0Bi`FA^?Ec1b_(8Qv`x%p26ieE6$p; z1_5yC?WOaVF5bFzt0^DPiP#S-PyoVUhG+!b>B0t}HI7DEc*q)nje!`@8qF84y?yuX zAFix44FA~yrNAO8X)^t=76DrCLmof?s2DIX(@y1EME3r$D`=FwU>7r`Taj%+uEl^m z%?a>cL+y8R2(VO_OF&1k(`g1aA<~;%;e`vE3jq+(&dyF}=OQm_f7HQ$?h6d+5lhdt z7NTNLuhxJCF$$AMg0tC|7$LXd(Q_v>$HTP%*b4J9`-;;cCzbin?dZbyHiizZ-Yw(}+p zL23y+@BF1px9+qreoG?bHF>FK_>WX-@!A?hz{W;Q9Y8=%^bc@QhSz;(^yn-9`9I(N z;SU>|@;m?l|I!E)$b!Avl3cXseE84w-c*$%?aHX$J&2{&ccjogOxoU@s;Ajrv_ z5y&C7Ty>UYVelF1){v6`IWke!^p!AgMm{jXRBXOT8-NI)Rgd?x?G30nJ3)W~=apX3 zM2P}}9k{r<+JFiW5K;UGVhhrz58HR|{$fkdd#(gd<(auRw;=@}0YH8e2)Nb0NSz~8 zL-XMoY7n6yKs#{l&dob(aV=n(hxVZZE|>b^Mbz7)qes8;$`9{e-!#*(z>e+hh$2Af zyOx@v0uXIb=AQZx0P3}L0~Hw|Zb0Wz1kep`7CqaNj%=x#004V6YA`+!z;tUh$^nA_ z+K2KLdkwZCmHr3+sr{gf6cc{tS53!qWJ@qjU8b1qi3XyJYR8Z; zI^{oT4JjFm0A%b(n59XO7%|2zM4e`wLYd!RYA(6de}#hO8kRr?*kFHhN5KLDa6{tv zeP`jq>gKtubAZdU>Rul0qx|3A-X_Z!4A#%xu2k;a(KZY2Te{euU%Hgo5Gd;KO|~JK z0?Y~a1i=hkL;YuneW2f!&H6=1g8N5D0f6h9K|?MhzYqWp4&njZp#snhuvD_f3mHZM zpnXE?R)Zoy+ljamvB=~Vage&to*t+l06^FdR47%0b-?IooN@(l2riu{j(i54`jh0umn~b_Xqra5rI53JqPp@`PM! zAZRS(66(Q6a|x_(t>0X4dESc&MbQU5T1dW*UYdR^_OBSNd_q zz_Wt6H^F}0D<}%+eEZ@>e_8hgg7X5OL_y*N{@-CE5KairFti&hC~X~K)B*pG9=(2d zWyRb89?=9yMZkgE?E0$_ZHS25dkbQeZ(28;S+JF)jAA;wFe?T zY<5Z7?9@Oj5iv+||8C+9Amh{NXWpJmASBfrIow7o!?rsxZW&DNj|kk4QIirztME2w znnH3Vl7rvu8s`U7PY(Qo=gDg9u>8DKD)(lQ;<6_o0RJ-^7F06LdwuvnY5WDG^lH zFd#DcZC>&z<-OEfejkZ|06|{j>xy{dryLT50Mk-kgN}lrpb4N68Ui?S(?=lX+jv_} zx${)_zF+w6exK%|pUqhWnNC1M&;fV5vV4FRPIuNSr^O*02Kg|I1U@)OAJQ|R5Qc;x zAdG`MQ7s1FYuaoF1)C}VM~@x_-(KmNHf=fpQZm^U90=!8P)S-WEBrThVLT&Um_4HOaBjXsEyTjgxRKAil8eD#-}0OQoe%Fz>2 zfdokTZ(TCygkVA%7l=1f@bi>4y^>o^oqa{063PaGGMf3W*6?N&(2NG(pK@6MnSt)) zHKmC5E*~{KG&Gd0c$Uyh@=3yfEhOzXIcUPGm>FmHrDUidMbN|S-2|=iViWe1yX3mk zM6gzIGoB@P`C=0{IrM)CuD97eRd8KgD_A~mfFfaY479L(Q8a=Gp-y+_y+j)Q;=W=j zA@e2=j^AF=JMt=-E|#J|zq4Q0XU%^+z&wMtzjkp3@bIoDzx0w-`nB-CSM7cTGOSOh zZ*Ynxya@)BHB^`RS4r}&wTV9vbs*a9OG|FOt}DH+YQehOjcm7WTmFm9I#^g=m5FT7 z>`l1q*17s-9fgNmE-=CPg9uxz?QbWqko|1hkJzVP7Hx4ow_7 z@G;Iy2BH2J3WZ@ekpZQbUM`g^{C^bck(Qe74Ps>y9^8*|>%Li4(;^V+69BlD`C8RN zj@|kY3eijx#m`-qt2%wwXV)?_^L+>HL~8+!M1cU!9xkaT8AQb9i!ZVYBSrp}fELSI zJqN7u1{iw&r6%h*m9h7G< z$#3TQuXj>2)W_OghhR360LP(an_w`t9Qn7v?M>7|K0z}ccmO_7uIwn(OX48{vL=QP zqqy7&(SMPFtkmR4y(yE6fB@lf-SL}uIqFNoWBu*(1^~Q)iUI%_TgG!euU-cd{%qN) zY`wSh+%LAb!|sk&1IPmYHUEFX1NU;ZTmsk-9ESfqeHfW?g^el2P0>GBQFBV+2*0qt zz6kkM*ZfEAx5$4H0z|+e3AOsYPzxj4PtXJI#90l2mstHvlmphpgJB??)|ry=ZlNG- zpKGUZ0EPeGkbO280(z=AGSOVlu{_G70rkJH&+TJv*8pHixym*ls&G+PFdIy;7G*vF z7|C*kOkh1`aWERywsC@g;5O?x2?9VE>eeX=2mp9j!A?%sFZky#-6b+`onwjHmzsq_ z9mW9e<{7XVTdt0|mf!N~E|kEZS;1B}ntSgTJ3Ad10y3H+l@I^6F$ad^vps%uOdpvh zeCOdo0HEs`+FHDmuF4$R(-mU`X!6m_5lH}Wa`1;wx2*vpK(5O%EN)MV45E2pLkLV< z=I3B9(*XE3ZGe~ZhCr#sor^Q_)i;Q3xP`#3nNE;rd#ye3ilQ1*Rwh*<*wDNKH?FXaje2X-g~u=bn29lW2Y3yzp9 zajKa1M+t&(NL*Qy_@FI>FnR65<-+)tm|xx3TZ;U*u#S0xNERN&+#&g7BYJP6P4C6sJZ zxM2NUWo~W+K+pluT)w}&D5AgzcUewG3hdWY0OXlraWeUqOev~?;fb@f1YRngIPvX? ziI*;yN@nINX!_t_k6F-a=~W4ZkQ2F{teYhK_q?oY&GJhJl~bC|1VD8yb&{%Up6j`p zOt{z#JJqHZy?w&$KB!x=6vYR|Y2L~3z5)Q`^KCH2p$R9~xU3-}hzNuU2&YtY^MyLE z4e8XtQp5lP3NA$f_eCj);m^xZ2$nPua9hFOej9QFCSaji=bwcGuDF0^G*m}<)a%FG z<%_}gFS zMevu^oEE-smQyDGVIpp`=a(kHYQ5P!U&lXj=Z}H^QEQ`BUpNLGu>6Zo6a~>wfBK7^ zyIYazXc-%~)mTmhh#byN`DEz;0HS+IL_t*90OWrUv0w1Momw30q5X$HEd-$b)d=lB zAOJ_aC+mNcDggPH9uh_a|7i!%sT%;>4iEszAQm8W89=}+K>@J-Bj0r4MsG@dN4Tq{#*sVBepAc%a z=D7UWH!7?#`&lD&h?Tvtq|HoRgKP$SZ~+0R#4zX?E;k7c@iJu?+K7lnR>BBqzS#6v zSJ}{8blt_mqKHwp^j)e2`3`_F>-FYp6PEufYy{uEb#d(C#s+7djg2i_{6)AOhSBtU zumZY~S@YW-8$V|B6$$*u%b@N# zV5nue#U24*S-74@K;R1bUG4Yng9Shq z3*+?S%ydHi4+{eDGf#yT@Y2L(LLgQ9rGrk74d}T}!T=%G|C|g6;xM;8324{-RQI`7 zfb!fXZNNk+sCncwUmkQPMq5J3@E+_x!3GYT5Trxd&XOR|Qj-n>hQ$$d#dhH(V1WEt zdXWYo5C92)1g=9LxaSs0R$&pB@#t-|1%ZIVrlrS_+||wV=Uu7-f6RCNI#fV?dHIE7 z{K7h@a6a+e8`E>J0n#rovL%`5z`tI0Mtec#ZSyaEKO)~n0Hn?C5!e8xKfn+~0Gok0 zA#Pfma8}$U+SZj95GYO-0RUJ4(Epc*Bi#%v!3I1rAuWN#@Ke*uE=}iPS(I;ZjR&`A zO_Q04ZCTLTc<#Ahak1|zCk1Ho-0HH6W`ObHIx1-L+07oL%Px(s9e{z{Dh)CB)x9Y)dfPyvNLX!cqV-MwqgO-FcA$gu$7Kn?-S-%xG|7sL15^$#Rn z@#QE7hnt>>H$pPy>M++IpE*5R;KoR1AEdbhp6T{u20RXIk z69NJ8g2=r@KaltVaF4%4{^zg9UavoYf3;~hs~o^Feh|z(x0#8ADkmj1du#+Gk}}*B zm8nA9(-r~XKZE6xiD@3N8%Ssj@>aZx>78Ejj_x_$LZ{FPL7^e4q}m`+)aKo4Y4;s zLU`5ugf|~Xk|uu4J5KBgmf8~ME^c1mTzqkn_b-a&cfRRwo&x|DHWz@G`nlB`o9DUe=($z27hw8Db+n2- zZ((eVYiD(Kb~=u2ci0smPhq7)@r#=z*@gk4wdYI*nnWSUG?pz z?3gdv1QOs`hM1@_A~^r}_Fov7da@TaRLdk+I)Lqb#tK!QFCs!&|JN7uIaAcK>d&E z_5z-0+fh9_cFa~g(GI7>*!GV6@tN{;k-<7YLPPwJg?V5=5<|bkFG+bLAk}z6EGHIi z<{<{42FQOCRu~p(1ro^*-alA3@UMVi4@jnr7X**gX6;M@#4iXC{+jqe0DUM?U3|F4 z#L^TPA3`E4TwanCon=52Ul+z_16aC4a%m(4k@8|h+&%JZ!oHNh)Jw4xe5iGt?!i;tkd&+lp{nPT3M zy}(IJN%QX!MKT|izsP;J<&F;qAFM85U@;(QWzR6j zw_w?S{pTWAs$J|o0TgwaeUlormd3hbT`urFn+&?t!tGB91`{7e&ea-m{h>eYG0S@1 zhLHc?-m&A#<1{Mf96CNntx*b&&%q1=wVK_FeC8k#}93rK}4b& zOaLl?=v^97zgNKhyGhslN*Flp6VXHPVZG7!8yg}BmE)L|DRfe{AN>xW2*&Z;d;IQv zcO~R2V4p4d?~LZN?YCu-!@$Fos=KbkyGMf7=w*d?N6>$*U*^{Xzf&m#@o2hguZrxECMj$&x|^RW zf*CeMU$cANmMq_!?L36Ne?gPD^zG%1!v!vY8rzvHFR?YSD!b(XA7X${;u@DJUEOT6 zpXq>?;xNC)V=4p0z{WU?sErW!1uVcW#vZxGE;!uZ@DVGyuI=*S^5N@Yz@d4|E}(5K ztpo)!Gg}vDGrrz-&CShGe2OO8DLudcQu}a!&h?kTdl`fBGkhWlY+(Wce3G3>d@(1a z(muGeeKQfB2-WVsz{8RCMcvcqD`#mNMMNBQ{v^zw<7qlvcp*ra_Je+mVJ&`}VCVJT zEzgAJ3GJA9avN=IwxqG7FWILGeOHtRU{R8riv8P0i)e7Fta>KDR!bFFpBY)9b0r1* z6EVR#de0Ug%pZg3vs1iB@v;ut28vc2z)Xsj%Lv8fSeS&%b^;S!A;z44(}2jL@6 z%AKX&2Y5t0D_-<{9A)x9XDFdv7jEQZ7eogGRKbrwUZ*y0ZqC0P|rF!kAjXB2-$iLh?9~}@Yrog;9Gn0CVjuQ`YP0!ZDDtx${if%+ z7Y2|0So*&sq1V{!A`zS8t+L8#s9e(adTpWXDu_~(e6Q0-w_!ha5H$b?19u40CC;<9 zwi@vJr5L?P3aZZy_D!moVoNup-;(&C*+n{l78IZ^ms9!YZ~6Wgb@)#Q;tVht=#7Wh zn}udR%imYrsDc6V;N+aZ#=A-3%B;h80Nf6uFd*fENQpDT1TxUhErOAhieNK`)5g~z z13(J{+k)%zx~prm2Or3&D9L=5^cEnj=vlnK4k8RaK`N#FFb1y`djwL2O5?#rBXHM2 zKW>dw8gMUdTx2gHN@ZXa!LI>2tQ`jb=9&c(_xOl5s?*FKPCDzul zvqM82(z@ZHbo-Y(3`T6q8f+==P6-usMbO;1+=fF9^^vSPF?4Vk zN9y5$|7AHf5bLp&z!ZvkL3lP^vIPPv`**}%G!ancO2XRmuZuH=rGwO1cX^GgL0<<8 z!_ba!0mpxXpHt`Mnz;5PX>R~uB4)x5=FAEIiCfpf&=xlUGw-)d>CHc%5c=xQ60sPd zhskmdbIU9xpa1s$gE0ARY!}zA5p1?g<3x}FpGb!~U`P-u6hM-&xQUsjC0f8I+~3%| zqF0oQ->#bf)p}X=;DWD(?4hQj1<)~%vx}o-xqH2(fIT3M46a#_ZJi#4Td+6my4}tk zzc5)tumJsZvP;@lfQ!jOXol7`@wn*+&7aO*KldP8!5Kcew}PbMp2D|M9jAU*>BYB9 z@E}Wm2QUfnh~Lpb%ro>*p3r??)>oVkS|l9M43&wWsi9`olY^P!PFSILCm#grfM;xFO)ID++IVsGVAl1{FT`?`xD@ZaMnk?<{RGN)&EEYwjc&xFB{?_>303ToX<<& zabh5~Z>P(7KV+Ykx>0g)$eDlM<%5&)IvSzt8w;8?U$GhktA14l8et6-ly zT@f8WzY$5(HilAWTg`_>;j7>+;VHpA7#I&tbKa;^d1H_9+kR6AH(q8BugF(19P?1F z*9HBS0{|l~F*4SF6_6_}o7?abJ+wDvyf<&-$Y~Nkovs>=ktY_92kcSVo|)p{-oyLy z!&V;}N`>U5oS0Mpy*CUx?t75mpo#emIRYdgk;n%udkPMTs=pBd;TU1S)}KUg(o93f z6%$bC@}hU~5Jby^NAi1s2&r?Nk~YUW0LQdn{1{bC5*ZCAvcTa-PEzb`x)41sH#bz8 z3i%U({Pf}0O-2@qAtzFyuGEC4-VO>T5em?7sSAow?SXIICgN%nA+ zUd~cu=9D6Y;_^CZMz@|n+pyg`QOpzEm5-A(3JZ2t2V3@?qH>LV^_V{EAc zA4)C#MAFi7+$PRwoYgc_Rr;zvtW5N6Z*M2DYX(~SX8-3=KL2pNFI?x;a%Zr3UEX$6 zp33TSb8_eZ!KZaRJ;&*Q$&<51UY3L%;mAaF(hi`n?4)mNc>}g%+6Zq}DBI3zhXZ%U zgRakC?sB!EyB;4nu$cMnaA8*G`erHm${=bAY1>R9dO1Z4E%N2l1)sZ8G>Fyk}A;KsBqP z_Z<`o0J(P%JE~?v0Njpzk7ZY^LJbINgm8yjma^PQd+e;0^4dckYnx2LOI1#$2d#G} z1JXH)TW13NBMsa`wlDZArlBU7cEj1~e8?|h@$CpAB-;FTjPekK(rH7pYGDFA|3QI> zC`kPJxIB+~YR5;He3JbB+tX2r+q_VVz#FfRz-uc0b(rkSJOW)Ctzc~w75Rkpl0?d@ zjvyU};Z}bNMP~3?a&+iGD%$rvrMz+nNBbn}-_Wf^Pzd0(67E|^36vRR{&=o97Uf}TwV!u2QDvnv&+r|yJm`%$Br@_5Y7S!-mwdS z7evCxi+|0y#=WHKs~V~r)Yk@b9~eaQwN^uO!-{U9vAtS+%TUhDG^&?hWBu7LiFcq# z#F4f_SpatCCh@_nPB9X>tuyXES^+Fg4F|Q>dc=g}-k!GkURON}J@h{FCsQBR{PXhX zs9~p%oEEXnh$90L?qK zv0>{_i*N1lE}CZGoLm{A`&>vd^%bGv+SutfER^5G6 z2>_XxdoPD?4ojFzLtsdB$;mhqKo&-wd$jhE+PkU{Ra#j>EjB60l&cR3g`*WP>@i%{ zqVR!aluvd#shaAYLSMy{iCuO# zom)SmD=VEYr-q%g#KKji#qr5qe55iq7FBtFbkH1xa)1CJ=P^FHAe8?*<^-@M{0=KF zhY1Wr4m$u63Xg%q1gJqBXlK}cA>%;lU|34h%3`GdS*^&!L6PXUWBIl(sEFpk`@z%(l&(AbOMRh-c!gFyv~VPVo_M^X6fagR$TivR1J9nInJ? zEI+6fe$om5q&Uz1n0n4=ftIW3WVumnW$F`5COK(QDq5H->bhaO{xRF}R~)YT1Xum& zSsnmzL|;I;@~o7`#&WFD(VWVbNQnZJkb>Whnrdsio+eMe zfkl~sw%YU49Q2)f3DW8If<}7r=9*hxS{`*~gO9v!Si&`rdgu)D-ezq_;0MVh z-Q&4(6XimeG-JC^EI+i$&Wnz0^T*ft`yncbEY2H;DOWj(i7_7$pNoNnFZF*0 z*idz?9(yywmTL}BTKxXD$P1!t^HTqP^hHo*(rHiZGMdT;K}S6!>Izoy3qb(ra1Awf zD+>pn?@&;M^hDFU_kp-6+5Tv^LX(Z{0c!~;67tCNYKr>|c9ZTaM*@5R(MY_wA9x2- zG!hi0PYwVVL0AHmSs4!3( zx}k?QY`_ZXLBCQhK&K&Yfw6Tm$*YN84?_R#BpmN7n>dRLL7}Y$!i~(mc~zk23rFZ~ zd=rBQ;oa}J>S+J_aLVpv_X$^eg$n+%pu&^cp!=W-2KT<(H$B~^?I1u)j5y(%4|oS4 zSYVHeHWk2@VTV&5F|qCVey~dBEcBKPLJczlCug>!N`M{Vhue``EA(+B#k47z-c(M*M{doG(^0L_xVhBjNjuKR$lH(e{w7r$mc#q{PF{9gWC1$hrR zLUEuakb?IQ{Na=esM#hjg^g6y6(WtW(Z7}&?S+;kUXn1$mPe33r3>JUHRcIUCXIN2 z@)1z-U^la87j0v*FNi(}57!?&hk0FI+ei@3Nr%+StUI7Lex?iu9=NYbGNM?0wtU}E z`-?oML!D@rNjDHmNn$rGO(c!}HL5hx6%+!AU(uE3?iV-k_M`Mq1s>=xW~mBTi0GCy zp;FXCWB5phjF66$W$dr&n-ah?^N5RJ^8TWQiPA%phw>crz=oEKlL1N(e4i(n08Bl2 zyYxC~{AU*Y=8s*r{|T;OG@u_u3>Z}1V57s;Qp0p~fAPJ5pi*OlZg|^XIom(76qhoN zaxNCl10TjC?qOJx=eO~*g-5^d?*96(?{TZ%3%$Faifj5eU-Ck{$>X$0hucVDk=o3s z0$ce#<*`N08fQ6D0AiEpbo>g$!NL`dQ<@v0n5>NAT7RPh{!w07iGYmrOw%EoUPy*Yr@}vqm_41I z@T^h-k%zZbATR(4mOwM2@o!nv$-dNMJ@Vb`9#j# zKSMu^L0AC;@!!#;NRAXj{Gb18IiUI{ofx152fmnlw<0;EioT?Z5-vQE|I8Y2adoUI zd2C#AWg+=Day3J&Sd7oj5`g^!1;>i!l>Bf8#^PX0gf9`g#xKatiBLZ)OF$|D-~fFG zC5aP;h}?y1>gQ0|7ngeJye4L`<^ra9DNJ{>@l)4 zrTe}kId0}Q|ASr0R$|gU-fx@_c!7H6)QSp<3HJ(MI4KBxZt^iU0A*rad99E3){69Lw*L2vPa z2U3`~2+?IFhTq-HW2zVKOb#HK6?5;na(EsCRV;Pg$Nuo-_3%OP^E+JiY5SWT7Y+M$ z^dsdIfuaF}5*{ZUzSst)=(tbEDoskeLCX-iKw#*8A!+F28Dj#^@UdW8U=jS}ji-WH zP~iXt%=R}EG+A0ETA)<%3beb<=-I^F+=uNcqb9mnS4sX1-3%27mj{;HP+L3c%ZA}F zP0#GiZv+-xxlf`1#Qo;D;fl35t-^(jD1mO{M(Ghc#{6cl_&=D%Vtvtn*OxxsleOlb zz>HiRdMb}_Xcbl@E21gTlLCkmt8=cJHBT8rDKH_e6uWh(Fa8|v)K>t# zJQTI`eQIh3%%_X7+U|K0WE)|HiYQ?Cg{5i*9kcH;4!M4b1DD>z_ap#;fZuR(&Y59F zBzljq`Ht>2U=R883hM)aJlOk74MqL!GPVe!9UjWx_;#QfdQF6xU=P5Myh<+sFcK&+ z4ZjMa4v)=mXFkR)vrny-u%Adb;@NK8p z25F_ETP0$I^gf(k7!{JdJhiuZp|ECCj*-ic znz~ZPqK}@}*NU2VtLV;RX>=-@;fPj#ijX|wXgK?IuirL^<^B6757P?>}No7sdLD@Gcc5FxouhMy9`FJ@wN7qi03;U9q-f6 z8qm9ltXR@q&++c0;n+S}j-VN*N(y&ICQ;_1gc^xc>PM!6HtSmbYVw7?aZ;4H?wNe{ z7N2%Wk75?rqaGe~cg9-OWeFVTKE+)}rw5(H1?}eC6E30ABFQdhYzr44fb4?lP%|%F z9r&=oN5#={yp|-`CdTVQbRvvbKFK>QdyWeznLqH)Xc))2Ek?mxY5qop08v(MkWblE zw#;I1K!XU3oD&caZ#~W0-V!e^vdamBrp0Om6zgWROh%kc?-fIl=~0k((gdl+mY<~z z2e6SMY=Eu3+tRC!fB^ZvaqJcis8Trr7Jwi+!hi9%^LtQ@`6&ZHw8~qFh630&*!x_p z)M7eqejV6TSLrnC&+G9N9K=VC`ds*~pS{-tp`_#QrdY0gc!9B4iw7vc&z7u(Q-U67 zyPj@46>mF_L-$GF+M%o3?grZK7|_NDD?0`Lv zEY!eZN%V6Ya|N0OCyv{TX>kboV`Y8+C&^?x zFOJ{umC~@reQ({qx(N|^x5n?eqT8S~CC6tS#!8X*nD(cC#kj1HF<(MVrc1v=@MGRa16xKETF% zT3$Sj)hDe~b<a$fvV#}g;Uq;O|EPF=CFM0Th3`WIs|Yo?I|gPPuWf&Oz6sGVav1s z`VD>_bP1D%L8%hIZ~LW#9J7qQm+hhS`edi-(eYh$vpE_2^xe3r{WI$(jYO0Ceb@@s<5n0n zV5OPq(6OZVPAZKN-;ohMDg9En=i}?zzNE4VnRUka_4U>l71*=4oUT2HeT8^nQY4Sb z(inGO()7pX56tnf03(1g>kdBW(W?A|9(483_fmlviw%9kg&z|z)>@MlUzVjndY&~- z%`VLTkZXC;9>O+X7)-~b{8h!5f=uSm4*FIoLI z+Ba(@QdQ4u@vRK>qq!un=N0;K5_!pO^lHPR2 zU|Bn~o}2nrwwm^rc@vkfdM%*e_6>6csWz()&p4c~vJ>Zi#DeVwD7xNzh(ZcTBQ+W^ zXzZ_h-9nDPMDo9{H5pd_eM4?gx^jMZS>130xBe%7efeXq8|Prs4PId=Nd8iY@(lrx z0I+j@qg`xv`Q>}}F$vk9*3p0|ROn87=8mGudT&xVBJO23;Vxj@}L9qtX^!?1q zp#ck6LKo74bsux}F$v)kf>UQAC+9;EA%w+U0Xz=#wj;c4pSS@V=&omlZJqQP*J-?y zL>8ahD%e{bDVd}ghDS8|+F7aB)&I`hT@OPFR#o_{%176HReS~^0)GL^Q|Z2}fiMz$ z`!=x~arji(UrUv>+*E55vlb@EOTMd!NiWGSmaB){BrlY84TfOHZyIx&;*$<*2|0pS zpNoZ8Yr5B4wXAAm@&zNlEE6Q+8-9`Cjc)O6F^sF~Hb`wowU;aWdht#n4<8y|V-i!o zuw>p@8Ml4D{cT9-n&JKC1XY1@YXmP#dH%b1AL@(|KRlbVPpI(^MiSP9_ecQSs>2qg z*+B;OcTYq^-uLTSKwg6zqcrkw78_H_0A^tu%IGjmg3Y@3HTg{&ryOHEstrHz@$Xx) z;e~s}tlZ_K-wG00EHICfSzS#x>C#{LYbtjydewfFeXS02Ez!G@xg zF6%=gOePD)z_x^57SnD-BgcO_7cAGEn>$s$zQ9Pdld1b{5R(<-QO11)cX_QvEDsPP zgM4s{(zZbTqyqGykRM`Zq31a((l`ej`)PzkM_R((rBmbz??dbouS^}7w=rviIf_%! z_R$y3cj35$xR_vV_pZl6ngeWc3jy)Uf$d?)Ec$|CN;@D5i_n0O#v=Z}Rvi6qWr*{V z@#9C8O%Z!sC76eH>k|4YDmFKEy8BbRX0S3mITQ-ScyTN0yyJSA3~p3ft&563XxlhMUSBLwx%S%V2DIF(%CvI7oOa#~NLfI6)sYA|;E zzWhIqg|z@BQ4oHk1^T@dV4_I+NaUYXz>2z%-WK@?Lk=?JYWNvGQ9MR1o6sOUPM0uV z?H=TblH}t9q)+?cmw|o4WEY)*Gzx}%7@e2NA3jMi(wKN;Wgtjx&dXaFa@RpiCVT7KlkQ0Ut6n%@^fIh^D zzR?(?bNKVR*S2Gs<*#$4}~4Sezq5Mb$K{_qF*JY@!^$k zReg~K*^>td?n~&F@iB{DYHg>C6J4G~TMHTIM8JmlKe`t7P)ReJIwSlgAkeg<+R38i z6#j~c6x{x6luR!ATHdWdS7R-<;Z49F7B9hkv>WG*GPjnocaDurN6qifyF`Y1=s_rs z?O=e`fsKoy_*nm*{`^hHk2fCAFbU0HCG!i@CitakXA`k-4{87YIUdawwyVhUY?TZi zvo)nSh&7kF5J33++(bw@N(wzBetMHvKcxP|6{le_z@J>Bj56wX+CJXzS>bAD1~(i2 zFGXQJxZpJW--(ZKRTWctZBMK`MlB@N8{^f<;mj_y*oQB$mBO4rTjLJqvK_gVL~=!B zrCp|}3qWN&jy(|75ap0UKJ(Adb_b) zp0V&6ufk#b@d8w4tNLc*PODOx^aUbmk~%(GNVZSOEWNuW%k=~g%%5sw@nrBn>7}L+ z`^cZCW-`4NAz;7rXULLwmU_kyh59i*2YD*?jel3YS-4e1tB)M8p{f$K#w4vn&<;%R zExgU|73xyWG7e!aBeFKLX zXG?1Xoatzy5Q&7KfCY7iT7QH|U)}btAB*Q=hU#-BXaWkG`R`AIKnWoXP-{WzErD4!9`3$6k9!4 zcXXif^aW1W${M5WzrGO#$==S4E#bw5TKs^GYc1>CnL#L>Xqwj8s%_3(oQaglqy5tF z#I-c#eyETPDL|xTIfWTkGHxKY=dR`j{ITH})wH^Ab4P*UT~DL^ zl{60Udi|@g^E=qmAh?;vU(2K%~Wz{PcbX&2?WpQF9oi5O&+OX z>Kz|h$DHJZDjfSL!N_N3Ax^4!1Jarh!4D`012$%GI!j# z`BK@#kTU|C`R2bi+Fa!R;&#LFdy+}siTi;~qt36rJ=6l$3?}yNxt2QnZj-_Lc}p2k z?lTjusc<2;oK19p^h@BH-u!6p*JPk1+7q&8{YS?>0u$w#tm&jzeL_u~i$s3?ATOBU z>@C@vcUJY|N20Bs*$Y{-4p`cX&4H?|9;az2=~0j;8x>~-7)UYs5?*7lmlvP(a#KFL ztgrJi&M8wYkr@PW3!%u~Xwe2TcuDwkf3rswe)Onb`3BGEzF$ksLb|YCYu0faU5|m+ zC3gB{$@a#Q|1q=E~FQVH~Q1&1}3tj2v ziik)p!4cS|uoUtuxBI}4lR8?*tQAZT#L76Y;@86wrmUhU3J2@8Q6*Cf!j*(bM8Zd;ocXEi(;<$f8eFEFjzW$`qe_Z&yM`e> zO&YG<+1t?lR%r=|Ol&08q^sQJ`3p^~tk7Bak_QExM`{6m-NfoVj0r$rCTp6{^aP#0 z`GCIIdr-qi{EeL3u)_xG>%+hj)^Xy#dUf)n#$^I}f74Y?P_yl0))QTYI4D%OY`go| z_Z`o@O7HiQi#_ME1J5X;h2-A|G4<3&ozmrSu(SVs{gt0245BevTb2zYx#tQq(=<{`yTLuaMh2{mNgJi9^?ye&fZz9i%R1 z_{y@dtN(ssFb~fsk2@QRQe9xK7L{4>5-FzBBZi)%ueMg>2s;V9?-ov;P_IO)Zg2qA z(UUs~_r822@-Gd_2iXML$1r2!|8y}Y|IL|z9ijJE#dZENKcdE9Qr1uUWtZ^)l%Z|G zuB!=WB~_=ilUKq$O?gzxk@T;NIHBfmihk6XbXc66jEnEh>T@aG=_`$d4S06h3IKl` zF@nG9M}wE7&sBjX!a^C!)7DO(yV&t|W5nOyfKuS7!s>^&Kt;6*J6Sk}@Lo3?<|-=v zzY`{nQ3$$IRLYS=9dM}eJ};XIX`+0Nm3ISzR718VWJEm5X8$$R!DV03{>2I{o}~@k z+btcF)51$Y<~)V>QIPQsHCF-$q1Tx;Ia4D&40LpXnb|$Bq!`JF`msb`UVrFp-OtNo zy!*unsz2oWgWTEQarE$nha=xJ6aH%Z??b{(j$jTx(5sd7kf*)9uW17SVCw>eIXM)G z{=QB7zU}8qMY77ShJV(#mG?6-PCvZXST8V}yGKX;wOT*Rto%hkur`)aRHAD#W;LNB z{TTnvqT2s0;}f%BFq2?^@0}%n@&uZN4)SxJrs+v2!nI9O*87o2ZfKRHm#p4cl3c^W zpCpR^=VZqM;Hj>}y=XV2X-)m~B=b4n^hx-0B2&SDKgmO{zinrOl;V8-$NdCxdr!bE z|C#VpNCwR9>!x60P6b$=1taNCBlk|5i4)8Vq$KvUC5!iq%W9ZjFf%i+1gzdiMSTh@ z{{0M2qAXhJVQ!{IljSi*>vf7wtebQgJoG0Z@#}K&lPFcAVto2dYLBC|dEq7O#@VqM z9SHLx`lA&o;O7E7e0qZD`|*Ulio{87FT^xOg8|=pEfWi5t;wgP7oB4RP&gAagj&7l zmZM*K6p}O}xQ;?52yI5bNNh*kERS>glW9CW1(}6P-K^mDA_r~1&C1VnD1erVa?w1k z#rp2Z5p!?CR~%qBayZ8X>oq)`rFFBN4#AqZq~$u|`ZNWR5drrG3aj4Wx+qUV0Tq?h zFUO$1AmB-L1Yv7#>!9HzyZ z`Wgdw^|jTvS%@kIZyM* zU&}BsK~O;bQOEI(=mv&Xa637YuDb6denC*#cFsZ~zu`^O9`2IDa2RF9X`!U$f?$d) zuy^=x7F&jzAQwci#c32)dKme3l9Ze8Nco2NL@O}{@Ia;keBjqwWnfVdKXZAasTMTkrC+Ay zhvq<%So{vAh+;LLQV%9O;pV7_txv!2X+G=XkfVN%C2NItU=>OvzmlYdW^eXoQn({4 za4{@0cY^=8VUK)2q4v~uCJ*Ph%s=|h_B*kGnNk8y#b(5D3b+H*16Ujzvtiq%Tvvu%@z~^?tgL$r4IU zFtRW}d<`HKxhJE@)Dlwu?Y4Jv=#|d>3H#A=drG0VWRbyHUw`ekx#q@(byV>*O9UgI zf+dds+5Ac-zbMVaiCuunkBinn43^!ljQi96fl+(^u$fu%Sa>EaodBBZ&jJ>ZFK+Mi zRw_%SF(|KeGU6miY_Lf_PO4kN$m8X{)l7F9lPNzHr2lHbvjZV}dHr^M|G>8iB-Iq$ z6DoqiK%|lDg8FgO{&pjKR+xNZtFoe=t0koyC)UZWmPN|ru;{ICj~l?;G!VrrjJVg{ z>g^H%Y3i1lG>gfLE}apq0F1QMr#E{__bZLz%M zb3;vWr#~~dtuau~O^(v`QyqJAK6WX}Xn?YvY`&o?5{e*`(X zF*YnU&hWLoIqwwsLziZekWCvR0L<8ZpEIrovqZ2EFz6^+n4ZLk5tH38lZ)|7c;vDx z0VIQTXiU~j#9I94ABXZrcPJm?&DSLD=~dv5-+4*KU#6L)p3c5~jv4cQ_5OtPV3&`v z7`h(dE{-48U+fW<6#PP7G-ryAX*{{gpMFJZ zed%)jqQ1JPB$jG2lHG0J#FNCkmEy`ph{=yJO{@b7PF&>bEhQDj;!Bsm{>t3^2j12% zb&#f(YrZ042YTaRXoWnx+9L>uR6tKuhAWQf6TVSLowKl6h2Mm>+vDA+(mFcM!M#;E zZCy_H=j*Z~AFA3u;y1Sn2i0eMA!~z z{APNLGC2ViqA6XXV`xoE&PvDgo`Zm33G*u2pdkZf!iRW8D~ufVH9zd665Smwob)mJ zoa9*B^0%le_;xSYIhk7QlF@p)(3S&0u{EdLGFIirM)dizfvo>tjzh-G7ds|bS;Z(e zPu~nwzxPUVOiaKq6UL#FZU~L#(#d|=X(>XBr-D;rAyw3+a!qwm^=wobHk~3Z5>!3! zk?HWq5}l#+sTFbp5nc@3-S2n*bB@iXJbHQ~=6q@FB6D_w%>;m#Tn-PU7Cmo{A0G0^ zzujy1Q1U5xjhFS_%t`$tc>8@JVA^$|B`#MqqW@i_+*fHArTQ?DuG z-8E575tMp$SE|>M5gagyGz$3Ip3ZR*8Opfj3>(}kC>s3S(^C>((vTT&rl-%7pZ{S1)1avAVKTZJE!!sX=QL>A13k<+psy&p-hNZyO`2Lh zAuGlGbi+yOpjTX|okb=3M;Gk+(*hZ0FE-1Ha`p9bF~cF7_p(#DJ}{7* zOokL1@9qZcQYMPwVgu~|lD*CkmdpC}4GezbH3L%9qt@MbVq9d$60wtWJ(}z@CoX{e zIX4!HKb42~GXlMq73#&NyjQ#@vZ^hSSk#cG!O&#Qg*?MTff^+Z#YXfIHw8g6I2~{* zg8%R#eKjuqt`yc-ue&uH=EMg6j4V0h-=9)%@^m@Gd1wAiVUljelwtL1_BrKo^lC}e z`v20Y;wp^~Xp~ z*Vl0jF4Ey&nW;PEk3`uw=Diq8I!Cx2mj^NTTg+bwMg3T! z>GL)zw4H}22Y2&$utLOtr=tU7gkj&1r2T%YR^&yARUUelR-UqaPKWzuk~hk1Ca&e zZN8tAJbNQO^h-Z33-A9&7H{?1i7E991v=H)Xx?y4@ zjk4Cfu)`UPa=z2cBsH(j-LJ0YCCM@m%az1ihx62Vvc2G9jRXZva!>O4zv+UW_#r1v zO?BuChBh=idLZYns;c#-4ZX+~^7B&T?UP45^%@WXoRB9rKJ`Zegl^q|B7^v@Kw63*f;2|#agnA;TAnic$~>Za7!o{*?lna9(Vht03>OJxtm zWJCW`Ig!kSC-rsUqsJAokjhhiWjrp#_FH$7o=@f41Ssqk9y+1zt_?Q*Iiu zcXil14uYTdFJ;iv<^c+tcVC_}yQyPq>GqaFU7u_diXUwZ);Y`RX)+hj;&#m8sgbgO zhBI}M*h!*bNIZaMOBn@86D~mC-)pbI zT6cXVQ6h7VU$W2p9)$zgb5lCLxp!|CgZz`z_q2>FzFvGR=>Wm0IjCT-&eBb+LP))> zWmJGxYhn1KfoEXD%C80uZRp9*9~o*^>t78!qW6jz>Qb$hgLv&R3aaqjwsa{hphhSs zPdmqzwGah26mHcPBt$3XdcKc;O-DTlIj;hL7_3|T!a)pMfQ9;p5K~LVol^Eokf{Xn z0nH#~SvGUOq2VA6IymRj0I#&CC5%D}-r72LBRk?$4;wy1jP2{#Yqb5JBzKOV%KMyp)PP8H(`X6`+Eljxw%?)8 zR^yJ_F4ud)xn9+5eN3T*gB;yojNkzd9AA!)_|!zyRW+8s2QysR62*Z5Go)pSlfjSs zx~btj5-RgV8Rln>B5q)%T+!V1T4O%Q+&?c{=b;^CR+>S8cIoPh_@z7z4=_GxV8pV@ z=NjO$nWWdFBg5qFh^#PT zm#~!nQ793+^CIBXTAYSFfzGc=gU;?LeY>G#kBkjlHHyMpT~Fn}5%UhrObe@!u)qCQ z;ukQ~P0WI|c(SC~e!(UFeLG7e!?=mT@^b1D1phBk2o=&-LWe-)XVUf*q9Olf61}>B zKo$vkAi3vqL#^NU0Z(WMh)f<3MKHlxQ?o#93YGqj+W!@ceA^uw{P)wV;FVKFf3ETA z2oCTDw8Qf;Z<|mCk%(kg^81>dF|a083&gd}L4AZ4_{W-CtWS0qg4l zAF;P``n=nI!>JU?|9eG+!1o>jQ8&|G8rNGmsF^d;qQqY6HKDKS4!C&hoz|afkebS6 zv}wuL1zH9(d8YMu#ADX<3#ix(%OMdE3ogIR%dN&-X;Ya3tbc?ZkcheEVsrW(RhD%U zEZBC+1=yX6S>~FS(784YvKD4de7!0+R_}xM&?WmH0CYf$zx2Srus?$FxwbSn>+8N@ zX|#Cbdkb_+(gH!bhz&n*clP!!=noYTCn#N@nh`7kiQ=q-lh_}`+mS^0>BNK}CZ7d! zMp^)zT3CP%K!EgrCwezuL;)N}O+zKXUAYcYrqq+nu4woT49cVmv{ktw3XS>=_dbO7 z$Cih1QW5~a88?uLDIfXqm-8C_+g)THhWmsxL*tNEijtet0Akw6IzuHHAoB|#0&Mas z;(`%wEYHUq7q4c+OZJ0sw0YaJ40Q!RiBsHC&T#n#I zdxLWTxCIB4=r2XWfjqx*KmJL`+#Ckr76e$l#eM)N3{X?YKRA%v1VZ-T@LSJDHl@DD*Yu=fJ?J_cw>ntdHffSux)6rB}lW9U7$< zV1k6+*HvwHQMKIX5s;rUSx(9Q&0X{~@q918-s}rKc}VY*y@UnweJV?V-ow8H^9XXL zxE#Qda)S0sZDhv_{GSdF;8+-Dvr2x?b@YFzF$1Nmm}8Zgu!!E#`8eel$6ibnNUwQ-R}1Gw!iKB z$8sq^7P@AL|6;iy+0;J2-}8IfQLi@z8?5xEnX&CxuUuJeu3o|Ijz9lyjZFb}vh@sp z2m&xv4J*_zy?xubHLxy0IoJ2ko@2uR1@gjK^qSbHwY9aYYv2JmSJIJ3LtAEZ!wrNz z6Gzxm)8ks4R-71l(h{Z`{U7yluHXNWwv)t2xWPdP<0=Anq1lczH<@O0bK@6hW@Z{I zsNn8JRNOn}v{3)rXP;r?|F+-&Q-H+K-=#WsCT4h1P*`*tD0~&Q1Eu&>IMg}ip3KY% zOjU31q&wT)rPDP=)z>3V*L@pj^f_ULB%8)grXPikk21eE1q;L^d~fQ?zw-gef91** z#{ma`^3~_xHT{{s^>o(nudj#ezp9SkSD|_c)U*)1^zyW6mx(SkiwqTC4)@!W& z?CRCEU^LZhRM2M4~&M{o^_D*dqAr;FI{rXSKi0V`x# zG=^K9OM_wYZ18lF`L}odl@%Wxzy?J6AJ`SaE`5sT?_B!q+GoH0ZHWU?o=>E21e6MH zA=5&CbCp+q^q6o{IZfY$Hh4`Fp|eE^wNFV4ujo-o63 z7=*$4I354WarhJDFRO9X{$2A?edHdAB=#Zj^2#qXZ=IZ7h?jHY8#4_zhw*KP%C z{#1rC0T3Qr7{3sQAbXN5aEJspHK-5oHfauq&1sGP#puR|PU`#|w2_7MNb|{rZ%Z3P z9Ek`Zaq=grCTJAzUB12B8n3(p2IyXV8}&9c3p7vwY+rLI0WMu~KFc{kFW?}P%&6^A z>HfWP`!^5mIQCC)-54dqwKe*CdW#i9e);leL zC~*cO_C|Xgc+zhAhqQjK2FTI3F$v|!tC*px(%la1x1s^adBo&`vr%$Fow4qG zp$IgP_1*VDB#?aam;%7%a>c>`DeUQiJbnpGvp>1~-rxN-Ip77_0B?`qc9dCz5jA)X z9}*r?fJZb3WJ$^g)I?ZGgDpSp4!BO(DCI6%TnrbNY~C#SwQC{>y-_}EUVOq98o0ZR zAEIRDi3`mD+g(3h^5-fNCVQ+#&f`1>;DDCrye+l>N{~&bar*B4`@Dp0ua~W?u4G_> zI9cTi9BlYkR-pnQ3T|InJ@)*&unjrWgg}{bIQr-#KAfCCi)5EHL1-@wZ%>2UkEge# zirFQ>v5e)5B)_IQOHUQYaIe<{`GK{oqpO@)jvLLA18}oh?+`$c7X;C!?+(07ue>9(fa_ z$r9+FLT~7OL_@_E*M)(XdV!V!d?1Y-6`kdaU;z@$Fpine*7cX1rSJAZ1y}(F@q?@+ zLoRmNBZMjk3y=q7+%AbTC(T$tJ%1&hX47Pv9O?Bppa8hRovw@!hWW>LeNqbW`R7dA z0H8`Pa0ds2u`>##W7HI4GI1w%3S+pp3ls2%umh!^%Z2!-HV65AUkZeaco~?RJ8KTe z-@n#x_T8&X%Q!>^z)uaF*;#g$`g{!6cN$7y#0kKx zjLSxJ3H0ZoOJWKN2aFY1O2wsCXuH&Sk!%_b%K?Z5{k#-M2+0L9#}kr_qEKQuY1oF2 z)m8vBoENlObIWtG*r0OOt=Xb=fH1)6IZmyU_<}G^A3QK31OaS|Sd+h|Hz({UQ|QAIQO#*#B0dj*XUlMAFgSqz9}GM_CDRmu?~5=YjosbdAKtz#&p{}(d{l_P;H%{Y78%zV z^~dt}*3@=?3FN=F%}t+zAKw65DHcu0B;nvm;-guz+4!o#D`#f*^CpNUZi?6Kb$g5b z;kEtTj|1Vs0VW^^B;S$)GQjt`7cR`d_)2i_qX(VRkU0$()*fyDOMo1-3;9q*+TqcT z*y9k0^dStma<|{KcIF~%dAE~4eT?S6AM6({UZv`2QFtWx%v!TClb_@3e3BzJ$1Y_5 z++3s6bx#D-}~e5rQK62D=)sX`{1DSqLC@#-hEs3W#^9!AY-(+ zfBu|FhaQNWKvWRXOl#xlJ#gZ)Q<{#S7PgHN0kJb?JL z0HTOJZ=56oK8M3$^Txj2(MJa#jT{dQkY^b;?WpgXpkQ~Gk8s~%1kj9a3B~c3mnD;u zse=Fem$uasZ9>R^?LOQ<+Wt@iyEnmhoSp_1;CMb*2r58d1$$s-CZ4j2G;Tn<-Z0g@ zIG^^r-JAjXaAZ|Hf{p+Os9mzXbSgaq)f3Y{&*@_Z-=0WJW z4qMwyV~q;L(my#uRZR63U!+@dq~(wfQwz~piV47nDj)*b7w8P+fkrU}#rZsd5$L=#JLJ>KRtj{!OO=y@9f5&; zzKAsQP@<;40M54-jbQ_P`w*@a^vg?2*RClwa?$!(2Yg6dVj(Mh3I{F#L;w#o8`BsH zGMVNgU@W5D$ag7b>2)7MdRDaj5&DS->C6NJd=FVv4afi((}n>+7qcoFQo5v#0FwXO zXOe9iQ*l<}fBe=t%hWJ{yzaz#Z25DsgZAG^BD)kB|ETIk5Ky8>m!?%HJjXzj9RV6J z$oR(_$~4~7r{^Fkbu>c9v$0tmxrfySajHu`mA_s*g#_rKMj;3ArT+&h01?pZkr{L^ zkW3Jg&OrEMoPtQ&lk$`T*uDcRZD{5LAuC|+PJVwtUVjwqYN;%Sy)y$50BO!$ojd98 z;2%T)mF%@`1h3J|pc4RKD;xk3APWdVEad{A!3Ei4D+086BR+uTc5p!Yp~FSFKz}(+ zk4C$J;-2zfw%_|>cI7Cwvf>;~Og|K1MZl$Pc!8ijsQ=r~be`cU<8(2+0<>B@Lo*Qd zFhj#TYZ@x3#VCP_jFLrB0w@EI%MWprSix*=JIb^s@sH6Ug#NlSAS)K_+m9B$Cb%Zq~_}wFFHN-Q-zuuxMo32@L>d+GLrE|I(%HWk>?0AZ*Dm z$es&6@Yy54u>i<`$VV~cl4c|J;bqOl*vR!6Y(o??qva05f0%yA3UJd8KTLggASSF( z(Eo8|ReJ*a?jQd^Cks4C9HYs^Opy?*KlR!6rQgCClx*{cZW8is0r~tCZXlp-GBYxK zZ55{wpyPtTfxe!{%nz6#IiWfVjT<03_m`Q1t0kO533%nY=?Q=Wm}|=n8rh}H=X`VN zBehw;QIuJvvQo)ZCOB9#NllfSO8Q*Z0w=%$pufA?bKNV@U;6p?h=W0(e+CKQ92|^p z9mvRxuz*rSd9>d?%SJ{n-I@YjppWVDv4q0?Jc2_-d^mx?vZJ;sXW<2KT@LDga~`S^ z2RO}1KWT-1w0$JVMf)j7$78+^KtC=od(1VeC&E>dqVI?EZiyw)75gLlr)p$OdKfR+Zw z(C=?=^I!G#AAXwAbo%;M1+Xhww}4ksNU1(nV_MiJR}VBBG(7Sd2Q`SlaH}aSM!xDWZs;y`< zdVRIwl&3N@V!>o2r+P=Hs$9=hxflzw#_MqZ=lSRoJSyoFqg*z%{wv?UNP-Is z3rnZJ`$tPx|DT`@2|)UvKmXS4x4usyz$UtmFX&G{iX%qWR9wChB*0qu{VuG-UMA!N?k5u@~pwv=6jMAcI(RVVQLtXUEyz?s7ee zg;N*)%fb?eZ?9g3B?|g`gY)Odw}1RzKn`%@hztO49$UR83*-R)FLrd#6|CDoU+b}> zduI7!?sxAxyMZUqOOJoP=JeL~*RFzk>?}(;H)N){0>Q(4oPf<=Y;JCCnl&u}1qpEB z{QrBo^$l$QKs0fZ{dO4cmt=q?D^R>O975NuXfU%1`>)4d3~LjV0J6KC&f;f$n2;Q> zFt>2wzcd>w&G{EO;Q0#a4-S9`*zv#r-g{`Xu&#I4-jigyuZ3 zxO8u65hfdU7Ut$IEWk2vuB~y54gz3vFg`y%pPmN?Tz(J!=qx>U2!PpHZM1V_T%MJn zgqO{qH|FL#+MB^gG!9J8KsZ1IS8wgG=l5O^D>Bs_FhjGV)KgdBCliPYcT*WH@I7$A z`J20Qm(Q#6$cuza8~|6#g(OzYJ2e#NOZ%>J$J&Cn!d30A#>* z);hW?hP%3plk|s3^0)*($lcrT`Rb4hO1lsNl9K@XKzDA}G1x?+o6eSg{cuOkwHD5| zTIXkGl)Oavn~RDi$OnLRP%J$VFMt!^ISr5>^e@k0BRueckOnlzsl}Z|{EHFbIA^`} zvu6YS^75Ul5C9%TfCn?+E$=d^I?F!0*=SZA{{7&70PYHA#EHk3gl{;@n*4lDngifq zCESen69yQD;ZV8zi0clVR3=5hCVheq7=ZBj&C46z)oFO2ZmV_kon5fBh>&j}yr3;@ zSY}CZGCiBWjPPN91P_rd3iJg7^k$kuf1ynk!U0|C0Fdeu&ue|)oNa*v!r?wSV5fI= z#vAXS-yb{Y-}0c0fGa79=oAY`>PMWN9?#-Xve8-(}zM(o`c!(yokD81glj27BTL~~C z{l(92K@>E5J&+$1D$lPl@SGNm0C|-`XB$FWyM##+thYRG7|O)k1}>jD|KIli+s^E) z@;pr-zCJ+=LBjyjtJzr7Dj$>%K=ID9ez2a+A2c@YpDF`+>Gfa=;;eGyJu^Pk30HNS zJHZCH2?n?c_N5vSBLFr)%l*Zzn>WFV-%t%e+Jg%iq*th+sZXHB_`WEqZ`GSw1qqwI z8C1G?N0V$>?*K&wnsld=SQ8+Lr%7=3?7Ddr00#ZctpCnC`?G2m^p|%|yIgC@<*HiJ z8K`@;6)kxIjt#*9L5Dp*1igFO0C|skk6yr48Qr4*7&!j!JH9j5xj3hpqykWXfS;_% z%j>BF?(g4xXM=b8W_p4ihpA+fBVPiDJu4$881YRizyJhX#b;%8WrYumm97yr0d&a= zi^(EqwgDU`l7L2Zwc(vt=g-6cbI+f@%$pzto{{#;A%(0(po6yYR*1GXIXJ*0mh8Q3o^gZ0e<7t}!gdmMZ$ z(NpGlFfbS?C{5B|YO~o~Sy^c|jRp{zDX;wz7m+}?vzRCd0X@ZFYl|b#NLx~OVFV7& zyYIO!=>Oi1+z=!v#)5E!2Q{_93&1cTcKTognonKOY9E809WrLLP`$c zQX_)_G)Kv*tpIsRkS#F-vA2%{Fd@I0-~@>Hpc0B*&m-z$8upAAfLW&h7+a` zpuy)L#jYsz*N%v8t~*N&QHX#-0O94|0hDX zOv2;jFW&Se$Z91%HpfmcY?b42{d{FVnT05pdzF5+=Ie$6{Jx2h_lB`6iq!t7obg$REc6vKZEEzMskC*p>9b z45b1FVKON_9yLi^^H#zqAuN_;uy`8%1=Z8CidY%Z<1$CoYrk4K{|<=t3oD+C_|jtD zv&O}}>luve1*|rAcIj3k#ML6kS*^&`7bfA0NBEy3fTP^b;={8{vM)cc5Fu(NT%v_$J7sGQXAI z3J9pc&B_WZ({spkbeyCn5zLyE1^5uJ2?Bb?YZ>~5l{_R-Qs#)deyZ*#?g=9I zYX*u_;(%lKizkul>StboIJ;52y-HB0Up;}e+We2jzgXLs&c5Q%@;2PIvJLR%{m?CS z-X&SYMVWKJzVu51KxNk=Nzp(BDk_^~5CJAcd>1#iFLpI3P3qT3$2Iy_^OIf$Y+c|alh`fZSbgVTZ`3kWub(>o?IKDRHGS{= zb&WqnD;I~BcUW8S`OUr)-@iW`7Uz>G6iWVpCh4E~?on}ml0B~6pdErdr2|z9P?xPz zLjBs!0#*7$1JrDYkZ)-$VNxq!7?lbG)b(eTBO{25>iORT$~VaBw~Il4b;)XgJO3Rf zmkA5dpiD^P*nW-vs$JXHtK^nI`kNrIyi+@m243b5KFwr;g6s(NSH-cjrAI zI)JbmzkdE${NwaDL5-uMqe=!r|1v%JICG`LD7jW|UT$C?mDD)y;?->Oy^6%+;E4$e zY6Vc~c>HPUNZq~PWH-_L12UR3{!B-*+;|e-i|b(SI_jKDV9J9^;lrBTbl?Bz5{Lw_T9{>bM54b;DH% z4*$Ozy?!~APwBvM`qx@JE2)-3xzDg_EdCx)dK-{M^*~&)Kn6D|8A44}Vwbz)h*(wa zGv!s~L4E%?{VU!wPG{Bj9Ur&_4FD0C2w^1INt&aUAdet64x59IKz;IJa>{ z0uwa&NU98r}$Yx?LIf7k6nkfeOXYgg}A-{;EX<@?p?Uu#~{fn45?s_Mb{ zYe=gCWw# zd2aB#e(w4?#JoN@cYT20x!`PYR$`vT6$tZ9!hD@D-zj~)vfe`(Y;}cdh-JB;(nuV8 zV3pDj?+Wy(QcJImtI*3Xd)oE=uLEj)&xHP65w=5c0H~?y?~~{Q5Xe*5kf?qL4gfVZ z{UgR-@x!*?F5>qPwONY48igx1K4>KLCkG5bGQRjj=x;ax=Slh@s6QNl8OQ-c(my1|gR|E|(!YH+XoCX~WjMq|;dO+-0j3zZafu)@Un=i8kKtHxNf~9t|6+IX9qhm3 zbnQ}x&O=!k3R?q}KUGAuV;F|sUTkMi6#G`6P|K7?Yxs`YAi&n_bLBR!Ui@T?$C0{s z!z72elHOCV___dkhT%X{KUAQs<^Ye>gt{j^!_9%FX6S?dpnf=@7(jsWdyL;}P!LFb zP=9kkF@ON#lklJ{s1E^v0Ete53I`y-_79py`xF2;PYED0021K(xuHma>y!bI01T1% z;Fb|vKd#dfAWTW`X|M9&3Qu}sj-yW>@whN*|2?LW-2bTCNA1wE%+%y(MMH&an| zPu&~n6hQc?q?gpE5BxqbU{eMmO?!rPZ>u(6QK#Fp8boa&q;Ah)v|{6f{ysKr{Su#y zfX%9n5Bf)18-T3gAVlLH@O4_GKd<2(+U>T`zjPigKfFGq1Q>t~&V^|C?ch2kfC3ww zZ9_4H`$K2|1i%BD0pcVL+#qb*2I(q4erV0_jBor&9>Vp?^t%kD-TM#00gw$06AvFh zv^z@0xc+g@0dNd`h=gfmIzUts_=)W6^kii|zAG=kK!MufcswvH$ko<;Kg|-$p-DXT z{b^}z7`MDJ9t;wh<&CBvp!E%qs+@do)YzqJygms+_;8@8o~Z^v9^Twj1CZ5In(z=2 z(I&_W4nXWx|BQ(bF@V_k4Vn@kVgRwPMyn=1!~h%rE|~zb05Tm4AW-MXS#5-%3aI#p zWCEN+%N~Z|b)i2bz>tEV-42BQkN_eG2G>U;=m4DI*4O~Zaq5Os*JuHD{Gg7Fd*x=)uX!^&=V>_Io_8>lvU`V*y<4dNfsiWARx_SVg z>$oNOZWS^Eg&C(bcx2CYN&Io%xyqR#(~M6XnFENj6%RJ!R9Hf}gTZt<4eJi+Gf;l3 zAz{`@d=>_6S^(1gWs5ecd4SXhl|Vnu14gM2r~~Aq|J$Mi_~Ad}v*}BGn1F~+;U9yg^^)~1aVL;kz z`;R7r*Z@!fNf;y^wo)cE

- - - -
ASCII_INROWASCII_INCOLTCOD
-
    -
  • ascii, in columns : characters 0 to 15 are in the first column. The space character is at coordinates 2,0.
  • -
  • ascii, in rows : characters 0 to 15 are in the first row. The space character is at coordinates 0,2.
  • -
  • tcod : special mapping. Not all ascii values are mapped. The space character is at coordinates 0,0.
  • -
-
Different font types
- - - - -
standard
(non antialiased)
antialiased
(32 bits PNG)
antialiased
(greyscale)
-
    -
  • standard : transparency is given by a key color automatically detected by looking at the color of the space character
  • -
  • 32 bits : transparency is given by the png alpha layer. The font color does not matter but it must be desaturated
  • -
  • greyscale : transparency is given by the pixel value. You can use white characters on black background or black characters on white background. The background color is automatically detected by looking at the color of the space character
  • -
- Examples of fonts can be found in libtcod's fonts directory. Check the Readme file there. - @Cpp static void TCODConsole::setCustomFont(const char *fontFile, int flags=TCOD_FONT_LAYOUT_ASCII_INCOL,int nbCharHoriz=0, int nbCharVertic=0) - @C void TCOD_console_set_custom_font(const char *fontFile, int flags,int nb_char_horiz, int nb_char_vertic) - @Py console_set_custom_font(fontFile, flags=FONT_LAYOUT_ASCII_INCOL,nb_char_horiz=0, nb_char_vertic=0) - @C# - static void TCODConsole::setCustomFont(string fontFile) - static void TCODConsole::setCustomFont(string fontFile, int flags) - static void TCODConsole::setCustomFont(string fontFile, int flags, int nbCharHoriz) - static void TCODConsole::setCustomFont(string fontFile, int flags, int nbCharHoriz, int nbCharVertic) - @Lua - tcod.console.setCustomFont(fontFile) - tcod.console.setCustomFont(fontFile, flags) - tcod.console.setCustomFont(fontFile, nbCharHoriz) - tcod.console.setCustomFont(fontFile, flags, nbCharHoriz, nbCharVertic) - -- flags : tcod.LayoutAsciiInColumn, tcod.LayoutAsciiInRow, tcod.LayoutTCOD, tcod.Greyscale - @Param fontFile Name of a .bmp or .png file containing the font. - @Param flags Used to define the characters layout in the bitmap and the font type : - TCOD_FONT_LAYOUT_ASCII_INCOL : characters in ASCII order, code 0-15 in the first column - TCOD_FONT_LAYOUT_ASCII_INROW : characters in ASCII order, code 0-15 in the first row - TCOD_FONT_LAYOUT_TCOD : simplified layout. See examples below. - TCOD_FONT_TYPE_GREYSCALE : create an anti-aliased font from a greyscale bitmap - For Python, remove TCOD _ : - libtcod.FONT_LAYOUT_ASCII_INCOL - @Param nbCharHoriz,nbCharVertic Number of characters in the font. - Should be 16x16 for ASCII layouts, 32x8 for TCOD layout. - But you can use any other layout. - If set to 0, there are deduced from the font layout flag. - @CppEx - TCODConsole::setCustomFont("standard_8x8_ascii_in_col_font.bmp",TCOD_FONT_LAYOUT_ASCII_INCOL); - TCODConsole::setCustomFont("32bits_8x8_ascii_in_row_font.png",TCOD_FONT_LAYOUT_ASCII_INROW); - TCODConsole::setCustomFont("greyscale_8x8_tcod_font.png",TCOD_FONT_LAYOUT_TCOD | TCOD_FONT_TYPE_GREYSCALE); - @CEx - TCOD_console_set_custom_font("standard_8x8_ascii_in_col_font.bmp",TCOD_FONT_LAYOUT_ASCII_INCOL,16,16); - TCOD_console_set_custom_font("32bits_8x8_ascii_in_row_font.png",TCOD_FONT_LAYOUT_ASCII_INROW,32,8); - TCOD_console_set_custom_font("greyscale_8x8_tcod_font.png",TCOD_FONT_LAYOUT_TCOD | TCOD_FONT_TYPE_GREYSCALE,32,8); - @PyEx - libtcod.console_set_custom_font("standard_8x8_ascii_in_col_font.bmp",libtcod.FONT_LAYOUT_ASCII_INCOL) - libtcod.console_set_custom_font("32bits_8x8_ascii_in_row_font.png",libtcod.FONT_LAYOUT_ASCII_INROW) - libtcod.console_set_custom_font("greyscale_8x8_tcod_font.png",libtcod.FONT_LAYOUT_TCOD | libtcod.FONT_TYPE_GREYSCALE) - @LuaEx - tcod.console.setCustomFont("standard_8x8_ascii_in_col_font.bmp",tcod.LayoutAsciiInColumn); - tcod.console.setCustomFont("32bits_8x8_ascii_in_row_font.png",tcod.LayoutAsciiInRow); - tcod.console.setCustomFont("greyscale_8x8_tcod_font.png",tcod.LayoutTCOD + tcod.Greyscale); - */ - static void setCustomFont(const char *fontFile, int flags=TCOD_FONT_LAYOUT_ASCII_INCOL,int nbCharHoriz=0, int nbCharVertic=0); - - /** - @PageName console_map - @PageTitle Using custom characters mapping - @PageFather console_init - @FuncTitle Mapping a single ASCII code to a character - @PageDesc These functions allow you to map characters in the bitmap font to ASCII codes. - They should be called after initializing the root console with initRoot. - You can dynamically change the characters mapping at any time, allowing to use several fonts in the same screen. - @Cpp static void TCODConsole::mapAsciiCodeToFont(int asciiCode, int fontCharX, int fontCharY) - @C void TCOD_console_map_ascii_code_to_font(int asciiCode, int fontCharX, int fontCharY) - @Py console_map_ascii_code_to_font(asciiCode, fontCharX, fontCharY) - @C# static void TCODConsole::mapAsciiCodeToFont(int asciiCode, int fontCharX, int fontCharY) - @Lua tcod.console.mapAsciiCodeToFont(asciiCode, fontCharX, fontCharY) - @Param asciiCode ASCII code to map. - @Param fontCharX,fontCharY Coordinate of the character in the bitmap font (in characters, not pixels). - */ - static void mapAsciiCodeToFont(int asciiCode, int fontCharX, int fontCharY); - - /** - @PageName console_map - @FuncTitle Mapping consecutive ASCII codes to consecutive characters - @Cpp static void TCODConsole::mapAsciiCodesToFont(int firstAsciiCode, int nbCodes, int fontCharX, int fontCharY) - @C void TCOD_console_map_ascii_codes_to_font(int firstAsciiCode, int nbCodes, int fontCharX, int fontCharY) - @Py console_map_ascii_codes_to_font(firstAsciiCode, nbCodes, fontCharX, fontCharY) - @C# static void TCODConsole::mapAsciiCodesToFont(int firstAsciiCode, int nbCodes, int fontCharX, int fontCharY) - @Lua tcod.console.mapAsciiCodesToFont(firstAsciiCode, nbCodes, fontCharX, fontCharY) - @Param firstAsciiCode first ASCII code to map - @Param nbCodes number of consecutive ASCII codes to map - @Param fontCharX,fontCharY coordinate of the character in the bitmap font (in characters, not pixels) corresponding to the first ASCII code - */ - static void mapAsciiCodesToFont(int firstAsciiCode, int nbCodes, int fontCharX, int fontCharY); - - /** - @PageName console_map - @FuncTitle Mapping ASCII code from a string to consecutive characters - @Cpp static void TCODConsole::mapStringToFont(const char *s, int fontCharX, int fontCharY) - @C void TCOD_console_map_string_to_font(const char *s, int fontCharX, int fontCharY) - @Py console_map_string_to_font(s, fontCharX, fontCharY) - @C# static void TCODConsole::mapStringToFont(string s, int fontCharX, int fontCharY) - @Lua tcod.console.mapStringToFont(s, fontCharX, fontCharY) - @Param s string containing the ASCII codes to map - @Param fontCharX,fontCharY coordinate of the character in the bitmap font (in characters, not pixels) corresponding to the first ASCII code in the string - */ - static void mapStringToFont(const char *s, int fontCharX, int fontCharY); - - /** - @PageName console_fullscreen - @PageTitle Fullscreen mode - @PageFather console_init - @FuncTitle Getting the current mode - @FuncDesc This function returns true if the current mode is fullscreen. - @Cpp static bool TCODConsole::isFullscreen() - @C bool TCOD_console_is_fullscreen() - @Py console_is_fullscreen() - @C# static bool TCODConsole::isFullscreen() - @Lua tcod.console.isFullscreen() - */ - static bool isFullscreen(); - /** - @PageName console_fullscreen - @FuncTitle Switching between windowed and fullscreen modes - @FuncDesc This function switches the root console to fullscreen or windowed mode. - Note that there is no predefined key combination to switch to/from fullscreen. You have to do this in your own code. - @Cpp static void TCODConsole::setFullscreen(bool fullscreen) - @C void TCOD_console_set_fullscreen(bool fullscreen) - @Py console_set_fullscreen(fullscreen) - @C# static void TCODConsole::setFullscreen(bool fullscreen) - @Lua tcod.console.setFullscreen(fullscreen) - @Param fullscreen true to switch to fullscreen mode. - false to switch to windowed mode. - @CppEx - TCOD_key_t key; - TCODConsole::checkForEvent(TCOD_EVENT_KEY_PRESS,&key,NULL); - if ( key.vk == TCODK_ENTER && key.lalt ) - TCODConsole::setFullscreen(!TCODConsole::isFullscreen()); - @CEx - TCOD_key_t key; - TCOD_console_check_for_event(TCOD_EVENT_KEY_PRESS,&key,NULL); - if ( key.vk == TCODK_ENTER && key.lalt ) - TCOD_console_set_fullscreen(!TCOD_console_is_fullscreen()); - @PyEx - key=Key() - libtcod.console_check_for_event(libtcod.EVENT_KEY_PRESS,key,0) - if key.vk == libtcod.KEY_ENTER and key.lalt : - libtcod.console_set_fullscreen(not libtcod.console_is_fullscreen()) - @LuaEx - key=tcod.console.checkForKeypress() - if key.KeyCode == tcod.Enter and key.LeftAlt then - tcod.console.setFullscreen(not tcod.console.isFullscreen()) - end - */ - static void setFullscreen(bool fullscreen); - - /** - @PageName console_window - @PageFather console_init - @PageTitle Communicate with the window manager - @FuncTitle Changing the window title - @FuncDesc This function dynamically changes the title of the game window. - Note that the window title is not visible while in fullscreen. - @Cpp static void TCODConsole::setWindowTitle(const char *title) - @C void TCOD_console_set_window_title(const char *title) - @Py console_set_window_title(title) - @C# static void TCODConsole::setWindowTitle(string title) - @Lua tcod.console.setWindowTitle(title) - @Param title New title of the game window - */ - static void setWindowTitle(const char *title); - - /** - @PageName console_window - @FuncTitle Handling "close window" events - @FuncDesc When you start the program, this returns false. Once a "close window" event has been sent by the window manager, it will always return true. You're supposed to exit cleanly the game. - @Cpp static bool TCODConsole::isWindowClosed() - @C bool TCOD_console_is_window_closed() - @Py console_is_window_closed() - @C# static bool TCODConsole::isWindowClosed() - @Lua tcod.console.isWindowClosed() - */ - static bool isWindowClosed(); - - /** - @PageName console_window - @FuncTitle Check if the mouse cursor is inside the game window - @FuncDesc Returns true if the mouse cursor is inside the game window area and the game window is the active application. - @Cpp static bool TCODConsole::hasMouseFocus() - @C bool TCOD_console_has_mouse_focus() - @Py console_has_mouse_focus() - */ - static bool hasMouseFocus(); - - /** - @PageName console_window - @FuncTitle Check if the game application is active - @FuncDesc Returns false if the game window is not the active window or is iconified. - @Cpp static bool TCODConsole::isActive() - @C bool TCOD_console_is_active() - @Py console_is_active() - */ - static bool isActive(); - - /** - @PageName console_credits - @PageTitle libtcod's credits - @PageFather console_init - @PageDesc Use these functions to display credits, as seen in the samples. - @FuncTitle Using a separate credit page - @FuncDesc You can print a "Powered by libtcod x.y.z" screen during your game startup simply by calling this function after initRoot. - The credits screen can be skipped by pressing any key. - @Cpp static void TCODConsole::credits() - @C void TCOD_console_credits() - @Py console_credits() - @C# static void TCODConsole::credits() - @Lua tcod.console.credits() - */ - static void credits(); - - /** - @PageName console_credits - @FuncTitle Embedding credits in an existing page - @FuncDesc You can also print the credits on one of your game screens (your main menu for example) by calling this function in your main loop. - This function returns true when the credits screen is finished, indicating that you no longer need to call it. - @Cpp static bool TCODConsole::renderCredits(int x, int y, bool alpha) - @C bool TCOD_console_credits_render(int x, int y, bool alpha) - @Py bool TCOD_console_credits_render(int x, int y, bool alpha) - @C# static bool TCODConsole::renderCredits(int x, int y, bool alpha) - @Lua tcod.console.renderCredits(x, y, alpha) - @Param x,y Position of the credits text in your root console - @Param alpha If true, credits are transparently added on top of the existing screen. - For this to work, this function must be placed between your screen rendering code and the console flush. - @CppEx - TCODConsole::initRoot(80,50,"The Chronicles Of Doryen v0.1",false); // initialize the root console - bool endCredits=false; - while ( ! TCODConsole::isWindowClosed() ) { // your game loop - // your game rendering here... - // render transparent credits near the center of the screen - if (! endCredits ) endCredits=TCODConsole::renderCredits(35,25,true); - TCODConsole::flush(); - } - @CEx - TCOD_console_init_root(80,50,"The Chronicles Of Doryen v0.1",false); - bool end_credits=false; - while ( ! TCOD_console_is_window_closed() ) { - // your game rendering here... - // render transparent credits near the center of the screen - if (! end_credits ) end_credits=TCOD_console_credits_render(35,25,true); - TCOD_console_flush(); - } - @PyEx - libtcod.console_init_root(80,50,"The Chronicles Of Doryen v0.1",False) - end_credits=False - while not libtcod.console_is_window_closed() : - // your game rendering here... - // render transparent credits near the center of the screen - if (not end_credits ) : end_credits=libtcod.console_credits_render(35,25,True) - libtcod.console_flush() - @LuaEx - tcod.console.initRoot(80,50,"The Chronicles Of Doryen v0.1") -- initialize the root console - endCredits=false - while not tcod.console.isWindowClosed() do -- your game loop - -- your game rendering here... - -- render transparent credits near the center of the screen - if not endCredits then endCredits=tcod.console.renderCredits(35,25,true) end - tcod.console.flush() - end - */ - static bool renderCredits(int x, int y, bool alpha); - - /** - @PageName console_credits - @FuncTitle Restart the credits animation - @FuncDesc When using rederCredits, you can restart the credits animation from the beginning before it's finished by calling this function. - @Cpp static void TCODConsole::resetCredits() - @C void TCOD_console_credits_reset() - @Py console_credits_reset() - @C# static void TCODConsole::resetCredits() - @Lua tcod.console.resetCredits() - */ - static void resetCredits(); - - /** - @PageName console_draw - @PageTitle Drawing on the root console - @PageFather console - */ - - /** - @PageName console_draw_basic - @PageTitle Basic printing functions - @PageFather console_draw - @FuncTitle Setting the default background color - @FuncDesc This function changes the default background color for a console. The default background color is used by several drawing functions like clear, putChar, ... - @Cpp void TCODConsole::setDefaultBackground(TCODColor back) - @C void TCOD_console_set_default_background(TCOD_console_t con,TCOD_color_t back) - @Py console_set_default_background(con,back) - @C# void TCODConsole::setBackgroundColor(TCODColor back) - @Lua Console:setBackgroundColor(back) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param back the new default background color for this console - @CppEx TCODConsole::root->setDefaultBackground(myColor) - @CEx TCOD_console_set_default_background(NULL, my_color) - @PyEx litbcod.console_set_default_background(0, my_color) - @Lua libtcod.TCODConsole_root:setBackgroundColor( myColor ) - */ - void setDefaultBackground(TCODColor back); - - /** - @PageName console_draw_basic - @FuncTitle Setting the default foreground color - @FuncDesc This function changes the default foreground color for a console. The default foreground color is used by several drawing functions like clear, putChar, ... - @Cpp void TCODConsole::setDefaultForeground(TCODColor fore) - @C void TCOD_console_set_default_foreground(TCOD_console_t con,TCOD_color_t fore) - @Py console_set_default_foreground(con, fore) - @C# void TCODConsole::setForegroundColor(TCODColor fore) - @Lua Console:setForegroundColor(fore) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param fore the new default foreground color for this console - @CppEx TCODConsole::root->setDefaultForeground(myColor) - @CEx TCOD_console_set_default_foreground(NULL, my_color) - @PyEx litbcod.console_set_default_foreground(0, my_color) - @LuaEx libtcod.TCODConsole_root:setForegroundColor( myColor ) - */ - void setDefaultForeground(TCODColor fore); - - /** - @PageName console_draw_basic - @FuncTitle Clearing a console - @FuncDesc This function modifies all cells of a console : - * set the cell's background color to the console default background color - * set the cell's foreground color to the console default foreground color - * set the cell's ASCII code to 32 (space) - @Cpp void TCODConsole::clear() - @C void TCOD_console_clear(TCOD_console_t con) - @Py console_clear(con) - @C# void TCODConsole::clear() - @Lua Console:clear() - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - */ - void clear(); - - /** - @PageName console_draw_basic - @FuncTitle Setting the background color of a cell - @FuncDesc This function modifies the background color of a cell, leaving other properties (foreground color and ASCII code) unchanged. - @Cpp void TCODConsole::setCharBackground(int x, int y, const TCODColor &col, TCOD_bkgnd_flag_t flag = TCOD_BKGND_SET) - @C void TCOD_console_set_char_background(TCOD_console_t con,int x, int y, TCOD_color_t col, TCOD_bkgnd_flag_t flag) - @Py console_set_char_background(con, x, y, col, flag=BKGND_SET) - @C# - void TCODConsole::setCharBackground(int x, int y, TCODColor col) - void TCODConsole::setCharBackground(int x, int y, TCODColor col, TCODBackgroundFlag flag) - @Lua - Console:setCharBackground(x, y, col) - Console:setCharBackground(x, y, col, flag) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinates of the cell in the console. - 0 <= x < console width - 0 <= y < console height - @Param col the background color to use. You can use color constants - @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t - */ - void setCharBackground(int x, int y, const TCODColor &col, TCOD_bkgnd_flag_t flag = TCOD_BKGND_SET); - /** - @PageName console_draw_basic - @FuncTitle Setting the foreground color of a cell - @FuncDesc This function modifies the foreground color of a cell, leaving other properties (background color and ASCII code) unchanged. - @Cpp void TCODConsole::setCharForeground(int x, int y, const TCODColor &col) - @C void TCOD_console_set_char_foreground(TCOD_console_t con,int x, int y, TCOD_color_t col) - @Py console_set_char_foreground(con, x, y, col) - @C# void TCODConsole::setCharForeground(int x, int y, TCODColor col) - @Lua Console:setCharForeground(x, y, col) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinates of the cell in the console. - 0 <= x < console width - 0 <= y < console height - @Param col the foreground color to use. You can use color constants - */ - void setCharForeground(int x, int y, const TCODColor &col); - - /** - @PageName console_draw_basic - @FuncTitle Setting the ASCII code of a cell - @FuncDesc This function modifies the ASCII code of a cell, leaving other properties (background and foreground colors) unchanged. - Note that since a clear console has both background and foreground colors set to black for every cell, using setchar will produce black characters on black background. Use putchar instead. - @Cpp void TCODConsole::setChar(int x, int y, int c) - @C void TCOD_console_set_char(TCOD_console_t con,int x, int y, int c) - @Py console_set_char(con, x, y, c) - @C# void TCODConsole::setChar(int x, int y, int c) - @Lua Console:setChar(x, y, c) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinates of the cell in the console. - 0 <= x < console width - 0 <= y < console height - @Param c the new ASCII code for the cell. You can use ASCII constants - */ - void setChar(int x, int y, int c); - - /** - @PageName console_draw_basic - @FuncTitle Setting every property of a cell using default colors - @FuncDesc This function modifies every property of a cell : - * update the cell's background color according to the console default background color (see TCOD_bkgnd_flag_t). - * set the cell's foreground color to the console default foreground color - * set the cell's ASCII code to c - @Cpp void TCODConsole::putChar(int x, int y, int c, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT) - @C void TCOD_console_put_char(TCOD_console_t con,int x, int y, int c, TCOD_bkgnd_flag_t flag) - @Py console_put_char( con, x, y, c, flag=BKGND_DEFAULT) - @C# - void TCODConsole::putChar(int x, int y, int c) - void TCODConsole::putChar(int x, int y, int c, TCODBackgroundFlag flag) - @Lua - Console:putChar(x, y, c) - Console:putChar(x, y, c, flag) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinates of the cell in the console. - 0 <= x < console width - 0 <= y < console height - @Param c the new ASCII code for the cell. You can use ASCII constants - @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t - */ - void putChar(int x, int y, int c, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT); - - /** - @PageName console_draw_basic - @FuncTitle Setting every property of a cell using specific colors - @FuncDesc This function modifies every property of a cell : - * set the cell's background color to back. - * set the cell's foreground color to fore. - * set the cell's ASCII code to c. - @Cpp void TCODConsole::putCharEx(int x, int y, int c, const TCODColor & fore, const TCODColor & back) - @C void TCOD_console_put_char_ex(TCOD_console_t con,int x, int y, int c, TCOD_color_t fore, TCOD_color_t back) - @Py console_put_char_ex( con, x, y, c, fore, back) - @C# void TCODConsole::putCharEx(int x, int y, int c, TCODColor fore, TCODColor back) - @Lua Console:putCharEx(x, y, c, fore, back) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinates of the cell in the console. - 0 <= x < console width - 0 <= y < console height - @Param c the new ASCII code for the cell. You can use ASCII constants - @Param fore,back new foreground and background colors for this cell - */ - void putCharEx(int x, int y, int c, const TCODColor &fore, const TCODColor &back); - - /** - @PageName console_bkgnd_flag_t - @PageTitle Background effect flags - @PageFather console_draw - @PageDesc This flag is used by most functions that modify a cell background color. It defines how the console's current background color is used to modify the cell's existing background color : - TCOD_BKGND_NONE : the cell's background color is not modified. - TCOD_BKGND_SET : the cell's background color is replaced by the console's default background color : newbk = curbk. - TCOD_BKGND_MULTIPLY : the cell's background color is multiplied by the console's default background color : newbk = oldbk * curbk - TCOD_BKGND_LIGHTEN : newbk = MAX(oldbk,curbk) - TCOD_BKGND_DARKEN : newbk = MIN(oldbk,curbk) - TCOD_BKGND_SCREEN : newbk = white - (white - oldbk) * (white - curbk) // inverse of multiply : (1-newbk) = (1-oldbk)*(1-curbk) - TCOD_BKGND_COLOR_DODGE : newbk = curbk / (white - oldbk) - TCOD_BKGND_COLOR_BURN : newbk = white - (white - oldbk) / curbk - TCOD_BKGND_ADD : newbk = oldbk + curbk - TCOD_BKGND_ADDALPHA(alpha) : newbk = oldbk + alpha*curbk - TCOD_BKGND_BURN : newbk = oldbk + curbk - white - TCOD_BKGND_OVERLAY : newbk = curbk.x <= 0.5 ? 2*curbk*oldbk : white - 2*(white-curbk)*(white-oldbk) - TCOD_BKGND_ALPHA(alpha) : newbk = (1.0f-alpha)*oldbk + alpha*(curbk-oldbk) - TCOD_BKGND_DEFAULT : use the console's default background flag - Note that TCOD_BKGND_ALPHA and TCOD_BKGND_ADDALPHA are MACROS that needs a float parameter between (0.0 and 1.0). TCOD_BKGND_ALPH and TCOD_BKGND_ADDA should not be used directly (else they will have the same effect as TCOD_BKGND_NONE). - For Python, remove TCOD_ : libtcod.BKGND_NONE - For C# : None, Set, Multiply, Lighten, Darken, Screen, ColodDodge, ColorBurn, Add, Burn Overlay, Default - With lua, use tcod.None, ..., tcod.Default, BUT tcod.console.Alpha(value) and tcod.console.AddAlpha(value) - */ - - /** - @PageName console_print - @PageTitle String drawing functions - @PageFather console_draw - @FuncTitle Setting the default background flag - @FuncDesc This function defines the background mode (see TCOD_bkgnd_flag_t) for the console. - This default mode is used by several functions (print, printRect, ...) - @Cpp void TCODConsole::setBackgroundFlag(TCOD_bkgnd_flag_t flag) - @C void TCOD_console_set_background_flag(TCOD_console_t con,TCOD_bkgnd_flag_t flag) - @Py console_set_background_flag(con, flag) - @C# void TCODConsole::setBackgroundFlag(TCODBackgroundFlag flag) - @Lua Console:setBackgroundFlag(flag) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t - */ - void setBackgroundFlag(TCOD_bkgnd_flag_t flag); - - /** - @PageName console_print - @FuncTitle Getting the default background flag - @FuncDesc This function returns the background mode (see TCOD_bkgnd_flag_t) for the console. - This default mode is used by several functions (print, printRect, ...) - @Cpp TCOD_bkgnd_flag_t TCODConsole::getBackgroundFlag() const - @C TCOD_bkgnd_flag_t TCOD_console_get_background_flag(TCOD_console_t con) - @Py console_get_background_flag(con) - @C# TCODBackgroundFlag TCODConsole::getBackgroundFlag() - @Lua Console:getBackgroundFlag() - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - */ - TCOD_bkgnd_flag_t getBackgroundFlag() const; - - /** - @PageName console_print - @FuncTitle Setting the default alignment - @FuncDesc This function defines the default alignment (see TCOD_alignment_t) for the console. - This default alignment is used by several functions (print, printRect, ...). - Values for alignment : TCOD_LEFT, TCOD_CENTER, TCOD_RIGHT (in Python, remove TCOD_ : libtcod.LEFT). - For C# and Lua : LeftAlignment, RightAlignment, CenterAlignment - @Cpp void TCODConsole::setAlignment(TCOD_alignment_t alignment) - @C void TCOD_console_set_alignment(TCOD_console_t con,TCOD_bkgnd_flag_t alignment) - @Py console_set_alignment(con, alignment) - @C# void TCODConsole::setAlignment(TCODAlignment alignment) - @Lua Console:setAlignment(alignment) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param alignment defines how the strings are printed on screen. - */ - void setAlignment(TCOD_alignment_t alignment); - - /** - @PageName console_print - @FuncTitle Getting the default alignment - @FuncDesc This function returns the default alignment (see TCOD_alignment_t) for the console. - This default mode is used by several functions (print, printRect, ...). - Values for alignment : TCOD_LEFT, TCOD_CENTER, TCOD_RIGHT (in Python, remove TCOD_ : libtcod.LEFT). - For C# and Lua : LeftAlignment, RightAlignment, CenterAlignment - @Cpp TCOD_alignment_t TCODConsole::getAlignment() const - @C TCOD_alignment_t TCOD_console_get_alignment(TCOD_console_t con) - @Py console_get_alignment(con) - @C# TCODAlignment TCODConsole::getAlignment() - @Lua Console:getAlignment() - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - */ - TCOD_alignment_t getAlignment() const; - - /** - @PageName console_print - @FuncTitle Printing a string with default parameters - @FuncDesc This function print a string at a specific position using current default alignment, background flag, foreground and background colors. - @Cpp void TCODConsole::print(int x, int y, const char *fmt, ...) - @C void TCOD_console_print(TCOD_console_t con,int x, int y, const char *fmt, ...) - @Py console_print(con, x, y, fmt) - @C# void TCODConsole::print(int x, int y, string fmt) - @Lua Console:print(x, y, fmt) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinate of the character in the console, depending on the default alignment for this console : - * TCOD_LEFT : leftmost character of the string - * TCOD_CENTER : center character of the string - * TCOD_RIGHT : rightmost character of the string - @Param fmt printf-like format string, eventually followed by parameters. You can use control codes to change the colors inside the string, except in C#. - */ - void print(int x, int y, const char *fmt, ...); - - /** - @PageName console_print - @FuncTitle Printing a string with specific alignment and background mode - @FuncDesc This function print a string at a specific position using specific alignment and background flag, but default foreground and background colors. - @Cpp void TCODConsole::printEx(int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...) - @C void TCOD_console_print_ex(TCOD_console_t con,int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...) - @Py console_print_ex(con, x, y, flag, alignment, fmt) - @C# void TCODConsole::printEx(int x, int y, TCODBackgroundFlag flag, TCODAlignment alignment, string fmt) - @Lua Console::printEx(x, y, flag, alignment, fmt) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinate of the character in the console, depending on the alignment : - * TCOD_LEFT : leftmost character of the string - * TCOD_CENTER : center character of the string - * TCOD_RIGHT : rightmost character of the string - @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t - @Param alignment defines how the strings are printed on screen. - @Param fmt printf-like format string, eventually followed by parameters. You can use control codes to change the colors inside the string, except in C#. - */ - void printEx(int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...); - - /** - @PageName console_print - @FuncTitle Printing a string with default parameters and autowrap - @FuncDesc This function draws a string in a rectangle inside the console, using default colors, alignment and background mode. - If the string reaches the borders of the rectangle, carriage returns are inserted. - If h > 0 and the bottom of the rectangle is reached, the string is truncated. If h = 0, the string is only truncated if it reaches the bottom of the console. - The function returns the height (number of console lines) of the printed string. - @Cpp int TCODConsole::printRect(int x, int y, int w, int h, const char *fmt, ...) - @C int TCOD_console_print_rect(TCOD_console_t con,int x, int y, int w, int h, const char *fmt, ...) - @Py console_print_rect(con, x, y, w, h, fmt) - @C# int TCODConsole::printRect(int x, int y, int w, int h, string fmt) - @Lua Console:printRect(x, y, w, h, fmt) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinate of the character in the console, depending on the alignment : - * TCOD_LEFT : leftmost character of the string - * TCOD_CENTER : center character of the string - * TCOD_RIGHT : rightmost character of the string - @Param w,h size of the rectangle - x <= x+w < console width - y <= y+h < console height - @Param fmt printf-like format string, eventually followed by parameters. You can use control codes to change the colors inside the string, except in C#. - */ - int printRect(int x, int y, int w, int h, const char *fmt, ...); - - /** - @PageName console_print - @FuncTitle Printing a string with specific alignment and background mode and autowrap - @FuncDesc This function draws a string in a rectangle inside the console, using default colors, but specific alignment and background mode. - If the string reaches the borders of the rectangle, carriage returns are inserted. - If h > 0 and the bottom of the rectangle is reached, the string is truncated. If h = 0, the string is only truncated if it reaches the bottom of the console. - The function returns the height (number of console lines) of the printed string. - @Cpp int TCODConsole::printRectEx(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...) - @C int TCOD_console_print_rect_ex(TCOD_console_t con,int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...) - @Py console_print_rect_ex(con, x, y, w, h, flag, alignment, fmt) - @C# int TCODConsole::printRectEx(int x, int y, int w, int h, TCODBackgroundFlag flag, TCODAlignment alignment, string fmt) - @Lua Console:printRectEx(x, y, w, h, flag, alignment, fmt) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinate of the character in the console, depending on the alignment : - * TCOD_LEFT : leftmost character of the string - * TCOD_CENTER : center character of the string - * TCOD_RIGHT : rightmost character of the string - @Param w,h size of the rectangle - x <= x+w < console width - y <= y+h < console height - @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t - @Param alignment defines how the strings are printed on screen. - @Param fmt printf-like format string, eventually followed by parameters. You can use control codes to change the colors inside the string, except in C#. - */ - int printRectEx(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...); - - /** - @PageName console_print - @FuncTitle Compute the height of an autowrapped string - @FuncDesc This function returns the expected height of an autowrapped string without actually printing the string with printRect or printRectEx - @Cpp int TCODConsole::getHeightRect(int x, int y, int w, int h, const char *fmt, ...) - - @C int TCOD_console_get_height_rect(TCOD_console_t con,int x, int y, int w, int h, const char *fmt, ...) - @Py console_get_height_rect(con, x, y, w, h, fmt) - @C# int TCODConsole::getHeightRect(int x, int y, int w, int h, string fmt) - @Lua Console:getHeightRect(x, y, w, h, fmt) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinate of the rectangle upper-left corner in the console - @Param w,h size of the rectangle - x <= x+w < console width - y <= y+h < console height - @Param fmt printf-like format string, eventually followed by parameters. You can use control codes to change the colors inside the string, except in C#. - */ - int getHeightRect(int x, int y, int w, int h, const char *fmt, ...); - - /** - @PageName console_print - @FuncTitle Changing the colors while printing a string - @FuncDesc If you want to draw a string using different colors for each word, the basic solution is to call a string printing function several times, changing the default colors between each call. - The TCOD library offers a simpler way to do this, allowing you to draw a string using different colors in a single call. For this, you have to insert color control codes in your string. - A color control code is associated with a color set (a foreground color and a background color). If you insert this code in your string, the next characters will use the colors associated with the color control code. - There are 5 predefined color control codes : - For Python, remove TCOD_ : libtcod.COLCTRL_1 - TCOD_COLCTRL_1 - TCOD_COLCTRL_2 - TCOD_COLCTRL_3 - TCOD_COLCTRL_4 - TCOD_COLCTRL_5 - To associate a color with a code, use setColorControl. - To go back to the console's default colors, insert in your string the color stop control code : - TCOD_COLCTRL_STOP - - You can also use any color without assigning it to a control code, using the generic control codes : - TCOD_COLCTRL_FORE_RGB - TCOD_COLCTRL_BACK_RGB - - Those controls respectively change the foreground and background color used to print the string characters. In the string, you must insert the r,g,b components of the color (between 1 and 255. The value 0 is forbidden because it represents the end of the string in C/C++) immediately after this code. - @Cpp static void TCODConsole::setColorControl(TCOD_colctrl_t con, const TCODColor &fore, const TCODColor &back) - @C void TCOD_console_set_color_control(TCOD_colctrl_t con, TCOD_color_t fore, TCOD_color_t back) - @Py console_set_color_control(con,fore,back) - @C# Not supported directly, use getRGBColorControlString and getColorControlString. - @Lua Not supported - @Param con the color control TCOD_COLCTRL_x, 1<=x<=5 - @Param fore foreground color when this control is activated - @Param back background color when this control is activated - @CppEx - // A string with a red over black word, using predefined color control codes - TCODConsole::setColorControl(TCOD_COLCTRL_1,TCODColor::red,TCODColor::black); - TCODConsole::root->print(1,1,"String with a %cred%c word.",TCOD_COLCTRL_1,TCOD_COLCTRL_STOP); - // A string with a red over black word, using generic color control codes - TCODConsole::root->print(1,1,"String with a %c%c%c%c%c%c%c%cred%c word.", - TCOD_COLCTRL_FORE_RGB,255,1,1,TCOD_COLCTRL_BACK_RGB,1,1,1,TCOD_COLCTRL_STOP); - // A string with a red over black word, using generic color control codes - TCODConsole::root->print(1,1,"String with a %c%c%c%c%c%c%c%cred%c word.", - TCOD_COLCTRL_FORE_RGB,255,1,1,TCOD_COLCTRL_BACK_RGB,1,1,1,TCOD_COLCTRL_STOP); - @CEx - // A string with a red over black word, using predefined color control codes - TCOD_console_set_color_control(TCOD_COLCTRL_1,red,black); - TCOD_console_print(NULL,1,1,"String with a %cred%c word.",TCOD_COLCTRL_1,TCOD_COLCTRL_STOP); - // A string with a red word (over default background color), using generic color control codes - TCOD_console_print(NULL,1,1,"String with a %c%c%c%cred%c word.", - TCOD_COLCTRL_FORE_RGB,255,1,1,TCOD_COLCTRL_STOP); - // A string with a red over black word, using generic color control codes - TCOD_console_print(NULL,1,1,"String with a %c%c%c%c%c%c%c%cred%c word.", - TCOD_COLCTRL_FORE_RGB,255,1,1,TCOD_COLCTRL_BACK_RGB,1,1,1,TCOD_COLCTRL_STOP); - @PyEx - # A string with a red over black word, using predefined color control codes - libtcod.console_set_color_control(libtcod.COLCTRL_1,litbcod.red,litbcod.black) - libtcod.console_print(0,1,1,"String with a %cred%c word."%(libtcod.COLCTRL_1,libtcod.COLCTRL_STOP)) - # A string with a red word (over default background color), using generic color control codes - litbcod.console_print(0,1,1,"String with a %c%c%c%cred%c word."%(libtcod.COLCTRL_FORE_RGB,255,1,1,libtcod.COLCTRL_STOP)) - # A string with a red over black word, using generic color control codes - libtcod.console_print(0,1,1,"String with a %c%c%c%c%c%c%c%cred%c word."% - (libtcod.COLCTRL_FORE_RGB,255,1,1,libtcod.COLCTRL_BACK_RGB,1,1,1,libtcod.COLCTRL_STOP)) - - @C#Ex - TCODConsole.root.print(1,1,String.Format("String with a {0}red{1} word.", - TCODConsole.getRGBColorControlString(ColorControlForeground,TCODColor.red), - TCODConsole.getColorControlString(ColorControlStop)); - */ - static void setColorControl(TCOD_colctrl_t con, const TCODColor &fore, const TCODColor &back); - -#ifndef NO_UNICODE - /** - @PageName console_print - @FuncTitle Unicode functions - @FuncDesc those functions are similar to their ASCII equivalent, but work with unicode strings (wchar_t in C/C++). - Note that unicode is not supported in the Python wrapper. - @Cpp static void TCODConsole::mapStringToFont(const wchar_t *s, int fontCharX, int fontCharY) - @C void TCOD_console_map_string_to_font_utf(const wchar_t *s, int fontCharX, int fontCharY) - */ - static void mapStringToFont(const wchar_t *s, int fontCharX, int fontCharY); - /** - @PageName console_print - @Cpp void TCODConsole::print(int x, int y, const wchar_t *fmt, ...) - @C void TCOD_console_print_utf(TCOD_console_t con,int x, int y, const wchar_t *fmt, ...) - */ - void print(int x, int y, const wchar_t *fmt, ...); - /** - @PageName console_print - @Cpp void TCODConsole::printEx(int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...) - @C void TCOD_console_print_ex_utf(TCOD_console_t con,int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...) - */ - void printEx(int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...); - /** - @PageName console_print - @Cpp int TCODConsole::printRect(int x, int y, int w, int h, const wchar_t *fmt, ...) - @C int TCOD_console_print_rect_utf(TCOD_console_t con,int x, int y, int w, int h, const wchar_t *fmt, ...) - */ - int printRect(int x, int y, int w, int h, const wchar_t *fmt, ...); - - /** - @PageName console_print - @Cpp int TCODConsole::printRectEx(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...) - @C int TCOD_console_print_rect_ex_utf(TCOD_console_t con,int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...) - */ - int printRectEx(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...); - - /** - @PageName console_print - @Cpp int TCODConsole::getHeightRect(int x, int y, int w, int h, const wchar_t *fmt, ...) - @C int TCOD_console_get_height_rect_utf(TCOD_console_t con,int x, int y, int w, int h, const wchar_t *fmt, ...) - */ - int getHeightRect(int x, int y, int w, int h, const wchar_t *fmt, ...); -#endif - - /** - @PageName console_advanced - @PageFather console_draw - @PageTitle Advanced printing functions - @FuncTitle Filling a rectangle with the background color - @FuncDesc Fill a rectangle inside a console. For each cell in the rectangle : - * set the cell's background color to the console default background color - * if clear is true, set the cell's ASCII code to 32 (space) - @Cpp void TCODConsole::rect(int x, int y, int w, int h, bool clear, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT) - @C void TCOD_console_rect(TCOD_console_t con,int x, int y, int w, int h, bool clear, TCOD_bkgnd_flag_t flag) - @Py console_rect(con,x, y, w, h, clear, flag=BKGND_DEFAULT) - @C# - void TCODConsole::rect(int x, int y, int w, int h, bool clear) - void TCODConsole::rect(int x, int y, int w, int h, bool clear, TCODBackgroundFlag flag) - @Lua - Console:rect(x, y, w, h, clear) - Console:rect(x, y, w, h, clear, flag) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinates of rectangle upper-left corner in the console. - 0 <= x < console width - 0 <= y < console height - @Param w,h size of the rectangle in the console. - x <= x+w < console width - y <= y+h < console height - @Param clear if true, all characters inside the rectangle are set to ASCII code 32 (space). - If false, only the background color is modified - @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t - */ - void rect(int x, int y, int w, int h, bool clear, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT); - - /** - @PageName console_advanced - @FuncTitle Drawing an horizontal line - @FuncDesc Draws an horizontal line in the console, using ASCII code TCOD_CHAR_HLINE (196), and the console's default background/foreground colors. - @Cpp void TCODConsole::hline(int x,int y, int l, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT) - @C void TCOD_console_hline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag) - @Py console_hline(con,x,y,l,flag=BKGND_DEFAULT) - @C# - void TCODConsole::hline(int x,int y, int l) - void TCODConsole::hline(int x,int y, int l, TCODBackgroundFlag flag) - @Lua - Console:hline(x,y, l) - Console:hline(x,y, l, flag) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y Coordinates of the line's left end in the console. - 0 <= x < console width - 0 <= y < console height - @Param l The length of the line in cells 1 <= l <= console width - x - @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t - */ - void hline(int x,int y, int l, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT); - - /** - @PageName console_advanced - @FuncTitle Drawing an vertical line - @FuncDesc Draws an vertical line in the console, using ASCII code TCOD_CHAR_VLINE (179), and the console's default background/foreground colors. - @Cpp void TCODConsole::vline(int x,int y, int l, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT) - @C void TCOD_console_vline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag) - @Py console_vline(con,x,y,l,flag=BKGND_DEFAULT) - @C# - void TCODConsole::vline(int x,int y, int l) - void TCODConsole::vline(int x,int y, int l, TCODBackgroundFlag flag) - @Lua - Console:vline(x,y, l) - Console:vline(x,y, l, flag) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y Coordinates of the line's upper end in the console. - 0 <= x < console width - 0 <= y < console height - @Param l The length of the line in cells 1 <= l <= console height - y - @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t - */ - void vline(int x,int y, int l, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT); - - /** - @PageName console_advanced - @FuncTitle Drawing a window frame - @FuncDesc This function calls the rect function using the supplied background mode flag, then draws a rectangle with the console's default foreground color. If fmt is not NULL, it is printed on the top of the rectangle, using inverted colors. - @Cpp void TCODConsole::printFrame(int x,int y,int w,int h, bool clear=true, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT, const char *fmt=NULL, ...) - @C void TCOD_console_print_frame(TCOD_console_t con,int x,int y,int w,int h, bool clear, TCOD_bkgnd_flag_t flag, const char *fmt, ...) - @Py console_print_frame(con,x, y, w, h, clear=True, flag=BKGND_DEFAULT, fmt=0) - @C# - void TCODConsole::printFrame(int x,int y, int w,int h) - void TCODConsole::printFrame(int x,int y, int w,int h, bool clear) - void TCODConsole::printFrame(int x,int y, int w,int h, bool clear, TCODBackgroundFlag flag) - void TCODConsole::printFrame(int x,int y, int w,int h, bool clear, TCODBackgroundFlag flag, string fmt) - @Lua - Console:printFrame(x,y, w,h) - Console:printFrame(x,y, w,h, clear) - Console:printFrame(x,y, w,h, clear, flag) - Console:printFrame(x,y, w,h, clear, flag, fmt) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y Coordinates of the rectangle's upper-left corner in the console. - 0 <= x < console width - 0 <= y < console height - @Param w,h size of the rectangle in the console. - x <= x+w < console width - y <= y+h < console height - @Param clear if true, all characters inside the rectangle are set to ASCII code 32 (space). - If false, only the background color is modified - @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t - @Param fmt if NULL, the function only draws a rectangle. - Else, printf-like format string, eventually followed by parameters. You can use control codes to change the colors inside the string. - */ - void printFrame(int x,int y,int w,int h, bool clear=true, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT, const char *fmt=NULL, ...); - - /** - @PageName console_advanced - @FuncTitle Manipulating foreground colors as an image - @FuncDesc This function obtains the image containing the console foreground colors. - @Cpp TCODImage *TCODConsole::getForegroundImage() - @C TCOD_image_t TCOD_console_get_foreground_color_image(TCOD_console_t con) - @Py console_get_foreground_image(con) - */ - TCODImage *getForegroundColorImage(); - - /** - @PageName console_advanced - @FuncTitle Manipulating background colors as an image - @FuncDesc This function obtains the image containing the console background colors. - @Cpp TCODImage *TCODConsole::getBackgroundImage() - @C TCOD_image_t TCOD_console_get_background_color_image(TCOD_console_t con) - @Py console_get_background_image(con) - */ - TCODImage *getBackgroundColorImage(); - - /** - @PageName console_read - @PageTitle Reading the content of the console - @PageFather console_draw - @FuncTitle Get the console's width - @FuncDesc This function returns the width of a console (either the root console or an offscreen console) - @Cpp int TCODConsole::getWidth() const - @C int TCOD_console_get_width(TCOD_console_t con) - @Py console_get_width(con) - @C# int TCODConsole::getWidth() - @Lua Console:getWidth() - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - */ - int getWidth() const; - - /** - @PageName console_read - @FuncTitle Get the console's height - @FuncDesc This function returns the height of a console (either the root console or an offscreen console) - @Cpp int TCODConsole::getHeight() const - @C int TCOD_console_get_height(TCOD_console_t con) - @Py console_get_height(con) - @C# int TCODConsole::getHeight() - @Lua Console:getHeight() - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - */ - int getHeight() const; - - /** - @PageName console_read - @FuncTitle Reading the default background color - @FuncDesc This function returns the default background color of a console. - @Cpp TCODColor TCODConsole::getDefaultBackground() const - @C TCOD_color_t TCOD_console_get_default_background(TCOD_console_t con) - @Py console_get_default_background(con) - @C# TCODColor TCODConsole::getBackgroundColor() - @Lua Console:getBackgroundColor() - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - */ - TCODColor getDefaultBackground() const; - - /** - @PageName console_read - @FuncTitle Reading the default foreground color - @FuncDesc This function returns the default foreground color of a console. - @Cpp TCODColor TCODConsole::getDefaultForeground() const - @C TCOD_color_t TCOD_console_get_default_foreground(TCOD_console_t con) - @Py console_get_default_foreground(con) - @C# TCODColor TCODConsole::getForegroundColor() - @Lua Console:getForegroundColor() - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - */ - TCODColor getDefaultForeground() const; - - /** - @PageName console_read - @FuncTitle Reading the background color of a cell - @FuncDesc This function returns the background color of a cell. - @Cpp TCODColor TCODConsole::getCharBackground(int x, int y) const - @C TCOD_color_t TCOD_console_get_char_background(TCOD_console_t con,int x, int y) - @Py console_get_char_background(con,x,y) - @C# TCODColor TCODConsole::getCharBackground(int x, int y) - @Lua Console::getCharBackground(x, y) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinates of the cell in the console. - 0 <= x < console width - 0 <= y < console height - */ - TCODColor getCharBackground(int x, int y) const; - - /** - @PageName console_read - @FuncTitle Reading the foreground color of a cell - @FuncDesc This function returns the foreground color of a cell. - @Cpp TCODColor TCODConsole::getCharForeground(int x, int y) const - @C TCOD_color_t TCOD_console_get_char_foreground(TCOD_console_t con,int x, int y) - @Py console_get_char_foreground(con,x,y) - @C# TCODColor TCODConsole::getCharForeground(int x, int y) - @Lua Console::getCharForeground(x, y) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinates of the cell in the console. - 0 <= x < console width - 0 <= y < console height - */ - TCODColor getCharForeground(int x, int y) const; - - /** - @PageName console_read - @FuncTitle Reading the ASCII code of a cell - @FuncDesc This function returns the ASCII code of a cell. - @Cpp int TCODConsole::getChar(int x, int y) const - @C int TCOD_console_get_char(TCOD_console_t con,int x, int y) - @Py console_get_char(con,x,y) - @C# int TCODConsole::getChar(int x, int y) - @Lua Console::getChar(x, y) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param x,y coordinates of the cell in the console. - 0 <= x < console width - 0 <= y < console height - */ - int getChar(int x, int y) const; - - /** - @PageName console_fading - @PageTitle Screen fading functions - @PageFather console_draw - @PageDesc Use these functions to easily fade to/from a color - @FuncTitle Changing the fading parameters - @FuncDesc This function defines the fading parameters, allowing to easily fade the game screen to/from a color. Once they are defined, the fading parameters are valid for ever. You don't have to call setFade for each rendered frame (unless you change the fading parameters). - @Cpp static void TCODConsole::setFade(uint8_t fade, const TCODColor &fadingColor) - @C void TCOD_console_set_fade(uint8_t fade, TCOD_color_t fadingColor) - @Py console_set_fade(fade, fadingColor) - @C# static void TCODConsole::setFade(byte fade, TCODColor fadingColor) - @Lua tcod.console.setFade(fade, fadingColor) - @Param fade the fading amount. 0 => the screen is filled with the fading color. 255 => no fading effect - @Param fadingColor the color to use during the console flushing operation - @CppEx - for (int fade=255; fade >= 0; fade --) { - TCODConsole::setFade(fade,TCODColor::black); - TCODConsole::flush(); - } - @CEx - int fade; - for (fade=255; fade >= 0; fade --) { - TCOD_console_setFade(fade,TCOD_black); - TCOD_console_flush(); - } - @PyEx - for fade in range(255,0) : - libtcod.console_setFade(fade,libtcod.black) - libtcod.console_flush() - @LuaEx - for fade=255,0,-1 do - tcod.console.setFade(fade,tcod.color.black) - tcod.console.flush() - end - */ - static void setFade(uint8_t fade, const TCODColor &fadingColor); - - /** - @PageName console_fading - @FuncTitle Reading the fade amount - @FuncDesc This function returns the current fade amount, previously defined by setFade. - @Cpp static uint8_t TCODConsole::getFade() - @C uint8_t TCOD_console_get_fade() - @Py console_get_fade() - @C# static byte TCODConsole::getFade() - @Lua tcod.console.getFade() - */ - static uint8_t getFade(); - - /** - @PageName console_fading - @FuncTitle Reading the fading color - @FuncDesc This function returns the current fading color, previously defined by setFade. - @Cpp static TCODColor TCODConsole::getFadingColor() - @C TCOD_color_t TCOD_console_get_fading_color() - @Py console_get_fading_color() - @C# static TCODColor TCODConsole::getFadingColor() - @Lua tcod.console.getFadingColor() - */ - static TCODColor getFadingColor(); - - /** - @PageName console_flush - @PageFather console - @PageTitle Flushing the root console - @FuncDesc Once the root console is initialized, you can use one of the printing functions to change the background colors, the foreground colors or the ASCII characters on the console. - Once you've finished rendering the root console, you have to actually apply the updates to the screen with this function. - @Cpp static void TCODConsole::flush() - @C void TCOD_console_flush() - @Py console_flush() - @C# static void TCODConsole::flush() - @Lua tcod.console.flush() - */ - static void flush(); - - /** - @PageName console_ascii - @PageTitle ASCII constants - @PageFather console_draw - @FuncDesc Some useful graphic characters in the terminal.bmp font. For the Python version, remove TCOD_ from the constants. C# and Lua is in parenthesis : - Single line walls: - TCOD_CHAR_HLINE=196 (HorzLine) - TCOD_CHAR_VLINE=179 (VertLine) - TCOD_CHAR_NE=191 (NE) - TCOD_CHAR_NW=218 (NW) - TCOD_CHAR_SE=217 (SE) - TCOD_CHAR_SW=192 (SW) - - Double lines walls: - TCOD_CHAR_DHLINE=205 (DoubleHorzLine) - TCOD_CHAR_DVLINE=186 (DoubleVertLine) - TCOD_CHAR_DNE=187 (DoubleNE) - TCOD_CHAR_DNW=201 (DoubleNW) - TCOD_CHAR_DSE=188 (DoubleSE) - TCOD_CHAR_DSW=200 (DoubleSW) - - Single line vertical/horizontal junctions (T junctions): - TCOD_CHAR_TEEW=180 (TeeWest) - TCOD_CHAR_TEEE=195 (TeeEast) - TCOD_CHAR_TEEN=193 (TeeNorth) - TCOD_CHAR_TEES=194 (TeeSouth) - - Double line vertical/horizontal junctions (T junctions): - TCOD_CHAR_DTEEW=185 (DoubleTeeWest) - TCOD_CHAR_DTEEE=204 (DoubleTeeEast) - TCOD_CHAR_DTEEN=202 (DoubleTeeNorth) - TCOD_CHAR_DTEES=203 (DoubleTeeSouth) - - Block characters: - TCOD_CHAR_BLOCK1=176 (Block1) - TCOD_CHAR_BLOCK2=177 (Block2) - TCOD_CHAR_BLOCK3=178 (Block3) - - Cross-junction between two single line walls: - TCOD_CHAR_CROSS=197 (Cross) - - Arrows: - TCOD_CHAR_ARROW_N=24 (ArrowNorth) - TCOD_CHAR_ARROW_S=25 (ArrowSouth) - TCOD_CHAR_ARROW_E=26 (ArrowEast) - TCOD_CHAR_ARROW_W=27 (ArrowWest) - - Arrows without tail: - TCOD_CHAR_ARROW2_N=30 (ArrowNorthNoTail) - TCOD_CHAR_ARROW2_S=31 (ArrowSouthNoTail) - TCOD_CHAR_ARROW2_E=16 (ArrowEastNoTail) - TCOD_CHAR_ARROW2_W=17 (ArrowWestNoTail) - - Double arrows: - TCOD_CHAR_DARROW_H=29 (DoubleArrowHorz) - TCOD_CHAR_ARROW_V=18 (DoubleArrowVert) - - GUI stuff: - TCOD_CHAR_CHECKBOX_UNSET=224 - TCOD_CHAR_CHECKBOX_SET=225 - TCOD_CHAR_RADIO_UNSET=9 - TCOD_CHAR_RADIO_SET=10 - - Sub-pixel resolution kit: - TCOD_CHAR_SUBP_NW=226 (SubpixelNorthWest) - TCOD_CHAR_SUBP_NE=227 (SubpixelNorthEast) - TCOD_CHAR_SUBP_N=228 (SubpixelNorth) - TCOD_CHAR_SUBP_SE=229 (SubpixelSouthEast) - TCOD_CHAR_SUBP_DIAG=230 (SubpixelDiagonal) - TCOD_CHAR_SUBP_E=231 (SubpixelEast) - TCOD_CHAR_SUBP_SW=232 (SubpixelSouthWest) - - Miscellaneous characters: - TCOD_CHAR_SMILY = 1 (Smilie) - TCOD_CHAR_SMILY_INV = 2 (SmilieInv) - TCOD_CHAR_HEART = 3 (Heart) - TCOD_CHAR_DIAMOND = 4 (Diamond) - TCOD_CHAR_CLUB = 5 (Club) - TCOD_CHAR_SPADE = 6 (Spade) - TCOD_CHAR_BULLET = 7 (Bullet) - TCOD_CHAR_BULLET_INV = 8 (BulletInv) - TCOD_CHAR_MALE = 11 (Male) - TCOD_CHAR_FEMALE = 12 (Female) - TCOD_CHAR_NOTE = 13 (Note) - TCOD_CHAR_NOTE_DOUBLE = 14 (NoteDouble) - TCOD_CHAR_LIGHT = 15 (Light) - TCOD_CHAR_EXCLAM_DOUBLE = 19 (ExclamationDouble) - TCOD_CHAR_PILCROW = 20 (Pilcrow) - TCOD_CHAR_SECTION = 21 (Section) - TCOD_CHAR_POUND = 156 (Pound) - TCOD_CHAR_MULTIPLICATION = 158 (Multiplication) - TCOD_CHAR_FUNCTION = 159 (Function) - TCOD_CHAR_RESERVED = 169 (Reserved) - TCOD_CHAR_HALF = 171 (Half) - TCOD_CHAR_ONE_QUARTER = 172 (OneQuarter) - TCOD_CHAR_COPYRIGHT = 184 (Copyright) - TCOD_CHAR_CENT = 189 (Cent) - TCOD_CHAR_YEN = 190 (Yen) - TCOD_CHAR_CURRENCY = 207 (Currency) - TCOD_CHAR_THREE_QUARTERS = 243 (ThreeQuarters) - TCOD_CHAR_DIVISION = 246 (Division) - TCOD_CHAR_GRADE = 248 (Grade) - TCOD_CHAR_UMLAUT = 249 (Umlaut) - TCOD_CHAR_POW1 = 251 (Pow1) - TCOD_CHAR_POW3 = 252 (Pow2) - TCOD_CHAR_POW2 = 253 (Pow3) - TCOD_CHAR_BULLET_SQUARE = 254 (BulletSquare) - */ - - /** - @PageName console_input - @PageTitle Handling user input - @PageDesc The user handling functions allow you to get keyboard and mouse input from the user, either for turn by turn games (the function wait until the user press a key or a mouse button), or real time games (non blocking function). - WARNING : those functions also handle screen redraw event, so TCODConsole::flush function won't redraw screen if no user input function is called ! - @PageFather console - */ - - /* deprecated as of 1.5.1 */ - static TCOD_key_t waitForKeypress(bool flush); - /* deprecated as of 1.5.1 */ - static TCOD_key_t checkForKeypress(int flags=TCOD_KEY_RELEASED); - - /** - @PageName console_blocking_input - @PageCategory Core - @PageFather console_input - @PageTitle Blocking user input - @PageDesc This function stops the application until an event occurs. - */ - - /** - @PageName console_non_blocking_input - @PageTitle Non blocking user input - @PageFather console_input - @FuncDesc The preferred way to check for user input is to use checkForEvent below, but you can also get the status of any special key at any time with : - @Cpp static bool TCODConsole::isKeyPressed(TCOD_keycode_t key) - @C bool TCOD_console_is_key_pressed(TCOD_keycode_t key) - @Py console_is_key_pressed(key) - @C# static bool TCODConsole::isKeyPressed(TCODKeyCode key) - @Lua tcod.console.isKeyPressed(key) - @Param key Any key code defined in keycode_t except TCODK_CHAR (Char) and TCODK_NONE (NoKey) - */ - static bool isKeyPressed(TCOD_keycode_t key); - - /** - @PageName console_key_t - @PageTitle Keyboard event structure - @PageFather console_input - @PageDesc This structure contains information about a key pressed/released by the user. - @C - typedef struct { - TCOD_keycode_t vk; - char c; - char text[32]; - bool pressed; - bool lalt; - bool lctrl; - bool lmeta; - bool ralt; - bool rctrl; - bool rmeta; - bool shift; - } TCOD_key_t; - @Lua - key.KeyCode - key.Character - key.Text - key.Pressed - key.LeftAlt - key.LeftControl - key.LeftMeta - key.RightAlt - key.RightControl - key.RightMeta - key.Shift - @Param vk An arbitrary value representing the physical key on the keyboard. Possible values are stored in the TCOD_keycode_t enum. If no key was pressed, the value is TCODK_NONE - @Param c If the key correspond to a printable character, the character is stored in this field. Else, this field contains 0. - @Param text If vk is TCODK_TEXT, this will contain the text entered by the user. - @Param pressed true if the event is a key pressed, or false for a key released. - @Param lalt This field represents the status of the left Alt key : true => pressed, false => released. - @Param lctrl This field represents the status of the left Control key : true => pressed, false => released. - @Param lmeta This field represents the status of the left Meta (Windows/Command/..) key : true => pressed, false => released. - @Param ralt This field represents the status of the right Alt key : true => pressed, false => released. - @Param rctrl This field represents the status of the right Control key : true => pressed, false => released. - @Param rmeta This field represents the status of the right Meta (Windows/Command/..) key : true => pressed, false => released. - @Param shift This field represents the status of the shift key : true => pressed, false => released. - */ - - /** - @PageName console_mouse_t - @PageTitle Mouse event structure - @PageFather console_input - @PageDesc This structure contains information about a mouse move/press/release event. - @C - typedef struct { - int x,y; - int dx,dy; - int cx,cy; - int dcx,dcy; - bool lbutton; - bool rbutton; - bool mbutton; - bool lbutton_pressed; - bool rbutton_pressed; - bool mbutton_pressed; - bool wheel_up; - bool wheel_down; - } TCOD_mouse_t; - @Param x,y Absolute position of the mouse cursor in pixels relative to the window top-left corner. - @Param dx,dy Movement of the mouse cursor since the last call in pixels. - @Param cx,cy Coordinates of the console cell under the mouse cursor (pixel coordinates divided by the font size). - @Param dcx,dcy Movement of the mouse since the last call in console cells (pixel coordinates divided by the font size). - @Param lbutton true if the left button is pressed. - @Param rbutton true if the right button is pressed. - @Param mbutton true if the middle button (or the wheel) is pressed. - @Param lbutton_pressed true if the left button was pressed and released. - @Param rbutton_pressed true if the right button was pressed and released. - @Param mbutton_pressed true if the middle button was pressed and released. - @Param wheel_up true if the wheel was rolled up. - @Param wheel_down true if the wheel was rolled down. - */ - - /** - @PageName console_keycode_t - @PageTitle Key codes - @PageFather console_input - @PageDesc TCOD_keycode_t is a libtcod specific code representing a key on the keyboard. - For Python, replace TCODK by KEY: libtcod.KEY_NONE. C# and Lua, the value is in parenthesis. Possible values are : - When no key was pressed (see checkForEvent) : TCOD_NONE (NoKey) - Special keys : - TCODK_ESCAPE (Escape) - TCODK_BACKSPACE (Backspace) - TCODK_TAB (Tab) - TCODK_ENTER (Enter) - TCODK_SHIFT (Shift) - TCODK_CONTROL (Control) - TCODK_ALT (Alt) - TCODK_PAUSE (Pause) - TCODK_CAPSLOCK (CapsLock) - TCODK_PAGEUP (PageUp) - TCODK_PAGEDOWN (PageDown) - TCODK_END (End) - TCODK_HOME (Home) - TCODK_UP (Up) - TCODK_LEFT (Left) - TCODK_RIGHT (Right) - TCODK_DOWN (Down) - TCODK_PRINTSCREEN (Printscreen) - TCODK_INSERT (Insert) - TCODK_DELETE (Delete) - TCODK_LWIN (Lwin) - TCODK_RWIN (Rwin) - TCODK_APPS (Apps) - TCODK_KPADD (KeypadAdd) - TCODK_KPSUB (KeypadSubtract) - TCODK_KPDIV (KeypadDivide) - TCODK_KPMUL (KeypadMultiply) - TCODK_KPDEC (KeypadDecimal) - TCODK_KPENTER (KeypadEnter) - TCODK_F1 (F1) - TCODK_F2 (F2) - TCODK_F3 (F3) - TCODK_F4 (F4) - TCODK_F5 (F5) - TCODK_F6 (F6) - TCODK_F7 (F7) - TCODK_F8 (F8) - TCODK_F9 (F9) - TCODK_F10 (F10) - TCODK_F11 (F11) - TCODK_F12 (F12) - TCODK_NUMLOCK (Numlock) - TCODK_SCROLLLOCK (Scrolllock) - TCODK_SPACE (Space) - - numeric keys : - - TCODK_0 (Zero) - TCODK_1 (One) - TCODK_2 (Two) - TCODK_3 (Three) - TCODK_4 (Four) - TCODK_5 (Five) - TCODK_6 (Six) - TCODK_7 (Seven) - TCODK_8 (Eight) - TCODK_9 (Nine) - TCODK_KP0 (KeypadZero) - TCODK_KP1 (KeypadOne) - TCODK_KP2 (KeypadTwo) - TCODK_KP3 (KeypadThree) - TCODK_KP4 (KeypadFour) - TCODK_KP5 (KeypadFive) - TCODK_KP6 (KeypadSix) - TCODK_KP7 (KeypadSeven) - TCODK_KP8 (KeypadEight) - TCODK_KP9 (KeypadNine) - - Any other (printable) key : - - TCODK_CHAR (Char) - - Codes starting with TCODK_KP represents keys on the numeric keypad (if available). - */ - - /** - @PageName console_offscreen - @PageFather console - @PageTitle Using off-screen consoles - @PageDesc The offscreen consoles allow you to draw on secondary consoles as you would do with the root console. You can then blit those secondary consoles on the root console. This allows you to use local coordinate space while rendering a portion of the final screen, and easily move components of the screen without modifying the rendering functions. - @FuncTitle Creating an offscreen console - @FuncDesc You can create as many off-screen consoles as you want by using this function. You can draw on them as you would do with the root console, but you cannot flush them to the screen. Else, you can blit them on other consoles, including the root console. See blit. The C version of this function returns a console handler that you can use in most console drawing functions. - @Cpp TCODConsole::TCODConsole(int w, int h) - @C TCOD_console_t TCOD_console_new(int w, int h) - @Py console_new(w,h) - @C# TCODConsole::TCODConsole(int w, int h) - @Lua tcod.Console(w,h) - @Param w,h the console size. - 0 < w - 0 < h - @CppEx - // Creating a 40x20 offscreen console, filling it with red and blitting it on the root console at position 5,5 - TCODConsole *offscreenConsole = new TCODConsole(40,20); - offscreenConsole->setDefaultBackground(TCODColor::red); - offscreenConsole->clear(); - TCODConsole::blit(offscreenConsole,0,0,40,20,TCODConsole::root,5,5,255); - @CEx - TCOD_console_t offscreen_console = TCOD_console_new(40,20); - TCOD_console_set_default_background(offscreen_console,TCOD_red); - TCOD_console_clear(offscreen_console); - TCOD_console_blit(offscreen_console,0,0,40,20,NULL,5,5,255); - @PyEx - offscreen_console = libtcod.console_new(40,20) - libtcod.console_set_background_color(offscreen_console,libtcod.red) - libtcod.console_clear(offscreen_console) - libtcod.console_blit(offscreen_console,0,0,40,20,0,5,5,255) - @LuaEx - -- Creating a 40x20 offscreen console, filling it with red and blitting it on the root console at position 5,5 - offscreenConsole = tcod.Console(40,20) - offscreenConsole:setBackgroundColor(tcod.color.red) - offscreenConsole:clear() - tcod.console.blit(offscreenConsole,0,0,40,20,libtcod.TCODConsole_root,5,5,255) - */ - TCODConsole(int w, int h); - - /** - @PageName console_offscreen - @FuncTitle Creating an offscreen console from a .asc or .apf file - @FuncDesc You can create an offscreen console from a file created with Ascii Paint with this constructor - @Cpp TCODConsole::TCODConsole(const char *filename) - @C TCOD_console_t TCOD_console_from_file(const char *filename) - @Param filename path to the .asc or .apf file created with Ascii Paint - @CppEx - // Creating an offscreen console, filling it with data from the .asc file - TCODConsole *offscreenConsole = new TCODConsole("myfile.asc"); - @CEx - TCOD_console_t offscreen_console = TCOD_console_from_file("myfile.apf"); - */ - TCODConsole(const char *filename); - - /** - @PageName console_offscreen - @FuncTitle Loading an offscreen console from a .asc file - @FuncDesc You can load data from a file created with Ascii Paint with this function. When needed, the console will be resized to fit the file size. The function returns false if it couldn't read the file. - @Cpp bool TCODConsole::loadAsc(const char *filename) - @C bool TCOD_console_load_asc(TCOD_console_t con, const char *filename) - @Param con in the C and Python versions, the offscreen console handler - @Param filename path to the .asc file created with Ascii Paint - @CppEx - // Creating a 40x20 offscreen console - TCODConsole *offscreenConsole = new TCODConsole(40,20); - // possibly resizing it and filling it with data from the .asc file - offscreenConsole->loadAsc("myfile.asc"); - @CEx - TCOD_console_t offscreen_console = TCOD_console_new(40,20); - TCOD_console_load_asc(offscreen_console,"myfile.asc"); - */ - bool loadAsc(const char *filename); - /** - @PageName console_offscreen - @FuncTitle Loading an offscreen console from a .apf file - @FuncDesc You can load data from a file created with Ascii Paint with this function. When needed, the console will be resized to fit the file size. The function returns false if it couldn't read the file. - @Cpp bool TCODConsole::loadApf(const char *filename) - @C bool TCOD_console_load_apf(TCOD_console_t con, const char *filename) - @Param con in the C and Python versions, the offscreen console handler - - @Param filename path to the .apf file created with Ascii Paint - - @CppEx - // Creating a 40x20 offscreen console - TCODConsole *offscreenConsole = new TCODConsole(40,20); - // possibly resizing it and filling it with data from the .apf file - offscreenConsole->loadApf("myfile.apf"); - @CEx - TCOD_console_t offscreen_console = TCOD_console_new(40,20); - TCOD_console_load_apf(offscreen_console,"myfile.asc"); - */ - bool loadApf(const char *filename); - - /** - @PageName console_offscreen - @FuncTitle Saving a console to a .asc file - @FuncDesc You can save data from a console to Ascii Paint format with this function. The function returns false if it couldn't write the file. This is the only ASC function that works also with the root console ! - @Cpp bool TCODConsole::saveAsc(const char *filename) const - @C bool TCOD_console_save_asc(TCOD_console_t con, const char *filename) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param filename path to the .asc file to be created - @CppEx - console->saveAsc("myfile.asc"); - @CEx - TCOD_console_save_asc(console,"myfile.asc"); - */ - bool saveAsc(const char *filename) const; - - /** - @PageName console_offscreen - @FuncTitle Saving a console to a .apf file - @FuncDesc You can save data from a console to Ascii Paint format with this function. The function returns false if it couldn't write the file. This is the only ASC function that works also with the root console ! - @Cpp bool TCODConsole::saveApf(const char *filename) const - @C bool TCOD_console_save_apf(TCOD_console_t con, const char *filename) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param filename path to the .apf file to be created - @CppEx - console->saveApf("myfile.apf"); - @CEx - TCOD_console_save_apf(console,"myfile.apf"); - */ - bool saveApf(const char *filename) const; - - bool loadXp(const char *filename) { - return TCOD_console_load_xp(data, filename) != 0; - } - bool saveXp(const char *filename, int compress_level) { - return TCOD_console_save_xp(data, filename, compress_level) != 0; - } - - /** - @PageName console_offscreen - @FuncTitle Blitting a console on another one - @FuncDesc This function allows you to blit a rectangular area of the source console at a specific position on a destination console. It can also simulate alpha transparency with the fade parameter. - @Cpp static void blit(const TCODConsole *src,int xSrc, int ySrc, int wSrc, int hSrc, TCODConsole *dst, int xDst, int yDst, float foregroundAlpha=1.0f, float backgroundAlpha=1.0f) - @C void TCOD_console_blit(TCOD_console_t src,int xSrc, int ySrc, int wSrc, int hSrc, TCOD_console_t dst, int xDst, int yDst, float foreground_alpha, float background_alpha) - @Py console_blit(src,xSrc,ySrc,xSrc,hSrc,dst,xDst,yDst,foregroundAlpha=1.0,backgroundAlpha=1.0) - @C# - static void TCODConsole::blit(TCODConsole src, int xSrc, int ySrc, int wSrc, int hSrc, TCODConsole dst, int xDst, int yDst) - static void TCODConsole::blit(TCODConsole src, int xSrc, int ySrc, int wSrc, int hSrc, TCODConsole dst, int xDst, int yDst, float foreground_alpha) - static void TCODConsole::blit(TCODConsole src, int xSrc, int ySrc, int wSrc, int hSrc, TCODConsole dst, int xDst, int yDst, float foreground_alpha, float background_alpha) - @Lua - tcod.console.blit(src, xSrc, ySrc, wSrc, hSrc, dst, xDst, yDst) - tcod.console.blit(src, xSrc, ySrc, wSrc, hSrc, dst, xDst, yDst, foreground_alpha) - tcod.console.blit(src, xSrc, ySrc, wSrc, hSrc, dst, xDst, yDst, foreground_alpha, background_alpha) - @Param src The source console that must be blitted on another one. - @Param xSrc,ySrc,wSrc,hSrc The rectangular area of the source console that will be blitted. If wSrc and/or hSrc == 0, the source console width/height are used - @Param dst The destination console. - @Param xDst,yDst Where to blit the upper-left corner of the source area in the destination console. - @Param foregroundAlpha,backgroundAlpha Alpha transparency of the blitted console. - 0.0 => The source console is completely transparent. This function does nothing. - 1.0 => The source console is opaque. Its cells replace the destination cells. - 0 < fade < 1.0 => The source console is partially blitted, simulating real transparency. - @CppEx - // Cross-fading between two offscreen consoles. We use two offscreen consoles with the same size as the root console. We render a different screen on each offscreen console. When the user hits a key, we do a cross-fading from the first screen to the second screen. - TCODConsole *off1 = new TCODConsole(80,50); - TCODConsole *off2 = new TCODConsole(80,50); - ... print screen1 on off1 - ... print screen2 of off2 - // render screen1 in the game window - TCODConsole::blit(off1,0,0,80,50,TCODConsole::root,0,0); - TCODConsole::flush(); - // wait or a keypress - TCODConsole::waitForKeypress(true); - // do a cross-fading from off1 to off2 - for (int i=1; i <= 255; i++) { - TCODConsole::blit(off1,0,0,80,50,TCODConsole::root,0,0); // renders the first screen (opaque) - TCODConsole::blit(off2,0,0,80,50,TCODConsole::root,0,0,i/255.0,i/255.0); // renders the second screen (transparent) - TCODConsole::flush(); - } - @CEx - TCOD_console_t off1 = TCOD_console_new(80,50); - TCOD_console_t off2 = TCOD_console_new(80,50); - int i; - ... print screen1 on off1 - ... print screen2 of off2 - // render screen1 in the game window - TCOD_console_blit(off1,0,0,80,50,NULL,0,0,1.0,1.0); - TCOD_console_flush(); - // wait or a keypress - TCOD_console_wait_for_keypress(true); - // do a cross-fading from off1 to off2 - for (i=1; i <= 255; i++) { - TCOD_console_blit(off1,0,0,80,50,NULL,0,0,1.0,1.0); // renders the first screen (opaque) - TCOD_console_blit(off2,0,0,80,50,NULL,0,0,i/255.0,i/255.0); // renders the second screen (transparent) - TCOD_console_flush(); - } - @PyEx - off1 = libtcod.console_new(80,50) - off2 = libtcod.console_new(80,50) - ... print screen1 on off1 - ... print screen2 of off2 - # render screen1 in the game window - libtcod.console_blit(off1,0,0,80,50,0,0,0) - libtcod.console_flush() - # wait or a keypress - libtcod.console_wait_for_keypress(True) - # do a cross-fading from off1 to off2 - for i in range(1,256) : - litbcod.console_blit(off1,0,0,80,50,0,0,0) # renders the first screen (opaque) - litbcod.console_blit(off2,0,0,80,50,0,0,0,i/255.0,i/255.0) # renders the second screen (transparent) - litbcod.console_flush() - @LuaEx - -- Cross-fading between two offscreen consoles. We use two offscreen consoles with the same size as the root console. We render a different screen on each offscreen console. When the user hits a key, we do a cross-fading from the first screen to the second screen. - off1 = tcod.Console(80,50) - off2 = tcod.Console(80,50) - ... print screen1 on off1 - ... print screen2 of off2 - -- render screen1 in the game window - root=libtcod.TCODConsole_root - tcod.console.blit(off1,0,0,80,50,root,0,0) - tcod.console.flush() - -- wait or a keypress - tcod.console.waitForKeypress(true) - -- do a cross-fading from off1 to off2 - for i=1,255,1 do - tcod.console.blit(off1,0,0,80,50,root,0,0) -- renders the first screen (opaque) - tcod.console.blit(off2,0,0,80,50,root,0,0,i/255,i/255) -- renders the second screen (transparent) - tcod.console.flush() - end - */ - static void blit(const TCODConsole *src,int xSrc, int ySrc, int wSrc, int hSrc, TCODConsole *dst, int xDst, int yDst, float foreground_alpha=1.0f, float background_alpha=1.0f); - /** - @PageName console_offscreen - @FuncTitle Define a blit-transparent color - @FuncDesc This function defines a transparent background color for an offscreen console. All cells with this background color are ignored by the blit operation. You can use it to blit only some parts of the console. - @Cpp void TCODConsole::setKeyColor(const TCODColor &col) - @C void TCOD_console_set_key_color(TCOD_console_t con,TCOD_color_t col) - @Py console_set_key_color(con,col) - @C# void TCODConsole::setKeyColor(TCODColor col) - @Lua Console:setKeyColor(col) - @Param con in the C and Python versions, the offscreen console handler or NULL for the root console - @Param col the transparent background color - */ - void setKeyColor(const TCODColor &col); - /** - @PageName console_offscreen - @FuncTitle Destroying an offscreen console - @FuncDesc Use this function to destroy an offscreen console and release any resources allocated. Don't use it on the root console. - @Cpp TCODConsole::~TCODConsole() - @C void TCOD_console_delete(TCOD_console_t con) - @Py console_delete(con) - @C# void TCODConsole::Dispose() - @Lua through garbage collector - @Param con in the C and Python versions, the offscreen console handler - @CppEx - TCODConsole *off1 = new TCODConsole(80,50); - ... use off1 - delete off1; // destroy the offscreen console - @CEx - TCOD_console_t off1 = TCOD_console_new(80,50); - ... use off1 - TCOD_console_delete(off1); // destroy the offscreen console - @PyEx - off1 = libtcod.console_new(80,50) - ... use off1 - libtcod.console_delete(off1) # destroy the offscreen console - @LuaEx - off1 = tcod.Console(80,50) - ... use off1 - off1=nil -- release the reference - */ - virtual ~TCODConsole(); - - void setDirty(int x, int y, int w, int h); - - - TCODConsole(TCOD_console_t con) : data(con) {} - - // ctrl = TCOD_COLCTRL_1...TCOD_COLCTRL_5 or TCOD_COLCTRL_STOP - static const char *getColorControlString( TCOD_colctrl_t ctrl ); - // ctrl = TCOD_COLCTRL_FORE_RGB or TCOD_COLCTRL_BACK_RGB - static const char *getRGBColorControlString( TCOD_colctrl_t ctrl, const TCODColor & col ); - -protected : - friend class TCODImage; - friend class TCODZip; - friend class TCODText; - TCODConsole(); - TCOD_console_t data; -}; - -#endif /* TCOD_CONSOLE_SUPPORT */ - -#endif /* _TCOD_CONSOLE_HPP */ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_CONSOLE_HPP +#define _TCOD_CONSOLE_HPP + +#include + +#include "console.h" +#include "console_etc.h" +#include "console_init.h" +#include "console_drawing.h" +#include "console_printing.h" +#include "console_rexpaint.h" + +#include "image.hpp" +#include "color.hpp" + +class TCODImage; +/** + @PageName console + @PageCategory Core + @PageTitle Console + @PageDesc The console emulator handles the rendering of the game screen and the keyboard input. +Classic real time game loop: + @Cpp + TCODConsole::initRoot(80,50,"my game",false); + TCODSystem::setFps(25); // limit framerate to 25 frames per second + while (!endGame && !TCODConsole::isWindowClosed()) { + TCOD_key_t key; + TCODSystem::checkForEvent(TCOD_EVENT_KEY_PRESS,&key,NULL); + updateWorld (key, TCODSystem::getLastFrameLength()); + // updateWorld(TCOD_key_t key, float elapsed) (using key if key.vk != TCODK_NONE) + // use elapsed to scale any update that is time dependent. + // ... draw world+GUI on TCODConsole::root + TCODConsole::flush(); + } + @Lua + tcod.console.initRoot(80,50,"my game", false) + root=libtcod.TCODConsole_root + tcod.system.setFps(25) + while not tcod.console.isWindowClosed() do + -- ... draw on root + tcod.console.flush() + key=tcod.console.checkForKeypress() + -- ... update world, using key and tcod.system.getLastFrameLength + end + +*/ +/** + @PageName console + @FuncDesc Classic turn by turn game loop: + @Cpp + TCODConsole::initRoot(80,50,"my game",false); + while (!endGame && !TCODConsole::isWindowClosed()) { + // ... draw on TCODConsole::root + TCODConsole::flush(); + TCOD_key_t key; + TCODConsole::waitForEvent(TCOD_EVENT_KEY_PRESS,&key,NULL,true); + //... update world, using key + } +*/ + +class TCODLIB_API TCODConsole { +public : + /** + @PageName console_init + @PageTitle Initializing the console + @PageFather console + */ + + static TCODConsole *root; + + /** + @PageName console_init_root + @PageTitle Creating the game window + @PageFather console_init + @Cpp static void TCODConsole::initRoot (int w, int h, const char * title, bool fullscreen = false, TCOD_renderer_t renderer = TCOD_RENDERER_SDL) + @C void TCOD_console_init_root (int w, int h, const char * title, bool fullscreen, TCOD_renderer_t renderer) + @Py console_init_root (w, h, title, fullscreen = False, renderer = RENDERER_SDL) + @C# + static void TCODConsole::initRoot(int w, int h, string title) + static void TCODConsole::initRoot(int w, int h, string title, bool fullscreen) + static void TCODConsole::initRoot(int w, int h, string title, bool fullscreen, TCODRendererType renderer) + @Lua + tcod.console.initRoot(w,h,title) -- fullscreen = false, renderer = SDL + tcod.console.initRoot(w,h,title,fullscreen) -- renderer = SDL + tcod.console.initRoot(w,h,title,fullscreen,renderer) + -- renderers : tcod.GLSL, tcod.OpenGL, tcod.SDL + @Param w,h size of the console(in characters). The default font in libtcod (./terminal.png) uses 8x8 pixels characters. + You can change the font by calling TCODConsole::setCustomFont before calling initRoot. + @Param title title of the window. It's not visible when you are in fullscreen. + Note 1 : you can dynamically change the window title with TCODConsole::setWindowTitle + @Param fullscreen whether you start in windowed or fullscreen mode. + Note 1 : you can dynamically change this mode with TCODConsole::setFullscreen + Note 2 : you can get current mode with TCODConsole::isFullscreen + @Param renderer which renderer to use. Possible values are : + * TCOD_RENDERER_GLSL : works only on video cards with pixel shaders + * TCOD_RENDERER_OPENGL : works on all video cards supporting OpenGL 1.4 + * TCOD_RENDERER_SDL : should work everywhere! + Note 1: if you select a renderer that is not supported by the player's machine, libtcod scan the lower renderers until it finds a working one. + Note 2: on recent video cards, GLSL results in up to 900% increase of framerates in the true color sample compared to SDL renderer. + Note 3: whatever renderer you use, it can always be overridden by the player through the libtcod.cfg file. + Note 4: you can dynamically change the renderer after calling initRoot with TCODSystem::setRenderer. + Note 5: you can get current renderer with TCODSystem::getRenderer. It might be different from the one you set in initRoot in case it's not supported on the player's computer. + @CppEx TCODConsole::initRoot(80, 50, "The Chronicles Of Doryen v0.1"); + @CEx TCOD_console_init_root(80, 50, "The Chronicles Of Doryen v0.1", false, TCOD_RENDERER_OPENGL); + @PyEx libtcod.console_init_root(80, 50, 'The Chronicles Of Doryen v0.1') + @LuaEx tcod.console.initRoot(80,50,"The Chronicles Of Doryen v0.1") + */ + static void initRoot(int w, int h, const char * title, bool fullscreen = false, TCOD_renderer_t renderer=TCOD_RENDERER_SDL); + + /** + @PageName console_set_custom_font + @PageTitle Using a custom bitmap font + @PageFather console_init + @FuncTitle setCustomFont + @FuncDesc This function allows you to use a bitmap font (png or bmp) with custom character size or layout. + It should be called before initializing the root console with initRoot. + Once this function is called, you can define your own custom mappings using mapping functions +
Different font layouts
+ + + + +
ASCII_INROWASCII_INCOLTCOD
+
    +
  • ascii, in columns : characters 0 to 15 are in the first column. The space character is at coordinates 2,0.
  • +
  • ascii, in rows : characters 0 to 15 are in the first row. The space character is at coordinates 0,2.
  • +
  • tcod : special mapping. Not all ascii values are mapped. The space character is at coordinates 0,0.
  • +
+
Different font types
+ + + + +
standard
(non antialiased)
antialiased
(32 bits PNG)
antialiased
(greyscale)
+
    +
  • standard : transparency is given by a key color automatically detected by looking at the color of the space character
  • +
  • 32 bits : transparency is given by the png alpha layer. The font color does not matter but it must be desaturated
  • +
  • greyscale : transparency is given by the pixel value. You can use white characters on black background or black characters on white background. The background color is automatically detected by looking at the color of the space character
  • +
+ Examples of fonts can be found in libtcod's fonts directory. Check the Readme file there. + @Cpp static void TCODConsole::setCustomFont(const char *fontFile, int flags=TCOD_FONT_LAYOUT_ASCII_INCOL,int nbCharHoriz=0, int nbCharVertic=0) + @C void TCOD_console_set_custom_font(const char *fontFile, int flags,int nb_char_horiz, int nb_char_vertic) + @Py console_set_custom_font(fontFile, flags=FONT_LAYOUT_ASCII_INCOL,nb_char_horiz=0, nb_char_vertic=0) + @C# + static void TCODConsole::setCustomFont(string fontFile) + static void TCODConsole::setCustomFont(string fontFile, int flags) + static void TCODConsole::setCustomFont(string fontFile, int flags, int nbCharHoriz) + static void TCODConsole::setCustomFont(string fontFile, int flags, int nbCharHoriz, int nbCharVertic) + @Lua + tcod.console.setCustomFont(fontFile) + tcod.console.setCustomFont(fontFile, flags) + tcod.console.setCustomFont(fontFile, nbCharHoriz) + tcod.console.setCustomFont(fontFile, flags, nbCharHoriz, nbCharVertic) + -- flags : tcod.LayoutAsciiInColumn, tcod.LayoutAsciiInRow, tcod.LayoutTCOD, tcod.Greyscale + @Param fontFile Name of a .bmp or .png file containing the font. + @Param flags Used to define the characters layout in the bitmap and the font type : + TCOD_FONT_LAYOUT_ASCII_INCOL : characters in ASCII order, code 0-15 in the first column + TCOD_FONT_LAYOUT_ASCII_INROW : characters in ASCII order, code 0-15 in the first row + TCOD_FONT_LAYOUT_TCOD : simplified layout. See examples below. + TCOD_FONT_TYPE_GREYSCALE : create an anti-aliased font from a greyscale bitmap + For Python, remove TCOD _ : + libtcod.FONT_LAYOUT_ASCII_INCOL + @Param nbCharHoriz,nbCharVertic Number of characters in the font. + Should be 16x16 for ASCII layouts, 32x8 for TCOD layout. + But you can use any other layout. + If set to 0, there are deduced from the font layout flag. + @CppEx + TCODConsole::setCustomFont("standard_8x8_ascii_in_col_font.bmp",TCOD_FONT_LAYOUT_ASCII_INCOL); + TCODConsole::setCustomFont("32bits_8x8_ascii_in_row_font.png",TCOD_FONT_LAYOUT_ASCII_INROW); + TCODConsole::setCustomFont("greyscale_8x8_tcod_font.png",TCOD_FONT_LAYOUT_TCOD | TCOD_FONT_TYPE_GREYSCALE); + @CEx + TCOD_console_set_custom_font("standard_8x8_ascii_in_col_font.bmp",TCOD_FONT_LAYOUT_ASCII_INCOL,16,16); + TCOD_console_set_custom_font("32bits_8x8_ascii_in_row_font.png",TCOD_FONT_LAYOUT_ASCII_INROW,32,8); + TCOD_console_set_custom_font("greyscale_8x8_tcod_font.png",TCOD_FONT_LAYOUT_TCOD | TCOD_FONT_TYPE_GREYSCALE,32,8); + @PyEx + libtcod.console_set_custom_font("standard_8x8_ascii_in_col_font.bmp",libtcod.FONT_LAYOUT_ASCII_INCOL) + libtcod.console_set_custom_font("32bits_8x8_ascii_in_row_font.png",libtcod.FONT_LAYOUT_ASCII_INROW) + libtcod.console_set_custom_font("greyscale_8x8_tcod_font.png",libtcod.FONT_LAYOUT_TCOD | libtcod.FONT_TYPE_GREYSCALE) + @LuaEx + tcod.console.setCustomFont("standard_8x8_ascii_in_col_font.bmp",tcod.LayoutAsciiInColumn); + tcod.console.setCustomFont("32bits_8x8_ascii_in_row_font.png",tcod.LayoutAsciiInRow); + tcod.console.setCustomFont("greyscale_8x8_tcod_font.png",tcod.LayoutTCOD + tcod.Greyscale); + */ + static void setCustomFont(const char *fontFile, int flags=TCOD_FONT_LAYOUT_ASCII_INCOL,int nbCharHoriz=0, int nbCharVertic=0); + + /** + @PageName console_map + @PageTitle Using custom characters mapping + @PageFather console_init + @FuncTitle Mapping a single ASCII code to a character + @PageDesc These functions allow you to map characters in the bitmap font to ASCII codes. + They should be called after initializing the root console with initRoot. + You can dynamically change the characters mapping at any time, allowing to use several fonts in the same screen. + @Cpp static void TCODConsole::mapAsciiCodeToFont(int asciiCode, int fontCharX, int fontCharY) + @C void TCOD_console_map_ascii_code_to_font(int asciiCode, int fontCharX, int fontCharY) + @Py console_map_ascii_code_to_font(asciiCode, fontCharX, fontCharY) + @C# static void TCODConsole::mapAsciiCodeToFont(int asciiCode, int fontCharX, int fontCharY) + @Lua tcod.console.mapAsciiCodeToFont(asciiCode, fontCharX, fontCharY) + @Param asciiCode ASCII code to map. + @Param fontCharX,fontCharY Coordinate of the character in the bitmap font (in characters, not pixels). + */ + static void mapAsciiCodeToFont(int asciiCode, int fontCharX, int fontCharY); + + /** + @PageName console_map + @FuncTitle Mapping consecutive ASCII codes to consecutive characters + @Cpp static void TCODConsole::mapAsciiCodesToFont(int firstAsciiCode, int nbCodes, int fontCharX, int fontCharY) + @C void TCOD_console_map_ascii_codes_to_font(int firstAsciiCode, int nbCodes, int fontCharX, int fontCharY) + @Py console_map_ascii_codes_to_font(firstAsciiCode, nbCodes, fontCharX, fontCharY) + @C# static void TCODConsole::mapAsciiCodesToFont(int firstAsciiCode, int nbCodes, int fontCharX, int fontCharY) + @Lua tcod.console.mapAsciiCodesToFont(firstAsciiCode, nbCodes, fontCharX, fontCharY) + @Param firstAsciiCode first ASCII code to map + @Param nbCodes number of consecutive ASCII codes to map + @Param fontCharX,fontCharY coordinate of the character in the bitmap font (in characters, not pixels) corresponding to the first ASCII code + */ + static void mapAsciiCodesToFont(int firstAsciiCode, int nbCodes, int fontCharX, int fontCharY); + + /** + @PageName console_map + @FuncTitle Mapping ASCII code from a string to consecutive characters + @Cpp static void TCODConsole::mapStringToFont(const char *s, int fontCharX, int fontCharY) + @C void TCOD_console_map_string_to_font(const char *s, int fontCharX, int fontCharY) + @Py console_map_string_to_font(s, fontCharX, fontCharY) + @C# static void TCODConsole::mapStringToFont(string s, int fontCharX, int fontCharY) + @Lua tcod.console.mapStringToFont(s, fontCharX, fontCharY) + @Param s string containing the ASCII codes to map + @Param fontCharX,fontCharY coordinate of the character in the bitmap font (in characters, not pixels) corresponding to the first ASCII code in the string + */ + static void mapStringToFont(const char *s, int fontCharX, int fontCharY); + + /** + @PageName console_fullscreen + @PageTitle Fullscreen mode + @PageFather console_init + @FuncTitle Getting the current mode + @FuncDesc This function returns true if the current mode is fullscreen. + @Cpp static bool TCODConsole::isFullscreen() + @C bool TCOD_console_is_fullscreen() + @Py console_is_fullscreen() + @C# static bool TCODConsole::isFullscreen() + @Lua tcod.console.isFullscreen() + */ + static bool isFullscreen(); + /** + @PageName console_fullscreen + @FuncTitle Switching between windowed and fullscreen modes + @FuncDesc This function switches the root console to fullscreen or windowed mode. + Note that there is no predefined key combination to switch to/from fullscreen. You have to do this in your own code. + @Cpp static void TCODConsole::setFullscreen(bool fullscreen) + @C void TCOD_console_set_fullscreen(bool fullscreen) + @Py console_set_fullscreen(fullscreen) + @C# static void TCODConsole::setFullscreen(bool fullscreen) + @Lua tcod.console.setFullscreen(fullscreen) + @Param fullscreen true to switch to fullscreen mode. + false to switch to windowed mode. + @CppEx + TCOD_key_t key; + TCODConsole::checkForEvent(TCOD_EVENT_KEY_PRESS,&key,NULL); + if ( key.vk == TCODK_ENTER && key.lalt ) + TCODConsole::setFullscreen(!TCODConsole::isFullscreen()); + @CEx + TCOD_key_t key; + TCOD_console_check_for_event(TCOD_EVENT_KEY_PRESS,&key,NULL); + if ( key.vk == TCODK_ENTER && key.lalt ) + TCOD_console_set_fullscreen(!TCOD_console_is_fullscreen()); + @PyEx + key=Key() + libtcod.console_check_for_event(libtcod.EVENT_KEY_PRESS,key,0) + if key.vk == libtcod.KEY_ENTER and key.lalt : + libtcod.console_set_fullscreen(not libtcod.console_is_fullscreen()) + @LuaEx + key=tcod.console.checkForKeypress() + if key.KeyCode == tcod.Enter and key.LeftAlt then + tcod.console.setFullscreen(not tcod.console.isFullscreen()) + end + */ + static void setFullscreen(bool fullscreen); + + /** + @PageName console_window + @PageFather console_init + @PageTitle Communicate with the window manager + @FuncTitle Changing the window title + @FuncDesc This function dynamically changes the title of the game window. + Note that the window title is not visible while in fullscreen. + @Cpp static void TCODConsole::setWindowTitle(const char *title) + @C void TCOD_console_set_window_title(const char *title) + @Py console_set_window_title(title) + @C# static void TCODConsole::setWindowTitle(string title) + @Lua tcod.console.setWindowTitle(title) + @Param title New title of the game window + */ + static void setWindowTitle(const char *title); + + /** + @PageName console_window + @FuncTitle Handling "close window" events + @FuncDesc When you start the program, this returns false. Once a "close window" event has been sent by the window manager, it will always return true. You're supposed to exit cleanly the game. + @Cpp static bool TCODConsole::isWindowClosed() + @C bool TCOD_console_is_window_closed() + @Py console_is_window_closed() + @C# static bool TCODConsole::isWindowClosed() + @Lua tcod.console.isWindowClosed() + */ + static bool isWindowClosed(); + + /** + @PageName console_window + @FuncTitle Check if the mouse cursor is inside the game window + @FuncDesc Returns true if the mouse cursor is inside the game window area and the game window is the active application. + @Cpp static bool TCODConsole::hasMouseFocus() + @C bool TCOD_console_has_mouse_focus() + @Py console_has_mouse_focus() + */ + static bool hasMouseFocus(); + + /** + @PageName console_window + @FuncTitle Check if the game application is active + @FuncDesc Returns false if the game window is not the active window or is iconified. + @Cpp static bool TCODConsole::isActive() + @C bool TCOD_console_is_active() + @Py console_is_active() + */ + static bool isActive(); + + /** + @PageName console_credits + @PageTitle libtcod's credits + @PageFather console_init + @PageDesc Use these functions to display credits, as seen in the samples. + @FuncTitle Using a separate credit page + @FuncDesc You can print a "Powered by libtcod x.y.z" screen during your game startup simply by calling this function after initRoot. + The credits screen can be skipped by pressing any key. + @Cpp static void TCODConsole::credits() + @C void TCOD_console_credits() + @Py console_credits() + @C# static void TCODConsole::credits() + @Lua tcod.console.credits() + */ + static void credits(); + + /** + @PageName console_credits + @FuncTitle Embedding credits in an existing page + @FuncDesc You can also print the credits on one of your game screens (your main menu for example) by calling this function in your main loop. + This function returns true when the credits screen is finished, indicating that you no longer need to call it. + @Cpp static bool TCODConsole::renderCredits(int x, int y, bool alpha) + @C bool TCOD_console_credits_render(int x, int y, bool alpha) + @Py bool TCOD_console_credits_render(int x, int y, bool alpha) + @C# static bool TCODConsole::renderCredits(int x, int y, bool alpha) + @Lua tcod.console.renderCredits(x, y, alpha) + @Param x,y Position of the credits text in your root console + @Param alpha If true, credits are transparently added on top of the existing screen. + For this to work, this function must be placed between your screen rendering code and the console flush. + @CppEx + TCODConsole::initRoot(80,50,"The Chronicles Of Doryen v0.1",false); // initialize the root console + bool endCredits=false; + while ( ! TCODConsole::isWindowClosed() ) { // your game loop + // your game rendering here... + // render transparent credits near the center of the screen + if (! endCredits ) endCredits=TCODConsole::renderCredits(35,25,true); + TCODConsole::flush(); + } + @CEx + TCOD_console_init_root(80,50,"The Chronicles Of Doryen v0.1",false); + bool end_credits=false; + while ( ! TCOD_console_is_window_closed() ) { + // your game rendering here... + // render transparent credits near the center of the screen + if (! end_credits ) end_credits=TCOD_console_credits_render(35,25,true); + TCOD_console_flush(); + } + @PyEx + libtcod.console_init_root(80,50,"The Chronicles Of Doryen v0.1",False) + end_credits=False + while not libtcod.console_is_window_closed() : + // your game rendering here... + // render transparent credits near the center of the screen + if (not end_credits ) : end_credits=libtcod.console_credits_render(35,25,True) + libtcod.console_flush() + @LuaEx + tcod.console.initRoot(80,50,"The Chronicles Of Doryen v0.1") -- initialize the root console + endCredits=false + while not tcod.console.isWindowClosed() do -- your game loop + -- your game rendering here... + -- render transparent credits near the center of the screen + if not endCredits then endCredits=tcod.console.renderCredits(35,25,true) end + tcod.console.flush() + end + */ + static bool renderCredits(int x, int y, bool alpha); + + /** + @PageName console_credits + @FuncTitle Restart the credits animation + @FuncDesc When using rederCredits, you can restart the credits animation from the beginning before it's finished by calling this function. + @Cpp static void TCODConsole::resetCredits() + @C void TCOD_console_credits_reset() + @Py console_credits_reset() + @C# static void TCODConsole::resetCredits() + @Lua tcod.console.resetCredits() + */ + static void resetCredits(); + + /** + @PageName console_draw + @PageTitle Drawing on the root console + @PageFather console + */ + + /** + @PageName console_draw_basic + @PageTitle Basic printing functions + @PageFather console_draw + @FuncTitle Setting the default background color + @FuncDesc This function changes the default background color for a console. The default background color is used by several drawing functions like clear, putChar, ... + @Cpp void TCODConsole::setDefaultBackground(TCODColor back) + @C void TCOD_console_set_default_background(TCOD_console_t con,TCOD_color_t back) + @Py console_set_default_background(con,back) + @C# void TCODConsole::setBackgroundColor(TCODColor back) + @Lua Console:setBackgroundColor(back) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param back the new default background color for this console + @CppEx TCODConsole::root->setDefaultBackground(myColor) + @CEx TCOD_console_set_default_background(NULL, my_color) + @PyEx litbcod.console_set_default_background(0, my_color) + @Lua libtcod.TCODConsole_root:setBackgroundColor( myColor ) + */ + void setDefaultBackground(TCODColor back); + + /** + @PageName console_draw_basic + @FuncTitle Setting the default foreground color + @FuncDesc This function changes the default foreground color for a console. The default foreground color is used by several drawing functions like clear, putChar, ... + @Cpp void TCODConsole::setDefaultForeground(TCODColor fore) + @C void TCOD_console_set_default_foreground(TCOD_console_t con,TCOD_color_t fore) + @Py console_set_default_foreground(con, fore) + @C# void TCODConsole::setForegroundColor(TCODColor fore) + @Lua Console:setForegroundColor(fore) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param fore the new default foreground color for this console + @CppEx TCODConsole::root->setDefaultForeground(myColor) + @CEx TCOD_console_set_default_foreground(NULL, my_color) + @PyEx litbcod.console_set_default_foreground(0, my_color) + @LuaEx libtcod.TCODConsole_root:setForegroundColor( myColor ) + */ + void setDefaultForeground(TCODColor fore); + + /** + @PageName console_draw_basic + @FuncTitle Clearing a console + @FuncDesc This function modifies all cells of a console : + * set the cell's background color to the console default background color + * set the cell's foreground color to the console default foreground color + * set the cell's ASCII code to 32 (space) + @Cpp void TCODConsole::clear() + @C void TCOD_console_clear(TCOD_console_t con) + @Py console_clear(con) + @C# void TCODConsole::clear() + @Lua Console:clear() + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + */ + void clear(); + + /** + @PageName console_draw_basic + @FuncTitle Setting the background color of a cell + @FuncDesc This function modifies the background color of a cell, leaving other properties (foreground color and ASCII code) unchanged. + @Cpp void TCODConsole::setCharBackground(int x, int y, const TCODColor &col, TCOD_bkgnd_flag_t flag = TCOD_BKGND_SET) + @C void TCOD_console_set_char_background(TCOD_console_t con,int x, int y, TCOD_color_t col, TCOD_bkgnd_flag_t flag) + @Py console_set_char_background(con, x, y, col, flag=BKGND_SET) + @C# + void TCODConsole::setCharBackground(int x, int y, TCODColor col) + void TCODConsole::setCharBackground(int x, int y, TCODColor col, TCODBackgroundFlag flag) + @Lua + Console:setCharBackground(x, y, col) + Console:setCharBackground(x, y, col, flag) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y coordinates of the cell in the console. + 0 <= x < console width + 0 <= y < console height + @Param col the background color to use. You can use color constants + @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t + */ + void setCharBackground(int x, int y, const TCODColor &col, TCOD_bkgnd_flag_t flag = TCOD_BKGND_SET); + /** + @PageName console_draw_basic + @FuncTitle Setting the foreground color of a cell + @FuncDesc This function modifies the foreground color of a cell, leaving other properties (background color and ASCII code) unchanged. + @Cpp void TCODConsole::setCharForeground(int x, int y, const TCODColor &col) + @C void TCOD_console_set_char_foreground(TCOD_console_t con,int x, int y, TCOD_color_t col) + @Py console_set_char_foreground(con, x, y, col) + @C# void TCODConsole::setCharForeground(int x, int y, TCODColor col) + @Lua Console:setCharForeground(x, y, col) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y coordinates of the cell in the console. + 0 <= x < console width + 0 <= y < console height + @Param col the foreground color to use. You can use color constants + */ + void setCharForeground(int x, int y, const TCODColor &col); + + /** + @PageName console_draw_basic + @FuncTitle Setting the ASCII code of a cell + @FuncDesc This function modifies the ASCII code of a cell, leaving other properties (background and foreground colors) unchanged. + Note that since a clear console has both background and foreground colors set to black for every cell, using setchar will produce black characters on black background. Use putchar instead. + @Cpp void TCODConsole::setChar(int x, int y, int c) + @C void TCOD_console_set_char(TCOD_console_t con,int x, int y, int c) + @Py console_set_char(con, x, y, c) + @C# void TCODConsole::setChar(int x, int y, int c) + @Lua Console:setChar(x, y, c) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y coordinates of the cell in the console. + 0 <= x < console width + 0 <= y < console height + @Param c the new ASCII code for the cell. You can use ASCII constants + */ + void setChar(int x, int y, int c); + + /** + @PageName console_draw_basic + @FuncTitle Setting every property of a cell using default colors + @FuncDesc This function modifies every property of a cell : + * update the cell's background color according to the console default background color (see TCOD_bkgnd_flag_t). + * set the cell's foreground color to the console default foreground color + * set the cell's ASCII code to c + @Cpp void TCODConsole::putChar(int x, int y, int c, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT) + @C void TCOD_console_put_char(TCOD_console_t con,int x, int y, int c, TCOD_bkgnd_flag_t flag) + @Py console_put_char( con, x, y, c, flag=BKGND_DEFAULT) + @C# + void TCODConsole::putChar(int x, int y, int c) + void TCODConsole::putChar(int x, int y, int c, TCODBackgroundFlag flag) + @Lua + Console:putChar(x, y, c) + Console:putChar(x, y, c, flag) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y coordinates of the cell in the console. + 0 <= x < console width + 0 <= y < console height + @Param c the new ASCII code for the cell. You can use ASCII constants + @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t + */ + void putChar(int x, int y, int c, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT); + + /** + @PageName console_draw_basic + @FuncTitle Setting every property of a cell using specific colors + @FuncDesc This function modifies every property of a cell : + * set the cell's background color to back. + * set the cell's foreground color to fore. + * set the cell's ASCII code to c. + @Cpp void TCODConsole::putCharEx(int x, int y, int c, const TCODColor & fore, const TCODColor & back) + @C void TCOD_console_put_char_ex(TCOD_console_t con,int x, int y, int c, TCOD_color_t fore, TCOD_color_t back) + @Py console_put_char_ex( con, x, y, c, fore, back) + @C# void TCODConsole::putCharEx(int x, int y, int c, TCODColor fore, TCODColor back) + @Lua Console:putCharEx(x, y, c, fore, back) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y coordinates of the cell in the console. + 0 <= x < console width + 0 <= y < console height + @Param c the new ASCII code for the cell. You can use ASCII constants + @Param fore,back new foreground and background colors for this cell + */ + void putCharEx(int x, int y, int c, const TCODColor &fore, const TCODColor &back); + + /** + @PageName console_bkgnd_flag_t + @PageTitle Background effect flags + @PageFather console_draw + @PageDesc This flag is used by most functions that modify a cell background color. It defines how the console's current background color is used to modify the cell's existing background color : + TCOD_BKGND_NONE : the cell's background color is not modified. + TCOD_BKGND_SET : the cell's background color is replaced by the console's default background color : newbk = curbk. + TCOD_BKGND_MULTIPLY : the cell's background color is multiplied by the console's default background color : newbk = oldbk * curbk + TCOD_BKGND_LIGHTEN : newbk = MAX(oldbk,curbk) + TCOD_BKGND_DARKEN : newbk = MIN(oldbk,curbk) + TCOD_BKGND_SCREEN : newbk = white - (white - oldbk) * (white - curbk) // inverse of multiply : (1-newbk) = (1-oldbk)*(1-curbk) + TCOD_BKGND_COLOR_DODGE : newbk = curbk / (white - oldbk) + TCOD_BKGND_COLOR_BURN : newbk = white - (white - oldbk) / curbk + TCOD_BKGND_ADD : newbk = oldbk + curbk + TCOD_BKGND_ADDALPHA(alpha) : newbk = oldbk + alpha*curbk + TCOD_BKGND_BURN : newbk = oldbk + curbk - white + TCOD_BKGND_OVERLAY : newbk = curbk.x <= 0.5 ? 2*curbk*oldbk : white - 2*(white-curbk)*(white-oldbk) + TCOD_BKGND_ALPHA(alpha) : newbk = (1.0f-alpha)*oldbk + alpha*(curbk-oldbk) + TCOD_BKGND_DEFAULT : use the console's default background flag + Note that TCOD_BKGND_ALPHA and TCOD_BKGND_ADDALPHA are MACROS that needs a float parameter between (0.0 and 1.0). TCOD_BKGND_ALPH and TCOD_BKGND_ADDA should not be used directly (else they will have the same effect as TCOD_BKGND_NONE). + For Python, remove TCOD_ : libtcod.BKGND_NONE + For C# : None, Set, Multiply, Lighten, Darken, Screen, ColodDodge, ColorBurn, Add, Burn Overlay, Default + With lua, use tcod.None, ..., tcod.Default, BUT tcod.console.Alpha(value) and tcod.console.AddAlpha(value) + */ + + /** + @PageName console_print + @PageTitle String drawing functions + @PageFather console_draw + @FuncTitle Setting the default background flag + @FuncDesc This function defines the background mode (see TCOD_bkgnd_flag_t) for the console. + This default mode is used by several functions (print, printRect, ...) + @Cpp void TCODConsole::setBackgroundFlag(TCOD_bkgnd_flag_t flag) + @C void TCOD_console_set_background_flag(TCOD_console_t con,TCOD_bkgnd_flag_t flag) + @Py console_set_background_flag(con, flag) + @C# void TCODConsole::setBackgroundFlag(TCODBackgroundFlag flag) + @Lua Console:setBackgroundFlag(flag) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t + */ + void setBackgroundFlag(TCOD_bkgnd_flag_t flag); + + /** + @PageName console_print + @FuncTitle Getting the default background flag + @FuncDesc This function returns the background mode (see TCOD_bkgnd_flag_t) for the console. + This default mode is used by several functions (print, printRect, ...) + @Cpp TCOD_bkgnd_flag_t TCODConsole::getBackgroundFlag() const + @C TCOD_bkgnd_flag_t TCOD_console_get_background_flag(TCOD_console_t con) + @Py console_get_background_flag(con) + @C# TCODBackgroundFlag TCODConsole::getBackgroundFlag() + @Lua Console:getBackgroundFlag() + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + */ + TCOD_bkgnd_flag_t getBackgroundFlag() const; + + /** + @PageName console_print + @FuncTitle Setting the default alignment + @FuncDesc This function defines the default alignment (see TCOD_alignment_t) for the console. + This default alignment is used by several functions (print, printRect, ...). + Values for alignment : TCOD_LEFT, TCOD_CENTER, TCOD_RIGHT (in Python, remove TCOD_ : libtcod.LEFT). + For C# and Lua : LeftAlignment, RightAlignment, CenterAlignment + @Cpp void TCODConsole::setAlignment(TCOD_alignment_t alignment) + @C void TCOD_console_set_alignment(TCOD_console_t con,TCOD_bkgnd_flag_t alignment) + @Py console_set_alignment(con, alignment) + @C# void TCODConsole::setAlignment(TCODAlignment alignment) + @Lua Console:setAlignment(alignment) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param alignment defines how the strings are printed on screen. + */ + void setAlignment(TCOD_alignment_t alignment); + + /** + @PageName console_print + @FuncTitle Getting the default alignment + @FuncDesc This function returns the default alignment (see TCOD_alignment_t) for the console. + This default mode is used by several functions (print, printRect, ...). + Values for alignment : TCOD_LEFT, TCOD_CENTER, TCOD_RIGHT (in Python, remove TCOD_ : libtcod.LEFT). + For C# and Lua : LeftAlignment, RightAlignment, CenterAlignment + @Cpp TCOD_alignment_t TCODConsole::getAlignment() const + @C TCOD_alignment_t TCOD_console_get_alignment(TCOD_console_t con) + @Py console_get_alignment(con) + @C# TCODAlignment TCODConsole::getAlignment() + @Lua Console:getAlignment() + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + */ + TCOD_alignment_t getAlignment() const; + /** + * Print an EASCII formatted string to the console. + * \rst + * .. deprecated:: 1.8 + * EASCII is being phased out. Use TCODConsole::printf or one of the + * UTF-8 overloads. + * \endrst + */ + TCOD_DEPRECATED( + "Use TCODConsole::printf or the std::string overload for this function." + "\nNote that you'll need to use UTF-8 encoded strings for those functions.") + void print(int x, int y, const char *fmt, ...); + /** + * Print an EASCII encoded string to the console. + * + * This method will use this consoles default alignment, blend mode, and + * colors. + * \rst + * .. versionadded:: 1.8 + * \endrst + */ + void print(int x, int y, const std::string &str); + /** + * Print a UTF-8 string to the console with specific alignment and blend + * mode. + * \rst + * .. versionadded:: 1.8 + * \endrst + */ + void print(int x, int y, const std::string &str, + TCOD_alignment_t alignment, TCOD_bkgnd_flag_t flag); + /** + * Format and print a UTF-8 string to the console. + * + * This method will use this consoles default alignment, blend mode, and + * colors. + * \rst + * .. versionadded:: 1.8 + * \endrst + */ + TCODLIB_FORMAT(4, 5) + void printf(int x, int y, const char *fmt, ...); + /** + * Format and print a UTF-8 string to the console with specific alignment + * and blend mode. + * \rst + * .. versionadded:: 1.8 + * \endrst + */ + TCODLIB_FORMAT(6, 7) + void printf(int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, + const char *fmt, ...); + /** + * Print an EASCII formatted string to the console. + * \rst + * .. deprecated:: 1.8 + * Use `TCODConsole::print` or `TCODConsole::printf`. + * These functions have overloads for specifying flag and alignment. + * \endrst + */ + TCOD_DEPRECATED( + "Use TCODConsole::print (std::string overload) or TCODConsole::printf" + "instead of this function." + "\nNote that you'll need to use UTF-8 encoded strings for those functions.") + void printEx(int x, int y, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment, const char *fmt, ...); + /** + @PageName console_print + @FuncTitle Printing a string with default parameters and autowrap + @FuncDesc This function draws a string in a rectangle inside the console, using default colors, alignment and background mode. + If the string reaches the borders of the rectangle, carriage returns are inserted. + If h > 0 and the bottom of the rectangle is reached, the string is truncated. If h = 0, the string is only truncated if it reaches the bottom of the console. + The function returns the height (number of console lines) of the printed string. + @Cpp int TCODConsole::printRect(int x, int y, int w, int h, const char *fmt, ...) + @C int TCOD_console_print_rect(TCOD_console_t con,int x, int y, int w, int h, const char *fmt, ...) + @Py console_print_rect(con, x, y, w, h, fmt) + @C# int TCODConsole::printRect(int x, int y, int w, int h, string fmt) + @Lua Console:printRect(x, y, w, h, fmt) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y coordinate of the character in the console, depending on the alignment : + * TCOD_LEFT : leftmost character of the string + * TCOD_CENTER : center character of the string + * TCOD_RIGHT : rightmost character of the string + @Param w,h size of the rectangle + x <= x+w < console width + y <= y+h < console height + @Param fmt printf-like format string, eventually followed by parameters. You can use control codes to change the colors inside the string, except in C#. + */ + TCODLIB_FORMAT(6, 7) + int printRect(int x, int y, int w, int h, const char *fmt, ...); + + /** + @PageName console_print + @FuncTitle Printing a string with specific alignment and background mode and autowrap + @FuncDesc This function draws a string in a rectangle inside the console, using default colors, but specific alignment and background mode. + If the string reaches the borders of the rectangle, carriage returns are inserted. + If h > 0 and the bottom of the rectangle is reached, the string is truncated. If h = 0, the string is only truncated if it reaches the bottom of the console. + The function returns the height (number of console lines) of the printed string. + @Cpp int TCODConsole::printRectEx(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...) + @C int TCOD_console_print_rect_ex(TCOD_console_t con,int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...) + @Py console_print_rect_ex(con, x, y, w, h, flag, alignment, fmt) + @C# int TCODConsole::printRectEx(int x, int y, int w, int h, TCODBackgroundFlag flag, TCODAlignment alignment, string fmt) + @Lua Console:printRectEx(x, y, w, h, flag, alignment, fmt) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y coordinate of the character in the console, depending on the alignment : + * TCOD_LEFT : leftmost character of the string + * TCOD_CENTER : center character of the string + * TCOD_RIGHT : rightmost character of the string + @Param w,h size of the rectangle + x <= x+w < console width + y <= y+h < console height + @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t + @Param alignment defines how the strings are printed on screen. + @Param fmt printf-like format string, eventually followed by parameters. You can use control codes to change the colors inside the string, except in C#. + */ + TCODLIB_FORMAT(8, 9) + int printRectEx(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment, const char *fmt, ...); + + /** + @PageName console_print + @FuncTitle Compute the height of an autowrapped string + @FuncDesc This function returns the expected height of an autowrapped string without actually printing the string with printRect or printRectEx + @Cpp int TCODConsole::getHeightRect(int x, int y, int w, int h, const char *fmt, ...) + + @C int TCOD_console_get_height_rect(TCOD_console_t con,int x, int y, int w, int h, const char *fmt, ...) + @Py console_get_height_rect(con, x, y, w, h, fmt) + @C# int TCODConsole::getHeightRect(int x, int y, int w, int h, string fmt) + @Lua Console:getHeightRect(x, y, w, h, fmt) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y coordinate of the rectangle upper-left corner in the console + @Param w,h size of the rectangle + x <= x+w < console width + y <= y+h < console height + @Param fmt printf-like format string, eventually followed by parameters. You can use control codes to change the colors inside the string, except in C#. + */ + TCODLIB_FORMAT(6, 7) + int getHeightRect(int x, int y, int w, int h, const char *fmt, ...); + + /** + @PageName console_print + @FuncTitle Changing the colors while printing a string + @FuncDesc If you want to draw a string using different colors for each word, the basic solution is to call a string printing function several times, changing the default colors between each call. + The TCOD library offers a simpler way to do this, allowing you to draw a string using different colors in a single call. For this, you have to insert color control codes in your string. + A color control code is associated with a color set (a foreground color and a background color). If you insert this code in your string, the next characters will use the colors associated with the color control code. + There are 5 predefined color control codes : + For Python, remove TCOD_ : libtcod.COLCTRL_1 + TCOD_COLCTRL_1 + TCOD_COLCTRL_2 + TCOD_COLCTRL_3 + TCOD_COLCTRL_4 + TCOD_COLCTRL_5 + To associate a color with a code, use setColorControl. + To go back to the console's default colors, insert in your string the color stop control code : + TCOD_COLCTRL_STOP + + You can also use any color without assigning it to a control code, using the generic control codes : + TCOD_COLCTRL_FORE_RGB + TCOD_COLCTRL_BACK_RGB + + Those controls respectively change the foreground and background color used to print the string characters. In the string, you must insert the r,g,b components of the color (between 1 and 255. The value 0 is forbidden because it represents the end of the string in C/C++) immediately after this code. + @Cpp static void TCODConsole::setColorControl(TCOD_colctrl_t con, const TCODColor &fore, const TCODColor &back) + @C void TCOD_console_set_color_control(TCOD_colctrl_t con, TCOD_color_t fore, TCOD_color_t back) + @Py console_set_color_control(con,fore,back) + @C# Not supported directly, use getRGBColorControlString and getColorControlString. + @Lua Not supported + @Param con the color control TCOD_COLCTRL_x, 1<=x<=5 + @Param fore foreground color when this control is activated + @Param back background color when this control is activated + @CppEx + // A string with a red over black word, using predefined color control codes + TCODConsole::setColorControl(TCOD_COLCTRL_1,TCODColor::red,TCODColor::black); + TCODConsole::root->print(1,1,"String with a %cred%c word.",TCOD_COLCTRL_1,TCOD_COLCTRL_STOP); + // A string with a red over black word, using generic color control codes + TCODConsole::root->print(1,1,"String with a %c%c%c%c%c%c%c%cred%c word.", + TCOD_COLCTRL_FORE_RGB,255,1,1,TCOD_COLCTRL_BACK_RGB,1,1,1,TCOD_COLCTRL_STOP); + // A string with a red over black word, using generic color control codes + TCODConsole::root->print(1,1,"String with a %c%c%c%c%c%c%c%cred%c word.", + TCOD_COLCTRL_FORE_RGB,255,1,1,TCOD_COLCTRL_BACK_RGB,1,1,1,TCOD_COLCTRL_STOP); + @CEx + // A string with a red over black word, using predefined color control codes + TCOD_console_set_color_control(TCOD_COLCTRL_1,red,black); + TCOD_console_print(NULL,1,1,"String with a %cred%c word.",TCOD_COLCTRL_1,TCOD_COLCTRL_STOP); + // A string with a red word (over default background color), using generic color control codes + TCOD_console_print(NULL,1,1,"String with a %c%c%c%cred%c word.", + TCOD_COLCTRL_FORE_RGB,255,1,1,TCOD_COLCTRL_STOP); + // A string with a red over black word, using generic color control codes + TCOD_console_print(NULL,1,1,"String with a %c%c%c%c%c%c%c%cred%c word.", + TCOD_COLCTRL_FORE_RGB,255,1,1,TCOD_COLCTRL_BACK_RGB,1,1,1,TCOD_COLCTRL_STOP); + @PyEx + # A string with a red over black word, using predefined color control codes + libtcod.console_set_color_control(libtcod.COLCTRL_1,litbcod.red,litbcod.black) + libtcod.console_print(0,1,1,"String with a %cred%c word."%(libtcod.COLCTRL_1,libtcod.COLCTRL_STOP)) + # A string with a red word (over default background color), using generic color control codes + litbcod.console_print(0,1,1,"String with a %c%c%c%cred%c word."%(libtcod.COLCTRL_FORE_RGB,255,1,1,libtcod.COLCTRL_STOP)) + # A string with a red over black word, using generic color control codes + libtcod.console_print(0,1,1,"String with a %c%c%c%c%c%c%c%cred%c word."% + (libtcod.COLCTRL_FORE_RGB,255,1,1,libtcod.COLCTRL_BACK_RGB,1,1,1,libtcod.COLCTRL_STOP)) + + @C#Ex + TCODConsole.root.print(1,1,String.Format("String with a {0}red{1} word.", + TCODConsole.getRGBColorControlString(ColorControlForeground,TCODColor.red), + TCODConsole.getColorControlString(ColorControlStop)); + */ + static void setColorControl(TCOD_colctrl_t con, const TCODColor &fore, const TCODColor &back); + +#ifndef NO_UNICODE + /** + @PageName console_print + @FuncTitle Unicode functions + @FuncDesc those functions are similar to their ASCII equivalent, but work with unicode strings (wchar_t in C/C++). + Note that unicode is not supported in the Python wrapper. + @Cpp static void TCODConsole::mapStringToFont(const wchar_t *s, int fontCharX, int fontCharY) + @C void TCOD_console_map_string_to_font_utf(const wchar_t *s, int fontCharX, int fontCharY) + */ + static void mapStringToFont(const wchar_t *s, int fontCharX, int fontCharY); + /** + @PageName console_print + @Cpp void TCODConsole::print(int x, int y, const wchar_t *fmt, ...) + @C void TCOD_console_print_utf(TCOD_console_t con,int x, int y, const wchar_t *fmt, ...) + */ + void print(int x, int y, const wchar_t *fmt, ...); + /** + @PageName console_print + @Cpp void TCODConsole::printEx(int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...) + @C void TCOD_console_print_ex_utf(TCOD_console_t con,int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...) + */ + void printEx(int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...); + /** + @PageName console_print + @Cpp int TCODConsole::printRect(int x, int y, int w, int h, const wchar_t *fmt, ...) + @C int TCOD_console_print_rect_utf(TCOD_console_t con,int x, int y, int w, int h, const wchar_t *fmt, ...) + */ + int printRect(int x, int y, int w, int h, const wchar_t *fmt, ...); + + /** + @PageName console_print + @Cpp int TCODConsole::printRectEx(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...) + @C int TCOD_console_print_rect_ex_utf(TCOD_console_t con,int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...) + */ + int printRectEx(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...); + + /** + @PageName console_print + @Cpp int TCODConsole::getHeightRect(int x, int y, int w, int h, const wchar_t *fmt, ...) + @C int TCOD_console_get_height_rect_utf(TCOD_console_t con,int x, int y, int w, int h, const wchar_t *fmt, ...) + */ + int getHeightRect(int x, int y, int w, int h, const wchar_t *fmt, ...); +#endif + + /** + @PageName console_advanced + @PageFather console_draw + @PageTitle Advanced printing functions + @FuncTitle Filling a rectangle with the background color + @FuncDesc Fill a rectangle inside a console. For each cell in the rectangle : + * set the cell's background color to the console default background color + * if clear is true, set the cell's ASCII code to 32 (space) + @Cpp void TCODConsole::rect(int x, int y, int w, int h, bool clear, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT) + @C void TCOD_console_rect(TCOD_console_t con,int x, int y, int w, int h, bool clear, TCOD_bkgnd_flag_t flag) + @Py console_rect(con,x, y, w, h, clear, flag=BKGND_DEFAULT) + @C# + void TCODConsole::rect(int x, int y, int w, int h, bool clear) + void TCODConsole::rect(int x, int y, int w, int h, bool clear, TCODBackgroundFlag flag) + @Lua + Console:rect(x, y, w, h, clear) + Console:rect(x, y, w, h, clear, flag) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y coordinates of rectangle upper-left corner in the console. + 0 <= x < console width + 0 <= y < console height + @Param w,h size of the rectangle in the console. + x <= x+w < console width + y <= y+h < console height + @Param clear if true, all characters inside the rectangle are set to ASCII code 32 (space). + If false, only the background color is modified + @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t + */ + void rect(int x, int y, int w, int h, bool clear, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT); + + /** + @PageName console_advanced + @FuncTitle Drawing an horizontal line + @FuncDesc Draws an horizontal line in the console, using ASCII code TCOD_CHAR_HLINE (196), and the console's default background/foreground colors. + @Cpp void TCODConsole::hline(int x,int y, int l, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT) + @C void TCOD_console_hline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag) + @Py console_hline(con,x,y,l,flag=BKGND_DEFAULT) + @C# + void TCODConsole::hline(int x,int y, int l) + void TCODConsole::hline(int x,int y, int l, TCODBackgroundFlag flag) + @Lua + Console:hline(x,y, l) + Console:hline(x,y, l, flag) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y Coordinates of the line's left end in the console. + 0 <= x < console width + 0 <= y < console height + @Param l The length of the line in cells 1 <= l <= console width - x + @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t + */ + void hline(int x,int y, int l, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT); + + /** + @PageName console_advanced + @FuncTitle Drawing an vertical line + @FuncDesc Draws an vertical line in the console, using ASCII code TCOD_CHAR_VLINE (179), and the console's default background/foreground colors. + @Cpp void TCODConsole::vline(int x,int y, int l, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT) + @C void TCOD_console_vline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag) + @Py console_vline(con,x,y,l,flag=BKGND_DEFAULT) + @C# + void TCODConsole::vline(int x,int y, int l) + void TCODConsole::vline(int x,int y, int l, TCODBackgroundFlag flag) + @Lua + Console:vline(x,y, l) + Console:vline(x,y, l, flag) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y Coordinates of the line's upper end in the console. + 0 <= x < console width + 0 <= y < console height + @Param l The length of the line in cells 1 <= l <= console height - y + @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t + */ + void vline(int x,int y, int l, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT); + + /** + @PageName console_advanced + @FuncTitle Drawing a window frame + @FuncDesc This function calls the rect function using the supplied background mode flag, then draws a rectangle with the console's default foreground color. If fmt is not NULL, it is printed on the top of the rectangle, using inverted colors. + @Cpp void TCODConsole::printFrame(int x,int y,int w,int h, bool clear=true, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT, const char *fmt=NULL, ...) + @C void TCOD_console_print_frame(TCOD_console_t con,int x,int y,int w,int h, bool clear, TCOD_bkgnd_flag_t flag, const char *fmt, ...) + @Py console_print_frame(con,x, y, w, h, clear=True, flag=BKGND_DEFAULT, fmt=0) + @C# + void TCODConsole::printFrame(int x,int y, int w,int h) + void TCODConsole::printFrame(int x,int y, int w,int h, bool clear) + void TCODConsole::printFrame(int x,int y, int w,int h, bool clear, TCODBackgroundFlag flag) + void TCODConsole::printFrame(int x,int y, int w,int h, bool clear, TCODBackgroundFlag flag, string fmt) + @Lua + Console:printFrame(x,y, w,h) + Console:printFrame(x,y, w,h, clear) + Console:printFrame(x,y, w,h, clear, flag) + Console:printFrame(x,y, w,h, clear, flag, fmt) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y Coordinates of the rectangle's upper-left corner in the console. + 0 <= x < console width + 0 <= y < console height + @Param w,h size of the rectangle in the console. + x <= x+w < console width + y <= y+h < console height + @Param clear if true, all characters inside the rectangle are set to ASCII code 32 (space). + If false, only the background color is modified + @Param flag this flag defines how the cell's background color is modified. See TCOD_bkgnd_flag_t + @Param fmt if NULL, the function only draws a rectangle. + Else, printf-like format string, eventually followed by parameters. You can use control codes to change the colors inside the string. + */ + TCODLIB_FORMAT(8, 9) + void printFrame(int x,int y,int w,int h, bool clear=true, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT, const char *fmt=NULL, ...); + + /** + @PageName console_read + @PageTitle Reading the content of the console + @PageFather console_draw + @FuncTitle Get the console's width + @FuncDesc This function returns the width of a console (either the root console or an offscreen console) + @Cpp int TCODConsole::getWidth() const + @C int TCOD_console_get_width(TCOD_console_t con) + @Py console_get_width(con) + @C# int TCODConsole::getWidth() + @Lua Console:getWidth() + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + */ + int getWidth() const; + + /** + @PageName console_read + @FuncTitle Get the console's height + @FuncDesc This function returns the height of a console (either the root console or an offscreen console) + @Cpp int TCODConsole::getHeight() const + @C int TCOD_console_get_height(TCOD_console_t con) + @Py console_get_height(con) + @C# int TCODConsole::getHeight() + @Lua Console:getHeight() + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + */ + int getHeight() const; + + /** + @PageName console_read + @FuncTitle Reading the default background color + @FuncDesc This function returns the default background color of a console. + @Cpp TCODColor TCODConsole::getDefaultBackground() const + @C TCOD_color_t TCOD_console_get_default_background(TCOD_console_t con) + @Py console_get_default_background(con) + @C# TCODColor TCODConsole::getBackgroundColor() + @Lua Console:getBackgroundColor() + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + */ + TCODColor getDefaultBackground() const; + + /** + @PageName console_read + @FuncTitle Reading the default foreground color + @FuncDesc This function returns the default foreground color of a console. + @Cpp TCODColor TCODConsole::getDefaultForeground() const + @C TCOD_color_t TCOD_console_get_default_foreground(TCOD_console_t con) + @Py console_get_default_foreground(con) + @C# TCODColor TCODConsole::getForegroundColor() + @Lua Console:getForegroundColor() + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + */ + TCODColor getDefaultForeground() const; + + /** + @PageName console_read + @FuncTitle Reading the background color of a cell + @FuncDesc This function returns the background color of a cell. + @Cpp TCODColor TCODConsole::getCharBackground(int x, int y) const + @C TCOD_color_t TCOD_console_get_char_background(TCOD_console_t con,int x, int y) + @Py console_get_char_background(con,x,y) + @C# TCODColor TCODConsole::getCharBackground(int x, int y) + @Lua Console::getCharBackground(x, y) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y coordinates of the cell in the console. + 0 <= x < console width + 0 <= y < console height + */ + TCODColor getCharBackground(int x, int y) const; + + /** + @PageName console_read + @FuncTitle Reading the foreground color of a cell + @FuncDesc This function returns the foreground color of a cell. + @Cpp TCODColor TCODConsole::getCharForeground(int x, int y) const + @C TCOD_color_t TCOD_console_get_char_foreground(TCOD_console_t con,int x, int y) + @Py console_get_char_foreground(con,x,y) + @C# TCODColor TCODConsole::getCharForeground(int x, int y) + @Lua Console::getCharForeground(x, y) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y coordinates of the cell in the console. + 0 <= x < console width + 0 <= y < console height + */ + TCODColor getCharForeground(int x, int y) const; + + /** + @PageName console_read + @FuncTitle Reading the ASCII code of a cell + @FuncDesc This function returns the ASCII code of a cell. + @Cpp int TCODConsole::getChar(int x, int y) const + @C int TCOD_console_get_char(TCOD_console_t con,int x, int y) + @Py console_get_char(con,x,y) + @C# int TCODConsole::getChar(int x, int y) + @Lua Console::getChar(x, y) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param x,y coordinates of the cell in the console. + 0 <= x < console width + 0 <= y < console height + */ + int getChar(int x, int y) const; + + /** + @PageName console_fading + @PageTitle Screen fading functions + @PageFather console_draw + @PageDesc Use these functions to easily fade to/from a color + @FuncTitle Changing the fading parameters + @FuncDesc This function defines the fading parameters, allowing to easily fade the game screen to/from a color. Once they are defined, the fading parameters are valid for ever. You don't have to call setFade for each rendered frame (unless you change the fading parameters). + @Cpp static void TCODConsole::setFade(uint8_t fade, const TCODColor &fadingColor) + @C void TCOD_console_set_fade(uint8_t fade, TCOD_color_t fadingColor) + @Py console_set_fade(fade, fadingColor) + @C# static void TCODConsole::setFade(byte fade, TCODColor fadingColor) + @Lua tcod.console.setFade(fade, fadingColor) + @Param fade the fading amount. 0 => the screen is filled with the fading color. 255 => no fading effect + @Param fadingColor the color to use during the console flushing operation + @CppEx + for (int fade=255; fade >= 0; fade --) { + TCODConsole::setFade(fade,TCODColor::black); + TCODConsole::flush(); + } + @CEx + int fade; + for (fade=255; fade >= 0; fade --) { + TCOD_console_setFade(fade,TCOD_black); + TCOD_console_flush(); + } + @PyEx + for fade in range(255,0) : + libtcod.console_setFade(fade,libtcod.black) + libtcod.console_flush() + @LuaEx + for fade=255,0,-1 do + tcod.console.setFade(fade,tcod.color.black) + tcod.console.flush() + end + */ + static void setFade(uint8_t fade, const TCODColor &fadingColor); + + /** + @PageName console_fading + @FuncTitle Reading the fade amount + @FuncDesc This function returns the current fade amount, previously defined by setFade. + @Cpp static uint8_t TCODConsole::getFade() + @C uint8_t TCOD_console_get_fade() + @Py console_get_fade() + @C# static byte TCODConsole::getFade() + @Lua tcod.console.getFade() + */ + static uint8_t getFade(); + + /** + @PageName console_fading + @FuncTitle Reading the fading color + @FuncDesc This function returns the current fading color, previously defined by setFade. + @Cpp static TCODColor TCODConsole::getFadingColor() + @C TCOD_color_t TCOD_console_get_fading_color() + @Py console_get_fading_color() + @C# static TCODColor TCODConsole::getFadingColor() + @Lua tcod.console.getFadingColor() + */ + static TCODColor getFadingColor(); + + /** + @PageName console_flush + @PageFather console + @PageTitle Flushing the root console + @FuncDesc Once the root console is initialized, you can use one of the printing functions to change the background colors, the foreground colors or the ASCII characters on the console. + Once you've finished rendering the root console, you have to actually apply the updates to the screen with this function. + @Cpp static void TCODConsole::flush() + @C void TCOD_console_flush() + @Py console_flush() + @C# static void TCODConsole::flush() + @Lua tcod.console.flush() + */ + static void flush(); + + /** + @PageName console_ascii + @PageTitle ASCII constants + @PageFather console_draw + @FuncDesc Some useful graphic characters in the terminal.bmp font. For the Python version, remove TCOD_ from the constants. C# and Lua is in parenthesis : + Single line walls: + TCOD_CHAR_HLINE=196 (HorzLine) + TCOD_CHAR_VLINE=179 (VertLine) + TCOD_CHAR_NE=191 (NE) + TCOD_CHAR_NW=218 (NW) + TCOD_CHAR_SE=217 (SE) + TCOD_CHAR_SW=192 (SW) + + Double lines walls: + TCOD_CHAR_DHLINE=205 (DoubleHorzLine) + TCOD_CHAR_DVLINE=186 (DoubleVertLine) + TCOD_CHAR_DNE=187 (DoubleNE) + TCOD_CHAR_DNW=201 (DoubleNW) + TCOD_CHAR_DSE=188 (DoubleSE) + TCOD_CHAR_DSW=200 (DoubleSW) + + Single line vertical/horizontal junctions (T junctions): + TCOD_CHAR_TEEW=180 (TeeWest) + TCOD_CHAR_TEEE=195 (TeeEast) + TCOD_CHAR_TEEN=193 (TeeNorth) + TCOD_CHAR_TEES=194 (TeeSouth) + + Double line vertical/horizontal junctions (T junctions): + TCOD_CHAR_DTEEW=185 (DoubleTeeWest) + TCOD_CHAR_DTEEE=204 (DoubleTeeEast) + TCOD_CHAR_DTEEN=202 (DoubleTeeNorth) + TCOD_CHAR_DTEES=203 (DoubleTeeSouth) + + Block characters: + TCOD_CHAR_BLOCK1=176 (Block1) + TCOD_CHAR_BLOCK2=177 (Block2) + TCOD_CHAR_BLOCK3=178 (Block3) + + Cross-junction between two single line walls: + TCOD_CHAR_CROSS=197 (Cross) + + Arrows: + TCOD_CHAR_ARROW_N=24 (ArrowNorth) + TCOD_CHAR_ARROW_S=25 (ArrowSouth) + TCOD_CHAR_ARROW_E=26 (ArrowEast) + TCOD_CHAR_ARROW_W=27 (ArrowWest) + + Arrows without tail: + TCOD_CHAR_ARROW2_N=30 (ArrowNorthNoTail) + TCOD_CHAR_ARROW2_S=31 (ArrowSouthNoTail) + TCOD_CHAR_ARROW2_E=16 (ArrowEastNoTail) + TCOD_CHAR_ARROW2_W=17 (ArrowWestNoTail) + + Double arrows: + TCOD_CHAR_DARROW_H=29 (DoubleArrowHorz) + TCOD_CHAR_ARROW_V=18 (DoubleArrowVert) + + GUI stuff: + TCOD_CHAR_CHECKBOX_UNSET=224 + TCOD_CHAR_CHECKBOX_SET=225 + TCOD_CHAR_RADIO_UNSET=9 + TCOD_CHAR_RADIO_SET=10 + + Sub-pixel resolution kit: + TCOD_CHAR_SUBP_NW=226 (SubpixelNorthWest) + TCOD_CHAR_SUBP_NE=227 (SubpixelNorthEast) + TCOD_CHAR_SUBP_N=228 (SubpixelNorth) + TCOD_CHAR_SUBP_SE=229 (SubpixelSouthEast) + TCOD_CHAR_SUBP_DIAG=230 (SubpixelDiagonal) + TCOD_CHAR_SUBP_E=231 (SubpixelEast) + TCOD_CHAR_SUBP_SW=232 (SubpixelSouthWest) + + Miscellaneous characters: + TCOD_CHAR_SMILY = 1 (Smilie) + TCOD_CHAR_SMILY_INV = 2 (SmilieInv) + TCOD_CHAR_HEART = 3 (Heart) + TCOD_CHAR_DIAMOND = 4 (Diamond) + TCOD_CHAR_CLUB = 5 (Club) + TCOD_CHAR_SPADE = 6 (Spade) + TCOD_CHAR_BULLET = 7 (Bullet) + TCOD_CHAR_BULLET_INV = 8 (BulletInv) + TCOD_CHAR_MALE = 11 (Male) + TCOD_CHAR_FEMALE = 12 (Female) + TCOD_CHAR_NOTE = 13 (Note) + TCOD_CHAR_NOTE_DOUBLE = 14 (NoteDouble) + TCOD_CHAR_LIGHT = 15 (Light) + TCOD_CHAR_EXCLAM_DOUBLE = 19 (ExclamationDouble) + TCOD_CHAR_PILCROW = 20 (Pilcrow) + TCOD_CHAR_SECTION = 21 (Section) + TCOD_CHAR_POUND = 156 (Pound) + TCOD_CHAR_MULTIPLICATION = 158 (Multiplication) + TCOD_CHAR_FUNCTION = 159 (Function) + TCOD_CHAR_RESERVED = 169 (Reserved) + TCOD_CHAR_HALF = 171 (Half) + TCOD_CHAR_ONE_QUARTER = 172 (OneQuarter) + TCOD_CHAR_COPYRIGHT = 184 (Copyright) + TCOD_CHAR_CENT = 189 (Cent) + TCOD_CHAR_YEN = 190 (Yen) + TCOD_CHAR_CURRENCY = 207 (Currency) + TCOD_CHAR_THREE_QUARTERS = 243 (ThreeQuarters) + TCOD_CHAR_DIVISION = 246 (Division) + TCOD_CHAR_GRADE = 248 (Grade) + TCOD_CHAR_UMLAUT = 249 (Umlaut) + TCOD_CHAR_POW1 = 251 (Pow1) + TCOD_CHAR_POW3 = 252 (Pow2) + TCOD_CHAR_POW2 = 253 (Pow3) + TCOD_CHAR_BULLET_SQUARE = 254 (BulletSquare) + */ + + /** + @PageName console_input + @PageTitle Handling user input + @PageDesc The user handling functions allow you to get keyboard and mouse input from the user, either for turn by turn games (the function wait until the user press a key or a mouse button), or real time games (non blocking function). + WARNING : those functions also handle screen redraw event, so TCODConsole::flush function won't redraw screen if no user input function is called ! + @PageFather console + */ + + /* deprecated as of 1.5.1 */ + static TCOD_key_t waitForKeypress(bool flush); + /* deprecated as of 1.5.1 */ + static TCOD_key_t checkForKeypress(int flags=TCOD_KEY_RELEASED); + + /** + @PageName console_blocking_input + @PageCategory Core + @PageFather console_input + @PageTitle Blocking user input + @PageDesc This function stops the application until an event occurs. + */ + + /** + @PageName console_non_blocking_input + @PageTitle Non blocking user input + @PageFather console_input + @FuncDesc The preferred way to check for user input is to use checkForEvent below, but you can also get the status of any special key at any time with : + @Cpp static bool TCODConsole::isKeyPressed(TCOD_keycode_t key) + @C bool TCOD_console_is_key_pressed(TCOD_keycode_t key) + @Py console_is_key_pressed(key) + @C# static bool TCODConsole::isKeyPressed(TCODKeyCode key) + @Lua tcod.console.isKeyPressed(key) + @Param key Any key code defined in keycode_t except TCODK_CHAR (Char) and TCODK_NONE (NoKey) + */ + static bool isKeyPressed(TCOD_keycode_t key); + + /** + @PageName console_key_t + @PageTitle Keyboard event structure + @PageFather console_input + @PageDesc This structure contains information about a key pressed/released by the user. + @C + typedef struct { + TCOD_keycode_t vk; + char c; + char text[32]; + bool pressed; + bool lalt; + bool lctrl; + bool lmeta; + bool ralt; + bool rctrl; + bool rmeta; + bool shift; + } TCOD_key_t; + @Lua + key.KeyCode + key.Character + key.Text + key.Pressed + key.LeftAlt + key.LeftControl + key.LeftMeta + key.RightAlt + key.RightControl + key.RightMeta + key.Shift + @Param vk An arbitrary value representing the physical key on the keyboard. Possible values are stored in the TCOD_keycode_t enum. If no key was pressed, the value is TCODK_NONE + @Param c If the key correspond to a printable character, the character is stored in this field. Else, this field contains 0. + @Param text If vk is TCODK_TEXT, this will contain the text entered by the user. + @Param pressed true if the event is a key pressed, or false for a key released. + @Param lalt This field represents the status of the left Alt key : true => pressed, false => released. + @Param lctrl This field represents the status of the left Control key : true => pressed, false => released. + @Param lmeta This field represents the status of the left Meta (Windows/Command/..) key : true => pressed, false => released. + @Param ralt This field represents the status of the right Alt key : true => pressed, false => released. + @Param rctrl This field represents the status of the right Control key : true => pressed, false => released. + @Param rmeta This field represents the status of the right Meta (Windows/Command/..) key : true => pressed, false => released. + @Param shift This field represents the status of the shift key : true => pressed, false => released. + */ + + /** + @PageName console_mouse_t + @PageTitle Mouse event structure + @PageFather console_input + @PageDesc This structure contains information about a mouse move/press/release event. + @C + typedef struct { + int x,y; + int dx,dy; + int cx,cy; + int dcx,dcy; + bool lbutton; + bool rbutton; + bool mbutton; + bool lbutton_pressed; + bool rbutton_pressed; + bool mbutton_pressed; + bool wheel_up; + bool wheel_down; + } TCOD_mouse_t; + @Param x,y Absolute position of the mouse cursor in pixels relative to the window top-left corner. + @Param dx,dy Movement of the mouse cursor since the last call in pixels. + @Param cx,cy Coordinates of the console cell under the mouse cursor (pixel coordinates divided by the font size). + @Param dcx,dcy Movement of the mouse since the last call in console cells (pixel coordinates divided by the font size). + @Param lbutton true if the left button is pressed. + @Param rbutton true if the right button is pressed. + @Param mbutton true if the middle button (or the wheel) is pressed. + @Param lbutton_pressed true if the left button was pressed and released. + @Param rbutton_pressed true if the right button was pressed and released. + @Param mbutton_pressed true if the middle button was pressed and released. + @Param wheel_up true if the wheel was rolled up. + @Param wheel_down true if the wheel was rolled down. + */ + + /** + @PageName console_keycode_t + @PageTitle Key codes + @PageFather console_input + @PageDesc TCOD_keycode_t is a libtcod specific code representing a key on the keyboard. + For Python, replace TCODK by KEY: libtcod.KEY_NONE. C# and Lua, the value is in parenthesis. Possible values are : + When no key was pressed (see checkForEvent) : TCOD_NONE (NoKey) + Special keys : + TCODK_ESCAPE (Escape) + TCODK_BACKSPACE (Backspace) + TCODK_TAB (Tab) + TCODK_ENTER (Enter) + TCODK_SHIFT (Shift) + TCODK_CONTROL (Control) + TCODK_ALT (Alt) + TCODK_PAUSE (Pause) + TCODK_CAPSLOCK (CapsLock) + TCODK_PAGEUP (PageUp) + TCODK_PAGEDOWN (PageDown) + TCODK_END (End) + TCODK_HOME (Home) + TCODK_UP (Up) + TCODK_LEFT (Left) + TCODK_RIGHT (Right) + TCODK_DOWN (Down) + TCODK_PRINTSCREEN (Printscreen) + TCODK_INSERT (Insert) + TCODK_DELETE (Delete) + TCODK_LWIN (Lwin) + TCODK_RWIN (Rwin) + TCODK_APPS (Apps) + TCODK_KPADD (KeypadAdd) + TCODK_KPSUB (KeypadSubtract) + TCODK_KPDIV (KeypadDivide) + TCODK_KPMUL (KeypadMultiply) + TCODK_KPDEC (KeypadDecimal) + TCODK_KPENTER (KeypadEnter) + TCODK_F1 (F1) + TCODK_F2 (F2) + TCODK_F3 (F3) + TCODK_F4 (F4) + TCODK_F5 (F5) + TCODK_F6 (F6) + TCODK_F7 (F7) + TCODK_F8 (F8) + TCODK_F9 (F9) + TCODK_F10 (F10) + TCODK_F11 (F11) + TCODK_F12 (F12) + TCODK_NUMLOCK (Numlock) + TCODK_SCROLLLOCK (Scrolllock) + TCODK_SPACE (Space) + + numeric keys : + + TCODK_0 (Zero) + TCODK_1 (One) + TCODK_2 (Two) + TCODK_3 (Three) + TCODK_4 (Four) + TCODK_5 (Five) + TCODK_6 (Six) + TCODK_7 (Seven) + TCODK_8 (Eight) + TCODK_9 (Nine) + TCODK_KP0 (KeypadZero) + TCODK_KP1 (KeypadOne) + TCODK_KP2 (KeypadTwo) + TCODK_KP3 (KeypadThree) + TCODK_KP4 (KeypadFour) + TCODK_KP5 (KeypadFive) + TCODK_KP6 (KeypadSix) + TCODK_KP7 (KeypadSeven) + TCODK_KP8 (KeypadEight) + TCODK_KP9 (KeypadNine) + + Any other (printable) key : + + TCODK_CHAR (Char) + + Codes starting with TCODK_KP represents keys on the numeric keypad (if available). + */ + + /** + @PageName console_offscreen + @PageFather console + @PageTitle Using off-screen consoles + @PageDesc The offscreen consoles allow you to draw on secondary consoles as you would do with the root console. You can then blit those secondary consoles on the root console. This allows you to use local coordinate space while rendering a portion of the final screen, and easily move components of the screen without modifying the rendering functions. + @FuncTitle Creating an offscreen console + @FuncDesc You can create as many off-screen consoles as you want by using this function. You can draw on them as you would do with the root console, but you cannot flush them to the screen. Else, you can blit them on other consoles, including the root console. See blit. The C version of this function returns a console handler that you can use in most console drawing functions. + @Cpp TCODConsole::TCODConsole(int w, int h) + @C TCOD_console_t TCOD_console_new(int w, int h) + @Py console_new(w,h) + @C# TCODConsole::TCODConsole(int w, int h) + @Lua tcod.Console(w,h) + @Param w,h the console size. + 0 < w + 0 < h + @CppEx + // Creating a 40x20 offscreen console, filling it with red and blitting it on the root console at position 5,5 + TCODConsole *offscreenConsole = new TCODConsole(40,20); + offscreenConsole->setDefaultBackground(TCODColor::red); + offscreenConsole->clear(); + TCODConsole::blit(offscreenConsole,0,0,40,20,TCODConsole::root,5,5,255); + @CEx + TCOD_console_t offscreen_console = TCOD_console_new(40,20); + TCOD_console_set_default_background(offscreen_console,TCOD_red); + TCOD_console_clear(offscreen_console); + TCOD_console_blit(offscreen_console,0,0,40,20,NULL,5,5,255); + @PyEx + offscreen_console = libtcod.console_new(40,20) + libtcod.console_set_background_color(offscreen_console,libtcod.red) + libtcod.console_clear(offscreen_console) + libtcod.console_blit(offscreen_console,0,0,40,20,0,5,5,255) + @LuaEx + -- Creating a 40x20 offscreen console, filling it with red and blitting it on the root console at position 5,5 + offscreenConsole = tcod.Console(40,20) + offscreenConsole:setBackgroundColor(tcod.color.red) + offscreenConsole:clear() + tcod.console.blit(offscreenConsole,0,0,40,20,libtcod.TCODConsole_root,5,5,255) + */ + TCODConsole(int w, int h); + + /** + @PageName console_offscreen + @FuncTitle Creating an offscreen console from a .asc or .apf file + @FuncDesc You can create an offscreen console from a file created with Ascii Paint with this constructor + @Cpp TCODConsole::TCODConsole(const char *filename) + @C TCOD_console_t TCOD_console_from_file(const char *filename) + @Param filename path to the .asc or .apf file created with Ascii Paint + @CppEx + // Creating an offscreen console, filling it with data from the .asc file + TCODConsole *offscreenConsole = new TCODConsole("myfile.asc"); + @CEx + TCOD_console_t offscreen_console = TCOD_console_from_file("myfile.apf"); + */ + TCODConsole(const char *filename); + + /** + @PageName console_offscreen + @FuncTitle Loading an offscreen console from a .asc file + @FuncDesc You can load data from a file created with Ascii Paint with this function. When needed, the console will be resized to fit the file size. The function returns false if it couldn't read the file. + @Cpp bool TCODConsole::loadAsc(const char *filename) + @C bool TCOD_console_load_asc(TCOD_console_t con, const char *filename) + @Param con in the C and Python versions, the offscreen console handler + @Param filename path to the .asc file created with Ascii Paint + @CppEx + // Creating a 40x20 offscreen console + TCODConsole *offscreenConsole = new TCODConsole(40,20); + // possibly resizing it and filling it with data from the .asc file + offscreenConsole->loadAsc("myfile.asc"); + @CEx + TCOD_console_t offscreen_console = TCOD_console_new(40,20); + TCOD_console_load_asc(offscreen_console,"myfile.asc"); + */ + bool loadAsc(const char *filename); + /** + @PageName console_offscreen + @FuncTitle Loading an offscreen console from a .apf file + @FuncDesc You can load data from a file created with Ascii Paint with this function. When needed, the console will be resized to fit the file size. The function returns false if it couldn't read the file. + @Cpp bool TCODConsole::loadApf(const char *filename) + @C bool TCOD_console_load_apf(TCOD_console_t con, const char *filename) + @Param con in the C and Python versions, the offscreen console handler + + @Param filename path to the .apf file created with Ascii Paint + + @CppEx + // Creating a 40x20 offscreen console + TCODConsole *offscreenConsole = new TCODConsole(40,20); + // possibly resizing it and filling it with data from the .apf file + offscreenConsole->loadApf("myfile.apf"); + @CEx + TCOD_console_t offscreen_console = TCOD_console_new(40,20); + TCOD_console_load_apf(offscreen_console,"myfile.asc"); + */ + bool loadApf(const char *filename); + + /** + @PageName console_offscreen + @FuncTitle Saving a console to a .asc file + @FuncDesc You can save data from a console to Ascii Paint format with this function. The function returns false if it couldn't write the file. This is the only ASC function that works also with the root console ! + @Cpp bool TCODConsole::saveAsc(const char *filename) const + @C bool TCOD_console_save_asc(TCOD_console_t con, const char *filename) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param filename path to the .asc file to be created + @CppEx + console->saveAsc("myfile.asc"); + @CEx + TCOD_console_save_asc(console,"myfile.asc"); + */ + bool saveAsc(const char *filename) const; + + /** + @PageName console_offscreen + @FuncTitle Saving a console to a .apf file + @FuncDesc You can save data from a console to Ascii Paint format with this function. The function returns false if it couldn't write the file. This is the only ASC function that works also with the root console ! + @Cpp bool TCODConsole::saveApf(const char *filename) const + @C bool TCOD_console_save_apf(TCOD_console_t con, const char *filename) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param filename path to the .apf file to be created + @CppEx + console->saveApf("myfile.apf"); + @CEx + TCOD_console_save_apf(console,"myfile.apf"); + */ + bool saveApf(const char *filename) const; + + bool loadXp(const char *filename) { + return TCOD_console_load_xp(data, filename) != 0; + } + bool saveXp(const char *filename, int compress_level) { + return TCOD_console_save_xp(data, filename, compress_level) != 0; + } + + /** + @PageName console_offscreen + @FuncTitle Blitting a console on another one + @FuncDesc This function allows you to blit a rectangular area of the source console at a specific position on a destination console. It can also simulate alpha transparency with the fade parameter. + @Cpp static void blit(const TCODConsole *src,int xSrc, int ySrc, int wSrc, int hSrc, TCODConsole *dst, int xDst, int yDst, float foregroundAlpha=1.0f, float backgroundAlpha=1.0f) + @C void TCOD_console_blit(TCOD_console_t src,int xSrc, int ySrc, int wSrc, int hSrc, TCOD_console_t dst, int xDst, int yDst, float foreground_alpha, float background_alpha) + @Py console_blit(src,xSrc,ySrc,xSrc,hSrc,dst,xDst,yDst,foregroundAlpha=1.0,backgroundAlpha=1.0) + @C# + static void TCODConsole::blit(TCODConsole src, int xSrc, int ySrc, int wSrc, int hSrc, TCODConsole dst, int xDst, int yDst) + static void TCODConsole::blit(TCODConsole src, int xSrc, int ySrc, int wSrc, int hSrc, TCODConsole dst, int xDst, int yDst, float foreground_alpha) + static void TCODConsole::blit(TCODConsole src, int xSrc, int ySrc, int wSrc, int hSrc, TCODConsole dst, int xDst, int yDst, float foreground_alpha, float background_alpha) + @Lua + tcod.console.blit(src, xSrc, ySrc, wSrc, hSrc, dst, xDst, yDst) + tcod.console.blit(src, xSrc, ySrc, wSrc, hSrc, dst, xDst, yDst, foreground_alpha) + tcod.console.blit(src, xSrc, ySrc, wSrc, hSrc, dst, xDst, yDst, foreground_alpha, background_alpha) + @Param src The source console that must be blitted on another one. + @Param xSrc,ySrc,wSrc,hSrc The rectangular area of the source console that will be blitted. If wSrc and/or hSrc == 0, the source console width/height are used + @Param dst The destination console. + @Param xDst,yDst Where to blit the upper-left corner of the source area in the destination console. + @Param foregroundAlpha,backgroundAlpha Alpha transparency of the blitted console. + 0.0 => The source console is completely transparent. This function does nothing. + 1.0 => The source console is opaque. Its cells replace the destination cells. + 0 < fade < 1.0 => The source console is partially blitted, simulating real transparency. + @CppEx + // Cross-fading between two offscreen consoles. We use two offscreen consoles with the same size as the root console. We render a different screen on each offscreen console. When the user hits a key, we do a cross-fading from the first screen to the second screen. + TCODConsole *off1 = new TCODConsole(80,50); + TCODConsole *off2 = new TCODConsole(80,50); + ... print screen1 on off1 + ... print screen2 of off2 + // render screen1 in the game window + TCODConsole::blit(off1,0,0,80,50,TCODConsole::root,0,0); + TCODConsole::flush(); + // wait or a keypress + TCODConsole::waitForKeypress(true); + // do a cross-fading from off1 to off2 + for (int i=1; i <= 255; i++) { + TCODConsole::blit(off1,0,0,80,50,TCODConsole::root,0,0); // renders the first screen (opaque) + TCODConsole::blit(off2,0,0,80,50,TCODConsole::root,0,0,i/255.0,i/255.0); // renders the second screen (transparent) + TCODConsole::flush(); + } + @CEx + TCOD_console_t off1 = TCOD_console_new(80,50); + TCOD_console_t off2 = TCOD_console_new(80,50); + int i; + ... print screen1 on off1 + ... print screen2 of off2 + // render screen1 in the game window + TCOD_console_blit(off1,0,0,80,50,NULL,0,0,1.0,1.0); + TCOD_console_flush(); + // wait or a keypress + TCOD_console_wait_for_keypress(true); + // do a cross-fading from off1 to off2 + for (i=1; i <= 255; i++) { + TCOD_console_blit(off1,0,0,80,50,NULL,0,0,1.0,1.0); // renders the first screen (opaque) + TCOD_console_blit(off2,0,0,80,50,NULL,0,0,i/255.0,i/255.0); // renders the second screen (transparent) + TCOD_console_flush(); + } + @PyEx + off1 = libtcod.console_new(80,50) + off2 = libtcod.console_new(80,50) + ... print screen1 on off1 + ... print screen2 of off2 + # render screen1 in the game window + libtcod.console_blit(off1,0,0,80,50,0,0,0) + libtcod.console_flush() + # wait or a keypress + libtcod.console_wait_for_keypress(True) + # do a cross-fading from off1 to off2 + for i in range(1,256) : + litbcod.console_blit(off1,0,0,80,50,0,0,0) # renders the first screen (opaque) + litbcod.console_blit(off2,0,0,80,50,0,0,0,i/255.0,i/255.0) # renders the second screen (transparent) + litbcod.console_flush() + @LuaEx + -- Cross-fading between two offscreen consoles. We use two offscreen consoles with the same size as the root console. We render a different screen on each offscreen console. When the user hits a key, we do a cross-fading from the first screen to the second screen. + off1 = tcod.Console(80,50) + off2 = tcod.Console(80,50) + ... print screen1 on off1 + ... print screen2 of off2 + -- render screen1 in the game window + root=libtcod.TCODConsole_root + tcod.console.blit(off1,0,0,80,50,root,0,0) + tcod.console.flush() + -- wait or a keypress + tcod.console.waitForKeypress(true) + -- do a cross-fading from off1 to off2 + for i=1,255,1 do + tcod.console.blit(off1,0,0,80,50,root,0,0) -- renders the first screen (opaque) + tcod.console.blit(off2,0,0,80,50,root,0,0,i/255,i/255) -- renders the second screen (transparent) + tcod.console.flush() + end + */ + static void blit(const TCODConsole *src,int xSrc, int ySrc, int wSrc, int hSrc, TCODConsole *dst, int xDst, int yDst, float foreground_alpha=1.0f, float background_alpha=1.0f); + /** + @PageName console_offscreen + @FuncTitle Define a blit-transparent color + @FuncDesc This function defines a transparent background color for an offscreen console. All cells with this background color are ignored by the blit operation. You can use it to blit only some parts of the console. + @Cpp void TCODConsole::setKeyColor(const TCODColor &col) + @C void TCOD_console_set_key_color(TCOD_console_t con,TCOD_color_t col) + @Py console_set_key_color(con,col) + @C# void TCODConsole::setKeyColor(TCODColor col) + @Lua Console:setKeyColor(col) + @Param con in the C and Python versions, the offscreen console handler or NULL for the root console + @Param col the transparent background color + */ + void setKeyColor(const TCODColor &col); + /** + @PageName console_offscreen + @FuncTitle Destroying an offscreen console + @FuncDesc Use this function to destroy an offscreen console and release any resources allocated. Don't use it on the root console. + @Cpp TCODConsole::~TCODConsole() + @C void TCOD_console_delete(TCOD_console_t con) + @Py console_delete(con) + @C# void TCODConsole::Dispose() + @Lua through garbage collector + @Param con in the C and Python versions, the offscreen console handler + @CppEx + TCODConsole *off1 = new TCODConsole(80,50); + ... use off1 + delete off1; // destroy the offscreen console + @CEx + TCOD_console_t off1 = TCOD_console_new(80,50); + ... use off1 + TCOD_console_delete(off1); // destroy the offscreen console + @PyEx + off1 = libtcod.console_new(80,50) + ... use off1 + libtcod.console_delete(off1) # destroy the offscreen console + @LuaEx + off1 = tcod.Console(80,50) + ... use off1 + off1=nil -- release the reference + */ + TCOD_DEPRECATED("This function is a stub and will do nothing.") + static void setKeyboardRepeat(int initialDelay,int interval); + TCOD_DEPRECATED("This function is a stub and will do nothing.") + static void disableKeyboardRepeat(); + + virtual ~TCODConsole(); + + void setDirty(int x, int y, int w, int h); + + + TCODConsole(TCOD_console_t con) : data(con) {} + + // ctrl = TCOD_COLCTRL_1...TCOD_COLCTRL_5 or TCOD_COLCTRL_STOP + static const char *getColorControlString( TCOD_colctrl_t ctrl ); + // ctrl = TCOD_COLCTRL_FORE_RGB or TCOD_COLCTRL_BACK_RGB + static const char *getRGBColorControlString( TCOD_colctrl_t ctrl, const TCODColor & col ); + /** + * Return a pointer to the underlying TCOD_Console struct. + * \rst + * .. versionadded:: 1.14 + * \endrst + */ + TCOD_Console* get_data() noexcept + { + return data; + } + const TCOD_Console* get_data() const noexcept + { + return data; + } +protected : + TCODConsole(); + TCOD_Console* data = nullptr; +}; +#endif /* _TCOD_CONSOLE_HPP */ diff --git a/tcod_sys/libtcod/src/console.cpp b/tcod_sys/libtcod/src/libtcod/console_.cpp similarity index 63% rename from tcod_sys/libtcod/src/console.cpp rename to tcod_sys/libtcod/src/libtcod/console_.cpp index 34fb53e2a..3c9c206e2 100644 --- a/tcod_sys/libtcod/src/console.cpp +++ b/tcod_sys/libtcod/src/libtcod/console_.cpp @@ -1,441 +1,463 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include - -#include -#include - -#ifdef TCOD_CONSOLE_SUPPORT - -TCODConsole * TCODConsole::root = NULL; - -TCODConsole::TCODConsole() {} -TCODConsole::TCODConsole(int w, int h) { - data = TCOD_console_new(w,h); -} - -TCODConsole::TCODConsole(const char *filename) { - data = TCOD_console_from_file(filename); -} - -bool TCODConsole::loadAsc(const char *filename) { - return TCOD_console_load_asc(data,filename) != 0; -} -bool TCODConsole::saveAsc(const char *filename) const { - return TCOD_console_save_asc(data,filename) != 0; -} -bool TCODConsole::saveApf(const char *filename) const { - return TCOD_console_save_apf(data,filename) != 0; -} -bool TCODConsole::loadApf(const char *filename) { - return TCOD_console_load_apf(data,filename) != 0; -} - -void TCODConsole::setCustomFont(const char *fontFile, int flags,int nbCharHoriz, int nbCharVertic) { - TCOD_console_set_custom_font(fontFile,flags,nbCharHoriz,nbCharVertic); -} - -void TCODConsole::mapAsciiCodeToFont(int asciiCode, int fontCharX, int fontCharY) { - TCOD_console_map_ascii_code_to_font(asciiCode,fontCharX,fontCharY); -} - -void TCODConsole::mapAsciiCodesToFont(int firstAsciiCode, int nbCodes, int fontCharX, int fontCharY) { - TCOD_console_map_ascii_codes_to_font(firstAsciiCode,nbCodes,fontCharX,fontCharY); -} - -void TCODConsole::mapStringToFont(const char *s, int fontCharX, int fontCharY) { - TCOD_console_map_string_to_font(s, fontCharX, fontCharY); -} - -void TCODConsole::setDirty(int x, int y, int w, int h) { - TCOD_console_set_dirty(x,y,w,h); -} - -TCOD_key_t TCODConsole::checkForKeypress(int flags) { - return TCOD_sys_check_for_keypress(flags); -} - -TCOD_key_t TCODConsole::waitForKeypress(bool flush) { - return TCOD_sys_wait_for_keypress(flush); -} - -bool TCODConsole::isWindowClosed() { - return TCOD_console_is_window_closed() != 0; -} - -bool TCODConsole::hasMouseFocus() { - return TCOD_console_has_mouse_focus() != 0; -} - -bool TCODConsole::isActive() { - return TCOD_console_is_active() != 0; -} - -int TCODConsole::getWidth() const { - return TCOD_console_get_width(data); -} - -int TCODConsole::getHeight() const { - return TCOD_console_get_height(data); -} - -void TCODConsole::setColorControl(TCOD_colctrl_t con, const TCODColor &fore, const TCODColor &back) { - TCOD_color_t b={back.r,back.g,back.b},f={fore.r,fore.g,fore.b}; - TCOD_console_set_color_control(con,f,b); -} - -TCODColor TCODConsole::getDefaultBackground() const { - TCOD_color_t c= TCOD_console_get_default_background(data); - TCODColor ret; - ret.r=c.r; - ret.g=c.g; - ret.b=c.b; - return ret; -} -TCODColor TCODConsole::getDefaultForeground() const { - return TCOD_console_get_default_foreground(data); -} -void TCODConsole::setDefaultBackground(TCODColor back) { - TCOD_color_t b={back.r,back.g,back.b}; - TCOD_console_set_default_background(data,b); -} -void TCODConsole::setDefaultForeground(TCODColor fore) { - TCOD_color_t b={fore.r,fore.g,fore.b}; - TCOD_console_set_default_foreground(data,b); -} - -#ifndef TCOD_BARE -void TCODConsole::setWindowTitle(const char *title) { - TCOD_sys_set_window_title(title); -} -#endif - -void TCODConsole::initRoot(int w, int h, const char *title, bool fullscreen, TCOD_renderer_t renderer) { - TCODConsole *con=new TCODConsole(); - TCOD_console_init_root(w,h,title,fullscreen,renderer); - con->data=TCOD_ctx.root; - TCODConsole::root=con; -} - -void TCODConsole::setFullscreen(bool fullscreen) { - TCOD_console_set_fullscreen(fullscreen); -} - -bool TCODConsole::isFullscreen() { - return TCOD_console_is_fullscreen() != 0; -} - -void TCODConsole::setBackgroundFlag(TCOD_bkgnd_flag_t bkgnd_flag) { - TCOD_console_set_background_flag(data,bkgnd_flag); -} - -TCOD_bkgnd_flag_t TCODConsole::getBackgroundFlag() const { - return TCOD_console_get_background_flag(data); -} - -void TCODConsole::setAlignment(TCOD_alignment_t alignment) { - TCOD_console_set_alignment(data,alignment); -} - -TCOD_alignment_t TCODConsole::getAlignment() const { - return TCOD_console_get_alignment(data); -} - -TCODConsole::~TCODConsole() { - TCOD_console_delete(data); -} - -void TCODConsole::blit(const TCODConsole *srcCon,int xSrc, int ySrc, int wSrc, int hSrc, - TCODConsole *dstCon, int xDst, int yDst, float foreground_alpha, float background_alpha) { - TCOD_console_blit(srcCon->data,xSrc,ySrc,wSrc,hSrc,dstCon->data,xDst,yDst,foreground_alpha, background_alpha); -} - - -void TCODConsole::flush() { - TCOD_console_flush(); -} - -void TCODConsole::setFade(uint8_t val, const TCODColor &fade) { - TCOD_color_t f= {fade.r,fade.g,fade.b}; - TCOD_console_set_fade(val,f); -} - -uint8_t TCODConsole::getFade() { - return TCOD_console_get_fade(); -} - -TCODColor TCODConsole::getFadingColor() { - return TCOD_console_get_fading_color(); -} - -void TCODConsole::putChar(int x, int y, int c, TCOD_bkgnd_flag_t flag) { - TCOD_console_put_char(data,x,y,c,flag); -} - -void TCODConsole::putCharEx(int x, int y, int c, const TCODColor &fore, const TCODColor &back) { - TCOD_color_t f={fore.r,fore.g,fore.b}; - TCOD_color_t b={back.r,back.g,back.b}; - TCOD_console_put_char_ex(data,x,y,c,f,b); -} - -void TCODConsole::clear() { - TCOD_console_clear(data); -} - -TCODColor TCODConsole::getCharBackground(int x, int y) const { - return TCOD_console_get_char_background(data,x,y); -} -void TCODConsole::setCharForeground(int x,int y, const TCODColor &col) { - TCOD_color_t c={col.r,col.g,col.b}; - TCOD_console_set_char_foreground(data,x,y,c); -} -TCODColor TCODConsole::getCharForeground(int x, int y) const { - return TCOD_console_get_char_foreground(data,x,y); -} - -int TCODConsole::getChar(int x, int y) const { - return TCOD_console_get_char(data,x,y); -} - -void TCODConsole::setCharBackground(int x, int y, const TCODColor &col, TCOD_bkgnd_flag_t flag) { - TCOD_color_t c={col.r,col.g,col.b}; - TCOD_console_set_char_background(data,x,y,c,flag); -} - -void TCODConsole::setChar(int x, int y, int c) { - TCOD_console_set_char(data,x,y,c); -} - -void TCODConsole::rect(int x,int y, int rw, int rh, bool clear, TCOD_bkgnd_flag_t flag) { - TCOD_console_rect(data,x,y,rw,rh,clear,flag); -} - -void TCODConsole::hline(int x,int y, int l, TCOD_bkgnd_flag_t flag) { - TCOD_console_hline(data,x,y,l,flag); -} - -void TCODConsole::vline(int x,int y, int l, TCOD_bkgnd_flag_t flag) { - TCOD_console_vline(data,x,y,l,flag); -} - -/* -TCODImage *TCODConsole::getForegroundColorImage() { - return new TCODImage(TCOD_console_get_foreground_color_image(data)); -} - -TCODImage *TCODConsole::getBackgroundColorImage() { - return new TCODImage(TCOD_console_get_background_color_image(data)); -} -*/ - -void TCODConsole::printFrame(int x,int y,int w,int h, bool empty, TCOD_bkgnd_flag_t flag, const char *fmt , ...) { - if ( fmt ) { - va_list ap; - va_start(ap,fmt); - TCOD_console_print_frame(data,x,y,w,h,empty,flag,TCOD_console_vsprint(fmt,ap)); - va_end(ap); - } else { - TCOD_console_print_frame(data,x,y,w,h,empty,flag,NULL); - } -} - -void TCODConsole::print(int x, int y, const char *fmt, ...) { - va_list ap; - TCOD_console_data_t *dat=(TCOD_console_data_t *)data; - TCOD_IFNOT ( dat != NULL ) return; - va_start(ap,fmt); - TCOD_console_print_internal(data,x,y,0,0,dat->bkgnd_flag,dat->alignment, - TCOD_console_vsprint(fmt,ap),false,false); - va_end(ap); -} - -void TCODConsole::printEx(int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...) { - va_list ap; - va_start(ap,fmt); - TCOD_console_print_internal(data,x,y,0,0,flag,alignment,TCOD_console_vsprint(fmt,ap),false,false); - va_end(ap); -} - - -/* -void TCODConsole::printLine(int x, int y, TCOD_bkgnd_flag_t flag, TCOD_print_location_t location, const char *fmt, ...) { - va_list ap; - va_start(ap,fmt); - switch(location) - { - case TCOD_PRINT_LEFT: - TCOD_console_print(data,x,y,getWidth()-x,getHeight()-y,flag,LEFT,TCOD_console_vsprint(fmt,ap),false,false); - break; - case TCOD_PRINT_RIGHT: - TCOD_console_print(data,x,y,x+1,getHeight()-y,flag,RIGHT,TCOD_console_vsprint(fmt,ap),false,false); - break; - case TCOD_PRINT_CENTER: - TCOD_console_print(data,x,y,getWidth(),getHeight()-y,flag,CENTER,TCOD_console_vsprint(fmt,ap),false,false); - break; - default: - TCOD_ASSERT(0); - break; - } - va_end(ap); -} -*/ - -int TCODConsole::printRect(int x, int y, int w, int h, const char *fmt, ...) { - va_list ap; - TCOD_console_data_t *dat=(TCOD_console_data_t *)data; - TCOD_IFNOT ( dat != NULL ) return 0; - va_start(ap,fmt); - int ret = TCOD_console_print_internal(data,x,y,w,h,dat->bkgnd_flag,dat->alignment,TCOD_console_vsprint(fmt,ap),true,false); - va_end(ap); - return ret; -} - -int TCODConsole::printRectEx(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, - TCOD_alignment_t alignment, const char *fmt, ...) { - va_list ap; - va_start(ap,fmt); - int ret = TCOD_console_print_internal(data,x,y,w,h,flag,alignment,TCOD_console_vsprint(fmt,ap),true,false); - va_end(ap); - return ret; -} - -int TCODConsole::getHeightRect(int x, int y, int w, int h, const char *fmt, ...) { - va_list ap; - va_start(ap,fmt); - int ret = TCOD_console_print_internal(data,x,y,w,h,TCOD_BKGND_NONE,TCOD_LEFT,TCOD_console_vsprint(fmt,ap),true,true); - va_end(ap); - return ret; -} - -bool TCODConsole::isKeyPressed(TCOD_keycode_t key) { - return TCOD_console_is_key_pressed(key) != 0; -} -void TCODConsole::setKeyColor(const TCODColor &col) { - TCOD_color_t c={col.r,col.g,col.b}; - TCOD_console_set_key_color(data,c); -} - -void TCODConsole::credits() { - TCOD_console_credits(); -} - -void TCODConsole::resetCredits() { - TCOD_console_credits_reset(); -} - -bool TCODConsole::renderCredits(int x, int y, bool alpha) { - return TCOD_console_credits_render(x,y,alpha) != 0; -} - -#ifndef NO_UNICODE -void TCODConsole::mapStringToFont(const wchar_t *s, int fontCharX, int fontCharY) { - TCOD_console_map_string_to_font_utf(s, fontCharX, fontCharY); -} - -void TCODConsole::print(int x, int y, const wchar_t *fmt, ...) { - va_list ap; - TCOD_console_data_t *dat=(TCOD_console_data_t *)data; - TCOD_IFNOT ( dat != NULL ) return; - va_start(ap,fmt); - TCOD_console_print_internal_utf(data,x,y,0,0,dat->bkgnd_flag,dat->alignment,TCOD_console_vsprint_utf(fmt,ap),false,false); - va_end(ap); -} - -void TCODConsole::printEx(int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...) { - va_list ap; - va_start(ap,fmt); - TCOD_console_print_internal_utf(data,x,y,0,0,flag,alignment,TCOD_console_vsprint_utf(fmt,ap),false,false); - va_end(ap); -} - -int TCODConsole::printRect(int x, int y, int w, int h, const wchar_t *fmt, ...) { - va_list ap; - TCOD_console_data_t *dat=(TCOD_console_data_t *)data; - TCOD_IFNOT ( dat != NULL ) return 0; - va_start(ap,fmt); - int ret = TCOD_console_print_internal_utf(data,x,y,w,h,dat->bkgnd_flag,dat->alignment, - TCOD_console_vsprint_utf(fmt,ap),true,false); - va_end(ap); - return ret; -} - -int TCODConsole::printRectEx(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, - TCOD_alignment_t alignment, const wchar_t *fmt, ...) { - va_list ap; - va_start(ap,fmt); - int ret = TCOD_console_print_internal_utf(data,x,y,w,h,flag,alignment, - TCOD_console_vsprint_utf(fmt,ap),true,false); - va_end(ap); - return ret; -} - -int TCODConsole::getHeightRect(int x, int y, int w, int h, const wchar_t *fmt, ...) { - va_list ap; - va_start(ap,fmt); - int ret = TCOD_console_print_internal_utf(data,x,y,w,h,TCOD_BKGND_NONE,TCOD_LEFT,TCOD_console_vsprint_utf(fmt,ap),true,true); - va_end(ap); - return ret; -} - -// color control string formatting utilities for swigged language - -// ctrl = TCOD_COLCTRL_1...TCOD_COLCTRL_5 or TCOD_COLCTRL_STOP -#define NB_BUFFERS 10 -const char *TCODConsole::getColorControlString( TCOD_colctrl_t ctrl ) { - static char buf[NB_BUFFERS][2]; - static int buf_nb=0; - const char *ret; - buf[buf_nb][0]=ctrl; - buf[buf_nb][1]=0; - ret = (const char *)(&buf[buf_nb][0]); - buf_nb = (buf_nb+1) % NB_BUFFERS; - return ret; -} - -// ctrl = TCOD_COLCTRL_FORE_RGB or TCOD_COLCTRL_BACK_RGB -const char *TCODConsole::getRGBColorControlString( TCOD_colctrl_t ctrl, const TCODColor & col ) { - static char buf[NB_BUFFERS][5]; - static int buf_nb=0; - const char *ret; - buf[buf_nb][0]=ctrl; - buf[buf_nb][1]=col.r; - buf[buf_nb][2]=col.g; - buf[buf_nb][3]=col.b; - buf[buf_nb][4]=0; - ret = (const char *)(&buf[buf_nb][0]); - buf_nb = (buf_nb+1) % NB_BUFFERS; - return ret; -} - -#endif - -#endif /* TCOD_CONSOLE_SUPPORT */ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "console.hpp" + +#include +#include +#include + +#include "libtcod_int.h" +#include "image.hpp" +#include "console_init.h" +#include "console_printing.h" + +TCODConsole* TCODConsole::root = new TCODConsole(); + +TCODConsole::TCODConsole() {} +TCODConsole::TCODConsole(int w, int h) { + data = TCOD_console_new(w,h); +} + +TCODConsole::TCODConsole(const char *filename) { + data = TCOD_console_from_file(filename); +} + +bool TCODConsole::loadAsc(const char *filename) { + return TCOD_console_load_asc(data,filename) != 0; +} +bool TCODConsole::saveAsc(const char *filename) const { + return TCOD_console_save_asc(data,filename) != 0; +} +bool TCODConsole::saveApf(const char *filename) const { + return TCOD_console_save_apf(data,filename) != 0; +} +bool TCODConsole::loadApf(const char *filename) { + return TCOD_console_load_apf(data,filename) != 0; +} + +void TCODConsole::setCustomFont(const char *fontFile, int flags,int nbCharHoriz, int nbCharVertic) { + TCOD_console_set_custom_font(fontFile,flags,nbCharHoriz,nbCharVertic); +} + +void TCODConsole::mapAsciiCodeToFont(int asciiCode, int fontCharX, int fontCharY) { + TCOD_console_map_ascii_code_to_font(asciiCode,fontCharX,fontCharY); +} + +void TCODConsole::mapAsciiCodesToFont(int firstAsciiCode, int nbCodes, int fontCharX, int fontCharY) { + TCOD_console_map_ascii_codes_to_font(firstAsciiCode,nbCodes,fontCharX,fontCharY); +} + +void TCODConsole::mapStringToFont(const char *s, int fontCharX, int fontCharY) { + TCOD_console_map_string_to_font(s, fontCharX, fontCharY); +} + +void TCODConsole::setDirty(int, int, int, int) {} + +TCOD_key_t TCODConsole::checkForKeypress(int flags) { + return TCOD_sys_check_for_keypress(flags); +} + +TCOD_key_t TCODConsole::waitForKeypress(bool flush) { + return TCOD_sys_wait_for_keypress(flush); +} + +bool TCODConsole::isWindowClosed() { + return TCOD_console_is_window_closed() != 0; +} + +bool TCODConsole::hasMouseFocus() { + return TCOD_console_has_mouse_focus() != 0; +} + +bool TCODConsole::isActive() { + return TCOD_console_is_active() != 0; +} + +int TCODConsole::getWidth() const { + return TCOD_console_get_width(data); +} + +int TCODConsole::getHeight() const { + return TCOD_console_get_height(data); +} + +void TCODConsole::setColorControl(TCOD_colctrl_t con, const TCODColor &fore, const TCODColor &back) { + TCOD_color_t b={back.r,back.g,back.b},f={fore.r,fore.g,fore.b}; + TCOD_console_set_color_control(con,f,b); +} + +TCODColor TCODConsole::getDefaultBackground() const { + TCOD_color_t c= TCOD_console_get_default_background(data); + TCODColor ret; + ret.r=c.r; + ret.g=c.g; + ret.b=c.b; + return ret; +} +TCODColor TCODConsole::getDefaultForeground() const { + return TCOD_console_get_default_foreground(data); +} +void TCODConsole::setDefaultBackground(TCODColor back) { + TCOD_color_t b={back.r,back.g,back.b}; + TCOD_console_set_default_background(data,b); +} +void TCODConsole::setDefaultForeground(TCODColor fore) { + TCOD_color_t b={fore.r,fore.g,fore.b}; + TCOD_console_set_default_foreground(data,b); +} + +void TCODConsole::setWindowTitle(const char *title) { + TCOD_console_set_window_title(title); +} + +void TCODConsole::initRoot(int w, int h, const char *title, bool fullscreen, + TCOD_renderer_t renderer) +{ + tcod::check_throw_error( + TCOD_console_init_root(w, h, title, fullscreen, renderer) + ); +} + +void TCODConsole::setFullscreen(bool fullscreen) { + TCOD_console_set_fullscreen(fullscreen); +} + +bool TCODConsole::isFullscreen() { + return TCOD_console_is_fullscreen() != 0; +} + +void TCODConsole::setBackgroundFlag(TCOD_bkgnd_flag_t bkgnd_flag) { + TCOD_console_set_background_flag(data,bkgnd_flag); +} + +TCOD_bkgnd_flag_t TCODConsole::getBackgroundFlag() const { + return TCOD_console_get_background_flag(data); +} + +void TCODConsole::setAlignment(TCOD_alignment_t alignment) { + TCOD_console_set_alignment(data,alignment); +} + +TCOD_alignment_t TCODConsole::getAlignment() const { + return TCOD_console_get_alignment(data); +} + +TCODConsole::~TCODConsole() { + TCOD_console_delete(data); +} + +void TCODConsole::blit(const TCODConsole *srcCon,int xSrc, int ySrc, int wSrc, int hSrc, + TCODConsole *dstCon, int xDst, int yDst, float foreground_alpha, float background_alpha) { + TCOD_console_blit(srcCon->data,xSrc,ySrc,wSrc,hSrc,dstCon->data,xDst,yDst,foreground_alpha, background_alpha); +} + + +void TCODConsole::flush() { + tcod::check_throw_error(TCOD_console_flush()); +} + +void TCODConsole::setFade(uint8_t val, const TCODColor &fade) { + TCOD_color_t f= {fade.r,fade.g,fade.b}; + TCOD_console_set_fade(val,f); +} + +uint8_t TCODConsole::getFade() { + return TCOD_console_get_fade(); +} + +TCODColor TCODConsole::getFadingColor() { + return TCOD_console_get_fading_color(); +} + +void TCODConsole::putChar(int x, int y, int c, TCOD_bkgnd_flag_t flag) { + TCOD_console_put_char(data,x,y,c,flag); +} + +void TCODConsole::putCharEx(int x, int y, int c, const TCODColor &fore, const TCODColor &back) { + TCOD_color_t f={fore.r,fore.g,fore.b}; + TCOD_color_t b={back.r,back.g,back.b}; + TCOD_console_put_char_ex(data,x,y,c,f,b); +} + +void TCODConsole::clear() { + TCOD_console_clear(data); +} + +TCODColor TCODConsole::getCharBackground(int x, int y) const { + return TCOD_console_get_char_background(data,x,y); +} +void TCODConsole::setCharForeground(int x,int y, const TCODColor &col) { + TCOD_color_t c={col.r,col.g,col.b}; + TCOD_console_set_char_foreground(data,x,y,c); +} +TCODColor TCODConsole::getCharForeground(int x, int y) const { + return TCOD_console_get_char_foreground(data,x,y); +} + +int TCODConsole::getChar(int x, int y) const { + return TCOD_console_get_char(data,x,y); +} + +void TCODConsole::setCharBackground(int x, int y, const TCODColor &col, TCOD_bkgnd_flag_t flag) { + TCOD_color_t c={col.r,col.g,col.b}; + TCOD_console_set_char_background(data,x,y,c,flag); +} + +void TCODConsole::setChar(int x, int y, int c) { + TCOD_console_set_char(data,x,y,c); +} + +void TCODConsole::rect(int x,int y, int rw, int rh, bool clear, TCOD_bkgnd_flag_t flag) { + TCOD_console_rect(data,x,y,rw,rh,clear,flag); +} + +void TCODConsole::hline(int x,int y, int l, TCOD_bkgnd_flag_t flag) { + TCOD_console_hline(data,x,y,l,flag); +} + +void TCODConsole::vline(int x,int y, int l, TCOD_bkgnd_flag_t flag) { + TCOD_console_vline(data,x,y,l,flag); +} + +void TCODConsole::printFrame(int x,int y,int w,int h, bool empty, TCOD_bkgnd_flag_t flag, const char *fmt , ...) { + if ( fmt ) { + va_list ap; + va_start(ap,fmt); + TCOD_console_print_frame(data,x,y,w,h,empty,flag,TCOD_console_vsprint(fmt,ap)); + va_end(ap); + } else { + TCOD_console_print_frame(data,x,y,w,h,empty,flag,NULL); + } +} +/** Deprecated EASCII function. */ +void TCODConsole::print(int x, int y, const char *fmt, ...) { + va_list ap; + va_start(ap, fmt); + TCOD_console_print_internal( + data, x, y, 0, 0, getBackgroundFlag(), getAlignment(), + TCOD_console_vsprint(fmt, ap), false, false); + va_end(ap); +} +void TCODConsole::print(int x, int y, const std::string &str) { + this->print(x, y, str, getAlignment(), getBackgroundFlag()); +} +void TCODConsole::print(int x, int y, const std::string &str, + TCOD_alignment_t alignment, TCOD_bkgnd_flag_t flag) { + auto fg_ = getDefaultForeground(); + auto bg_ = getDefaultBackground(); + TCOD_ColorRGB fg{fg_.r, fg_.g, fg_.b}; + TCOD_ColorRGB bg{bg_.r, bg_.g, bg_.b}; + TCOD_console_printn( + data, x, y, str.size(), str.c_str(), &fg, &bg, flag, alignment); +} +void TCODConsole::printf(int x, int y, const char *fmt, ...) { + va_list ap; + va_start(ap, fmt); + this->print(x, y, std::string(TCOD_console_vsprint(fmt, ap))); + va_end(ap); +} +void TCODConsole::printf(int x, int y, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment, const char *fmt, ...) { + va_list ap; + va_start(ap, fmt); + this->print(x, y, std::string(TCOD_console_vsprint(fmt, ap)), + alignment, flag); + va_end(ap); +} +/** Deprecated EASCII function. */ +void TCODConsole::printEx(int x, int y, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment, const char *fmt, ...) { + va_list ap; + va_start(ap, fmt); + TCOD_console_print_internal(data, x, y, 0, 0, flag, alignment, + TCOD_console_vsprint(fmt,ap), false, false); + va_end(ap); +} + + +/* +void TCODConsole::printLine(int x, int y, TCOD_bkgnd_flag_t flag, TCOD_print_location_t location, const char *fmt, ...) { + va_list ap; + va_start(ap,fmt); + switch(location) + { + case TCOD_PRINT_LEFT: + TCOD_console_print(data,x,y,getWidth()-x,getHeight()-y,flag,LEFT,TCOD_console_vsprint(fmt,ap),false,false); + break; + case TCOD_PRINT_RIGHT: + TCOD_console_print(data,x,y,x+1,getHeight()-y,flag,RIGHT,TCOD_console_vsprint(fmt,ap),false,false); + break; + case TCOD_PRINT_CENTER: + TCOD_console_print(data,x,y,getWidth(),getHeight()-y,flag,CENTER,TCOD_console_vsprint(fmt,ap),false,false); + break; + default: + TCOD_ASSERT(0); + break; + } + va_end(ap); +} +*/ + +int TCODConsole::printRect(int x, int y, int w, int h, const char *fmt, ...) +{ + va_list ap; + va_start(ap,fmt); + int ret = TCOD_console_print_internal( + data, x, y, w, h, getBackgroundFlag(), getAlignment(), + TCOD_console_vsprint(fmt, ap), true, false); + va_end(ap); + return ret; +} + +int TCODConsole::printRectEx(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment, const char *fmt, ...) { + va_list ap; + va_start(ap,fmt); + int ret = TCOD_console_print_internal(data,x,y,w,h,flag,alignment,TCOD_console_vsprint(fmt,ap),true,false); + va_end(ap); + return ret; +} + +int TCODConsole::getHeightRect(int x, int y, int w, int h, const char *fmt, ...) { + va_list ap; + va_start(ap,fmt); + int ret = TCOD_console_print_internal(data,x,y,w,h,TCOD_BKGND_NONE,TCOD_LEFT,TCOD_console_vsprint(fmt,ap),true,true); + va_end(ap); + return ret; +} + +bool TCODConsole::isKeyPressed(TCOD_keycode_t key) { + return TCOD_console_is_key_pressed(key) != 0; +} +void TCODConsole::setKeyColor(const TCODColor &col) { + TCOD_color_t c={col.r,col.g,col.b}; + TCOD_console_set_key_color(data,c); +} + +void TCODConsole::credits() { + TCOD_console_credits(); +} + +void TCODConsole::resetCredits() { + TCOD_console_credits_reset(); +} + +bool TCODConsole::renderCredits(int x, int y, bool alpha) { + return TCOD_console_credits_render(x,y,alpha) != 0; +} + +#ifndef NO_UNICODE +void TCODConsole::mapStringToFont(const wchar_t *s, int fontCharX, int fontCharY) { + TCOD_console_map_string_to_font_utf(s, fontCharX, fontCharY); +} + +void TCODConsole::print(int x, int y, const wchar_t *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + TCOD_console_print_internal_utf( + data, x, y, 0, 0, getBackgroundFlag(), getAlignment(), + TCOD_console_vsprint_utf(fmt, ap), false, false); + va_end(ap); +} + +void TCODConsole::printEx(int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...) { + va_list ap; + va_start(ap,fmt); + TCOD_console_print_internal_utf(data,x,y,0,0,flag,alignment,TCOD_console_vsprint_utf(fmt,ap),false,false); + va_end(ap); +} + +int TCODConsole::printRect(int x, int y, int w, int h, const wchar_t *fmt, ...) +{ + va_list ap; + va_start(ap,fmt); + int ret = TCOD_console_print_internal_utf( + data, x, y, w, h, getBackgroundFlag(), getAlignment(), + TCOD_console_vsprint_utf(fmt, ap), true, false); + va_end(ap); + return ret; +} + +int TCODConsole::printRectEx(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment, const wchar_t *fmt, ...) { + va_list ap; + va_start(ap,fmt); + int ret = TCOD_console_print_internal_utf(data,x,y,w,h,flag,alignment, + TCOD_console_vsprint_utf(fmt,ap),true,false); + va_end(ap); + return ret; +} + +int TCODConsole::getHeightRect(int x, int y, int w, int h, const wchar_t *fmt, ...) { + va_list ap; + va_start(ap,fmt); + int ret = TCOD_console_print_internal_utf(data,x,y,w,h,TCOD_BKGND_NONE,TCOD_LEFT,TCOD_console_vsprint_utf(fmt,ap),true,true); + va_end(ap); + return ret; +} + +// color control string formatting utilities for swigged language + +// ctrl = TCOD_COLCTRL_1...TCOD_COLCTRL_5 or TCOD_COLCTRL_STOP +#define NB_BUFFERS 10 +const char *TCODConsole::getColorControlString(TCOD_colctrl_t ctrl) +{ + static char buf[NB_BUFFERS][2]; + static int buf_nb = 0; + buf[buf_nb][0] = ctrl; + buf[buf_nb][1] = 0; + const char* ret = buf[buf_nb]; + buf_nb = (buf_nb + 1) % NB_BUFFERS; + return ret; +} + +// ctrl = TCOD_COLCTRL_FORE_RGB or TCOD_COLCTRL_BACK_RGB +const char *TCODConsole::getRGBColorControlString(TCOD_colctrl_t ctrl, + const TCODColor& col) +{ + static char buf[NB_BUFFERS][5]; + static int buf_nb = 0; + buf[buf_nb][0] = ctrl; + buf[buf_nb][1] = col.r; + buf[buf_nb][2] = col.g; + buf[buf_nb][3] = col.b; + buf[buf_nb][4] = 0; + const char* ret = buf[buf_nb]; + buf_nb = (buf_nb + 1) % NB_BUFFERS; + return ret; +} +#endif // NO_UNICODE + +// Deprecated keyboard functions. +void TCODConsole::setKeyboardRepeat(int, int) {} +void TCODConsole::disableKeyboardRepeat() {} diff --git a/tcod_sys/libtcod/src/libtcod/console_drawing.c b/tcod_sys/libtcod/src/libtcod/console_drawing.c new file mode 100644 index 000000000..a2e88674a --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/console_drawing.c @@ -0,0 +1,111 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "console_drawing.h" + +#include "libtcod_int.h" +#include "console.h" +/** + * Clamp the given values to fit within a console. + */ +static void clamp_rect_(int cx, int cy, int cw, int ch, + int* x, int* y, int* w, int* h) +{ + if (*x + *w > cw) { *w = cw - *x; } + if (*y + *h > ch) { *h = ch - *y; } + if (*x < cx) { + *w -= cx - *x; + *x = cx; + } + if (*y < cy) { + *h -= cy - *y; + *y = cy; + } +} +void TCOD_console_put_rgb( + TCOD_Console* console, + int x, + int y, + int ch, + const TCOD_color_t* fg, + const TCOD_color_t* bg, + TCOD_bkgnd_flag_t flag) +{ + console = TCOD_console_validate_(console); + if (!console) { return; } + if (!TCOD_console_is_index_valid_(console, x, y)) { return; } + int console_index = y * console->w + x; + if (ch > 0) { console->tiles[console_index].ch = ch; } + if (fg) { TCOD_console_set_char_foreground(console, x, y, *fg); } + if (bg) { TCOD_console_set_char_background(console, x, y, *bg, flag); } +} +void TCOD_console_draw_rect_rgb( + TCOD_Console* console, + int x, + int y, + int width, + int height, + int ch, + const TCOD_color_t* fg, + const TCOD_color_t* bg, + TCOD_bkgnd_flag_t flag) +{ + console = TCOD_console_validate_(console); + if (!console) { return; } + clamp_rect_(0, 0, console->w, console->h, &x, &y, &width, &height); + TCOD_ASSERT(x + width <= console->w && y + height <= console->h); + for (int console_y = y; console_y < y + height; ++console_y) { + for (int console_x = x; console_x < x + width; ++console_x) { + TCOD_console_put_rgb(console, console_x, console_y, ch, fg, bg, flag); + } + } +} +void TCOD_console_rect(TCOD_Console* console, int x, int y, int rw, int rh, + bool clear, TCOD_bkgnd_flag_t flag) +{ + console = TCOD_console_validate_(console); + if (!console) { return; } + TCOD_console_draw_rect_rgb(console, x, y, rw, rh, clear ? 0x20 : 0, NULL, &console->back, flag); +} +void TCOD_console_hline(TCOD_Console* console,int x, int y, int l, + TCOD_bkgnd_flag_t flag) +{ + console = TCOD_console_validate_(console); + if (!console) { return; } + TCOD_console_draw_rect_rgb(console, x, y, l, 1, 0x2500, &console->fore, &console->back, flag); // ─ +} +void TCOD_console_vline(TCOD_Console* console,int x, int y, int l, + TCOD_bkgnd_flag_t flag) +{ + console = TCOD_console_validate_(console); + if (!console) { return; } + TCOD_console_draw_rect_rgb(console, x, y, 1, l, 0x2502, &console->fore, &console->back, flag); // │ +} diff --git a/tcod_sys/libtcod/src/libtcod/console_drawing.h b/tcod_sys/libtcod/src/libtcod/console_drawing.h new file mode 100644 index 000000000..cd86cd544 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/console_drawing.h @@ -0,0 +1,117 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef TCOD_CONSOLE_DRAWING_H_ +#define TCOD_CONSOLE_DRAWING_H_ +#include "config.h" +#include "console_types.h" +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +/** + * Draw a rectangle onto a console. + * + * \param con A console pointer. + * \param x The starting region, the left-most position being 0. + * \param y The starting region, the top-most position being 0. + * \param rw The width of the rectangle. + * \param rh The height of the rectangle. + * \param clear If true the drawing region will be filled with spaces. + * \param flag The blending flag to use. + */ +TCOD_PUBLIC void TCOD_console_rect( + TCOD_Console* con, int x, int y, int w, int h, bool clear, + TCOD_bkgnd_flag_t flag); +/** + * Draw a horizontal line using the default colors. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param l The width of the line. + * \param flag The blending flag. + * + * This function makes assumptions about the fonts character encoding. + * It will fail if the font encoding is not `cp437`. + */ +TCOD_PUBLIC void TCOD_console_hline( + TCOD_Console* con, int x, int y, int l, TCOD_bkgnd_flag_t flag); +/** + * Draw a vertical line using the default colors. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param l The height of the line. + * \param flag The blending flag. + * + * This function makes assumptions about the fonts character encoding. + * It will fail if the font encoding is not `cp437`. + */ +TCOD_PUBLIC void TCOD_console_vline( + TCOD_Console* con, int x, int y, int l, TCOD_bkgnd_flag_t flag); +// Next functions are provisional unless given an added version. +/** + * Place a single tile on a `console` at `x`,`y`. + * + * If `ch` is 0 then the character code will not be updated. + * + * If `fg`,`bg` is NULL then their respective colors will not be updated. + */ +void TCOD_console_put_rgb( + TCOD_Console* console, + int x, + int y, + int ch, + const TCOD_color_t* fg, + const TCOD_color_t* bg, + TCOD_bkgnd_flag_t flag); +/** + * Draw a rectangle on a `console` with a shape of `x`,`y`,`width`,`height`. + * + * If `ch` is 0 then the character code will not be updated. + * + * If `fg`,`bg` is NULL then their respective colors will not be updated. + */ +void TCOD_console_draw_rect_rgb( + TCOD_Console* console, + int x, + int y, + int width, + int height, + int ch, + const TCOD_color_t* fg, + const TCOD_color_t* bg, + TCOD_bkgnd_flag_t flag); +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus +#endif // TCOD_CONSOLE_DRAWING_H_ diff --git a/tcod_sys/libtcod/src/libtcod/console_etc.c b/tcod_sys/libtcod/src/libtcod/console_etc.c new file mode 100644 index 000000000..978ebe5b5 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/console_etc.c @@ -0,0 +1,1406 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "console_etc.h" + +#include +#include +#include +#include +#include + +#include +#include "noise.h" +#include "mersenne.h" +#include "libtcod_int.h" +#include "utility.h" +#include "version.h" +#include "console_drawing.h" +#include "console_rexpaint.h" +#include "context.h" +#include "error.h" +#include "globals.h" +#include "tileset.h" + +#if defined( TCOD_VISUAL_STUDIO ) +static const char *version_string = "libtcod " TCOD_STRVERSION; +#else +static const char *version_string __attribute__((unused)) = "libtcod " TCOD_STRVERSION; +#endif + +TCOD_internal_context_t TCOD_ctx={ + /* number of characters in the bitmap font */ + 16,16, + /* font type and layout */ + false,false,false, + 0, + /* character size in font */ + 0, 0, + "terminal.png","", + NULL,NULL,NULL,0,false,0,0,0,0,0,0, + NULL, // sdl_cbk + /* fading data */ + {0,0,0},255, + /*key state*/ + {0}, + /* window closed ? */ + false, + /* mouse focus ? */ + false, + /* application active ? */ + true, + NULL, + NULL, +}; +/** + * Wait for a key press event, then return it. + * + * \param flush If 1 then the event queue will be cleared before waiting for + * the next event. This should always be 0. + * \return A TCOD_key_t struct with the most recent key data. + * + * Do not solve input lag issues by arbitrarily dropping events! + */ +TCOD_key_t TCOD_console_wait_for_keypress(bool flush) { + return TCOD_sys_wait_for_keypress(flush); +} +/** + * Return immediately with a recently pressed key. + * + * \param flags A TCOD_event_t bit-field, for example: `TCOD_EVENT_KEY_PRESS` + * \return A TCOD_key_t struct with a recently pressed key. + * If no event exists then the `vk` attribute will be `TCODK_NONE` + */ +TCOD_key_t TCOD_console_check_for_keypress(int flags) { + return TCOD_sys_check_for_keypress(flags); +} +TCOD_Error TCOD_console_flush_ex( + TCOD_Console* console, + struct TCOD_ViewportOptions* viewport) +{ + console = TCOD_console_validate_(console); + if (!console) { + TCOD_set_errorv("Console must not be NULL or root console must exist."); + return TCOD_E_INVALID_ARGUMENT; + } + if (!TCOD_ctx.engine) { + return TCOD_set_errorv("Rendering context is not yet initialized."); + } + TCOD_Error err = TCOD_context_present(TCOD_ctx.engine, console, viewport); + if (TCOD_ctx.fade == 255) { + err = TCOD_context_present(TCOD_ctx.engine, console, viewport); + } else { + // Apply the global fading color before presenting. + TCOD_Console* root_copy = TCOD_console_new(TCOD_ctx.root->w, TCOD_ctx.root->h); + if (!root_copy) { return TCOD_E_ERROR; } + const TCOD_ColorRGBA fade_color = { + TCOD_ctx.fading_color.r, + TCOD_ctx.fading_color.g, + TCOD_ctx.fading_color.b, + 255 - TCOD_ctx.fade, + }; + for (int i = 0; i < root_copy->elements; ++i) { + root_copy->tiles[i] = TCOD_ctx.root->tiles[i]; + TCOD_color_alpha_blend(&root_copy->tiles[i].fg, &fade_color); + TCOD_color_alpha_blend(&root_copy->tiles[i].bg, &fade_color); + } + err = TCOD_context_present(TCOD_ctx.engine, root_copy, viewport); + TCOD_console_delete(root_copy); + } + sync_time_(); + return err; +} +TCOD_Error TCOD_console_flush(void) { + return TCOD_console_flush_ex(NULL, NULL); +} +/** + * Manually mark a region of a console as dirty. + */ +void TCOD_console_set_dirty(int dx, int dy, int dw, int dh) { + (void)dx; (void)dy; (void)dw; (void)dh; // Ignore. +} +/** + * \brief Set a font image to be loaded during initialization. + * + * \param fontFile The path to a font image. + * \param flags A TCOD_font_flags_t bit-field describing the font image + * contents. + * \param nb_char_horiz The number of columns in the font image. + * \param nb_char_vertic The number of rows in the font image. + * + * `fontFile` will be case-sensitive depending on the platform. + * + * Returns 0 on success, or -1 on an error, you can check the error with + * TCOD_sys_get_error() + * \rst + * .. versionchanged:: 1.12 + * Now returns -1 on error instead of crashing. + * \endrst + */ +int TCOD_console_set_custom_font( + const char *fontFile, + int flags, + int nb_char_horiz, + int nb_char_vertic) +{ + strcpy(TCOD_ctx.font_file, fontFile); + /* if layout not defined, assume ASCII_INCOL */ + if (!(flags & (TCOD_FONT_LAYOUT_ASCII_INCOL + | TCOD_FONT_LAYOUT_ASCII_INROW | TCOD_FONT_LAYOUT_TCOD))) { + flags |= TCOD_FONT_LAYOUT_ASCII_INCOL; + } + TCOD_ctx.font_in_row = ((flags & TCOD_FONT_LAYOUT_ASCII_INROW) != 0); + TCOD_ctx.font_greyscale = ((flags & TCOD_FONT_TYPE_GREYSCALE) != 0); + TCOD_ctx.font_tcod_layout = ((flags & TCOD_FONT_LAYOUT_TCOD) != 0); + TCOD_ctx.font_flags = flags; + if (nb_char_horiz > 0 && nb_char_vertic > 0) { + TCOD_ctx.fontNbCharHoriz = nb_char_horiz; + TCOD_ctx.fontNbCharVertic = nb_char_vertic; + } else { + if (flags & TCOD_FONT_LAYOUT_TCOD) { + TCOD_ctx.fontNbCharHoriz = nb_char_horiz = 32; + TCOD_ctx.fontNbCharVertic = nb_char_vertic = 8; + } else { + TCOD_ctx.fontNbCharHoriz = nb_char_horiz = 16; + TCOD_ctx.fontNbCharVertic = nb_char_vertic = 16; + } + } + if (TCOD_ctx.font_tcod_layout) { TCOD_ctx.font_in_row = true; } + + TCOD_Tileset* tileset = + TCOD_tileset_load(fontFile, nb_char_horiz, nb_char_vertic, 0, NULL); + if (!tileset) { return TCOD_E_ERROR; } + TCOD_set_default_tileset(tileset); + TCOD_sys_decode_font_(); + return TCOD_E_OK; +} +/** + * \brief Remap a character code to a tile. + * + * \param asciiCode Character code to modify. + * \param fontCharX X tile-coordinate, starting from the left at zero. + * \param fontCharY Y tile-coordinate, starting from the top at zero. + * + * X,Y parameters are the coordinate of the tile, not pixel-coordinates. + */ +void TCOD_console_map_ascii_code_to_font(int asciiCode, + int fontCharX, int fontCharY) +{ + TCOD_sys_map_ascii_to_font(asciiCode, fontCharX, fontCharY); +} +/** + * \brief Remap a series of character codes to a row of tiles. + * + * \param asciiCode The starting character code. + * \param nbCodes Number of character codes to assign. + * \param fontCharX First X tile-coordinate, starting from the left at zero. + * \param fontCharY First Y tile-coordinate, starting from the top at zero. + * + * This function always assigns tiles in row-major order, even if the + * TCOD_FONT_LAYOUT_ASCII_INCOL flag was set. + */ +void TCOD_console_map_ascii_codes_to_font(int asciiCode, int nbCodes, + int fontCharX, int fontCharY) +{ + for (int c = asciiCode; c < asciiCode + nbCodes; ++c) { + TCOD_sys_map_ascii_to_font(c, fontCharX, fontCharY); + ++fontCharX; + if (fontCharX == TCOD_ctx.fontNbCharHoriz) { + fontCharX = 0; + ++fontCharY; + } + } +} +/** + * \brief Remap a string of character codes to a row of tiles. + * + * \param s A null-terminated string. + * \param fontCharX First X tile-coordinate, starting from the left at zero. + * \param fontCharY First Y tile-coordinate, starting from the top at zero. + * + * This function always assigns tiles in row-major order, even if the + * TCOD_FONT_LAYOUT_ASCII_INCOL flag was set. + */ +void TCOD_console_map_string_to_font(const char *s, + int fontCharX, int fontCharY) +{ + TCOD_IFNOT(s) { return; } + /* cannot change mapping before initRoot is called */ + TCOD_IFNOT(TCOD_ctx.root) { return; } + while (*s) { + TCOD_console_map_ascii_code_to_font(*s, fontCharX, fontCharY); + ++fontCharX; + if (fontCharX == TCOD_ctx.fontNbCharHoriz) { + fontCharX = 0; + ++fontCharY; + } + ++s; + } +} +void TCOD_console_map_string_to_font_utf(const wchar_t *s, + int fontCharX, int fontCharY) +{ + TCOD_IFNOT(s != NULL) return; + while (*s) { + TCOD_sys_map_ascii_to_font(*s, fontCharX, fontCharY); + fontCharX++; + if (fontCharX == TCOD_ctx.fontNbCharHoriz) { + fontCharX = 0; + fontCharY++; + } + s++; + } +} +bool TCOD_console_is_key_pressed(TCOD_keycode_t key) { + return TCOD_sys_is_key_pressed(key); +} +void TCOD_console_set_key_color(TCOD_Console* con,TCOD_color_t col) { + con = TCOD_console_validate_(con); + if (!con) { return; } + con->has_key_color = 1; + con->key_color = col; +} + +void TCOD_console_credits(void) { + bool end=false; + int x=TCOD_console_get_width(NULL)/2-6; + int y=TCOD_console_get_height(NULL)/2; + int fade=260; + TCOD_sys_save_fps(); + TCOD_sys_set_fps(25); + while (!end ) { + TCOD_key_t k; + end=TCOD_console_credits_render(x,y,false); + TCOD_sys_check_for_event(TCOD_EVENT_KEY_PRESS,&k,NULL); + if ( fade == 260 && k.vk != TCODK_NONE ) { + fade -= 10; + } + if (TCOD_console_flush() < 0) { break; } + if ( fade < 260 ) { + fade -= 10; + TCOD_console_set_fade(fade,TCOD_black); + if ( fade == 0 ) end=true; + } + } + TCOD_console_set_fade(255,TCOD_black); + TCOD_sys_restore_fps(); +} + +static bool init2=false; + +void TCOD_console_credits_reset(void) { + init2=false; +} + +bool TCOD_console_credits_render(int x, int y, bool alpha) { + static char poweredby[128]; + static float char_heat[128]; + static int char_x[128]; + static int char_y[128]; + static bool init1=false; + static int len,len1,cw=-1,ch=-1; + static float xstr; + static TCOD_color_t colmap[64]; + static TCOD_color_t colmap_light[64]; + static TCOD_noise_t noise; + static TCOD_color_t colkeys[4] = { + {255,255,204}, + {255,204,0}, + {255,102,0}, + {102,153,255}, + }; + static TCOD_color_t colkeys_light[4] = { + {255,255,204}, + {128,128,77}, + {51,51,31}, + {0,0,0}, + }; + static int colpos[4]={ + 0,21,42,63 + }; + static TCOD_image_t img=NULL; + int i,xc,yc,xi,yi,j; + static int left,right,top,bottom; + float sparklex,sparkley,sparklerad,sparklerad2,noisex; + /* mini particule system */ +#define MAX_PARTICULES 50 + static float pheat[MAX_PARTICULES]; + static float px[MAX_PARTICULES],py[MAX_PARTICULES], pvx[MAX_PARTICULES],pvy[MAX_PARTICULES]; + static int nbpart=0, firstpart=0; + static float partDelay=0.1f; + float elapsed=TCOD_sys_get_last_frame_length(); + TCOD_color_t fbackup; /* backup fg color */ + + if (!init1) { + /* initialize all static data, colormaps, ... */ + TCOD_color_t col; + TCOD_color_gen_map(colmap,4,colkeys,colpos); + TCOD_color_gen_map(colmap_light,4,colkeys_light,colpos); + sprintf(poweredby,"Powered by\n%s",version_string); + noise=TCOD_noise_new(1,TCOD_NOISE_DEFAULT_HURST,TCOD_NOISE_DEFAULT_LACUNARITY,NULL); + len=(int)strlen(poweredby); + len1=11; /* sizeof "Powered by\n" */ + left=MAX(x-4,0); + top=MAX(y-4,0); + col= TCOD_console_get_default_background(NULL); + TCOD_console_set_default_background(NULL,TCOD_black); + TCOD_console_set_default_background(NULL,col); + init1=true; + } + if (!init2) { + /* reset the credits vars ... */ + int curx,cury; + xstr=-4.0f; + curx=x; + cury=y; + for (i=0; i < len ;i++) { + char_heat[i]=-1; + char_x[i]=curx; + char_y[i]=cury; + curx++; + if ( poweredby[i] == '\n' ) { + curx=x; + cury++; + } + } + nbpart=firstpart=0; + init2=true; + } + if (TCOD_console_get_width(NULL) != cw || TCOD_console_get_height(NULL)!=ch) { + /* console size has changed */ + int width,height; + cw=TCOD_console_get_width(NULL); + ch=TCOD_console_get_height(NULL); + right=MIN(x+len,cw-1); + bottom=MIN(y+6,ch-1); + width=right - left + 1; + height=bottom - top + 1; + if ( img ) TCOD_image_delete(img); + img = TCOD_image_new(width*2,height*2); + } + fbackup=TCOD_console_get_default_foreground(NULL); + if ( xstr < len1 ) { + sparklex=x+xstr; + sparkley = (float)y; + } else { + sparklex=x-len1+xstr; + sparkley = (float)(y + 1); + } + noisex=xstr*6; + sparklerad=3.0f+2*TCOD_noise_get(noise,&noisex); + if ( xstr >= len-1 ) sparklerad -= (xstr-len+1)*4.0f; + else if ( xstr < 0.0f ) sparklerad += xstr*4.0f; + else if ( poweredby[ (int)(xstr+0.5f) ] == ' ' || poweredby[ (int)(xstr+0.5f) ] == '\n' ) sparklerad/=2; + sparklerad2=sparklerad*sparklerad*4; + + /* draw the light */ + for (xc=left*2,xi=0; xc < (right+1)*2; xc++,xi++) { + for (yc=top*2,yi=0; yc < (bottom+1)*2; yc++,yi++) { + float dist=((xc-2*sparklex)*(xc-2*sparklex)+(yc-2*sparkley)*(yc-2*sparkley)); + TCOD_color_t pixcol; + if ( sparklerad >= 0.0f && dist < sparklerad2 ) { + int colidx=63-(int)(63*(sparklerad2-dist)/sparklerad2) + TCOD_random_get_int(NULL,-10,10); + colidx=CLAMP(0,63,colidx); + pixcol=colmap_light[colidx]; + } else { + pixcol=TCOD_black; + } + if ( alpha ) { + /* console cells have following flag values : + 1 2 + 4 8 + flag indicates which subcell uses foreground color */ + static int asciiToFlag[] = { + 1, /* TCOD_CHAR_SUBP_NW */ + 2, /* TCOD_CHAR_SUBP_NE */ + 3, /* TCOD_CHAR_SUBP_N */ + 8, /* TCOD_CHAR_SUBP_SE */ + 9, /* TCOD_CHAR_SUBP_DIAG */ + 10, /* TCOD_CHAR_SUBP_E */ + 4, /* TCOD_CHAR_SUBP_SW */ + }; + int conc= TCOD_console_get_char(NULL,xc/2,yc/2); + TCOD_color_t bk=TCOD_console_get_char_background(NULL,xc/2,yc/2); + if ( conc >= TCOD_CHAR_SUBP_NW && conc <= TCOD_CHAR_SUBP_SW ) { + /* merge two subcell chars... + get the flag for the existing cell on root console */ + int bkflag=asciiToFlag[conc - TCOD_CHAR_SUBP_NW ]; + int xflag = (xc & 1); + int yflag = (yc & 1); + /* get the flag for the current subcell */ + int credflag = (1+3*yflag) * (xflag+1); + if ( (credflag & bkflag) != 0 ) { + /* the color for this subcell on root console + is foreground, not background */ + bk = TCOD_console_get_char_foreground(NULL,xc/2,yc/2); + } + } + pixcol.r = MIN(255, bk.r + pixcol.r); + pixcol.g = MIN(255, bk.g + pixcol.g); + pixcol.b = MIN(255, bk.b + pixcol.b); + } + TCOD_image_put_pixel(img,xi,yi,pixcol); + } + } + + /* draw and update the particules */ + j=nbpart;i=firstpart; + while (j > 0) { + int colidx = (int)(64 * (1.0f - pheat[i])); + TCOD_color_t col; + colidx=MIN(63, colidx); + col=colmap[colidx]; + if (py[i] < (bottom - top + 1) * 2) { + int ipx = (int)px[i]; + int ipy = (int)py[i]; + float fpx = px[i]-ipx; + float fpy = py[i]-ipy; + TCOD_color_t col2=TCOD_image_get_pixel(img,ipx,ipy); + col2=TCOD_color_lerp(col,col2,0.5f*(fpx+fpy)); + TCOD_image_put_pixel(img,ipx,ipy,col2); + col2=TCOD_image_get_pixel(img,ipx+1,ipy); + col2=TCOD_color_lerp(col2,col,fpx); + TCOD_image_put_pixel(img,ipx+1,ipy,col2); + col2=TCOD_image_get_pixel(img,ipx,ipy+1); + col2=TCOD_color_lerp(col2,col,fpy); + TCOD_image_put_pixel(img,ipx,ipy+1,col2); + } else pvy[i]=-pvy[i] * 0.5f; + pvx[i] *= (1.0f-elapsed); + pvy[i] += (1.0f-pheat[i])*elapsed*300.0f; + px[i] += pvx[i]*elapsed; + py[i] += pvy[i]*elapsed; + pheat[i] -= elapsed*0.3f; + if ( pheat[i] < 0.0f ) { + firstpart = (firstpart+1)%MAX_PARTICULES; + nbpart--; + } + i = (i+1)%MAX_PARTICULES; + j--; + } + partDelay -= elapsed; + if ( partDelay < 0.0f && nbpart < MAX_PARTICULES && sparklerad > 2.0f ) { + /* fire a new particule */ + int lastpart = firstpart; + int nb=nbpart; + while (nb > 0 ) { + lastpart = ( lastpart + 1 )%MAX_PARTICULES; + nb--; + } + nbpart++; + px[lastpart] = 2*(sparklex-left); + py[lastpart] = 2*(sparkley-top)+2; + pvx[lastpart] = TCOD_random_get_float(NULL,-5.0f,5.0f); + pvy[lastpart] = TCOD_random_get_float(NULL,-0.5f, -15.0f); + pheat[lastpart] = 1.0f; + partDelay += 0.1f; + } + TCOD_image_blit_2x(img,NULL,left,top,0,0,-1,-1); + /* draw the text */ + for (i=0; i < len ;i++) { + if ( char_heat[i] >= 0.0f && poweredby[i]!='\n') { + int colidx = (int)(64 * char_heat[i]); + TCOD_color_t col; + colidx=MIN(63,colidx); + col=colmap[colidx]; + if ( xstr >= len ) { + float coef=(xstr-len)/len; + if ( alpha ) { + TCOD_color_t fore=TCOD_console_get_char_background(NULL,char_x[i],char_y[i]); + int r = (int)(coef * fore.r + (1.0f - coef) * col.r); + int g = (int)(coef * fore.g + (1.0f - coef) * col.g); + int b = (int)(coef * fore.b + (1.0f - coef) * col.b); + col.r = MAX(0, MIN(r, 255)); + col.g = MAX(0, MIN(g, 255)); + col.b = MAX(0, MIN(b, 255)); + TCOD_console_set_char_foreground(NULL,char_x[i],char_y[i],col); + } else { + col=TCOD_color_lerp(col,TCOD_black,coef); + } + } + TCOD_console_set_char(NULL,char_x[i],char_y[i],poweredby[i]); + TCOD_console_set_char_foreground(NULL,char_x[i],char_y[i],col); + } + } + /* update letters heat */ + xstr += elapsed * 4; + for (i = 0; i < (int)(xstr+0.5f); ++i) { + char_heat[i]=(xstr-i)/(len/2); + } + /* restore fg color */ + TCOD_console_set_default_foreground(NULL,fbackup); + if ( xstr <= 2*len ) return false; + init2=false; + return true; +} + +void TCOD_console_set_keyboard_repeat(int initial_delay, int interval) +{ + (void)initial_delay; (void)interval; +} +void TCOD_console_disable_keyboard_repeat(void) {} + +static void TCOD_console_read_asc(TCOD_console_t con, FILE *f, + int width, int height, float version) +{ + con = TCOD_console_validate_(con); + TCOD_IFNOT(con) { return; } + while(fgetc(f) != '#'); + for(int x = 0; x < width; ++x) { + for(int y = 0; y < height; ++y) { + TCOD_color_t fore, back; + int c = fgetc(f); + fore.r = fgetc(f); + fore.g = fgetc(f); + fore.b = fgetc(f); + back.r = fgetc(f); + back.g = fgetc(f); + back.b = fgetc(f); + /* skip solid/walkable info */ + if (version >= 0.3f) { + fgetc(f); + fgetc(f); + } + TCOD_console_put_char_ex(con, x, y, c, fore, back); + } + } + fclose(f); +} + +static int string_ends_with(const char *str, const char *suffix) { + size_t str_len = strlen(str); + size_t suffix_len = strlen(suffix); + return + (str_len >= suffix_len) && + (0 == strcmp(str + (str_len-suffix_len), suffix)); +} + +TCOD_console_t TCOD_console_from_file(const char *filename) { + float version; + int width,height; + TCOD_console_t con; + FILE *f; + TCOD_IFNOT( filename != NULL ) { + return NULL; + } + if (string_ends_with(filename, ".xp")) { + return TCOD_console_from_xp(filename); + } + f=fopen(filename,"rb"); + TCOD_IFNOT( f!=NULL ) { + return NULL; + } + if (fscanf(f, "ASCII-Paint v%g", &version) != 1 ) { + fclose(f); + return NULL; + } + if (fscanf(f, "%i %i", &width, &height) != 2 ) { + fclose(f); + return NULL; + } + TCOD_IFNOT ( width > 0 && height > 0) { + fclose(f); + return NULL; + } + con=TCOD_console_new(width,height); + if (string_ends_with(filename, ".asc")) { + TCOD_console_read_asc(con,f,width,height,version); + } + return con; +} + +bool TCOD_console_load_asc(TCOD_console_t pcon, const char *filename) { + float version; + int width,height; + FILE *f; + struct TCOD_Console *con = TCOD_console_validate_(pcon); + TCOD_IFNOT(con != NULL) return false; + TCOD_IFNOT( filename != NULL ) { + return false; + } + f=fopen(filename,"rb"); + TCOD_IFNOT( f!=NULL ) { + return false; + } + if (fscanf(f, "ASCII-Paint v%g", &version) != 1 ) { + fclose(f); + return false; + } + if (fscanf(f, "%i %i", &width, &height) != 2 ) { + fclose(f); + return false; + } + TCOD_IFNOT ( width > 0 && height > 0) { + fclose(f); + return false; + } + TCOD_console_resize_(con, width, height); + TCOD_console_read_asc(con,f,width,height,version); + return true; +} + +bool TCOD_console_save_asc(TCOD_console_t pcon, const char *filename) { + static float version = 0.3f; + FILE *f; + int x,y; + struct TCOD_Console *con = TCOD_console_validate_(pcon); + TCOD_IFNOT(con != NULL) return false; + TCOD_IFNOT( filename != NULL ) { + return false; + } + TCOD_IFNOT(con->w > 0 && con->h > 0) return false; + f=fopen(filename,"wb"); + TCOD_IFNOT( f != NULL ) return false; + fprintf(f, "ASCII-Paint v%g\n", (double)version); + fprintf(f, "%i %i\n", con->w, con->h); + fputc('#', f); + for(x = 0; x < con->w; x++) { + for(y = 0; y < con->h; y++) { + TCOD_color_t fore,back; + int c=TCOD_console_get_char(con,x,y); + fore=TCOD_console_get_char_foreground(con,x,y); + back=TCOD_console_get_char_background(con,x,y); + fputc(c, f); + fputc(fore.r,f); + fputc(fore.g,f); + fputc(fore.b,f); + fputc(back.r,f); + fputc(back.g,f); + fputc(back.b,f); + fputc(0,f); /* solid */ + fputc(1,f); /* walkable */ + } + } + fclose(f); + return true; +} + +static bool hasDetectedBigEndianness = false; +static bool isBigEndian; +void detectBigEndianness(void) { + if (!hasDetectedBigEndianness){ + uint32_t Value32; + uint8_t *VPtr = (uint8_t*)&Value32; + VPtr[0] = VPtr[1] = VPtr[2] = 0; VPtr[3] = 1; + if(Value32 == 1) isBigEndian = true; + else isBigEndian = false; + hasDetectedBigEndianness = true; + } +} +#ifndef bswap16 +static uint16_t bswap16(uint16_t s) +{ + uint8_t* ps = (uint8_t*)&s; + uint16_t res; + uint8_t* pres = (uint8_t*)&res; + pres[0] = ps[1]; + pres[1] = ps[0]; + return res; +} +#endif +#ifndef bswap32 +static uint32_t bswap32(uint32_t s) +{ + uint8_t *ps = (uint8_t*)&s; + uint32_t res; + uint8_t *pres = (uint8_t*)&res; + pres[0]=ps[3]; + pres[1]=ps[2]; + pres[2]=ps[1]; + pres[3]=ps[0]; + return res; +} +#endif +uint16_t l16(uint16_t s){ + if (isBigEndian) return bswap16(s); else return s; +} + +uint32_t l32(uint32_t s){ + if (isBigEndian) return bswap32(s); else return s; +} + +/* fix the endianness */ +void fix16(uint16_t* u){ + *u = l16(*u); +} + +void fix32(uint32_t* u){ + *u = l32(*u); +} + +/************ RIFF helpers */ + +uint32_t fourCC(const char* c){ + return (*(const uint32_t*)c); +} + +/* checks if u equals str */ +bool fourCCequals(uint32_t u, const char* str){ + return fourCC(str)==u; +} + +void fromFourCC(uint32_t u, char*s){ + const char* c = (const char*)&u; + s[0]=c[0]; + s[1]=c[1]; + s[2]=c[2]; + s[3]=c[3]; + s[4]=0; +} + +void put8(uint8_t d, FILE* fp){ + fwrite(&d,1,1,fp); +} + +void put16(uint16_t d, FILE* fp){ + fwrite(&d,2,1,fp); +} + +void put32(uint32_t d, FILE* fp){ + fwrite(&d,4,1,fp); +} + +void putFourCC(const char* c, FILE* fp){ + put32(fourCC(c),fp); +} + +void putData(void* what, int length, FILE* fp){ + fwrite(what,length,1,fp); +} + +bool get8(uint8_t* u, FILE* fp){ + return 1==fread(u, sizeof(uint8_t),1,fp); +} + +bool get16(uint16_t* u, FILE* fp){ + return 1==fread(u, sizeof(uint16_t),1,fp); +} + +bool get32(uint32_t* u, FILE* fp){ + return 1==fread(u, sizeof(uint32_t),1,fp); +} + +bool getData(void* u, size_t sz, FILE* fp){ + return 1==fread(u, sz,1,fp); +} + + +/********* APF RIFF structures */ + +typedef struct { + uint32_t show_grid; + uint32_t grid_width; + uint32_t grid_height; +} SettingsDataV1; + +#define FILTER_TYPE_UNCOMPRESSED 0 +#define FORMAT_TYPE_CRGBRGB 0 + +typedef struct { + uint32_t width; + uint32_t height; + uint32_t filter; + uint32_t format; +} ImageDetailsV1; + +/* Layers */ + +typedef struct { + uint32_t name; + uint32_t mode; + uint32_t index; + uint32_t dataSize; +} LayerV1 ; + +typedef struct { + uint32_t name; + uint32_t mode; + uint32_t fgalpha; + uint32_t bgalpha; + uint32_t visible; + uint32_t index; + uint32_t dataSize; +} LayerV2; + +/* fix the endianness */ +void fixSettings(SettingsDataV1* s){ + fix32(&s->show_grid); + fix32(&s->grid_width); + fix32(&s->grid_height); +} + +void fixImage(ImageDetailsV1* v){ + fix32(&v->width); + fix32(&v->height); + fix32(&v->filter); + fix32(&v->format); +} + +void fixLayerv1(LayerV1* l){ + fix32(&l->mode); + fix32(&l->index); + fix32(&l->dataSize); +} + +void fixLayerv2(LayerV2* l){ + fix32(&l->mode); + fix32(&l->fgalpha); + fix32(&l->bgalpha); + fix32(&l->visible); + fix32(&l->index); + fix32(&l->dataSize); +} + + +/*********** ApfFile */ + +bool TCOD_console_save_apf(TCOD_console_t pcon, const char *filename) { + struct TCOD_Console *con = TCOD_console_validate_(pcon); + FILE* fp ; + TCOD_IFNOT(con != NULL) return false; + detectBigEndianness(); + + fp = fopen(filename, "wb"); + if(fp == NULL) { + return false; + } + else { + int x,y; + uint32_t riffSize = 0; + uint32_t imgDetailsSize ; + SettingsDataV1 settingsData; + ImageDetailsV1 imgData; + fpos_t posRiffSize; + uint32_t settingsSz ; + uint32_t layerImageSize ; + uint32_t layerChunkSize ; + /* riff header*/ + putFourCC("RIFF",fp); + fgetpos(fp,&posRiffSize); + put32(0,fp); + + /* APF_ header */ + putFourCC("apf ",fp); + riffSize += 4; + + /* settings */ + settingsData.show_grid = 0; + settingsData.grid_width = 8; + settingsData.grid_height = 8; + settingsSz = sizeof(uint32_t) + sizeof settingsData; + putFourCC("sett",fp); + put32(l32(settingsSz),fp); + put32(l32(1),fp); + putData(&settingsData,sizeof settingsData,fp); + if (settingsSz&1){ + put8(0,fp); + riffSize++; + } + riffSize += 4+4+settingsSz; + + /* image details */ + imgData.width = con->w; + imgData.height = con->h; + imgData.filter = 0; + imgData.format = 0; + imgDetailsSize = sizeof(uint32_t) + sizeof imgData; + putFourCC("imgd",fp); + put32(l32(imgDetailsSize),fp); + put32(l32(1),fp); + putData(&imgData,sizeof imgData,fp); + if (imgDetailsSize&1){ + put8(0,fp); + riffSize++; + } + riffSize += 4+4+imgDetailsSize; + + /* now write the layers as a RIFF list + the first layer is the lowest layer + Assume imgData filter = uncompressed, and imgData format = CRGB */ + layerImageSize = imgData.width*imgData.height*7; + layerChunkSize = sizeof(uint32_t) /* version */ + + sizeof(LayerV2) /* header */ + + layerImageSize; /* data */ + + putFourCC("layr",fp); /* layer */ + put32(l32(layerChunkSize),fp); + /* VERSION -> */ + put32(l32(2),fp); + /* Data */ + putFourCC("LAY0",fp); + put32(l32(0),fp); + put32(l32(255),fp); + put32(l32(255),fp); + put32(l32(1),fp); + put32(l32(0),fp); + put32(l32(layerImageSize),fp); + + /* now write out the data */ + + for(x = 0; x < con->w; x++) { + for(y = 0; y < con->h; y++) { + TCOD_color_t fore,back; + int c=TCOD_console_get_char(con,x,y); + fore=TCOD_console_get_char_foreground(con,x,y); + back=TCOD_console_get_char_background(con,x,y); + put8(c, fp); + put8(fore.r,fp); + put8(fore.g,fp); + put8(fore.b,fp); + put8(back.r,fp); + put8(back.g,fp); + put8(back.b,fp); + } + } + + if (layerChunkSize&1){ + put8(0,fp); /* padding bit */ + riffSize++; + } + + riffSize += 2*sizeof(uint32_t)+layerChunkSize; + + fsetpos(fp,&posRiffSize); + put32(l32(riffSize),fp); + } + + fclose(fp); + return true; +} + +typedef struct { + LayerV1 headerv1; + LayerV2 headerv2; + uint8_t* data; /* dynamically allocated */ +} LayerData; + +typedef struct { + ImageDetailsV1 details; + SettingsDataV1 settings; + LayerData layer; +} Data; + +bool TCOD_console_load_apf(TCOD_console_t pcon, const char *filename) { + uint32_t sett = fourCC("sett"); + uint32_t imgd = fourCC("imgd"); + /* + uint32_t LIST = fourCC("LIST"); + uint32_t LAYR = fourCC("LAYR"); + */ + uint32_t layr = fourCC("layr"); + FILE* fp ; + Data data; + struct TCOD_Console *con = TCOD_console_validate_(pcon); + TCOD_IFNOT(con != NULL) return false; + + detectBigEndianness(); + data.details.width = 1; + data.details.height = 1; + data.details.filter = 0; + data.details.format = 0; + + data.settings.show_grid = true; + data.settings.grid_width = 10; + data.settings.grid_height = 10; + + #define ERR(x) {printf("Error: %s\n. Aborting operation.",x); return false;} + #define ERR_NEWER(x) {printf("Error: It looks like this file was made with a newer version of Ascii-Paint\n. In particular the %s field. Aborting operation.",x); return false;} + + fp = fopen(filename, "rb"); + if(fp == NULL) { + printf("The file %s could not be loaded.\n", filename); + return false; + } + else { + /* read the header */ + uint32_t riff; + uint32_t riffSize; + int index = 0; + int x,y; + uint8_t *imgData; + bool keepGoing = true; + if (! get32(&riff,fp) || ! fourCCequals(riff,"RIFF")){ + ERR("File doesn't have a RIFF header"); + } + if (!get32(&riffSize,fp)) ERR("No RIFF size field!"); + fix32(&riffSize); + + while(keepGoing && fp){ /* for each subfield, try to find the APF_ field */ + uint32_t apf; + if (! get32(&apf,fp)) break; + if (fourCCequals(apf,"apf ") || fourCCequals(apf,"APF ")){ + /* Process APF segment */ + while(keepGoing && fp){ + uint32_t seg; + if (! get32(&seg,fp)){ + keepGoing = false; + break; + } + else { + if (seg==sett){ + /* size */ + uint32_t sz; + uint32_t ver; + SettingsDataV1 settingsData; + + get32(&sz,fp); + fix32(&sz); + /* version */ + get32(&ver,fp); + fix32(&ver); + if (ver!=1) ERR_NEWER("settings"); + /* ver must be 1 */ + if (! getData(&settingsData,sizeof settingsData,fp)) ERR("Can't read settings."); + data.settings = settingsData; + fixSettings(&data.settings); + + } + else if (seg==imgd){ + /* sz */ + uint32_t sz; + uint32_t ver; + ImageDetailsV1 dets; + + get32(&sz,fp); + fix32(&sz); + /* version */ + get32(&ver,fp); + fix32(&ver); + if (ver!=1) ERR_NEWER("image details"); + /* ver must be 1 */ + if (! getData(&dets, sizeof dets, fp)) ERR("Can't read image details."); + data.details = dets; + fixImage(&data.details); + + /* get canvas ready */ + TCOD_IFNOT ( data.details.width > 0 && data.details.height > 0) { + fclose(fp); + return false; + } + TCOD_console_resize_( + con, data.details.width, data.details.height); + } + else if (seg==layr){ + uint32_t sz; + uint32_t ver; + + get32(&sz,fp); + fix32(&sz); + /* version */ + get32(&ver,fp); + fix32(&ver); + if (ver>2) ERR_NEWER("layer spec"); + + if (ver==1){ + if (! getData(&data.layer.headerv1, sizeof( LayerV1 ), fp)) ERR("Can't read layer header."); + fixLayerv1(&data.layer.headerv1); + + /* Read in the data chunk*/ + data.layer.data = (uint8_t*)(malloc(sizeof(uint8_t)*data.layer.headerv1.dataSize)); + getData(data.layer.data, data.layer.headerv1.dataSize, fp); + } + else if (ver==2){ + if (! getData(&data.layer.headerv2, sizeof( LayerV2 ), fp)) ERR("Can't read layer header."); + fixLayerv2(&data.layer.headerv2); + + /* Read in the data chunk */ + data.layer.data = (uint8_t*)(malloc(sizeof(uint8_t)*data.layer.headerv2.dataSize)); + getData(data.layer.data, data.layer.headerv2.dataSize, fp); + + } + } + else { + /* skip unknown segment */ + uint32_t sz; + get32(&sz,fp); + fix32(&sz); + fseek(fp,sz,SEEK_CUR); + } + } + } + + /* we're done! */ + keepGoing = false; + } + else { + /* skip this segment */ + uint32_t sz; + get32(&sz,fp); + fseek(fp,sz,SEEK_CUR); + } + } + + imgData = data.layer.data; + for(x = 0; x < con->w; x++) { + for(y = 0; y < con->h; y++) { + TCOD_color_t fore,back; + int c = imgData[index++]; + fore.r = imgData[index++]; + fore.g = imgData[index++]; + fore.b = imgData[index++]; + back.r = imgData[index++]; + back.g = imgData[index++]; + back.b = imgData[index++]; + TCOD_console_put_char_ex(con,x,y,c,fore,back); + } + } + + free (data.layer.data); + } + fclose(fp); + + return true; +} +/* + +bool ApfFile::Load(std::string filename){ + detectBigEndianness(); + + uint32_t sett = fourCC("sett"); + uint32_t imgd = fourCC("imgd"); + uint32_t LIST = fourCC("LIST"); + uint32_t LAYR = fourCC("LAYR"); + uint32_t layr = fourCC("layr"); + + Data data; // File data + + data.details.width = 1; + data.details.height = 1; + data.details.filter = FILTER_TYPE_UNCOMPRESSED; + data.details.format = FORMAT_TYPE_CRGBRGB; + + data.settings.show_grid = true; + data.settings.grid_width = 10; + data.settings.grid_height = 10; + + data.currentLayer = NULL; + + #define ERR(x) {printf("Error: %s\n. Aborting operation.",x); return false;} + #define ERR_NEWER(x) {printf("Error: It looks like this file was made with a newer version of Ascii-Paint\n. In particular the %s field. Aborting operation.",x); return false;} + + FILE* fp = fopen(filename.c_str(), "rb"); + if(fp == NULL) { + printf("The file %s could not be loaded.\n", filename.c_str()); + return false; + } + else { + // read the header + uint32_t riff; + if (not get32(&riff,fp) + or + not fourCCequals(riff,"RIFF")){ + ERR("File doesn't have a RIFF header"); + } + // else + uint32_t riffSize; + if (!get32(&riffSize,fp)) ERR("No RIFF size field!"); + fix(&riffSize); + + bool keepGoing = true; + while(keepGoing and fp){ // for each subfield, try to find the APF_ field + uint32_t apf; + if (not get32(&apf,fp)) break; + if (fourCCequals(apf,"apf ") or fourCCequals(apf,"APF ")){ + // Process APF segment + while(keepGoing and fp){ + uint32_t seg; + if (not get32(&seg,fp)){ + keepGoing = false; + break; + } + else { + if (seg==sett){ + // size + uint32_t sz; + get32(&sz,fp); + fix(&sz); + // version + uint32_t ver; + get32(&ver,fp); + fix(&ver); + if (ver!=1) ERR_NEWER("settings"); + // ver must be 1 + SettingsDataV1 settingsData; + if (not getData((void*)&settingsData,sizeof settingsData,fp)) ERR("Can't read settings."); + data.settings = settingsData; + fix(&data.settings); + + // Change app settings + app->setGridDimensions(data.settings.grid_width,data.settings.grid_height); + app->setShowGrid(data.settings.show_grid==1); + } + else if (seg==imgd){ + // sz + uint32_t sz; + get32(&sz,fp); + fix(&sz); + // version + uint32_t ver; + get32(&ver,fp); + fix(&ver); + if (ver!=1) ERR_NEWER("image details"); + // ver must be 1 + ImageDetailsV1 dets; + if (not getData((void*)&dets, sizeof dets, fp)) ERR("Can't read image details."); + data.details = dets; + fix(&data.details); + + // get canvas ready + app->canvasWidth = data.details.width; + app->canvasHeight = data.details.height; + app->initCanvas(); + + // delete new layer + app->deleteLayer(app->getCurrentLayer()->name); + + } + else if (seg==layr){ + // printf("Found a layer\n"); + + // sz + uint32_t sz; + get32(&sz,fp); + fix(&sz); + // version + uint32_t ver; + get32(&ver,fp); + fix(&ver); + if (ver>2) ERR_NEWER("layer spec"); + + if (ver==1){ + LayerV1 layerHeader; + if (not getData((void*)&layerHeader, sizeof layerHeader, fp)) ERR("Can't read layer header."); + fix(&layerHeader); + + // creat new layer data + LayerData* ld = new LayerData; + ld->header = layerHeader; // already fix'd + ld->data = new uint8[ld->header.dataSize]; + + // Read in the data chunk + getData((void*) ld->data, ld->header.dataSize, fp); + + // push layer onto the list + data.currentLayer = ld; + data.layers.push(ld); + } + else if (ver==2){ + LayerV2 layerHeader; + if (not getData((void*)&layerHeader, sizeof layerHeader, fp)) ERR("Can't read layer header."); + fix(&layerHeader); + + // creat new layer data + LayerData* ld = new LayerData; + ld->header = layerHeader; // already fix'd + ld->data = new uint8[ld->header.dataSize]; + + // Read in the data chunk + getData((void*) ld->data, ld->header.dataSize, fp); + + // push layer onto the list + data.currentLayer = ld; + data.layers.push(ld); + } + } + else { + // skip unknown segment + uint32_t sz; + get32(&sz,fp); + fix(&sz); + fseek(fp,sz,SEEK_CUR); + } + } + } + + // we're done! + keepGoing = false; + } + else { + // skip this segment + uint32_t sz; + get32(&sz,fp); + fseek(fp,sz,SEEK_CUR); + } + } + + // finally, copy the layers into the current document + for(int i=0;iaddNewLayer(); + + // Parse layer header + l->name = fromFourCC(ld->header.name); + l->fgalpha = ld->header.fgalpha; + l->bgalpha = ld->header.bgalpha; + l->visible = (ld->header.visible==1); + // l->compositingMode = + + // Copy data into currently selected canvas + uint8_t* imgData = ld->data; + CanvasImage *img = new CanvasImage; + // Write the brush data for every brush in the image + int index = 0; + for(int x = 0; x < app->canvasWidth; x++) { + for(int y = 0; y < app->canvasHeight; y++) { + Brush b; + b.symbol = (unsigned char)(imgData[index++]); + b.fore.r = (uint8_t)(imgData[index++]); + b.fore.g = (uint8_t)(imgData[index++]); + b.fore.b = (uint8_t)(imgData[index++]); + b.back.r = (uint8_t)(imgData[index++]); + b.back.g = (uint8_t)(imgData[index++]); + b.back.b = (uint8_t)(imgData[index++]); + b.solid = true; // deprecated + b.walkable = true; // deprecated + img->push_back(b); + } + } + + app->setCanvasImage(*img); + delete img; + } + + // then free all the temporary layer data + for(int i=0;idata; + delete data.layers.get(i); + } + + // and update the layer widget + app->gui->layerWidget->regenerateLayerList(); + } + fclose(fp); + + return true; +} +*/ diff --git a/tcod_sys/libtcod/src/libtcod/console_etc.h b/tcod_sys/libtcod/src/libtcod/console_etc.h new file mode 100644 index 000000000..2e25f69a2 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/console_etc.h @@ -0,0 +1,115 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef TCOD_CONSOLE_ETC_H_ +#define TCOD_CONSOLE_ETC_H_ + +#include +#ifndef NO_UNICODE +#include +#endif + +#include "config.h" + +#include "console.h" +#include "context.h" +#include "color.h" +#include "console_types.h" +#include "image.h" +#include "list.h" +#include "error.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define TCOD_BKGND_ALPHA(alpha) ((TCOD_bkgnd_flag_t)(TCOD_BKGND_ALPH|(((uint8_t)(alpha*255))<<8))) +#define TCOD_BKGND_ADDALPHA(alpha) ((TCOD_bkgnd_flag_t)(TCOD_BKGND_ADDA|(((uint8_t)(alpha*255))<<8))) + +TCODLIB_API TCOD_Error TCOD_console_set_custom_font( + const char *fontFile, + int flags, + int nb_char_horiz, + int nb_char_vertic); +TCODLIB_API void TCOD_console_map_ascii_code_to_font(int asciiCode, int fontCharX, int fontCharY); +TCODLIB_API void TCOD_console_map_ascii_codes_to_font(int asciiCode, int nbCodes, int fontCharX, int fontCharY); +TCODLIB_API void TCOD_console_map_string_to_font(const char *s, int fontCharX, int fontCharY); +#ifndef NO_UNICODE +TCODLIB_API void TCOD_console_map_string_to_font_utf(const wchar_t *s, int fontCharX, int fontCharY); +#endif + +TCOD_DEPRECATED("This function does nothing.") +TCODLIB_API void TCOD_console_set_dirty(int x, int y, int w, int h); +/** + Render and present a console with optional viewport options. + + `console` is the console to render. + + `viewport` is optional. + + Returns a negative values on error. See `TCOD_get_error`. + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC TCOD_Error TCOD_console_flush_ex( + TCOD_Console* console, + struct TCOD_ViewportOptions* viewport); +/** + * Render and present the root console to the active display. + */ +TCOD_PUBLIC TCOD_Error TCOD_console_flush(void); + +TCODLIB_API TCOD_key_t TCOD_console_check_for_keypress(int flags); +TCODLIB_API TCOD_key_t TCOD_console_wait_for_keypress(bool flush); +TCOD_DEPRECATED("Use SDL to check the keyboard state.") +TCODLIB_API bool TCOD_console_is_key_pressed(TCOD_keycode_t key); + +/* ASCII paint file support */ +TCODLIB_API TCOD_console_t TCOD_console_from_file(const char *filename); +TCODLIB_API bool TCOD_console_load_asc(TCOD_console_t con, const char *filename); +TCODLIB_API bool TCOD_console_load_apf(TCOD_console_t con, const char *filename); +TCODLIB_API bool TCOD_console_save_asc(TCOD_console_t con, const char *filename); +TCODLIB_API bool TCOD_console_save_apf(TCOD_console_t con, const char *filename); + +TCODLIB_API void TCOD_console_credits(void); +TCODLIB_API void TCOD_console_credits_reset(void); +TCODLIB_API bool TCOD_console_credits_render(int x, int y, bool alpha); + +TCOD_DEPRECATED("This function is a stub and will do nothing.") +TCODLIB_API void TCOD_console_set_keyboard_repeat(int initial_delay, + int interval); +TCOD_DEPRECATED("This function is a stub and will do nothing.") +TCODLIB_API void TCOD_console_disable_keyboard_repeat(void); +#ifdef __cplusplus +} +#endif +#endif // TCOD_CONSOLE_ETC_H_ diff --git a/tcod_sys/libtcod/src/libtcod/console_init.c b/tcod_sys/libtcod/src/libtcod/console_init.c new file mode 100644 index 000000000..0c36d6c9f --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/console_init.c @@ -0,0 +1,141 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "console_init.h" + +#include "stdbool.h" +#include "string.h" + +#include +#include "console.h" +#include "console_etc.h" +#include "context_init.h" +#include "libtcod_int.h" +TCOD_Error TCOD_console_init_root_( + int w, + int h, + const char* title, + bool fullscreen, + TCOD_renderer_t renderer, + bool vsync) +{ + if (w < 0 || h < 0) { + TCOD_set_errorvf("Width and height must be non-negative. Not %i,%i", + w, h); + return TCOD_E_INVALID_ARGUMENT; + } + TCOD_Error err = TCOD_sys_load_player_config(); + if (err < 0) { return err; } + TCOD_console_delete(NULL); + TCOD_ctx.root = TCOD_console_new(w, h); + if (!TCOD_ctx.root) { return TCOD_E_ERROR; } + strncpy(TCOD_ctx.window_title, title ? title : "", + sizeof(TCOD_ctx.window_title) - 1); + TCOD_ctx.fullscreen = fullscreen; + int window_flags = (SDL_WINDOW_RESIZABLE | + (fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0)); + return TCOD_context_new_terminal( + w, h, renderer, NULL, vsync, window_flags, title, &TCOD_ctx.engine); +} +TCOD_Error TCOD_console_init_root(int w, int h, const char* title, + bool fullscreen, TCOD_renderer_t renderer) +{ + return TCOD_console_init_root_(w, h, title, fullscreen, renderer, false); +} +void TCOD_quit(void) +{ + TCOD_console_delete(NULL); +} +void TCOD_console_set_window_title(const char *title) +{ + struct SDL_Window* window = TCOD_sys_get_sdl_window(); + SDL_SetWindowTitle(window, title); + strncpy(TCOD_ctx.window_title, title, sizeof(TCOD_ctx.window_title) - 1); +} +void TCOD_console_set_fullscreen(bool fullscreen) +{ + TCOD_ctx.fullscreen = fullscreen; + struct SDL_Window* window = TCOD_sys_get_sdl_window(); + if (window) { + SDL_SetWindowFullscreen( + window, fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); + } +} +bool TCOD_console_is_fullscreen(void) +{ + struct SDL_Window* window = TCOD_sys_get_sdl_window(); + if (!window) { return TCOD_ctx.fullscreen; } + return (SDL_GetWindowFlags(window) + & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP)) != 0; +} +bool TCOD_console_has_mouse_focus(void) +{ + struct SDL_Window* window = TCOD_sys_get_sdl_window(); + if (!window) { return TCOD_ctx.app_has_mouse_focus; } + return (SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_FOCUS) != 0; +} +bool TCOD_console_is_active(void) +{ + struct SDL_Window* window = TCOD_sys_get_sdl_window(); + if (!window) { return TCOD_ctx.app_is_active; } + return (SDL_GetWindowFlags(window) & SDL_WINDOW_INPUT_FOCUS) != 0; +} +bool TCOD_console_is_window_closed(void) { + return TCOD_ctx.is_window_closed; +} +struct SDL_Window* TCOD_sys_get_sdl_window(void) +{ + if (TCOD_ctx.engine && TCOD_ctx.engine->get_sdl_window_) { + return TCOD_ctx.engine->get_sdl_window_(TCOD_ctx.engine); + } + return NULL; +} +struct SDL_Renderer* TCOD_sys_get_sdl_renderer(void) +{ + if (TCOD_ctx.engine && TCOD_ctx.engine->get_sdl_renderer_) { + return TCOD_ctx.engine->get_sdl_renderer_(TCOD_ctx.engine); + } + return NULL; +} +int TCOD_sys_accumulate_console(const TCOD_Console* console) +{ + return TCOD_sys_accumulate_console_(console, NULL); +} +int TCOD_sys_accumulate_console_(const TCOD_Console* console, const struct SDL_Rect* viewport) +{ + (void)viewport; // Ignored parameter. + console = TCOD_console_validate_(console); + if (!console) { return -1; } + if (TCOD_ctx.engine && TCOD_ctx.engine->accumulate_) { + return TCOD_ctx.engine->accumulate_(TCOD_ctx.engine, console, NULL); + } + return -1; +} diff --git a/tcod_sys/libtcod/src/libtcod/console_init.h b/tcod_sys/libtcod/src/libtcod/console_init.h new file mode 100644 index 000000000..d1d07af0c --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/console_init.h @@ -0,0 +1,187 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_CONSOLE_INIT_H_ +#define LIBTCOD_CONSOLE_INIT_H_ + +#include "config.h" +#include "error.h" +#include "tileset.h" +#include "console_types.h" + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +struct SDL_Rect; +struct SDL_Window; +struct SDL_Renderer; +/** + * \brief Initialize the libtcod graphical engine. + * + * \param w The width in tiles. + * \param h The height in tiles. + * \param title The title for the window. + * \param fullscreen Fullscreen option. + * \param renderer Which renderer to use when rendering the console. + * + * You may want to call TCOD_console_set_custom_font BEFORE calling this + * function. By default this function loads libtcod's `terminal.png` image + * from the working directory. + * + * Afterwards TCOD_quit must be called before the program exits. + * + * Returns 0 on success, or -1 on an error, you can check the error with + * TCOD_sys_get_error() + * + * `renderer` and vsync settings can be overridden by the `TCOD_RENDERER` or + * `TCOD_VSYNC` environment variables. + * + * Valid case-sensitive options for `TCOD_RENDERER` are: + * - sdl + * - opengl + * - glsl + * - sdl2 + * - opengl2 + * + * Valid options for `TCOD_VSYNC` are `0` or `1`. + * + * \rst + * .. versionchanged:: 1.12 + * Now returns -1 on error instead of crashing. + * + * .. versionchanged:: 1.13 + * Added the `TCOD_RENDERER` and `TCOD_VSYNC` overrides. + * \endrst + */ + +TCOD_PUBLIC TCOD_NODISCARD TCOD_Error TCOD_console_init_root( + int w, int h, const char* title, bool fullscreen, TCOD_renderer_t renderer); +TCOD_PUBLIC TCOD_NODISCARD TCOD_Error TCOD_console_init_root_( + int w, + int h, + const char* title, + bool fullscreen, + TCOD_renderer_t renderer, + bool vsync); +/** + * Shutdown libtcod. This must be called before your program exits. + * \rst + * .. versionadded:: 1.8 + * \endrst + */ +TCOD_PUBLIC void TCOD_quit(void); +/** + * Change the title string of the active window. + * + * \param title A utf8 string. + */ +TCOD_PUBLIC void TCOD_console_set_window_title(const char *title); +/** + * Set the display to be full-screen or windowed. + * + * \param fullscreen If true the display will go full-screen. + */ +TCOD_PUBLIC void TCOD_console_set_fullscreen(bool fullscreen); +/** + * Return true if the display is full-screen. + */ +TCOD_PUBLIC bool TCOD_console_is_fullscreen(void); +/** + * Return true if the window has mouse focus. + */ +TCOD_PUBLIC bool TCOD_console_has_mouse_focus(void); +/** + * Return true if the window has keyboard focus. + * + * \verbatim embed:rst:leading-asterisk + * .. versionchanged: 1.7 + * This function was previously broken. It now keeps track of keyboard + * focus. + * \endverbatim + */ +TCOD_PUBLIC bool TCOD_console_is_active(void); +/** + * Return true if the window is closing. + */ +TCOD_PUBLIC bool TCOD_console_is_window_closed(void); +/** + * Return an SDL_Window pointer if one is in use, returns NULL otherwise. + * \rst + * .. versionadded:: 1.11 + * \endrst + */ +TCOD_PUBLIC struct SDL_Window* TCOD_sys_get_sdl_window(void); +/** + * Return an SDL_Renderer pointer if one is in use, returns NULL otherwise. + * \rst + * .. versionadded:: 1.11 + * \endrst + */ +TCOD_PUBLIC struct SDL_Renderer* TCOD_sys_get_sdl_renderer(void); +/** + * Render a console over the display. + * \rst + * `console` can be any size, the active render will try to scale it to fit + * the screen. + * + * The function will only work for the SDL2/OPENGL2 renderers. + * + * Unlike :any:`TCOD_console_flush` this will not present the display. + * You will need to do that manually, likely with the SDL API. + * + * Returns 0 on success, or a negative number on a failure such as the + * incorrect renderer being active. + * + * .. versionadded:: 1.11 + * + * .. seealso:: + * :any:`TCOD_sys_get_sdl_window` :any:`TCOD_sys_get_sdl_renderer` + * \endrst + */ +TCOD_PUBLIC int TCOD_sys_accumulate_console(const TCOD_Console* console); +TCOD_PUBLIC int TCOD_sys_accumulate_console_(const TCOD_Console* console, const struct SDL_Rect* viewport); +#ifdef __cplusplus +} // extern "C" +namespace tcod { +namespace console { +TCOD_PUBLIC void init_root(int w, int h, const std::string& title, + bool fullscreen, TCOD_renderer_t renderer); +TCOD_PUBLIC void init_root( + int w, + int h, + const std::string& title, + bool fullscreen, + TCOD_renderer_t renderer, + bool vsync); +} // namespace console +} // namespace tcod +#endif // __cplusplus +#endif // LIBTCOD_CONSOLE_INIT_H_ diff --git a/tcod_sys/libtcod/src/libtcod/console_init_.cpp b/tcod_sys/libtcod/src/libtcod/console_init_.cpp new file mode 100644 index 000000000..5e2a01348 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/console_init_.cpp @@ -0,0 +1,53 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "console_init.h" + +#include "error.h" +#include "console.hpp" +namespace tcod { +namespace console { +void init_root(int w, int h, const std::string& title, bool fullscreen, + TCOD_renderer_t renderer, bool vsync) +{ + check_throw_error( + TCOD_console_init_root_(w, h, title.c_str(), fullscreen, renderer, vsync) + ); +} +void init_root(int w, int h, const std::string& title, bool fullscreen, + TCOD_renderer_t renderer) +{ + check_throw_error( + TCOD_console_init_root(w, h, title.c_str(), fullscreen, renderer) + ); +} +} // namespace console +} // namespace tcod diff --git a/tcod_sys/libtcod/src/libtcod/console_printing.c b/tcod_sys/libtcod/src/libtcod/console_printing.c new file mode 100644 index 000000000..9f19c9f2b --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/console_printing.c @@ -0,0 +1,1445 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "console_printing.h" + +#include +#include +#include +#include +#include +#include +#ifndef NO_UNICODE +#include +#include +#endif + +#include "console_drawing.h" +#include "console.h" +#include "libtcod_int.h" +#include "utility.h" +#include "../vendor/utf8proc/utf8proc.h" +static TCOD_color_t color_control_fore[TCOD_COLCTRL_NUMBER] = { + {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, + {255, 255, 255}}; +static TCOD_color_t color_control_back[TCOD_COLCTRL_NUMBER]; +/** + * Assign a foreground and background color to a color control index. + * + * \param con Index to change, e.g. `TCOD_COLCTRL_1` + * \param fore Foreground color to assign to this index. + * \param back Background color to assign to this index. + */ +void TCOD_console_set_color_control( + TCOD_colctrl_t con, TCOD_color_t fore, TCOD_color_t back) +{ + TCOD_IFNOT(con >= TCOD_COLCTRL_1 && con <= TCOD_COLCTRL_NUMBER) return; + color_control_fore[con - 1] = fore; + color_control_back[con - 1] = back; +} +char *TCOD_console_vsprint(const char *fmt, va_list ap) +{ + #define NB_BUFFERS 10 + #define INITIAL_SIZE 512 + /* several static buffers in case the function is used more than once in a single function call */ + static char *msg[NB_BUFFERS] = {NULL}; + static int buflen[NB_BUFFERS] = {0}; + static int curbuf = 0; + char *ret; + bool ok = false; + if (!msg[0]) { + int i; + for (i = 0; i < NB_BUFFERS; i++) { + buflen[i] = INITIAL_SIZE; + msg[i] = calloc(sizeof(char), INITIAL_SIZE); + } + } + do { + /* warning ! depending on the compiler, vsnprintf return -1 or + the expected string length if the buffer is not big enough */ + va_list ap_clone; + va_copy(ap_clone, ap); + int len = vsnprintf(msg[curbuf], buflen[curbuf], fmt, ap_clone); + va_end(ap_clone); + ok=true; + if (len < 0 || len >= buflen[curbuf]) { + /* buffer too small. */ + if (len > 0) { + while (buflen[curbuf] < len + 1) { buflen[curbuf] *= 2; } + } else { + buflen[curbuf] *= 2; + } + free(msg[curbuf]); + msg[curbuf] = calloc(sizeof(char), buflen[curbuf]); + ok = false; + } + } while (!ok); + ret = msg[curbuf]; + curbuf = (curbuf + 1) % NB_BUFFERS; + return ret; +} +/** + * Print a titled, framed region on a console, using default colors and + * alignment. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param w The width of the frame. + * \param h The height of the frame. + * \param empty If true the characters inside of the frame will be cleared + * with spaces. + * \param flag The blending flag. + * \param fmt A format string as if passed to printf. + * \param ... Variadic arguments as if passed to printf. + * + * This function makes assumptions about the fonts character encoding. + * It will fail if the font encoding is not `cp437`. + */ +void TCOD_console_print_frame( + TCOD_Console* con,int x, int y, int w, int h, + bool empty, TCOD_bkgnd_flag_t flag, const char* fmt, ...) +{ + con = TCOD_console_validate_(con); + if (!con) { return; } + TCOD_console_put_char(con, x, y, TCOD_CHAR_NW, flag); + TCOD_console_put_char(con, x + w - 1, y, TCOD_CHAR_NE, flag); + TCOD_console_put_char(con, x, y + h - 1 , TCOD_CHAR_SW, flag); + TCOD_console_put_char(con, x + w - 1, y + h - 1, TCOD_CHAR_SE, flag); + TCOD_console_hline(con, x + 1, y, w - 2, flag); + TCOD_console_hline(con, x + 1, y + h - 1, w - 2, flag); + if (h > 2) { + TCOD_console_vline(con, x,y + 1, h - 2, flag); + TCOD_console_vline(con, x + w - 1, y + 1, h - 2, flag); + if (empty) { + TCOD_console_rect(con, x + 1, y + 1, w - 2, h - 2, true, flag); + } + } + if (fmt) { + va_list ap; + int xs; + char *title; + va_start(ap, fmt); + title = TCOD_console_vsprint(fmt, ap); + va_end(ap); + title[w - 3] = 0; /* truncate if needed */ + xs = x + (w - (int)(strlen(title)) - 2) / 2; + TCOD_color_t tmp; + tmp = con->fore; + con->fore = con->back; + con->back = tmp; + TCOD_console_print_ex(con, xs, y, TCOD_BKGND_SET, TCOD_LEFT, + " %s ", title); + tmp = con->fore; + con->fore = con->back; + con->back = tmp; + } +} +/** + * Print a string on a console, using default colors and alignment. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param fmt A format string as if passed to printf. + * \param ... Variadic arguments as if passed to printf. + */ +void TCOD_console_print(TCOD_Console* con, int x, int y, const char* fmt, ...) +{ + va_list ap; + con = TCOD_console_validate_(con); + if (!con) { return; } + va_start(ap, fmt); + TCOD_console_print_internal(con, x, y, 0, 0, con->bkgnd_flag, + con->alignment, TCOD_console_vsprint(fmt, ap), false, false); + va_end(ap); +} +/** + * Print a string on a console, using default colors. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param flag The blending flag. + * \param alignment The font alignment to use. + * \param fmt A format string as if passed to printf. + * \param ... Variadic arguments as if passed to printf. + */ +void TCOD_console_print_ex(TCOD_Console* con,int x, int y, + TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + TCOD_console_print_internal(con, x, y, 0, 0, flag, alignment, + TCOD_console_vsprint(fmt, ap), false, false); + va_end(ap); +} +/** + * Print a string on a console constrained to a rectangle, using default + * colors and alignment. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param w The width of the region. + * If 0 then the maximum width will be used. + * \param h The height of the region. + * If 0 then the maximum height will be used. + * \param fmt A format string as if passed to printf. + * \param ... Variadic arguments as if passed to printf. + * \return The number of lines actually printed. + */ +int TCOD_console_print_rect(TCOD_Console* con, int x, int y, int w, int h, + const char *fmt, ...) +{ + int ret; + va_list ap; + con = TCOD_console_validate_(con); + if (!con) { return 0; } + va_start(ap, fmt); + ret = TCOD_console_print_internal(con, x, y, w, h, con->bkgnd_flag, + con->alignment, TCOD_console_vsprint(fmt, ap), true, false); + va_end(ap); + return ret; +} +/** + * Print a string on a console constrained to a rectangle, using default + * colors. + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param w The width of the region. + * If 0 then the maximum width will be used. + * \param h The height of the region. + * If 0 then the maximum height will be used. + * \param flag The blending flag. + * \param alignment The font alignment to use. + * \param fmt A format string as if passed to printf. + * \param ... Variadic arguments as if passed to printf. + * \return The number of lines actually printed. + */ +int TCOD_console_print_rect_ex(TCOD_Console* con, int x, int y, int w, int h, + TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...) +{ + int ret; + va_list ap; + va_start(ap, fmt); + ret = TCOD_console_print_internal(con, x, y, w, h, flag, alignment, + TCOD_console_vsprint(fmt, ap), true, false); + va_end(ap); + return ret; +} +/** + * Return the number of lines that would be printed by the + * + * \param con A console pointer. + * \param x The starting X coordinate, the left-most position being 0. + * \param y The starting Y coordinate, the top-most position being 0. + * \param w The width of the region. + * If 0 then the maximum width will be used. + * \param h The height of the region. + * If 0 then the maximum height will be used. + * \param fmt A format string as if passed to printf. + * \param ... Variadic arguments as if passed to printf. + * \return The number of lines that would have been printed. + */ +int TCOD_console_get_height_rect(TCOD_Console* con, + int x, int y, int w, int h, const char *fmt, ...) +{ + int ret; + va_list ap; + va_start(ap, fmt); + ret = TCOD_console_print_internal(con, x, y, w, h, TCOD_BKGND_NONE, + TCOD_LEFT, TCOD_console_vsprint(fmt, ap), true, true); + va_end(ap); + return ret; +} +/* non public methods */ +int TCOD_console_stringLength(const unsigned char *s) +{ + int l = 0; + while (*s) { + if (*s == TCOD_COLCTRL_FORE_RGB || *s == TCOD_COLCTRL_BACK_RGB) { + s += 3; + } else if (*s > TCOD_COLCTRL_STOP) { + l++; + } + s++; + } + return l; +} +unsigned char * TCOD_console_forward(unsigned char *s,int l) +{ + while (*s && l > 0) { + if (*s == TCOD_COLCTRL_FORE_RGB || *s == TCOD_COLCTRL_BACK_RGB) { + s += 3; + } else if (*s > TCOD_COLCTRL_STOP) { + l--; + } + s++; + } + return s; +} +unsigned char *TCOD_console_strchr(unsigned char *s, unsigned char c) +{ + while (*s && *s != c) { + if (*s == TCOD_COLCTRL_FORE_RGB || *s == TCOD_COLCTRL_BACK_RGB) { + s += 3; + } + s++; + } + return (*s ? s : NULL); +} + +int TCOD_console_print_internal( + TCOD_Console* con, int x,int y, int rw, int rh, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t align, char *msg, bool can_split, bool count_only) +{ + unsigned char *c = (unsigned char*)msg; + int cx = 0; + int cy = y; + int minx, maxx, miny, maxy; + TCOD_color_t oldFore; + TCOD_color_t oldBack; + con = TCOD_console_validate_(con); + if (!con) { return 0; } + TCOD_IFNOT(TCOD_console_is_index_valid_(con, x, y)) { return 0; } + TCOD_IFNOT(msg != NULL) { return 0; } + if (rh == 0) { rh = con->h - y; } + if (rw == 0) { + switch(align) { + case TCOD_LEFT: rw = con->w - x; break; + case TCOD_RIGHT: rw = x + 1; break; + case TCOD_CENTER: default: rw = con->w; break; + } + } + oldFore = con->fore; + oldBack = con->back; + miny = y; + maxy = con->h - 1; + if (rh > 0) { maxy = MIN(maxy, y + rh - 1); } + switch (align) { + case TCOD_LEFT: + minx = MAX(0,x); + maxx = MIN(con->w - 1, x + rw - 1); + break; + case TCOD_RIGHT: + minx = MAX(0, x - rw + 1); + maxx = MIN(con->w - 1, x); + break; + case TCOD_CENTER: default: + minx = MAX(0, x - rw / 2); + maxx = MIN(con->w - 1, x + rw / 2); + break; + } + + do { + /* get \n delimited sub-message */ + unsigned char *end = TCOD_console_strchr(c, '\n'); + char bak = 0; + int cl; + unsigned char *split = NULL; + if (end) { *end=0; } + cl = TCOD_console_stringLength(c); + /* find starting x */ + switch (align) { + case TCOD_LEFT : cx = x; break; + case TCOD_RIGHT : cx = x - cl + 1; break; + case TCOD_CENTER : cx = x - cl / 2; break; + } + /* check if the string is completely out of the minx,miny,maxx,maxy frame */ + if (cy >= miny && cy <= maxy && cx <= maxx && cx + cl -1 >= minx) { + if (can_split && cy <= maxy) { + /* if partially out of screen, try to split the sub-message */ + if (cx < minx) { + split = TCOD_console_forward(c, (align == TCOD_CENTER + ? cl - 2 * (minx - cx) + : cl - (minx - cx))); + } else if (align == TCOD_CENTER) { + if (cx + cl / 2 > maxx + 1) { + split = TCOD_console_forward(c, maxx + 1 - cx); + } + } else { + if (cx + cl > maxx + 1) { + split = TCOD_console_forward(c, maxx + 1 - cx); + } + } + } + if (split) { + unsigned char *oldsplit = split; + while (!isspace(*split) && split > c) { split--; } + if (end) { *end = '\n'; } + if (!isspace(*split)) { + split = oldsplit; + } + end = split; + bak = *split; + *split = 0; + cl = TCOD_console_stringLength(c); + switch (align) { + case TCOD_LEFT : cx = x; break; + case TCOD_RIGHT : cx = x - cl + 1; break; + case TCOD_CENTER : cx = x - cl / 2; break; + } + } + if (cx < minx) { + /* truncate left part */ + c += minx-cx; + cl -= minx-cx; + cx = minx; + } + if (cx + cl > maxx + 1) { + /* truncate right part */ + split = TCOD_console_forward(c, maxx + 1 - cx); + *split = 0; + } + /* render the sub-message */ + if (cy >= 0 && cy < con->h) { + while (*c) { + if (*c >= TCOD_COLCTRL_1 && *c <= TCOD_COLCTRL_NUMBER) { + con->fore = color_control_fore[*c - 1]; + con->back = color_control_back[*c - 1]; + } else if (*c == TCOD_COLCTRL_FORE_RGB) { + c++; + con->fore.r = *c++; + con->fore.g = *c++; + con->fore.b = *c; + } else if (*c == TCOD_COLCTRL_BACK_RGB) { + c++; + con->back.r = *c++; + con->back.g = *c++; + con->back.b = *c; + } else if (*c == TCOD_COLCTRL_STOP) { + con->fore = oldFore; + con->back = oldBack; + } else { + if (!count_only) { + TCOD_console_put_char(con, cx, cy, *c, flag); + } + cx++; + } + c++; + } + } + } + if (end) { + /* next line */ + if (split && ! isspace(bak)) { + *end = bak; + c = end; + } else { + c = end + 1; + } + cy++; + } else { + c = NULL; + } + } while (c && cy < con->h && (rh == 0 || cy < y + rh)); + return cy - y + 1; +} +#ifndef NO_UNICODE +wchar_t *TCOD_console_strchr_utf(wchar_t *s, char c) +{ + while (*s && *s != c) { + if (*s == TCOD_COLCTRL_FORE_RGB || *s == TCOD_COLCTRL_BACK_RGB) { + s += 3; + } + s++; + } + return (*s ? s : NULL); +} +wchar_t *TCOD_console_vsprint_utf(const wchar_t *fmt, va_list ap) +{ + #define NB_BUFFERS 10 + #define INITIAL_SIZE 512 + /* several static buffers in case the function is used more than once in a single function call */ + static wchar_t *msg[NB_BUFFERS] = {NULL}; + static int buflen[NB_BUFFERS] = {0}; + static int curbuf = 0; + wchar_t *ret; + bool ok = false; + if (!msg[0]) { + int i; + for (i = 0; i < NB_BUFFERS; i++) { + buflen[i] = INITIAL_SIZE; + msg[i] = calloc(sizeof(wchar_t), INITIAL_SIZE); + } + } + do { + /* warning ! depending on the compiler, vsnprintf return -1 or + the expected string length if the buffer is not big enough */ + int len = vswprintf(msg[curbuf], buflen[curbuf], fmt, ap); + ok = true; + if (len < 0 || len >= buflen[curbuf]) { + /* buffer too small. */ + if (len > 0) { + while (buflen[curbuf] < len + 1) { buflen[curbuf] *= 2; } + } else { + buflen[curbuf] *= 2; + } + free(msg[curbuf]); + msg[curbuf] = calloc(sizeof(wchar_t), buflen[curbuf]); + ok = false; + } + } while (!ok); + ret = msg[curbuf]; + curbuf = (curbuf + 1) % NB_BUFFERS; + return ret; +} +int TCOD_console_stringLength_utf(const wchar_t *s) +{ + int l = 0; + while (*s) { + if (*s == TCOD_COLCTRL_FORE_RGB || *s == TCOD_COLCTRL_BACK_RGB) { + s += 3; + } else if (*s > TCOD_COLCTRL_STOP) { + l++; + } + s++; + } + return l; +} +wchar_t * TCOD_console_forward_utf(wchar_t *s,int l) +{ + while (*s && l > 0) { + if (*s == TCOD_COLCTRL_FORE_RGB || *s == TCOD_COLCTRL_BACK_RGB) { + s+=3; + } else if (*s > TCOD_COLCTRL_STOP) { + l--; + } + s++; + } + return s; +} +int TCOD_console_print_internal_utf( + TCOD_Console* con,int x,int y, int rw, int rh, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t align, wchar_t *msg, bool can_split, bool count_only) +{ + wchar_t *c = msg; + int cx = 0; + int cy = y; + int minx, maxx, miny, maxy; + TCOD_color_t oldFore; + TCOD_color_t oldBack; + con = TCOD_console_validate_(con); + if (!con) { return 0; } + if (!TCOD_console_is_index_valid_(con, x, y)) { return 0; } + TCOD_IFNOT(msg != NULL) { return 0; } + if (rh == 0) { rh = con->h - y; } + if (rw == 0) { + switch(align) { + case TCOD_LEFT: rw = con->w - x; break; + case TCOD_RIGHT: rw = x + 1; break; + case TCOD_CENTER: default: rw = con->w; break; + } + } + oldFore = con->fore; + oldBack = con->back; + miny = y; + maxy = con->h - 1; + if (rh > 0) maxy = MIN(maxy, y + rh - 1); + switch (align) { + case TCOD_LEFT: + minx = MAX(0,x); + maxx = MIN(con->w-1,x+rw-1); + break; + case TCOD_RIGHT: + minx = MAX(0, x - rw + 1); + maxx = MIN(con->w - 1, x); + break; + case TCOD_CENTER: default: + minx = MAX(0, x - rw / 2); + maxx = MIN(con->w - 1, x + rw / 2); + break; + } + + do { + /* get \n delimited sub-message */ + wchar_t *end = TCOD_console_strchr_utf(c, '\n'); + wchar_t bak = 0; + int cl; + wchar_t *split = NULL; + if (end) { *end = 0; } + cl = TCOD_console_stringLength_utf(c); + /* find starting x */ + switch (align) { + case TCOD_LEFT: cx = x; break; + case TCOD_RIGHT: cx = x - cl + 1; break; + case TCOD_CENTER: cx = x - cl / 2; break; + } + /* check if the string is completely out of the minx,miny,maxx,maxy frame */ + if (cy >= miny && cy <= maxy && cx <= maxx && cx + cl - 1 >= minx) { + if (can_split && cy < maxy) { + /* if partially out of screen, try to split the sub-message */ + if (cx < minx) { + split = TCOD_console_forward_utf(c, (align == TCOD_CENTER + ? cl - 2 * (minx - cx) + : cl - (minx - cx))); + } else if (align == TCOD_CENTER) { + if (cx + cl / 2 > maxx + 1) { + split = TCOD_console_forward_utf(c, maxx + 1 - cx); + } + } else { + if (cx + cl > maxx + 1) { + split = TCOD_console_forward_utf(c, maxx + 1 - cx); + } + } + } + if (split) { + wchar_t *oldsplit = split; + while (!iswspace(*split) && split > c) { split--; } + if (end) { *end='\n'; } + if (!iswspace(*split)) { + split = oldsplit; + } + end = split; + bak = *split; + *split = 0; + cl = TCOD_console_stringLength_utf(c); + switch (align) { + case TCOD_LEFT: cx = x; break; + case TCOD_RIGHT: cx = x - cl + 1; break; + case TCOD_CENTER: cx = x - cl / 2; break; + } + } + if (cx < minx) { + /* truncate left part */ + c += minx - cx; + cl -= minx - cx; + cx = minx; + } + if (cx + cl > maxx + 1) { + /* truncate right part */ + split = TCOD_console_forward_utf(c, maxx + 1 - cx); + *split = 0; + } + /* render the sub-message */ + if (cy >= 0 && cy < con->h) + while (*c) { + if (*c >= TCOD_COLCTRL_1 && *c <= TCOD_COLCTRL_NUMBER) { + con->fore = color_control_fore[(int)(*c) - 1]; + con->back = color_control_back[(int)(*c) - 1]; + } else if (*c == TCOD_COLCTRL_FORE_RGB) { + c++; + con->fore.r = (uint8_t)(*c++); + con->fore.g = (uint8_t)(*c++); + con->fore.b = (uint8_t)(*c); + } else if (*c == TCOD_COLCTRL_BACK_RGB) { + c++; + con->back.r = (uint8_t)(*c++); + con->back.g = (uint8_t)(*c++); + con->back.b = (uint8_t)(*c); + } else if (*c == TCOD_COLCTRL_STOP) { + con->fore = oldFore; + con->back = oldBack; + } else { + if (!count_only) { + TCOD_console_put_char(con, cx, cy, (int)*c, flag); + } + cx++; + } + c++; + } + } + if (end) { + /* next line */ + if (split && !iswspace(bak)) { + *end = bak; + c = end; + } else { + c = end + 1; + } + cy++; + } else { + c = NULL; + } + } while (c && cy < con->h && (rh == 0 || cy < y + rh)); + return cy - y + 1; +} +/** + * \rst + * .. deprecated:: 1.8 + * Use :any:`TCOD_console_printf` instead. + * \endrst + */ +void TCOD_console_print_utf(TCOD_Console* con, int x, int y, + const wchar_t *fmt, ...) +{ + va_list ap; + con = TCOD_console_validate_(con); + if (!con) { return; } + va_start(ap, fmt); + TCOD_console_print_internal_utf(con, x, y, 0, 0, con->bkgnd_flag, + con->alignment, TCOD_console_vsprint_utf(fmt, ap), false, false); + va_end(ap); +} +/** + * \rst + * .. deprecated:: 1.8 + * Use :any:`TCOD_console_printf_ex` instead. + * \endrst + */ +void TCOD_console_print_ex_utf( + TCOD_Console* con, int x, int y, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment, const wchar_t *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + TCOD_console_print_internal_utf( + con, x, y, 0, 0, flag, alignment, TCOD_console_vsprint_utf(fmt, ap), + false, false); + va_end(ap); +} + +int TCOD_console_print_rect_utf(TCOD_Console* con, int x, int y, int w, int h, + const wchar_t *fmt, ...) +{ + con = TCOD_console_validate_(con); + if (!con) { return 0; } + va_list ap; + va_start(ap, fmt); + int ret = TCOD_console_print_internal_utf( + con, x, y, w, h, con->bkgnd_flag, con->alignment, + TCOD_console_vsprint_utf(fmt, ap), true, false); + va_end(ap); + return ret; +} +/** + * \rst + * .. deprecated:: 1.8 + * Use :any:`TCOD_console_printf_rect_ex` instead. + * \endrst + */ +int TCOD_console_print_rect_ex_utf( + TCOD_Console* con,int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment, const wchar_t *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + int ret = TCOD_console_print_internal_utf( + con, x, y, w, h, flag, alignment, + TCOD_console_vsprint_utf(fmt, ap), true, false); + va_end(ap); + return ret; +} +/** + * \rst + * .. deprecated:: 1.8 + * \endrst + */ +int TCOD_console_get_height_rect_utf( + TCOD_Console* con,int x, int y, int w, int h, const wchar_t *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + int ret = TCOD_console_print_internal_utf( + con, x, y, w, h, TCOD_BKGND_NONE, TCOD_LEFT, + TCOD_console_vsprint_utf(fmt, ap), true, true); + va_end(ap); + return ret; +} + +#endif /* NO_UNICODE */ +// ---------------------------------------------------------------------------- +// New UTF-8 parser. +/** + * Allocates the formatted string to `out` and returns the size. + * + * Returns a negative number on error. + */ +static int vsprint_(char** out, const char *fmt, va_list ap) +{ + if (!fmt) { return -1; } + va_list ap_clone; + va_copy(ap_clone, ap); + int size = vsnprintf(NULL, 0, fmt, ap_clone); + va_end(ap_clone); + if (size < 0) { return size; } + *out = malloc(size + 1); + if (!*out) { return -1; } + vsprintf(*out, fmt, ap); + return size; +} +struct FormattedPrinter { + const unsigned char* string; + const unsigned char* end; + struct TCOD_ColorRGBA fg; + struct TCOD_ColorRGBA bg; + const struct TCOD_ColorRGBA default_fg; + const struct TCOD_ColorRGBA default_bg; +}; +static TCOD_Error utf8_report_error(int err) { + switch (err) { + case UTF8PROC_ERROR_NOMEM: + TCOD_set_errorv("Out of memory while parsing a UTF-8 string."); + return TCOD_E_OUT_OF_MEMORY; + case UTF8PROC_ERROR_INVALIDUTF8: + TCOD_set_errorv("UTF-8 string is malformed."); + return TCOD_E_ERROR; + default: + if (err < 0) { + TCOD_set_errorvf("Unexpected error while processing UTF-8 string: %d", err); + return TCOD_E_ERROR; + } + return TCOD_E_OK; + } +} +/** + Return the next codepoint without advancing the string pointer. + */ +static int fp_peak_raw(const struct FormattedPrinter* printer) +{ + int codepoint; + int err = utf8proc_iterate(printer->string, printer->end - printer->string, &codepoint); + if (err < 0) { return utf8_report_error(err); } + return codepoint; +} +/** + Return the next codepoint and advance the string pointer. + */ +static int fp_next_raw(struct FormattedPrinter* printer) +{ + int codepoint; + int len = utf8proc_iterate(printer->string, printer->end - printer->string, &codepoint); + if (len < 0) { return utf8_report_error(len); } + printer->string += len; + return codepoint; +} +/** + Return the next 3 codepoints as a TCOD_ColorRGBA struct and advance. + */ +static struct TCOD_ColorRGBA fp_next_rgba(struct FormattedPrinter* printer) +{ + struct TCOD_ColorRGBA rgb = { + fp_next_raw(printer), + fp_next_raw(printer), + fp_next_raw(printer), + 255, + }; + return rgb; +} +/** + Apply and special formatting codes to this printer and advance. + + Special codes are the libtcod color formatting codes, these change the state + if the FormattedPrinter struct. + */ +static void fp_handle_special_codes(struct FormattedPrinter* printer) +{ + while(printer->string < printer->end) { + int codepoint = fp_peak_raw(printer); + switch (codepoint) { + case TCOD_COLCTRL_STOP: + fp_next_raw(printer); + printer->fg = printer->default_fg; + printer->bg = printer->default_bg; + break; + case TCOD_COLCTRL_FORE_RGB: + fp_next_raw(printer); + printer->fg = fp_next_rgba(printer); + break; + case TCOD_COLCTRL_BACK_RGB: + fp_next_raw(printer); + printer->bg = fp_next_rgba(printer); + break; + default: + if (codepoint < 0) { return; } + if (TCOD_COLCTRL_1 <= codepoint && codepoint <= TCOD_COLCTRL_NUMBER) { + fp_next_raw(printer); + int color_index = codepoint - TCOD_COLCTRL_1; + *(TCOD_ColorRGB*)&printer->fg = color_control_fore[color_index]; + printer->fg.a = 255; + *(TCOD_ColorRGB*)&printer->bg = color_control_back[color_index]; + printer->bg.a = 255; + } else { + return; + } + break; + } + } +} +/** + Return the next non-special codepoint and apply any states up to that point. + */ +static int fp_next(struct FormattedPrinter* printer) +{ + fp_handle_special_codes(printer); + return fp_next_raw(printer); +} +/** + Return the next non-special codepoint without advancing the string pointer. + */ +static int fp_peak(const struct FormattedPrinter* printer) +{ + struct FormattedPrinter temp = *printer; + return fp_next(&temp); +} +/* + * Check if the specified character is any line-break character + */ +static bool is_newline(int codepoint) +{ + const utf8proc_property_t* property = utf8proc_get_property(codepoint); + switch (property->category) { + case UTF8PROC_CATEGORY_ZL: /* Separator, line */ + case UTF8PROC_CATEGORY_ZP: /* Separator, paragraph */ + return true; + case UTF8PROC_CATEGORY_CC: /* Other, control */ + switch(property->boundclass) { + case UTF8PROC_BOUNDCLASS_CR: // carriage return - \r + case UTF8PROC_BOUNDCLASS_LF: // line feed - \n + return true; + default: break; + } + break; + default: break; + } + return false; +} +/** + A variable that toggles double wide character handing in print functions. + + In theory this option could be made public. + */ +static const bool TCOD_double_width_print_mode = 0; +/** + Return the tile-width for this character. + + The result for normally double-width characters will depend on + `TCOD_double_width_print_mode`. + */ +static int get_character_width(int codepoint) +{ + const utf8proc_property_t* property = utf8proc_get_property(codepoint); + switch(property->charwidth) { + default: + return (int)property->charwidth; + case 2: + return TCOD_double_width_print_mode ? 2 : 1; + } +} +/** + * Get the next line-break or null terminator, or break the string before + * `max_width`. + * + * `break_point` is the pointer to the line end position. + * + * `break_width` is the width of the line. + * + * Returns true if this function is breaking a line, or false where the line + * doesn't break or breaks on its own (line a new-line.) + */ +static bool next_split_( + const struct FormattedPrinter* printer, + int max_width, + int can_split, + const unsigned char** break_point, + int* break_width) +{ + struct FormattedPrinter it = *printer; + // The break point and width of the line. + *break_point = it.end; + *break_width = 0; + // The current line width. + int char_width = 0; + bool separating = false; // True if the last iteration was breakable. + while (it.string != it.end) { + int codepoint = fp_peak(&it); + if (codepoint < 0) { return 0; } // Break out of function on error. + const utf8proc_property_t* property = utf8proc_get_property(codepoint); + if (can_split && char_width > 0) { + switch (property->category) { + default: + if (char_width + get_character_width(codepoint) > max_width) { + // The next character would go over the max width, so return now. + if (*break_point != it.end) { + // Use latest line break if one exists. + return 1; + } else { + // Force a line break here. + *break_point = it.string; + *break_width = char_width; + return 1; + } + } + separating = false; + break; + case UTF8PROC_CATEGORY_PD: // Punctuation, dash + if (char_width + get_character_width(codepoint) > max_width) { + *break_point = it.string; + *break_width = char_width; + return 1; + } else { + char_width += get_character_width(codepoint); + fp_next(&it); + *break_point = it.string; + *break_width = char_width; + separating = true; + continue; + } + break; + case UTF8PROC_CATEGORY_ZS: // Separator, space + if (!separating) { + *break_point = it.string; + *break_width = char_width; + separating = true; + } + break; + } + } + if (is_newline(codepoint)) { + // Always break on newlines. + *break_point = it.string; + *break_width = char_width; + return 0; + } + char_width += get_character_width(codepoint); + fp_next(&it); + } + // Return end of iteration. + *break_point = it.string; + *break_width = char_width; + return 0; +} +static int print_internal_( + TCOD_Console* con, + int x, + int y, + int width, + int height, + int n, + const char* string, + const TCOD_color_t* fg_in, + const TCOD_color_t* bg_in, + TCOD_bkgnd_flag_t flag, + TCOD_alignment_t align, + int can_split, + int count_only) +{ + static const TCOD_ColorRGBA color_default = {255, 255, 255, 0}; + TCOD_ColorRGBA fg = color_default; + TCOD_ColorRGBA bg = color_default; + if (fg_in) { + fg.r = fg_in->r; + fg.g = fg_in->g; + fg.b = fg_in->b; + fg.a = 255; + } + if (bg_in) { + bg.r = bg_in->r; + bg.g = bg_in->g; + bg.b = bg_in->b; + bg.a = 255; + } + struct FormattedPrinter printer = { + .string = (const unsigned char*)string, + .end = (const unsigned char*)string + n, + .fg = fg, + .bg = bg, + .default_fg = fg, + .default_bg = bg, + }; + if (!can_split && align == TCOD_RIGHT) { + // In general `can_split = false` is deprecated. + x -= con->w - 1; + width = con->w; + } + // Expand the width/height of 0 to the edge of the console. + if (!width) { width = con->w - x; } + if (!height) { height = con->h - y; } + // Print bounding box. + int left = x; + int right = x + width; + int top = y; + int bottom = y + height; + width = right - left; + height = bottom - top; + if (can_split && (width <= 0 || height <= 0)) { + return 0; // The bounding box is invalid. + } + while (printer.string != printer.end && top < bottom && top < con->h) { + int codepoint = fp_peak(&printer); + if (codepoint < 0) { return codepoint; } // Return error code. + const utf8proc_property_t* property = utf8proc_get_property(codepoint); + // Check for newlines. + if(is_newline(codepoint)) { + if(property->category == UTF8PROC_CATEGORY_ZP) { + top += 2; + } else { + top += 1; + } + fp_next(&printer); + continue; + } + // Get the next line of characters. + const unsigned char* line_break; + int line_width; + int split_status = next_split_(&printer, width, can_split, &line_break, &line_width); + // Set cursor_x from alignment. + int cursor_x = 0; + switch (align) { + default: + case TCOD_LEFT: + cursor_x = left; + break; + case TCOD_RIGHT: + cursor_x = right - line_width; + break; + case TCOD_CENTER: + if (can_split) { + cursor_x = left + (width - line_width) / 2; + } else { + cursor_x = left - (line_width / 2); // Deprecated. + } + break; + } + // True clipping area. Prevent drawing outside of these bounds. + int clip_left = left; + int clip_right = right; + if (!can_split) { + // Bounds are ignored if splitting is off. + clip_left = 0; + clip_right = con->w; + } + while (printer.string < line_break) { + // Iterate over a line of characters. + codepoint = fp_next(&printer); + if (codepoint < 0) { return codepoint; } // Return error code. + if(count_only) { continue; } + if (clip_left <= cursor_x && cursor_x < clip_right) { + // Actually render this line of characters. + TCOD_ColorRGB* fg_rgb = printer.fg.a ? (TCOD_ColorRGB*)&printer.fg : NULL; + TCOD_ColorRGB* bg_rgb = printer.bg.a ? (TCOD_ColorRGB*)&printer.bg : NULL; + TCOD_console_put_rgb(con, cursor_x, top, codepoint, fg_rgb, bg_rgb, flag); + } + cursor_x += get_character_width(codepoint); + } + // Ignore any extra spaces. + while (printer.string != printer.end) { + // Separator, space + if (utf8proc_get_property(fp_peak(&printer))->category != UTF8PROC_CATEGORY_ZS) { + break; + } + codepoint = fp_next(&printer); + if (codepoint < 0) { return codepoint; } // Return error code. + } + // If there was an automatic split earlier then the top is moved down. + if (split_status == 1) { top += 1; } + } + return MIN(top, bottom) - y + 1; +} +/** + * Normalize rectangle values using old libtcod rules where alignment can move + * the rectangle position. + */ +static void normalize_old_rect_( + TCOD_Console* console, + TCOD_alignment_t alignment, + int* x, + int* y, + int* width, + int* height) +{ + // Set default width/height if either is zero. + if (*width == 0) { *width = console->w; } + if (*height == 0) { *height = console->h - *y; } + switch(alignment) { + default: + case TCOD_LEFT: + break; + case TCOD_RIGHT: + *x -= *width; + break; + case TCOD_CENTER: + *x -= *width / 2; + break; + } + return; +} +TCOD_Error TCOD_console_printn( + TCOD_Console* con, + int x, + int y, + int n, + const char* str, + const TCOD_color_t* fg, + const TCOD_color_t* bg, + TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment) +{ + con = TCOD_console_validate_(con); + if (!con) { + TCOD_set_errorv("Console pointer must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + int err = print_internal_(con, x, y, con->w, con->h, n, str, + fg, bg, flag, alignment, false, false); + if (err < 0) { return (TCOD_Error)err; } + return TCOD_E_OK; +} +int TCOD_console_printn_rect( + TCOD_Console *con, + int x, + int y, + int width, + int height, + int n, + const char* str, + const TCOD_color_t* fg, + const TCOD_color_t* bg, + TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment) +{ + con = TCOD_console_validate_(con); + if (!con) { + TCOD_set_errorv("Console pointer must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + return print_internal_(con, x, y, width, height, n, str, fg, bg, flag, alignment, true, false); +} + +int TCOD_console_get_height_rect_n( + TCOD_Console *console, + int x, + int y, + int width, + int height, + int n, + const char* str) +{ + console = TCOD_console_validate_(console); + if (!console) { + TCOD_set_errorv("Console pointer must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + return print_internal_(console, x, y, width, height, n, str, NULL, NULL, + TCOD_BKGND_NONE, TCOD_LEFT, true, true); +} +int TCOD_console_get_height_rect_wn( + int width, + int n, + const char* str) +{ + TCOD_Console console = { .w = width, .h = INT_MAX }; + return TCOD_console_get_height_rect_n(&console, 0, 0, width, INT_MAX, n, str); +} +TCOD_Error TCOD_console_printn_frame( + struct TCOD_Console *con, + int x, + int y, + int width, + int height, + int n, + const char* title, + const TCOD_color_t* fg, + const TCOD_color_t* bg, + TCOD_bkgnd_flag_t flag, + bool empty) +{ + const int left = x; + const int right = x + width - 1; + const int top = y; + const int bottom = y + height - 1; + con = TCOD_console_validate_(con); + if (!con) { + TCOD_set_errorv("Console pointer must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + TCOD_console_put_rgb(con, left, top, 0x250C, fg, bg, flag); // ┌ + TCOD_console_put_rgb(con, right, top, 0x2510, fg, bg, flag); // ┐ + TCOD_console_put_rgb(con, left, bottom, 0x2514, fg, bg, flag); // └ + TCOD_console_put_rgb(con, right, bottom, 0x2518, fg, bg, flag); // ┘ + TCOD_console_draw_rect_rgb( + con, x + 1, y, width - 2, 1, 0x2500, fg, bg, flag); // ─ + TCOD_console_draw_rect_rgb( + con, x + 1, y + height - 1, width - 2, 1, 0x2500, fg, bg, flag); + TCOD_console_draw_rect_rgb( + con, x, y + 1, 1, height - 2, 0x2502, fg, bg, flag); // │ + TCOD_console_draw_rect_rgb( + con, x + width - 1, y + 1, 1, height - 2, 0x2502, fg, bg, flag); + if (empty) { + TCOD_console_draw_rect_rgb( + con, x + 1, y + 1, width - 2, height - 2, 0x20, fg, bg, flag); + } + if (n > 0 && title) { + char* tmp_string = malloc(n + 2); + if (!tmp_string) { + TCOD_set_errorv("Out of memory."); + return TCOD_E_OUT_OF_MEMORY; + } + memcpy(&tmp_string[1], title, n); + tmp_string[0] = ' '; + tmp_string[n + 1] = ' '; + int err = TCOD_console_printn_rect( + con, x, y, width, 1, n + 2, tmp_string, bg, fg, TCOD_BKGND_SET, TCOD_CENTER); + free(tmp_string); + if (err < 0) { return (TCOD_Error)err; } + } + return TCOD_E_OK; +} +TCOD_Error TCOD_console_printf_ex( + TCOD_Console* con, + int x, + int y, + TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment, + const char *fmt, ...) +{ + con = TCOD_console_validate_(con); + if (!con) { + TCOD_set_errorv("Console pointer must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + va_list ap; + va_start(ap, fmt); + char* str = NULL; + int len = vsprint_(&str, fmt, ap); + va_end(ap); + if (len < 0) { + TCOD_set_errorv("Error while resolving formatting string."); + return TCOD_E_ERROR; + } + TCOD_Error err = + TCOD_console_printn(con, x, y, len, str, &con->fore, &con->back, flag, alignment); + free(str); + return err; +} +TCOD_Error TCOD_console_printf(TCOD_Console* con, int x, int y, const char *fmt, ...) +{ + con = TCOD_console_validate_(con); + if (!con) { + TCOD_set_errorv("Console pointer must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + va_list ap; + va_start(ap, fmt); + char* str = NULL; + int len = vsprint_(&str, fmt, ap); + va_end(ap); + if (len < 0) { + TCOD_set_errorv("Error while resolving formatting string."); + return TCOD_E_ERROR; + } + int err = TCOD_console_printn(con, x, y, len, str, &con->fore, &con->back, con->bkgnd_flag, con->alignment); + free(str); + return (TCOD_Error)err; +} +int TCOD_console_printf_rect_ex( + struct TCOD_Console* con, + int x, int y, int w, int h, + TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...) +{ + con = TCOD_console_validate_(con); + if (!con) { + TCOD_set_errorv("Console pointer must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + normalize_old_rect_(con, alignment, &x, &y, &w, &h); + va_list ap; + va_start(ap, fmt); + char* str = NULL; + int len = vsprint_(&str, fmt, ap); + va_end(ap); + if (len < 0) { + TCOD_set_errorv("Error while resolving formatting string."); + return TCOD_E_ERROR; + } + int ret = TCOD_console_printn_rect(con, x, y, w, h, len, str, &con->fore, &con->back, flag, alignment); + free(str); + return ret; +} +int TCOD_console_printf_rect( + struct TCOD_Console* con, int x, int y, int w, int h, const char *fmt, ...) +{ + con = TCOD_console_validate_(con); + if (!con) { + TCOD_set_errorv("Console pointer must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + normalize_old_rect_(con, con->alignment, &x, &y, &w, &h); + va_list ap; + va_start(ap, fmt); + char* str = NULL; + int len = vsprint_(&str, fmt, ap); + va_end(ap); + if (len < 0) { + TCOD_set_errorv("Error while resolving formatting string."); + return TCOD_E_ERROR; + } + int ret = TCOD_console_printn_rect( con, x, y, w, h, len, str, &con->fore, &con->back, con->bkgnd_flag, con->alignment); + free(str); + return ret; +} +int TCOD_console_get_height_rect_fmt( + struct TCOD_Console* con, int x, int y, int w, int h, const char *fmt, ...) +{ + con = TCOD_console_validate_(con); + if (!con) { + TCOD_set_errorv("Console pointer must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + normalize_old_rect_(con, TCOD_LEFT, &x, &y, &w, &h); + va_list ap; + va_start(ap, fmt); + char* str = NULL; + int len = vsprint_(&str, fmt, ap); + va_end(ap); + if (len < 0) { + TCOD_set_errorv("Error while resolving formatting string."); + return TCOD_E_ERROR; + } + int ret = TCOD_console_get_height_rect_n(con, x, y, w, h, len, str); + free(str); + return ret; +} +TCOD_Error TCOD_console_printf_frame(struct TCOD_Console *con, + int x, int y, int width, int height, int empty, + TCOD_bkgnd_flag_t flag, const char *fmt, ...) +{ + con = TCOD_console_validate_(con); + if (!con) { + TCOD_set_errorv("Console pointer must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + va_list ap; + va_start(ap, fmt); + char* str = NULL; + int len = vsprint_(&str, fmt, ap); + va_end(ap); + if (len < 0) { + TCOD_set_errorv("Error while resolving formatting string."); + return TCOD_E_ERROR; + } + int err = TCOD_console_printn_frame(con, x, y, width, height, len, str, &con->fore, &con->back, flag, empty); + free(str); + return (TCOD_Error)err; +} diff --git a/tcod_sys/libtcod/src/libtcod/console_printing.h b/tcod_sys/libtcod/src/libtcod/console_printing.h new file mode 100644 index 000000000..23dbc0d96 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/console_printing.h @@ -0,0 +1,285 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef TCOD_CONSOLE_PRINTING_H_ +#define TCOD_CONSOLE_PRINTING_H_ + +#ifdef __cplusplus +#include +#include +#endif + +#include +#ifndef NO_UNICODE +#include +#endif + +#include "config.h" +#include "error.h" +#include "console_types.h" + +#ifdef __cplusplus +extern "C" { +#endif +TCOD_DEPRECATED("Use TCOD_console_printf instead.") +TCODLIB_API void TCOD_console_print(TCOD_Console* con,int x, int y, const char *fmt, ...); +TCOD_DEPRECATED("Use TCOD_console_printf_ex instead.") +TCODLIB_API void TCOD_console_print_ex(TCOD_Console* con,int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...); +TCOD_DEPRECATED("Use TCOD_console_printf_rect instead.") +TCODLIB_API int TCOD_console_print_rect(TCOD_Console* con,int x, int y, int w, int h, const char *fmt, ...); +TCOD_DEPRECATED("Use TCOD_console_printf_rect_ex instead.") +TCODLIB_API int TCOD_console_print_rect_ex(TCOD_Console* con,int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...); +TCOD_DEPRECATED("Use TCOD_console_printf_frame instead.") +TCODLIB_API void TCOD_console_print_frame(TCOD_console_t con,int x,int y,int w,int h, bool empty, TCOD_bkgnd_flag_t flag, const char *fmt, ...); +TCOD_DEPRECATED("Use TCOD_console_get_height_rect_fmt instead.") +TCODLIB_API int TCOD_console_get_height_rect(TCOD_Console* con,int x, int y, int w, int h, const char *fmt, ...); + +#ifndef NO_UNICODE +TCOD_DEPRECATED("Use TCOD_console_printf instead.") +TCODLIB_API void TCOD_console_print_utf(TCOD_Console* con,int x, int y, const wchar_t *fmt, ...); +TCOD_DEPRECATED("Use TCOD_console_printf_ex instead.") +TCODLIB_API void TCOD_console_print_ex_utf(TCOD_Console* con,int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...); +TCOD_DEPRECATED("Use TCOD_console_printf_rect instead.") +TCODLIB_API int TCOD_console_print_rect_utf(TCOD_Console* con,int x, int y, int w, int h, const wchar_t *fmt, ...); +TCOD_DEPRECATED("Use TCOD_console_printf_rect_ex instead.") +TCODLIB_API int TCOD_console_print_rect_ex_utf(TCOD_Console* con,int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...); +TCOD_DEPRECATED("Use TCOD_console_get_height_rect_fmt instead.") +TCODLIB_API int TCOD_console_get_height_rect_utf(TCOD_Console* con,int x, int y, int w, int h, const wchar_t *fmt, ...); +#endif + +typedef enum { + TCOD_COLCTRL_1 = 1, + TCOD_COLCTRL_2, + TCOD_COLCTRL_3, + TCOD_COLCTRL_4, + TCOD_COLCTRL_5, + TCOD_COLCTRL_NUMBER=5, + TCOD_COLCTRL_FORE_RGB, + TCOD_COLCTRL_BACK_RGB, + TCOD_COLCTRL_STOP +} TCOD_colctrl_t; + +TCODLIB_API void TCOD_console_set_color_control(TCOD_colctrl_t con, TCOD_color_t fore, TCOD_color_t back); + +/* UTF-8 functions */ +/** + Format and print a UTF-8 string to a console. + \rst + .. versionadded:: 1.8 + + .. versionchanged:: 1.16 + Now returns a negative error code on failure. + \endrst + */ +TCODLIB_API TCODLIB_FORMAT(4, 5) TCOD_Error TCOD_console_printf( + TCOD_Console* con, int x, int y, const char *fmt, ...); +/** + Format and print a UTF-8 string to a console. + \rst + .. versionadded:: 1.8 + + .. versionchanged:: 1.16 + Now returns a negative error code on failure. + \endrst + */ +TCODLIB_API TCODLIB_FORMAT(6, 7) TCOD_Error TCOD_console_printf_ex( + TCOD_Console* con, int x, int y, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment, const char *fmt, ...); +/** + Format and print a UTF-8 string to a console. + \rst + .. versionadded:: 1.8 + + .. versionchanged:: 1.16 + Now returns a negative error code on failure. + \endrst + */ +TCODLIB_API TCODLIB_FORMAT(6, 7) int TCOD_console_printf_rect( + TCOD_Console* con, int x, int y, int w, int h, const char *fmt, ...); +/** + Format and print a UTF-8 string to a console. + \rst + .. versionadded:: 1.8 + + .. versionchanged:: 1.16 + Now returns a negative error code on failure. + \endrst + */ +TCODLIB_API TCODLIB_FORMAT(8, 9) int TCOD_console_printf_rect_ex( + TCOD_Console* con,int x, int y, int w, int h, + TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, ...); +/** + Print a framed and optionally titled region to a console, using default + colors and alignment. + + This function uses Unicode box-drawing characters and a UTF-8 formatted + string. + \rst + .. versionadded:: 1.8 + + .. versionchanged:: 1.16 + Now returns a negative error code on failure. + \endrst + */ +TCODLIB_API TCODLIB_FORMAT(8, 9) +TCOD_Error TCOD_console_printf_frame(struct TCOD_Console *con, + int x, int y, int w, int h, int empty, + TCOD_bkgnd_flag_t flag, const char *fmt, ...); +/** + Return the number of lines that would be printed by this formatted string. + \rst + .. versionadded:: 1.8 + + .. versionchanged:: 1.16 + Now returns a negative error code on failure. + \endrst + */ +TCODLIB_API TCODLIB_FORMAT(6, 7) +int TCOD_console_get_height_rect_fmt(struct TCOD_Console *con, + int x, int y, int w, int h, + const char *fmt, ...); + +TCOD_PUBLIC TCOD_Error TCOD_console_printn( + TCOD_Console* con, + int x, + int y, + int n, + const char* str, + const TCOD_color_t* fg, + const TCOD_color_t* bg, + TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment); +TCOD_PUBLIC int TCOD_console_printn_rect( + TCOD_Console *con, + int x, + int y, + int width, + int height, + int n, + const char* str, + const TCOD_color_t* fg, + const TCOD_color_t* bg, + TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment); +TCOD_PUBLIC int TCOD_console_get_height_rect_n( + TCOD_Console *console, + int x, + int y, + int width, + int height, + int n, + const char* str); +TCOD_PUBLIC int TCOD_console_get_height_rect_wn( + int width, + int n, + const char* str); +TCOD_PUBLIC TCOD_Error TCOD_console_printn_frame( + struct TCOD_Console *con, + int x, + int y, + int width, + int height, + int n, + const char* title, + const TCOD_color_t* fg, + const TCOD_color_t* bg, + TCOD_bkgnd_flag_t flag, + bool empty); +#ifdef __cplusplus +} // extern "C" +namespace tcod { +inline void print( + TCOD_Console& con, + int x, + int y, + const std::string& str, + const TCOD_color_t* fg, + const TCOD_color_t* bg, + TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment) +{ + check_throw_error( + TCOD_console_printn(&con, x, y, str.size(), str.data(), fg, bg, flag, alignment)); +} +inline int print_rect( + TCOD_Console &con, + int x, + int y, + int width, + int height, + const std::string& str, + const TCOD_color_t* fg, + const TCOD_color_t* bg, + TCOD_bkgnd_flag_t flag, + TCOD_alignment_t alignment) +{ + return check_throw_error( + TCOD_console_printn_rect( + &con, x, y, width, height, str.size(), str.data(), fg, bg, flag, alignment)); +} +inline int get_height_rect( + TCOD_Console &console, + int x, + int y, + int width, + int height, + const std::string& str) +{ + return check_throw_error( + TCOD_console_get_height_rect_n( + &console, x, y, width, height, str.size(), str.data())); +} +inline int get_height_rect( + int width, + const std::string& str) +{ + return check_throw_error( + TCOD_console_get_height_rect_wn(width, str.size(), str.data())); +} +inline void print_frame( + struct TCOD_Console &con, + int x, + int y, + int width, + int height, + const std::string& title, + const TCOD_color_t* fg, + const TCOD_color_t* bg, + TCOD_bkgnd_flag_t flag, + bool empty) +{ + check_throw_error( + TCOD_console_printn_frame( + &con, x, y, width, height, title.size(), title.data(), fg, bg, flag, empty)); +} +} // namespace tcod +#endif // __cplusplus +#endif /* TCOD_CONSOLE_PRINTING_H_ */ diff --git a/tcod_sys/libtcod/src/console_rexpaint.c b/tcod_sys/libtcod/src/libtcod/console_rexpaint.c similarity index 80% rename from tcod_sys/libtcod/src/console_rexpaint.c rename to tcod_sys/libtcod/src/libtcod/console_rexpaint.c index 862b00985..6fad08c01 100644 --- a/tcod_sys/libtcod/src/console_rexpaint.c +++ b/tcod_sys/libtcod/src/libtcod/console_rexpaint.c @@ -1,59 +1,61 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#ifdef TCOD_CONSOLE_SUPPORT +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "console_rexpaint.h" #include #include -#include -#include -#include /* Needed only for TCOD_fatal */ -#include -#include +#include "console.h" +#include "libtcod_int.h" /* Needed only for TCOD_fatal */ +#include "console_types.h" +#include "color.h" /* Convert a little-endian number to native memory order. */ -static uint32_t decode_little_endian(uint32_t data) { - int i; - uint32_t result=0; - for(i=0; i<(int)sizeof(result);++i){ - result += (unsigned int)((unsigned char*)&data)[i] << (CHAR_BIT * i); +static uint32_t decode_little_endian(uint32_t data) +{ + uint32_t result = 0; + const uint8_t* p = (uint8_t*)&data; + for(int i = 0; i < (int)sizeof(result); ++i) { + result += p[i] << (CHAR_BIT * i); } return result; } /* Byte swaps a number into little-endian order to be saved to disk. */ static uint32_t encode_little_endian(uint32_t number) { - int i; - uint32_t result=0; - for(i=0; i<(int)sizeof(result);++i){ - ((unsigned char*)&result)[i] = number & UCHAR_MAX; + uint32_t result = 0; + uint8_t* p = (uint8_t*)&result; + for(int i = 0; i < (int)sizeof(result); ++i) { + p[i] = number & UCHAR_MAX; number >>= CHAR_BIT; } return result; @@ -74,13 +76,14 @@ struct RexPaintTile { }; /* Read data from a gz file, returns 0 on success, or -1 on any error. */ static int load_gz_confirm(gzFile gz_file, void *data, size_t length) { - if (gzread(gz_file, data, (int)length) != length) { return -1; } + int length_ = (int)length; + if (gzread(gz_file, data, length_) != length_) { return -1; } return 0; } /* Loads a little-endian 32 bit signed int into memory. */ static int load_int32(gzFile gz_file, int32_t *out) { if (load_gz_confirm(gz_file, out, sizeof(out[0]))) { return -1; } - *out = (int32_t)decode_little_endian((uint32_t)(out[0])); + *out = (int32_t)decode_little_endian((uint32_t)out[0]); return 0; } static int load_header(gzFile gz_file, struct RexPaintHeader *xp_header) { @@ -100,7 +103,7 @@ static int load_tile(gzFile gz_file, struct RexPaintTile *tile) { /* Read a layer of REXPaint tiles onto a console. If transparent is true, then follow REXPaint's rules for transparency. */ static int load_tiles( - gzFile gz_file, TCOD_console_t console, int transparent) { + gzFile gz_file, TCOD_Console* console, int transparent) { int x, y; const int width = TCOD_console_get_width(console); const int height = TCOD_console_get_height(console); @@ -162,7 +165,7 @@ static TCOD_list_t load_consoleList(gzFile gz_file) { /* Convert a list of consoles into a single console, deleting the list. Follows REXPaint's rules for transparency. */ static TCOD_console_t combine_console_list(TCOD_list_t console_list) { - TCOD_console_t main_console; + TCOD_Console* main_console; if (!console_list) { return NULL; } /* Reverse the list so that elements will be dequeued. */ TCOD_list_reverse(console_list); @@ -261,7 +264,7 @@ static int write_tile(gzFile gz_file, struct RexPaintTile *tile) { } return 0; } -static int write_console(gzFile gz_file, TCOD_console_t console) { +static int write_console(gzFile gz_file, const TCOD_Console* console) { int x, y; struct RexPaintLayerChunk xp_layer; xp_layer.width = TCOD_console_get_width(console); @@ -296,7 +299,7 @@ static int write_console(gzFile gz_file, TCOD_console_t console) { * The REXPaint format can support a 1:1 copy of a libtcod console. */ bool TCOD_console_save_xp( - TCOD_console_t con, const char *filename, int compress_level) { + const TCOD_Console* con, const char *filename, int compress_level) { struct RexPaintHeader xp_header; gzFile gz_file = gzopen(filename, "wb"); if (!gz_file) { return false; /* could not open file */ } @@ -322,7 +325,7 @@ bool TCOD_console_save_xp( * This function can save any number of layers with multiple * different sizes. * - * The REXPaint tool only supports files with up to 4 layers where + * The REXPaint tool only supports files with up to 9 layers where * all layers are the same size. */ bool TCOD_console_list_save_xp( @@ -347,5 +350,3 @@ bool TCOD_console_list_save_xp( if (gzclose(gz_file)) { return false; /* error writing to file */ } return true; } - -#endif /* TCOD_CONSOLE_SUPPORT */ diff --git a/tcod_sys/libtcod/src/libtcod/console_rexpaint.h b/tcod_sys/libtcod/src/libtcod/console_rexpaint.h new file mode 100644 index 000000000..4e574fc42 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/console_rexpaint.h @@ -0,0 +1,46 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef TCOD_CONSOLE_REXPAINT_H_ +#define TCOD_CONSOLE_REXPAINT_H_ + +#include "config.h" +#include "console_types.h" +#include "list.h" +TCODLIB_CAPI TCOD_console_t TCOD_console_from_xp(const char *filename); +TCODLIB_CAPI bool TCOD_console_load_xp(TCOD_Console* con, + const char *filename); +TCODLIB_CAPI bool TCOD_console_save_xp( + const TCOD_Console* con, const char *filename, int compress_level); +TCODLIB_CAPI TCOD_list_t TCOD_console_list_from_xp(const char *filename); +TCODLIB_CAPI bool TCOD_console_list_save_xp( + TCOD_list_t console_list, const char *filename, int compress_level); +#endif /* TCOD_CONSOLE_REXPAINT_H_ */ diff --git a/tcod_sys/libtcod/include/console_types.h b/tcod_sys/libtcod/src/libtcod/console_types.h similarity index 63% rename from tcod_sys/libtcod/include/console_types.h rename to tcod_sys/libtcod/src/libtcod/console_types.h index 054190fdf..9cd74482b 100644 --- a/tcod_sys/libtcod/include/console_types.h +++ b/tcod_sys/libtcod/src/libtcod/console_types.h @@ -1,305 +1,292 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_CONSOLE_TYPES_H -#define _TCOD_CONSOLE_TYPES_H - -#include "libtcod_portability.h" - -typedef void * TCOD_console_t; - -typedef enum { - TCODK_NONE, - TCODK_ESCAPE, - TCODK_BACKSPACE, - TCODK_TAB, - TCODK_ENTER, - TCODK_SHIFT, - TCODK_CONTROL, - TCODK_ALT, - TCODK_PAUSE, - TCODK_CAPSLOCK, - TCODK_PAGEUP, - TCODK_PAGEDOWN, - TCODK_END, - TCODK_HOME, - TCODK_UP, - TCODK_LEFT, - TCODK_RIGHT, - TCODK_DOWN, - TCODK_PRINTSCREEN, - TCODK_INSERT, - TCODK_DELETE, - TCODK_LWIN, - TCODK_RWIN, - TCODK_APPS, - TCODK_0, - TCODK_1, - TCODK_2, - TCODK_3, - TCODK_4, - TCODK_5, - TCODK_6, - TCODK_7, - TCODK_8, - TCODK_9, - TCODK_KP0, - TCODK_KP1, - TCODK_KP2, - TCODK_KP3, - TCODK_KP4, - TCODK_KP5, - TCODK_KP6, - TCODK_KP7, - TCODK_KP8, - TCODK_KP9, - TCODK_KPADD, - TCODK_KPSUB, - TCODK_KPDIV, - TCODK_KPMUL, - TCODK_KPDEC, - TCODK_KPENTER, - TCODK_F1, - TCODK_F2, - TCODK_F3, - TCODK_F4, - TCODK_F5, - TCODK_F6, - TCODK_F7, - TCODK_F8, - TCODK_F9, - TCODK_F10, - TCODK_F11, - TCODK_F12, - TCODK_NUMLOCK, - TCODK_SCROLLLOCK, - TCODK_SPACE, - TCODK_CHAR, - TCODK_TEXT -} TCOD_keycode_t; - -#define TCOD_KEY_TEXT_SIZE 32 - -/* key data : special code or character or text */ -typedef struct { - TCOD_keycode_t vk; /* key code */ - char c; /* character if vk == TCODK_CHAR else 0 */ - char text[TCOD_KEY_TEXT_SIZE]; /* text if vk == TCODK_TEXT else text[0] == '\0' */ - bool pressed ; /* does this correspond to a key press or key release event ? */ - bool lalt ; - bool lctrl ; - bool lmeta ; - bool ralt ; - bool rctrl ; - bool rmeta ; - bool shift ; -} TCOD_key_t; - -typedef enum { - /* single walls */ - TCOD_CHAR_HLINE=196, - TCOD_CHAR_VLINE=179, - TCOD_CHAR_NE=191, - TCOD_CHAR_NW=218, - TCOD_CHAR_SE=217, - TCOD_CHAR_SW=192, - TCOD_CHAR_TEEW=180, - TCOD_CHAR_TEEE=195, - TCOD_CHAR_TEEN=193, - TCOD_CHAR_TEES=194, - TCOD_CHAR_CROSS=197, - /* double walls */ - TCOD_CHAR_DHLINE=205, - TCOD_CHAR_DVLINE=186, - TCOD_CHAR_DNE=187, - TCOD_CHAR_DNW=201, - TCOD_CHAR_DSE=188, - TCOD_CHAR_DSW=200, - TCOD_CHAR_DTEEW=185, - TCOD_CHAR_DTEEE=204, - TCOD_CHAR_DTEEN=202, - TCOD_CHAR_DTEES=203, - TCOD_CHAR_DCROSS=206, - /* blocks */ - TCOD_CHAR_BLOCK1=176, - TCOD_CHAR_BLOCK2=177, - TCOD_CHAR_BLOCK3=178, - /* arrows */ - TCOD_CHAR_ARROW_N=24, - TCOD_CHAR_ARROW_S=25, - TCOD_CHAR_ARROW_E=26, - TCOD_CHAR_ARROW_W=27, - /* arrows without tail */ - TCOD_CHAR_ARROW2_N=30, - TCOD_CHAR_ARROW2_S=31, - TCOD_CHAR_ARROW2_E=16, - TCOD_CHAR_ARROW2_W=17, - /* double arrows */ - TCOD_CHAR_DARROW_H=29, - TCOD_CHAR_DARROW_V=18, - /* GUI stuff */ - TCOD_CHAR_CHECKBOX_UNSET=224, - TCOD_CHAR_CHECKBOX_SET=225, - TCOD_CHAR_RADIO_UNSET=9, - TCOD_CHAR_RADIO_SET=10, - /* sub-pixel resolution kit */ - TCOD_CHAR_SUBP_NW=226, - TCOD_CHAR_SUBP_NE=227, - TCOD_CHAR_SUBP_N=228, - TCOD_CHAR_SUBP_SE=229, - TCOD_CHAR_SUBP_DIAG=230, - TCOD_CHAR_SUBP_E=231, - TCOD_CHAR_SUBP_SW=232, - /* miscellaneous */ - TCOD_CHAR_SMILIE = 1, - TCOD_CHAR_SMILIE_INV = 2, - TCOD_CHAR_HEART = 3, - TCOD_CHAR_DIAMOND = 4, - TCOD_CHAR_CLUB = 5, - TCOD_CHAR_SPADE = 6, - TCOD_CHAR_BULLET = 7, - TCOD_CHAR_BULLET_INV = 8, - TCOD_CHAR_MALE = 11, - TCOD_CHAR_FEMALE = 12, - TCOD_CHAR_NOTE = 13, - TCOD_CHAR_NOTE_DOUBLE = 14, - TCOD_CHAR_LIGHT = 15, - TCOD_CHAR_EXCLAM_DOUBLE = 19, - TCOD_CHAR_PILCROW = 20, - TCOD_CHAR_SECTION = 21, - TCOD_CHAR_POUND = 156, - TCOD_CHAR_MULTIPLICATION = 158, - TCOD_CHAR_FUNCTION = 159, - TCOD_CHAR_RESERVED = 169, - TCOD_CHAR_HALF = 171, - TCOD_CHAR_ONE_QUARTER = 172, - TCOD_CHAR_COPYRIGHT = 184, - TCOD_CHAR_CENT = 189, - TCOD_CHAR_YEN = 190, - TCOD_CHAR_CURRENCY = 207, - TCOD_CHAR_THREE_QUARTERS = 243, - TCOD_CHAR_DIVISION = 246, - TCOD_CHAR_GRADE = 248, - TCOD_CHAR_UMLAUT = 249, - TCOD_CHAR_POW1 = 251, - TCOD_CHAR_POW3 = 252, - TCOD_CHAR_POW2 = 253, - TCOD_CHAR_BULLET_SQUARE = 254, - /* diacritics */ -} TCOD_chars_t; - -typedef enum { - TCOD_COLCTRL_1 = 1, - TCOD_COLCTRL_2, - TCOD_COLCTRL_3, - TCOD_COLCTRL_4, - TCOD_COLCTRL_5, - TCOD_COLCTRL_NUMBER=5, - TCOD_COLCTRL_FORE_RGB, - TCOD_COLCTRL_BACK_RGB, - TCOD_COLCTRL_STOP -} TCOD_colctrl_t; - -typedef enum { - TCOD_BKGND_NONE, - TCOD_BKGND_SET, - TCOD_BKGND_MULTIPLY, - TCOD_BKGND_LIGHTEN, - TCOD_BKGND_DARKEN, - TCOD_BKGND_SCREEN, - TCOD_BKGND_COLOR_DODGE, - TCOD_BKGND_COLOR_BURN, - TCOD_BKGND_ADD, - TCOD_BKGND_ADDA, - TCOD_BKGND_BURN, - TCOD_BKGND_OVERLAY, - TCOD_BKGND_ALPH, - TCOD_BKGND_DEFAULT -} TCOD_bkgnd_flag_t; - -typedef enum { - TCOD_KEY_PRESSED=1, - TCOD_KEY_RELEASED=2, -} TCOD_key_status_t; - -/** - * These font flags can be OR'd together into a bit-field and passed to - * TCOD_console_set_custom_font - */ -typedef enum { - /** Tiles are arranged in column-major order. - * - * 0 3 6 - * 1 4 7 - * 2 5 8 - */ - TCOD_FONT_LAYOUT_ASCII_INCOL=1, - /** Tiles are arranged in row-major order. - * - * 0 1 2 - * 3 4 5 - * 6 7 8 - */ - TCOD_FONT_LAYOUT_ASCII_INROW=2, - /** Converts all tiles into a monochrome gradient. */ - TCOD_FONT_TYPE_GREYSCALE=4, - TCOD_FONT_TYPE_GRAYSCALE=4, - /** A unique layout used by some of libtcod's fonts. */ - TCOD_FONT_LAYOUT_TCOD=8, -} TCOD_font_flags_t; -/** - * The available renderers. - */ -typedef enum { - /** An OpenGL implementation using a shader. */ - TCOD_RENDERER_GLSL, - /** - * An OpenGL implementation without a shader. - * - * Performs worse than TCOD_RENDERER_GLSL without many benefits. - */ - TCOD_RENDERER_OPENGL, - /** - * A software based renderer. - * - * The font file is loaded into RAM instead of VRAM in this implementation. - */ - TCOD_RENDERER_SDL, - TCOD_NB_RENDERERS, -} TCOD_renderer_t; - -/** - * \enum TCOD_alignment_t - * - * Print justification options. - */ -typedef enum { - TCOD_LEFT, - TCOD_RIGHT, - TCOD_CENTER -} TCOD_alignment_t; -#endif /* _TCOD_CONSOLE_TYPES_H */ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_CONSOLE_TYPES_H +#define _TCOD_CONSOLE_TYPES_H + +#include "config.h" +#include "color.h" +#include "console.h" + +typedef enum { + TCODK_NONE, + TCODK_ESCAPE, + TCODK_BACKSPACE, + TCODK_TAB, + TCODK_ENTER, + TCODK_SHIFT, + TCODK_CONTROL, + TCODK_ALT, + TCODK_PAUSE, + TCODK_CAPSLOCK, + TCODK_PAGEUP, + TCODK_PAGEDOWN, + TCODK_END, + TCODK_HOME, + TCODK_UP, + TCODK_LEFT, + TCODK_RIGHT, + TCODK_DOWN, + TCODK_PRINTSCREEN, + TCODK_INSERT, + TCODK_DELETE, + TCODK_LWIN, + TCODK_RWIN, + TCODK_APPS, + TCODK_0, + TCODK_1, + TCODK_2, + TCODK_3, + TCODK_4, + TCODK_5, + TCODK_6, + TCODK_7, + TCODK_8, + TCODK_9, + TCODK_KP0, + TCODK_KP1, + TCODK_KP2, + TCODK_KP3, + TCODK_KP4, + TCODK_KP5, + TCODK_KP6, + TCODK_KP7, + TCODK_KP8, + TCODK_KP9, + TCODK_KPADD, + TCODK_KPSUB, + TCODK_KPDIV, + TCODK_KPMUL, + TCODK_KPDEC, + TCODK_KPENTER, + TCODK_F1, + TCODK_F2, + TCODK_F3, + TCODK_F4, + TCODK_F5, + TCODK_F6, + TCODK_F7, + TCODK_F8, + TCODK_F9, + TCODK_F10, + TCODK_F11, + TCODK_F12, + TCODK_NUMLOCK, + TCODK_SCROLLLOCK, + TCODK_SPACE, + TCODK_CHAR, + TCODK_TEXT +} TCOD_keycode_t; + +#define TCOD_KEY_TEXT_SIZE 32 + +/* key data : special code or character or text */ +typedef struct { + TCOD_keycode_t vk; /* key code */ + char c; /* character if vk == TCODK_CHAR else 0 */ + char text[TCOD_KEY_TEXT_SIZE]; /* text if vk == TCODK_TEXT else text[0] == '\0' */ + bool pressed ; /* does this correspond to a key press or key release event ? */ + bool lalt ; + bool lctrl ; + bool lmeta ; + bool ralt ; + bool rctrl ; + bool rmeta ; + bool shift ; +} TCOD_key_t; + +typedef enum { + /* single walls */ + TCOD_CHAR_HLINE=196, + TCOD_CHAR_VLINE=179, + TCOD_CHAR_NE=191, + TCOD_CHAR_NW=218, + TCOD_CHAR_SE=217, + TCOD_CHAR_SW=192, + TCOD_CHAR_TEEW=180, + TCOD_CHAR_TEEE=195, + TCOD_CHAR_TEEN=193, + TCOD_CHAR_TEES=194, + TCOD_CHAR_CROSS=197, + /* double walls */ + TCOD_CHAR_DHLINE=205, + TCOD_CHAR_DVLINE=186, + TCOD_CHAR_DNE=187, + TCOD_CHAR_DNW=201, + TCOD_CHAR_DSE=188, + TCOD_CHAR_DSW=200, + TCOD_CHAR_DTEEW=185, + TCOD_CHAR_DTEEE=204, + TCOD_CHAR_DTEEN=202, + TCOD_CHAR_DTEES=203, + TCOD_CHAR_DCROSS=206, + /* blocks */ + TCOD_CHAR_BLOCK1=176, + TCOD_CHAR_BLOCK2=177, + TCOD_CHAR_BLOCK3=178, + /* arrows */ + TCOD_CHAR_ARROW_N=24, + TCOD_CHAR_ARROW_S=25, + TCOD_CHAR_ARROW_E=26, + TCOD_CHAR_ARROW_W=27, + /* arrows without tail */ + TCOD_CHAR_ARROW2_N=30, + TCOD_CHAR_ARROW2_S=31, + TCOD_CHAR_ARROW2_E=16, + TCOD_CHAR_ARROW2_W=17, + /* double arrows */ + TCOD_CHAR_DARROW_H=29, + TCOD_CHAR_DARROW_V=18, + /* GUI stuff */ + TCOD_CHAR_CHECKBOX_UNSET=224, + TCOD_CHAR_CHECKBOX_SET=225, + TCOD_CHAR_RADIO_UNSET=9, + TCOD_CHAR_RADIO_SET=10, + /* sub-pixel resolution kit */ + TCOD_CHAR_SUBP_NW=226, + TCOD_CHAR_SUBP_NE=227, + TCOD_CHAR_SUBP_N=228, + TCOD_CHAR_SUBP_SE=229, + TCOD_CHAR_SUBP_DIAG=230, + TCOD_CHAR_SUBP_E=231, + TCOD_CHAR_SUBP_SW=232, + /* miscellaneous */ + TCOD_CHAR_SMILIE = 1, + TCOD_CHAR_SMILIE_INV = 2, + TCOD_CHAR_HEART = 3, + TCOD_CHAR_DIAMOND = 4, + TCOD_CHAR_CLUB = 5, + TCOD_CHAR_SPADE = 6, + TCOD_CHAR_BULLET = 7, + TCOD_CHAR_BULLET_INV = 8, + TCOD_CHAR_MALE = 11, + TCOD_CHAR_FEMALE = 12, + TCOD_CHAR_NOTE = 13, + TCOD_CHAR_NOTE_DOUBLE = 14, + TCOD_CHAR_LIGHT = 15, + TCOD_CHAR_EXCLAM_DOUBLE = 19, + TCOD_CHAR_PILCROW = 20, + TCOD_CHAR_SECTION = 21, + TCOD_CHAR_POUND = 156, + TCOD_CHAR_MULTIPLICATION = 158, + TCOD_CHAR_FUNCTION = 159, + TCOD_CHAR_RESERVED = 169, + TCOD_CHAR_HALF = 171, + TCOD_CHAR_ONE_QUARTER = 172, + TCOD_CHAR_COPYRIGHT = 184, + TCOD_CHAR_CENT = 189, + TCOD_CHAR_YEN = 190, + TCOD_CHAR_CURRENCY = 207, + TCOD_CHAR_THREE_QUARTERS = 243, + TCOD_CHAR_DIVISION = 246, + TCOD_CHAR_GRADE = 248, + TCOD_CHAR_UMLAUT = 249, + TCOD_CHAR_POW1 = 251, + TCOD_CHAR_POW3 = 252, + TCOD_CHAR_POW2 = 253, + TCOD_CHAR_BULLET_SQUARE = 254, + /* diacritics */ +} TCOD_chars_t; + +typedef enum { + TCOD_KEY_PRESSED=1, + TCOD_KEY_RELEASED=2, +} TCOD_key_status_t; +/** + * These font flags can be OR'd together into a bit-field and passed to + * TCOD_console_set_custom_font + */ +typedef enum { + /** Tiles are arranged in column-major order. + * + * 0 3 6 + * 1 4 7 + * 2 5 8 + */ + TCOD_FONT_LAYOUT_ASCII_INCOL=1, + /** Tiles are arranged in row-major order. + * + * 0 1 2 + * 3 4 5 + * 6 7 8 + */ + TCOD_FONT_LAYOUT_ASCII_INROW=2, + /** Converts all tiles into a monochrome gradient. */ + TCOD_FONT_TYPE_GREYSCALE=4, + TCOD_FONT_TYPE_GRAYSCALE=4, + /** A unique layout used by some of libtcod's fonts. */ + TCOD_FONT_LAYOUT_TCOD=8, + /** + * Decode a code page 437 tileset into Unicode code-points. + * \rst + * .. versionadded:: 1.10 + * \endrst + */ + TCOD_FONT_LAYOUT_CP437=16, +} TCOD_font_flags_t; +/** + * The available renderers. + */ +typedef enum { + /** Alias for TCOD_RENDERER_OPENGL2. */ + TCOD_RENDERER_GLSL, + /** + * An OpenGL 1.1 implementation. + * + * Performs worse than TCOD_RENDERER_GLSL without many benefits. + */ + TCOD_RENDERER_OPENGL, + /** + * A software based renderer. + * + * The font file is loaded into RAM instead of VRAM in this implementation. + */ + TCOD_RENDERER_SDL, + /** + * A new SDL2 renderer. Allows the window to be resized. + * \rst + * .. versionadded:: 1.8 + * \endrst + */ + TCOD_RENDERER_SDL2, + /** + * A new OpenGL 2.0 core renderer. Allows the window to be resized. + * \rst + * .. versionadded:: 1.9 + * + * .. versionchanged:: 1.11.0 + * This renderer now uses OpenGL 2.0 instead of 2.1. + * \endrst + */ + TCOD_RENDERER_OPENGL2, + TCOD_NB_RENDERERS, +} TCOD_renderer_t; +#endif /* _TCOD_CONSOLE_TYPES_H */ diff --git a/tcod_sys/libtcod/src/libtcod/context.c b/tcod_sys/libtcod/src/libtcod/context.c new file mode 100644 index 000000000..b85768da2 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/context.c @@ -0,0 +1,140 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "context.h" + +#include "stdlib.h" +#include "math.h" + +struct TCOD_Context* TCOD_context_new_(void) +{ + struct TCOD_Context* renderer = calloc(sizeof(*renderer), 1); + return renderer; +} + +void TCOD_context_delete(struct TCOD_Context* renderer) +{ + if (!renderer) { return; } + if (renderer->destructor_) { renderer->destructor_(renderer); } + free(renderer); +} +TCOD_Error TCOD_context_present( + struct TCOD_Context* context, + const struct TCOD_Console* console, + const struct TCOD_ViewportOptions* viewport) +{ + if (!context) { + TCOD_set_errorv("Context must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + if (!console) { + TCOD_set_errorv("Console must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + return context->present_(context, console, viewport); +} +TCOD_Error TCOD_context_screen_pixel_to_tile_d( + struct TCOD_Context* context, double* x, double* y) +{ + if (!context) { + TCOD_set_errorv("Context must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + context->pixel_to_tile_(context, x, y); + return TCOD_E_OK; +} +TCOD_Error TCOD_context_screen_pixel_to_tile_i( + struct TCOD_Context* context, int* x, int* y) +{ + double xd = x ? (double)(*x) : 0; + double yd = y ? (double)(*y) : 0; + TCOD_Error err = TCOD_context_screen_pixel_to_tile_d(context, &xd, &yd); + if (x) { *x = (int)floor(xd); } + if (y) { *y = (int)floor(yd); } + return err; +} +TCOD_PUBLIC TCOD_Error TCOD_context_save_screenshot( + struct TCOD_Context* context, const char* filename) +{ + if (!context) { + TCOD_set_errorv("Context must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + return context->save_screenshot_(context, filename); +} +TCOD_PUBLIC struct SDL_Window* TCOD_context_get_sdl_window( + struct TCOD_Context* context) +{ + if (!context) { + TCOD_set_errorv("Context must not be NULL."); + return NULL; + } + return context->get_sdl_window_(context); +} +TCOD_PUBLIC struct SDL_Renderer* TCOD_context_get_sdl_renderer( + struct TCOD_Context* context) +{ + if (!context) { + TCOD_set_errorv("Context must not be NULL."); + return NULL; + } + return context->get_sdl_renderer_(context); +} +TCOD_Error TCOD_context_change_tileset( + struct TCOD_Context* context, TCOD_Tileset* tileset) +{ + if (!context) { + TCOD_set_errorv("Context must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + return context->set_tileset(context, tileset); +} +int TCOD_context_get_renderer_type(struct TCOD_Context* context) +{ + if (!context) { + TCOD_set_errorv("Context must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + return context->type; +} +TCOD_Error TCOD_context_recommended_console_size( + struct TCOD_Context* context, int* columns, int* rows) +{ + if (!context) { + TCOD_set_errorv("Context must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + if (!context->cb_recommended_console_size_) { + TCOD_set_errorv("Context is missing configuration.."); + return TCOD_E_ERROR; + } + return context->cb_recommended_console_size_(context, columns, rows); +} diff --git a/tcod_sys/libtcod/src/libtcod/context.h b/tcod_sys/libtcod/src/libtcod/context.h new file mode 100644 index 000000000..09900b8c4 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/context.h @@ -0,0 +1,196 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_CONTEXT_H_ +#define LIBTCOD_CONTEXT_H_ + +#include "config.h" +#include "context_viewport.h" +#include "console.h" +#include "error.h" +#include "tileset.h" + +struct SDL_Window; +struct SDL_Renderer; +struct SDL_Rect; +/** + * A rendering context for libtcod. + * \rst + * .. versionadded:: 1.16 + * \endrst + */ +struct TCOD_Context { + int type; + void* contextdata; + void (*destructor_)(struct TCOD_Context* self); + TCOD_Error (*present_)( + struct TCOD_Context* self, + const struct TCOD_Console* console, + const struct TCOD_ViewportOptions* viewport); + void (*pixel_to_tile_)(struct TCOD_Context* self, double* x, double* y); + TCOD_Error (*save_screenshot_)(struct TCOD_Context* self, const char* filename); + struct SDL_Window* (*get_sdl_window_)(struct TCOD_Context* self); + struct SDL_Renderer* (*get_sdl_renderer_)(struct TCOD_Context* self); + TCOD_Error (*accumulate_)( + struct TCOD_Context* self, + const struct TCOD_Console* console, + const struct TCOD_ViewportOptions* viewport); + /** + Change the tileset used by this context. + */ + TCOD_Error (*set_tileset)(struct TCOD_Context* self, TCOD_Tileset* tileset); + /** + Output the recommended console size to `columns` and `rows`. + */ + TCOD_Error (*cb_recommended_console_size_)( + struct TCOD_Context* self, int* columns, int* rows); +}; +typedef struct TCOD_Context TCOD_Context; +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +/** + * Delete a rendering context. + * \rst + * .. versionadded:: 1.16 + * \endrst + */ +TCOD_PUBLIC void TCOD_context_delete(struct TCOD_Context* renderer); +/** + * Create an uninitialized rendering context. + * + * Used internally. + */ +TCOD_NODISCARD struct TCOD_Context* TCOD_context_new_(void); +/** + Present a console to the screen, using a rendering context. + + `console` is the console to present, the console can be any size. + + `viewport` is the optional viewport options to use. + This will affect the scaling of the console with the current context. + This can be NULL to use the default options, which are to stretch the + console to fit the screen. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC TCOD_Error TCOD_context_present( + struct TCOD_Context* context, + const struct TCOD_Console* console, + const struct TCOD_ViewportOptions* viewport); +/** + Convert the screen coordinates to tile coordinates for this context. + + `x` and `y` are the pointers to the screen coordinates, these will be + converted to tile coordinates after the call to this function. + + The parameters given to the last call to `TCOD_context_present` will + determine where the tiles are for this call. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC TCOD_Error TCOD_context_screen_pixel_to_tile_d( + struct TCOD_Context* context, double* x, double* y); +/** + Convert the screen coordinates to integer tile coordinates for this context. + + Save as `TCOD_context_screen_pixel_to_tile` but the inputs and results are + integers. This is useful if you don't need sub-tile coordinates. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC TCOD_Error TCOD_context_screen_pixel_to_tile_i( + struct TCOD_Context* context, int* x, int* y); +/** + Save the last presented console to a PNG file. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC TCOD_Error TCOD_context_save_screenshot( + struct TCOD_Context* context, const char* filename); +/** + Return a pointer the SDL_Window for this context if it uses one. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC struct SDL_Window* TCOD_context_get_sdl_window( + struct TCOD_Context* context); +/** + Return a pointer the SDL_Renderer for this context if it uses one. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC struct SDL_Renderer* TCOD_context_get_sdl_renderer( + struct TCOD_Context* context); +/** + Change the active tileset for this context. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC TCOD_Error TCOD_context_change_tileset( + struct TCOD_Context* self, TCOD_Tileset* tileset); +/** + Return the `TCOD_renderer_t` renderer type for this context. + + Returns a negative number on error, such as `context` being NULL. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC int TCOD_context_get_renderer_type(struct TCOD_Context* context); +/** + Set `columns` and `rows` to the recommended console size for this context. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC TCOD_Error TCOD_context_recommended_console_size( + struct TCOD_Context* context, int* columns, int* rows); +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus +#endif // LIBTCOD_CONTEXT_H_ diff --git a/tcod_sys/libtcod/src/libtcod/context_init.c b/tcod_sys/libtcod/src/libtcod/context_init.c new file mode 100644 index 000000000..6572be673 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/context_init.c @@ -0,0 +1,172 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "context_init.h" + +#include "stdlib.h" +#include "string.h" + +#include +#include "console.h" +#include "console_etc.h" +#include "globals.h" +#include "libtcod_int.h" +#include "tileset_fallback.h" +#include "renderer_sdl2.h" +#include "renderer_gl1.h" +#include "renderer_gl2.h" + +static TCOD_Error ensure_tileset(TCOD_Tileset** tileset) +{ + if (*tileset) { return TCOD_E_OK; } + if (!TCOD_ctx.tileset) { + TCOD_console_set_custom_font( + "terminal.png", TCOD_FONT_LAYOUT_ASCII_INCOL, 0, 0); + } + if (!TCOD_ctx.tileset) { + TCOD_set_default_tileset(TCOD_tileset_load_fallback_font_(0, 12)); + } + if (!TCOD_ctx.tileset) { + TCOD_set_errorv("No font loaded and couldn't load a fallback font!"); + return TCOD_E_ERROR; + } + *tileset = TCOD_ctx.tileset; + return TCOD_E_OK; +} +/** + * Set `renderer` from the TCOD_RENDERER environment variable if it exists. + */ +static void get_env_renderer(int* renderer_type) +{ + const char* value = getenv("TCOD_RENDERER"); + if (!value) { return; } + if (strcmp(value, "sdl")) { + *renderer_type = TCOD_RENDERER_SDL; + } else if (strcmp(value, "opengl")) { + *renderer_type = TCOD_RENDERER_OPENGL; + } else if (strcmp(value, "glsl")) { + *renderer_type = TCOD_RENDERER_GLSL; + } else if (strcmp(value, "sdl2")) { + *renderer_type = TCOD_RENDERER_SDL2; + } else if (strcmp(value, "opengl2")) { + *renderer_type = TCOD_RENDERER_OPENGL2; + } +} +/** + * Set `vsync` from the TCOD_VSYNC environment variable if it exists. + */ +static void get_env_vsync(bool* vsync) +{ + const char* value = getenv("TCOD_VSYNC"); + if (!value) { return; } + if (strcmp(value, "0")) { + *vsync = 0; + } else if (strcmp(value, "1")) { + *vsync = 1; + } +} +TCOD_Error TCOD_context_new_terminal( + int columns, + int rows, + int renderer_type, + TCOD_Tileset* tileset, + bool vsync, + int sdl_window_flags, + const char* window_title, + TCOD_Context** out) +{ + get_env_renderer(&renderer_type); + get_env_vsync(&vsync); + TCOD_Error err = ensure_tileset(&tileset); + if (err < 0) { return err; } + int width = columns * tileset->tile_width; + int height = rows * tileset->tile_height; + return TCOD_context_new_window( + width, height, renderer_type, tileset, + vsync, sdl_window_flags, window_title, out); +} +TCOD_Error TCOD_context_new_window( + int pixel_width, + int pixel_height, + int renderer_type, + TCOD_Tileset* tileset, + bool vsync, + int sdl_window_flags, + const char* window_title, + TCOD_Context** out) +{ + if (!out) { + TCOD_set_errorv("Output parameter is NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + if (pixel_width < 0 || pixel_height < 0) { + TCOD_set_errorvf("Width and height must be non-negative. Not %i,%i", + pixel_width, pixel_height); + return TCOD_E_INVALID_ARGUMENT; + } + get_env_renderer(&renderer_type); + get_env_vsync(&vsync); + TCOD_Error err = ensure_tileset(&tileset); + if (err < 0) { return err; } + int renderer_flags = SDL_RENDERER_PRESENTVSYNC * vsync; + err = TCOD_E_OK; + switch (renderer_type) { + case TCOD_RENDERER_SDL: + renderer_flags |= SDL_RENDERER_SOFTWARE; + *out = TCOD_renderer_init_sdl2( + pixel_width, pixel_height, + window_title, sdl_window_flags, renderer_flags, tileset); + if (!*out) { return TCOD_E_ERROR; } + return TCOD_E_OK; + case TCOD_RENDERER_GLSL: + case TCOD_RENDERER_OPENGL2: + *out = TCOD_renderer_new_gl2( + pixel_width, pixel_height, + window_title, sdl_window_flags, vsync, tileset); + if (*out) { return err; } + err = TCOD_E_WARN; + //@fallthrough@ + case TCOD_RENDERER_OPENGL: + *out = TCOD_renderer_init_gl1( + pixel_width, pixel_height, + window_title, sdl_window_flags, vsync, tileset); + if (*out) { return err; } + err = TCOD_E_WARN; + //@fallthrough@ + default: + case TCOD_RENDERER_SDL2: + *out = TCOD_renderer_init_sdl2( + pixel_width, pixel_height, + window_title, sdl_window_flags, renderer_flags, tileset); + if (!*out) { return TCOD_E_ERROR; } + return err; + } +} diff --git a/tcod_sys/libtcod/src/libtcod/context_init.h b/tcod_sys/libtcod/src/libtcod/context_init.h new file mode 100644 index 000000000..1fe014b4c --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/context_init.h @@ -0,0 +1,107 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_CONTEXT_INIT_H_ +#define LIBTCOD_CONTEXT_INIT_H_ +#include "config.h" + +#include "stdbool.h" + +#include "context.h" +#include "error.h" +#include "tileset.h" +/** + Create a new context with the given console size. + + + Same as `TCOD_context_new_window`, but the following parameters have + different effects: + + `columns` and `rows` is the desired size of the terminal window. + The actual size of the window will be derived from this and the given + `tileset`. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC TCOD_NODISCARD TCOD_Error TCOD_context_new_terminal( + int columns, + int rows, + int renderer_type, + TCOD_Tileset* tileset, + bool vsync, + int sdl_window_flags, + const char* window_title, + TCOD_Context** out); +/** + Create a new context with a window of the given size. + + Same as `TCOD_context_new_terminal`, but the following parameters have + different effects: + + `pixel_width` and `pixel_height` are the desired size of the window in + pixels. + + `renderer_type` is a `TCOD_renderer_t` type. + + `tileset` is an optional pointer to a tileset object. + + If `vsync` is True, then vertical sync will be enabled whenever possible. + A value of true is recommended. + + `sdl_window_flags` is a bitfield of SDL_WindowFlags flags. + For a window, a value of ``SDL_WINDOW_RESIZABLE`` is recommended. + For fullscreen, a value of + ``SDL_WINDOW_RESIZABLE | SDL_WINDOW_FULLSCREEN_DESKTOP`` is recommended. + You should avoid the ``SDL_WINDOW_FULLSCREEN`` flag whenever possible. + + `window_title` is the title of the opened window. + + `out` is the output for the `TCOD_Context`, must not be NULL. + + Returns a negative error code on failure, `out` will unlikely be set in this + case. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC TCOD_NODISCARD TCOD_Error TCOD_context_new_window( + int pixel_width, + int pixel_height, + int renderer_type, + TCOD_Tileset* tileset, + bool vsync, + int sdl_window_flags, + const char* window_title, + TCOD_Context** out); +#endif // LIBTCOD_CONTEXT_INIT_H_ diff --git a/tcod_sys/libtcod/src/libtcod/context_viewport.c b/tcod_sys/libtcod/src/libtcod/context_viewport.c new file mode 100644 index 000000000..c33f16961 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/context_viewport.c @@ -0,0 +1,61 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "context_viewport.h" + +#include "stdlib.h" +#include "string.h" + +#include "error.h" + +const struct TCOD_ViewportOptions TCOD_VIEWPORT_DEFAULT_ = { + .keep_aspect = false, + .integer_scaling = false, + .clear_color = {0, 0, 0, 255}, + .align_x = 0.5f, + .align_y = 0.5f, +}; + + +TCOD_ViewportOptions* TCOD_viewport_new(void) +{ + TCOD_ViewportOptions* viewport = malloc(sizeof(*viewport)); + if (!viewport) { + TCOD_set_errorv("Could not allocate memory."); + return NULL; + } + memcpy(viewport, &TCOD_VIEWPORT_DEFAULT_, sizeof(*viewport)); + return viewport; +} +void TCOD_viewport_delete(TCOD_ViewportOptions* viewport) +{ + free(viewport); +} diff --git a/tcod_sys/libtcod/src/libtcod/context_viewport.h b/tcod_sys/libtcod/src/libtcod/context_viewport.h new file mode 100644 index 000000000..40114aed7 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/context_viewport.h @@ -0,0 +1,106 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_CONTEXT_VIEWPORT_H_ +#define LIBTCOD_CONTEXT_VIEWPORT_H_ + +#include "stdbool.h" + +#include "color.h" +/** + Viewport options for the rendering context. + \rst + .. versionadded:: 1.16 + \endrst + */ +struct TCOD_ViewportOptions { + /** + If true then the aspect ratio will be kept square when the console is + scaled. The view will be letter-boxed. + + If false the console will be stretched to fill the screen. + + Set this is true if your tileset is deigned for square pixels. + */ + bool keep_aspect; + /** + If true then console scaling will be fixed to integer increments. + + Has no effect if the console must be scaled down. + */ + bool integer_scaling; + /** + Not used. + */ + bool reserved_; + /** + The color to clear the screen with before rendering the console. + */ + TCOD_ColorRGBA clear_color; + /** + Alignment of the console when it is letter-boxed: 0.0f renders the + console in the upper-left corner, and 1.0f in the lower-right. + + Values of 0.5f will center the console. + Values outside of the range 0.0f to 1.0f are clamped. + */ + float align_x; + float align_y; +}; +typedef struct TCOD_ViewportOptions TCOD_ViewportOptions; +/** + Default viewport options if none are provided. + */ +extern const struct TCOD_ViewportOptions TCOD_VIEWPORT_DEFAULT_; +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +/** + Allocate a new viewport options struct. + + You should not allocate this struct manually since the size of it may change + between versions. + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC TCOD_NODISCARD TCOD_ViewportOptions* TCOD_viewport_new(void); +/** + Delete a viewport. + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC void TCOD_viewport_delete(TCOD_ViewportOptions* viewport); +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus +#endif // LIBTCOD_CONTEXT_VIEWPORT_H_ diff --git a/tcod_sys/libtcod/src/libtcod/error.c b/tcod_sys/libtcod/src/libtcod/error.c new file mode 100644 index 000000000..8403d1fc1 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/error.c @@ -0,0 +1,66 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "error.h" + +#include +#include +#include + +// Define __thread for MSVC. +#if !defined(__thread) && defined(_MSC_VER) +#define __thread __declspec(thread) +#endif + +// Maximum error length in bytes. +#define MAX_ERROR_LENGTH 1024 +static __thread char error_msg_[MAX_ERROR_LENGTH] = ""; +const char* TCOD_get_error(void) +{ + return error_msg_; +} +int TCOD_set_error(const char* msg) +{ + strncpy(error_msg_, msg, sizeof(error_msg_) - 1); + return -1; +} +int TCOD_set_errorf(const char* fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vsnprintf(error_msg_, sizeof(error_msg_) - 1, fmt, ap); + va_end(ap); + return -1; +} +void TCOD_clear_error(void) +{ + error_msg_[0] = '\0'; +} diff --git a/tcod_sys/libtcod/src/libtcod/error.h b/tcod_sys/libtcod/src/libtcod/error.h new file mode 100644 index 000000000..c0e5e348e --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/error.h @@ -0,0 +1,171 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_ENGINE_ERROR_H_ +#define LIBTCOD_ENGINE_ERROR_H_ + +#ifdef __cplusplus +#include +#include +#include +#endif // __cplusplus + +#include "config.h" +#include "version.h" +/** + * An enum of libtcod error codes. + * + * On values other than `TCOD_E_OK` you can use `TCOD_get_error()` to learn + * more information. + * \rst + * .. versionadded:: 1.16 + * \endrst + */ +typedef enum TCOD_Error { + /** + * The function completed successfully without issues. + * + * A function is successful when `(err >= 0)`. Positive values may be used + * for warnings, or for other outputs. + */ + TCOD_E_OK = 0, + /** + * The error code for generic runtime errors. + * + * The returned code my be changed in the future to something more specific. + * Use `(err < 0)` to check if the value is an error. + */ + TCOD_E_ERROR = -1, + /** + * The function failed because a given input argument was invalid. + */ + TCOD_E_INVALID_ARGUMENT = -2, + /** + * The function failed because it was unable to allocate enough memory. + */ + TCOD_E_OUT_OF_MEMORY = -3, + /** + * The function completed, but a minor issue was detected. + */ + TCOD_E_WARN = 1, +} TCOD_Error; +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +/** + * Return the last error message. If there is no error then the string will + * have a length of zero. + * + * The error state is thread specific. + * \rst + * .. versionadded:: 1.12 + * \endrst + */ +TCOD_NODISCARD +TCODLIB_API const char* TCOD_get_error(void); +/** + * Set an error message and return TCOD_E_ERROR. + * \rst + * .. versionadded:: 1.12 + * \endrst + */ +TCODLIB_API TCOD_Error TCOD_set_error(const char* msg); +/** + * Set an error message and return TCOD_E_ERROR. + * \rst + * .. versionadded:: 1.16 + * \endrst + */ +TCODLIB_FORMAT(1, 2) +TCODLIB_API TCOD_Error TCOD_set_errorf(const char* fmt, ...); +/** + * Clear a current existing error message. + * \rst + * .. versionadded:: 1.16 + * \endrst + */ +TCODLIB_API void TCOD_clear_error(void); +/** + * Set an error with version, file, and line info added to the output. + * + * Used internally. + */ +#define TCOD_set_errorv(msg) \ + TCOD_set_errorf("%s:%i\n%s", \ + TCOD_STRVERSIONNAME " " __FILE__, __LINE__, (msg)) +/** + * Format an error with version, file, and line info added to the output. + * + * Used internally. + */ +#define TCOD_set_errorvf(fmt, ...) \ + TCOD_set_errorf("%s:%i\n" fmt, \ + TCOD_STRVERSIONNAME " " __FILE__, __LINE__, __VA_ARGS__) +#ifdef __cplusplus +} // extern "C" +namespace tcod { +/** + * Set an error message and return a relevant error code, usually -1. + * + * Used internally. + */ +inline TCOD_Error set_error(const std::string& msg) +{ + return TCOD_set_errorv(msg.c_str()); +} +inline TCOD_Error set_error(const std::exception& e) +{ + return TCOD_set_errorv(e.what()); +} +/** + * Check and throw error messages. + * + * Used internally. + */ +inline int check_throw_error(int error) +{ + if (error >= 0) { return error; } + switch (error) { + case TCOD_E_ERROR: + default: + throw std::runtime_error(TCOD_get_error()); + break; + case TCOD_E_INVALID_ARGUMENT: + throw std::invalid_argument(TCOD_get_error()); + break; + } +} +inline TCOD_Error check_throw_error(TCOD_Error error) { + return static_cast(check_throw_error(static_cast(error))); +} +} // namespace tcod +#endif // __cplusplus +#endif // LIBTCOD_ENGINE_ERROR_H_ diff --git a/tcod_sys/libtcod/src/libtcod/fov.cpp b/tcod_sys/libtcod/src/libtcod/fov.cpp new file mode 100644 index 000000000..9340c4cff --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/fov.cpp @@ -0,0 +1,84 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "fov.hpp" + +TCODMap::TCODMap(int width,int height) { + data = TCOD_map_new(width,height); +} + +void TCODMap::clear(bool transparent, bool walkable) { + TCOD_map_clear(data,transparent,walkable); +} + +void TCODMap::setProperties(int x, int y, bool isTransparent, bool isWalkable) { + TCOD_map_set_properties(data,x,y,isTransparent,isWalkable); +} + +void TCODMap::copy(const TCODMap *source) { + TCOD_map_copy(source->data,data); +} + +void TCODMap::computeFov(int x, int y, int maxRadius, bool light_walls, TCOD_fov_algorithm_t algo) { + TCOD_map_compute_fov(data,x,y,maxRadius,light_walls, algo); +} + +bool TCODMap::isInFov(int x, int y) const { + return TCOD_map_is_in_fov(data,x,y) != 0; +} + +void TCODMap::setInFov(int x,int y, bool fov) { + TCOD_map_set_in_fov(data, x, y, fov); +} + +bool TCODMap::isTransparent(int x, int y) const { + return TCOD_map_is_transparent(data,x,y) != 0; +} + +bool TCODMap::isWalkable(int x, int y) const { + return TCOD_map_is_walkable(data,x,y) != 0; +} + +int TCODMap::getWidth() const { + return TCOD_map_get_width(data); +} + +int TCODMap::getHeight() const { + return TCOD_map_get_height(data); +} + +int TCODMap::getNbCells() const { + return TCOD_map_get_nb_cells(data); +} + +TCODMap::~TCODMap() { + TCOD_map_delete(data); +} diff --git a/tcod_sys/libtcod/src/libtcod/fov.h b/tcod_sys/libtcod/src/libtcod/fov.h new file mode 100644 index 000000000..e59aba3ca --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/fov.h @@ -0,0 +1,71 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_FOV_H +#define _TCOD_FOV_H + +#include "portability.h" +#include "fov_types.h" + +#ifdef __cplusplus +extern "C" { +#endif +/* allocate a new map */ +TCODLIB_API TCOD_Map *TCOD_map_new(int width, int height); +/* set all cells as solid rock (cannot see through nor walk) */ +TCODLIB_API void TCOD_map_clear(TCOD_Map *map, + bool transparent, bool walkable); +/* copy a map to another, reallocating it when needed */ +TCODLIB_API void TCOD_map_copy(const TCOD_Map *source, TCOD_Map *dest); +/* change a cell properties */ +TCODLIB_API void TCOD_map_set_properties( + TCOD_Map *map, int x, int y, bool is_transparent, bool is_walkable); +/* destroy a map */ +TCODLIB_API void TCOD_map_delete(TCOD_Map *map); + +/* calculate the field of view (potentially visible cells from player_x,player_y) */ +TCODLIB_API void TCOD_map_compute_fov( + TCOD_Map *map, int player_x, int player_y, int max_radius, + bool light_walls, TCOD_fov_algorithm_t algo); +/* check if a cell is in the last computed field of view */ +TCODLIB_API bool TCOD_map_is_in_fov(const TCOD_Map *map, int x, int y); +TCODLIB_API void TCOD_map_set_in_fov(TCOD_Map *map, int x, int y, bool fov); + +/* retrieve properties from the map */ +TCODLIB_API bool TCOD_map_is_transparent(const TCOD_Map *map, int x, int y); +TCODLIB_API bool TCOD_map_is_walkable(TCOD_Map *map, int x, int y); +TCODLIB_API int TCOD_map_get_width(const TCOD_Map *map); +TCODLIB_API int TCOD_map_get_height(const TCOD_Map *map); +TCODLIB_API int TCOD_map_get_nb_cells(const TCOD_Map *map); +#ifdef __cplusplus +} +#endif +#endif diff --git a/tcod_sys/libtcod/include/fov.hpp b/tcod_sys/libtcod/src/libtcod/fov.hpp similarity index 85% rename from tcod_sys/libtcod/include/fov.hpp rename to tcod_sys/libtcod/src/libtcod/fov.hpp index 2ea0d0f33..75cc86fe0 100644 --- a/tcod_sys/libtcod/include/fov.hpp +++ b/tcod_sys/libtcod/src/libtcod/fov.hpp @@ -1,256 +1,260 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_FOV_HPP -#define _TCOD_FOV_HPP - -#include "fov.h" - -class TCODPath; -/** - @PageName fov - @PageCategory Roguelike toolkits - @PageTitle Field of view - @PageDesc This toolkit allows one to easily calculate the potential visible set of map cells from the player position. -A cell is potentially visible if the line of sight from the player to the cell in unobstructed. - */ - -class TCODLIB_API TCODMap { - public : - /** - @PageName fov_init - @PageFather fov - @PageTitle Building the map - @FuncTitle Creating the map object - @FuncDesc First, you have to allocate a map of the same size as your dungeon. - @Cpp TCODMap::TCODMap (int width, int height) - @C TCOD_map_t TCOD_map_new (int width, int height) - @Py map_new (width, height) - @C# TCODMap::TCODMap(int width, int height) - @Param width, height The size of the map (in map cells). - */ - TCODMap(int width, int height); - - /** - @PageName fov_init - @PageFather fov - @FuncTitle Defining the cell properties - @FuncDesc Then, build your dungeon by defining which cells let the light pass (by default, all cells block the light) and which cells are walkable (by default, all cells are not-walkable). - @Cpp void TCODMap::setProperties (int x, int y, bool isTransparent, bool isWalkable) - @C void TCOD_map_set_properties (TCOD_map_t map, int x, int y, bool is_transparent, bool is_walkable) - @Py map_set_properties (map, x, y, is_transparent, is_walkable) - @C# void TCODMap::setProperties (int x, int y, bool isTransparent, bool isWalkable) - @Param map In the C version, the map handler returned by the TCOD_map_new function. - @Param x, y Coordinate of the cell that we want to update. - @Param isTransparent If true, this cell will let the light pass else it will block the light. - @Param isWalkable If true, creatures can walk true this cell (it is not a wall). - */ - void setProperties(int x,int y, bool isTransparent, bool isWalkable); - - /** - @PageName fov_init - @PageFather fov - @FuncTitle Clearing the map - @FuncDesc You can clear an existing map (setting all cells to the chosen walkable/transparent values) with: - @Cpp void TCODMap::clear (bool transparent = false, bool walkable = false) - @C void TCOD_map_clear (TCOD_map_t map, bool transparent, bool walkable) - @Py map_clear (map, transparent = False, walkable = False) - @C# - void TCODMap::clear() - void TCODMap::clear(bool transparent) - void TCODMap::clear(bool transparent, bool walkable) - @Param map In the C version, the map handler returned by the TCOD_map_new function. - @Param walkable Whether the cells should be walkable. - @Param transparent Whether the cells should be transparent. - */ - void clear(bool transparent=false, bool walkable=false); - - /** - @PageName fov_init - @PageFather fov - @FuncTitle Copying a map - @FuncDesc You can copy an existing map into another. You have to allocate the destination map first. - @Cpp void TCODMap::copy (const TCODMap * source) - @C void TCOD_map_copy (TCOD_map_t source, TCOD_map_t dest) - @Py map_copy (source, dest) - @C# void TCODMap::copy (TCODMap source) - @Param source The map containing the source data. - @Param dest In C and Python version, the map where data is copied. - @CppEx - TCODMap * map = new TCODMap(50,50); // allocate the map - map->setProperties(10,10,true,true); // set a cell as 'empty' - TCODMap * map2 = new TCODMap(10,10); // allocate another map - map2->copy(map); // copy map data into map2, reallocating it to 50x50 - @CEx - TCOD_map_t map = TCOD_map_new(50,50); - TCOD_map_t map2 = TCOD_map_new(10,10); - TCOD_map_set_properties(map,10,10,true,true); - TCOD_map_copy(map,map2); - @PyEx - map = libtcod.map_new(50,50) - map2 = libtcod.map_new(10,10) - libtcod.map_set_properties(map,10,10,True,True) - libtcod.map_copy(map,map2) - */ - void copy (const TCODMap *source); - - /** - @PageName fov_compute - @PageTitle Computing the field of view - @PageFather fov - @FuncDesc Once your map is allocated and empty cells have been defined, you can calculate the field of view with : -
typedef enum { FOV_BASIC,
-               FOV_DIAMOND,
-               FOV_SHADOW,
-               FOV_PERMISSIVE_0,FOV_PERMISSIVE_1,FOV_PERMISSIVE_2,FOV_PERMISSIVE_3,
-               FOV_PERMISSIVE_4,FOV_PERMISSIVE_5,FOV_PERMISSIVE_6,FOV_PERMISSIVE_7,FOV_PERMISSIVE_8,
-               FOV_RESTRICTIVE,
-               NB_FOV_ALGORITHMS } TCOD_fov_algorithm_t;
-            
- * FOV_BASIC : classic libtcod fov algorithm (ray casted from the player to all the cells on the submap perimeter) - * FOV_DIAMOND : based on this algorithm - * FOV_SHADOW : based on this algorithm - * FOV_PERMISSIVE_x : based on this algorithm - Permissive has a variable permissiveness parameter. You can either use the constants FOV_PERMISSIVE_x, x between 0 (the less permissive) and 8 (the more permissive), or using the macro FOV_PERMISSIVE(x). - * FOV_RESTRICTIVE : Mingos' Restrictive Precise Angle Shadowcasting (MRPAS). Original implementation here. Comparison of the algorithms : - Check this. - @Cpp void TCODMap::computeFov(int playerX,int playerY, int maxRadius=0,bool light_walls = true, TCOD_fov_algorithm_t algo = FOV_BASIC) - @C void TCOD_map_compute_fov(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls, TCOD_fov_algorithm_t algo) - @Py map_compute_fov(map, player_x, player_y, max_radius=0, light_walls=True, algo=FOV_BASIC ) - @C# - void TCODMap::computeFov(int playerX, int playerY) - void TCODMap::computeFov(int playerX, int playerY, int maxRadius) - void TCODMap::computeFov(int playerX, int playerY, int maxRadius,bool light_walls) - void TCODMap::computeFov(int playerX, int playerY, int maxRadius,bool light_walls, TCODFOVTypes algo) - @Param map In the C version, the map handler returned by the TCOD_map_new function. - @Param player_x,player_y Position of the player in the map. - 0 <= player_x < map width. - 0 <= player_y < map height. - @Param maxRadius If > 0, the fov is only computed up to maxRadius cells away from the player. Else, the range is unlimited. - @Param light_walls Whether the wall cells near ground cells in fov must be in fov too. - @Param algo FOV algorithm to use. - @CppEx - TCODMap *map = new TCODMap(50,50); // allocate the map - map->setProperties(10,10,true,true); // set a cell as 'empty' - map->computeFov(10,10); // calculate fov from the cell 10x10 (basic raycasting, unlimited range, walls lighting on) - @CEx - TCOD_map_t map = TCOD_map_new(50,50); - TCOD_map_set_properties(map,10,10,true,true); - TCOD_map_compute_fov(map,10,10,0,true,FOV_SHADOW); // using shadow casting - @PyEx - map = libtcod.map_new(50,50) - libtcod.map_set_properties(map,10,10,True,True) - libtcod.map_compute_fov(map,10,10,0,True,libtcod.FOV_PERMISSIVE(2)) - */ - void computeFov(int playerX,int playerY, int maxRadius = 0,bool light_walls = true, TCOD_fov_algorithm_t algo = FOV_BASIC); - - /** - @PageName fov_get - @PageFather fov - @PageTitle Reading fov information - @FuncTitle Checking if a cell is in fov - @FuncDesc Once your computed the field of view, you can know if a cell is visible with : - @Cpp bool TCODMap::isInFov(int x, int y) const - @C bool TCOD_map_is_in_fov(TCOD_map_t map, int x, int y) - @Py map_is_in_fov(map, x, y) - @C# bool TCODMap::isInFov(int x, int y) - @Param map In the C version, the map handler returned by the TCOD_map_new function. - @Param x,y Coordinates of the cell we want to check. - 0 <= x < map width. - 0 <= y < map height. - @CppEx - TCODMap *map = new TCODMap(50,50); // allocate the map - map->setProperties(10,10,true,true); // set a cell as 'empty' - map->computeFov(10,10); // calculate fov from the cell 10x10 - bool visible=map->isInFov(10,10); // is the cell 10x10 visible ? - @CEx - TCOD_map_t map = TCOD_map_new(50,50); - TCOD_map_set_properties(map,10,10,true,true); - TCOD_map_compute_fov(map,10,10); - bool visible = TCOD_map_is_in_fov(map,10,10); - @PyEx - map = libtcod.map_new(50,50) - libtcod.map_set_properties(map,10,10,True,True) - libtcod.map_compute_fov(map,10,10) - visible = libtcod.map_is_in_fov(map,10,10) - */ - bool isInFov(int x,int y) const; - /** - @PageName fov_get - @FuncTitle Checking a cell transparency/walkability - @FuncDesc You can also retrieve transparent/walkable information with : - @Cpp - bool TCODMap::isTransparent(int x, int y) const - bool TCODMap::isWalkable(int x, int y) const - @C - bool TCOD_map_is_transparent(TCOD_map_t map, int x, int y) - bool TCOD_map_is_walkable(TCOD_map_t map, int x, int y) - @Py - map_is_transparent(map, x, y) - map_is_walkable(map, x, y) - @C# - bool TCODMap::isTransparent(int x, int y) - bool TCODMap::isWalkable(int x, int y) - @Param map In the C version, the map handler returned by the TCOD_map_new function. - @Param x,y Coordinates of the cell we want to check. - 0 <= x < map width. - 0 <= y < map height. - */ - bool isTransparent(int x, int y) const; - bool isWalkable(int x, int y) const; - - /** - @PageName fov_get - @FuncTitle Getting the map size - @FuncDesc You can retrieve the map size with : - @Cpp - int TCODMap::getWidth() const - int TCODMap::getHeight() const - @C - int TCOD_map_get_width(TCOD_map_t map) - int TCOD_map_get_height(TCOD_map_t map) - @Py - map_get_width(map) - map_get_height(map) - @C# - int TCODMap::getWidth() - int TCODMap::getHeight() - @Param map In the C version, the map handler returned by the TCOD_map_new function. - */ - int getWidth() const; - int getHeight() const; - - virtual ~TCODMap(); - void setInFov(int x,int y, bool fov); - int getNbCells() const; - friend class TCODLIB_API TCODPath; - friend class TCODLIB_API TCODDijkstra; -// protected : - TCOD_map_t data; -}; - -#endif +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_FOV_HPP +#define _TCOD_FOV_HPP + +#include "fov.h" + +class TCODPath; +/** + @PageName fov + @PageCategory Roguelike toolkits + @PageTitle Field of view + @PageDesc This toolkit allows one to easily calculate the potential visible set of map cells from the player position. +A cell is potentially visible if the line of sight from the player to the cell in unobstructed. + */ + +class TCODLIB_API TCODMap { + public : + /** + @PageName fov_init + @PageFather fov + @PageTitle Building the map + @FuncTitle Creating the map object + @FuncDesc First, you have to allocate a map of the same size as your dungeon. + @Cpp TCODMap::TCODMap (int width, int height) + @C TCOD_map_t TCOD_map_new (int width, int height) + @Py map_new (width, height) + @C# TCODMap::TCODMap(int width, int height) + @Param width, height The size of the map (in map cells). + */ + TCODMap(int width, int height); + + /** + @PageName fov_init + @PageFather fov + @FuncTitle Defining the cell properties + @FuncDesc Then, build your dungeon by defining which cells let the light pass (by default, all cells block the light) and which cells are walkable (by default, all cells are not-walkable). + @Cpp void TCODMap::setProperties (int x, int y, bool isTransparent, bool isWalkable) + @C void TCOD_map_set_properties (TCOD_map_t map, int x, int y, bool is_transparent, bool is_walkable) + @Py map_set_properties (map, x, y, is_transparent, is_walkable) + @C# void TCODMap::setProperties (int x, int y, bool isTransparent, bool isWalkable) + @Param map In the C version, the map handler returned by the TCOD_map_new function. + @Param x, y Coordinate of the cell that we want to update. + @Param isTransparent If true, this cell will let the light pass else it will block the light. + @Param isWalkable If true, creatures can walk true this cell (it is not a wall). + */ + void setProperties(int x,int y, bool isTransparent, bool isWalkable); + + /** + @PageName fov_init + @PageFather fov + @FuncTitle Clearing the map + @FuncDesc You can clear an existing map (setting all cells to the chosen walkable/transparent values) with: + @Cpp void TCODMap::clear (bool transparent = false, bool walkable = false) + @C void TCOD_map_clear (TCOD_map_t map, bool transparent, bool walkable) + @Py map_clear (map, transparent = False, walkable = False) + @C# + void TCODMap::clear() + void TCODMap::clear(bool transparent) + void TCODMap::clear(bool transparent, bool walkable) + @Param map In the C version, the map handler returned by the TCOD_map_new function. + @Param walkable Whether the cells should be walkable. + @Param transparent Whether the cells should be transparent. + */ + void clear(bool transparent=false, bool walkable=false); + + /** + @PageName fov_init + @PageFather fov + @FuncTitle Copying a map + @FuncDesc You can copy an existing map into another. You have to allocate the destination map first. + @Cpp void TCODMap::copy (const TCODMap * source) + @C void TCOD_map_copy (TCOD_map_t source, TCOD_map_t dest) + @Py map_copy (source, dest) + @C# void TCODMap::copy (TCODMap source) + @Param source The map containing the source data. + @Param dest In C and Python version, the map where data is copied. + @CppEx + TCODMap * map = new TCODMap(50,50); // allocate the map + map->setProperties(10,10,true,true); // set a cell as 'empty' + TCODMap * map2 = new TCODMap(10,10); // allocate another map + map2->copy(map); // copy map data into map2, reallocating it to 50x50 + @CEx + TCOD_map_t map = TCOD_map_new(50,50); + TCOD_map_t map2 = TCOD_map_new(10,10); + TCOD_map_set_properties(map,10,10,true,true); + TCOD_map_copy(map,map2); + @PyEx + map = libtcod.map_new(50,50) + map2 = libtcod.map_new(10,10) + libtcod.map_set_properties(map,10,10,True,True) + libtcod.map_copy(map,map2) + */ + void copy (const TCODMap *source); + + /** + @PageName fov_compute + @PageTitle Computing the field of view + @PageFather fov + @FuncDesc Once your map is allocated and empty cells have been defined, you can calculate the field of view with : +
typedef enum { FOV_BASIC,
+               FOV_DIAMOND,
+               FOV_SHADOW,
+               FOV_PERMISSIVE_0,FOV_PERMISSIVE_1,FOV_PERMISSIVE_2,FOV_PERMISSIVE_3,
+               FOV_PERMISSIVE_4,FOV_PERMISSIVE_5,FOV_PERMISSIVE_6,FOV_PERMISSIVE_7,FOV_PERMISSIVE_8,
+               FOV_RESTRICTIVE,
+               NB_FOV_ALGORITHMS } TCOD_fov_algorithm_t;
+            
+ * FOV_BASIC : classic libtcod fov algorithm (ray casted from the player to all the cells on the submap perimeter) + * FOV_DIAMOND : based on this algorithm + * FOV_SHADOW : based on this algorithm + * FOV_PERMISSIVE_x : based on this algorithm + Permissive has a variable permissiveness parameter. You can either use the constants FOV_PERMISSIVE_x, x between 0 (the less permissive) and 8 (the more permissive), or using the macro FOV_PERMISSIVE(x). + * FOV_RESTRICTIVE : Mingos' Restrictive Precise Angle Shadowcasting (MRPAS). Original implementation here. Comparison of the algorithms : + Check this. + @Cpp void TCODMap::computeFov(int playerX,int playerY, int maxRadius=0,bool light_walls = true, TCOD_fov_algorithm_t algo = FOV_BASIC) + @C void TCOD_map_compute_fov(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls, TCOD_fov_algorithm_t algo) + @Py map_compute_fov(map, player_x, player_y, max_radius=0, light_walls=True, algo=FOV_BASIC ) + @C# + void TCODMap::computeFov(int playerX, int playerY) + void TCODMap::computeFov(int playerX, int playerY, int maxRadius) + void TCODMap::computeFov(int playerX, int playerY, int maxRadius,bool light_walls) + void TCODMap::computeFov(int playerX, int playerY, int maxRadius,bool light_walls, TCODFOVTypes algo) + @Param map In the C version, the map handler returned by the TCOD_map_new function. + @Param player_x,player_y Position of the player in the map. + 0 <= player_x < map width. + 0 <= player_y < map height. + @Param maxRadius If > 0, the fov is only computed up to maxRadius cells away from the player. Else, the range is unlimited. + @Param light_walls Whether the wall cells near ground cells in fov must be in fov too. + @Param algo FOV algorithm to use. + @CppEx + TCODMap *map = new TCODMap(50,50); // allocate the map + map->setProperties(10,10,true,true); // set a cell as 'empty' + map->computeFov(10,10); // calculate fov from the cell 10x10 (basic raycasting, unlimited range, walls lighting on) + @CEx + TCOD_map_t map = TCOD_map_new(50,50); + TCOD_map_set_properties(map,10,10,true,true); + TCOD_map_compute_fov(map,10,10,0,true,FOV_SHADOW); // using shadow casting + @PyEx + map = libtcod.map_new(50,50) + libtcod.map_set_properties(map,10,10,True,True) + libtcod.map_compute_fov(map,10,10,0,True,libtcod.FOV_PERMISSIVE(2)) + */ + void computeFov(int playerX,int playerY, int maxRadius = 0,bool light_walls = true, TCOD_fov_algorithm_t algo = FOV_BASIC); + + /** + @PageName fov_get + @PageFather fov + @PageTitle Reading fov information + @FuncTitle Checking if a cell is in fov + @FuncDesc Once your computed the field of view, you can know if a cell is visible with : + @Cpp bool TCODMap::isInFov(int x, int y) const + @C bool TCOD_map_is_in_fov(TCOD_map_t map, int x, int y) + @Py map_is_in_fov(map, x, y) + @C# bool TCODMap::isInFov(int x, int y) + @Param map In the C version, the map handler returned by the TCOD_map_new function. + @Param x,y Coordinates of the cell we want to check. + 0 <= x < map width. + 0 <= y < map height. + @CppEx + TCODMap *map = new TCODMap(50,50); // allocate the map + map->setProperties(10,10,true,true); // set a cell as 'empty' + map->computeFov(10,10); // calculate fov from the cell 10x10 + bool visible=map->isInFov(10,10); // is the cell 10x10 visible ? + @CEx + TCOD_map_t map = TCOD_map_new(50,50); + TCOD_map_set_properties(map,10,10,true,true); + TCOD_map_compute_fov(map,10,10); + bool visible = TCOD_map_is_in_fov(map,10,10); + @PyEx + map = libtcod.map_new(50,50) + libtcod.map_set_properties(map,10,10,True,True) + libtcod.map_compute_fov(map,10,10) + visible = libtcod.map_is_in_fov(map,10,10) + */ + bool isInFov(int x,int y) const; + /** + @PageName fov_get + @FuncTitle Checking a cell transparency/walkability + @FuncDesc You can also retrieve transparent/walkable information with : + @Cpp + bool TCODMap::isTransparent(int x, int y) const + bool TCODMap::isWalkable(int x, int y) const + @C + bool TCOD_map_is_transparent(TCOD_map_t map, int x, int y) + bool TCOD_map_is_walkable(TCOD_map_t map, int x, int y) + @Py + map_is_transparent(map, x, y) + map_is_walkable(map, x, y) + @C# + bool TCODMap::isTransparent(int x, int y) + bool TCODMap::isWalkable(int x, int y) + @Param map In the C version, the map handler returned by the TCOD_map_new function. + @Param x,y Coordinates of the cell we want to check. + 0 <= x < map width. + 0 <= y < map height. + */ + bool isTransparent(int x, int y) const; + bool isWalkable(int x, int y) const; + + /** + @PageName fov_get + @FuncTitle Getting the map size + @FuncDesc You can retrieve the map size with : + @Cpp + int TCODMap::getWidth() const + int TCODMap::getHeight() const + @C + int TCOD_map_get_width(TCOD_map_t map) + int TCOD_map_get_height(TCOD_map_t map) + @Py + map_get_width(map) + map_get_height(map) + @C# + int TCODMap::getWidth() + int TCODMap::getHeight() + @Param map In the C version, the map handler returned by the TCOD_map_new function. + */ + int getWidth() const; + int getHeight() const; + + virtual ~TCODMap(); + void setInFov(int x,int y, bool fov); + int getNbCells() const; + friend class TCODLIB_API TCODPath; + friend class TCODLIB_API TCODDijkstra; +// protected : + TCOD_map_t data; +}; + +#endif diff --git a/tcod_sys/libtcod/src/libtcod/fov_c.c b/tcod_sys/libtcod/src/libtcod/fov_c.c new file mode 100644 index 000000000..7c6f85882 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/fov_c.c @@ -0,0 +1,208 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "fov.h" + +#include +#include + +#include "libtcod_int.h" +/** + * Return a new TCOD_Map with `width` and `height`. + */ +struct TCOD_Map *TCOD_map_new(int width, int height) { + if (width <= 0 || height <= 0) { return NULL; } + struct TCOD_Map* map = calloc(sizeof(*map), 1); + map->width = width; + map->height = height; + map->nbcells = width * height; + map->cells = calloc(sizeof(*map->cells), map->nbcells); + return map; +} +/** + * Clone map data from `source` to `dest`. + * + * `dest` will be resized to match `source` if necessary. + */ +void TCOD_map_copy(const struct TCOD_Map *source, struct TCOD_Map *dest) { + if (!source || !dest) { return; } + if (dest->nbcells != source->nbcells) { + free(dest->cells); + dest->cells = malloc(sizeof(*dest->cells) * dest->nbcells); + } + dest->width = source->width; + dest->height = source->height; + dest->nbcells = source->nbcells; + memcpy(dest->cells, source->cells, sizeof(*dest->cells) * source->nbcells); +} +/** + * Set all cell values on `map` to the given parameters. + * + * This call also zeroes out the field of view flag. + */ +void TCOD_map_clear(struct TCOD_Map *map, bool transparent, bool walkable) { + int i; + if (!map) { return; } + for (i = 0; i < map->nbcells; ++i) { + map->cells[i].transparent = transparent; + map->cells[i].walkable = walkable; + map->cells[i].fov = 0; + } +} +/** + * Return true if `x` and `y` are in the boundaries of `map`. + * + * Returns false if `map` is NULL. + */ +static int TCOD_map_in_bounds(const struct TCOD_Map *map, int x, int y) { + return map && 0 <= x && x < map->width && 0 <= y && y < map->height; +} +/** + * Set the properties of a single cell. + */ +void TCOD_map_set_properties(struct TCOD_Map *map, int x, int y, + bool is_transparent, bool is_walkable) { + if (!TCOD_map_in_bounds(map, x, y)) { return; } + map->cells[x + y * map->width].transparent = is_transparent; + map->cells[x + y * map->width].walkable = is_walkable; +} +/** + * Free all memory belonging to `map`. + */ +void TCOD_map_delete(struct TCOD_Map *map) { + if (!map) { return; } + free(map->cells); + free(map); +} +/** + * Calculate the field-of-view. + * + * \rst + * `player_x` and `player_y` are the used as the field-of-view source. + * These coordinates must be within the map. + * + * `max_radius` is the maximum distance for the field-of-view algorithm. + * + * If `light_walls` is false then only transparent cells will be touched by + * the field-of-view. + * + * `algo` is one of the :any:`TCOD_fov_algorithm_t` algorithms. + * + * After this call you may check if a cell is within the field-of-view by + * calling :any:`TCOD_map_is_in_fov`. + * \endrst + */ +void TCOD_map_compute_fov(struct TCOD_Map *map, int player_x, int player_y, + int max_radius, bool light_walls, + TCOD_fov_algorithm_t algo) { + if (!map) { return; } + if (!TCOD_map_in_bounds(map, player_x, player_y)) { return; } + switch(algo) { + case FOV_BASIC: + TCOD_map_compute_fov_circular_raycasting(map, player_x, player_y, + max_radius, light_walls); + return; + case FOV_DIAMOND: + TCOD_map_compute_fov_diamond_raycasting(map, player_x, player_y, + max_radius, light_walls); + return; + case FOV_SHADOW: + TCOD_map_compute_fov_recursive_shadowcasting(map, player_x, player_y, + max_radius, light_walls); + return; + case FOV_PERMISSIVE_0: + case FOV_PERMISSIVE_1: + case FOV_PERMISSIVE_2: + case FOV_PERMISSIVE_3: + case FOV_PERMISSIVE_4: + case FOV_PERMISSIVE_5: + case FOV_PERMISSIVE_6: + case FOV_PERMISSIVE_7: + case FOV_PERMISSIVE_8: + TCOD_map_compute_fov_permissive2(map, player_x, player_y, max_radius, + light_walls, algo - FOV_PERMISSIVE_0); + return; + case FOV_RESTRICTIVE: + TCOD_map_compute_fov_restrictive_shadowcasting(map, player_x, player_y, + max_radius, light_walls); + return; + default: return; + } +} +/** + * Return true if this cell was touched by the current field-of-view. + */ +bool TCOD_map_is_in_fov(const struct TCOD_Map *map, int x, int y) { + if (!TCOD_map_in_bounds(map, x, y)) { return 0; } + return map->cells[x + y * map->width].fov; +} +/** + * Set the fov flag on a specific cell. + */ +void TCOD_map_set_in_fov(struct TCOD_Map *map, int x, int y, bool fov) { + if (!TCOD_map_in_bounds(map, x, y)) { return; } + map->cells[x + y * map->width].fov = fov; +} +/** + * Return true if this cell is transparent. + */ +bool TCOD_map_is_transparent(const struct TCOD_Map *map, int x, int y) { + if (!TCOD_map_in_bounds(map, x, y)) { return 0; } + return map->cells[x + y * map->width].transparent; +} +/** + * Return true if this cell is walkable. + */ +bool TCOD_map_is_walkable(struct TCOD_Map *map, int x, int y) { + if (!TCOD_map_in_bounds(map, x, y)) { return 0; } + return map->cells[x + y * map->width].walkable; +} +/** + * Return the width of `map`. + */ +int TCOD_map_get_width(const struct TCOD_Map *map) { + if (!map) { return 0; } + return map->width; +} +/** + * Return the height of `map`. + */ +int TCOD_map_get_height(const struct TCOD_Map *map) { + if (!map) { return 0; } + return map->height; +} +/** + * Return the total number of cells in `map`. + */ +int TCOD_map_get_nb_cells(const struct TCOD_Map *map) { + if (!map) { return 0; } + return map->nbcells; +} diff --git a/tcod_sys/libtcod/src/fov_circular_raycasting.c b/tcod_sys/libtcod/src/libtcod/fov_circular_raycasting.c similarity index 72% rename from tcod_sys/libtcod/src/fov_circular_raycasting.c rename to tcod_sys/libtcod/src/libtcod/fov_circular_raycasting.c index aafb3c7bc..c82ed746a 100644 --- a/tcod_sys/libtcod/src/fov_circular_raycasting.c +++ b/tcod_sys/libtcod/src/libtcod/fov_circular_raycasting.c @@ -1,240 +1,244 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include - -#include -#include -#include - -static void cast_ray(map_t *map, int xo, int yo, int xd, int yd, int r2,bool light_walls) { - int curx=xo,cury=yo; - bool in=false; - bool blocked=false; - bool end=false; - int offset; - TCOD_bresenham_data_t bresenham_data; - TCOD_line_init_mt(xo,yo,xd,yd,&bresenham_data); - offset=curx+cury*map->width; - if ( 0 <= offset && offset < map->nbcells ) { - in=true; - map->cells[offset].fov=1; - } - while (!end) { - end = TCOD_line_step_mt(&curx,&cury,&bresenham_data); /* reached xd,yd */ - offset=curx+cury*map->width; - if ( r2 > 0 ) { - /* check radius */ - int cur_radius=(curx-xo)*(curx-xo)+(cury-yo)*(cury-yo); - if ( cur_radius > r2 ) return; - } - if ( 0 <= offset && offset < map->nbcells ) { - in=true; - if ( !blocked && ! map->cells[offset].transparent ) { - blocked=true; - } else if ( blocked ) { - return; /* wall */ - } - if ( light_walls || ! blocked ) map->cells[offset].fov=1; - } else if (in) return; /* ray out of map */ - } -} - -void TCOD_map_postproc(map_t *map,int x0,int y0, int x1, int y1, int dx, int dy) { - int cx,cy; - for (cx=x0; cx <= x1; cx++) { - for (cy=y0;cy <= y1; cy ++ ) { - int x2 = cx+dx; - int y2 = cy+dy; - unsigned int offset=cx+cy*map->width; - if ( offset < (unsigned)map->nbcells && map->cells[offset].fov == 1 - && map->cells[offset].transparent ) { - if ( x2 >= x0 && x2 <= x1 ) { - unsigned int offset2=x2+cy*map->width; - if ( offset2 < (unsigned)map->nbcells && ! map->cells[offset2].transparent ) - map->cells[offset2].fov=1; - } - if ( y2 >= y0 && y2 <= y1 ) { - unsigned int offset2=cx+y2*map->width; - if ( offset2 < (unsigned)map->nbcells && ! map->cells[offset2].transparent ) - map->cells[offset2].fov=1; - } - if ( x2 >= x0 && x2 <= x1 && y2 >= y0 && y2 <= y1 ) { - unsigned int offset2=x2+y2*map->width; - if ( offset2 < (unsigned)map->nbcells && ! map->cells[offset2].transparent ) - map->cells[offset2].fov=1; - } - } - } - } -} - - -void TCOD_map_compute_fov_circular_raycastingi(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls) { - int xo,yo; - map_t *m = (map_t *)map; - /* circular ray casting */ - int xmin=0, ymin=0, xmax=m->width, ymax=m->height; - int c; - int r2=max_radius*max_radius; - if ( max_radius > 0 ) { - xmin=MAX(0,player_x-max_radius); - ymin=MAX(0,player_y-max_radius); - xmax=MIN(m->width,player_x+max_radius+1); - ymax=MIN(m->height,player_y+max_radius+1); - } - for (c=m->nbcells-1; c >= 0; c--) { - m->cells[c].fov=0; - } - xo=xmin; yo=ymin; - while ( xo < xmax ) { - cast_ray(m,player_x,player_y,xo++,yo,r2,light_walls); - } - xo=xmax-1;yo=ymin+1; - while ( yo < ymax ) { - cast_ray(m,player_x,player_y,xo,yo++,r2,light_walls); - } - xo=xmax-2;yo=ymax-1; - while ( xo >= 0 ) { - cast_ray(m,player_x,player_y,xo--,yo,r2,light_walls); - } - xo=xmin;yo=ymax-2; - while ( yo > 0 ) { - cast_ray(m,player_x,player_y,xo,yo--,r2,light_walls); - } - if ( light_walls ) { - /* post-processing artefact fix */ - TCOD_map_postproc(m,xmin,ymin,player_x,player_y,-1,-1); - TCOD_map_postproc(m,player_x,ymin,xmax-1,player_y,1,-1); - TCOD_map_postproc(m,xmin,player_y,player_x,ymax-1,-1,1); - TCOD_map_postproc(m,player_x,player_y,xmax-1,ymax-1,1,1); - } -} - -#if 0 -#define CELL_RADIUS 0.4f -#define RAY_RADIUS 0.2f -static bool ray_blocked(map_t *map,float x, float y, int cx, int cy) { - int offset=cx+cy*map->width; - float d; - if ( (unsigned)offset >= (unsigned)map->nbcells ) return false; /* out of the map */ - if ( map->cells[offset].transparent ) return false; /* empty cell */ - d=(cx-x+0.5f)*(cx-x+0.5f)+(cy-y+0.5f)*(cy-y+0.5f); - return d < (CELL_RADIUS+RAY_RADIUS)*(CELL_RADIUS+RAY_RADIUS); -} -static void cast_rayf(map_t *map, int xo, int yo, int xd, int yd, int r2,bool light_walls) { - float fxo=xo+0.5f, fyo=yo+0.5f; - float curx=fxo, cury=fyo; - float fxd=xd+0.5f; - float fyd=yd+0.5f; - bool in=false; - bool end=false; - int offset; - float dx=(float)(fxd-curx), dy=(float)(fyd-cury),idx,idy; - if ( dx == 0 && dy == 0 ) return; - if ( fabs(dx) > fabs(dy) ) { - idy = (float)(dy/fabs(dx)); - idx = (float)(dx/fabs(dx)); - } else { - idx = (float)(dx/fabs(dy)); - idy = (float)(dy/fabs(dy)); - } - offset=(int)(curx)+(int)(cury)*map->width; - if ( (unsigned)offset < (unsigned)map->nbcells ) { - in=true; - map->cells[offset].fov=1; - } - while (!end) { - int cx,cy; - curx+=idx; - cury+=idy; - cx=(int)curx; - cy=(int)cury; - end = (cx==xd && cy==yd); - offset=cx+cy*map->width; - if ( r2 > 0 ) { - /* check radius */ - int cur_radius=(int)((curx-fxo)*(curx-fxo)+(cury-fyo)*(cury-fyo)); - if ( cur_radius > r2 ) return; - } - if ( (unsigned)offset < (unsigned)map->nbcells ) { - in=true; - if ( ray_blocked(map,curx,cury,cx,cy) ) return; - if ( curx+RAY_RADIUS > cx+0.5f-CELL_RADIUS && ray_blocked(map,curx,cury,cx+1,cy) ) return; - if ( curx-RAY_RADIUS < cx-0.5f+CELL_RADIUS && ray_blocked(map,curx,cury,cx-1,cy) ) return; - if ( cury+RAY_RADIUS > cy+0.5f-CELL_RADIUS && ray_blocked(map,curx,cury,cx,cy+1) ) return; - if ( cury-RAY_RADIUS < cy-0.5f+CELL_RADIUS && ray_blocked(map,curx,cury,cx,cy-1) ) return; - map->cells[offset].fov=1; - } else if (in) return; /* ray out of map */ - } -} -#endif - -void TCOD_map_compute_fov_circular_raycasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls) { - int xo,yo; - map_t *m = (map_t *)map; - /* circular ray casting */ - int xmin=0, ymin=0, xmax=m->width, ymax=m->height; - int c; - int r2=max_radius*max_radius; - if ( max_radius > 0 ) { - xmin=MAX(0,player_x-max_radius); - ymin=MAX(0,player_y-max_radius); - xmax=MIN(m->width,player_x+max_radius+1); - ymax=MIN(m->height,player_y+max_radius+1); - } - for (c=m->nbcells-1; c >= 0; c--) { - m->cells[c].fov=0; - } - xo=xmin; yo=ymin; - while ( xo < xmax ) { - cast_ray(m,player_x,player_y,xo++,yo,r2,light_walls); - } - xo=xmax-1;yo=ymin+1; - while ( yo < ymax ) { - cast_ray(m,player_x,player_y,xo,yo++,r2,light_walls); - } - xo=xmax-2;yo=ymax-1; - while ( xo >= 0 ) { - cast_ray(m,player_x,player_y,xo--,yo,r2,light_walls); - } - xo=xmin;yo=ymax-2; - while ( yo > 0 ) { - cast_ray(m,player_x,player_y,xo,yo--,r2,light_walls); - } - if ( light_walls ) { - /* post-processing artefact fix */ - TCOD_map_postproc(m,xmin,ymin,player_x,player_y,-1,-1); - TCOD_map_postproc(m,player_x,ymin,xmax-1,player_y,1,-1); - TCOD_map_postproc(m,xmin,player_y,player_x,ymax-1,-1,1); - TCOD_map_postproc(m,player_x,player_y,xmax-1,ymax-1,1,1); - } -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "fov.h" + +#include +#include +#include + +#include "bresenham.h" +#include "libtcod_int.h" +#include "utility.h" + +static void cast_ray(struct TCOD_Map *map, int xo, int yo, int xd, int yd, int r2,bool light_walls) { + int curx=xo,cury=yo; + bool in=false; + bool blocked=false; + bool end=false; + int offset; + TCOD_bresenham_data_t bresenham_data; + TCOD_line_init_mt(xo,yo,xd,yd,&bresenham_data); + offset=curx+cury*map->width; + if ( 0 <= offset && offset < map->nbcells ) { + in=true; + map->cells[offset].fov=1; + } + while (!end) { + end = TCOD_line_step_mt(&curx,&cury,&bresenham_data); /* reached xd,yd */ + offset=curx+cury*map->width; + if ( r2 > 0 ) { + /* check radius */ + int cur_radius=(curx-xo)*(curx-xo)+(cury-yo)*(cury-yo); + if ( cur_radius > r2 ) return; + } + if ( 0 <= offset && offset < map->nbcells ) { + in=true; + if ( !blocked && ! map->cells[offset].transparent ) { + blocked=true; + } else if ( blocked ) { + return; /* wall */ + } + if ( light_walls || ! blocked ) map->cells[offset].fov=1; + } else if (in) return; /* ray out of map */ + } +} + +void TCOD_map_postproc(struct TCOD_Map *map,int x0,int y0, int x1, int y1, int dx, int dy) { + int cx,cy; + for (cx=x0; cx <= x1; cx++) { + for (cy=y0;cy <= y1; cy ++ ) { + int x2 = cx+dx; + int y2 = cy+dy; + unsigned int offset=cx+cy*map->width; + if ( offset < (unsigned)map->nbcells && map->cells[offset].fov == 1 + && map->cells[offset].transparent ) { + if ( x2 >= x0 && x2 <= x1 ) { + unsigned int offset2=x2+cy*map->width; + if ( offset2 < (unsigned)map->nbcells && ! map->cells[offset2].transparent ) + map->cells[offset2].fov=1; + } + if ( y2 >= y0 && y2 <= y1 ) { + unsigned int offset2=cx+y2*map->width; + if ( offset2 < (unsigned)map->nbcells && ! map->cells[offset2].transparent ) + map->cells[offset2].fov=1; + } + if ( x2 >= x0 && x2 <= x1 && y2 >= y0 && y2 <= y1 ) { + unsigned int offset2=x2+y2*map->width; + if ( offset2 < (unsigned)map->nbcells && ! map->cells[offset2].transparent ) + map->cells[offset2].fov=1; + } + } + } + } +} + + +void TCOD_map_compute_fov_circular_raycastingi(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls) { + int xo,yo; + struct TCOD_Map *m = (struct TCOD_Map *)map; + /* circular ray casting */ + int xmin=0, ymin=0, xmax=m->width, ymax=m->height; + int c; + int r2=max_radius*max_radius; + if ( max_radius > 0 ) { + xmin=MAX(0,player_x-max_radius); + ymin=MAX(0,player_y-max_radius); + xmax=MIN(m->width,player_x+max_radius+1); + ymax=MIN(m->height,player_y+max_radius+1); + } + for (c=m->nbcells-1; c >= 0; c--) { + m->cells[c].fov=0; + } + xo=xmin; yo=ymin; + while ( xo < xmax ) { + cast_ray(m,player_x,player_y,xo++,yo,r2,light_walls); + } + xo=xmax-1;yo=ymin+1; + while ( yo < ymax ) { + cast_ray(m,player_x,player_y,xo,yo++,r2,light_walls); + } + xo=xmax-2;yo=ymax-1; + while ( xo >= 0 ) { + cast_ray(m,player_x,player_y,xo--,yo,r2,light_walls); + } + xo=xmin;yo=ymax-2; + while ( yo > 0 ) { + cast_ray(m,player_x,player_y,xo,yo--,r2,light_walls); + } + if ( light_walls ) { + /* post-processing artefact fix */ + TCOD_map_postproc(m,xmin,ymin,player_x,player_y,-1,-1); + TCOD_map_postproc(m,player_x,ymin,xmax-1,player_y,1,-1); + TCOD_map_postproc(m,xmin,player_y,player_x,ymax-1,-1,1); + TCOD_map_postproc(m,player_x,player_y,xmax-1,ymax-1,1,1); + } +} + +#if 0 +#define CELL_RADIUS 0.4f +#define RAY_RADIUS 0.2f +static bool ray_blocked(struct TCOD_Map *map,float x, float y, int cx, int cy) { + int offset=cx+cy*map->width; + float d; + if ( (unsigned)offset >= (unsigned)map->nbcells ) return false; /* out of the map */ + if ( map->cells[offset].transparent ) return false; /* empty cell */ + d=(cx-x+0.5f)*(cx-x+0.5f)+(cy-y+0.5f)*(cy-y+0.5f); + return d < (CELL_RADIUS+RAY_RADIUS)*(CELL_RADIUS+RAY_RADIUS); +} +static void cast_rayf(struct TCOD_Map *map, int xo, int yo, int xd, int yd, int r2,bool light_walls) { + float fxo=xo+0.5f, fyo=yo+0.5f; + float curx=fxo, cury=fyo; + float fxd=xd+0.5f; + float fyd=yd+0.5f; + bool in=false; + bool end=false; + int offset; + float dx=(float)(fxd-curx), dy=(float)(fyd-cury),idx,idy; + if ( dx == 0 && dy == 0 ) return; + if ( fabs(dx) > fabs(dy) ) { + idy = (float)(dy/fabs(dx)); + idx = (float)(dx/fabs(dx)); + } else { + idx = (float)(dx/fabs(dy)); + idy = (float)(dy/fabs(dy)); + } + offset=(int)(curx)+(int)(cury)*map->width; + if ( (unsigned)offset < (unsigned)map->nbcells ) { + in=true; + map->cells[offset].fov=1; + } + while (!end) { + int cx,cy; + curx+=idx; + cury+=idy; + cx=(int)curx; + cy=(int)cury; + end = (cx==xd && cy==yd); + offset=cx+cy*map->width; + if ( r2 > 0 ) { + /* check radius */ + int cur_radius=(int)((curx-fxo)*(curx-fxo)+(cury-fyo)*(cury-fyo)); + if ( cur_radius > r2 ) return; + } + if ( (unsigned)offset < (unsigned)map->nbcells ) { + in=true; + if ( ray_blocked(map,curx,cury,cx,cy) ) return; + if ( curx+RAY_RADIUS > cx+0.5f-CELL_RADIUS && ray_blocked(map,curx,cury,cx+1,cy) ) return; + if ( curx-RAY_RADIUS < cx-0.5f+CELL_RADIUS && ray_blocked(map,curx,cury,cx-1,cy) ) return; + if ( cury+RAY_RADIUS > cy+0.5f-CELL_RADIUS && ray_blocked(map,curx,cury,cx,cy+1) ) return; + if ( cury-RAY_RADIUS < cy-0.5f+CELL_RADIUS && ray_blocked(map,curx,cury,cx,cy-1) ) return; + map->cells[offset].fov=1; + } else if (in) return; /* ray out of map */ + } +} +#endif + +void TCOD_map_compute_fov_circular_raycasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls) { + int xo,yo; + struct TCOD_Map *m = (struct TCOD_Map *)map; + /* circular ray casting */ + int xmin=0, ymin=0, xmax=m->width, ymax=m->height; + int c; + int r2=max_radius*max_radius; + if ( max_radius > 0 ) { + xmin=MAX(0,player_x-max_radius); + ymin=MAX(0,player_y-max_radius); + xmax=MIN(m->width,player_x+max_radius+1); + ymax=MIN(m->height,player_y+max_radius+1); + } + for (c=m->nbcells-1; c >= 0; c--) { + m->cells[c].fov=0; + } + xo=xmin; yo=ymin; + while ( xo < xmax ) { + cast_ray(m,player_x,player_y,xo++,yo,r2,light_walls); + } + xo=xmax-1;yo=ymin+1; + while ( yo < ymax ) { + cast_ray(m,player_x,player_y,xo,yo++,r2,light_walls); + } + xo=xmax-2;yo=ymax-1; + while ( xo >= 0 ) { + cast_ray(m,player_x,player_y,xo--,yo,r2,light_walls); + } + xo=xmin;yo=ymax-2; + while ( yo > 0 ) { + cast_ray(m,player_x,player_y,xo,yo--,r2,light_walls); + } + if ( light_walls ) { + /* post-processing artefact fix */ + TCOD_map_postproc(m,xmin,ymin,player_x,player_y,-1,-1); + TCOD_map_postproc(m,player_x,ymin,xmax-1,player_y,1,-1); + TCOD_map_postproc(m,xmin,player_y,player_x,ymax-1,-1,1); + TCOD_map_postproc(m,player_x,player_y,xmax-1,ymax-1,1,1); + } +} diff --git a/tcod_sys/libtcod/src/libtcod/fov_diamond_raycasting.c b/tcod_sys/libtcod/src/libtcod/fov_diamond_raycasting.c new file mode 100644 index 000000000..4ff355ce5 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/fov_diamond_raycasting.c @@ -0,0 +1,230 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "fov.h" + +#include +#include + +#include "libtcod_int.h" +#include "utility.h" + +typedef struct _ray_data_t { + int xloc,yloc; /* position */ + int xob,yob; /* obscurity vector */ + int xerr,yerr; /* bresenham error */ + struct _ray_data_t * xinput, * yinput; /* offset of input rays */ + bool added; /* already in the fov */ + bool ignore; /* non visible. don't bother processing it */ +} ray_data_t; + +static int ray_length_sq(ray_data_t *ray) { + return (ray->xloc * ray->xloc) + (ray->yloc * ray->yloc); +} + +typedef struct _fov_t { + struct TCOD_Map* map; + TCOD_list_t perim; + + int origx, origy; /* fov origin */ + ray_data_t **raymap; /* result rays */ + ray_data_t *raymap2; /* temporary rays */ +} fov_t; + +static ray_data_t *new_ray(fov_t *fov, int rx, int ry) { + struct TCOD_Map* map = fov->map; + const int x = fov->origx + rx; + const int y = fov->origy + ry; + + if ( x < 0 || y < 0 ) return NULL; + if ( x >= map->width ) return NULL; + if ( y >= map->height ) return NULL; + + ray_data_t *r = &fov->raymap2[x + (y * map->width)]; + r->xloc = rx; + r->yloc = ry; + return r; +} + +static void processRay(fov_t* fov, ray_data_t *new_ray, ray_data_t *input_ray) { + if ( new_ray ) { + const int mapx = fov->origx + new_ray->xloc; + const int mapy = fov->origy + new_ray->yloc; + const int newrayidx = mapx + (mapy * fov->map->width); + if ( new_ray->yloc == input_ray->yloc ) { + new_ray->xinput = input_ray; + } else { + new_ray->yinput = input_ray; + } + if (! new_ray->added) { + TCOD_list_push(fov->perim, new_ray); + new_ray->added = true; + fov->raymap[newrayidx] = new_ray; + } + } +} + +static bool is_obscure(ray_data_t *r) { + return (r->xerr > 0 && r->xerr <= r->xob) || (r->yerr > 0 && r->yerr <= r->yob); +} + + +static void process_x_input(ray_data_t *new_ray, ray_data_t *xinput) { + if ( xinput->xob == 0 && xinput->yob == 0 ) return; + if ( xinput->xerr > 0 && new_ray->xob == 0) { + new_ray->xerr = xinput->xerr - xinput->yob; + new_ray->yerr = xinput->yerr + xinput->yob; + new_ray->xob=xinput->xob; + new_ray->yob=xinput->yob; + } + if ( xinput->yerr <= 0 && xinput->yob > 0 && xinput->xerr > 0) { + new_ray->yerr = xinput->yerr + xinput->yob; + new_ray->xerr = xinput->xerr - xinput->yob; + new_ray->xob=xinput->xob; + new_ray->yob=xinput->yob; + } +} + +static void process_y_input(ray_data_t *new_ray, ray_data_t *yinput) { + if ( yinput->xob == 0 && yinput->yob == 0 ) return; + if ( yinput->yerr > 0 && new_ray->yob == 0) { + new_ray->yerr = yinput->yerr - yinput->xob; + new_ray->xerr = yinput->xerr + yinput->xob; + new_ray->xob=yinput->xob; + new_ray->yob=yinput->yob; + } + if ( yinput->xerr <= 0 && yinput->xob > 0 && yinput->yerr > 0) { + new_ray->yerr = yinput->yerr - yinput->xob; + new_ray->xerr = yinput->xerr + yinput->xob; + new_ray->xob=yinput->xob; + new_ray->yob=yinput->yob; + } +} + +static void merge_input(fov_t *fov, ray_data_t *r) { + TCOD_Map* map = fov->map; + const int x = r->xloc + fov->origx; + const int y = r->yloc + fov->origy; + const int rayidx = x + y*map->width; + + ray_data_t *xi = r->xinput; + ray_data_t *yi = r->yinput; + if ( xi ) process_x_input(r,xi); + if ( yi ) process_y_input(r,yi); + if ( ! xi ) { + if ( is_obscure(yi) ) r->ignore=true; + } else if ( ! yi ) { + if ( is_obscure(xi) ) r->ignore=true; + } else if ( is_obscure(xi) && is_obscure(yi) ) { + r->ignore=true; + } + if ( !r->ignore && !map->cells[rayidx].transparent) { + r->xerr = r->xob = ABS(r->xloc); + r->yerr = r->yob = ABS(r->yloc); + } +} + +static void expandPerimeterFrom(fov_t* fov, ray_data_t *r) { + const int rx = r->xloc; + const int ry = r->yloc; + if ( rx >= 0 ) { + processRay(fov, new_ray(fov, rx+1, ry), r); + } + if ( rx <= 0 ) { + processRay(fov, new_ray(fov, rx-1, ry), r); + } + if ( ry >= 0 ) { + processRay(fov, new_ray(fov, rx, ry+1), r); + } + if ( ry <= 0 ) { + processRay(fov, new_ray(fov, rx, ry-1), r); + } +} + + +void TCOD_map_compute_fov_diamond_raycasting(TCOD_map_t m, int player_x, int player_y, int max_radius, bool light_walls) { + const int radius_sq = max_radius*max_radius; + const int nbcells = m->nbcells; + + fov_t fov; + fov.map = m; + fov.perim = TCOD_list_allocate(nbcells); + + fov.origx = player_x; + fov.origy = player_y; + fov.raymap = calloc(sizeof(*fov.raymap), nbcells); + fov.raymap2 = calloc(sizeof(*fov.raymap2), nbcells); + + expandPerimeterFrom(&fov, new_ray(&fov,0,0)); + + for (int perimidx = 0; perimidx < TCOD_list_size(fov.perim); perimidx++) { + ray_data_t *ray = (ray_data_t *)TCOD_list_get(fov.perim, perimidx); + if ( radius_sq == 0 || ray_length_sq(ray) <= radius_sq ) { + merge_input(&fov, ray); + if (!ray->ignore) expandPerimeterFrom(&fov, ray); + } else { + ray->ignore = true; + } + } + + /* set fov data */ + for (int i = 0; i != nbcells; ++i) { + struct TCOD_MapCell *cell = &m->cells[i]; + ray_data_t *ray = fov.raymap[i]; + + cell->fov = false; + if (ray == NULL) continue; + if (ray->ignore) continue; + if (ray->xerr > 0 && ray->xerr <= ray->xob) continue; + if (ray->yerr > 0 && ray->yerr <= ray->yob) continue; + cell->fov = true; + } + m->cells[player_x + player_y*m->width].fov = true; + + /* light walls */ + if ( light_walls ) { + int xmin=0, ymin=0, xmax=m->width, ymax=m->height; + if ( max_radius > 0 ) { + xmin=MAX(0,player_x-max_radius); + ymin=MAX(0,player_y-max_radius); + xmax=MIN(m->width,player_x+max_radius+1); + ymax=MIN(m->height,player_y+max_radius+1); + } + TCOD_map_postproc(m,xmin,ymin,player_x,player_y,-1,-1); + TCOD_map_postproc(m,player_x,ymin,xmax-1,player_y,1,-1); + TCOD_map_postproc(m,xmin,player_y,player_x,ymax-1,-1,1); + TCOD_map_postproc(m,player_x,player_y,xmax-1,ymax-1,1,1); + } + + free(fov.raymap); + free(fov.raymap2); + TCOD_list_delete(fov.perim); +} diff --git a/tcod_sys/libtcod/src/fov_permissive2.c b/tcod_sys/libtcod/src/libtcod/fov_permissive2.c similarity index 74% rename from tcod_sys/libtcod/src/fov_permissive2.c rename to tcod_sys/libtcod/src/libtcod/fov_permissive2.c index 3d9f96bc6..bd1b6a534 100644 --- a/tcod_sys/libtcod/src/fov_permissive2.c +++ b/tcod_sys/libtcod/src/libtcod/fov_permissive2.c @@ -1,256 +1,260 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include - -#include -#include - -/* The size of each square in units */ -#define STEP_SIZE 16 - -/* Jonathon Duerig enhanced permissive FOV */ -typedef struct { - int xi,yi,xf,yf; -} line_t; - -/* Defines the parameters of the permissiveness */ -/* Derived values defining the actual part of the square used as a range. */ -static int offset; -static int limit; - -typedef struct _viewbump_t { - int x,y; - int refcount; - struct _viewbump_t *parent; -} viewbump_t; - -typedef struct { - line_t shallow_line; - line_t steep_line; - viewbump_t *shallow_bump; - viewbump_t *steep_bump; -} view_t; - -static view_t **current_view=NULL; -static view_t *views=NULL; -static viewbump_t *bumps=NULL; -static int bumpidx=0; - -#define RELATIVE_SLOPE(l,x,y) (((l)->yf-(l)->yi)*((l)->xf-(x)) - ((l)->xf-(l)->xi)*((l)->yf-(y))) -#define BELOW(l,x,y) (RELATIVE_SLOPE(l,x,y) > 0) -#define BELOW_OR_COLINEAR(l,x,y) (RELATIVE_SLOPE(l,x,y) >= 0) -#define ABOVE(l,x,y) (RELATIVE_SLOPE(l,x,y) < 0) -#define ABOVE_OR_COLINEAR(l,x,y) (RELATIVE_SLOPE(l,x,y) <= 0) -#define COLINEAR(l,x,y) (RELATIVE_SLOPE(l,x,y) == 0) -#define LINE_COLINEAR(l,l2) (COLINEAR(l,(l2)->xi,(l2)->yi) && COLINEAR(l,(l2)->xf,(l2)->yf)) - -static bool is_blocked(map_t *map, view_t *view, int startX, int startY, int x, int y, int dx, int dy, bool light_walls) { - int posx=x*dx/STEP_SIZE+startX; - int posy=y*dy/STEP_SIZE+startY; - int offset=posx + (posy)*map->width; - bool blocked=!map->cells[offset].transparent; - if (! blocked || light_walls) map->cells[offset].fov=1; - return blocked; -} - -static void add_shallow_bump(int x, int y, view_t *view) { - viewbump_t *shallow, *curbump; - view->shallow_line.xf=x; - view->shallow_line.yf=y; - shallow= &bumps[bumpidx++]; - shallow->x=x; - shallow->y=y; - shallow->parent=view->shallow_bump; - view->shallow_bump=shallow; - curbump=view->steep_bump; - while ( curbump ) { - if ( ABOVE(&view->shallow_line,curbump->x,curbump->y)) { - view->shallow_line.xi=curbump->x; - view->shallow_line.yi=curbump->y; - } - curbump=curbump->parent; - } -} - -static void add_steep_bump(int x, int y, view_t *view) { - viewbump_t *steep, *curbump; - view->steep_line.xf=x; - view->steep_line.yf=y; - steep=&bumps[bumpidx++]; - steep->x=x; - steep->y=y; - steep->parent=view->steep_bump; - view->steep_bump=steep; - curbump=view->shallow_bump; - while ( curbump ) { - if ( BELOW(&view->steep_line,curbump->x,curbump->y)) { - view->steep_line.xi=curbump->x; - view->steep_line.yi=curbump->y; - } - curbump=curbump->parent; - } -} - -static bool check_view(TCOD_list_t active_views, view_t **it) { - view_t *view=*it; - line_t *shallow_line=&view->shallow_line; - line_t *steep_line=&view->steep_line; - if (LINE_COLINEAR(shallow_line,steep_line) - && (COLINEAR(shallow_line,offset,limit) - || COLINEAR(shallow_line,limit,offset)) ){ -/*printf ("deleting view %x\n",it); */ - /* slow ! */ - TCOD_list_remove_iterator(active_views,(void **)it); - return false; - } - return true; -} - -static void visit_coords(map_t *m,int startX, int startY, int x, int y, int dx, int dy, - TCOD_list_t active_views, bool light_walls) { - /* top left */ - int tlx=x, tly=y+STEP_SIZE; - /* bottom right */ - int brx=x+STEP_SIZE, bry=y; - view_t *view=NULL; - while (current_view != (view_t **)TCOD_list_end(active_views)) { - view=*current_view; - if ( ! BELOW_OR_COLINEAR(&view->steep_line,brx,bry) ) { - break; - } - current_view++; - } - if ( current_view == (view_t **)TCOD_list_end(active_views) || ABOVE_OR_COLINEAR(&view->shallow_line,tlx,tly)) { - /* no more active view */ - return; - } - if ( !is_blocked(m,view,startX,startY,x,y,dx,dy,light_walls) ) return; - if ( ABOVE(&view->shallow_line,brx,bry) - && BELOW(&view->steep_line,tlx,tly)) { - /* view blocked */ - /* slow ! */ - TCOD_list_remove_iterator(active_views,(void **)current_view); - } else if ( ABOVE(&view->shallow_line,brx,bry)) { - /* shallow bump */ - add_shallow_bump(tlx,tly,view); - check_view(active_views,current_view); - } else if (BELOW(&view->steep_line,tlx,tly)) { - /* steep bump */ - add_steep_bump(brx,bry,view); - check_view(active_views,current_view); - } else { - /* view split */ - int offset=startX+x*dx/STEP_SIZE + (startY+y*dy/STEP_SIZE)*m->width; - view_t *shallower_view= & views[offset]; - int view_index=(int)(current_view - (view_t **)TCOD_list_begin(active_views)); - view_t **shallower_view_it; - view_t **steeper_view_it; - *shallower_view=**current_view; - /* slow ! */ - shallower_view_it = (view_t **)TCOD_list_insert_before(active_views,shallower_view,view_index); - steeper_view_it=shallower_view_it+1; - current_view=shallower_view_it; - add_steep_bump(brx,bry,shallower_view); - if (!check_view(active_views,shallower_view_it)) steeper_view_it--; - add_shallow_bump(tlx,tly,*steeper_view_it); - check_view(active_views,steeper_view_it); - if ( view_index > TCOD_list_size(active_views)) current_view=(view_t **)TCOD_list_end(active_views); - } -} - -static void check_quadrant(map_t *m,int startX,int startY,int dx, int dy, int extentX,int extentY, bool light_walls) { - TCOD_list_t active_views=TCOD_list_new(); - line_t shallow_line={offset,limit,extentX*STEP_SIZE,0}; - line_t steep_line={limit,offset,0,extentY*STEP_SIZE}; - int maxI=extentX+extentY,i=1; - view_t *view= &views[startX+startY*m->width]; - - view->shallow_line=shallow_line; - view->steep_line=steep_line; - view->shallow_bump=NULL; - view->steep_bump=NULL; - TCOD_list_push(active_views,view); - current_view=(view_t **)TCOD_list_begin(active_views); - while ( i != maxI+1 && ! TCOD_list_is_empty(active_views) ) { - int startJ=MAX(i-extentX,0); - int maxJ=MIN(i,extentY); - int j=startJ; - while ( j != maxJ+1 && ! TCOD_list_is_empty(active_views) && current_view != (view_t **)TCOD_list_end(active_views) ) { - int x=(i - j)*STEP_SIZE; - int y=j*STEP_SIZE; - visit_coords(m,startX,startY,x,y,dx,dy,active_views, light_walls); - j++; - } - i++; - current_view=(view_t **)TCOD_list_begin(active_views); - } - TCOD_list_delete(active_views); -} - -void TCOD_map_compute_fov_permissive2(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls, int fovType) { - int c,minx,maxx,miny,maxy; - map_t *m = (map_t *)map; - if ( (unsigned)fovType>8 ) TCOD_fatal("Bad permissiveness %d for FOV_PERMISSIVE. Accepted range is [0,8].\n",fovType); - offset=8-fovType; - limit=8+fovType; - /* clean the map */ - for (c=m->nbcells-1; c >= 0; c--) { - m->cells[c].fov=0; - } - m->cells[player_x+player_y*m->width].fov=1; - /* preallocate views and bumps */ - views=(view_t *)calloc(sizeof(view_t),m->width*m->height); - bumps=(viewbump_t *)calloc(sizeof(viewbump_t),m->width*m->height); - /* set the fov range */ - if ( max_radius > 0 ) { - minx=MIN(player_x,max_radius); - maxx=MIN(m->width-player_x-1,max_radius); - miny=MIN(player_y,max_radius); - maxy=MIN(m->height-player_y-1,max_radius); - } else { - minx=player_x; - maxx=m->width-player_x-1; - miny=player_y; - maxy=m->height-player_y-1; - } - /* calculate fov. precise permissive field of view */ - bumpidx=0; - check_quadrant(m,player_x,player_y,1,1,maxx,maxy, light_walls); - bumpidx=0; - check_quadrant(m,player_x,player_y,1,-1,maxx,miny, light_walls); - bumpidx=0; - check_quadrant(m,player_x,player_y,-1,-1,minx,miny, light_walls); - bumpidx=0; - check_quadrant(m,player_x,player_y,-1,1,minx,maxy, light_walls); - free(bumps); - free(views); -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "fov.h" + +#include +#include +#include + +#include "libtcod_int.h" +#include "utility.h" + +/* The size of each square in units */ +#define STEP_SIZE 16 + +/* Jonathon Duerig enhanced permissive FOV */ +typedef struct { + int xi,yi,xf,yf; +} line_t; + +/* Defines the parameters of the permissiveness */ +/* Derived values defining the actual part of the square used as a range. */ +static int offset; +static int limit; + +typedef struct _viewbump_t { + int x,y; + int refcount; + struct _viewbump_t *parent; +} viewbump_t; + +typedef struct { + line_t shallow_line; + line_t steep_line; + viewbump_t *shallow_bump; + viewbump_t *steep_bump; +} view_t; + +static view_t **current_view=NULL; +static view_t *views=NULL; +static viewbump_t *bumps=NULL; +static int bumpidx=0; + +#define RELATIVE_SLOPE(l,x,y) (((l)->yf-(l)->yi)*((l)->xf-(x)) - ((l)->xf-(l)->xi)*((l)->yf-(y))) +#define BELOW(l,x,y) (RELATIVE_SLOPE(l,x,y) > 0) +#define BELOW_OR_COLINEAR(l,x,y) (RELATIVE_SLOPE(l,x,y) >= 0) +#define ABOVE(l,x,y) (RELATIVE_SLOPE(l,x,y) < 0) +#define ABOVE_OR_COLINEAR(l,x,y) (RELATIVE_SLOPE(l,x,y) <= 0) +#define COLINEAR(l,x,y) (RELATIVE_SLOPE(l,x,y) == 0) +#define LINE_COLINEAR(l,l2) (COLINEAR(l,(l2)->xi,(l2)->yi) && COLINEAR(l,(l2)->xf,(l2)->yf)) + +static bool is_blocked(struct TCOD_Map *map, view_t *view, int startX, int startY, int x, int y, int dx, int dy, bool light_walls) { + int posx=x*dx/STEP_SIZE+startX; + int posy=y*dy/STEP_SIZE+startY; + int offset=posx + (posy)*map->width; + bool blocked=!map->cells[offset].transparent; + if (! blocked || light_walls) map->cells[offset].fov=1; + return blocked; +} + +static void add_shallow_bump(int x, int y, view_t *view) { + viewbump_t *shallow, *curbump; + view->shallow_line.xf=x; + view->shallow_line.yf=y; + shallow= &bumps[bumpidx++]; + shallow->x=x; + shallow->y=y; + shallow->parent=view->shallow_bump; + view->shallow_bump=shallow; + curbump=view->steep_bump; + while ( curbump ) { + if ( ABOVE(&view->shallow_line,curbump->x,curbump->y)) { + view->shallow_line.xi=curbump->x; + view->shallow_line.yi=curbump->y; + } + curbump=curbump->parent; + } +} + +static void add_steep_bump(int x, int y, view_t *view) { + viewbump_t *steep, *curbump; + view->steep_line.xf=x; + view->steep_line.yf=y; + steep=&bumps[bumpidx++]; + steep->x=x; + steep->y=y; + steep->parent=view->steep_bump; + view->steep_bump=steep; + curbump=view->shallow_bump; + while ( curbump ) { + if ( BELOW(&view->steep_line,curbump->x,curbump->y)) { + view->steep_line.xi=curbump->x; + view->steep_line.yi=curbump->y; + } + curbump=curbump->parent; + } +} + +static bool check_view(TCOD_list_t active_views, view_t **it) { + view_t *view=*it; + line_t *shallow_line=&view->shallow_line; + line_t *steep_line=&view->steep_line; + if (LINE_COLINEAR(shallow_line,steep_line) + && (COLINEAR(shallow_line,offset,limit) + || COLINEAR(shallow_line,limit,offset)) ){ +/*printf ("deleting view %x\n",it); */ + /* slow ! */ + TCOD_list_remove_iterator(active_views,(void **)it); + return false; + } + return true; +} + +static void visit_coords(struct TCOD_Map *m,int startX, int startY, int x, int y, int dx, int dy, + TCOD_list_t active_views, bool light_walls) { + /* top left */ + int tlx=x, tly=y+STEP_SIZE; + /* bottom right */ + int brx=x+STEP_SIZE, bry=y; + view_t *view=NULL; + while (current_view != (view_t **)TCOD_list_end(active_views)) { + view=*current_view; + if ( ! BELOW_OR_COLINEAR(&view->steep_line,brx,bry) ) { + break; + } + current_view++; + } + if ( current_view == (view_t **)TCOD_list_end(active_views) || ABOVE_OR_COLINEAR(&view->shallow_line,tlx,tly)) { + /* no more active view */ + return; + } + if ( !is_blocked(m,view,startX,startY,x,y,dx,dy,light_walls) ) return; + if ( ABOVE(&view->shallow_line,brx,bry) + && BELOW(&view->steep_line,tlx,tly)) { + /* view blocked */ + /* slow ! */ + TCOD_list_remove_iterator(active_views,(void **)current_view); + } else if ( ABOVE(&view->shallow_line,brx,bry)) { + /* shallow bump */ + add_shallow_bump(tlx,tly,view); + check_view(active_views,current_view); + } else if (BELOW(&view->steep_line,tlx,tly)) { + /* steep bump */ + add_steep_bump(brx,bry,view); + check_view(active_views,current_view); + } else { + /* view split */ + int offset=startX+x*dx/STEP_SIZE + (startY+y*dy/STEP_SIZE)*m->width; + view_t *shallower_view= & views[offset]; + int view_index=(int)(current_view - (view_t **)TCOD_list_begin(active_views)); + view_t **shallower_view_it; + view_t **steeper_view_it; + *shallower_view=**current_view; + /* slow ! */ + shallower_view_it = (view_t **)TCOD_list_insert_before(active_views,shallower_view,view_index); + steeper_view_it=shallower_view_it+1; + current_view=shallower_view_it; + add_steep_bump(brx,bry,shallower_view); + if (!check_view(active_views,shallower_view_it)) steeper_view_it--; + add_shallow_bump(tlx,tly,*steeper_view_it); + check_view(active_views,steeper_view_it); + if ( view_index > TCOD_list_size(active_views)) current_view=(view_t **)TCOD_list_end(active_views); + } +} + +static void check_quadrant(struct TCOD_Map *m,int startX,int startY,int dx, int dy, int extentX,int extentY, bool light_walls) { + TCOD_list_t active_views=TCOD_list_new(); + line_t shallow_line={offset,limit,extentX*STEP_SIZE,0}; + line_t steep_line={limit,offset,0,extentY*STEP_SIZE}; + int maxI=extentX+extentY,i=1; + view_t *view= &views[startX+startY*m->width]; + + view->shallow_line=shallow_line; + view->steep_line=steep_line; + view->shallow_bump=NULL; + view->steep_bump=NULL; + TCOD_list_push(active_views,view); + current_view=(view_t **)TCOD_list_begin(active_views); + while ( i != maxI+1 && ! TCOD_list_is_empty(active_views) ) { + int startJ=MAX(i-extentX,0); + int maxJ=MIN(i,extentY); + int j=startJ; + while ( j != maxJ+1 && ! TCOD_list_is_empty(active_views) && current_view != (view_t **)TCOD_list_end(active_views) ) { + int x=(i - j)*STEP_SIZE; + int y=j*STEP_SIZE; + visit_coords(m,startX,startY,x,y,dx,dy,active_views, light_walls); + j++; + } + i++; + current_view=(view_t **)TCOD_list_begin(active_views); + } + TCOD_list_delete(active_views); +} + +void TCOD_map_compute_fov_permissive2(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls, int fovType) { + int c,minx,maxx,miny,maxy; + struct TCOD_Map *m = (struct TCOD_Map *)map; + if ( (unsigned)fovType>8 ) TCOD_fatal("Bad permissiveness %d for FOV_PERMISSIVE. Accepted range is [0,8].\n",fovType); + offset=8-fovType; + limit=8+fovType; + /* clean the map */ + for (c=m->nbcells-1; c >= 0; c--) { + m->cells[c].fov=0; + } + m->cells[player_x+player_y*m->width].fov=1; + /* preallocate views and bumps */ + views = calloc(sizeof(*views), m->width * m->height); + bumps = calloc(sizeof(*bumps), m->width * m->height); + /* set the fov range */ + if ( max_radius > 0 ) { + minx=MIN(player_x,max_radius); + maxx=MIN(m->width-player_x-1,max_radius); + miny=MIN(player_y,max_radius); + maxy=MIN(m->height-player_y-1,max_radius); + } else { + minx=player_x; + maxx=m->width-player_x-1; + miny=player_y; + maxy=m->height-player_y-1; + } + /* calculate fov. precise permissive field of view */ + bumpidx=0; + check_quadrant(m,player_x,player_y,1,1,maxx,maxy, light_walls); + bumpidx=0; + check_quadrant(m,player_x,player_y,1,-1,maxx,miny, light_walls); + bumpidx=0; + check_quadrant(m,player_x,player_y,-1,-1,minx,miny, light_walls); + bumpidx=0; + check_quadrant(m,player_x,player_y,-1,1,minx,maxy, light_walls); + free(bumps); + free(views); +} diff --git a/tcod_sys/libtcod/src/fov_recursive_shadowcasting.c b/tcod_sys/libtcod/src/libtcod/fov_recursive_shadowcasting.c similarity index 52% rename from tcod_sys/libtcod/src/fov_recursive_shadowcasting.c rename to tcod_sys/libtcod/src/libtcod/fov_recursive_shadowcasting.c index 2814e9652..d26c4c316 100644 --- a/tcod_sys/libtcod/src/fov_recursive_shadowcasting.c +++ b/tcod_sys/libtcod/src/libtcod/fov_recursive_shadowcasting.c @@ -1,108 +1,112 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include - -#include -#include - -static int mult[4][8]= { - {1,0,0,-1,-1,0,0,1}, - {0,1,-1,0,0,-1,1,0}, - {0,1,1,0,0,-1,-1,0}, - {1,0,0,1,-1,0,0,-1}, -}; - -static void cast_light(map_t *map,int cx, int cy,int row,float start, float end, int radius, int r2, - int xx, int xy, int yx, int yy, int id, bool light_walls) { - int j; - float new_start=0.0f; - if ( start < end ) return; - for (j=row; j< radius+1; j++) { - int dx=-j-1; - int dy=-j; - bool blocked=false; - while ( dx <= 0 ) { - int X,Y; - dx++; - X=cx+dx*xx+dy*xy; - Y=cy+dx*yx+dy*yy; - if ((unsigned)X < (unsigned)map->width && (unsigned)Y < (unsigned)map->height) { - float l_slope,r_slope; - int offset; - offset=X+Y*map->width; - l_slope=(dx-0.5f)/(dy+0.5f); - r_slope=(dx+0.5f)/(dy-0.5f); - if( start < r_slope ) continue; - else if( end > l_slope ) break; - if ( dx*dx+dy*dy <= r2 - && (light_walls || map->cells[offset].transparent)) map->cells[offset].fov=1; - if ( blocked ) { - if (!map->cells[offset].transparent) { - new_start=r_slope; - continue; - } else { - blocked=false; - start=new_start; - } - } else { - if (!map->cells[offset].transparent && j < radius ) { - blocked=true; - cast_light(map,cx,cy,j+1,start,l_slope,radius,r2,xx,xy,yx,yy,id+1,light_walls); - new_start=r_slope; - } - } - } - } - if ( blocked ) break; - } -} - -void TCOD_map_compute_fov_recursive_shadowcasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls) { - int oct,c,r2; - map_t *m = (map_t *)map; - /* clean the map */ - for (c=m->nbcells-1; c >= 0; c--) { - m->cells[c].fov=0; - } - if ( max_radius == 0 ) { - int max_radius_x=m->width-player_x; - int max_radius_y=m->height-player_y; - max_radius_x=MAX(max_radius_x,player_x); - max_radius_y=MAX(max_radius_y,player_y); - max_radius = (int)(sqrt(max_radius_x*max_radius_x+max_radius_y*max_radius_y))+1; - } - r2=max_radius*max_radius; - /* recursive shadow casting */ - for (oct=0; oct < 8; oct++) cast_light(m,player_x,player_y,1,1.0,0.0,max_radius,r2, - mult[0][oct],mult[1][oct],mult[2][oct],mult[3][oct],0,light_walls); - m->cells[player_x+player_y*m->width].fov=1; -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "fov.h" + +#include +#include +#include + +#include "libtcod_int.h" +#include "utility.h" + +static int mult[4][8]= { + {1,0,0,-1,-1,0,0,1}, + {0,1,-1,0,0,-1,1,0}, + {0,1,1,0,0,-1,-1,0}, + {1,0,0,1,-1,0,0,-1}, +}; + +static void cast_light(struct TCOD_Map *map,int cx, int cy,int row,float start, float end, int radius, int r2, + int xx, int xy, int yx, int yy, int id, bool light_walls) { + int j; + float new_start=0.0f; + if ( start < end ) return; + for (j=row; j< radius+1; j++) { + int dx=-j-1; + int dy=-j; + bool blocked=false; + while ( dx <= 0 ) { + int X,Y; + dx++; + X=cx+dx*xx+dy*xy; + Y=cy+dx*yx+dy*yy; + if ((unsigned)X < (unsigned)map->width && (unsigned)Y < (unsigned)map->height) { + float l_slope,r_slope; + int offset; + offset=X+Y*map->width; + l_slope=(dx-0.5f)/(dy+0.5f); + r_slope=(dx+0.5f)/(dy-0.5f); + if( start < r_slope ) continue; + else if( end > l_slope ) break; + if ( dx*dx+dy*dy <= r2 + && (light_walls || map->cells[offset].transparent)) map->cells[offset].fov=1; + if ( blocked ) { + if (!map->cells[offset].transparent) { + new_start=r_slope; + continue; + } else { + blocked=false; + start=new_start; + } + } else { + if (!map->cells[offset].transparent && j < radius ) { + blocked=true; + cast_light(map,cx,cy,j+1,start,l_slope,radius,r2,xx,xy,yx,yy,id+1,light_walls); + new_start=r_slope; + } + } + } + } + if ( blocked ) break; + } +} + +void TCOD_map_compute_fov_recursive_shadowcasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls) { + int oct,c,r2; + struct TCOD_Map *m = (struct TCOD_Map *)map; + /* clean the map */ + for (c=m->nbcells-1; c >= 0; c--) { + m->cells[c].fov=0; + } + if ( max_radius == 0 ) { + int max_radius_x=m->width-player_x; + int max_radius_y=m->height-player_y; + max_radius_x=MAX(max_radius_x,player_x); + max_radius_y=MAX(max_radius_y,player_y); + max_radius = (int)(sqrt(max_radius_x*max_radius_x+max_radius_y*max_radius_y))+1; + } + r2=max_radius*max_radius; + /* recursive shadow casting */ + for (oct=0; oct < 8; oct++) cast_light(m,player_x,player_y,1,1.0,0.0,max_radius,r2, + mult[0][oct],mult[1][oct],mult[2][oct],mult[3][oct],0,light_walls); + m->cells[player_x+player_y*m->width].fov=1; +} diff --git a/tcod_sys/libtcod/src/fov_restrictive.c b/tcod_sys/libtcod/src/libtcod/fov_restrictive.c similarity index 68% rename from tcod_sys/libtcod/src/fov_restrictive.c rename to tcod_sys/libtcod/src/libtcod/fov_restrictive.c index 277484fc1..e0e289afa 100644 --- a/tcod_sys/libtcod/src/fov_restrictive.c +++ b/tcod_sys/libtcod/src/libtcod/fov_restrictive.c @@ -1,295 +1,295 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/* -* Mingos' Restrictive Precise Angle Shadowcasting (MRPAS) v1.2 -*/ -#include - -#include /* for NULL in VS */ - -#include -#include - -/* angle ranges */ -double * start_angle = NULL; -double * end_angle = NULL; -/* number of allocated angle pairs */ -int allocated = 0; - -void TCOD_map_compute_fov_restrictive_shadowcasting_quadrant (map_t *m, int player_x, int player_y, int max_radius, bool light_walls, int dx, int dy) { - /* octant: vertical edge */ - { - int iteration = 1; /* iteration of the algo for this octant */ - bool done = false; - int total_obstacles = 0; - int obstacles_in_last_line = 0; - double min_angle = 0.0; - int x; - int y; - - /* do while there are unblocked slopes left and the algo is within the map's boundaries - scan progressive lines/columns from the PC outwards */ - y = player_y+dy; /* the outer slope's coordinates (first processed line) */ - if (y < 0 || y >= m->height) { - done = true; - } - while (!done) { - /* process cells in the line */ - double slopes_per_cell = 1.0 / (double)(iteration); - double half_slopes = slopes_per_cell * 0.5; - int processed_cell = (int)((min_angle + half_slopes) / slopes_per_cell); - int minx = MAX(0, player_x - iteration); - int maxx = MIN(m->width - 1, player_x + iteration); - done = true; - for (x = player_x + (processed_cell * dx); x >= minx && x <= maxx; x+=dx) { - int c = x + (y * m->width); - /* calculate slopes per cell */ - bool visible = true; - bool extended = false; - double centre_slope = (double)processed_cell * slopes_per_cell; - double start_slope = centre_slope - half_slopes; - double end_slope = centre_slope + half_slopes; - if (obstacles_in_last_line > 0) { - if ( - !( - m->cells[c-(m->width * dy)].fov && - m->cells[c-(m->width * dy)].transparent - ) && - !( - m->cells[c-(m->width * dy) - dx].fov && - m->cells[c-(m->width * dy) - dx].transparent - ) - ) { - visible = false; - } else { - int idx; - for (idx = 0; idx < obstacles_in_last_line && visible; ++idx) { - if ( - start_slope <= end_angle[idx] && - end_slope >= start_angle[idx] - ) { - if (m->cells[c].transparent) { - if ( - centre_slope > start_angle[idx] && - centre_slope < end_angle[idx] - ) { - visible = false; - } - } else { - if ( - start_slope >= start_angle[idx] && - end_slope <= end_angle[idx] - ) { - visible = false; - } else { - start_angle[idx] = MIN(start_angle[idx], start_slope); - end_angle[idx] = MAX(end_angle[idx], end_slope); - extended = true; - } - } - } - } - } - } - if (visible) { - done = false; - m->cells[c].fov = true; - /* if the cell is opaque, block the adjacent slopes */ - if (!m->cells[c].transparent) { - if (min_angle >= start_slope) { - min_angle = end_slope; - /* if min_angle is applied to the last cell in line, nothing more - needs to be checked. */ - if (processed_cell == iteration) { - done = true; - } - } else if (!extended) { - start_angle[total_obstacles] = start_slope; - end_angle[total_obstacles++] = end_slope; - } - if (!light_walls) { - m->cells[c].fov = false; - } - } - } - processed_cell++; - } - if (iteration == max_radius) { - done = true; - } - iteration++; - obstacles_in_last_line = total_obstacles; - y += dy; - if (y < 0 || y >= m->height) { - done = true; - } - } - } - - /* octant: horizontal edge */ - { - int iteration = 1; /* iteration of the algo for this octant */ - bool done = false; - int total_obstacles = 0; - int obstacles_in_last_line = 0; - double min_angle = 0.0; - int x; - int y; - - /* do while there are unblocked slopes left and the algo is within the map's boundaries - scan progressive lines/columns from the PC outwards */ - x = player_x+dx; /*the outer slope's coordinates (first processed line) */ - if (x < 0 || x >= m->width) { - done = true; - } - while (!done) { - /* process cells in the line */ - double slopes_per_cell = 1.0 / (double)(iteration); - double half_slopes = slopes_per_cell * 0.5; - int processed_cell = (int)((min_angle + half_slopes) / slopes_per_cell); - int miny = MAX(0, player_y - iteration); - int maxy = MIN(m->height - 1, player_y + iteration); - done = true; - for (y = player_y + (processed_cell * dy); y >= miny && y <= maxy; y += dy) { - int c = x + (y * m->width); - /* calculate slopes per cell */ - bool visible = true; - bool extended = false; - double centre_slope = (double)processed_cell * slopes_per_cell; - double start_slope = centre_slope - half_slopes; - double end_slope = centre_slope + half_slopes; - if (obstacles_in_last_line > 0) { - if ( - !( - m->cells[c-dx].fov && - m->cells[c-dx].transparent - ) && - !( - m->cells[c-(m->width * dy) - dx].fov && - m->cells[c-(m->width * dy) - dx].transparent - ) - ) { - visible = false; - } else { - int idx; - for (idx = 0; idx < obstacles_in_last_line && visible; ++idx) { - if ( - start_slope <= end_angle[idx] && - end_slope >= start_angle[idx] - ) { - if (m->cells[c].transparent) { - if ( - centre_slope > start_angle[idx] && - centre_slope < end_angle[idx] - ) { - visible = false; - } - } else { - if ( - start_slope >= start_angle[idx] && - end_slope <= end_angle[idx] - ) { - visible = false; - } else { - start_angle[idx] = MIN(start_angle[idx], start_slope); - end_angle[idx] = MAX(end_angle[idx], end_slope); - extended = true; - } - } - ++idx; - } - } - } - } - if (visible) { - done = false; - m->cells[c].fov = true; - /* if the cell is opaque, block the adjacent slopes */ - if (!m->cells[c].transparent) { - if (min_angle >= start_slope) { - min_angle = end_slope; - /* if min_angle is applied to the last cell in line, nothing more - needs to be checked. */ - if (processed_cell == iteration) { - done = true; - } - } else if (!extended) { - start_angle[total_obstacles] = start_slope; - end_angle[total_obstacles++] = end_slope; - } - if (!light_walls) { - m->cells[c].fov = false; - } - } - } - processed_cell++; - } - if (iteration == max_radius) { - done = true; - } - iteration++; - obstacles_in_last_line = total_obstacles; - x += dx; - if (x < 0 || x >= m->width) { - done = true; - } - } - } -} - -void TCOD_map_compute_fov_restrictive_shadowcasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls) { - map_t *m = (map_t *)map; - int max_obstacles; - int c; - - /* first, zero the FOV map */ - for(c = m->nbcells - 1; c >= 0; c--) { - m->cells[c].fov = false; - } - - /* calculate an approximated (excessive, just in case) maximum number of obstacles per octant */ - max_obstacles = m->nbcells / 7; - - /* check memory for angles */ - if (max_obstacles > allocated) { - allocated = max_obstacles; - if (start_angle != NULL) free(start_angle); - if (end_angle != NULL) free(end_angle); - start_angle = (double*)calloc(max_obstacles, sizeof(double)); - end_angle = (double*)calloc(max_obstacles, sizeof(double)); - } - - /* set PC's position as visible */ - m->cells[player_x+(player_y*m->width)].fov = true; - - /* compute the 4 quadrants of the map */ - TCOD_map_compute_fov_restrictive_shadowcasting_quadrant (m, player_x, player_y, max_radius, light_walls, 1, 1); - TCOD_map_compute_fov_restrictive_shadowcasting_quadrant (m, player_x, player_y, max_radius, light_walls, 1, -1); - TCOD_map_compute_fov_restrictive_shadowcasting_quadrant (m, player_x, player_y, max_radius, light_walls, -1, 1); - TCOD_map_compute_fov_restrictive_shadowcasting_quadrant (m, player_x, player_y, max_radius, light_walls, -1, -1); -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +/* +* Mingos' Restrictive Precise Angle Shadowcasting (MRPAS) v1.2 +*/ +#include "fov.h" + +#include /* for NULL in VS */ + +#include "libtcod_int.h" +#include "utility.h" + +static void compute_quadrant ( + struct TCOD_Map *m, + int player_x, + int player_y, + int max_radius, + bool light_walls, + int dx, + int dy, + double*__restrict start_angle, + double*__restrict end_angle) +{ + /* octant: vertical edge */ + { + int iteration = 1; /* iteration of the algo for this octant */ + bool done = false; + int total_obstacles = 0; + int obstacles_in_last_line = 0; + double min_angle = 0.0; + int x; + int y; + + /* do while there are unblocked slopes left and the algo is within the map's boundaries + scan progressive lines/columns from the PC outwards */ + y = player_y+dy; /* the outer slope's coordinates (first processed line) */ + if (y < 0 || y >= m->height) { + done = true; + } + while (!done) { + /* process cells in the line */ + double slopes_per_cell = 1.0 / (double)(iteration); + double half_slopes = slopes_per_cell * 0.5; + int processed_cell = (int)((min_angle + half_slopes) / slopes_per_cell); + int minx = MAX(0, player_x - iteration); + int maxx = MIN(m->width - 1, player_x + iteration); + done = true; + for (x = player_x + (processed_cell * dx); x >= minx && x <= maxx; x+=dx) { + int c = x + (y * m->width); + /* calculate slopes per cell */ + bool visible = true; + bool extended = false; + double centre_slope = (double)processed_cell * slopes_per_cell; + double start_slope = centre_slope - half_slopes; + double end_slope = centre_slope + half_slopes; + if (obstacles_in_last_line > 0) { + if ( + !( + m->cells[c-(m->width * dy)].fov && + m->cells[c-(m->width * dy)].transparent + ) && + !( + m->cells[c-(m->width * dy) - dx].fov && + m->cells[c-(m->width * dy) - dx].transparent + ) + ) { + visible = false; + } else { + int idx; + for (idx = 0; idx < obstacles_in_last_line && visible; ++idx) { + if ( + start_slope <= end_angle[idx] && + end_slope >= start_angle[idx] + ) { + if (m->cells[c].transparent) { + if ( + centre_slope > start_angle[idx] && + centre_slope < end_angle[idx] + ) { + visible = false; + } + } else { + if ( + start_slope >= start_angle[idx] && + end_slope <= end_angle[idx] + ) { + visible = false; + } else { + start_angle[idx] = MIN(start_angle[idx], start_slope); + end_angle[idx] = MAX(end_angle[idx], end_slope); + extended = true; + } + } + } + } + } + } + if (visible) { + done = false; + m->cells[c].fov = true; + /* if the cell is opaque, block the adjacent slopes */ + if (!m->cells[c].transparent) { + if (min_angle >= start_slope) { + min_angle = end_slope; + /* if min_angle is applied to the last cell in line, nothing more + needs to be checked. */ + if (processed_cell == iteration) { + done = true; + } + } else if (!extended) { + start_angle[total_obstacles] = start_slope; + end_angle[total_obstacles++] = end_slope; + } + if (!light_walls) { + m->cells[c].fov = false; + } + } + } + processed_cell++; + } + if (iteration == max_radius) { + done = true; + } + iteration++; + obstacles_in_last_line = total_obstacles; + y += dy; + if (y < 0 || y >= m->height) { + done = true; + } + } + } + + /* octant: horizontal edge */ + { + int iteration = 1; /* iteration of the algo for this octant */ + bool done = false; + int total_obstacles = 0; + int obstacles_in_last_line = 0; + double min_angle = 0.0; + int x; + int y; + + /* do while there are unblocked slopes left and the algo is within the map's boundaries + scan progressive lines/columns from the PC outwards */ + x = player_x+dx; /*the outer slope's coordinates (first processed line) */ + if (x < 0 || x >= m->width) { + done = true; + } + while (!done) { + /* process cells in the line */ + double slopes_per_cell = 1.0 / (double)(iteration); + double half_slopes = slopes_per_cell * 0.5; + int processed_cell = (int)((min_angle + half_slopes) / slopes_per_cell); + int miny = MAX(0, player_y - iteration); + int maxy = MIN(m->height - 1, player_y + iteration); + done = true; + for (y = player_y + (processed_cell * dy); y >= miny && y <= maxy; y += dy) { + int c = x + (y * m->width); + /* calculate slopes per cell */ + bool visible = true; + bool extended = false; + double centre_slope = (double)processed_cell * slopes_per_cell; + double start_slope = centre_slope - half_slopes; + double end_slope = centre_slope + half_slopes; + if (obstacles_in_last_line > 0) { + if ( + !( + m->cells[c-dx].fov && + m->cells[c-dx].transparent + ) && + !( + m->cells[c-(m->width * dy) - dx].fov && + m->cells[c-(m->width * dy) - dx].transparent + ) + ) { + visible = false; + } else { + int idx; + for (idx = 0; idx < obstacles_in_last_line && visible; ++idx) { + if ( + start_slope <= end_angle[idx] && + end_slope >= start_angle[idx] + ) { + if (m->cells[c].transparent) { + if ( + centre_slope > start_angle[idx] && + centre_slope < end_angle[idx] + ) { + visible = false; + } + } else { + if ( + start_slope >= start_angle[idx] && + end_slope <= end_angle[idx] + ) { + visible = false; + } else { + start_angle[idx] = MIN(start_angle[idx], start_slope); + end_angle[idx] = MAX(end_angle[idx], end_slope); + extended = true; + } + } + ++idx; + } + } + } + } + if (visible) { + done = false; + m->cells[c].fov = true; + /* if the cell is opaque, block the adjacent slopes */ + if (!m->cells[c].transparent) { + if (min_angle >= start_slope) { + min_angle = end_slope; + /* if min_angle is applied to the last cell in line, nothing more + needs to be checked. */ + if (processed_cell == iteration) { + done = true; + } + } else if (!extended) { + start_angle[total_obstacles] = start_slope; + end_angle[total_obstacles++] = end_slope; + } + if (!light_walls) { + m->cells[c].fov = false; + } + } + } + processed_cell++; + } + if (iteration == max_radius) { + done = true; + } + iteration++; + obstacles_in_last_line = total_obstacles; + x += dx; + if (x < 0 || x >= m->width) { + done = true; + } + } + } +} + +void TCOD_map_compute_fov_restrictive_shadowcasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls) { + /* first, zero the FOV map */ + for(int i = 0, e = map->nbcells; i != e; i++) { + map->cells[i].fov = false; + } + + /* set PC's position as visible */ + map->cells[player_x + (player_y*map->width)].fov = true; + + /* calculate an approximated (excessive, just in case) maximum number of obstacles per octant */ + const int max_obstacles = map->nbcells / 7; + double* start_angle = malloc(max_obstacles * sizeof(*start_angle)); + double* end_angle = malloc(max_obstacles * sizeof(*end_angle)); + + /* compute the 4 quadrants of the map */ + compute_quadrant(map, player_x, player_y, max_radius, light_walls, 1, 1, start_angle, end_angle); + compute_quadrant(map, player_x, player_y, max_radius, light_walls, 1, -1, start_angle, end_angle); + compute_quadrant(map, player_x, player_y, max_radius, light_walls, -1, 1, start_angle, end_angle); + compute_quadrant(map, player_x, player_y, max_radius, light_walls, -1, -1, start_angle, end_angle); + + free(end_angle); + free(start_angle); +} diff --git a/tcod_sys/libtcod/src/libtcod/fov_types.h b/tcod_sys/libtcod/src/libtcod/fov_types.h new file mode 100644 index 000000000..a87c206e4 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/fov_types.h @@ -0,0 +1,87 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef TCOD_FOV_TYPES_H_ +#define TCOD_FOV_TYPES_H_ +#include "portability.h" +/** + * Private map cell struct. + */ +struct TCOD_MapCell { + bool transparent; + bool walkable; + bool fov; +}; +/** + * Private map struct. + */ +typedef struct TCOD_Map { + int width; + int height; + int nbcells; + struct TCOD_MapCell *cells; +} TCOD_Map; +typedef TCOD_Map *TCOD_map_t; +/** + * Field-of-view options. + */ +typedef enum { + /** + * Basic: http://roguebasin.roguelikedevelopment.org/index.php?title=Ray_casting + */ + FOV_BASIC, + /** + * Diamond: http://www.geocities.com/temerra/los_rays.html + */ + FOV_DIAMOND, + /** + * Shadow casting: http://roguebasin.roguelikedevelopment.org/index.php?title=FOV_using_recursive_shadowcasting + */ + FOV_SHADOW, + /** + * Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View + */ + FOV_PERMISSIVE_0, + FOV_PERMISSIVE_1, + FOV_PERMISSIVE_2, + FOV_PERMISSIVE_3, + FOV_PERMISSIVE_4, + FOV_PERMISSIVE_5, + FOV_PERMISSIVE_6, + FOV_PERMISSIVE_7, + FOV_PERMISSIVE_8, + /** + * Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos) + */ + FOV_RESTRICTIVE, + NB_FOV_ALGORITHMS } TCOD_fov_algorithm_t; +#define FOV_PERMISSIVE(x) ((TCOD_fov_algorithm_t)(FOV_PERMISSIVE_0 + (x))) +#endif /* TCOD_FOV_TYPES_H_ */ diff --git a/tcod_sys/libtcod/src/libtcod/globals.c b/tcod_sys/libtcod/src/libtcod/globals.c new file mode 100644 index 000000000..2c9a62da8 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/globals.c @@ -0,0 +1,49 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "globals.h" + +#include "libtcod_int.h" + +TCODLIB_CAPI TCOD_Tileset* TCOD_get_default_tileset(void) +{ + if (TCOD_ctx.tileset) { ++TCOD_ctx.tileset->ref_count; } + return TCOD_ctx.tileset; +} +TCODLIB_CAPI void TCOD_set_default_tileset(TCOD_Tileset* tileset) +{ + TCOD_tileset_delete(TCOD_ctx.tileset); + TCOD_ctx.tileset = tileset; + if (tileset) { ++tileset->ref_count; } + if (tileset && TCOD_ctx.engine) { + TCOD_ctx.engine->set_tileset(TCOD_ctx.engine, tileset); + } +} diff --git a/tcod_sys/libtcod/src/libtcod/globals.h b/tcod_sys/libtcod/src/libtcod/globals.h new file mode 100644 index 000000000..9b06f391e --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/globals.h @@ -0,0 +1,59 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_GLOBALS_H_ +#define LIBTCOD_GLOBALS_H_ + +#include "config.h" +#include "tileset.h" +/** + Return the default tileset, may be NULL. + + A non-NULL return value is a new reference to the global tileset. + When you are done you will need to call `TCOD_tileset_delete` on this + pointer. + + This function is provisional, the API may change in the future. + */ +TCODLIB_CAPI TCOD_Tileset* TCOD_get_default_tileset(void); +/** + Set the default tileset and update the default display to use it. + + This will keep alive a reference to the given tileset. If you no longer + need the pointer then you should call `TCOD_tileset_delete` on it after + this function. + + This function is provisional, the API may change in the future. + */ +TCODLIB_CAPI void TCOD_set_default_tileset(TCOD_Tileset* tileset); +#endif // LIBTCOD_GLOBALS_H_ + + diff --git a/tcod_sys/libtcod/src/libtcod/heapq.c b/tcod_sys/libtcod/src/libtcod/heapq.c new file mode 100644 index 000000000..404f0f784 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/heapq.c @@ -0,0 +1,159 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "heapq.h" + +#include +#include + +#include "error.h" + +void TCOD_heap_uninit(struct TCOD_Heap* heap) +{ + if (heap->heap) { free(heap->heap); } + heap->heap = NULL; + heap->size = 0; + heap->capacity = 0; + heap->node_size = 0; + heap->data_size = 0; +} + +int TCOD_heap_init(struct TCOD_Heap* heap, size_t data_size) +{ + size_t node_size = sizeof(struct TCOD_HeapNode) + data_size; + if (node_size > TCOD_HEAP_MAX_NODE_SIZE) { + return TCOD_set_errorvf("Heap data size is too large: %i", (int)node_size); + } + heap->heap = NULL; + heap->size = 0; + heap->capacity = 0; + heap->node_size = node_size; + heap->data_size = data_size; + return 0; +} + +void TCOD_heap_clear(struct TCOD_Heap* heap) +{ + heap->size = 0; +} + +static struct TCOD_HeapNode* TCOD_heap_get(struct TCOD_Heap* heap, int index) +{ + return (struct TCOD_HeapNode*)((char*)(heap->heap) + index * heap->node_size); +} + +static void TCOD_heap_swap(struct TCOD_Heap* heap, int lhs, int rhs) +{ + unsigned char buffer[TCOD_HEAP_MAX_NODE_SIZE]; + memcpy(buffer, TCOD_heap_get(heap, lhs), heap->node_size); + memcpy(TCOD_heap_get(heap, lhs), TCOD_heap_get(heap, rhs), heap->node_size); + memcpy(TCOD_heap_get(heap, rhs), buffer, heap->node_size); +} + +static void TCOD_heap_set( + struct TCOD_Heap* heap, int index, int priority, const void* data) +{ + struct TCOD_HeapNode* node = TCOD_heap_get(heap, index); + node->priority = priority; + memcpy(node->data, data, heap->node_size - sizeof(struct TCOD_HeapNode)); +} + +static void TCOD_heap_copy(struct TCOD_Heap* heap, int dest, int src) +{ + memcpy(TCOD_heap_get(heap, dest), TCOD_heap_get(heap, src), heap->node_size); +} + +static bool TCOD_minheap_compare(struct TCOD_Heap* minheap, int lhs, int rhs) +{ + return (TCOD_heap_get(minheap, lhs)->priority + < TCOD_heap_get(minheap, rhs)->priority); +} + +static void TCOD_TCOD_minheap_heapify_down(struct TCOD_Heap* minheap, int index) +{ + int canidate = index; + int left = index * 2 + 1; + int right = index * 2 + 2; + if (left < minheap->size && TCOD_minheap_compare(minheap, left, canidate)) { + canidate = left; + } + if (right < minheap->size && TCOD_minheap_compare(minheap, right, canidate)) { + canidate = right; + } + if (canidate != index) { + TCOD_heap_swap(minheap, index, canidate); + TCOD_TCOD_minheap_heapify_down(minheap, canidate); + } +} + +static void TCOD_TCOD_minheap_heapify_up(struct TCOD_Heap* minheap, int index) +{ + if (index == 0) { return; } + int parent = (index - 1) >> 1; + if (TCOD_minheap_compare(minheap, index, parent)) { + TCOD_heap_swap(minheap, index, parent); + TCOD_TCOD_minheap_heapify_up(minheap, parent); + } +} +void TCOD_minheap_heapify(struct TCOD_Heap* minheap) +{ + for (int i = minheap->size / 2; i >= 0; --i) { + TCOD_TCOD_minheap_heapify_down(minheap, i); + } +} +void TCOD_minheap_pop(struct TCOD_Heap* minheap, void* out) +{ + if (minheap->size == 0) { return; } + if (out) { + memcpy(out, minheap->heap[0].data, minheap->data_size); + } + TCOD_heap_copy(minheap, 0, minheap->size - 1); + --minheap->size; + TCOD_TCOD_minheap_heapify_down(minheap, 0); +} + +int TCOD_minheap_push( + struct TCOD_Heap* minheap, int priority, const void* data) +{ + if (minheap->size == minheap->capacity) { + int new_capacity = ( + minheap->capacity ? minheap->capacity * 2 : TCOD_HEAP_DEFAULT_CAPACITY + ); + void* new_heap = realloc(minheap->heap, minheap->node_size * new_capacity); + if (!new_heap) { return -1; } // Out of memory. + minheap->capacity = new_capacity; + minheap->heap = (struct TCOD_HeapNode*)new_heap; + } + ++minheap->size; + TCOD_heap_set(minheap, minheap->size - 1, priority, data); + TCOD_TCOD_minheap_heapify_up(minheap, minheap->size - 1); + return 0; +} diff --git a/tcod_sys/libtcod/src/libtcod/heapq.h b/tcod_sys/libtcod/src/libtcod/heapq.h new file mode 100644 index 000000000..befb90063 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/heapq.h @@ -0,0 +1,73 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef TCOD_HEAPQ_H +#define TCOD_HEAPQ_H + +#include +#include + +#include "config.h" + +#define TCOD_HEAP_DEFAULT_CAPACITY 256 +#define TCOD_HEAP_MAX_NODE_SIZE 256 + +struct TCOD_HeapNode { + int priority; +#if !defined(__cplusplus) + unsigned char data[]; +#endif // !defined(__cplusplus) +}; + +struct TCOD_Heap { + struct TCOD_HeapNode* heap; + int size; + int capacity; + size_t node_size; + size_t data_size; +}; + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +TCOD_PUBLIC int TCOD_heap_init(struct TCOD_Heap* heap, size_t data_size); +TCOD_PUBLIC void TCOD_heap_uninit(struct TCOD_Heap* heap); + +TCOD_PUBLIC void TCOD_heap_clear(struct TCOD_Heap* heap); + +TCOD_PUBLIC int TCOD_minheap_push( + struct TCOD_Heap* minheap, int priority, const void* data); +TCOD_PUBLIC void TCOD_minheap_pop(struct TCOD_Heap* minheap, void* out); +TCOD_PUBLIC void TCOD_minheap_heapify(struct TCOD_Heap* minheap); +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus +#endif // TCOD_HEAPQ_H diff --git a/tcod_sys/libtcod/src/heightmap.cpp b/tcod_sys/libtcod/src/libtcod/heightmap.cpp similarity index 73% rename from tcod_sys/libtcod/src/heightmap.cpp rename to tcod_sys/libtcod/src/libtcod/heightmap.cpp index f1c568d67..4d503f696 100644 --- a/tcod_sys/libtcod/src/heightmap.cpp +++ b/tcod_sys/libtcod/src/libtcod/heightmap.cpp @@ -1,178 +1,184 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include - -#include - -TCODHeightMap::TCODHeightMap(int w, int h) : w(w),h(h) { - values = new float[w*h]; - memset(values,0,sizeof(float)*w*h); -} -TCODHeightMap::~TCODHeightMap() { - delete [] values; -} - -void TCODHeightMap::clear() { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_clear(&hm); -} -void TCODHeightMap::normalize(float newMin, float newMax) { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_normalize(&hm,newMin,newMax); -} - -void TCODHeightMap::getMinMax(float *min, float *max) const { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_get_minmax(&hm,min,max); -} - -void TCODHeightMap::addHill(float hx, float hy, float hradius, float height) { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_add_hill(&hm,hx,hy,hradius,height); -} - -void TCODHeightMap::digHill(float hx, float hy, float hradius, float height) { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_dig_hill(&hm,hx,hy,hradius,height); -} - -void TCODHeightMap::copy(const TCODHeightMap *source) { - TCOD_heightmap_t hm_source={source->w,source->h,source->values}; - TCOD_heightmap_t hm_dest={w,h,values}; - TCOD_heightmap_copy(&hm_source,&hm_dest); -} - -void TCODHeightMap::addFbm(TCODNoise *noise, float mulx, float muly, float addx, float addy, float octaves, float delta, float scale) { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_add_fbm(&hm,noise->data,mulx,muly,addx,addy,octaves,delta,scale); -} -void TCODHeightMap::scaleFbm(TCODNoise *noise, float mulx, float muly, float addx, float addy, float octaves, float delta, float scale) { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_scale_fbm(&hm,noise->data,mulx,muly,addx,addy,octaves,delta,scale); -} - -float TCODHeightMap::getInterpolatedValue(float x, float y) const { - TCOD_heightmap_t hm={w,h,values}; - return TCOD_heightmap_get_interpolated_value(&hm,x,y); -} - -void TCODHeightMap::getNormal(float x, float y,float n[3], float waterHeight) const { - TCOD_heightmap_t hm={w,h,values}; - return TCOD_heightmap_get_normal(&hm,x,y,n,waterHeight); -} - -void TCODHeightMap::digBezier(int px[4], int py[4], float startRadius, float startDepth, float endRadius, float endDepth) { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_dig_bezier(&hm,px,py,startRadius,startDepth,endRadius,endDepth); -} - -bool TCODHeightMap::hasLandOnBorder(float seaLevel) const { - TCOD_heightmap_t hm={w,h,values}; - return TCOD_heightmap_has_land_on_border(&hm,seaLevel) != 0; -} - -void TCODHeightMap::islandify(float seaLevel,TCODRandom *rnd) { - TCOD_heightmap_t hm={w,h,values}; - return TCOD_heightmap_islandify(&hm,seaLevel,rnd->data); -} - -void TCODHeightMap::add(float f) { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_add(&hm,f); -} - -int TCODHeightMap::countCells(float min,float max) const { - TCOD_heightmap_t hm={w,h,values}; - return TCOD_heightmap_count_cells(&hm,min,max); -} - -void TCODHeightMap::scale(float f) { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_scale(&hm,f); -} - -void TCODHeightMap::clamp(float min, float max) { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_clamp(&hm,min,max); -} - -void TCODHeightMap::lerp(const TCODHeightMap *a, const TCODHeightMap *b,float coef) { - TCOD_heightmap_t hm1={a->w,a->h,a->values}; - TCOD_heightmap_t hm2={b->w,b->h,b->values}; - TCOD_heightmap_t hmres={w,h,values}; - TCOD_heightmap_lerp_hm(&hm1,&hm2,&hmres,coef); -} - -void TCODHeightMap::add(const TCODHeightMap *a, const TCODHeightMap *b) { - TCOD_heightmap_t hm1={a->w,a->h,a->values}; - TCOD_heightmap_t hm2={b->w,b->h,b->values}; - TCOD_heightmap_t hmres={w,h,values}; - TCOD_heightmap_add_hm(&hm1,&hm2,&hmres); -} - -void TCODHeightMap::multiply(const TCODHeightMap *a, const TCODHeightMap *b) { - TCOD_heightmap_t hm1={a->w,a->h,a->values}; - TCOD_heightmap_t hm2={b->w,b->h,b->values}; - TCOD_heightmap_t hmres={w,h,values}; - TCOD_heightmap_multiply_hm(&hm1,&hm2,&hmres); -} - -float TCODHeightMap::getSlope(int x, int y) const { - TCOD_heightmap_t hm={w,h,values}; - return TCOD_heightmap_get_slope(&hm,x,y); -} - -void TCODHeightMap::rainErosion(int nbDrops, float erosionCoef,float agregationCoef, TCODRandom *rnd) { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_rain_erosion(&hm, nbDrops, erosionCoef, agregationCoef, rnd->data); -} - -void TCODHeightMap::kernelTransform(int kernelSize, const int *dx, const int *dy, const float *weight, float minLevel,float maxLevel) { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_kernel_transform(&hm, kernelSize,dx,dy,weight,minLevel, maxLevel); -} - -void TCODHeightMap::addVoronoi(int nbPoints, int nbCoef, const float *coef,TCODRandom *rnd) { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_add_voronoi(&hm, nbPoints, nbCoef, coef, rnd->data); -} - -#if 0 -void TCODHeightMap::heatErosion(int nbPass,float minSlope,float erosionCoef,float agregationCoef,TCODRandom *rnd) { - TCOD_heightmap_t hm={w,h,values}; - TCOD_heightmap_heat_erosion(&hm, nbPass, minSlope, erosionCoef, agregationCoef, rnd->data); -} -#endif - -void TCODHeightMap::midPointDisplacement(TCODRandom *rnd, float roughness) { - TCOD_heightmap_t hm={w,h,values}; - if ( ! rnd ) rnd = TCODRandom::getInstance(); - TCOD_heightmap_mid_point_displacement(&hm, rnd->data, roughness); -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "heightmap.hpp" + +#include + +#include + +TCODHeightMap::TCODHeightMap(int width, int height) +: w(width), h(height) +{ + values = new float[w * h]; + memset(values, 0, sizeof(float) * w * h); +} +TCODHeightMap::~TCODHeightMap() { + delete [] values; +} + +void TCODHeightMap::clear() { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_clear(&hm); +} +void TCODHeightMap::normalize(float newMin, float newMax) { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_normalize(&hm,newMin,newMax); +} + +void TCODHeightMap::getMinMax(float *min, float *max) const { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_get_minmax(&hm,min,max); +} + +void TCODHeightMap::addHill(float hx, float hy, float hradius, float height) { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_add_hill(&hm,hx,hy,hradius,height); +} + +void TCODHeightMap::digHill(float hx, float hy, float hradius, float height) { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_dig_hill(&hm,hx,hy,hradius,height); +} + +void TCODHeightMap::copy(const TCODHeightMap *source) { + TCOD_heightmap_t hm_source={source->w,source->h,source->values}; + TCOD_heightmap_t hm_dest={w,h,values}; + TCOD_heightmap_copy(&hm_source,&hm_dest); +} + +void TCODHeightMap::addFbm(TCODNoise *noise, float mulx, float muly, float addx, float addy, float octaves, float delta, float scale) { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_add_fbm(&hm,noise->data,mulx,muly,addx,addy,octaves,delta,scale); +} +void TCODHeightMap::scaleFbm(TCODNoise *noise, float mulx, float muly, float addx, float addy, float octaves, float delta, float scale) { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_scale_fbm(&hm,noise->data,mulx,muly,addx,addy,octaves,delta,scale); +} + +float TCODHeightMap::getInterpolatedValue(float x, float y) const { + TCOD_heightmap_t hm={w,h,values}; + return TCOD_heightmap_get_interpolated_value(&hm,x,y); +} + +void TCODHeightMap::getNormal(float x, float y,float n[3], float waterHeight) const { + TCOD_heightmap_t hm={w,h,values}; + return TCOD_heightmap_get_normal(&hm,x,y,n,waterHeight); +} + +void TCODHeightMap::digBezier(int px[4], int py[4], float startRadius, float startDepth, float endRadius, float endDepth) { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_dig_bezier(&hm,px,py,startRadius,startDepth,endRadius,endDepth); +} + +bool TCODHeightMap::hasLandOnBorder(float seaLevel) const { + TCOD_heightmap_t hm={w,h,values}; + return TCOD_heightmap_has_land_on_border(&hm,seaLevel) != 0; +} + +void TCODHeightMap::islandify(float seaLevel,TCODRandom *rnd) { + TCOD_heightmap_t hm={w,h,values}; + return TCOD_heightmap_islandify(&hm,seaLevel,rnd->data); +} + +void TCODHeightMap::add(float f) { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_add(&hm,f); +} + +int TCODHeightMap::countCells(float min,float max) const { + TCOD_heightmap_t hm={w,h,values}; + return TCOD_heightmap_count_cells(&hm,min,max); +} + +void TCODHeightMap::scale(float f) { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_scale(&hm,f); +} + +void TCODHeightMap::clamp(float min, float max) { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_clamp(&hm,min,max); +} + +void TCODHeightMap::lerp(const TCODHeightMap *a, const TCODHeightMap *b,float coef) { + TCOD_heightmap_t hm1={a->w,a->h,a->values}; + TCOD_heightmap_t hm2={b->w,b->h,b->values}; + TCOD_heightmap_t hmres={w,h,values}; + TCOD_heightmap_lerp_hm(&hm1,&hm2,&hmres,coef); +} + +void TCODHeightMap::add(const TCODHeightMap *a, const TCODHeightMap *b) { + TCOD_heightmap_t hm1={a->w,a->h,a->values}; + TCOD_heightmap_t hm2={b->w,b->h,b->values}; + TCOD_heightmap_t hmres={w,h,values}; + TCOD_heightmap_add_hm(&hm1,&hm2,&hmres); +} + +void TCODHeightMap::multiply(const TCODHeightMap *a, const TCODHeightMap *b) { + TCOD_heightmap_t hm1={a->w,a->h,a->values}; + TCOD_heightmap_t hm2={b->w,b->h,b->values}; + TCOD_heightmap_t hmres={w,h,values}; + TCOD_heightmap_multiply_hm(&hm1,&hm2,&hmres); +} + +float TCODHeightMap::getSlope(int x, int y) const { + TCOD_heightmap_t hm={w,h,values}; + return TCOD_heightmap_get_slope(&hm,x,y); +} + +void TCODHeightMap::rainErosion(int nbDrops, float erosionCoef,float agregationCoef, TCODRandom *rnd) { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_rain_erosion(&hm, nbDrops, erosionCoef, agregationCoef, rnd->data); +} + +void TCODHeightMap::kernelTransform(int kernelSize, const int *dx, const int *dy, const float *weight, float minLevel,float maxLevel) { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_kernel_transform(&hm, kernelSize,dx,dy,weight,minLevel, maxLevel); +} + +void TCODHeightMap::addVoronoi(int nbPoints, int nbCoef, const float *coef,TCODRandom *rnd) { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_add_voronoi(&hm, nbPoints, nbCoef, coef, rnd->data); +} + +#if 0 +void TCODHeightMap::heatErosion(int nbPass,float minSlope,float erosionCoef,float agregationCoef,TCODRandom *rnd) { + TCOD_heightmap_t hm={w,h,values}; + TCOD_heightmap_heat_erosion(&hm, nbPass, minSlope, erosionCoef, agregationCoef, rnd->data); +} +#endif + +void TCODHeightMap::midPointDisplacement(TCODRandom *rnd, float roughness) { + TCOD_heightmap_t hm={w,h,values}; + if ( ! rnd ) rnd = TCODRandom::getInstance(); + TCOD_heightmap_mid_point_displacement(&hm, rnd->data, roughness); +} diff --git a/tcod_sys/libtcod/include/heightmap.h b/tcod_sys/libtcod/src/libtcod/heightmap.h similarity index 67% rename from tcod_sys/libtcod/include/heightmap.h rename to tcod_sys/libtcod/src/libtcod/heightmap.h index f113829f8..29d8e5df2 100644 --- a/tcod_sys/libtcod/include/heightmap.h +++ b/tcod_sys/libtcod/src/libtcod/heightmap.h @@ -1,34 +1,38 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_HEIGHTMAP_H #define _TCOD_HEIGHTMAP_H -#include "libtcod_portability.h" +#include "portability.h" #include "mersenne_types.h" #include "noise.h" @@ -72,6 +76,7 @@ TCODLIB_API void TCOD_heightmap_add_voronoi(TCOD_heightmap_t *hm, int nbPoints, TCODLIB_API void TCOD_heightmap_mid_point_displacement(TCOD_heightmap_t *hm, TCOD_random_t rnd, float roughness); TCODLIB_API void TCOD_heightmap_add_fbm(TCOD_heightmap_t *hm, TCOD_noise_t noise,float mulx, float muly, float addx, float addy, float octaves, float delta, float scale); TCODLIB_API void TCOD_heightmap_scale_fbm(TCOD_heightmap_t *hm, TCOD_noise_t noise,float mulx, float muly, float addx, float addy, float octaves, float delta, float scale); +TCOD_DEPRECATED("This function does nothing and will be removed.") TCODLIB_API void TCOD_heightmap_islandify(TCOD_heightmap_t *hm, float seaLevel,TCOD_random_t rnd); #ifdef __cplusplus } diff --git a/tcod_sys/libtcod/include/heightmap.hpp b/tcod_sys/libtcod/src/libtcod/heightmap.hpp similarity index 93% rename from tcod_sys/libtcod/include/heightmap.hpp rename to tcod_sys/libtcod/src/libtcod/heightmap.hpp index e7b0643d4..64f5ae251 100644 --- a/tcod_sys/libtcod/include/heightmap.hpp +++ b/tcod_sys/libtcod/src/libtcod/heightmap.hpp @@ -1,30 +1,34 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_HEIGHTMAP_HPP #define _TCOD_HEIGHTMAP_HPP @@ -66,7 +70,7 @@ public : map=libtcod.heightmap_new(50,50) print map.w, map.h */ - TCODHeightMap(int w, int h); + TCODHeightMap(int width, int height); /** @PageName heightmap_init diff --git a/tcod_sys/libtcod/src/libtcod/heightmap_c.c b/tcod_sys/libtcod/src/libtcod/heightmap_c.c new file mode 100644 index 000000000..8c1041053 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/heightmap_c.c @@ -0,0 +1,581 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "heightmap.h" + +#include +#include +#include +#include +#include + +#include "utility.h" +#include "mersenne.h" + +#define GET_VALUE(hm,x,y) (hm)->values[(x)+(y)*(hm)->w] +/** + Returns true if `x`,`y` are valid coordinates for this heightmap. + */ +static bool in_bounds(const TCOD_heightmap_t *hm, int x, int y) { + if (!hm) { return false; } // No valid coordinates on a NULL pointer. + if (x < 0 || x >= hm->w) return false; + if (y < 0 || y >= hm->h) return false; + return true; +} +/** + Returns true if these heighmaps have the same shape and are non-NULL. + */ +static bool is_same_size(const TCOD_heightmap_t *hm1, const TCOD_heightmap_t *hm2) { + return hm1 && hm2 && hm1->w == hm2->w && hm1->h == hm2->h; +} + +TCOD_heightmap_t *TCOD_heightmap_new(int w,int h) { + TCOD_heightmap_t *hm=malloc(sizeof(*hm)); + hm->values = calloc(sizeof(*hm->values),w*h); + if (!hm->values) { + free(hm); + return NULL; + } + hm->w=w; + hm->h=h; + return hm; +} + +void TCOD_heightmap_delete(TCOD_heightmap_t *hm) { + if (hm) { free(hm->values); } + free(hm); +} + +void TCOD_heightmap_clear(TCOD_heightmap_t *hm) { + if (!hm) { return; } + memset(hm->values,0,hm->w*hm->h*sizeof(float)); +} + +float TCOD_heightmap_get_value(const TCOD_heightmap_t *hm, int x, int y) { + if (in_bounds(hm, x, y)) { + return GET_VALUE(hm, x, y); + } else { + return 0.0; + } +} + +void TCOD_heightmap_set_value(TCOD_heightmap_t *hm, int x, int y, float value) { + if (in_bounds(hm, x, y)) { + GET_VALUE(hm, x, y) = value; + } +} + +void TCOD_heightmap_get_minmax(const TCOD_heightmap_t *hm, float *min, float *max) { + if (!in_bounds(hm, 0, 0)) { return; } + if (min) { *min = hm->values[0]; } + if (max) { *max = hm->values[0]; } + for (int i=0; i != hm->h*hm->w; i++) { + const float value = hm->values[i]; + if (min) { *min = MIN(*min, value); } + if (max) { *max = MAX(*max, value); } + } +} + +void TCOD_heightmap_normalize(TCOD_heightmap_t *hm, float min, float max) { + if (!hm) { return; } + float curmin,curmax; + TCOD_heightmap_get_minmax(hm,&curmin,&curmax); + + if (curmax - curmin < FLT_EPSILON) { + for (int i = 0; i != hm->w*hm->h; ++i) { + hm->values[i] = min; + } + } else { + const float invmax = (max - min) / (curmax - curmin); + for (int i = 0; i != hm->w*hm->h; ++i) { + hm->values[i] = min + (hm->values[i] - curmin) * invmax; + } + } +} + +void TCOD_heightmap_add_hill(TCOD_heightmap_t *hm, float hx, float hy, float hradius, float hheight) { + if (!hm) { return; } + const float hradius2=hradius*hradius; + const float coef=hheight / hradius2; + const int minx=MAX(floorf(hx-hradius),0); + const int miny=MAX(floorf(hy-hradius),0); + const int maxx=MIN(ceilf(hx+hradius),hm->w); + const int maxy=MIN(ceilf(hy+hradius),hm->h); + for (int y = miny; y < maxy; y++) { + const float ydist = (y - hy)*(y - hy); + for (int x = minx; x < maxx; x++) { + const float xdist = (x - hx)*(x - hx); + const float z = hradius2 - xdist - ydist; + if (z > 0) { GET_VALUE(hm, x, y) += z * coef; } + } + } +} + +void TCOD_heightmap_dig_hill(TCOD_heightmap_t *hm, float hx, float hy, float hradius, float hheight) { + if (!hm) { return; } + const float hradius2=hradius*hradius; + const float coef=hheight / hradius2; + const int minx=MAX(floorf(hx-hradius),0); + const int miny=MAX(floorf(hy-hradius),0); + const int maxx=MIN(ceilf(hx+hradius),hm->w); + const int maxy=MIN(ceilf(hy+hradius),hm->h); + for (int y = miny; y < maxy; y++) { + for (int x = minx; x < maxx; x++) { + const float xdist = (x - hx)*(x - hx); + const float ydist = (y - hy)*(y - hy); + const float dist = xdist + ydist; + if ( dist < hradius2 ) { + const float z = (hradius2 - dist) * coef; + if (hheight > 0) { + if ( GET_VALUE(hm,x,y) < z ) GET_VALUE(hm,x,y) = z; + } else { + if ( GET_VALUE(hm,x,y) > z ) GET_VALUE(hm,x,y) = z; + } + } + } + } +} + +void TCOD_heightmap_copy(const TCOD_heightmap_t *hm_source,TCOD_heightmap_t *hm_dest) { + if (!is_same_size(hm_source, hm_dest)) { return; } + memcpy(hm_dest->values,hm_source->values,sizeof(float)*hm_source->w*hm_source->h); +} + +void TCOD_heightmap_add_fbm(TCOD_heightmap_t *hm, TCOD_noise_t noise,float mulx, float muly, float addx, float addy, float octaves, float delta, float scale) { + if (!hm) { return; } + const float xcoef=mulx / hm->w; + const float ycoef=muly / hm->h; + for (int y=0; y < hm->h; y++) { + for (int x=0; x < hm->w; x++) { + float f[2] = { + (x + addx) * xcoef, + (y + addy) * ycoef + }; + GET_VALUE(hm, x, y) += delta+TCOD_noise_get_fbm(noise,f,octaves)*scale; + } + } +} + +void TCOD_heightmap_scale_fbm(TCOD_heightmap_t *hm, TCOD_noise_t noise,float mulx, float muly, float addx, float addy, float octaves, float delta, float scale) { + if (!hm) { return; } + const float xcoef=mulx / hm->w; + const float ycoef=muly / hm->h; + for (int y = 0; y < hm->h; y++) { + for (int x=0; x < hm->w; x++) { + float f[2] = { + (x + addx) * xcoef, + (y + addy) * ycoef + }; + GET_VALUE(hm, x, y) *= delta+TCOD_noise_get_fbm(noise,f,octaves)*scale; + } + } +} + +float TCOD_heightmap_get_interpolated_value(const TCOD_heightmap_t *hm, float x, float y) { + if (!hm) { return 0.0f; } + x = CLAMP(0.0f, hm->w-1, x); + y = CLAMP(0.0f, hm->h-1, y); + float fix; + float fiy; + float fx = modff(x, &fix); + float fy = modff(y, &fiy); + int ix = fix; + int iy = fiy; + + if (ix >= hm->w - 1) { + ix = hm->w - 2; + fx = 1.0; + } + if (iy >= hm->h - 1) { + iy = hm->h - 2; + fy = 1.0; + } + const float c1 = GET_VALUE(hm,ix,iy); + const float c2 = GET_VALUE(hm,ix+1,iy); + const float c3 = GET_VALUE(hm,ix,iy+1); + const float c4 = GET_VALUE(hm,ix+1,iy+1); + const float top = LERP(c1, c2, fx); + const float bottom = LERP(c3, c4, fx); + return LERP(top, bottom, fy); +} + +void TCOD_heightmap_get_normal(const TCOD_heightmap_t *hm, float x, float y, float n[3], float waterLevel) { + if (!hm) { return; } + float h0,hx,hy,invlen; /* map heights at x,y x+1,y and x,y+1 */ + n[0]=0.0f;n[1]=0.0f;n[2]=1.0f; + if ( x >= hm->w-1 || y >= hm->h-1 ) return; + h0 = TCOD_heightmap_get_interpolated_value(hm,x,y); + if ( h0 < waterLevel ) h0=waterLevel; + hx = TCOD_heightmap_get_interpolated_value(hm,x+1,y); + if ( hx < waterLevel ) hx=waterLevel; + hy = TCOD_heightmap_get_interpolated_value(hm,x,y+1); + if ( hy < waterLevel ) hy=waterLevel; + /* vx = 1 vy = 0 */ + /* 0 1 */ + /* hx-h0 hy-h0 */ + /* vz = vx cross vy */ + n[0] = 255*(h0-hx); + n[1] = 255*(h0-hy); + n[2] = 16.0f; + /* normalize */ + invlen=1.0f / (float)sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]); + n[0]*=invlen; + n[1]*=invlen; + n[2]*=invlen; +} + +void TCOD_heightmap_dig_bezier(TCOD_heightmap_t *hm, int px[4], int py[4], float startRadius, float startDepth, float endRadius, float endDepth) { + if (!hm) { return; } + int xFrom=px[0]; + int yFrom=py[0]; + for ( int i=0;i <= 1000 ; ++i) { + const float t=i/1000.f; + const float it=1.0f-t; + const int xTo=(px[0]*it*it*it + 3*px[1]*t*it*it + 3*px[2]*t*t*it + px[3]*t*t*t); + const int yTo=(py[0]*it*it*it + 3*py[1]*t*it*it + 3*py[2]*t*t*it + py[3]*t*t*t); + if ( xTo != xFrom || yTo != yFrom ) { + float radius=startRadius+(endRadius-startRadius)*t; + float depth=startDepth+(endDepth-startDepth)*t; + TCOD_heightmap_dig_hill(hm,xTo,yTo,radius,depth); + xFrom=xTo; + yFrom=yTo; + } + } +} + +bool TCOD_heightmap_has_land_on_border(const TCOD_heightmap_t *hm, float waterLevel) { + if (!hm) { return false; } + for (int x=0; x < hm->w; x++) { + if ( GET_VALUE(hm,x,0) > waterLevel + || GET_VALUE(hm,x,hm->h-1) > waterLevel ) { + return true; + } + } + for (int y=0; y < hm->h; y++) { + if ( GET_VALUE(hm,0,y) > waterLevel + || GET_VALUE(hm,hm->w-1,y) > waterLevel ) { + return true; + } + } + return false; +} + +void TCOD_heightmap_islandify(TCOD_heightmap_t *hm, float seaLevel,TCOD_random_t rnd) { + (void)hm; (void)seaLevel; (void)rnd; // This function is pending removal. +} + +void TCOD_heightmap_add(TCOD_heightmap_t *hm, float value) { + if (!hm) { return; } + for (int i = 0; i < hm->w * hm->h; ++i) { hm->values[i] += value; } +} + +int TCOD_heightmap_count_cells(const TCOD_heightmap_t *hm, float min, float max) { + if (!hm) { return 0; } + int count = 0; + for (int i = 0; i < hm->w * hm->h; ++i) { + if (hm->values[i] >= min && hm->values[i] <= max) { ++count; } + } + return count; +} + +void TCOD_heightmap_scale(TCOD_heightmap_t *hm, float value) { + if (!hm) { return; } + for (int i = 0; i < hm->w * hm->h; ++i) { hm->values[i] *= value; } +} + +void TCOD_heightmap_clamp(TCOD_heightmap_t *hm, float min, float max) { + if (!hm) { return; } + for (int i = 0; i < hm->w * hm->h; ++i) { + hm->values[i] = CLAMP(min, max, hm->values[i]); + } +} + +void TCOD_heightmap_lerp_hm(const TCOD_heightmap_t *hm1, const TCOD_heightmap_t *hm2, TCOD_heightmap_t *hmres, float coef) { + if (!is_same_size(hm1, hm2) || !is_same_size(hm1, hmres)) { + return; + } + for (int i=0; i < hm1->w*hm1->h; i++ ) { + hmres->values[i]=LERP(hm1->values[i], hm2->values[i], coef); + } +} + +void TCOD_heightmap_add_hm(const TCOD_heightmap_t *hm1, const TCOD_heightmap_t *hm2, TCOD_heightmap_t *hmres) { + if (!is_same_size(hm1, hm2) || !is_same_size(hm1, hmres)) { + return; + } + for (int i=0; i < hm1->w*hm1->h; i++ ) { + hmres->values[i]=hm1->values[i]+hm2->values[i]; + } +} + +void TCOD_heightmap_multiply_hm(const TCOD_heightmap_t *hm1, const TCOD_heightmap_t *hm2, TCOD_heightmap_t *hmres) { + if (!is_same_size(hm1, hm2) || !is_same_size(hm1, hmres)) { + return; + } + for (int i=0; i < hm1->w*hm1->h; i++ ) { + hmres->values[i]=hm1->values[i]*hm2->values[i]; + } +} + +float TCOD_heightmap_get_slope(const TCOD_heightmap_t *hm, int x, int y) { + static const int dix[8]={-1,0,1,-1,1,-1,0,1}; + static const int diy[8]={-1,-1,-1,0,0,1,1,1}; + float mindy=0.0f,maxdy=0.0f; + if (!in_bounds(hm, x, y)) { + return 0; + } + const float v=GET_VALUE(hm,x,y); + for (int i=0; i < 8; i++ ) { + const int nx=x+dix[i]; + const int ny=y+diy[i]; + if ( in_bounds(hm, nx, ny) ) { + const float nslope=GET_VALUE(hm,nx,ny)-v; + mindy = MIN(mindy, nslope); + maxdy = MAX(maxdy, nslope); + } + } + return (float)atan2(maxdy+mindy,1.0f); +} + +void TCOD_heightmap_rain_erosion(TCOD_heightmap_t *hm, int nbDrops,float erosionCoef,float agregationCoef,TCOD_random_t rnd) { + if (!hm) { return; } + while (nbDrops-- > 0) { + int curx=TCOD_random_get_int(rnd,0,hm->w-1); + int cury=TCOD_random_get_int(rnd,0,hm->h-1); + static const int dx[8]={-1,0,1,-1,1,-1,0,1}; + static const int dy[8]={-1,-1,-1,0,0,1,1,1}; + float sediment=0.0f; + do { + int nextx=0,nexty=0; + float v=GET_VALUE(hm,curx,cury); + /* calculate slope at x,y */ + float slope = -INFINITY; + for (int i=0; i < 8; i++ ) { + const int nx=curx+dx[i]; + const int ny=cury+dy[i]; + if (!in_bounds(hm, nx, ny)) continue; + const float nslope=v-GET_VALUE(hm,nx,ny); + if (nslope > slope) { + slope=nslope; + nextx=nx; + nexty=ny; + } + } + if ( slope > 0.0f ) { +/* GET_VALUE(hm,curx,cury) *= 1.0f - (erosionCoef * slope); */ + GET_VALUE(hm,curx,cury) -= erosionCoef * slope; + curx=nextx; + cury=nexty; + sediment+=slope; + } else { +/* GET_VALUE(hm,curx,cury) *= 1.0f + (agregationCoef*sediment); */ + GET_VALUE(hm,curx,cury) += agregationCoef*sediment; + break; + } + } while (1); + } +} + +#if 0 +static void setMPDHeight(TCOD_heightmap_t *hm, TCOD_random_t rnd,int x,int y, float z, float offset); +static void setMDPHeightSquare(TCOD_heightmap_t *hm, TCOD_random_t rnd,int x, int y, int initsz, int sz,float offset); + +void TCOD_heightmap_heat_erosion(TCOD_heightmap_t *hm, int nbPass,float minSlope,float erosionCoef,float agregationCoef,TCOD_random_t rnd) { + if (!hm) { return; } + while ( nbPass-- > 0 ) { + for (int y=0; y < hm->h; y++) { + for (int x=0; x < hm->w; x++) { + static const int dx[8]={-1,0,1,-1,1,-1,0,1}; + static const int dy[8]={-1,-1,-1,0,0,1,1,1}; + int nextx=0,nexty=0,i; + const float v=GET_VALUE(hm, x, y); + /* calculate slope at x,y */ + float slope=0.0f; + for (i=0; i < 8; i++ ) { /* 4 : von neumann neighbourhood 8 : moore neighbourhood */ + const int nx=x+dx[i]; + const int ny=y+dy[i]; + if (in_bounds(hm, nx, ny)) { + const float nslope=v-GET_VALUE(hm,nx,ny); + if ( nslope > slope ) { + slope=nslope; + nextx=nx; + nexty=ny; + } + } + } + if ( slope > minSlope ) { + GET_VALUE(hm,x,y) -= erosionCoef*(slope-minSlope); + GET_VALUE(hm,nextx,nexty) += agregationCoef*(slope-minSlope); + } + } + } + } +} +#endif + +void TCOD_heightmap_kernel_transform(TCOD_heightmap_t *hm, int kernelsize, const int *dx, const int *dy, const float *weight, float minLevel,float maxLevel) { + if (!hm) { return; } + for (int y=0; y < hm->h; y++) { + for (int x=0; x < hm->w; x++) { + if (GET_VALUE(hm, x, y) >= minLevel && GET_VALUE(hm, x, y) <= maxLevel) { + float val=0.0f; + float totalWeight=0.0f; + for (int i=0; i < kernelsize; i++ ) { + const int nx=x+dx[i]; + const int ny=y+dy[i]; + if ( in_bounds(hm, nx, ny) ) { + val += weight[i] * GET_VALUE(hm,nx,ny); + totalWeight += weight[i]; + } + } + GET_VALUE(hm, x, y) = val/totalWeight; + } + } + } + +} + +void TCOD_heightmap_add_voronoi(TCOD_heightmap_t *hm, int nbPoints, int nbCoef, const float *coef,TCOD_random_t rnd) { + if (!hm) { return; } + typedef struct { + int x,y; + float dist; + } point_t; + if ( nbPoints <= 0 ) return; + point_t *pt = malloc(sizeof(point_t)*nbPoints); + nbCoef = MIN(nbCoef, nbPoints); + for (int i=0; i < nbPoints; i++ ) { + pt[i].x = TCOD_random_get_int(rnd,0,hm->w-1); + pt[i].y = TCOD_random_get_int(rnd,0,hm->h-1); + } + for (int y=0; y < hm->h; y++) { + for (int x=0; x < hm->w; x++) { + /* calculate distance to voronoi points */ + for (int i=0; i < nbPoints; i++ ) { + const int dx = pt[i].x - x; + const int dy = pt[i].y - y; + pt[i].dist = dx*dx + dy*dy; + } + for (int i=0; i < nbCoef; i++ ) { + /* get closest point */ + float minDist=1E8f; + int idx=-1; + for (int j=0; j < nbPoints; j++ ) { + if ( pt[j].dist < minDist ) { + idx=j; + minDist=pt[j].dist; + } + } + if (idx == -1) break; + GET_VALUE(hm, x, y)+=coef[i]*pt[idx].dist; + pt[idx].dist=1E8f; + } + } + } + free(pt); +} + +static void setMPDHeight(TCOD_heightmap_t *hm, TCOD_random_t rnd,int x,int y, float z, float offset); +static void setMDPHeightSquare(TCOD_heightmap_t *hm, TCOD_random_t rnd,int x, int y, int initsz, int sz,float offset); + +void TCOD_heightmap_mid_point_displacement(TCOD_heightmap_t *hm, TCOD_random_t rnd, float roughness) { + if (!hm) { return; } + int step = 1; + float offset = 1.0f; + int initsz = MIN(hm->w,hm->h)-1; + int sz = initsz; + hm->values[0] = TCOD_random_get_float(rnd,0.0f,1.0f); + hm->values[sz-1] = TCOD_random_get_float(rnd,0.0f,1.0f); + hm->values[(sz-1)*sz] = TCOD_random_get_float(rnd,0.0f,1.0f); + hm->values[sz*sz-1] = TCOD_random_get_float(rnd,0.0f,1.0f); + while (sz > 0) { + /* diamond step */ + for (int y=0; y < step; y++ ) { + for (int x=0; x < step; x++ ) { + const int diamondx = sz / 2 + x * sz; + const int diamondy = sz / 2 + y * sz; + float z = GET_VALUE(hm,x*sz,y*sz); + z += GET_VALUE(hm,(x+1)*sz,y*sz); + z += GET_VALUE(hm,(x+1)*sz,(y+1)*sz); + z += GET_VALUE(hm,x*sz,(y+1)*sz); + z *= 0.25f; + setMPDHeight(hm,rnd,diamondx,diamondy,z,offset); + } + } + offset*=roughness; + /* square step */ + for (int y=0; y < step; y++ ) { + for (int x=0; x < step; x++ ) { + int diamondx = sz / 2 + x * sz; + int diamondy = sz / 2 + y * sz; + /* north */ + setMDPHeightSquare(hm, rnd, diamondx, diamondy-sz/2, initsz,sz/2, offset); + /* south */ + setMDPHeightSquare(hm, rnd, diamondx, diamondy+sz/2, initsz,sz/2, offset); + /* west */ + setMDPHeightSquare(hm, rnd, diamondx-sz/2, diamondy, initsz,sz/2, offset); + /* east */ + setMDPHeightSquare(hm, rnd, diamondx+sz/2, diamondy, initsz,sz/2, offset); + } + } + sz /= 2; + step *= 2; + } +} + +/* private stuff */ +static void setMPDHeight(TCOD_heightmap_t *hm, TCOD_random_t rnd,int x,int y, float z, float offset) { + z += TCOD_random_get_float(rnd,-offset,offset); + GET_VALUE(hm,x,y)=z; +} + +static void setMDPHeightSquare(TCOD_heightmap_t *hm, TCOD_random_t rnd,int x, int y, int initsz, int sz,float offset) { + float z=0; + int count=0; + if ( y >= sz ) { + z += GET_VALUE(hm,x,y-sz); + count++; + } + if ( x >= sz ) { + z += GET_VALUE(hm,x-sz,y); + count++; + } + if ( y+sz < initsz ) { + z += GET_VALUE(hm,x,y+sz); + count++; + } + if ( x+sz < initsz ) { + z += GET_VALUE(hm,x+sz,y); + count++; + } + z /= count; + setMPDHeight(hm,rnd,x,y,z,offset); +} diff --git a/tcod_sys/libtcod/src/libtcod/image.cpp b/tcod_sys/libtcod/src/libtcod/image.cpp new file mode 100644 index 000000000..552faa6cd --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/image.cpp @@ -0,0 +1,130 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "image.hpp" + +TCODImage::TCODImage(const char *filename) : deleteData(true) { + data = TCOD_image_load(filename); +} + +TCODImage::TCODImage(int width, int height) : deleteData(true) { + data = TCOD_image_new(width,height); +} + +TCODImage::TCODImage(const TCODConsole *con) { + data = TCOD_image_from_console(con->get_data()); +} + +void TCODImage::clear(const TCODColor col) { + TCOD_color_t ccol; + ccol.r=col.r; + ccol.g=col.g; + ccol.b=col.b; + TCOD_image_clear(data,ccol); +} + +void TCODImage::getSize(int *w,int *h) const { + TCOD_image_get_size(data,w,h); +} + +TCODImage::~TCODImage() { + if ( deleteData ) TCOD_image_delete(data); +} + +TCODColor TCODImage::getPixel(int x, int y) const { + return TCOD_image_get_pixel(data,x,y); +} + +int TCODImage::getAlpha(int x,int y) const { + return TCOD_image_get_alpha(data,x,y); +} + +TCODColor TCODImage::getMipmapPixel(float x0,float y0, float x1, float y1) { + return TCOD_image_get_mipmap_pixel(data,x0,y0,x1,y1); +} + +void TCODImage::putPixel(int x, int y, const TCODColor col) { + TCOD_color_t ccol = {col.r,col.g,col.b}; + TCOD_image_put_pixel(data,x,y,ccol); +} + +void TCODImage::blit(TCODConsole *console, float x, float y, TCOD_bkgnd_flag_t bkgnd_flag, float scalex, float scaley, float angle) const +{ + TCOD_image_blit(data, console->get_data(), x, y, bkgnd_flag, scalex, scaley, angle); +} + +void TCODImage::blitRect(TCODConsole *console, int x, int y, int w, int h, TCOD_bkgnd_flag_t bkgnd_flag) const +{ + TCOD_image_blit_rect(data, console->get_data(), x, y, w, h, bkgnd_flag); +} + +void TCODImage::save(const char *filename) const { + TCOD_image_save(data,filename); +} + +void TCODImage::setKeyColor(const TCODColor keyColor) { + TCOD_color_t ccol = {keyColor.r,keyColor.g,keyColor.b}; + TCOD_image_set_key_color(data,ccol); +} + +bool TCODImage::isPixelTransparent(int x, int y) const { + return TCOD_image_is_pixel_transparent(data,x,y) != 0; +} + +void TCODImage::refreshConsole(const TCODConsole *console) +{ + TCOD_image_refresh_console(data,console->get_data()); +} + +void TCODImage::invert() { + TCOD_image_invert(data); +} + +void TCODImage::hflip() { + TCOD_image_hflip(data); +} + +void TCODImage::rotate90(int numRotations) { + TCOD_image_rotate90(data,numRotations); +} + +void TCODImage::vflip() { + TCOD_image_vflip(data); +} + +void TCODImage::scale(int neww, int newh) { + TCOD_image_scale(data,neww,newh); +} + +void TCODImage::blit2x(TCODConsole *dest, int dx, int dy, int sx, int sy, int w, int h) const +{ + TCOD_image_blit_2x(data, dest->get_data(), dx, dy, sx, sy, w, h); +} diff --git a/tcod_sys/libtcod/src/libtcod/image.h b/tcod_sys/libtcod/src/libtcod/image.h new file mode 100644 index 000000000..c209de4e9 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/image.h @@ -0,0 +1,112 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_IMAGE_H +#define _TCOD_IMAGE_H + +#include "portability.h" +#include "color.h" + +#include "console_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct TCOD_mipmap_{ + int width, height; + float fwidth, fheight; + TCOD_ColorRGB* buf; + bool dirty; +}; + +typedef struct TCOD_Image { + int nb_mipmaps; + struct TCOD_mipmap_* mipmaps; + TCOD_ColorRGB key_color; + bool has_key_color; +} TCOD_Image; + +typedef TCOD_Image *TCOD_image_t; + +TCODLIB_API TCOD_Image* TCOD_image_new(int width, int height); +/** + * Return a new image rendered from a console. + * + * This effectively returns a screenshot of the console. + */ +TCODLIB_API TCOD_Image* TCOD_image_from_console(const TCOD_Console* console); +/** + * Same as TCOD_image_from_console, but with an existing image. + */ +TCODLIB_API void TCOD_image_refresh_console(TCOD_Image* image, const TCOD_Console* console); +TCODLIB_API TCOD_Image* TCOD_image_load(const char *filename); +TCODLIB_API void TCOD_image_clear(TCOD_Image* image, TCOD_color_t color); +TCODLIB_API void TCOD_image_invert(TCOD_Image* image); +TCODLIB_API void TCOD_image_hflip(TCOD_Image* image); +TCODLIB_API void TCOD_image_rotate90(TCOD_Image* image, int numRotations); +TCODLIB_API void TCOD_image_vflip(TCOD_Image* image); +TCODLIB_API void TCOD_image_scale(TCOD_Image* image, int neww, int newh); +TCODLIB_API void TCOD_image_save(const TCOD_Image* image, const char *filename); +TCODLIB_API void TCOD_image_get_size(const TCOD_Image* image, int *w,int *h); +TCODLIB_API TCOD_color_t TCOD_image_get_pixel(const TCOD_Image* image, + int x, int y); +TCODLIB_API int TCOD_image_get_alpha(const TCOD_Image* image, int x, int y); +/** + * Return a mipmapped pixel of image. + * + * Mipmaps are updated when you call this, so it can't be called from multiple + * threads. + */ +TCODLIB_API TCOD_color_t TCOD_image_get_mipmap_pixel( + TCOD_Image* image, float x0, float y0, float x1, float y1); +TCODLIB_API void TCOD_image_put_pixel( + TCOD_Image* image, int x, int y, TCOD_color_t col); +TCODLIB_API void TCOD_image_blit( + TCOD_Image* image, TCOD_console_t console, float x, float y, + TCOD_bkgnd_flag_t bkgnd_flag, float scalex, float scaley, float angle); +TCODLIB_API void TCOD_image_blit_rect( + TCOD_Image* image, TCOD_console_t console, + int x, int y, int w, int h, TCOD_bkgnd_flag_t bkgnd_flag); +TCODLIB_API void TCOD_image_blit_2x( + const TCOD_Image* image, TCOD_console_t dest, + int dx, int dy, int sx, int sy, int w, int h); +TCODLIB_API void TCOD_image_delete(TCOD_Image* image); +TCODLIB_API void TCOD_image_set_key_color(TCOD_Image* image, + TCOD_color_t key_color); +TCODLIB_API bool TCOD_image_is_pixel_transparent( + const TCOD_Image* image, int x, int y); + +#ifdef __cplusplus +} +#endif + +#endif /* _TCOD_IMAGE_H */ diff --git a/tcod_sys/libtcod/include/image.hpp b/tcod_sys/libtcod/src/libtcod/image.hpp similarity index 91% rename from tcod_sys/libtcod/include/image.hpp rename to tcod_sys/libtcod/src/libtcod/image.hpp index ad90548ff..a5edca0ca 100644 --- a/tcod_sys/libtcod/include/image.hpp +++ b/tcod_sys/libtcod/src/libtcod/image.hpp @@ -1,45 +1,43 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_IMAGE_HPP #define _TCOD_IMAGE_HPP #include "color.hpp" -#ifdef TCOD_IMAGE_SUPPORT - -#ifdef TCOD_CONSOLE_SUPPORT #include "console.hpp" -#endif #include "image.h" -#ifdef TCOD_CONSOLE_SUPPORT class TCODConsole; -#endif class TCODLIB_API TCODImage { public : @@ -83,7 +81,6 @@ public : */ TCODImage(const char *filename); -#ifdef TCOD_CONSOLE_SUPPORT /** @PageName image_create @FuncTitle Creating an image from a console @@ -125,7 +122,6 @@ public : libtcod.image_refresh_console(pix,0) */ void refreshConsole(const TCODConsole *console); -#endif /** @PageName image_read @@ -349,7 +345,6 @@ public : */ void save(const char *filename) const; -#ifdef TCOD_CONSOLE_SUPPORT /** @PageName image_blit @PageFather image @@ -394,7 +389,6 @@ public : @Param angle Rotation angle in radians. */ void blit(TCODConsole *console, float x, float y, TCOD_bkgnd_flag_t bkgnd_flag = TCOD_BKGND_SET, float scalex=1.0f, float scaley=1.0f, float angle=0.0f) const; -#endif /** @PageName image_blit @@ -422,7 +416,6 @@ public : */ void setKeyColor(const TCODColor keyColor); -#ifdef TCOD_CONSOLE_SUPPORT /** @PageName image_blit @FuncTitle Blitting with subcell resolution @@ -449,7 +442,6 @@ public : @Param sx,sy,w,h Part of the image to blit. Use -1 in w and h to blit the whole image. */ void blit2x(TCODConsole *dest, int dx, int dy, int sx=0, int sy=0, int w=-1, int h=-1) const; -#endif TCODImage(TCOD_image_t img) : data(img), deleteData(false) {} virtual ~TCODImage(); @@ -457,10 +449,7 @@ public : protected : friend class TCODLIB_API TCODSystem; friend class TCODLIB_API TCODZip; - void *data; + struct TCOD_Image *data; bool deleteData; }; - -#endif /* TCOD_IMAGE_SUPPORT */ - #endif /* _TCOD_IMAGE_HPP */ diff --git a/tcod_sys/libtcod/src/libtcod/image_c.c b/tcod_sys/libtcod/src/libtcod/image_c.c new file mode 100644 index 000000000..b6ad17134 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/image_c.c @@ -0,0 +1,879 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "portability.h" +#include "image.h" + +#include +#include +#include +#include + +#include "console.h" +#include "libtcod_int.h" +#include "utility.h" + +#include + +static void TCOD_image_invalidate_mipmaps(TCOD_Image* image) +{ + if (!image) { return; } + for (int i = 1; i < image->nb_mipmaps; ++i) { + image->mipmaps[i].dirty = true; + } +} + +static int TCOD_image_get_mipmap_levels(int width, int height) +{ + int curw = width; + int curh = height; + int nb_mipmap = 0; + while (curw > 0 && curh > 0) { + ++nb_mipmap; + curw >>= 1; + curh >>= 1; + } + return nb_mipmap; +} + +static void TCOD_image_generate_mip(TCOD_Image* image, int mip) +{ + if (!image) { return; } + struct TCOD_mipmap_* orig = &image->mipmaps[0]; + struct TCOD_mipmap_* cur = &image->mipmaps[mip]; + if (!cur->buf) { + cur->buf = malloc(sizeof(*cur->buf) * cur->width * cur->height); + } + cur->dirty = false; + for (int x = 0; x < cur->width; ++x) { + for (int y = 0; y < cur->height; ++y) { + int r = 0; + int g = 0; + int b = 0; + int count = 0; + for (int sx = x << mip; sx < (x + 1) << mip; ++sx) { + for (int sy = y << mip; sy < (y + 1) << mip; ++sy) { + int offset = sx + sy * orig->width; + ++count; + r += orig->buf[offset].r; + g += orig->buf[offset].g; + b += orig->buf[offset].b; + } + } + cur->buf[x + y * cur->width] = (struct TCOD_ColorRGB){ + (uint8_t)(r / count), + (uint8_t)(g / count), + (uint8_t)(b / count), + }; + } + } +} + +void TCOD_image_clear(TCOD_Image* image, TCOD_color_t color) +{ + if (!image) { return; } + for (int i = 0; i < image->mipmaps[0].width * image->mipmaps[0].height; ++i) { + image->mipmaps[0].buf[i] = color; + } + for (int i = 1; i < image->nb_mipmaps; ++i) { + image->mipmaps[i].dirty = true; + } +} + +TCOD_Image* TCOD_image_new(int width, int height) +{ + TCOD_Image* ret = calloc(sizeof(*ret), 1); + if (!ret) { return NULL; } + ret->nb_mipmaps = TCOD_image_get_mipmap_levels(width, height); + ret->mipmaps = calloc(sizeof(*ret->mipmaps), ret->nb_mipmaps); + if (!ret->mipmaps) { + TCOD_image_delete(ret); + return NULL; + } + ret->mipmaps[0].buf = malloc(sizeof(*ret->mipmaps->buf) * width * height); + if (!ret->mipmaps[0].buf) { + TCOD_image_delete(ret); + return NULL; + } + + for (int i = 0; i < width * height; ++i) { + ret->mipmaps[0].buf[i] = (TCOD_ColorRGB){0, 0, 0}; + } + float fw = (float)width; + float fh = (float)height; + for (int i = 0; i < ret->nb_mipmaps; ++i) { + ret->mipmaps[i].width = width; + ret->mipmaps[i].height = height; + ret->mipmaps[i].fwidth = fw; + ret->mipmaps[i].fheight = fh; + width >>= 1; + height >>= 1; + fw *= 0.5f; + fh *= 0.5f; + } + return ret; +} + +TCOD_Image* TCOD_image_load(const char *filename) +{ + TCOD_Image* image = NULL; + SDL_Surface* surface = TCOD_sys_load_image(filename); + if (surface) { + image = TCOD_image_new(surface->w, surface->h); + if (image) { + SDL_ConvertPixels( + surface->w, + surface->h, + surface->format->format, + surface->pixels, + surface->pitch, + SDL_PIXELFORMAT_RGB24, + image->mipmaps[0].buf, + (int)sizeof(image->mipmaps[0].buf[0]) * surface->w); + TCOD_image_invalidate_mipmaps(image); + } + SDL_FreeSurface(surface); + } + return image; +} + +void TCOD_image_get_size(const TCOD_Image* image, int *w,int *h) +{ + if (!image) { return; } + *w = image->mipmaps[0].width; + *h = image->mipmaps[0].height; +} + +TCOD_color_t TCOD_image_get_pixel(const TCOD_Image* image, int x, int y) +{ + if (!image) { return (TCOD_ColorRGB){0, 0, 0}; } + if (x >= 0 && x < image->mipmaps[0].width + && y >= 0 && y < image->mipmaps[0].height) { + return image->mipmaps[0].buf[x + y * image->mipmaps[0].width]; + } + return (TCOD_ColorRGB){0, 0, 0}; +} + +int TCOD_image_get_alpha(const TCOD_Image* image,int x, int y) +{ + if (!image) { return 0; } + return 255; +} + +TCOD_color_t TCOD_image_get_mipmap_pixel( + TCOD_Image* image, float x0, float y0, float x1, float y1) +{ + if (!image) { return (TCOD_ColorRGB){0, 0, 0}; } + int cur_size = 1; + int mip = 0; + int texel_xsize = (int)(x1 - x0); + int texel_ysize = (int)(y1 - y0); + int texel_size = texel_xsize < texel_ysize ? texel_ysize : texel_xsize; + while (mip < image->nb_mipmaps - 1 && cur_size < texel_size) { + ++mip; + cur_size <<= 1; + } + if (mip > 0) { --mip; } + int texel_x = (int)( + x0 * (image->mipmaps[mip].width) / image->mipmaps[0].fwidth + ); + int texel_y = (int)( + y0 * (image->mipmaps[mip].height) / image->mipmaps[0].fheight + ); + if (image->mipmaps[mip].buf == NULL || image->mipmaps[mip].dirty) { + TCOD_image_generate_mip(image, mip); + } + if (texel_x < 0 || texel_y < 0 + || texel_x >= image->mipmaps[mip].width + || texel_y >= image->mipmaps[mip].height) { + return (TCOD_ColorRGB){0, 0, 0}; + } + return image->mipmaps[mip].buf[texel_x + + texel_y * image->mipmaps[mip].width]; +} + +void TCOD_image_put_pixel(TCOD_Image* image, int x, int y, TCOD_color_t col) +{ + if (!image) { return; } + if (x >= 0 && x < image->mipmaps[0].width + && y >= 0 && y < image->mipmaps[0].height) { + image->mipmaps[0].buf[x + y * image->mipmaps[0].width] = col; + for (int mip = 1; mip < image->nb_mipmaps; ++mip) { + image->mipmaps[mip].dirty = true; + } + } +} + +static void TCOD_image_delete_internal(TCOD_Image* image) +{ + if (!image) { return; } + if (image->mipmaps) { + for (int i=0; i < image->nb_mipmaps; ++i) { + if (image->mipmaps[i].buf) { free(image->mipmaps[i].buf); } + } + free(image->mipmaps); + image->mipmaps = NULL; + } +} + +void TCOD_image_delete(TCOD_Image* image) +{ + if (!image) { return; } + TCOD_image_delete_internal(image); + free(image); +} + +bool TCOD_image_is_pixel_transparent(const TCOD_Image* image, int x, int y) +{ + if (!image) { return false; } + TCOD_color_t col = TCOD_image_get_pixel(image, x, y); + if (image->has_key_color + && image->key_color.r == col.r + && image->key_color.g == col.g + && image->key_color.b == col.b) { + return true; + } + if (TCOD_image_get_alpha(image, x, y) == 0) { return true; } + return false; +} + +void TCOD_image_blit( + TCOD_Image* image, TCOD_Console* console, float x, float y, + TCOD_bkgnd_flag_t bkgnd_flag, float scalex, float scaley, float angle) +{ + if (!image) { return; } + console = TCOD_console_validate_(console); + if (!console) { return; } + if (scalex == 0.0f || scaley == 0.0f || bkgnd_flag == TCOD_BKGND_NONE) { + return; + } + int width, height; + TCOD_image_get_size(image, &width, &height); + float rx_ = x - width * 0.5f; + float ry_ = y - height * 0.5f; + if (scalex == 1.0f && scaley == 1.0f && angle == 0.0f + && rx_ == (int)rx_ && ry_ == (int)ry_) { + /* clip the image */ + int ix = (int)(x - width * 0.5f); + int iy = (int)(y - height * 0.5f); + int minx = MAX(ix, 0); + int miny = MAX(iy, 0); + int maxx = MIN(ix + width, TCOD_console_get_width(console)); + int maxy = MIN(iy + height, TCOD_console_get_height(console)); + int offx = 0; + int offy = 0; + if (ix < 0) { offx = -ix; } + if (iy < 0) { offy = -iy; } + for (int cx = minx; cx < maxx; ++cx) { + for (int cy = miny; cy < maxy; ++cy) { + TCOD_color_t col = TCOD_image_get_pixel( + image, cx - minx + offx, cy - miny + offy); + if (!image->has_key_color + || image->key_color.r != col.r + || image->key_color.g != col.g + || image->key_color.b != col.b) { + TCOD_console_set_char_background(console, cx, cy, col, bkgnd_flag); + } + } + } + } else { + float iw = width / 2 * scalex; + float ih = height / 2 * scaley; + /* get the coordinates of the image corners in the console */ + float newx_x = cosf(angle); + float newx_y = -sinf(angle); + float newy_x = newx_y; + float newy_y = -newx_x; + // image corners coordinates + /* 0 = P - w/2 x' +h/2 y' */ + int x0 = (int)(x - iw * newx_x + ih * newy_x); + int y0 = (int)(y - iw * newx_y + ih * newy_y); + /* 1 = P + w/2 x' + h/2 y' */ + int x1 = (int)(x + iw * newx_x + ih * newy_x); + int y1 = (int)(y + iw * newx_y + ih * newy_y); + /* 2 = P + w/2 x' - h/2 y' */ + int x2 = (int)(x + iw * newx_x - ih * newy_x); + int y2 = (int)(y + iw * newx_y - ih * newy_y); + /* 3 = P - w/2 x' - h/2 y' */ + int x3 = (int)(x - iw * newx_x - ih * newy_x); + int y3 = (int)(y - iw * newx_y - ih * newy_y); + /* get the affected rectangular area in the console */ + int rx = MIN(MIN(x0, x1), MIN(x2, x3)); + int ry = MIN(MIN(y0, y1), MIN(y2, y3)); + int rw = MAX(MAX(x0, x1), MAX(x2, x3)) - rx; + int rh = MAX(MAX(y0, y1), MAX(y2, y3)) - ry; + /* clip it */ + int minx = MAX(rx, 0); + int miny = MAX(ry, 0); + int maxx = MIN(rx + rw, TCOD_console_get_width(console)); + int maxy = MIN(ry + rh, TCOD_console_get_height(console)); + float invscalex = 1.0f / scalex; + float invscaley = 1.0f / scaley; + for (int cx = minx; cx < maxx; ++cx) { + for (int cy = miny; cy < maxy; ++cy) { + /* map the console pixel to the image world */ + float ix = (iw + (cx - x) * newx_x + (cy - y) * (-newy_x)) * invscalex; + float iy = (ih + (cx - x) * newx_y - (cy - y) * newy_y) * invscaley; + TCOD_color_t col = TCOD_image_get_pixel(image, (int)ix, (int)iy); + if (!image->has_key_color + || image->key_color.r != col.r + || image->key_color.g != col.g + || image->key_color.b != col.b ) { + if (scalex < 1.0f || scaley < 1.0f) { + col = TCOD_image_get_mipmap_pixel(image, + ix, iy, ix + 1.0f, iy + 1.0f); + } + TCOD_console_set_char_background(console, cx, cy, col, bkgnd_flag); + } + } + } + } +} + +void TCOD_image_blit_rect( + TCOD_Image* image, TCOD_Console* console, + int x, int y, int w, int h, TCOD_bkgnd_flag_t bkgnd_flag) +{ + if (!image) { return; } + console = TCOD_console_validate_(console); + if (!console) { return; } + int width, height; + TCOD_image_get_size(image, &width, &height); + if (w == -1) { w = width; } + if (h == -1) { h = height; } + if (w <= 0 || h <= 0 || bkgnd_flag == TCOD_BKGND_NONE) { return; } + float scalex = (float)w / width; + float scaley = (float)h / height; + TCOD_image_blit(image, console, x + w * 0.5f, y + h * 0.5f, bkgnd_flag, + scalex, scaley, 0.0f); +} + +TCOD_Image* TCOD_image_from_console(const TCOD_Console* console) +{ + console = TCOD_console_validate_(console); + if (!console) { return NULL; } + if (!TCOD_ctx.tileset) { return NULL; } + TCOD_Image* ret = TCOD_image_new( + TCOD_console_get_width(console) * TCOD_ctx.tileset->tile_width, + TCOD_console_get_height(console) * TCOD_ctx.tileset->tile_height); + if (!ret) { return NULL; } + TCOD_image_refresh_console(ret, console); + return ret; +} +void TCOD_image_refresh_console(TCOD_Image* image, const TCOD_Console* console) +{ + if (!image) { return; } + if (!TCOD_ctx.tileset) { return; } + console = TCOD_console_validate_(console); + if (!console) { return; } + for (int console_y = 0; console_y < console->h; ++console_y) { + for (int console_x = 0; console_x < console->w; ++console_x) { + // Get the console index and tileset graphic. + int console_i = console_y * console->w + console_x; + const struct TCOD_ConsoleTile* tile = &console->tiles[console_i]; + const TCOD_ColorRGBA* graphic = + TCOD_tileset_get_tile(TCOD_ctx.tileset, tile->ch); + for (int y = 0; y < TCOD_ctx.tileset->tile_height; ++y) { + for (int x = 0; x < TCOD_ctx.tileset->tile_width; ++x) { + struct TCOD_ColorRGBA out_rgba = tile->bg; + if (graphic) { + // Multiply the foreground and tileset colors, then blend with bg. + int graphic_i = y * TCOD_ctx.tileset->tile_width + x; + struct TCOD_ColorRGBA fg = { + tile->fg.r * graphic[graphic_i].r / 255, + tile->fg.g * graphic[graphic_i].g / 255, + tile->fg.b * graphic[graphic_i].b / 255, + tile->fg.a * graphic[graphic_i].a / 255, + }; + TCOD_color_alpha_blend(&out_rgba, &fg); + } + int out_x = console_x * TCOD_ctx.tileset->tile_width + x; + int out_y = console_y * TCOD_ctx.tileset->tile_width + y; + struct TCOD_ColorRGB out_rgb = {out_rgba.r, out_rgba.g, out_rgba.b}; + TCOD_image_put_pixel(image, out_x, out_y, out_rgb); + } + } + } + } +} + +void TCOD_image_save(const TCOD_Image* image, const char *filename) +{ + if (!image) { return; } + struct SDL_Surface* bitmap = NULL; + bool must_free = false; + bitmap = TCOD_sys_create_bitmap( + image->mipmaps[0].width, + image->mipmaps[0].height, + image->mipmaps[0].buf + ); + must_free=true; + if (bitmap) { + TCOD_sys_save_bitmap(bitmap, filename); + if (must_free) { + TCOD_sys_delete_bitmap(bitmap); + } + } +} + +void TCOD_image_set_key_color(TCOD_Image* image, TCOD_color_t key_color) +{ + if (!image) { return; } + image->has_key_color = true; + image->key_color = key_color; +} + +void TCOD_image_invert(TCOD_Image* image) +{ + if (!image) { return; } + int width, height; + TCOD_image_get_size(image, &width, &height); + for (int i = 0; i < width * height; ++i) { + TCOD_color_t col = image->mipmaps[0].buf[i]; + col.r = 255 - col.r; + col.g = 255 - col.g; + col.b = 255 - col.b; + image->mipmaps[0].buf[i] = col; + } + for (int mip = 1; mip < image->nb_mipmaps; ++mip) { + image->mipmaps[mip].dirty = true; + } +} + +void TCOD_image_hflip(TCOD_Image* image) +{ + if (!image) { return; } + int width, height; + TCOD_image_get_size(image, &width, &height); + for (int py = 0; py < height; ++py) { + for (int px = 0; px < width / 2; ++px) { + TCOD_color_t col1 = TCOD_image_get_pixel(image, px, py); + TCOD_color_t col2 = TCOD_image_get_pixel(image, width - 1 - px, py); + TCOD_image_put_pixel(image, px, py, col2); + TCOD_image_put_pixel(image, width - 1 - px, py, col1); + } + } +} + +void TCOD_image_vflip(TCOD_Image* image) +{ + if (!image) { return; } + int width, height; + TCOD_image_get_size(image, &width, &height); + for (int px = 0; px < width; ++px) { + for (int py = 0; py < height / 2; ++py) { + TCOD_color_t col1 = TCOD_image_get_pixel(image, px, py); + TCOD_color_t col2 = TCOD_image_get_pixel(image, px, height - 1 - py); + TCOD_image_put_pixel(image, px, py, col2); + TCOD_image_put_pixel(image, px, height - 1 - py, col1); + } + } +} + +void TCOD_image_rotate90(TCOD_Image* image, int numRotations) +{ + if (!image) { return; } + numRotations = numRotations % 4; + if (numRotations == 0) { return; } + if (numRotations < 0) numRotations += 4; + int width, height; + TCOD_image_get_size(image, &width, &height); + if (numRotations == 1) { + /* rotate 90 degrees */ + TCOD_Image* img2 = TCOD_image_new(height, width); + for (int px = 0; px < width; ++px) { + for (int py = 0; py < height; ++py) { + TCOD_color_t col1 = TCOD_image_get_pixel(image, px, py); + TCOD_image_put_pixel(img2, height - 1 - py, px, col1); + } + } + TCOD_image_delete_internal(image); + /* update image with the new image content */ + image->mipmaps = img2->mipmaps; + image->nb_mipmaps = img2->nb_mipmaps; + free(img2); + } else if (numRotations == 2) { + /* rotate 180 degrees */ + int maxy = height / 2 + ((height & 1) == 1 ? 1 : 0 ); + for (int px = 0; px < width; ++px) { + for (int py = 0; py < maxy; ++py) { + if (py != height - 1 - py || px < width / 2) { + TCOD_color_t col1 = TCOD_image_get_pixel(image, px, py); + TCOD_color_t col2 = TCOD_image_get_pixel( + image, width - 1 - px, height - 1 - py); + TCOD_image_put_pixel(image, px, py, col2); + TCOD_image_put_pixel(image, width - 1 - px, height - 1 - py, col1); + } + } + } + } else if (numRotations == 3) { + /* rotate 270 degrees */ + TCOD_Image* newImg = TCOD_image_new(height, width); + for (int px = 0; px < width; ++px) { + for (int py = 0; py < height; ++py) { + TCOD_color_t col1 = TCOD_image_get_pixel(image, px, py); + TCOD_image_put_pixel(newImg, py, width - 1 - px, col1); + } + } + TCOD_image_delete_internal(image); + /* update image with the new image content */ + image->mipmaps = newImg->mipmaps; + image->nb_mipmaps = newImg->nb_mipmaps; + free(newImg); + } +} + +void TCOD_image_scale(TCOD_Image* image, int neww, int newh) +{ + if (!image) { return; } + int width, height; + TCOD_image_get_size(image, &width, &height); + if ( neww == width && newh == height ) { return; } + if ( neww == 0 || newh == 0 ) { return; } + TCOD_Image* newimg = TCOD_image_new(neww, newh); + + if (neww < width && newh < height) { + /* scale down image, using supersampling */ + for (int py = 0; py < newh; ++py) { + float y0 = (float)py * height / newh; + float y0floor = floorf(y0); + float y0weight = 1.0f - (y0 - y0floor); + int iy0 = (int)y0floor; + + float y1 = (float)(py + 1) * height / newh; + float y1floor = floorf(y1 - 0.00001f); + float y1weight = (y1 - y1floor); + int iy1 = (int)y1floor; + + for (int px = 0; px < neww; ++px) { + float x0 = (float)px * width / neww; + float x0floor = floorf(x0); + float x0weight = 1.0f - (x0 - x0floor); + int ix0 = (int)x0floor; + + float x1 = (float)(px + 1) * width / neww; + float x1floor = floorf(x1 - 0.00001f); + float x1weight = (x1 - x1floor); + int ix1 = (int)x1floor; + + float r=0,g=0,b=0,sumweight=0.0f; + /* left & right fractional edges */ + for (int srcy = (int)y0 + 1; + srcy < (int)y1; + ++srcy) { + TCOD_color_t col_left = TCOD_image_get_pixel(image, ix0, srcy); + TCOD_color_t col_right = TCOD_image_get_pixel(image, ix1, srcy); + r += col_left.r * x0weight + col_right.r * x1weight; + g += col_left.g * x0weight + col_right.g * x1weight; + b += col_left.b * x0weight + col_right.b * x1weight; + sumweight += x0weight + x1weight; + } + /* top & bottom fractional edges */ + for (int srcx = (int)x0 + 1; + srcx < (int)x1; + ++srcx) { + TCOD_color_t col_top = TCOD_image_get_pixel(image, srcx, iy0); + TCOD_color_t col_bottom = TCOD_image_get_pixel(image, srcx, iy1); + r += col_top.r * y0weight + col_bottom.r * y1weight; + g += col_top.g * y0weight + col_bottom.g * y1weight; + b += col_top.b * y0weight + col_bottom.b * y1weight; + sumweight += y0weight + y1weight; + } + /* center */ + for (int srcy = (int)y0 + 1; + srcy < (int)y1; + ++srcy) { + for (int srcx = (int)x0 + 1; + srcx < (int)x1; + ++srcx) { + TCOD_color_t sample = TCOD_image_get_pixel(image, srcx, srcy); + r += sample.r; + g += sample.g; + b += sample.b; + sumweight += 1.0f; + } + } + /* corners */ + TCOD_color_t col = TCOD_image_get_pixel(image, ix0, iy0); + r += col.r * (x0weight * y0weight); + g += col.g * (x0weight * y0weight); + b += col.b * (x0weight * y0weight); + sumweight += x0weight * y0weight; + col = TCOD_image_get_pixel(image, ix0, iy1); + r += col.r * (x0weight * y1weight); + g += col.g * (x0weight * y1weight); + b += col.b * (x0weight * y1weight); + sumweight += x0weight * y1weight; + col = TCOD_image_get_pixel(image, ix1, iy1); + r += col.r * (x1weight * y1weight); + g += col.g * (x1weight * y1weight); + b += col.b * (x1weight * y1weight); + sumweight += x1weight * y1weight; + col = TCOD_image_get_pixel(image, ix1, iy0); + r += col.r * (x1weight * y0weight); + g += col.g * (x1weight * y0weight); + b += col.b * (x1weight * y0weight); + sumweight += x1weight * y0weight; + sumweight = 1.0f / sumweight; + r = r * sumweight + 0.5f; + g = g * sumweight + 0.5f; + b = b * sumweight + 0.5f; + col.r = (uint8_t)r; + col.g = (uint8_t)g; + col.b = (uint8_t)b; + TCOD_image_put_pixel(newimg, px, py, col); + } + } + } else { + /* scale up image, using nearest neightbor */ + for (int py = 0; py < newh; ++py) { + int srcy = py * height / newh; + for (int px = 0; px < neww; ++px) { + int srcx = px * width / neww; + TCOD_image_put_pixel( + newimg, px, py, TCOD_image_get_pixel(image, srcx, srcy) + ); + } + } + } + /* destroy old image */ + TCOD_image_delete_internal(image); + /* update image with the new image content */ + image->mipmaps = newimg->mipmaps; + image->nb_mipmaps = newimg->nb_mipmaps; + free(newimg); +} + + +/* distance between two colors */ +int rgbdist(const TCOD_color_t *c1, const TCOD_color_t *c2) +{ + int dr = (int)c1->r - c2->r; + int dg = (int)c1->g - c2->g; + int db = (int)c1->b - c2->b; + return dr * dr + dg * dg + db * db; +} + +void getPattern(const TCOD_color_t desired[4], TCOD_color_t palette[2], + int* nbCols, int* ascii) { + /* adapted from Jeff Lait's code posted on r.g.r.d */ + int flag = 0; + /* + pixels have following flag values : + X 1 + 2 4 + flag indicates which pixels uses foreground color (palette[1]) + */ + static int flagToAscii[8] = { + 0, + 0x259D, // Quadrant upper right. + 0x2597, // Quadrant lower left. + -0x259A, // Quadrant upper left and lower right. + 0x2596, // Quadrant lower right. + 0x2590, // Right half block. + -0x2580, // Upper half block. + -0x2598 // Quadrant upper left. + }; + int weight[2] = { 0, 0 }; + int i; + + /* First colour trivial. */ + palette[0] = desired[0]; + + /* Ignore all duplicates... */ + for (i = 1; i < 4; i++) { + if (!TCOD_color_equals(desired[i], palette[0])) { break; } + } + + /* All the same. */ + if (i == 4) { + *nbCols = 1; + return; + } + weight[0] = i; + + /* Found a second colour... */ + palette[1] = desired[i]; + weight[1] = 1; + flag |= 1 << (i - 1); + *nbCols = 2; + /* remaining colours */ + ++i; + while (i < 4) { + if (TCOD_color_equals(desired[i], palette[0])) { + ++weight[0]; + } else if (TCOD_color_equals(desired[i], palette[1])) { + flag |= 1 << (i - 1); + ++weight[1]; + } else { + /* Bah, too many colours, */ + /* merge the two nearest */ + int dist0i = rgbdist(&desired[i], &palette[0]); + int dist1i = rgbdist(&desired[i], &palette[1]); + int dist01 = rgbdist(&palette[0], &palette[1]); + if (dist0i < dist1i) { + if (dist0i <= dist01) { + /* merge 0 and i */ + palette[0] = TCOD_color_lerp( + desired[i], palette[0], weight[0] / (1.0f + weight[0]) + ); + ++weight[0]; + } else { + /* merge 0 and 1 */ + palette[0] = TCOD_color_lerp( + palette[0], + palette[1], + (float)weight[1] / (weight[0] + weight[1]) + ); + ++weight[0]; + palette[1] = desired[i]; + flag = 1 << (i - 1); + } + } else { + if (dist1i <= dist01) { + /* merge 1 and i */ + palette[1] = TCOD_color_lerp( + desired[i], palette[1], weight[1] / (1.0f + weight[1]) + ); + ++weight[1]; + flag |= 1 << (i - 1); + } else { + /* merge 0 and 1 */ + palette[0] = TCOD_color_lerp( + palette[0], + palette[1], + (float)weight[1] / (weight[0] + weight[1]) + ); + ++weight[0]; + palette[1] = desired[i]; + flag = 1 << (i - 1); + } + } + } + ++i; + } + *ascii = flagToAscii[flag]; +} + +void TCOD_image_blit_2x(const TCOD_Image* image, TCOD_Console* con, + int dx, int dy, int sx, int sy, int w, int h) +{ + if (!image) { return; } + con = TCOD_console_validate_(con); + if (!con) { return; } + TCOD_color_t grid[4]; + TCOD_color_t cols[2]; + + int width, height; + TCOD_image_get_size(image, &width, &height); + if (w == -1) { w = width; } + if (h == -1) { h = height; } + + /* check that the sx,sy/w,h rectangle is inside the image */ + TCOD_ASSERT(sx >= 0 && sy >= 0 && sx+w <= width && sy+h <= height); + TCOD_IFNOT(w > 0 && h > 0) { return; } + + sx = MAX(0, sx); + sy = MAX(0, sy); + w = MIN(w, width - sx); + h = MIN(h, height - sy); + + int maxx = dx + w / 2 <= con->w ? w : (con->w - dx) * 2; + int maxy = dy + h / 2 <= con->h ? h : (con->h - dy) * 2; + /* check that the image is not blitted outside the console */ + TCOD_IFNOT(dx + maxx / 2 >= 0 && dy + maxy / 2 >= 0 + && dx < con->w && dy < con->h) { return; } + maxx += sx; + maxy += sy; + + for (int cx = sx; cx < maxx; cx += 2) { + for (int cy = sy; cy < maxy; cy += 2) { + /* get the 2x2 super pixel colors from the image */ + int conx = dx + (cx - sx) / 2; + int cony = dy + (cy - sy) / 2; + TCOD_color_t consoleBack = + TCOD_console_get_char_background(con, conx, cony); + grid[0] = TCOD_image_get_pixel(image, cx, cy); + if (image->has_key_color + && TCOD_color_equals(grid[0], image->key_color)) { + grid[0] = consoleBack; + } + if (cx < maxx - 1) { + grid[1] = TCOD_image_get_pixel(image, cx + 1, cy); + if (image->has_key_color + && TCOD_color_equals(grid[1], image->key_color)) { + grid[1] = consoleBack; + } + } else { + grid[1] = consoleBack; + } + if (cy < maxy-1) { + grid[2] = TCOD_image_get_pixel(image, cx, cy + 1); + if (image->has_key_color + && TCOD_color_equals(grid[2], image->key_color)) { + grid[2] = consoleBack; + } + } else { + grid[2] = consoleBack; + } + if (cx < maxx-1 && cy < maxy-1) { + grid[3] = TCOD_image_get_pixel(image, cx + 1, cy + 1); + if (image->has_key_color + && TCOD_color_equals(grid[3], image->key_color)) { + grid[3] = consoleBack; + } + } else { + grid[3] = consoleBack; + } + /* analyse color, posterize, get pattern */ + int nbCols; + int ascii; + getPattern(grid, cols, &nbCols, &ascii); + if (nbCols == 1) { + /* single color */ + TCOD_console_set_char_background( + con, conx, cony, cols[0], TCOD_BKGND_SET); + TCOD_console_set_char(con, conx, cony, ' '); + } else if (ascii >= 0) { + TCOD_console_set_char_background(con, conx, cony, cols[0], + TCOD_BKGND_SET); + TCOD_console_set_char_foreground(con, conx, cony, cols[1]); + TCOD_console_set_char(con, conx, cony, ascii); + } else { + /* negative ascii code means we need to invert back/fore colors */ + TCOD_console_set_char_background(con, conx, cony, cols[1], + TCOD_BKGND_SET); + TCOD_console_set_char_foreground(con, conx, cony, cols[0]); + TCOD_console_set_char(con, conx, cony, -ascii); + } + } + } +} diff --git a/tcod_sys/libtcod/src/libtcod/lex.cpp b/tcod_sys/libtcod/src/libtcod/lex.cpp new file mode 100644 index 000000000..679c0eae1 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/lex.cpp @@ -0,0 +1,109 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "lex.hpp" + +#include +#include +#include +#include +#include + +#include "libtcod_int.h" + +TCODLex::TCODLex( + const char** _symbols, + const char** _keywords, + const char* simpleComment, + const char* commentStart, + const char* commentStop, + const char* javadocCommentStart, + const char* _stringDelim, + int _flags) +{ + data = TCOD_lex_new( + _symbols, + _keywords, + simpleComment, + commentStart, + commentStop, + javadocCommentStart, + _stringDelim, + _flags); +} +TCODLex::TCODLex() +{ + data = TCOD_lex_new_intern(); +} +TCODLex::~TCODLex() +{ + TCOD_lex_delete(data); +} +char* TCODLex::getLastJavadoc() +{ + return TCOD_lex_get_last_javadoc(data); +} +void TCODLex::setDataBuffer(char* dat) +{ + TCOD_lex_set_data_buffer(data, dat); +} +bool TCODLex::setDataFile(const char* _filename) +{ + return TCOD_lex_set_data_file(data, _filename) != 0; +} +int TCODLex::parse() +{ + return TCOD_lex_parse(data); +} +int TCODLex::parseUntil(int tokenType) +{ + return TCOD_lex_parse_until_token_type(data, tokenType); +} +int TCODLex::parseUntil(const char* tokenValue) +{ + return TCOD_lex_parse_until_token_value(data, tokenValue); +} +void TCODLex::savepoint(TCODLex* savepoint) +{ + TCOD_lex_savepoint(data, savepoint->data); +} +void TCODLex::restore(TCODLex* savepoint) +{ + TCOD_lex_restore(data, savepoint->data); +} +bool TCODLex::expect(int tokenType) +{ + return TCOD_lex_expect_token_type(data, tokenType) != 0; +} +bool TCODLex::expect(int tokenType, const char* tokenValue) +{ + return TCOD_lex_expect_token_value(data, tokenType, tokenValue) != 0; +} diff --git a/tcod_sys/libtcod/include/lex.h b/tcod_sys/libtcod/src/libtcod/lex.h similarity index 60% rename from tcod_sys/libtcod/include/lex.h rename to tcod_sys/libtcod/src/libtcod/lex.h index fe92b7ac4..bca810206 100644 --- a/tcod_sys/libtcod/include/lex.h +++ b/tcod_sys/libtcod/src/libtcod/lex.h @@ -1,109 +1,113 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/* - * This is a libtcod internal module. - * Use at your own risks... - */ -#ifndef _TCOD_LEX_H -#define _TCOD_LEX_H - -#include "libtcod_portability.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define TCOD_LEX_FLAG_NOCASE 1 -#define TCOD_LEX_FLAG_NESTING_COMMENT 2 -#define TCOD_LEX_FLAG_TOKENIZE_COMMENTS 4 - -#define TCOD_LEX_ERROR -1 -#define TCOD_LEX_UNKNOWN 0 -#define TCOD_LEX_SYMBOL 1 -#define TCOD_LEX_KEYWORD 2 -#define TCOD_LEX_IDEN 3 -#define TCOD_LEX_STRING 4 -#define TCOD_LEX_INTEGER 5 -#define TCOD_LEX_FLOAT 6 -#define TCOD_LEX_CHAR 7 -#define TCOD_LEX_EOF 8 -#define TCOD_LEX_COMMENT 9 - -#define TCOD_LEX_MAX_SYMBOLS 100 -#define TCOD_LEX_SYMBOL_SIZE 5 -#define TCOD_LEX_MAX_KEYWORDS 100 -#define TCOD_LEX_KEYWORD_SIZE 20 - -typedef struct { - int file_line, token_type, token_int_val, token_idx; - float token_float_val; - char *tok; - int toklen; - char lastStringDelim; - char *pos; - char *buf; - char *filename; - char *last_javadoc_comment; - /* private stuff */ - int nb_symbols, nb_keywords, flags; - char symbols[ TCOD_LEX_MAX_SYMBOLS][ TCOD_LEX_SYMBOL_SIZE ], - keywords[ TCOD_LEX_MAX_KEYWORDS ][ TCOD_LEX_KEYWORD_SIZE ]; - const char *simpleCmt; - const char *cmtStart, *cmtStop, *javadocCmtStart; - const char *stringDelim; - bool javadoc_read; - bool allocBuf; - bool savept; /* is this object a savepoint (no free in destructor) */ -} TCOD_lex_t; - -TCODLIB_API TCOD_lex_t *TCOD_lex_new_intern(void); -TCODLIB_API TCOD_lex_t *TCOD_lex_new(const char **symbols, const char **keywords, const char *simpleComment, - const char *commentStart, const char *commentStop, const char *javadocCommentStart, const char *stringDelim, int flags); -TCODLIB_API void TCOD_lex_delete(TCOD_lex_t *lex); - -TCODLIB_API void TCOD_lex_set_data_buffer(TCOD_lex_t *lex,char *dat); -TCODLIB_API bool TCOD_lex_set_data_file(TCOD_lex_t *lex,const char *filename); - -TCODLIB_API int TCOD_lex_parse(TCOD_lex_t *lex); -TCODLIB_API int TCOD_lex_parse_until_token_type(TCOD_lex_t *lex,int token_type); -TCODLIB_API int TCOD_lex_parse_until_token_value(TCOD_lex_t *lex,const char *token_value); - -TCODLIB_API bool TCOD_lex_expect_token_type(TCOD_lex_t *lex,int token_type); -TCODLIB_API bool TCOD_lex_expect_token_value(TCOD_lex_t *lex,int token_type,const char *token_value); - -TCODLIB_API void TCOD_lex_savepoint(TCOD_lex_t *lex,TCOD_lex_t *savept); -TCODLIB_API void TCOD_lex_restore(TCOD_lex_t *lex,TCOD_lex_t *savept); -TCODLIB_API char *TCOD_lex_get_last_javadoc(TCOD_lex_t *lex); -TCODLIB_API const char *TCOD_lex_get_token_name(int token_type); -TCODLIB_API char *TCOD_lex_get_last_error(void); - -TCODLIB_API int TCOD_lex_hextoint(char c); -#ifdef __cplusplus -} -#endif -#endif +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This is a libtcod internal module. + * Use at your own risks... + */ +#ifndef _TCOD_LEX_H +#define _TCOD_LEX_H + +#include "portability.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define TCOD_LEX_FLAG_NOCASE 1 +#define TCOD_LEX_FLAG_NESTING_COMMENT 2 +#define TCOD_LEX_FLAG_TOKENIZE_COMMENTS 4 + +#define TCOD_LEX_ERROR -1 +#define TCOD_LEX_UNKNOWN 0 +#define TCOD_LEX_SYMBOL 1 +#define TCOD_LEX_KEYWORD 2 +#define TCOD_LEX_IDEN 3 +#define TCOD_LEX_STRING 4 +#define TCOD_LEX_INTEGER 5 +#define TCOD_LEX_FLOAT 6 +#define TCOD_LEX_CHAR 7 +#define TCOD_LEX_EOF 8 +#define TCOD_LEX_COMMENT 9 + +#define TCOD_LEX_MAX_SYMBOLS 100 +#define TCOD_LEX_SYMBOL_SIZE 5 +#define TCOD_LEX_MAX_KEYWORDS 100 +#define TCOD_LEX_KEYWORD_SIZE 20 + +typedef struct { + int file_line, token_type, token_int_val, token_idx; + float token_float_val; + char *tok; + int toklen; + char lastStringDelim; + char *pos; + char *buf; + char *filename; + char *last_javadoc_comment; + /* private stuff */ + int nb_symbols, nb_keywords, flags; + char symbols[ TCOD_LEX_MAX_SYMBOLS][ TCOD_LEX_SYMBOL_SIZE ], + keywords[ TCOD_LEX_MAX_KEYWORDS ][ TCOD_LEX_KEYWORD_SIZE ]; + const char *simpleCmt; + const char *cmtStart, *cmtStop, *javadocCmtStart; + const char *stringDelim; + bool javadoc_read; + bool allocBuf; + bool savept; /* is this object a savepoint (no free in destructor) */ +} TCOD_lex_t; + +TCODLIB_API TCOD_lex_t *TCOD_lex_new_intern(void); +TCODLIB_API TCOD_lex_t *TCOD_lex_new(const char **symbols, const char **keywords, const char *simpleComment, + const char *commentStart, const char *commentStop, const char *javadocCommentStart, const char *stringDelim, int flags); +TCODLIB_API void TCOD_lex_delete(TCOD_lex_t *lex); + +TCODLIB_API void TCOD_lex_set_data_buffer(TCOD_lex_t *lex,char *dat); +TCODLIB_API bool TCOD_lex_set_data_file(TCOD_lex_t *lex,const char *filename); + +TCODLIB_API int TCOD_lex_parse(TCOD_lex_t *lex); +TCODLIB_API int TCOD_lex_parse_until_token_type(TCOD_lex_t *lex,int token_type); +TCODLIB_API int TCOD_lex_parse_until_token_value(TCOD_lex_t *lex,const char *token_value); + +TCODLIB_API bool TCOD_lex_expect_token_type(TCOD_lex_t *lex,int token_type); +TCODLIB_API bool TCOD_lex_expect_token_value(TCOD_lex_t *lex,int token_type,const char *token_value); + +TCODLIB_API void TCOD_lex_savepoint(TCOD_lex_t *lex,TCOD_lex_t *savept); +TCODLIB_API void TCOD_lex_restore(TCOD_lex_t *lex,TCOD_lex_t *savept); +TCODLIB_API char *TCOD_lex_get_last_javadoc(TCOD_lex_t *lex); +TCODLIB_API const char *TCOD_lex_get_token_name(int token_type); +TCODLIB_API char *TCOD_lex_get_last_error(void); + +TCODLIB_API int TCOD_lex_hextoint(char c); +#ifdef __cplusplus +} +#endif +#endif diff --git a/tcod_sys/libtcod/src/libtcod/lex.hpp b/tcod_sys/libtcod/src/libtcod/lex.hpp new file mode 100644 index 000000000..5a874af29 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/lex.hpp @@ -0,0 +1,118 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This is a libtcod internal module. + * Use at your own risks... + */ +#ifndef _TCOD_LEX_HPP +#define _TCOD_LEX_HPP + +#include "lex.h" + +class TCODLIB_API TCODLex { + public: + TCODLex(); + TCODLex( + const char** symbols, + const char** keywords, + const char* simpleComment="//", + const char* commentStart="/*", + const char* commentStop="*/", + const char* javadocCommentStart="/**", + const char* stringDelim="\"", + int flags=TCOD_LEX_FLAG_NESTING_COMMENT); + ~TCODLex(); + + void setDataBuffer(char* dat); + bool setDataFile(const char* filename); + + int parse(); + int parseUntil(int tokenType); + int parseUntil(const char* tokenValue); + + bool expect(int tokenType); + bool expect(int tokenType, const char* tokenValue); + + void savepoint(TCODLex* savept); + void restore(TCODLex* savept); + char* getLastJavadoc(); + + int getFileLine() + { + return data->file_line; + } + int getTokenType() + { + return data->token_type; + } + int getTokenIntVal() + { + return data->token_int_val; + } + int getTokenIdx() + { + return data->token_idx; + } + float getTokenFloatVal() + { + return data->token_float_val; + } + char* getToken() + { + return data->tok; + } + char getStringLastDelimiter() + { + return data->lastStringDelim; + } + char* getPos() + { return data->pos; } + char* getBuf() + { + return data->buf; + } + char* getFilename() + { + return data->filename; + } + char* getLastJavadocComment() + { + return data->last_javadoc_comment; + } + static const char* getTokenName(int tokenType) + { + return TCOD_lex_get_token_name(tokenType); + } + protected: + TCOD_lex_t* data; +}; +#endif // _TCOD_LEX_HPP diff --git a/tcod_sys/libtcod/src/lex_c.c b/tcod_sys/libtcod/src/libtcod/lex_c.c similarity index 83% rename from tcod_sys/libtcod/src/lex_c.c rename to tcod_sys/libtcod/src/libtcod/lex_c.c index 525a3b210..3a9e1bbab 100644 --- a/tcod_sys/libtcod/src/lex_c.c +++ b/tcod_sys/libtcod/src/libtcod/lex_c.c @@ -1,702 +1,705 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include -#include - -#define MAX_JAVADOC_COMMENT_SIZE 16384 - -/* damn ANSI C does not know strdup, strcasecmp, strncasecmp */ -char *TCOD_strdup(const char *str) { - size_t l = strlen(str) + 1; - char *duplicate = malloc(l); - if (duplicate) { strcpy(duplicate, str); } - return duplicate; -} - -int TCOD_strcasecmp(const char *s1, const char *s2) { - unsigned char c1,c2; - do { - c1 = *s1++; - c2 = *s2++; - c1 = (unsigned char) tolower( (unsigned char) c1); - c2 = (unsigned char) tolower( (unsigned char) c2); - } while((c1 == c2) && (c1 != '\0')); - return (int) c1-c2; -} - -int TCOD_strncasecmp(const char *s1, const char *s2, size_t n) { - unsigned char c1,c2; - do { - c1 = *s1++; - c2 = *s2++; - c1 = (unsigned char) tolower( (unsigned char) c1); - c2 = (unsigned char) tolower( (unsigned char) c2); - n--; - } while((c1 == c2) && (c1 != '\0') && n > 0); - return (int) c1-c2; -} - -static const char * TCOD_LEX_names[] = { - "unknown token", - "symbol", - "keyword", - "identifier", - "string", - "integer", - "float", - "char", - "eof" -}; - -static char *TCOD_last_error=NULL; - -const char *TCOD_lex_get_token_name(int token_type) { return TCOD_LEX_names[token_type]; } - -static void allocate_tok(TCOD_lex_t *lex, int len) { - if ( lex->toklen > len ) return; - while ( lex->toklen <= len ) lex->toklen *= 2; - lex->tok = (char *)realloc(lex->tok,lex->toklen); -} - - -char *TCOD_lex_get_last_error(void) { - return TCOD_last_error; -} - -TCOD_lex_t *TCOD_lex_new_intern(void) { - return (TCOD_lex_t *)calloc(1,sizeof(TCOD_lex_t)); -} - -TCOD_lex_t * TCOD_lex_new( const char **_symbols, const char **_keywords, const char *simpleComment, - const char *commentStart, const char *commentStop, const char *javadocCommentStart, - const char *_stringDelim, int _flags) -{ - TCOD_lex_t *lex=(TCOD_lex_t *)TCOD_lex_new_intern(); - lex->flags = _flags; - lex->last_javadoc_comment = (char *)calloc(sizeof(char),MAX_JAVADOC_COMMENT_SIZE ); - if ( _symbols ) - { - while ( _symbols[ lex->nb_symbols ] ) - { - if ( strlen( _symbols[ lex->nb_symbols ] ) >= TCOD_LEX_SYMBOL_SIZE ) - { - static char msg[255]; - sprintf (msg, "symbol '%s' too long (max size %d)", - _symbols[ lex->nb_symbols ], TCOD_LEX_SYMBOL_SIZE ); - TCOD_last_error=TCOD_strdup(msg); - TCOD_lex_delete (lex); - return NULL; - } - strcpy(lex->symbols[ lex->nb_symbols ], _symbols[ lex->nb_symbols ] ); - lex->nb_symbols++; - } - } - if ( _keywords ) - { - while ( _keywords[ lex->nb_keywords ] ) - { - if ( strlen( _keywords[ lex->nb_keywords ] ) >= TCOD_LEX_KEYWORD_SIZE ) - { - static char msg[255]; - sprintf(msg,"keyword '%s' too long (max size %d)", - _keywords[ lex->nb_keywords ], TCOD_LEX_KEYWORD_SIZE); - TCOD_last_error=TCOD_strdup(msg); - TCOD_lex_delete (lex); - return NULL; - } - if ( lex->flags & TCOD_LEX_FLAG_NOCASE ) - { - char *ptr = (char *)_keywords[ lex->nb_keywords ]; - while ( *ptr ) - { - *ptr = (char)toupper( *ptr); - ptr++; - } - } - strcpy(lex->keywords[ lex->nb_keywords ], _keywords[ lex->nb_keywords ] ); - lex->nb_keywords++; - } - } - lex->simpleCmt = simpleComment; - lex->cmtStart = commentStart; - lex->cmtStop = commentStop; - lex->javadocCmtStart = javadocCommentStart; - lex->stringDelim = _stringDelim; - lex->lastStringDelim='\0'; - lex->tok = (char *)calloc(sizeof(char),256); - lex->toklen=256; - return (TCOD_lex_t *)lex; -} - -char *TCOD_lex_get_last_javadoc(TCOD_lex_t *lex) -{ - if ( ! lex->javadoc_read && lex->last_javadoc_comment[0] != '\0' ) - { - lex->javadoc_read=true; - return lex->last_javadoc_comment; - } - lex->javadoc_read=false; - lex->last_javadoc_comment[0]='\0'; - return NULL; -} - -void TCOD_lex_delete(TCOD_lex_t *lex) -{ - if ( ! lex->savept ) - { - if ( lex->filename ) free( lex->filename ); - if ( lex->buf && lex->allocBuf ) free(lex->buf); - if ( lex->last_javadoc_comment ) free(lex->last_javadoc_comment); - } - lex->filename=NULL; - lex->buf = NULL; - lex->allocBuf=false; - if ( lex->tok ) free(lex->tok); - free(lex); -} - -void TCOD_lex_set_data_buffer_internal(TCOD_lex_t *lex) -{ - lex->file_line = 1; - lex->pos = lex->buf; - lex->token_type = TCOD_LEX_UNKNOWN; - lex->token_int_val = 0; - lex->token_float_val = 0.0; - lex->token_idx = -1; - lex->tok[0] = '\0'; -} - - -void TCOD_lex_set_data_buffer(TCOD_lex_t *lex,char *dat) -{ - lex->buf = dat; - lex->allocBuf = false; - TCOD_lex_set_data_buffer_internal(lex); -} - -bool TCOD_lex_set_data_file(TCOD_lex_t *lex, const char *_filename) -{ - FILE *f; - char *ptr; - long size; - if ( ! _filename ) { - TCOD_last_error = (char *)"Lex.setDatafile(NULL) called"; - return false; - } - f = fopen( _filename, "rb" ); - if ( f == NULL ) - { - static char msg[255]; - sprintf(msg, "Cannot open '%s'", _filename); - TCOD_last_error=TCOD_strdup(msg); - return false; - } - fseek(f, 0, SEEK_END); - size = ftell(f); - fclose(f); - f = fopen( _filename, "r" ); - - lex->buf = (char*)calloc(sizeof(char),(size + 1)); - lex->filename = TCOD_strdup( _filename ); - if ( lex->buf == NULL || lex->filename == NULL ) - { - fclose(f); - if ( lex->buf ) free(lex->buf); - if ( lex->filename ) { - free( lex->filename ); - } - TCOD_last_error=(char *)"Out of memory"; - return false; - } - ptr=lex->buf; - /* can't rely on size to read because of MS/DOS dumb CR/LF handling */ - while ( fgets(ptr, size,f ) ) - { - ptr += strlen(ptr); - } - fclose(f); - TCOD_lex_set_data_buffer_internal(lex); - lex->allocBuf=true; - return true; -} - -void TCOD_lex_get_new_line(TCOD_lex_t *lex) -{ - if ( *(lex->pos) == '\n' ) - { - lex->file_line ++; - lex->pos++; - } -} - -#ifdef TCOD_VISUAL_STUDIO -#pragma warning(disable:4127) /* conditional expression is constant */ -#endif - -int TCOD_lex_get_space(TCOD_lex_t *lex) -{ - char c; - char *startPos=NULL; - while ( 1 ) - { - while ( (c = *lex->pos) <= ' ') - { - if (c=='\n') - TCOD_lex_get_new_line(lex); - else if (c == 0) - return TCOD_LEX_EOF; /* end of file */ - else lex->pos++; - } - if ( lex->simpleCmt && strncmp(lex->pos, lex->simpleCmt, strlen(lex->simpleCmt)) == 0 ) - { - if ( ! startPos ) startPos = lex->pos; - while ( *lex->pos != '\0' && *lex->pos != '\n' ) - lex->pos++; - TCOD_lex_get_new_line(lex); - continue; - } - if ( lex->cmtStart && lex->cmtStop && strncmp(lex->pos, lex->cmtStart, strlen(lex->cmtStart)) == 0 ) - { - int isJavadoc=( lex->javadocCmtStart && strncmp(lex->pos, lex->javadocCmtStart, strlen(lex->javadocCmtStart)) == 0 ); - int cmtLevel=1; - char *javadocStart = NULL; - if ( ! startPos ) startPos = lex->pos; - if ( isJavadoc ) - { - javadocStart=lex->pos+strlen(lex->javadocCmtStart); - while ( isspace(*javadocStart) ) javadocStart++; - } - lex->pos++; - do - { - if ( *lex->pos == '\n' ) - { - TCOD_lex_get_new_line(lex); - } - else - lex->pos++; - if ( *lex->pos == '\0' ) - return TCOD_LEX_EOF; - if ( (lex->flags & TCOD_LEX_FLAG_NESTING_COMMENT) && strncmp(lex->pos-1, lex->cmtStart, strlen(lex->cmtStart)) == 0) cmtLevel++; - if ( strncmp(lex->pos-1, lex->cmtStop, strlen(lex->cmtStop)) == 0) cmtLevel--; - } while ( cmtLevel > 0 ); - lex->pos++; - if ( isJavadoc ) - { - char *src, *dst; - char *end = lex->pos - strlen(lex->cmtStop); - while ( isspace(*end) && end > javadocStart ) end --; - src = javadocStart; - dst = lex->last_javadoc_comment; - while ( src < end ) - { - /* skip heading spaces */ - while ( src < end && isspace(*src) && *src != '\n') src ++; - /* copy comment line */ - while ( src < end && *src != '\n' ) *dst++ = *src++; - if ( *src == '\n' ) *dst++ = *src++; - } - /* remove trailing spaces */ - while ( dst > lex->last_javadoc_comment && isspace (*(dst-1)) ) dst --; - *dst = '\0'; - lex->javadoc_read=false; - } - continue; - } - break; - } - if ( (lex->flags & TCOD_LEX_FLAG_TOKENIZE_COMMENTS) && startPos && lex->pos > startPos ) { - int len = (int)(lex->pos - startPos); - allocate_tok(lex, len+1); - strncpy(lex->tok,startPos,len); - lex->tok[len]=0; - lex->token_type = TCOD_LEX_COMMENT; - lex->token_idx = -1; - return TCOD_LEX_COMMENT; - } - return TCOD_LEX_UNKNOWN; -} - - - -int TCOD_lex_hextoint(char c) { - int v=toupper(c); - if ( v >= '0' && v <= '9' ) return v-'0'; - return 10 + (v-'A'); -} - -static bool TCOD_lex_get_special_char(TCOD_lex_t *lex, char *c) { - *c = *(++(lex->pos) ); - - switch ( *c ) - { - case 'n' : *c='\n'; break; - case 't' : *c='\t'; break; - case 'r' : *c='\r'; break; - case '\\' : - case '\"' : - case '\'' : - break; - case 'x' : - { - /* hexadecimal value "\x80" */ - int value=0; - bool hasHex=false; - *c = *(++(lex->pos) ); - while (( *c >= '0' && *c <= '9' ) || (*c >= 'a' && *c <= 'f') || (*c >= 'A' && *c <= 'F') ) { - hasHex=true; - value <<= 4; - value += TCOD_lex_hextoint(*c); - *c = *(++(lex->pos) ); - } - if (! hasHex ) { - TCOD_last_error=(char *)"\\x must be followed by an hexadecimal value"; - return false; - } - *c = value; - lex->pos--; - } - break; - case '0' : - case '1' : - case '2' : - case '3' : - case '4' : - case '5' : - case '6' : - case '7' : - { - /* octal value "\200" */ - int value=0; - while ( *c >= '0' && *c <= '7' ) { - value <<= 3; - value += (*c - '0'); - *c = *(++(lex->pos) ); - } - *c = value; - lex->pos--; - } - break; - default : - TCOD_last_error=(char *)"bad escape sequence inside quote"; - return false; - } - return true; -} - -int TCOD_lex_get_string(TCOD_lex_t *lex) -{ - char c; - int len = 0; - do - { - c= *(++(lex->pos)); - if ( c == '\0' ) { - TCOD_last_error=(char *)"EOF inside quote"; - return TCOD_LEX_ERROR; - } - if ( c == '\n' ) { - TCOD_last_error=(char *)"newline inside quote"; - return TCOD_LEX_ERROR; - } - if ( c== '\\' ) - { - if ( ! TCOD_lex_get_special_char(lex,&c) ) return TCOD_LEX_ERROR; - } - else if ( c == lex->lastStringDelim ) - { - allocate_tok(lex, len); - lex->tok[ len ] = '\0'; - lex->token_type = TCOD_LEX_STRING; - lex->token_idx = -1; - lex->pos++; - return TCOD_LEX_STRING; - } - allocate_tok(lex, len); - lex->tok[ len++ ] = c; - } while ( 1 ); -} - -#ifdef TCOD_VISUAL_STUDIO -#pragma warning(default:4127) /* conditional expression is constant */ -#endif - -int TCOD_lex_get_number(TCOD_lex_t *lex) -{ - int c; - int len; - char *ptr; - int bhex = 0, bfloat = 0; - - len = 0; - if ( *lex->pos == '-' ) - { - allocate_tok(lex, len); - lex->tok[ len ++ ] = '-'; - lex->pos++; - } - - c = toupper(*lex->pos); - - if ( c == '0' && ( lex->pos[1] == 'x' || lex->pos[1]=='X') ) - { - bhex = 1; - allocate_tok(lex, len); - lex->tok[ len ++ ] = '0'; - lex->pos++; - c = toupper( * (lex->pos)); - } - do - { - allocate_tok(lex, len); - lex->tok[ len++ ] = (char)c; - lex->pos++; - if ( c == '.' ) - { - if ( bhex ) { - TCOD_last_error=(char *)"bad constant format"; - return TCOD_LEX_ERROR; - } - bfloat = 1; - } - c = toupper(*lex->pos); - } while ((c >= '0' && c<= '9') - || ( bhex && c >= 'A' && c <= 'F' ) - || c == '.' ); - allocate_tok(lex, len); - lex->tok[len] = 0; - - if ( !bfloat ) - { - lex->token_int_val = strtol( lex->tok, &ptr, 0 ); - lex->token_float_val = (float)lex->token_int_val; - lex->token_type = TCOD_LEX_INTEGER; - lex->token_idx = -1; - return TCOD_LEX_INTEGER; - } - else - { - lex->token_float_val = (float)atof( lex->tok ); - lex->token_type = TCOD_LEX_FLOAT; - lex->token_idx = -1; - return TCOD_LEX_FLOAT; - } -} - -int TCOD_lex_get_char(TCOD_lex_t *lex) -{ - char c; - c= *(++(lex->pos)); - - if ( c == '\0' ) { - TCOD_last_error=(char *)"EOF inside simple quote"; - return TCOD_LEX_ERROR; - } - if ( c == '\n' ) { - TCOD_last_error=(char *)"newline inside simple quote"; - return TCOD_LEX_ERROR; - } - if ( c== '\\' ) - { - if ( ! TCOD_lex_get_special_char(lex,&c) ) return TCOD_LEX_ERROR; - lex->pos++; - } - else - lex->pos++; - - if ( *lex->pos != '\'' ) { - TCOD_last_error= (char *)"bad character inside simple quote" ; - return TCOD_LEX_ERROR; - } - lex->pos ++; - lex->tok[ 0 ] = c; - lex->tok[ 1 ] = '\0'; - lex->token_type = TCOD_LEX_CHAR; - lex->token_int_val = (int)c; - lex->token_idx = -1; - return TCOD_LEX_CHAR; -} - -int TCOD_lex_get_symbol(TCOD_lex_t *lex) -{ - int symb = 0; - static char msg[255]; - - while ( symb < lex->nb_symbols ) - { - if ( ( ( lex->flags & TCOD_LEX_FLAG_NOCASE ) - && TCOD_strncasecmp( lex->symbols[ symb ], lex->pos, strlen( lex->symbols[ symb ] ) ) == 0 ) - || ( strncmp( lex->symbols[ symb ], lex->pos, strlen( lex->symbols[ symb ] ) ) == 0 ) ) - { - strcpy( lex->tok, lex->symbols[ symb ] ); - lex->pos += strlen( lex->symbols[ symb ] ); - lex->token_idx = symb; - lex->token_type = TCOD_LEX_SYMBOL; - return TCOD_LEX_SYMBOL; - } - symb ++; - } - - lex->pos++; - sprintf(msg, "unknown symbol %.10s", lex->pos-1 ); - TCOD_last_error=TCOD_strdup(msg); - return TCOD_LEX_ERROR; -} - -int TCOD_lex_get_iden(TCOD_lex_t *lex) -{ - char c = *lex->pos; - int len = 0, key = 0; - - do - { - allocate_tok(lex, len); - lex->tok[ len++ ] = c; - c = *( ++ (lex->pos) ); - } while ( ( c >= 'a' && c <= 'z' ) - || ( c >= 'A' && c <= 'Z' ) - || ( c >= '0' && c <= '9' ) - || c == '_' ); - allocate_tok(lex, len); - lex->tok[len ] = 0; - - while ( key < lex->nb_keywords ) - { - if ( strcmp( lex->tok, lex->keywords[ key ] ) == 0 - || ( lex->flags & TCOD_LEX_FLAG_NOCASE && TCOD_strcasecmp( lex->tok, lex->keywords[ key ] ) == 0 )) - { - lex->token_type = TCOD_LEX_KEYWORD; - lex->token_idx = key; - return TCOD_LEX_KEYWORD; - } - key ++; - } - - lex->token_type = TCOD_LEX_IDEN; - lex->token_idx = -1; - return TCOD_LEX_IDEN; -} - -int TCOD_lex_parse(TCOD_lex_t *lex) -{ - char *ptr; - int token; - - token = TCOD_lex_get_space(lex); - if ( token == TCOD_LEX_ERROR ) return token; - ptr = lex->pos; - if ( token != TCOD_LEX_UNKNOWN ) - { - lex->token_type = token; - return token; - } - if ( strchr(lex->stringDelim, *ptr) ) - { - lex->lastStringDelim=*ptr; - return TCOD_lex_get_string(lex); - } - if ( *ptr == '\'' ) - { - return TCOD_lex_get_char(lex); - } - if ( isdigit( (int)(*ptr) ) - || ( *ptr == '-' && isdigit( (int)(ptr[1]) ) ) - ) - { - return TCOD_lex_get_number(lex); - } - if ( ( *ptr >= 'a' && *ptr <= 'z' ) || ( *ptr >= 'A' && *ptr <= 'Z' ) - || *ptr == '_' ) - { - return TCOD_lex_get_iden(lex); - } - return TCOD_lex_get_symbol(lex); -} - - -int TCOD_lex_parse_until_token_type(TCOD_lex_t *lex,int tokenType) -{ - int token; - token = TCOD_lex_parse(lex); - if ( token == TCOD_LEX_ERROR ) return token; - while ( token != TCOD_LEX_EOF ) - { - if ( token == tokenType ) - return token; - token = TCOD_lex_parse(lex); - if ( token == TCOD_LEX_ERROR ) return token; - } - return token; -} - -int TCOD_lex_parse_until_token_value(TCOD_lex_t *lex, const char *tokenValue) -{ - int token; - token = TCOD_lex_parse(lex); - if ( token == TCOD_LEX_ERROR ) return token; - { - while ( token != TCOD_LEX_EOF ) - if ( strcmp( lex->tok, tokenValue ) == 0 - || ( ( lex->flags & TCOD_LEX_FLAG_NOCASE ) && TCOD_strcasecmp(lex->tok, tokenValue ) == 0 ) ) - return token; - token = TCOD_lex_parse(lex); - if ( token == TCOD_LEX_ERROR ) return token; - } - return token; -} - -void TCOD_lex_savepoint(TCOD_lex_t *lex,TCOD_lex_t *_savept) -{ - TCOD_lex_t *savept=(TCOD_lex_t *)_savept; - *savept = *lex; - savept->tok = (char *)calloc(sizeof(char),lex->toklen); - strcpy(savept->tok,lex->tok); - savept->savept=true; -} - -void TCOD_lex_restore(TCOD_lex_t *lex,TCOD_lex_t *_savept) -{ - TCOD_lex_t *savept=(TCOD_lex_t *)_savept; - *lex = *savept; - lex->savept=false; -} - -bool TCOD_lex_expect_token_type(TCOD_lex_t *lex,int token_type) -{ - return (TCOD_lex_parse(lex) == token_type); -} - -bool TCOD_lex_expect_token_value(TCOD_lex_t *lex,int token_type, const char *token_value) -{ - TCOD_lex_parse(lex); - return (token_type == lex->token_type && strcmp(lex->tok, token_value) == 0 ); -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "lex.h" + +#include +#include +#include +#include + +#define MAX_JAVADOC_COMMENT_SIZE 16384 + +/* damn ANSI C does not know strdup, strcasecmp, strncasecmp */ +char *TCOD_strdup(const char *str) { + size_t l = strlen(str) + 1; + char *duplicate = malloc(l); + if (duplicate) { strcpy(duplicate, str); } + return duplicate; +} + +int TCOD_strcasecmp(const char *s1, const char *s2) { + unsigned char c1,c2; + do { + c1 = *s1++; + c2 = *s2++; + c1 = (unsigned char) tolower( (unsigned char) c1); + c2 = (unsigned char) tolower( (unsigned char) c2); + } while((c1 == c2) && (c1 != '\0')); + return (int) c1-c2; +} + +int TCOD_strncasecmp(const char *s1, const char *s2, size_t n) { + unsigned char c1,c2; + do { + c1 = *s1++; + c2 = *s2++; + c1 = (unsigned char) tolower( (unsigned char) c1); + c2 = (unsigned char) tolower( (unsigned char) c2); + n--; + } while((c1 == c2) && (c1 != '\0') && n > 0); + return (int) c1-c2; +} + +static const char * TCOD_LEX_names[] = { + "unknown token", + "symbol", + "keyword", + "identifier", + "string", + "integer", + "float", + "char", + "eof" +}; + +static char *TCOD_last_error=NULL; + +const char *TCOD_lex_get_token_name(int token_type) { return TCOD_LEX_names[token_type]; } + +static void allocate_tok(TCOD_lex_t *lex, int len) { + if ( lex->toklen > len ) return; + while ( lex->toklen <= len ) lex->toklen *= 2; + lex->tok = (char *)realloc(lex->tok,lex->toklen); +} + + +char *TCOD_lex_get_last_error(void) { + return TCOD_last_error; +} + +TCOD_lex_t *TCOD_lex_new_intern(void) { + return (TCOD_lex_t *)calloc(1,sizeof(TCOD_lex_t)); +} + +TCOD_lex_t * TCOD_lex_new( const char **_symbols, const char **_keywords, const char *simpleComment, + const char *commentStart, const char *commentStop, const char *javadocCommentStart, + const char *_stringDelim, int _flags) +{ + TCOD_lex_t *lex=(TCOD_lex_t *)TCOD_lex_new_intern(); + lex->flags = _flags; + lex->last_javadoc_comment = (char *)calloc(sizeof(char),MAX_JAVADOC_COMMENT_SIZE ); + if ( _symbols ) + { + while ( _symbols[ lex->nb_symbols ] ) + { + if ( strlen( _symbols[ lex->nb_symbols ] ) >= TCOD_LEX_SYMBOL_SIZE ) + { + static char msg[255]; + sprintf (msg, "symbol '%s' too long (max size %d)", + _symbols[ lex->nb_symbols ], TCOD_LEX_SYMBOL_SIZE ); + TCOD_last_error=TCOD_strdup(msg); + TCOD_lex_delete (lex); + return NULL; + } + strcpy(lex->symbols[ lex->nb_symbols ], _symbols[ lex->nb_symbols ] ); + lex->nb_symbols++; + } + } + if ( _keywords ) + { + while ( _keywords[ lex->nb_keywords ] ) + { + if ( strlen( _keywords[ lex->nb_keywords ] ) >= TCOD_LEX_KEYWORD_SIZE ) + { + static char msg[255]; + sprintf(msg,"keyword '%s' too long (max size %d)", + _keywords[ lex->nb_keywords ], TCOD_LEX_KEYWORD_SIZE); + TCOD_last_error=TCOD_strdup(msg); + TCOD_lex_delete (lex); + return NULL; + } + if ( lex->flags & TCOD_LEX_FLAG_NOCASE ) + { + char *ptr = (char *)_keywords[ lex->nb_keywords ]; + while ( *ptr ) + { + *ptr = (char)toupper( *ptr); + ptr++; + } + } + strcpy(lex->keywords[ lex->nb_keywords ], _keywords[ lex->nb_keywords ] ); + lex->nb_keywords++; + } + } + lex->simpleCmt = simpleComment; + lex->cmtStart = commentStart; + lex->cmtStop = commentStop; + lex->javadocCmtStart = javadocCommentStart; + lex->stringDelim = _stringDelim; + lex->lastStringDelim='\0'; + lex->tok = (char *)calloc(sizeof(char),256); + lex->toklen=256; + return (TCOD_lex_t *)lex; +} + +char *TCOD_lex_get_last_javadoc(TCOD_lex_t *lex) +{ + if ( ! lex->javadoc_read && lex->last_javadoc_comment[0] != '\0' ) + { + lex->javadoc_read=true; + return lex->last_javadoc_comment; + } + lex->javadoc_read=false; + lex->last_javadoc_comment[0]='\0'; + return NULL; +} + +void TCOD_lex_delete(TCOD_lex_t *lex) +{ + if ( ! lex->savept ) + { + if ( lex->filename ) free( lex->filename ); + if ( lex->buf && lex->allocBuf ) free(lex->buf); + if ( lex->last_javadoc_comment ) free(lex->last_javadoc_comment); + } + lex->filename=NULL; + lex->buf = NULL; + lex->allocBuf=false; + if ( lex->tok ) free(lex->tok); + free(lex); +} + +void TCOD_lex_set_data_buffer_internal(TCOD_lex_t *lex) +{ + lex->file_line = 1; + lex->pos = lex->buf; + lex->token_type = TCOD_LEX_UNKNOWN; + lex->token_int_val = 0; + lex->token_float_val = 0.0; + lex->token_idx = -1; + lex->tok[0] = '\0'; +} + + +void TCOD_lex_set_data_buffer(TCOD_lex_t *lex,char *dat) +{ + lex->buf = dat; + lex->allocBuf = false; + TCOD_lex_set_data_buffer_internal(lex); +} + +bool TCOD_lex_set_data_file(TCOD_lex_t *lex, const char *_filename) +{ + FILE *f; + char *ptr; + long size; + if ( ! _filename ) { + TCOD_last_error = (char *)"Lex.setDatafile(NULL) called"; + return false; + } + f = fopen( _filename, "rb" ); + if ( f == NULL ) + { + static char msg[255]; + sprintf(msg, "Cannot open '%s'", _filename); + TCOD_last_error=TCOD_strdup(msg); + return false; + } + fseek(f, 0, SEEK_END); + size = ftell(f); + fclose(f); + f = fopen( _filename, "r" ); + + lex->buf = (char*)calloc(sizeof(char),(size + 1)); + lex->filename = TCOD_strdup( _filename ); + if ( lex->buf == NULL || lex->filename == NULL ) + { + fclose(f); + if ( lex->buf ) free(lex->buf); + if ( lex->filename ) { + free( lex->filename ); + } + TCOD_last_error=(char *)"Out of memory"; + return false; + } + ptr=lex->buf; + /* can't rely on size to read because of MS/DOS dumb CR/LF handling */ + while ( fgets(ptr, size,f ) ) + { + ptr += strlen(ptr); + } + fclose(f); + TCOD_lex_set_data_buffer_internal(lex); + lex->allocBuf=true; + return true; +} + +void TCOD_lex_get_new_line(TCOD_lex_t *lex) +{ + if ( *(lex->pos) == '\n' ) + { + lex->file_line ++; + lex->pos++; + } +} + +#ifdef TCOD_VISUAL_STUDIO +#pragma warning(disable:4127) /* conditional expression is constant */ +#endif + +int TCOD_lex_get_space(TCOD_lex_t *lex) +{ + char c; + char *startPos=NULL; + while ( 1 ) + { + while ( (c = *lex->pos) <= ' ') + { + if (c=='\n') + TCOD_lex_get_new_line(lex); + else if (c == 0) + return TCOD_LEX_EOF; /* end of file */ + else lex->pos++; + } + if ( lex->simpleCmt && strncmp(lex->pos, lex->simpleCmt, strlen(lex->simpleCmt)) == 0 ) + { + if ( ! startPos ) startPos = lex->pos; + while ( *lex->pos != '\0' && *lex->pos != '\n' ) + lex->pos++; + TCOD_lex_get_new_line(lex); + continue; + } + if ( lex->cmtStart && lex->cmtStop && strncmp(lex->pos, lex->cmtStart, strlen(lex->cmtStart)) == 0 ) + { + int isJavadoc=( lex->javadocCmtStart && strncmp(lex->pos, lex->javadocCmtStart, strlen(lex->javadocCmtStart)) == 0 ); + int cmtLevel=1; + char *javadocStart = NULL; + if ( ! startPos ) startPos = lex->pos; + if ( isJavadoc ) + { + javadocStart=lex->pos+strlen(lex->javadocCmtStart); + while ( isspace(*javadocStart) ) javadocStart++; + } + lex->pos++; + do + { + if ( *lex->pos == '\n' ) + { + TCOD_lex_get_new_line(lex); + } + else + lex->pos++; + if ( *lex->pos == '\0' ) + return TCOD_LEX_EOF; + if ( (lex->flags & TCOD_LEX_FLAG_NESTING_COMMENT) && strncmp(lex->pos-1, lex->cmtStart, strlen(lex->cmtStart)) == 0) cmtLevel++; + if ( strncmp(lex->pos-1, lex->cmtStop, strlen(lex->cmtStop)) == 0) cmtLevel--; + } while ( cmtLevel > 0 ); + lex->pos++; + if ( isJavadoc ) + { + char *src, *dst; + char *end = lex->pos - strlen(lex->cmtStop); + while ( isspace(*end) && end > javadocStart ) end --; + src = javadocStart; + dst = lex->last_javadoc_comment; + while ( src < end ) + { + /* skip heading spaces */ + while ( src < end && isspace(*src) && *src != '\n') src ++; + /* copy comment line */ + while ( src < end && *src != '\n' ) *dst++ = *src++; + if ( *src == '\n' ) *dst++ = *src++; + } + /* remove trailing spaces */ + while ( dst > lex->last_javadoc_comment && isspace (*(dst-1)) ) dst --; + *dst = '\0'; + lex->javadoc_read=false; + } + continue; + } + break; + } + if ( (lex->flags & TCOD_LEX_FLAG_TOKENIZE_COMMENTS) && startPos && lex->pos > startPos ) { + int len = (int)(lex->pos - startPos); + allocate_tok(lex, len+1); + strncpy(lex->tok,startPos,len); + lex->tok[len]=0; + lex->token_type = TCOD_LEX_COMMENT; + lex->token_idx = -1; + return TCOD_LEX_COMMENT; + } + return TCOD_LEX_UNKNOWN; +} + + + +int TCOD_lex_hextoint(char c) { + int v=toupper(c); + if ( v >= '0' && v <= '9' ) return v-'0'; + return 10 + (v-'A'); +} + +static bool TCOD_lex_get_special_char(TCOD_lex_t *lex, char *c) { + *c = *(++(lex->pos) ); + + switch ( *c ) + { + case 'n' : *c='\n'; break; + case 't' : *c='\t'; break; + case 'r' : *c='\r'; break; + case '\\' : + case '\"' : + case '\'' : + break; + case 'x' : + { + /* hexadecimal value "\x80" */ + int value=0; + bool hasHex=false; + *c = *(++(lex->pos) ); + while (( *c >= '0' && *c <= '9' ) || (*c >= 'a' && *c <= 'f') || (*c >= 'A' && *c <= 'F') ) { + hasHex=true; + value <<= 4; + value += TCOD_lex_hextoint(*c); + *c = *(++(lex->pos) ); + } + if (! hasHex ) { + TCOD_last_error=(char *)"\\x must be followed by an hexadecimal value"; + return false; + } + *c = value; + lex->pos--; + } + break; + case '0' : + case '1' : + case '2' : + case '3' : + case '4' : + case '5' : + case '6' : + case '7' : + { + /* octal value "\200" */ + int value=0; + while ( *c >= '0' && *c <= '7' ) { + value <<= 3; + value += (*c - '0'); + *c = *(++(lex->pos) ); + } + *c = value; + lex->pos--; + } + break; + default : + TCOD_last_error=(char *)"bad escape sequence inside quote"; + return false; + } + return true; +} + +int TCOD_lex_get_string(TCOD_lex_t *lex) +{ + char c; + int len = 0; + do + { + c= *(++(lex->pos)); + if ( c == '\0' ) { + TCOD_last_error=(char *)"EOF inside quote"; + return TCOD_LEX_ERROR; + } + if ( c == '\n' ) { + TCOD_last_error=(char *)"newline inside quote"; + return TCOD_LEX_ERROR; + } + if ( c== '\\' ) + { + if ( ! TCOD_lex_get_special_char(lex,&c) ) return TCOD_LEX_ERROR; + } + else if ( c == lex->lastStringDelim ) + { + allocate_tok(lex, len); + lex->tok[ len ] = '\0'; + lex->token_type = TCOD_LEX_STRING; + lex->token_idx = -1; + lex->pos++; + return TCOD_LEX_STRING; + } + allocate_tok(lex, len); + lex->tok[ len++ ] = c; + } while ( 1 ); +} + +#ifdef TCOD_VISUAL_STUDIO +#pragma warning(default:4127) /* conditional expression is constant */ +#endif + +int TCOD_lex_get_number(TCOD_lex_t *lex) +{ + int c; + int len; + char *ptr; + int bhex = 0, bfloat = 0; + + len = 0; + if ( *lex->pos == '-' ) + { + allocate_tok(lex, len); + lex->tok[ len ++ ] = '-'; + lex->pos++; + } + + c = toupper(*lex->pos); + + if ( c == '0' && ( lex->pos[1] == 'x' || lex->pos[1]=='X') ) + { + bhex = 1; + allocate_tok(lex, len); + lex->tok[ len ++ ] = '0'; + lex->pos++; + c = toupper( * (lex->pos)); + } + do + { + allocate_tok(lex, len); + lex->tok[ len++ ] = (char)c; + lex->pos++; + if ( c == '.' ) + { + if ( bhex ) { + TCOD_last_error=(char *)"bad constant format"; + return TCOD_LEX_ERROR; + } + bfloat = 1; + } + c = toupper(*lex->pos); + } while ((c >= '0' && c<= '9') + || ( bhex && c >= 'A' && c <= 'F' ) + || c == '.' ); + allocate_tok(lex, len); + lex->tok[len] = 0; + + if ( !bfloat ) + { + lex->token_int_val = strtol( lex->tok, &ptr, 0 ); + lex->token_float_val = (float)lex->token_int_val; + lex->token_type = TCOD_LEX_INTEGER; + lex->token_idx = -1; + return TCOD_LEX_INTEGER; + } + else + { + lex->token_float_val = (float)atof( lex->tok ); + lex->token_type = TCOD_LEX_FLOAT; + lex->token_idx = -1; + return TCOD_LEX_FLOAT; + } +} + +int TCOD_lex_get_char(TCOD_lex_t *lex) +{ + char c; + c= *(++(lex->pos)); + + if ( c == '\0' ) { + TCOD_last_error=(char *)"EOF inside simple quote"; + return TCOD_LEX_ERROR; + } + if ( c == '\n' ) { + TCOD_last_error=(char *)"newline inside simple quote"; + return TCOD_LEX_ERROR; + } + if ( c== '\\' ) + { + if ( ! TCOD_lex_get_special_char(lex,&c) ) return TCOD_LEX_ERROR; + lex->pos++; + } + else + lex->pos++; + + if ( *lex->pos != '\'' ) { + TCOD_last_error= (char *)"bad character inside simple quote" ; + return TCOD_LEX_ERROR; + } + lex->pos ++; + lex->tok[ 0 ] = c; + lex->tok[ 1 ] = '\0'; + lex->token_type = TCOD_LEX_CHAR; + lex->token_int_val = (int)c; + lex->token_idx = -1; + return TCOD_LEX_CHAR; +} + +int TCOD_lex_get_symbol(TCOD_lex_t *lex) +{ + int symb = 0; + static char msg[255]; + + while ( symb < lex->nb_symbols ) + { + if ( ( ( lex->flags & TCOD_LEX_FLAG_NOCASE ) + && TCOD_strncasecmp( lex->symbols[ symb ], lex->pos, strlen( lex->symbols[ symb ] ) ) == 0 ) + || ( strncmp( lex->symbols[ symb ], lex->pos, strlen( lex->symbols[ symb ] ) ) == 0 ) ) + { + strcpy( lex->tok, lex->symbols[ symb ] ); + lex->pos += strlen( lex->symbols[ symb ] ); + lex->token_idx = symb; + lex->token_type = TCOD_LEX_SYMBOL; + return TCOD_LEX_SYMBOL; + } + symb ++; + } + + lex->pos++; + sprintf(msg, "unknown symbol %.10s", lex->pos-1 ); + TCOD_last_error=TCOD_strdup(msg); + return TCOD_LEX_ERROR; +} + +int TCOD_lex_get_iden(TCOD_lex_t *lex) +{ + char c = *lex->pos; + int len = 0, key = 0; + + do + { + allocate_tok(lex, len); + lex->tok[ len++ ] = c; + c = *( ++ (lex->pos) ); + } while ( ( c >= 'a' && c <= 'z' ) + || ( c >= 'A' && c <= 'Z' ) + || ( c >= '0' && c <= '9' ) + || c == '_' ); + allocate_tok(lex, len); + lex->tok[len ] = 0; + + while ( key < lex->nb_keywords ) + { + if ( strcmp( lex->tok, lex->keywords[ key ] ) == 0 + || ( lex->flags & TCOD_LEX_FLAG_NOCASE && TCOD_strcasecmp( lex->tok, lex->keywords[ key ] ) == 0 )) + { + lex->token_type = TCOD_LEX_KEYWORD; + lex->token_idx = key; + return TCOD_LEX_KEYWORD; + } + key ++; + } + + lex->token_type = TCOD_LEX_IDEN; + lex->token_idx = -1; + return TCOD_LEX_IDEN; +} + +int TCOD_lex_parse(TCOD_lex_t *lex) +{ + char *ptr; + int token; + + token = TCOD_lex_get_space(lex); + if ( token == TCOD_LEX_ERROR ) return token; + ptr = lex->pos; + if ( token != TCOD_LEX_UNKNOWN ) + { + lex->token_type = token; + return token; + } + if ( strchr(lex->stringDelim, *ptr) ) + { + lex->lastStringDelim=*ptr; + return TCOD_lex_get_string(lex); + } + if ( *ptr == '\'' ) + { + return TCOD_lex_get_char(lex); + } + if ( isdigit( (int)(*ptr) ) + || ( *ptr == '-' && isdigit( (int)(ptr[1]) ) ) + ) + { + return TCOD_lex_get_number(lex); + } + if ( ( *ptr >= 'a' && *ptr <= 'z' ) || ( *ptr >= 'A' && *ptr <= 'Z' ) + || *ptr == '_' ) + { + return TCOD_lex_get_iden(lex); + } + return TCOD_lex_get_symbol(lex); +} + + +int TCOD_lex_parse_until_token_type(TCOD_lex_t *lex, int tokenType) +{ + int token; + token = TCOD_lex_parse(lex); + if (token == TCOD_LEX_ERROR) { return token; } + while (token != TCOD_LEX_EOF) + { + if (token == tokenType) { return token; } + token = TCOD_lex_parse(lex); + if (token == TCOD_LEX_ERROR) { return token; } + } + return token; +} + +int TCOD_lex_parse_until_token_value(TCOD_lex_t *lex, const char *tokenValue) +{ + int token = TCOD_lex_parse(lex); + if (token == TCOD_LEX_ERROR) { return token; } + while (token != TCOD_LEX_EOF) { + if (strcmp(lex->tok, tokenValue) == 0 + || ((lex->flags & TCOD_LEX_FLAG_NOCASE) + && TCOD_strcasecmp(lex->tok, tokenValue) == 0)) { + return token; + } + token = TCOD_lex_parse(lex); + if (token == TCOD_LEX_ERROR) { return token; } + } + return token; +} + +void TCOD_lex_savepoint(TCOD_lex_t *lex,TCOD_lex_t *_savept) +{ + TCOD_lex_t *savept=(TCOD_lex_t *)_savept; + *savept = *lex; + savept->tok = (char *)calloc(sizeof(char),lex->toklen); + strcpy(savept->tok,lex->tok); + savept->savept=true; +} + +void TCOD_lex_restore(TCOD_lex_t *lex,TCOD_lex_t *_savept) +{ + TCOD_lex_t *savept=(TCOD_lex_t *)_savept; + *lex = *savept; + lex->savept=false; +} + +bool TCOD_lex_expect_token_type(TCOD_lex_t *lex,int token_type) +{ + return (TCOD_lex_parse(lex) == token_type); +} + +bool TCOD_lex_expect_token_value(TCOD_lex_t *lex,int token_type, const char *token_value) +{ + TCOD_lex_parse(lex); + return (token_type == lex->token_type && strcmp(lex->tok, token_value) == 0 ); +} diff --git a/tcod_sys/libtcod/src/libtcod/libtcod.h b/tcod_sys/libtcod/src/libtcod/libtcod.h new file mode 100644 index 000000000..dd825d2bd --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/libtcod.h @@ -0,0 +1,103 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _LIBTCOD_H +#define _LIBTCOD_H + +#include "portability.h" +#include "utility.h" +#include "version.h" + +#include "bresenham.h" +#include "bsp.h" +#include "color.h" +#include "console.h" +#include "console_drawing.h" +#include "console_etc.h" +#include "console_init.h" +#include "console_printing.h" +#include "console_rexpaint.h" +#include "context.h" +#include "context_init.h" +#include "error.h" +#include "fov.h" +#include "globals.h" +#include "heightmap.h" +#include "image.h" +#include "lex.h" +#include "list.h" +#include "mersenne.h" +#include "mouse.h" +#include "namegen.h" +#include "noise.h" +#include "path.h" +#include "pathfinder.h" +#include "pathfinder_frontier.h" +#include "parser.h" +#include "renderer_gl.h" +#include "renderer_gl1.h" +#include "renderer_gl2.h" +#include "renderer_sdl2.h" +#include "sys.h" +#include "tileset.h" +#include "tileset_bdf.h" +#include "tileset_fallback.h" +#include "tileset_render.h" +#include "tileset_truetype.h" +#include "tree.h" +#include "txtfield.h" +#include "zip.h" + +#include "sdl2/event.h" + +#ifdef __cplusplus +#include "bresenham.hpp" +#include "bsp.hpp" +#include "color.hpp" +#include "console.hpp" +#include "fov.hpp" +#include "heightmap.hpp" +#include "image.hpp" +#include "lex.hpp" +#include "list.hpp" +#include "mersenne.hpp" +#include "mouse.hpp" +#include "namegen.hpp" +#include "noise.hpp" +#include "parser.hpp" +#include "path.hpp" +#include "sys.hpp" +#include "tree.hpp" +#include "txtfield.hpp" +#include "zip.hpp" +#endif // __cplusplus + +#endif diff --git a/tcod_sys/libtcod/src/libtcod/libtcod.hpp b/tcod_sys/libtcod/src/libtcod/libtcod.hpp new file mode 100644 index 000000000..4de7afbcc --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/libtcod.hpp @@ -0,0 +1,32 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "libtcod.h" diff --git a/tcod_sys/libtcod/include/libtcod_int.h b/tcod_sys/libtcod/src/libtcod/libtcod_int.h similarity index 67% rename from tcod_sys/libtcod/include/libtcod_int.h rename to tcod_sys/libtcod/src/libtcod/libtcod_int.h index efe5d3698..c3e231ad2 100644 --- a/tcod_sys/libtcod/include/libtcod_int.h +++ b/tcod_sys/libtcod/src/libtcod/libtcod_int.h @@ -1,566 +1,520 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCODLIB_INT_H -#define _TCODLIB_INT_H -#include -#include -#if defined(__ANDROID__) -#include -#endif - -#include "libtcod_portability.h" -#include "color.h" -#include "console_types.h" -#include "fov.h" -#include "fov_types.h" -#include "mersenne_types.h" -#include "sys.h" - -/* tcodlib internal stuff */ -#ifdef __cplusplus -extern "C" { -#endif - -/* SDL2 forward declarations */ -struct SDL_Surface; -struct SDL_Window; -struct SDL_Renderer; - -#ifdef TCOD_CONSOLE_SUPPORT -typedef struct { - int *ch_array; /* character code array */ - TCOD_image_t fg_colors, bg_colors; - /* console width and height (in characters,not pixels) */ - int w,h; - /* default background operator for print & print_rect functions */ - TCOD_bkgnd_flag_t bkgnd_flag; - /* default alignment for print & print_rect functions */ - TCOD_alignment_t alignment; - /* foreground (text), background colors */ - TCOD_color_t fore, back; -} TCOD_console_data_t; -#endif - -/* fov internal stuff */ -typedef struct { - bool transparent:1; - bool walkable:1; - bool fov:1; -} cell_t; - -typedef struct { - int width; - int height; - int nbcells; - cell_t *cells; -} map_t; - -/* pseudorandom number generator toolkit */ -typedef struct { - /* algorithm identifier */ - TCOD_random_algo_t algo; - /* distribution */ - TCOD_distribution_t distribution; - /* Mersenne Twister stuff */ - uint32_t mt[624]; - int cur_mt; - /* Complementary-Multiply-With-Carry stuff */ - /* shared with Generalised Feedback Shift Register */ - uint32_t Q[4096], c; - int cur; -} mersenne_data_t; - -typedef struct { - /* number of characters in the bitmap font */ - int fontNbCharHoriz; - int fontNbCharVertic; - /* font type and layout */ - bool font_tcod_layout; - bool font_in_row; - bool font_greyscale; - /* character size in font */ - int font_width; - int font_height; - char font_file[512]; - char window_title[512]; - /* ascii code to tcod layout converter */ - int *ascii_to_tcod; - /* whether each character in the font is a colored tile */ - bool *colored; -#ifdef TCOD_CONSOLE_SUPPORT - /* the root console */ - TCOD_console_data_t *root; - /* nb chars in the font */ - int max_font_chars; - /* fullscreen data */ - bool fullscreen; - int fullscreen_offsetx; - int fullscreen_offsety; - /* asked by the user */ - int fullscreen_width; - int fullscreen_height; - /* actual resolution */ - int actual_fullscreen_width; - int actual_fullscreen_height; -#endif -#ifndef TCOD_BARE - /* renderer to use */ - TCOD_renderer_t renderer; - /* user post-processing callback */ - SDL_renderer_t sdl_cbk; -#endif - /* fading data */ - TCOD_color_t fading_color; - uint8_t fade; -#ifdef TCOD_CONSOLE_SUPPORT - TCOD_key_t key_state; -#endif -#ifndef TCOD_BARE - /* application window was closed */ - bool is_window_closed; - /* application has mouse focus */ - bool app_has_mouse_focus; - /* application is active (not iconified) */ - bool app_is_active; -#endif -} TCOD_internal_context_t; - -extern TCOD_internal_context_t TCOD_ctx; - -#if defined(__ANDROID__) && !defined(NDEBUG) -#include -#ifdef printf -#undef printf -#endif -#ifdef vprintf -#undef vprintf -#endif -#define printf(args...) __android_log_print(ANDROID_LOG_INFO, "libtcod", ## args) -#define vprintf(args...) __android_log_vprint(ANDROID_LOG_INFO, "libtcod", ## args) - -#ifdef assert -#undef assert -#endif -#define assert(cond) if(!(cond)) __android_log_assert(#cond, "libtcod", "assertion failed: %s", #cond) -#endif - -#ifdef NDEBUG -#define TCOD_IF(x) if (x) -#define TCOD_IFNOT(x) if (!(x)) -#define TCOD_ASSERT(x) -#define TCOD_LOG(x) -#else -#define TCOD_IF(x) assert(x); -#define TCOD_IFNOT(x) assert(x); if (0) -#define TCOD_ASSERT(x) assert(x) -#define TCOD_LOG(x) printf x -#endif - -#if !defined(TCOD_BARE) && !defined(NO_OPENGL) -/* opengl utilities */ -void TCOD_opengl_init_attributes(void); -bool TCOD_opengl_init_state(int conw, int conh, void *font_tex); -void TCOD_opengl_uninit_state(void); -bool TCOD_opengl_init_shaders(void); -bool TCOD_opengl_render(int oldFade, bool *ascii_updated, TCOD_console_data_t *console, TCOD_console_data_t *cache); -void TCOD_opengl_swap(void); -void * TCOD_opengl_get_screen(void); -#endif - -#ifdef TCOD_IMAGE_SUPPORT -/* image internal stuff */ -bool TCOD_image_mipmap_copy_internal(TCOD_image_t srcImage, TCOD_image_t dstImage); -TCOD_color_t *TCOD_image_get_colors(TCOD_image_t *image); -void TCOD_image_invalidate_mipmaps(TCOD_image_t *image); -void TCOD_image_get_key_data(TCOD_image_t image, bool *has_key_color, TCOD_color_t *key_color); -#endif - -/* fov internal stuff */ -void TCOD_map_compute_fov_circular_raycasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls); -void TCOD_map_compute_fov_diamond_raycasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls); -void TCOD_map_compute_fov_recursive_shadowcasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls); -void TCOD_map_compute_fov_permissive2(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls, int fovType); -void TCOD_map_compute_fov_restrictive_shadowcasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls); -void TCOD_map_postproc(map_t *map,int x0,int y0, int x1, int y1, int dx, int dy); - -#ifdef TCOD_CONSOLE_SUPPORT -/* TCODConsole non public methods*/ -bool TCOD_console_init(TCOD_console_t con,const char *title, bool fullscreen); -int TCOD_console_print_internal(TCOD_console_t con,int x,int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t align, char *msg, bool can_split, bool count_only); -int TCOD_console_stringLength(const unsigned char *s); -unsigned char * TCOD_console_forward(unsigned char *s,int l); -char *TCOD_console_vsprint(const char *fmt, va_list ap); -#endif - -/* fatal errors */ -void TCOD_fatal(const char *fmt, ...); -void TCOD_fatal_nopar(const char *msg); - -/* TCODSystem non public methods */ -#ifdef TCOD_CONSOLE_SUPPORT -bool TCOD_sys_init(TCOD_console_data_t *console, bool fullscreen); -void TCOD_sys_uninit(void); -void TCOD_sys_set_custom_font(const char *font_name,int nb_ch, int nb_cv,int flags); -void TCOD_sys_map_ascii_to_font(int asciiCode, int fontCharX, int fontCharY); -void *TCOD_sys_create_bitmap_for_console(TCOD_console_t console); -void TCOD_sys_save_bitmap(void *bitmap, const char *filename); -void *TCOD_sys_create_bitmap(int width, int height, TCOD_color_t *buf); -void TCOD_sys_delete_bitmap(void *bitmap); -void TCOD_sys_console_to_bitmap(void *bitmap, TCOD_console_data_t *console, - TCOD_console_data_t *cache); -TCODLIB_API void *TCOD_sys_get_surface(int width, int height, bool alpha); -void TCOD_sys_save_fps(void); -void TCOD_sys_restore_fps(void); -void TCOD_sys_set_dirty(int dx, int dy, int dw, int dh); -void TCOD_sys_set_dirty_character_code(int ch); -int TCOD_get_tileid_for_charcode_(int charcode); - -/* switch fullscreen mode */ -void TCOD_sys_set_fullscreen(bool fullscreen); -void TCOD_sys_set_clear_screen(void); -void TCOD_sys_set_scale_factor(float value); -void TCOD_sys_convert_console_to_screen_coords(int cx, int cy, int *sx, int *sy); -void TCOD_sys_convert_screen_to_console_coords(int sx, int sy, int *cx, int *cy); -void TCOD_sys_flush(bool render); -TCOD_key_t TCOD_sys_check_for_keypress(int flags); -TCOD_key_t TCOD_sys_wait_for_keypress(bool flush); -bool TCOD_sys_is_key_pressed(TCOD_keycode_t key); -void TCOD_sys_set_window_title(const char *title); -#endif - -/* UTF-8 stuff */ -#ifndef NO_UNICODE -wchar_t *TCOD_console_vsprint_utf(const wchar_t *fmt, va_list ap); -int TCOD_console_print_internal_utf(TCOD_console_t con,int x,int y, int rw, int rh, TCOD_bkgnd_flag_t flag, - TCOD_alignment_t align, wchar_t *msg, bool can_split, bool count_only); -#endif - -#ifdef TCOD_IMAGE_SUPPORT -/* image manipulation */ -TCODLIB_API void *TCOD_sys_load_image(const char *filename); -void TCOD_sys_get_image_size(const void *image, int *w,int *h); -TCOD_color_t TCOD_sys_get_image_pixel(const void *image,int x, int y); -int TCOD_sys_get_image_alpha(const void *image,int x, int y); -bool TCOD_sys_check_magic_number(const char *filename, size_t size, uint8_t *data); -#endif - -/* TCOD_list nonpublic methods */ -void TCOD_list_set_size(TCOD_list_t l, int size); - -#ifndef TCOD_BARE -/* - SDL12/SDL2 abstraction layer -*/ -typedef struct TCOD_SDL_driver_t { - float scale_xc; - float scale_yc; - - /* get a fullscreen mode suitable for the console */ - void (*get_closest_mode)(int *w, int *h); - /* render the console on a surface/texture */ - void (*render)(struct TCOD_SDL_driver_t *sdl, void *vbitmap, TCOD_console_data_t *console); - /* create a new surface */ - struct SDL_Surface *(*create_surface) (int width, int height, bool with_alpha); - /* create the game window */ - void (*create_window)(int w, int h, bool fullscreen); - /* destroy the game window */ - void (*destroy_window)(void); - /* switch fullscreen on/off */ - void (*set_fullscreen)(bool fullscreen); - /* change the game window title */ - void (*set_window_title)(const char *title); - /* save game screenshot */ - void (*save_screenshot)(const char *filename); - /* get desktop resolution */ - void (*get_current_resolution)(int *w, int *h); - /* change the mouse cursor position */ - void (*set_mouse_position)(int x, int y); - /* clipboard */ - char *(*get_clipboard_text)(void); - bool (*set_clipboard_text)(const char *text); - /* android compatible file access functions */ - bool (*file_read)(const char *filename, unsigned char **buf, size_t *size); - bool (*file_exists)(const char * filename); - bool (*file_write)(const char *filename, unsigned char *buf, uint32_t size); - /* clean stuff */ - void (*shutdown)(void); - /* get root cache */ - TCOD_console_data_t *(*get_root_console_cache)(void); -} TCOD_SDL_driver_t; - -/* defined in TCOD_sys_sdl12_c.c and TCOD_sys_sdl2_c.c */ -TCOD_SDL_driver_t *SDL_implementation_factory(void); - -void find_resolution(void); -void TCOD_sys_init_screen_offset(void); -typedef struct { - float force_recalc; - float last_scale_xc, last_scale_yc; - float last_scale_factor; - float last_fullscreen; - - float min_scale_factor; - - float src_height_width_ratio; - float dst_height_width_ratio; - int src_x0, src_y0; - int src_copy_width, src_copy_height; - int src_proportionate_width, src_proportionate_height; - int dst_display_width, dst_display_height; - int dst_offset_x, dst_offset_y; - int surface_width, surface_height; -} scale_data_t; -extern scale_data_t scale_data; - -extern float scale_factor; -extern struct SDL_Surface* charmap; -extern struct SDL_Window* window; -extern struct SDL_Renderer* renderer; -extern char *last_clipboard_text; -#endif - -/* SDL & OpenGL */ -extern int oldFade; - -/* color values */ -#define TCOD_BLACK 0,0,0 -#define TCOD_DARKEST_GREY 31,31,31 -#define TCOD_DARKER_GREY 63,63,63 -#define TCOD_DARK_GREY 95,95,95 -#define TCOD_GREY 127,127,127 -#define TCOD_LIGHT_GREY 159,159,159 -#define TCOD_LIGHTER_GREY 191,191,191 -#define TCOD_LIGHTEST_GREY 223,223,223 -#define TCOD_WHITE 255,255,255 - -#define TCOD_DARKEST_SEPIA 31,24,15 -#define TCOD_DARKER_SEPIA 63,50,31 -#define TCOD_DARK_SEPIA 94,75,47 -#define TCOD_SEPIA 127,101,63 -#define TCOD_LIGHT_SEPIA 158,134,100 -#define TCOD_LIGHTER_SEPIA 191,171,143 -#define TCOD_LIGHTEST_SEPIA 222,211,195 - -/* desaturated */ -#define TCOD_DESATURATED_RED 127,63,63 -#define TCOD_DESATURATED_FLAME 127,79,63 -#define TCOD_DESATURATED_ORANGE 127,95,63 -#define TCOD_DESATURATED_AMBER 127,111,63 -#define TCOD_DESATURATED_YELLOW 127,127,63 -#define TCOD_DESATURATED_LIME 111,127,63 -#define TCOD_DESATURATED_CHARTREUSE 95,127,63 -#define TCOD_DESATURATED_GREEN 63,127,63 -#define TCOD_DESATURATED_SEA 63,127,95 -#define TCOD_DESATURATED_TURQUOISE 63,127,111 -#define TCOD_DESATURATED_CYAN 63,127,127 -#define TCOD_DESATURATED_SKY 63,111,127 -#define TCOD_DESATURATED_AZURE 63,95,127 -#define TCOD_DESATURATED_BLUE 63,63,127 -#define TCOD_DESATURATED_HAN 79,63,127 -#define TCOD_DESATURATED_VIOLET 95,63,127 -#define TCOD_DESATURATED_PURPLE 111,63,127 -#define TCOD_DESATURATED_FUCHSIA 127,63,127 -#define TCOD_DESATURATED_MAGENTA 127,63,111 -#define TCOD_DESATURATED_PINK 127,63,95 -#define TCOD_DESATURATED_CRIMSON 127,63,79 - -/* lightest */ -#define TCOD_LIGHTEST_RED 255,191,191 -#define TCOD_LIGHTEST_FLAME 255,207,191 -#define TCOD_LIGHTEST_ORANGE 255,223,191 -#define TCOD_LIGHTEST_AMBER 255,239,191 -#define TCOD_LIGHTEST_YELLOW 255,255,191 -#define TCOD_LIGHTEST_LIME 239,255,191 -#define TCOD_LIGHTEST_CHARTREUSE 223,255,191 -#define TCOD_LIGHTEST_GREEN 191,255,191 -#define TCOD_LIGHTEST_SEA 191,255,223 -#define TCOD_LIGHTEST_TURQUOISE 191,255,239 -#define TCOD_LIGHTEST_CYAN 191,255,255 -#define TCOD_LIGHTEST_SKY 191,239,255 -#define TCOD_LIGHTEST_AZURE 191,223,255 -#define TCOD_LIGHTEST_BLUE 191,191,255 -#define TCOD_LIGHTEST_HAN 207,191,255 -#define TCOD_LIGHTEST_VIOLET 223,191,255 -#define TCOD_LIGHTEST_PURPLE 239,191,255 -#define TCOD_LIGHTEST_FUCHSIA 255,191,255 -#define TCOD_LIGHTEST_MAGENTA 255,191,239 -#define TCOD_LIGHTEST_PINK 255,191,223 -#define TCOD_LIGHTEST_CRIMSON 255,191,207 - -/* lighter */ -#define TCOD_LIGHTER_RED 255,127,127 -#define TCOD_LIGHTER_FLAME 255,159,127 -#define TCOD_LIGHTER_ORANGE 255,191,127 -#define TCOD_LIGHTER_AMBER 255,223,127 -#define TCOD_LIGHTER_YELLOW 255,255,127 -#define TCOD_LIGHTER_LIME 223,255,127 -#define TCOD_LIGHTER_CHARTREUSE 191,255,127 -#define TCOD_LIGHTER_GREEN 127,255,127 -#define TCOD_LIGHTER_SEA 127,255,191 -#define TCOD_LIGHTER_TURQUOISE 127,255,223 -#define TCOD_LIGHTER_CYAN 127,255,255 -#define TCOD_LIGHTER_SKY 127,223,255 -#define TCOD_LIGHTER_AZURE 127,191,255 -#define TCOD_LIGHTER_BLUE 127,127,255 -#define TCOD_LIGHTER_HAN 159,127,255 -#define TCOD_LIGHTER_VIOLET 191,127,255 -#define TCOD_LIGHTER_PURPLE 223,127,255 -#define TCOD_LIGHTER_FUCHSIA 255,127,255 -#define TCOD_LIGHTER_MAGENTA 255,127,223 -#define TCOD_LIGHTER_PINK 255,127,191 -#define TCOD_LIGHTER_CRIMSON 255,127,159 - -/* light */ -#define TCOD_LIGHT_RED 255,63,63 -#define TCOD_LIGHT_FLAME 255,111,63 -#define TCOD_LIGHT_ORANGE 255,159,63 -#define TCOD_LIGHT_AMBER 255,207,63 -#define TCOD_LIGHT_YELLOW 255,255,63 -#define TCOD_LIGHT_LIME 207,255,63 -#define TCOD_LIGHT_CHARTREUSE 159,255,63 -#define TCOD_LIGHT_GREEN 63,255,63 -#define TCOD_LIGHT_SEA 63,255,159 -#define TCOD_LIGHT_TURQUOISE 63,255,207 -#define TCOD_LIGHT_CYAN 63,255,255 -#define TCOD_LIGHT_SKY 63,207,255 -#define TCOD_LIGHT_AZURE 63,159,255 -#define TCOD_LIGHT_BLUE 63,63,255 -#define TCOD_LIGHT_HAN 111,63,255 -#define TCOD_LIGHT_VIOLET 159,63,255 -#define TCOD_LIGHT_PURPLE 207,63,255 -#define TCOD_LIGHT_FUCHSIA 255,63,255 -#define TCOD_LIGHT_MAGENTA 255,63,207 -#define TCOD_LIGHT_PINK 255,63,159 -#define TCOD_LIGHT_CRIMSON 255,63,111 - -/* normal */ -#define TCOD_RED 255,0,0 -#define TCOD_FLAME 255,63,0 -#define TCOD_ORANGE 255,127,0 -#define TCOD_AMBER 255,191,0 -#define TCOD_YELLOW 255,255,0 -#define TCOD_LIME 191,255,0 -#define TCOD_CHARTREUSE 127,255,0 -#define TCOD_GREEN 0,255,0 -#define TCOD_SEA 0,255,127 -#define TCOD_TURQUOISE 0,255,191 -#define TCOD_CYAN 0,255,255 -#define TCOD_SKY 0,191,255 -#define TCOD_AZURE 0,127,255 -#define TCOD_BLUE 0,0,255 -#define TCOD_HAN 63,0,255 -#define TCOD_VIOLET 127,0,255 -#define TCOD_PURPLE 191,0,255 -#define TCOD_FUCHSIA 255,0,255 -#define TCOD_MAGENTA 255,0,191 -#define TCOD_PINK 255,0,127 -#define TCOD_CRIMSON 255,0,63 - -/* dark */ -#define TCOD_DARK_RED 191,0,0 -#define TCOD_DARK_FLAME 191,47,0 -#define TCOD_DARK_ORANGE 191,95,0 -#define TCOD_DARK_AMBER 191,143,0 -#define TCOD_DARK_YELLOW 191,191,0 -#define TCOD_DARK_LIME 143,191,0 -#define TCOD_DARK_CHARTREUSE 95,191,0 -#define TCOD_DARK_GREEN 0,191,0 -#define TCOD_DARK_SEA 0,191,95 -#define TCOD_DARK_TURQUOISE 0,191,143 -#define TCOD_DARK_CYAN 0,191,191 -#define TCOD_DARK_SKY 0,143,191 -#define TCOD_DARK_AZURE 0,95,191 -#define TCOD_DARK_BLUE 0,0,191 -#define TCOD_DARK_HAN 47,0,191 -#define TCOD_DARK_VIOLET 95,0,191 -#define TCOD_DARK_PURPLE 143,0,191 -#define TCOD_DARK_FUCHSIA 191,0,191 -#define TCOD_DARK_MAGENTA 191,0,143 -#define TCOD_DARK_PINK 191,0,95 -#define TCOD_DARK_CRIMSON 191,0,47 - -/* darker */ -#define TCOD_DARKER_RED 127,0,0 -#define TCOD_DARKER_FLAME 127,31,0 -#define TCOD_DARKER_ORANGE 127,63,0 -#define TCOD_DARKER_AMBER 127,95,0 -#define TCOD_DARKER_YELLOW 127,127,0 -#define TCOD_DARKER_LIME 95,127,0 -#define TCOD_DARKER_CHARTREUSE 63,127,0 -#define TCOD_DARKER_GREEN 0,127,0 -#define TCOD_DARKER_SEA 0,127,63 -#define TCOD_DARKER_TURQUOISE 0,127,95 -#define TCOD_DARKER_CYAN 0,127,127 -#define TCOD_DARKER_SKY 0,95,127 -#define TCOD_DARKER_AZURE 0,63,127 -#define TCOD_DARKER_BLUE 0,0,127 -#define TCOD_DARKER_HAN 31,0,127 -#define TCOD_DARKER_VIOLET 63,0,127 -#define TCOD_DARKER_PURPLE 95,0,127 -#define TCOD_DARKER_FUCHSIA 127,0,127 -#define TCOD_DARKER_MAGENTA 127,0,95 -#define TCOD_DARKER_PINK 127,0,63 -#define TCOD_DARKER_CRIMSON 127,0,31 - -/* darkest */ -#define TCOD_DARKEST_RED 63,0,0 -#define TCOD_DARKEST_FLAME 63,15,0 -#define TCOD_DARKEST_ORANGE 63,31,0 -#define TCOD_DARKEST_AMBER 63,47,0 -#define TCOD_DARKEST_YELLOW 63,63,0 -#define TCOD_DARKEST_LIME 47,63,0 -#define TCOD_DARKEST_CHARTREUSE 31,63,0 -#define TCOD_DARKEST_GREEN 0,63,0 -#define TCOD_DARKEST_SEA 0,63,31 -#define TCOD_DARKEST_TURQUOISE 0,63,47 -#define TCOD_DARKEST_CYAN 0,63,63 -#define TCOD_DARKEST_SKY 0,47,63 -#define TCOD_DARKEST_AZURE 0,31,63 -#define TCOD_DARKEST_BLUE 0,0,63 -#define TCOD_DARKEST_HAN 15,0,63 -#define TCOD_DARKEST_VIOLET 31,0,63 -#define TCOD_DARKEST_PURPLE 47,0,63 -#define TCOD_DARKEST_FUCHSIA 63,0,63 -#define TCOD_DARKEST_MAGENTA 63,0,47 -#define TCOD_DARKEST_PINK 63,0,31 -#define TCOD_DARKEST_CRIMSON 63,0,15 - -/* metallic */ -#define TCOD_BRASS 191,151,96 -#define TCOD_COPPER 197,136,124 -#define TCOD_GOLD 229,191,0 -#define TCOD_SILVER 203,203,203 - -/* miscellaneous */ -#define TCOD_CELADON 172,255,175 -#define TCOD_PEACH 255,159,127 - -#ifdef __cplusplus -} -#endif -#endif +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef TCODLIB_INT_H_ +#define TCODLIB_INT_H_ +#include +#include +#if defined(__ANDROID__) +#include +#endif +#ifdef __cplusplus +#include +#include +#endif // __cplusplus + +#include "portability.h" +#include "color.h" +#include "console_types.h" +#include "fov.h" +#include "fov_types.h" +#include "mersenne_types.h" +#include "sys.h" +#include "tileset.h" +#include "context.h" + +/* tcodlib internal stuff */ +#ifdef __cplusplus +extern "C" { +#endif + +/* SDL2 forward declarations */ +struct SDL_Surface; +struct SDL_Window; +struct SDL_Renderer; +union SDL_Event; + +/* pseudorandom number generator toolkit */ +typedef struct TCOD_Random { + /* algorithm identifier */ + TCOD_random_algo_t algo; + /* distribution */ + TCOD_distribution_t distribution; + /* Mersenne Twister stuff */ + uint32_t mt[624]; + int cur_mt; + /* Complementary-Multiply-With-Carry stuff */ + /* shared with Generalised Feedback Shift Register */ + uint32_t Q[4096], c; + int cur; +} mersenne_data_t; + +typedef struct { + /* number of characters in the bitmap font */ + int fontNbCharHoriz; + int fontNbCharVertic; + /* font type and layout */ + bool font_tcod_layout; + bool font_in_row; + bool font_greyscale; + int font_flags; + /* character size in font */ + int font_width; + int font_height; + char font_file[512]; + char window_title[512]; + /* ascii code to tcod layout converter */ + int *ascii_to_tcod; + /* whether each character in the font is a colored tile */ + bool *colored; + /* the root console */ + struct TCOD_Console *root; + /* nb chars in the font */ + int max_font_chars; + /* fullscreen data */ + bool fullscreen; + int fullscreen_offsetx; + int fullscreen_offsety; + /* asked by the user */ + int fullscreen_width; + int fullscreen_height; + /* actual resolution */ + int actual_fullscreen_width; + int actual_fullscreen_height; + /* user post-processing callback */ + SDL_renderer_t sdl_cbk; + /* fading data */ + TCOD_color_t fading_color; + uint8_t fade; + TCOD_key_t key_state; + /* application window was closed */ + bool is_window_closed; + /* application has mouse focus */ + bool app_has_mouse_focus; + /* application is active (not iconified) */ + bool app_is_active; + /** + Active tileset for libtcod. + + Use TCOD_set_default_tileset when you want to change this value, since it + needs to trigger some important side-effects. + */ + struct TCOD_Tileset* tileset; + struct TCOD_Context* engine; +} TCOD_internal_context_t; + +extern TCOD_internal_context_t TCOD_ctx; + +#if defined(__ANDROID__) && !defined(NDEBUG) +#include +#ifdef printf +#undef printf +#endif +#ifdef vprintf +#undef vprintf +#endif +#define printf(args...) __android_log_print(ANDROID_LOG_INFO, "libtcod", ## args) +#define vprintf(args...) __android_log_vprint(ANDROID_LOG_INFO, "libtcod", ## args) + +#ifdef assert +#undef assert +#endif +#define assert(cond) if(!(cond)) __android_log_assert(#cond, "libtcod", "assertion failed: %s", #cond) +#endif + +#ifdef NDEBUG +#define TCOD_IF(x) if (x) +#define TCOD_IFNOT(x) if (!(x)) +#define TCOD_ASSERT(x) +#define TCOD_LOG(x) +#else +#define TCOD_IF(x) assert(x); +#define TCOD_IFNOT(x) assert(x); if (0) +#define TCOD_ASSERT(x) assert(x) +#define TCOD_LOG(x) printf x +#endif + +/* fov internal stuff */ +void TCOD_map_compute_fov_circular_raycasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls); +void TCOD_map_compute_fov_diamond_raycasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls); +void TCOD_map_compute_fov_recursive_shadowcasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls); +void TCOD_map_compute_fov_permissive2(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls, int fovType); +void TCOD_map_compute_fov_restrictive_shadowcasting(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls); +void TCOD_map_postproc(TCOD_map_t map,int x0,int y0, int x1, int y1, int dx, int dy); + +/* fatal errors */ +void TCOD_fatal(const char *fmt, ...); +void TCOD_fatal_nopar(const char *msg); + +/* switch fullscreen mode */ +TCOD_key_t TCOD_sys_check_for_keypress(int flags); +TCOD_key_t TCOD_sys_wait_for_keypress(bool flush); +bool TCOD_sys_is_key_pressed(TCOD_keycode_t key); +void TCOD_sys_pixel_to_tile(double* x, double* y); + +int TCOD_console_print_internal( + TCOD_Console* con, int x,int y, int w, int h, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t align, char* msg, bool can_split, bool count_only +); +char* TCOD_console_vsprint(const char* fmt, va_list ap); +/* UTF-8 stuff */ +#ifndef NO_UNICODE +wchar_t *TCOD_console_vsprint_utf(const wchar_t *fmt, va_list ap); +int TCOD_console_print_internal_utf(TCOD_console_t con,int x,int y, int rw, int rh, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t align, wchar_t *msg, bool can_split, bool count_only); +#endif + +/* image manipulation */ +TCODLIB_API struct SDL_Surface* TCOD_sys_load_image(const char *filename); +void TCOD_sys_get_image_size(const struct SDL_Surface *image, int *w,int *h); +TCOD_color_t TCOD_sys_get_image_pixel(const struct SDL_Surface *image, + int x, int y); +int TCOD_sys_get_image_alpha(const struct SDL_Surface* image, int x, int y); +bool TCOD_sys_check_magic_number(const char *filename, size_t size, uint8_t *data); + +/* TCOD_list nonpublic methods */ +void TCOD_list_set_size(TCOD_list_t l, int size); + +/* + SDL12/SDL2 abstraction layer +*/ +typedef struct TCOD_SDL_driver_t { + float scale_xc; + float scale_yc; + + /* get a fullscreen mode suitable for the console */ + void (*get_closest_mode)(int *w, int *h); + /* render the console on a surface/texture */ + void (*render)(const struct TCOD_SDL_driver_t *sdl, void *vbitmap, struct TCOD_Console *console); + /* create a new surface */ + struct SDL_Surface *(*create_surface) (int width, int height, bool with_alpha); + /* create the game window */ + void (*create_window)(int w, int h, bool fullscreen); + /* destroy the game window */ + void (*destroy_window)(void); + /* switch fullscreen on/off */ + void (*set_fullscreen)(bool fullscreen); + /* change the game window title */ + void (*set_window_title)(const char *title); + /* save game screenshot */ + void (*save_screenshot)(const char *filename); + /* get desktop resolution */ + void (*get_current_resolution)(int *w, int *h); + /* change the mouse cursor position */ + void (*set_mouse_position)(int x, int y); + /* clipboard */ + const char *(*get_clipboard_text)(void); + bool (*set_clipboard_text)(const char *text); + /* android compatible file access functions */ + bool (*file_read)(const char *filename, unsigned char **buf, size_t *size); + bool (*file_exists)(const char * filename); + bool (*file_write)(const char *filename, unsigned char *buf, uint32_t size); + /* clean stuff */ + void (*shutdown)(void); + /* get root cache */ + struct TCOD_Console *(*get_root_console_cache)(void); +} TCOD_SDL_driver_t; + +typedef struct { + float force_recalc; + float last_scale_xc, last_scale_yc; + float last_scale_factor; + bool last_fullscreen; + + float min_scale_factor; + + float src_height_width_ratio; + float dst_height_width_ratio; + int src_x0, src_y0; + int src_copy_width, src_copy_height; + int src_proportionate_width, src_proportionate_height; + int dst_display_width, dst_display_height; + int dst_offset_x, dst_offset_y; + int surface_width, surface_height; +} scale_data_t; +extern scale_data_t scale_data; + +extern float scale_factor; +extern struct SDL_Surface* charmap; + +/* SDL & OpenGL */ +extern int oldFade; + +/* color values */ +#define TCOD_BLACK 0,0,0 +#define TCOD_DARKEST_GREY 31,31,31 +#define TCOD_DARKER_GREY 63,63,63 +#define TCOD_DARK_GREY 95,95,95 +#define TCOD_GREY 127,127,127 +#define TCOD_LIGHT_GREY 159,159,159 +#define TCOD_LIGHTER_GREY 191,191,191 +#define TCOD_LIGHTEST_GREY 223,223,223 +#define TCOD_WHITE 255,255,255 + +#define TCOD_DARKEST_SEPIA 31,24,15 +#define TCOD_DARKER_SEPIA 63,50,31 +#define TCOD_DARK_SEPIA 94,75,47 +#define TCOD_SEPIA 127,101,63 +#define TCOD_LIGHT_SEPIA 158,134,100 +#define TCOD_LIGHTER_SEPIA 191,171,143 +#define TCOD_LIGHTEST_SEPIA 222,211,195 + +/* desaturated */ +#define TCOD_DESATURATED_RED 127,63,63 +#define TCOD_DESATURATED_FLAME 127,79,63 +#define TCOD_DESATURATED_ORANGE 127,95,63 +#define TCOD_DESATURATED_AMBER 127,111,63 +#define TCOD_DESATURATED_YELLOW 127,127,63 +#define TCOD_DESATURATED_LIME 111,127,63 +#define TCOD_DESATURATED_CHARTREUSE 95,127,63 +#define TCOD_DESATURATED_GREEN 63,127,63 +#define TCOD_DESATURATED_SEA 63,127,95 +#define TCOD_DESATURATED_TURQUOISE 63,127,111 +#define TCOD_DESATURATED_CYAN 63,127,127 +#define TCOD_DESATURATED_SKY 63,111,127 +#define TCOD_DESATURATED_AZURE 63,95,127 +#define TCOD_DESATURATED_BLUE 63,63,127 +#define TCOD_DESATURATED_HAN 79,63,127 +#define TCOD_DESATURATED_VIOLET 95,63,127 +#define TCOD_DESATURATED_PURPLE 111,63,127 +#define TCOD_DESATURATED_FUCHSIA 127,63,127 +#define TCOD_DESATURATED_MAGENTA 127,63,111 +#define TCOD_DESATURATED_PINK 127,63,95 +#define TCOD_DESATURATED_CRIMSON 127,63,79 + +/* lightest */ +#define TCOD_LIGHTEST_RED 255,191,191 +#define TCOD_LIGHTEST_FLAME 255,207,191 +#define TCOD_LIGHTEST_ORANGE 255,223,191 +#define TCOD_LIGHTEST_AMBER 255,239,191 +#define TCOD_LIGHTEST_YELLOW 255,255,191 +#define TCOD_LIGHTEST_LIME 239,255,191 +#define TCOD_LIGHTEST_CHARTREUSE 223,255,191 +#define TCOD_LIGHTEST_GREEN 191,255,191 +#define TCOD_LIGHTEST_SEA 191,255,223 +#define TCOD_LIGHTEST_TURQUOISE 191,255,239 +#define TCOD_LIGHTEST_CYAN 191,255,255 +#define TCOD_LIGHTEST_SKY 191,239,255 +#define TCOD_LIGHTEST_AZURE 191,223,255 +#define TCOD_LIGHTEST_BLUE 191,191,255 +#define TCOD_LIGHTEST_HAN 207,191,255 +#define TCOD_LIGHTEST_VIOLET 223,191,255 +#define TCOD_LIGHTEST_PURPLE 239,191,255 +#define TCOD_LIGHTEST_FUCHSIA 255,191,255 +#define TCOD_LIGHTEST_MAGENTA 255,191,239 +#define TCOD_LIGHTEST_PINK 255,191,223 +#define TCOD_LIGHTEST_CRIMSON 255,191,207 + +/* lighter */ +#define TCOD_LIGHTER_RED 255,127,127 +#define TCOD_LIGHTER_FLAME 255,159,127 +#define TCOD_LIGHTER_ORANGE 255,191,127 +#define TCOD_LIGHTER_AMBER 255,223,127 +#define TCOD_LIGHTER_YELLOW 255,255,127 +#define TCOD_LIGHTER_LIME 223,255,127 +#define TCOD_LIGHTER_CHARTREUSE 191,255,127 +#define TCOD_LIGHTER_GREEN 127,255,127 +#define TCOD_LIGHTER_SEA 127,255,191 +#define TCOD_LIGHTER_TURQUOISE 127,255,223 +#define TCOD_LIGHTER_CYAN 127,255,255 +#define TCOD_LIGHTER_SKY 127,223,255 +#define TCOD_LIGHTER_AZURE 127,191,255 +#define TCOD_LIGHTER_BLUE 127,127,255 +#define TCOD_LIGHTER_HAN 159,127,255 +#define TCOD_LIGHTER_VIOLET 191,127,255 +#define TCOD_LIGHTER_PURPLE 223,127,255 +#define TCOD_LIGHTER_FUCHSIA 255,127,255 +#define TCOD_LIGHTER_MAGENTA 255,127,223 +#define TCOD_LIGHTER_PINK 255,127,191 +#define TCOD_LIGHTER_CRIMSON 255,127,159 + +/* light */ +#define TCOD_LIGHT_RED 255,63,63 +#define TCOD_LIGHT_FLAME 255,111,63 +#define TCOD_LIGHT_ORANGE 255,159,63 +#define TCOD_LIGHT_AMBER 255,207,63 +#define TCOD_LIGHT_YELLOW 255,255,63 +#define TCOD_LIGHT_LIME 207,255,63 +#define TCOD_LIGHT_CHARTREUSE 159,255,63 +#define TCOD_LIGHT_GREEN 63,255,63 +#define TCOD_LIGHT_SEA 63,255,159 +#define TCOD_LIGHT_TURQUOISE 63,255,207 +#define TCOD_LIGHT_CYAN 63,255,255 +#define TCOD_LIGHT_SKY 63,207,255 +#define TCOD_LIGHT_AZURE 63,159,255 +#define TCOD_LIGHT_BLUE 63,63,255 +#define TCOD_LIGHT_HAN 111,63,255 +#define TCOD_LIGHT_VIOLET 159,63,255 +#define TCOD_LIGHT_PURPLE 207,63,255 +#define TCOD_LIGHT_FUCHSIA 255,63,255 +#define TCOD_LIGHT_MAGENTA 255,63,207 +#define TCOD_LIGHT_PINK 255,63,159 +#define TCOD_LIGHT_CRIMSON 255,63,111 + +/* normal */ +#define TCOD_RED 255,0,0 +#define TCOD_FLAME 255,63,0 +#define TCOD_ORANGE 255,127,0 +#define TCOD_AMBER 255,191,0 +#define TCOD_YELLOW 255,255,0 +#define TCOD_LIME 191,255,0 +#define TCOD_CHARTREUSE 127,255,0 +#define TCOD_GREEN 0,255,0 +#define TCOD_SEA 0,255,127 +#define TCOD_TURQUOISE 0,255,191 +#define TCOD_CYAN 0,255,255 +#define TCOD_SKY 0,191,255 +#define TCOD_AZURE 0,127,255 +#define TCOD_BLUE 0,0,255 +#define TCOD_HAN 63,0,255 +#define TCOD_VIOLET 127,0,255 +#define TCOD_PURPLE 191,0,255 +#define TCOD_FUCHSIA 255,0,255 +#define TCOD_MAGENTA 255,0,191 +#define TCOD_PINK 255,0,127 +#define TCOD_CRIMSON 255,0,63 + +/* dark */ +#define TCOD_DARK_RED 191,0,0 +#define TCOD_DARK_FLAME 191,47,0 +#define TCOD_DARK_ORANGE 191,95,0 +#define TCOD_DARK_AMBER 191,143,0 +#define TCOD_DARK_YELLOW 191,191,0 +#define TCOD_DARK_LIME 143,191,0 +#define TCOD_DARK_CHARTREUSE 95,191,0 +#define TCOD_DARK_GREEN 0,191,0 +#define TCOD_DARK_SEA 0,191,95 +#define TCOD_DARK_TURQUOISE 0,191,143 +#define TCOD_DARK_CYAN 0,191,191 +#define TCOD_DARK_SKY 0,143,191 +#define TCOD_DARK_AZURE 0,95,191 +#define TCOD_DARK_BLUE 0,0,191 +#define TCOD_DARK_HAN 47,0,191 +#define TCOD_DARK_VIOLET 95,0,191 +#define TCOD_DARK_PURPLE 143,0,191 +#define TCOD_DARK_FUCHSIA 191,0,191 +#define TCOD_DARK_MAGENTA 191,0,143 +#define TCOD_DARK_PINK 191,0,95 +#define TCOD_DARK_CRIMSON 191,0,47 + +/* darker */ +#define TCOD_DARKER_RED 127,0,0 +#define TCOD_DARKER_FLAME 127,31,0 +#define TCOD_DARKER_ORANGE 127,63,0 +#define TCOD_DARKER_AMBER 127,95,0 +#define TCOD_DARKER_YELLOW 127,127,0 +#define TCOD_DARKER_LIME 95,127,0 +#define TCOD_DARKER_CHARTREUSE 63,127,0 +#define TCOD_DARKER_GREEN 0,127,0 +#define TCOD_DARKER_SEA 0,127,63 +#define TCOD_DARKER_TURQUOISE 0,127,95 +#define TCOD_DARKER_CYAN 0,127,127 +#define TCOD_DARKER_SKY 0,95,127 +#define TCOD_DARKER_AZURE 0,63,127 +#define TCOD_DARKER_BLUE 0,0,127 +#define TCOD_DARKER_HAN 31,0,127 +#define TCOD_DARKER_VIOLET 63,0,127 +#define TCOD_DARKER_PURPLE 95,0,127 +#define TCOD_DARKER_FUCHSIA 127,0,127 +#define TCOD_DARKER_MAGENTA 127,0,95 +#define TCOD_DARKER_PINK 127,0,63 +#define TCOD_DARKER_CRIMSON 127,0,31 + +/* darkest */ +#define TCOD_DARKEST_RED 63,0,0 +#define TCOD_DARKEST_FLAME 63,15,0 +#define TCOD_DARKEST_ORANGE 63,31,0 +#define TCOD_DARKEST_AMBER 63,47,0 +#define TCOD_DARKEST_YELLOW 63,63,0 +#define TCOD_DARKEST_LIME 47,63,0 +#define TCOD_DARKEST_CHARTREUSE 31,63,0 +#define TCOD_DARKEST_GREEN 0,63,0 +#define TCOD_DARKEST_SEA 0,63,31 +#define TCOD_DARKEST_TURQUOISE 0,63,47 +#define TCOD_DARKEST_CYAN 0,63,63 +#define TCOD_DARKEST_SKY 0,47,63 +#define TCOD_DARKEST_AZURE 0,31,63 +#define TCOD_DARKEST_BLUE 0,0,63 +#define TCOD_DARKEST_HAN 15,0,63 +#define TCOD_DARKEST_VIOLET 31,0,63 +#define TCOD_DARKEST_PURPLE 47,0,63 +#define TCOD_DARKEST_FUCHSIA 63,0,63 +#define TCOD_DARKEST_MAGENTA 63,0,47 +#define TCOD_DARKEST_PINK 63,0,31 +#define TCOD_DARKEST_CRIMSON 63,0,15 + +/* metallic */ +#define TCOD_BRASS 191,151,96 +#define TCOD_COPPER 197,136,124 +#define TCOD_GOLD 229,191,0 +#define TCOD_SILVER 203,203,203 + +/* miscellaneous */ +#define TCOD_CELADON 172,255,175 +#define TCOD_PEACH 255,159,127 + +// TCODConsole non public methods +int TCOD_console_stringLength(const unsigned char* s); +unsigned char* TCOD_console_forward(unsigned char* s,int l); +// TCODSystem non public methods +void sync_time_(void); +void TCOD_sys_map_ascii_to_font(int asciiCode, int fontCharX, int fontCharY); +void TCOD_sys_decode_font_(void); +void TCOD_sys_save_bitmap(struct SDL_Surface* bitmap, const char *filename); +struct SDL_Surface* TCOD_sys_create_bitmap(int width, int height, + TCOD_color_t *buf); +void TCOD_sys_delete_bitmap(struct SDL_Surface* bitmap); +void TCOD_sys_save_fps(void); +void TCOD_sys_restore_fps(void); +TCODLIB_CAPI TCOD_Error TCOD_sys_load_player_config(void); +/** + * Validate and return a constant console. + */ +static inline TCOD_Console* TCOD_console_validate_(const TCOD_Console* console) +{ + return (TCOD_Console*)(console ? console : TCOD_ctx.root); +} +/** + * Return true if the console is valid and the index is within it. + */ +static inline bool TCOD_console_is_index_valid_(const TCOD_Console* console, + int x, int y) +{ + return console && 0 <= x && x < console->w && 0 <= y && y < console->h; +} +TCOD_event_t TCOD_sys_handle_mouse_event( + const union SDL_Event* ev, TCOD_mouse_t* mouse); +TCOD_event_t TCOD_sys_handle_key_event( + const union SDL_Event* ev, TCOD_key_t* key); +#ifdef __cplusplus +} // extern "C" +#endif +#endif // TCODLIB_INT_H_ diff --git a/tcod_sys/libtcod/src/libtcod/list.h b/tcod_sys/libtcod/src/libtcod/list.h new file mode 100644 index 000000000..580127356 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/list.h @@ -0,0 +1,71 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_LIST_H +#define _TCOD_LIST_H + +#include "portability.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct TCOD_List; + +typedef struct TCOD_List *TCOD_list_t; + +TCODLIB_API TCOD_list_t TCOD_list_new(void); +TCODLIB_API TCOD_list_t TCOD_list_allocate(int nb_elements); +TCODLIB_API TCOD_list_t TCOD_list_duplicate(TCOD_list_t l); +TCODLIB_API void TCOD_list_delete(TCOD_list_t l); +TCODLIB_API void TCOD_list_push(TCOD_list_t l, const void * elt); +TCODLIB_API void * TCOD_list_pop(TCOD_list_t l); +TCODLIB_API void * TCOD_list_peek(TCOD_list_t l); +TCODLIB_API void TCOD_list_add_all(TCOD_list_t l, TCOD_list_t l2); +TCODLIB_API void * TCOD_list_get(TCOD_list_t l,int idx); +TCODLIB_API void TCOD_list_set(TCOD_list_t l,const void *elt, int idx); +TCODLIB_API void ** TCOD_list_begin(TCOD_list_t l); +TCODLIB_API void ** TCOD_list_end(TCOD_list_t l); +TCODLIB_API void TCOD_list_reverse(TCOD_list_t l); +TCODLIB_API void **TCOD_list_remove_iterator(TCOD_list_t l, void **elt); +TCODLIB_API void TCOD_list_remove(TCOD_list_t l, const void * elt); +TCODLIB_API void **TCOD_list_remove_iterator_fast(TCOD_list_t l, void **elt); +TCODLIB_API void TCOD_list_remove_fast(TCOD_list_t l, const void * elt); +TCODLIB_API bool TCOD_list_contains(TCOD_list_t l,const void * elt); +TCODLIB_API void TCOD_list_clear(TCOD_list_t l); +TCODLIB_API void TCOD_list_clear_and_delete(TCOD_list_t l); +TCODLIB_API int TCOD_list_size(TCOD_list_t l); +TCODLIB_API void ** TCOD_list_insert_before(TCOD_list_t l,const void *elt,int before); +TCODLIB_API bool TCOD_list_is_empty(TCOD_list_t l); +#ifdef __cplusplus +} +#endif +#endif diff --git a/tcod_sys/libtcod/include/list.hpp b/tcod_sys/libtcod/src/libtcod/list.hpp similarity index 90% rename from tcod_sys/libtcod/include/list.hpp rename to tcod_sys/libtcod/src/libtcod/list.hpp index 57d07f854..8fed02137 100644 --- a/tcod_sys/libtcod/include/list.hpp +++ b/tcod_sys/libtcod/src/libtcod/list.hpp @@ -1,30 +1,34 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_LIST_HPP #define _TCOD_LIST_HPP @@ -85,13 +89,14 @@ public : TCOD_list_push(intList,(const void *)5); TCOD_list_t intList2 = TCOD_list_duplicate(intList); // intList2 contains two elements : 3 and 5 */ - TCODList(const TCOD_list_t l) { - array=NULL; - fillSize=allocSize=0; - for ( void **it=TCOD_list_begin(l); it != TCOD_list_end(l); it++ ) { - push(*((T *)(it))); - } - } + TCODList(const TCOD_list_t l) + { + array = NULL; + fillSize = allocSize = 0; + for (void** it = TCOD_list_begin(l); it != TCOD_list_end(l); ++it) { + push(*reinterpret_cast(it)); + } + } TCODList(const TCODList &l2) { array=NULL; fillSize=allocSize=0; @@ -244,12 +249,13 @@ public : bool has3 = TCOD_list_contains(intList,(const void *)3); // has3 == true bool has4 = TCOD_list_contains(intList,(const void *)4); // has4 == false */ - bool contains(const T elt) const { - for ( T* curElt = begin(); curElt != end(); curElt ++) { - if ( *curElt == elt ) return true; - } - return false; - } + bool contains(const T elt) const + { + for (T* curElt = begin(); curElt != end(); ++curElt) { + if (*curElt == elt) { return true; } + } + return false; + } /** @PageName list_list @@ -470,7 +476,7 @@ public : val = (int)TCOD_list_pop(intList); */ T pop() { - if ( fillSize == 0 ) return (T)0; + if ( fillSize == 0 ) return T{}; return array[--fillSize]; } @@ -495,7 +501,7 @@ public : val = (int)TCOD_list_peek(intList); */ T peek() const { - if ( fillSize == 0 ) return (T)0; + if ( fillSize == 0 ) return T{}; return array[fillSize-1]; } diff --git a/tcod_sys/libtcod/src/libtcod/list_c.c b/tcod_sys/libtcod/src/libtcod/list_c.c new file mode 100644 index 000000000..a35c11060 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/list_c.c @@ -0,0 +1,306 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "list.h" + +#include /* calloc */ +#include /* NULL/memcpy */ + +#include "utility.h" +/** + * A lightweight and generic container that provides array, list, and stack + * paradigms. + */ +struct TCOD_List { + /** + * A pointer to an array of void pointers. + */ + void **array; + /** The current count of items in the array. */ + int fillSize; + /** The maximum number of items that `array` can currently hold. */ + int allocSize; +}; +/** + * Initialize or expand the array of a TCOD_list_t struct. + * + * If `l->allocSize` is zero then a new array is allocated, and allocSize is + * set. If `l->allocSize` is not zero then the allocated size is doubled. + */ +static void TCOD_list_allocate_int(TCOD_list_t l) { + void **newArray; + int newSize = l->allocSize * 2; + if (newSize == 0) { newSize = 16; } + newArray = (void **)calloc(sizeof(void *), newSize); + if (l->array) { + if (l->fillSize > 0) { + memcpy(newArray, l->array, sizeof(void *) * l->fillSize); + } + free(l->array); + } + l->array = newArray; + l->allocSize = newSize; +} +/** + * Set the number of items in a list. + * + * The new size will be no more than `l->allocSize`. + */ +void TCOD_list_set_size(TCOD_list_t l, int size) { + l->fillSize = MIN(size, l->allocSize); +} +/** + * Return a new list. + */ +TCOD_list_t TCOD_list_new(void) { + return (TCOD_list_t)calloc(1, sizeof(struct TCOD_List)); +} +/** + * Return a new list which can hold up to `nb_elements` items. + */ +TCOD_list_t TCOD_list_allocate(int nb_elements) { + TCOD_list_t l = TCOD_list_new(); + l->array = (void **)calloc(sizeof(void *), nb_elements); + l->allocSize = nb_elements; + return l; +} +/** + * Return a new copy of `l`. + */ +TCOD_list_t TCOD_list_duplicate(TCOD_list_t l) { + int i = 0; + void **t; + TCOD_list_t ret = TCOD_list_allocate(l->allocSize); + ret->fillSize = l->fillSize; + for (t = TCOD_list_begin(l); t != TCOD_list_end(l); ++t) { + ret->array[i++] = *t; + } + return ret; +} +/** + * Delete a list. + * + * This only frees the list itself, if the list contains any pointers then + * those will need to be freed separately. + */ +void TCOD_list_delete(TCOD_list_t l) { + if (l) { + free(l->array); + } + free(l); +} +/** + * Add `elt` to the end of a list. + */ +void TCOD_list_push(TCOD_list_t l, const void *elt) { + if (l->fillSize + 1 >= l->allocSize) { TCOD_list_allocate_int(l); } + l->array[l->fillSize++] = (void *)elt; +} +/** + * Remove the last item from a list and return it. + * + * If the list is empty this will return NULL. + */ +void * TCOD_list_pop(TCOD_list_t l) { + if (l->fillSize == 0) { return NULL; } + return l->array[--(l->fillSize)]; +} +/** + * Return the list item from the list, without removing it. + * + * If the list is empty this will return NULL. + */ +void * TCOD_list_peek(TCOD_list_t l) { + if (l->fillSize == 0) { return NULL; } + return l->array[l->fillSize - 1]; +} +/** + * Add all items from `l2` to the end of `l`. + */ +void TCOD_list_add_all(TCOD_list_t l, TCOD_list_t l2) { + void **curElt; + for (curElt = TCOD_list_begin(l2); curElt != TCOD_list_end(l2); ++curElt) { + TCOD_list_push(l, *curElt); + } +} +/** + * Return the item at index `idx`. + */ +void * TCOD_list_get(TCOD_list_t l,int idx) { + return l->array[idx]; +} +/** + * Set the item at `idx` to `elt`. + * + * The list will automatically resize to fit and item at `idx`. + */ +void TCOD_list_set(TCOD_list_t l,const void *elt, int idx) { + if (idx < 0) { return; } + while (l->allocSize < idx + 1) { TCOD_list_allocate_int(l); } + l->array[idx] = (void *)elt; + if (idx + 1 > l->fillSize) l->fillSize = idx + 1; +} +/** + * Return a pointer to the beginning of the list. + */ +void ** TCOD_list_begin(TCOD_list_t l) { + if (l->fillSize == 0) { return (void **)NULL; } + return &l->array[0]; +} +/** + * Return a pointer to the end of the list. + */ +void ** TCOD_list_end(TCOD_list_t l) { + if (l->fillSize == 0) { return (void **)NULL; } + return &l->array[l->fillSize]; +} +/** + * Reverse the order of the list. + */ +void TCOD_list_reverse(TCOD_list_t l) { + void **head = TCOD_list_begin(l); + void **tail = TCOD_list_end(l) - 1; + while (head < tail) { + void *tmp = *head; + *head = *tail; + *tail = tmp; + ++head; + --tail; + } +} +/** + * Remove an item from the list and return a new iterator. + */ +void **TCOD_list_remove_iterator(TCOD_list_t l, void **elt) { + void **curElt; + for (curElt = elt; curElt < TCOD_list_end(l) - 1; ++curElt) { + *curElt = *(curElt + 1); + } + l->fillSize--; + if (l->fillSize == 0) { + return ((void **)NULL) - 1; + } else { + return elt - 1; + } +} +/** + * Remove an item from the list. + */ +void TCOD_list_remove(TCOD_list_t l, const void *elt) { + void **curElt; + for (curElt = TCOD_list_begin(l); curElt != TCOD_list_end(l); ++curElt) { + if (*curElt == elt) { + TCOD_list_remove_iterator(l, curElt); + return; + } + } +} +/** + * Remove an item from the list and return a new iterator. + * + * This fast version replaces the removed item with the item at the end of the + * list. This is faster but does not preserve the list order. + */ +void **TCOD_list_remove_iterator_fast(TCOD_list_t l, void **elt) { + *elt = l->array[l->fillSize-1]; + l->fillSize--; + if (l->fillSize == 0) { + return ((void **)NULL) - 1; + } else { + return elt - 1; + } +} +/** + * Remove an item from the list, not preserving the list order. + * + * The removed item is replaced with the item from the end of the list. + * This is faster but does not preserve the list order. + */ +void TCOD_list_remove_fast(TCOD_list_t l, const void *elt) { + void **curElt; + for (curElt = TCOD_list_begin(l); curElt != TCOD_list_end(l); ++curElt) { + if (*curElt == elt) { + TCOD_list_remove_iterator_fast(l, curElt); + return; + } + } +} +/** + * Return true if `elt` is in the list. + */ +bool TCOD_list_contains(TCOD_list_t l,const void *elt) { + void **curElt; + for (curElt = TCOD_list_begin(l); curElt != TCOD_list_end(l); ++curElt) { + if (*curElt == elt) { return true; } + } + return false; +} +/** + * Remove ALL items from a list. + */ +void TCOD_list_clear(TCOD_list_t l) { + l->fillSize = 0; +} +/** + * Call free() on all items on the list, then remove them. + */ +void TCOD_list_clear_and_delete(TCOD_list_t l) { + void **curElt; + for (curElt = TCOD_list_begin(l); curElt != TCOD_list_end(l); ++curElt) { + free(*curElt); + } + l->fillSize = 0; +} +/** + * Return the current count of items in a list. + */ +int TCOD_list_size(TCOD_list_t l) { + return l->fillSize; +} +/** + * Insert `elt` on the index before `before`. + */ +void **TCOD_list_insert_before(TCOD_list_t l,const void *elt,int before) { + int idx; + if (l->fillSize+1 >= l->allocSize) { TCOD_list_allocate_int(l); } + for (idx = l->fillSize; idx > before; --idx) { + l->array[idx] = l->array[idx - 1]; + } + l->array[before] = (void *)elt; + l->fillSize++; + return &l->array[before]; +} +/** + * Return true if this list is empty. + */ +bool TCOD_list_is_empty(TCOD_list_t l) { + return (l->fillSize == 0); +} diff --git a/tcod_sys/libtcod/src/libtcod/mersenne.cpp b/tcod_sys/libtcod/src/libtcod/mersenne.cpp new file mode 100644 index 000000000..714128dff --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/mersenne.cpp @@ -0,0 +1,68 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "mersenne.hpp" + +#include + +#include "libtcod_int.h" + +static TCODRandom *instance=(TCODRandom *)NULL; + +TCODRandom *TCODRandom::getInstance(void) { + if (! instance ) { + instance=new TCODRandom(TCOD_RNG_CMWC,true); + } + return instance; +} + +TCODRandom::TCODRandom(TCOD_random_algo_t algo, bool allocate) { + if ( allocate ) data = TCOD_random_new(algo); +} + +TCODRandom::TCODRandom(uint32_t seed, TCOD_random_algo_t algo) { + data=TCOD_random_new_from_seed(algo, seed); +} + +TCODRandom::~TCODRandom() { + TCOD_random_delete(data); +} + +TCODRandom *TCODRandom::save() const { + TCODRandom *ret = + new TCODRandom(data->algo, false); + ret->data=TCOD_random_save(data); + return ret; +} + +void TCODRandom::restore(const TCODRandom *backup) { + TCOD_random_restore(data,backup->data); +} diff --git a/tcod_sys/libtcod/src/libtcod/mersenne.h b/tcod_sys/libtcod/src/libtcod/mersenne.h new file mode 100644 index 000000000..c1f113118 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/mersenne.h @@ -0,0 +1,64 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_RANDOM_H +#define _TCOD_RANDOM_H + +#include "portability.h" +#include "mersenne_types.h" + +#ifdef __cplusplus +extern "C" { +#endif +TCODLIB_API TCOD_random_t TCOD_random_get_instance(void); +TCODLIB_API TCOD_random_t TCOD_random_new(TCOD_random_algo_t algo); +TCODLIB_API TCOD_random_t TCOD_random_save(TCOD_random_t mersenne); +TCODLIB_API void TCOD_random_restore(TCOD_random_t mersenne, TCOD_random_t backup); +TCODLIB_API TCOD_random_t TCOD_random_new_from_seed(TCOD_random_algo_t algo, uint32_t seed); +TCODLIB_API void TCOD_random_delete(TCOD_random_t mersenne); + +TCODLIB_API void TCOD_random_set_distribution (TCOD_random_t mersenne, TCOD_distribution_t distribution); + +TCODLIB_API int TCOD_random_get_int (TCOD_random_t mersenne, int min, int max); +TCODLIB_API float TCOD_random_get_float (TCOD_random_t mersenne, float min, float max); +TCODLIB_API double TCOD_random_get_double (TCOD_random_t mersenne, double min, double max); + +TCODLIB_API int TCOD_random_get_int_mean (TCOD_random_t mersenne, int min, int max, int mean); +TCODLIB_API float TCOD_random_get_float_mean (TCOD_random_t mersenne, float min, float max, float mean); +TCODLIB_API double TCOD_random_get_double_mean (TCOD_random_t mersenne, double min, double max, double mean); + +TCODLIB_API TCOD_dice_t TCOD_random_dice_new (const char * s); +TCODLIB_API int TCOD_random_dice_roll (TCOD_random_t mersenne, TCOD_dice_t dice); +TCODLIB_API int TCOD_random_dice_roll_s (TCOD_random_t mersenne, const char * s); +#ifdef __cplusplus +} +#endif +#endif diff --git a/tcod_sys/libtcod/include/mersenne.hpp b/tcod_sys/libtcod/src/libtcod/mersenne.hpp similarity index 89% rename from tcod_sys/libtcod/include/mersenne.hpp rename to tcod_sys/libtcod/src/libtcod/mersenne.hpp index 3b09906c6..91c069c96 100644 --- a/tcod_sys/libtcod/include/mersenne.hpp +++ b/tcod_sys/libtcod/src/libtcod/mersenne.hpp @@ -1,30 +1,34 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_RANDOM_HPP #define _TCOD_RANDOM_HPP @@ -147,6 +151,14 @@ class TCODLIB_API TCODRandom { */ TCODRandom(uint32_t seed, TCOD_random_algo_t algo = TCOD_RNG_CMWC); + /** + Take ownership of a `TCOD_Random*` pointer. + \rst + .. versionadded:: 1.16 + \endrst + */ + explicit TCODRandom(TCOD_Random*&& mersenne) : data(mersenne) {} + /** @PageName random_init @FuncTitle Destroying a RNG @@ -388,12 +400,26 @@ In these cases, the selected mean will appear with the lowest frequency. inline int diceRoll (TCOD_dice_t dice) { return TCOD_random_dice_roll(data,dice); } inline int diceRoll (const char * s) { return TCOD_random_dice_roll(data,TCOD_random_dice_new(s)); } + /** + Return this objects `TCOD_Random*` pointer. + \rst + .. versionadded:: 1.16 + \endrst + */ + TCOD_Random* get_data() noexcept + { + return data; + } + const TCOD_Random* get_data() const noexcept + { + return data; + } protected : friend class TCODLIB_API TCODNoise; friend class TCODLIB_API TCODHeightMap; friend class TCODLIB_API TCODNamegen; friend class TCODNameGenerator; // Used for SWIG interface, does NOT need TCODLIB_API - TCOD_random_t data; + struct TCOD_Random* data; }; #endif diff --git a/tcod_sys/libtcod/src/mersenne_c.c b/tcod_sys/libtcod/src/libtcod/mersenne_c.c similarity index 87% rename from tcod_sys/libtcod/src/mersenne_c.c rename to tcod_sys/libtcod/src/libtcod/mersenne_c.c index 6ce7dbfbf..c0d92e209 100644 --- a/tcod_sys/libtcod/src/mersenne_c.c +++ b/tcod_sys/libtcod/src/libtcod/mersenne_c.c @@ -1,545 +1,549 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include -#include - -#include -#include - -static TCOD_random_t instance=NULL; -static float rand_div=1.0f/(float)(0xffffffff); -static double rand_div_double = 1.0 / (double)(0xffffffff); - -/* initialize the mersenne twister array */ -static void mt_init(uint32_t seed, uint32_t mt[624] ) -{ - int i; - mt[0]= seed; - for (i=1; i<624; i++) { - mt[i] = (1812433253 * (mt[i-1] ^ (mt[i-1] >> 30)) + i); - } -} - -/* get the next random value from the mersenne twister array */ -static uint32_t mt_rand(uint32_t mt[624], int *cur_mt) -{ -#define MT_HIGH_BIT 0x80000000UL -#define MT_LOW_BITS 0x7fffffffUL - uint32_t y; - - if (*cur_mt == 624) { - /* our 624 sequence is finished. generate a new one */ - int i; - - for (i=0;i<623;i++) { - y = ( mt[i] & MT_HIGH_BIT ) | ( mt[i+1] & MT_LOW_BITS ); - if ( y & 1 ) { - /* odd y */ - mt[i] = mt[ (i + 397) % 624 ] ^ (y >> 1) ^ 2567483615UL; - } else { - /* even y */ - mt[i] = mt[ (i + 397) % 624 ] ^ (y >> 1); - } - } - y = ( mt[623] & MT_HIGH_BIT ) | ( mt[0] & MT_LOW_BITS ); - if ( y & 1 ) { - /* odd y */ - mt[623] = mt[396] ^ (y >> 1) ^ 2567483615UL; - } else { - mt[623] = mt[396] ^ (y >> 1); - } - - *cur_mt = 0; - } - - y = mt[(*cur_mt)++]; - y ^= (y >> 11); - y ^= (y << 7) & 2636928640UL; - y ^= (y << 15) & 4022730752UL; - y ^= (y >> 18); - return y; -} - -/* get a random float between 0 and 1 */ -static float frandom01(mersenne_data_t *r) { - return (float)mt_rand(r->mt,&r->cur_mt)*rand_div; -} - -/* string hashing function */ -/* not used (yet) -static uint32_t hash(const char *data,int len) { - uint32_t hash = 0; - uint32_t x; - int i; - for(i = 0; i < len; data++, i++) { - hash = (hash << 4) + (*data); - if((x = hash & 0xF0000000L) != 0) { - hash ^= (x >> 24); - hash &= ~x; - } - } - return (hash & 0x7FFFFFFF); -} -*/ - -/* get a random number from the CMWC */ -#define CMWC_GET_NUMBER(num) { unsigned long long t; uint32_t x; r->cur=(r->cur+1)&4095; t=18782LL*r->Q[r->cur]+r->c; r->c=(t>>32); x=(uint32_t)(t+r->c); if (x < r->c) { x++; r->c++; } if((x+1)==0) { r->c++; x=0; } num = (uint32_t)(r->Q[r->cur] = 0xfffffffe - x); } - -TCOD_random_t TCOD_random_new(TCOD_random_algo_t algo) { - return TCOD_random_new_from_seed(algo,(uint32_t)time(0)); -} - -TCOD_random_t TCOD_random_get_instance(void) { - if (! instance ) { - instance=TCOD_random_new(TCOD_RNG_CMWC); - } - return instance; -} - -TCOD_random_t TCOD_random_new_from_seed(TCOD_random_algo_t algo, uint32_t seed) { - mersenne_data_t *r = (mersenne_data_t *)calloc(sizeof(mersenne_data_t),1); - /* Mersenne Twister */ - if (algo == TCOD_RNG_MT) { - r->algo = TCOD_RNG_MT; - r->cur_mt=624; - mt_init(seed,r->mt); - } - /* Complementary-Multiply-With-Carry or Generalised Feedback Shift Register */ - else { - int i; - /* fill the Q array with pseudorandom seeds */ - uint32_t s = seed; - for (i = 0; i < 4096; i++) r->Q[i] = s = (s * 1103515245) + 12345; /* glibc LCG */ - r->c = ((s * 1103515245) + 12345) % 809430660; /* this max value is recommended by George Marsaglia */ - r->cur = 0; - r->algo = TCOD_RNG_CMWC; - } - r->distribution = TCOD_DISTRIBUTION_LINEAR; - return (TCOD_random_t)r; -} - - -int TCOD_random_get_i(TCOD_random_t mersenne, int min, int max) { - mersenne_data_t *r; - int delta; - if (max==min) return min; - else if (max < min) { - int tmp=max; - max=min; - min=tmp; - } - if (!mersenne) mersenne=TCOD_random_get_instance(); - r=(mersenne_data_t *)mersenne; - delta = max - min + 1; - /* return a number from the Mersenne Twister */ - if (r->algo == TCOD_RNG_MT) return ( mt_rand(r->mt,&r->cur_mt) % delta ) + min; - /* or from the CMWC */ - else { - uint32_t number; - CMWC_GET_NUMBER(number) - return number % delta + min; - } -} - -float TCOD_random_get_f(TCOD_random_t mersenne,float min, float max) { - mersenne_data_t *r; - float delta,f; - if (max==min) return min; - else if (max < min) { - float tmp=max; - max=min; - min=tmp; - } - if (!mersenne) mersenne=TCOD_random_get_instance(); - r=(mersenne_data_t *)mersenne; - delta = max - min; - /* Mersenne Twister */ - if (r->algo == TCOD_RNG_MT) f = delta * frandom01(r); - /* CMWC */ - else { - uint32_t number; - CMWC_GET_NUMBER(number) - f = (float)(number) * rand_div * delta; - } - return min + f; -} - -double TCOD_random_get_d(TCOD_random_t mersenne, double min, double max) { - mersenne_data_t *r; - double delta,f; - if (max==min) return min; - else if (max < min) { - double tmp=max; - max=min; - min=tmp; - } - if (!mersenne) mersenne=TCOD_random_get_instance(); - r=(mersenne_data_t *)mersenne; - delta = max - min; - /* Mersenne Twister */ - if (r->algo == TCOD_RNG_MT) f = delta * (double)frandom01(r); - /* CMWC */ - else { - uint32_t number; - CMWC_GET_NUMBER(number) - f = (double)(number) * rand_div_double * delta; - } - return min + f; -} - -void TCOD_random_delete(TCOD_random_t mersenne) { - TCOD_IFNOT(mersenne != NULL) return; - if ( mersenne == instance ) instance = NULL; - free(mersenne); -} -TCOD_random_t TCOD_random_save(TCOD_random_t mersenne) { - mersenne_data_t *ret=(mersenne_data_t *)malloc(sizeof(mersenne_data_t)); - if (!mersenne) mersenne=TCOD_random_get_instance(); - memcpy(ret,mersenne,sizeof(mersenne_data_t)); - return (TCOD_random_t)ret; -} - -void TCOD_random_restore(TCOD_random_t mersenne, TCOD_random_t backup) { - if (!mersenne) mersenne=TCOD_random_get_instance(); - memcpy(mersenne,backup,sizeof(mersenne_data_t)); -} - -/* Box-Muller transform (Gaussian distribution) */ - -double TCOD_random_get_gaussian_double (TCOD_random_t mersenne, double mean, double std_deviation) { - double x1, x2, w, y1; - static double y2; - static bool again = false; - double ret; - if (again) - ret = mean + y2 * std_deviation; - else { - mersenne_data_t *r = NULL; - if (!mersenne) mersenne=TCOD_random_get_instance(); - r = (mersenne_data_t *)mersenne; - /* MT */ - if (r->algo == TCOD_RNG_MT) { - do { - x1 = frandom01(r) * 2.0 - 1.0; - x2 = frandom01(r) * 2.0 - 1.0; - w = x1 * x1 + x2 * x2; - } while (w >= 1.0); - } - /* CMWC */ - else { - uint32_t number; - do { - CMWC_GET_NUMBER(number) - x1 = number * rand_div_double * 2.0 - 1.0; - CMWC_GET_NUMBER(number) - x2 = number * rand_div_double * 2.0 - 1.0; - w = x1 * x1 + x2 * x2; - } while (w >= 1.0); - } - w = sqrt((-2.0 * log(w)) / w); - y1 = x1 * w; - y2 = x2 * w; - ret = mean + y1 * std_deviation; - } - again = !again; - return ret; -} - -float TCOD_random_get_gaussian_float (TCOD_random_t mersenne, float mean, float std_deviation) { - return (float)TCOD_random_get_gaussian_double(mersenne, (double)mean, (double)std_deviation); -} - -int TCOD_random_get_gaussian_int (TCOD_random_t mersenne, int mean, int std_deviation) { - double num = TCOD_random_get_gaussian_double(mersenne,(double)mean,(double)std_deviation); - return (num >= 0.0 ? (int)(num + 0.5) : (int)(num - 0.5)); -} - -/* Box-Muller, ranges */ - -double TCOD_random_get_gaussian_double_range (TCOD_random_t mersenne, double min, double max) { - double mean, std_deviation, ret; - if (min > max) { - double tmp = max; - max = min; - min = tmp; - } - mean = (min + max) / 2; - std_deviation = (max - min) / 6.0; /* 6.0 is used because of the three-sigma rule */ - ret = TCOD_random_get_gaussian_double(mersenne, mean, std_deviation); - return CLAMP(min,max,ret); -} - -float TCOD_random_get_gaussian_float_range (TCOD_random_t mersenne, float min, float max) { - if (min > max) { - float tmp = max; - max = min; - min = tmp; - } - return (float)TCOD_random_get_gaussian_double_range (mersenne, (double)min, (double)max); -} - -int TCOD_random_get_gaussian_int_range (TCOD_random_t mersenne, int min, int max) { - double num; - int ret; - if (min > max) { - int tmp = max; - max = min; - min = tmp; - } - num = TCOD_random_get_gaussian_double_range (mersenne, (double)min, (double)max); - ret = (num >= 0.0 ? (int)(num + 0.5) : (int)(num - 0.5)); - return CLAMP(min,max,ret); -} - -/* Box-Muller, ranges with a custom mean */ - -double TCOD_random_get_gaussian_double_range_custom (TCOD_random_t mersenne, double min, double max, double mean) { - double d1, d2, std_deviation, ret; - if (min > max) { - double tmp = max; - max = min; - min = tmp; - } - d1 = max - mean; - d2 = mean - min; - std_deviation = MAX(d1,d2) / 3.0; - ret = TCOD_random_get_gaussian_double(mersenne, mean, std_deviation); - return CLAMP(min,max,ret); -} - -float TCOD_random_get_gaussian_float_range_custom (TCOD_random_t mersenne, float min, float max, float mean) { - if (min > max) { - float tmp = max; - max = min; - min = tmp; - } - return (float)TCOD_random_get_gaussian_double_range_custom (mersenne, (double)min, (double)max, (double)mean); -} - -int TCOD_random_get_gaussian_int_range_custom (TCOD_random_t mersenne, int min, int max, int mean) { - double num; - int ret; - if (min > max) { - int tmp = max; - max = min; - min = tmp; - } - num = TCOD_random_get_gaussian_double_range_custom (mersenne, (double)min, (double)max, (double)mean); - ret = (num >= 0.0 ? (int)(num + 0.5) : (int)(num - 0.5)); - return CLAMP(min,max,ret); -} - -/* Box-Muller, inverted distribution */ - -double TCOD_random_get_gaussian_double_inv (TCOD_random_t mersenne, double mean, double std_deviation) { - double num = TCOD_random_get_gaussian_double(mersenne,mean,std_deviation); - return (num >= mean ? num - (3 * std_deviation) : num + (3 * std_deviation)); -} - -float TCOD_random_get_gaussian_float_inv (TCOD_random_t mersenne, float mean, float std_deviation) { - double num = TCOD_random_get_gaussian_double(mersenne,(double)mean,(double)std_deviation); - return (num >= mean ? (float)(num - (3 * std_deviation)) : (float)(num + (3 * std_deviation))); -} - -int TCOD_random_get_gaussian_int_inv (TCOD_random_t mersenne, int mean, int std_deviation) { - double num = TCOD_random_get_gaussian_double(mersenne,(double)mean,(double)std_deviation); - int inum = (num >= 0.0 ? (int)(num + 0.5) : (int)(num - 0.5)); - return (num >= mean ? inum - (3 * std_deviation) : inum + (3 * std_deviation)); -} - -/* Box-Muller, ranges, inverted distribution */ - -double TCOD_random_get_gaussian_double_range_inv (TCOD_random_t mersenne, double min, double max) { - double mean, std_deviation, ret; - if (min > max) { - double tmp = max; - max = min; - min = tmp; - } - mean = (min + max) / 2.0; - std_deviation = (max - min) / 6.0; /* 6.0 is used because of the three-sigma rule */ - ret = TCOD_random_get_gaussian_double_inv(mersenne, mean, std_deviation); - return CLAMP(min,max,ret); -} - -float TCOD_random_get_gaussian_float_range_inv (TCOD_random_t mersenne, float min, float max) { - float ret = (float)TCOD_random_get_gaussian_double_range_inv(mersenne, (double)min, (double)max); - return CLAMP(min,max,ret); -} - -int TCOD_random_get_gaussian_int_range_inv (TCOD_random_t mersenne, int min, int max) { - double num = TCOD_random_get_gaussian_double_range_inv(mersenne, (double)min, (double)max); - int ret = (num >= 0.0 ? (int)(num + 0.5) : (int)(num - 0.5)); - return CLAMP(min,max,ret); -} - -/* Box-Muller, ranges with a custom mean, inverted distribution */ - -double TCOD_random_get_gaussian_double_range_custom_inv (TCOD_random_t mersenne, double min, double max, double mean) { - double d1, d2, std_deviation, ret; - if (min > max) { - double tmp = max; - max = min; - min = tmp; - } - d1 = max - mean; - d2 = mean - min; - std_deviation = MAX(d1,d2) / 3.0; - ret = TCOD_random_get_gaussian_double_inv(mersenne, mean, std_deviation); - return CLAMP(min,max,ret); -} - -float TCOD_random_get_gaussian_float_range_custom_inv (TCOD_random_t mersenne, float min, float max, float mean) { - float ret = (float)TCOD_random_get_gaussian_double_range_custom_inv(mersenne, (double)min, (double)max, (double)mean); - return CLAMP(min,max,ret); -} - -int TCOD_random_get_gaussian_int_range_custom_inv (TCOD_random_t mersenne, int min, int max, int mean) { - double num = TCOD_random_get_gaussian_double_range_custom_inv(mersenne, (double)min, (double)max, (double)mean); - int ret = (num >= 0.0 ? (int)(num + 0.5) : (int)(num - 0.5)); - return CLAMP(min,max,ret); -} - -void TCOD_random_set_distribution (TCOD_random_t mersenne, TCOD_distribution_t distribution) { - mersenne_data_t *r = NULL; - if (!mersenne) mersenne=TCOD_random_get_instance(); - r = (mersenne_data_t *)mersenne; - r->distribution = distribution; -} - -int TCOD_random_get_int (TCOD_random_t mersenne, int min, int max) { - if (!mersenne) mersenne=TCOD_random_get_instance(); - switch (((mersenne_data_t *)mersenne)->distribution) { - case TCOD_DISTRIBUTION_LINEAR: return TCOD_random_get_i(mersenne, min, max); break; - case TCOD_DISTRIBUTION_GAUSSIAN: return TCOD_random_get_gaussian_int(mersenne, min, max); break; - case TCOD_DISTRIBUTION_GAUSSIAN_INVERSE: return TCOD_random_get_gaussian_int_inv(mersenne, min, max); break; - case TCOD_DISTRIBUTION_GAUSSIAN_RANGE: return TCOD_random_get_gaussian_int_range(mersenne, min, max); break; - case TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE: return TCOD_random_get_gaussian_int_range_inv(mersenne, min, max); break; - default: return TCOD_random_get_i(mersenne, min, max); break; - } -} - -float TCOD_random_get_float (TCOD_random_t mersenne, float min, float max) { - if (!mersenne) mersenne=TCOD_random_get_instance(); - switch (((mersenne_data_t *)mersenne)->distribution) { - case TCOD_DISTRIBUTION_LINEAR: return TCOD_random_get_f(mersenne, min, max); break; - case TCOD_DISTRIBUTION_GAUSSIAN: return TCOD_random_get_gaussian_float(mersenne, min, max); break; - case TCOD_DISTRIBUTION_GAUSSIAN_INVERSE: return TCOD_random_get_gaussian_float_inv(mersenne, min, max); break; - case TCOD_DISTRIBUTION_GAUSSIAN_RANGE: return TCOD_random_get_gaussian_float_range(mersenne, min, max); break; - case TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE: return TCOD_random_get_gaussian_float_range_inv(mersenne, min, max); break; - default: return TCOD_random_get_f(mersenne, min, max); break; - } -} - -double TCOD_random_get_double (TCOD_random_t mersenne, double min, double max) { - if (!mersenne) mersenne=TCOD_random_get_instance(); - switch (((mersenne_data_t *)mersenne)->distribution) { - case TCOD_DISTRIBUTION_LINEAR: return TCOD_random_get_d(mersenne, min, max); break; - case TCOD_DISTRIBUTION_GAUSSIAN: return TCOD_random_get_gaussian_double(mersenne, min, max); break; - case TCOD_DISTRIBUTION_GAUSSIAN_INVERSE: return TCOD_random_get_gaussian_double_inv(mersenne, min, max); break; - case TCOD_DISTRIBUTION_GAUSSIAN_RANGE: return TCOD_random_get_gaussian_double_range(mersenne, min, max); break; - case TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE: return TCOD_random_get_gaussian_double_range_inv(mersenne, min, max); break; - default: return TCOD_random_get_d(mersenne, min, max); break; - } -} - -int TCOD_random_get_int_mean (TCOD_random_t mersenne, int min, int max, int mean) { - if (!mersenne) mersenne=TCOD_random_get_instance(); - switch (((mersenne_data_t *)mersenne)->distribution) { - case TCOD_DISTRIBUTION_GAUSSIAN_INVERSE: - case TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE: return TCOD_random_get_gaussian_int_range_custom_inv(mersenne, min, max, mean); break; - default: return TCOD_random_get_gaussian_int_range_custom(mersenne, min, max, mean); break; - } -} - -float TCOD_random_get_float_mean (TCOD_random_t mersenne, float min, float max, float mean) { - if (!mersenne) mersenne=TCOD_random_get_instance(); - switch (((mersenne_data_t *)mersenne)->distribution) { - case TCOD_DISTRIBUTION_GAUSSIAN_INVERSE: - case TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE: return TCOD_random_get_gaussian_float_range_custom_inv(mersenne, min, max, mean); break; - default: return TCOD_random_get_gaussian_float_range_custom(mersenne, min, max, mean); break; - } -} - -double TCOD_random_get_double_mean (TCOD_random_t mersenne, double min, double max, double mean) { - if (!mersenne) mersenne=TCOD_random_get_instance(); - switch (((mersenne_data_t *)mersenne)->distribution) { - case TCOD_DISTRIBUTION_GAUSSIAN_INVERSE: - case TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE: return TCOD_random_get_gaussian_double_range_custom_inv(mersenne, min, max, mean); break; - default: return TCOD_random_get_gaussian_double_range_custom(mersenne, min, max, mean); break; - } -} - -TCOD_dice_t TCOD_random_dice_new (const char * s) { - TCOD_dice_t d = { 1, 1, 1.0f, 0.0f }; - char * ptr = (char *)s; - char tmp[128]; - size_t l; - /* get multiplier */ - if ((l = strcspn(ptr,"*x")) < strlen(ptr)) { - strcpy(tmp,ptr); - tmp[l] = '\0'; - d.multiplier = (float)atof(tmp); - ptr += l + 1; - } - /* get rolls */ - l = strcspn(ptr,"dD"); - strcpy(tmp,ptr); - tmp[l] = '\0'; - d.nb_rolls = atoi(tmp); - ptr += l + 1; - /* get faces */ - l = strcspn(ptr,"-+"); - strcpy(tmp,ptr); - tmp[l] = '\0'; - d.nb_faces = atoi(tmp); - ptr += l; - /* get addsub */ - if (strlen(ptr) > 0) { - int sign = (*ptr == '+') ? 1 : (-1); - ptr++; - d.addsub = (float)(atof(ptr) * sign); - } - return d; -} - -int TCOD_random_dice_roll (TCOD_random_t mersenne, TCOD_dice_t dice) { - int rolls; - int result = 0; - for (rolls = 0; rolls < dice.nb_rolls; rolls++) - result += TCOD_random_get_i(mersenne,1,dice.nb_faces); - return (int)((result + dice.addsub) * dice.multiplier); -} - -int TCOD_random_dice_roll_s (TCOD_random_t mersenne, const char * s) { - return TCOD_random_dice_roll(mersenne,TCOD_random_dice_new(s)); -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "mersenne.h" + +#include +#include +#include +#include + +#include "libtcod_int.h" +#include "utility.h" + +static TCOD_random_t instance=NULL; +static float rand_div=1.0f/(float)(0xffffffff); +static double rand_div_double = 1.0 / (double)(0xffffffff); + +/* initialize the mersenne twister array */ +static void mt_init(uint32_t seed, uint32_t mt[624] ) +{ + int i; + mt[0]= seed; + for (i=1; i<624; i++) { + mt[i] = (1812433253 * (mt[i-1] ^ (mt[i-1] >> 30)) + i); + } +} + +/* get the next random value from the mersenne twister array */ +static uint32_t mt_rand(uint32_t mt[624], int *cur_mt) +{ +#define MT_HIGH_BIT 0x80000000UL +#define MT_LOW_BITS 0x7fffffffUL + uint32_t y; + + if (*cur_mt == 624) { + /* our 624 sequence is finished. generate a new one */ + int i; + + for (i=0;i<623;i++) { + y = ( mt[i] & MT_HIGH_BIT ) | ( mt[i+1] & MT_LOW_BITS ); + if ( y & 1 ) { + /* odd y */ + mt[i] = mt[ (i + 397) % 624 ] ^ (y >> 1) ^ 2567483615UL; + } else { + /* even y */ + mt[i] = mt[ (i + 397) % 624 ] ^ (y >> 1); + } + } + y = ( mt[623] & MT_HIGH_BIT ) | ( mt[0] & MT_LOW_BITS ); + if ( y & 1 ) { + /* odd y */ + mt[623] = mt[396] ^ (y >> 1) ^ 2567483615UL; + } else { + mt[623] = mt[396] ^ (y >> 1); + } + + *cur_mt = 0; + } + + y = mt[(*cur_mt)++]; + y ^= (y >> 11); + y ^= (y << 7) & 2636928640UL; + y ^= (y << 15) & 4022730752UL; + y ^= (y >> 18); + return y; +} + +/* get a random float between 0 and 1 */ +static float frandom01(mersenne_data_t *r) { + return (float)mt_rand(r->mt,&r->cur_mt)*rand_div; +} + +/* string hashing function */ +/* not used (yet) +static uint32_t hash(const char *data,int len) { + uint32_t hash = 0; + uint32_t x; + int i; + for(i = 0; i < len; data++, i++) { + hash = (hash << 4) + (*data); + if((x = hash & 0xF0000000L) != 0) { + hash ^= (x >> 24); + hash &= ~x; + } + } + return (hash & 0x7FFFFFFF); +} +*/ + +/* get a random number from the CMWC */ +#define CMWC_GET_NUMBER(num) { unsigned long long t; uint32_t x; r->cur=(r->cur+1)&4095; t=18782LL*r->Q[r->cur]+r->c; r->c=(t>>32); x=(uint32_t)(t+r->c); if (x < r->c) { x++; r->c++; } if((x+1)==0) { r->c++; x=0; } num = (uint32_t)(r->Q[r->cur] = 0xfffffffe - x); } + +TCOD_random_t TCOD_random_new(TCOD_random_algo_t algo) { + return TCOD_random_new_from_seed(algo,(uint32_t)time(0)); +} + +TCOD_random_t TCOD_random_get_instance(void) { + if (! instance ) { + instance=TCOD_random_new(TCOD_RNG_CMWC); + } + return instance; +} + +TCOD_random_t TCOD_random_new_from_seed(TCOD_random_algo_t algo, uint32_t seed) { + mersenne_data_t *r = (mersenne_data_t *)calloc(sizeof(mersenne_data_t),1); + /* Mersenne Twister */ + if (algo == TCOD_RNG_MT) { + r->algo = TCOD_RNG_MT; + r->cur_mt=624; + mt_init(seed,r->mt); + } + /* Complementary-Multiply-With-Carry or Generalised Feedback Shift Register */ + else { + int i; + /* fill the Q array with pseudorandom seeds */ + uint32_t s = seed; + for (i = 0; i < 4096; i++) r->Q[i] = s = (s * 1103515245) + 12345; /* glibc LCG */ + r->c = ((s * 1103515245) + 12345) % 809430660; /* this max value is recommended by George Marsaglia */ + r->cur = 0; + r->algo = TCOD_RNG_CMWC; + } + r->distribution = TCOD_DISTRIBUTION_LINEAR; + return (TCOD_random_t)r; +} + + +int TCOD_random_get_i(TCOD_random_t mersenne, int min, int max) { + mersenne_data_t *r; + int delta; + if (max==min) return min; + else if (max < min) { + int tmp=max; + max=min; + min=tmp; + } + if (!mersenne) mersenne=TCOD_random_get_instance(); + r=(mersenne_data_t *)mersenne; + delta = max - min + 1; + /* return a number from the Mersenne Twister */ + if (r->algo == TCOD_RNG_MT) return ( mt_rand(r->mt,&r->cur_mt) % delta ) + min; + /* or from the CMWC */ + else { + uint32_t number; + CMWC_GET_NUMBER(number) + return number % delta + min; + } +} + +float TCOD_random_get_f(TCOD_random_t mersenne,float min, float max) { + mersenne_data_t *r; + float delta,f; + if (max==min) return min; + else if (max < min) { + float tmp=max; + max=min; + min=tmp; + } + if (!mersenne) mersenne=TCOD_random_get_instance(); + r=(mersenne_data_t *)mersenne; + delta = max - min; + /* Mersenne Twister */ + if (r->algo == TCOD_RNG_MT) f = delta * frandom01(r); + /* CMWC */ + else { + uint32_t number; + CMWC_GET_NUMBER(number) + f = (float)(number) * rand_div * delta; + } + return min + f; +} + +double TCOD_random_get_d(TCOD_random_t mersenne, double min, double max) { + mersenne_data_t *r; + double delta,f; + if (max==min) return min; + else if (max < min) { + double tmp=max; + max=min; + min=tmp; + } + if (!mersenne) mersenne=TCOD_random_get_instance(); + r=(mersenne_data_t *)mersenne; + delta = max - min; + /* Mersenne Twister */ + if (r->algo == TCOD_RNG_MT) f = delta * (double)frandom01(r); + /* CMWC */ + else { + uint32_t number; + CMWC_GET_NUMBER(number) + f = (double)(number) * rand_div_double * delta; + } + return min + f; +} + +void TCOD_random_delete(TCOD_random_t mersenne) { + TCOD_IFNOT(mersenne != NULL) return; + if ( mersenne == instance ) instance = NULL; + free(mersenne); +} +TCOD_random_t TCOD_random_save(TCOD_random_t mersenne) { + mersenne_data_t *ret=(mersenne_data_t *)malloc(sizeof(mersenne_data_t)); + if (!mersenne) mersenne=TCOD_random_get_instance(); + memcpy(ret,mersenne,sizeof(mersenne_data_t)); + return (TCOD_random_t)ret; +} + +void TCOD_random_restore(TCOD_random_t mersenne, TCOD_random_t backup) { + if (!mersenne) mersenne=TCOD_random_get_instance(); + memcpy(mersenne,backup,sizeof(mersenne_data_t)); +} + +/* Box-Muller transform (Gaussian distribution) */ + +double TCOD_random_get_gaussian_double (TCOD_random_t mersenne, double mean, double std_deviation) { + double x1, x2, w, y1; + static double y2; + static bool again = false; + double ret; + if (again) + ret = mean + y2 * std_deviation; + else { + mersenne_data_t *r = NULL; + if (!mersenne) mersenne=TCOD_random_get_instance(); + r = (mersenne_data_t *)mersenne; + /* MT */ + if (r->algo == TCOD_RNG_MT) { + do { + x1 = (double)frandom01(r) * 2.0 - 1.0; + x2 = (double)frandom01(r) * 2.0 - 1.0; + w = x1 * x1 + x2 * x2; + } while (w >= 1.0); + } + /* CMWC */ + else { + uint32_t number; + do { + CMWC_GET_NUMBER(number) + x1 = number * rand_div_double * 2.0 - 1.0; + CMWC_GET_NUMBER(number) + x2 = number * rand_div_double * 2.0 - 1.0; + w = x1 * x1 + x2 * x2; + } while (w >= 1.0); + } + w = sqrt((-2.0 * log(w)) / w); + y1 = x1 * w; + y2 = x2 * w; + ret = mean + y1 * std_deviation; + } + again = !again; + return ret; +} + +float TCOD_random_get_gaussian_float (TCOD_random_t mersenne, float mean, float std_deviation) { + return (float)TCOD_random_get_gaussian_double(mersenne, (double)mean, (double)std_deviation); +} + +int TCOD_random_get_gaussian_int (TCOD_random_t mersenne, int mean, int std_deviation) { + double num = TCOD_random_get_gaussian_double(mersenne,(double)mean,(double)std_deviation); + return (num >= 0.0 ? (int)(num + 0.5) : (int)(num - 0.5)); +} + +/* Box-Muller, ranges */ + +double TCOD_random_get_gaussian_double_range (TCOD_random_t mersenne, double min, double max) { + double mean, std_deviation, ret; + if (min > max) { + double tmp = max; + max = min; + min = tmp; + } + mean = (min + max) / 2; + std_deviation = (max - min) / 6.0; /* 6.0 is used because of the three-sigma rule */ + ret = TCOD_random_get_gaussian_double(mersenne, mean, std_deviation); + return CLAMP(min,max,ret); +} + +float TCOD_random_get_gaussian_float_range (TCOD_random_t mersenne, float min, float max) { + if (min > max) { + float tmp = max; + max = min; + min = tmp; + } + return (float)TCOD_random_get_gaussian_double_range (mersenne, (double)min, (double)max); +} + +int TCOD_random_get_gaussian_int_range (TCOD_random_t mersenne, int min, int max) { + double num; + int ret; + if (min > max) { + int tmp = max; + max = min; + min = tmp; + } + num = TCOD_random_get_gaussian_double_range (mersenne, (double)min, (double)max); + ret = (num >= 0.0 ? (int)(num + 0.5) : (int)(num - 0.5)); + return CLAMP(min,max,ret); +} + +/* Box-Muller, ranges with a custom mean */ + +double TCOD_random_get_gaussian_double_range_custom (TCOD_random_t mersenne, double min, double max, double mean) { + double d1, d2, std_deviation, ret; + if (min > max) { + double tmp = max; + max = min; + min = tmp; + } + d1 = max - mean; + d2 = mean - min; + std_deviation = MAX(d1,d2) / 3.0; + ret = TCOD_random_get_gaussian_double(mersenne, mean, std_deviation); + return CLAMP(min,max,ret); +} + +float TCOD_random_get_gaussian_float_range_custom (TCOD_random_t mersenne, float min, float max, float mean) { + if (min > max) { + float tmp = max; + max = min; + min = tmp; + } + return (float)TCOD_random_get_gaussian_double_range_custom (mersenne, (double)min, (double)max, (double)mean); +} + +int TCOD_random_get_gaussian_int_range_custom (TCOD_random_t mersenne, int min, int max, int mean) { + double num; + int ret; + if (min > max) { + int tmp = max; + max = min; + min = tmp; + } + num = TCOD_random_get_gaussian_double_range_custom (mersenne, (double)min, (double)max, (double)mean); + ret = (num >= 0.0 ? (int)(num + 0.5) : (int)(num - 0.5)); + return CLAMP(min,max,ret); +} + +/* Box-Muller, inverted distribution */ + +double TCOD_random_get_gaussian_double_inv (TCOD_random_t mersenne, double mean, double std_deviation) { + double num = TCOD_random_get_gaussian_double(mersenne,mean,std_deviation); + return (num >= mean ? num - (3 * std_deviation) : num + (3 * std_deviation)); +} + +float TCOD_random_get_gaussian_float_inv (TCOD_random_t mersenne, float mean, float std_deviation) { + float num = (float)TCOD_random_get_gaussian_double(mersenne,(double)mean,(double)std_deviation); + return (num >= mean ? (num - (3 * std_deviation)) : (num + (3 * std_deviation))); +} + +int TCOD_random_get_gaussian_int_inv (TCOD_random_t mersenne, int mean, int std_deviation) { + double num = TCOD_random_get_gaussian_double(mersenne,(double)mean,(double)std_deviation); + int inum = (num >= 0.0 ? (int)(num + 0.5) : (int)(num - 0.5)); + return (num >= mean ? inum - (3 * std_deviation) : inum + (3 * std_deviation)); +} + +/* Box-Muller, ranges, inverted distribution */ + +double TCOD_random_get_gaussian_double_range_inv (TCOD_random_t mersenne, double min, double max) { + double mean, std_deviation, ret; + if (min > max) { + double tmp = max; + max = min; + min = tmp; + } + mean = (min + max) / 2.0; + std_deviation = (max - min) / 6.0; /* 6.0 is used because of the three-sigma rule */ + ret = TCOD_random_get_gaussian_double_inv(mersenne, mean, std_deviation); + return CLAMP(min,max,ret); +} + +float TCOD_random_get_gaussian_float_range_inv (TCOD_random_t mersenne, float min, float max) { + float ret = (float)TCOD_random_get_gaussian_double_range_inv(mersenne, (double)min, (double)max); + return CLAMP(min,max,ret); +} + +int TCOD_random_get_gaussian_int_range_inv (TCOD_random_t mersenne, int min, int max) { + double num = TCOD_random_get_gaussian_double_range_inv(mersenne, (double)min, (double)max); + int ret = (num >= 0.0 ? (int)(num + 0.5) : (int)(num - 0.5)); + return CLAMP(min,max,ret); +} + +/* Box-Muller, ranges with a custom mean, inverted distribution */ + +double TCOD_random_get_gaussian_double_range_custom_inv (TCOD_random_t mersenne, double min, double max, double mean) { + double d1, d2, std_deviation, ret; + if (min > max) { + double tmp = max; + max = min; + min = tmp; + } + d1 = max - mean; + d2 = mean - min; + std_deviation = MAX(d1,d2) / 3.0; + ret = TCOD_random_get_gaussian_double_inv(mersenne, mean, std_deviation); + return CLAMP(min,max,ret); +} + +float TCOD_random_get_gaussian_float_range_custom_inv (TCOD_random_t mersenne, float min, float max, float mean) { + float ret = (float)TCOD_random_get_gaussian_double_range_custom_inv(mersenne, (double)min, (double)max, (double)mean); + return CLAMP(min,max,ret); +} + +int TCOD_random_get_gaussian_int_range_custom_inv (TCOD_random_t mersenne, int min, int max, int mean) { + double num = TCOD_random_get_gaussian_double_range_custom_inv(mersenne, (double)min, (double)max, (double)mean); + int ret = (num >= 0.0 ? (int)(num + 0.5) : (int)(num - 0.5)); + return CLAMP(min,max,ret); +} + +void TCOD_random_set_distribution (TCOD_random_t mersenne, TCOD_distribution_t distribution) { + mersenne_data_t *r = NULL; + if (!mersenne) mersenne=TCOD_random_get_instance(); + r = (mersenne_data_t *)mersenne; + r->distribution = distribution; +} + +int TCOD_random_get_int (TCOD_random_t mersenne, int min, int max) { + if (!mersenne) mersenne=TCOD_random_get_instance(); + switch (((mersenne_data_t *)mersenne)->distribution) { + case TCOD_DISTRIBUTION_LINEAR: return TCOD_random_get_i(mersenne, min, max); break; + case TCOD_DISTRIBUTION_GAUSSIAN: return TCOD_random_get_gaussian_int(mersenne, min, max); break; + case TCOD_DISTRIBUTION_GAUSSIAN_INVERSE: return TCOD_random_get_gaussian_int_inv(mersenne, min, max); break; + case TCOD_DISTRIBUTION_GAUSSIAN_RANGE: return TCOD_random_get_gaussian_int_range(mersenne, min, max); break; + case TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE: return TCOD_random_get_gaussian_int_range_inv(mersenne, min, max); break; + default: return TCOD_random_get_i(mersenne, min, max); break; + } +} + +float TCOD_random_get_float (TCOD_random_t mersenne, float min, float max) { + if (!mersenne) mersenne=TCOD_random_get_instance(); + switch (((mersenne_data_t *)mersenne)->distribution) { + case TCOD_DISTRIBUTION_LINEAR: return TCOD_random_get_f(mersenne, min, max); break; + case TCOD_DISTRIBUTION_GAUSSIAN: return TCOD_random_get_gaussian_float(mersenne, min, max); break; + case TCOD_DISTRIBUTION_GAUSSIAN_INVERSE: return TCOD_random_get_gaussian_float_inv(mersenne, min, max); break; + case TCOD_DISTRIBUTION_GAUSSIAN_RANGE: return TCOD_random_get_gaussian_float_range(mersenne, min, max); break; + case TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE: return TCOD_random_get_gaussian_float_range_inv(mersenne, min, max); break; + default: return TCOD_random_get_f(mersenne, min, max); break; + } +} + +double TCOD_random_get_double (TCOD_random_t mersenne, double min, double max) { + if (!mersenne) mersenne=TCOD_random_get_instance(); + switch (((mersenne_data_t *)mersenne)->distribution) { + case TCOD_DISTRIBUTION_LINEAR: return TCOD_random_get_d(mersenne, min, max); break; + case TCOD_DISTRIBUTION_GAUSSIAN: return TCOD_random_get_gaussian_double(mersenne, min, max); break; + case TCOD_DISTRIBUTION_GAUSSIAN_INVERSE: return TCOD_random_get_gaussian_double_inv(mersenne, min, max); break; + case TCOD_DISTRIBUTION_GAUSSIAN_RANGE: return TCOD_random_get_gaussian_double_range(mersenne, min, max); break; + case TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE: return TCOD_random_get_gaussian_double_range_inv(mersenne, min, max); break; + default: return TCOD_random_get_d(mersenne, min, max); break; + } +} + +int TCOD_random_get_int_mean (TCOD_random_t mersenne, int min, int max, int mean) { + if (!mersenne) mersenne=TCOD_random_get_instance(); + switch (((mersenne_data_t *)mersenne)->distribution) { + case TCOD_DISTRIBUTION_GAUSSIAN_INVERSE: + case TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE: return TCOD_random_get_gaussian_int_range_custom_inv(mersenne, min, max, mean); break; + default: return TCOD_random_get_gaussian_int_range_custom(mersenne, min, max, mean); break; + } +} + +float TCOD_random_get_float_mean (TCOD_random_t mersenne, float min, float max, float mean) { + if (!mersenne) mersenne=TCOD_random_get_instance(); + switch (((mersenne_data_t *)mersenne)->distribution) { + case TCOD_DISTRIBUTION_GAUSSIAN_INVERSE: + case TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE: return TCOD_random_get_gaussian_float_range_custom_inv(mersenne, min, max, mean); break; + default: return TCOD_random_get_gaussian_float_range_custom(mersenne, min, max, mean); break; + } +} + +double TCOD_random_get_double_mean (TCOD_random_t mersenne, double min, double max, double mean) { + if (!mersenne) mersenne=TCOD_random_get_instance(); + switch (((mersenne_data_t *)mersenne)->distribution) { + case TCOD_DISTRIBUTION_GAUSSIAN_INVERSE: + case TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE: return TCOD_random_get_gaussian_double_range_custom_inv(mersenne, min, max, mean); break; + default: return TCOD_random_get_gaussian_double_range_custom(mersenne, min, max, mean); break; + } +} + +TCOD_dice_t TCOD_random_dice_new (const char * s) { + TCOD_dice_t d = { 1, 1, 1.0f, 0.0f }; + char * ptr = (char *)s; + char tmp[128]; + size_t l; + /* get multiplier */ + if ((l = strcspn(ptr,"*x")) < strlen(ptr)) { + strcpy(tmp,ptr); + tmp[l] = '\0'; + d.multiplier = (float)atof(tmp); + ptr += l + 1; + } + /* get rolls */ + l = strcspn(ptr,"dD"); + strcpy(tmp,ptr); + tmp[l] = '\0'; + d.nb_rolls = atoi(tmp); + ptr += l + 1; + /* get faces */ + l = strcspn(ptr,"-+"); + strcpy(tmp,ptr); + tmp[l] = '\0'; + d.nb_faces = atoi(tmp); + ptr += l; + /* get addsub */ + if (strlen(ptr) > 0) { + int sign = (*ptr == '+') ? 1 : (-1); + ptr++; + d.addsub = (float)(atof(ptr) * sign); + } + return d; +} + +int TCOD_random_dice_roll (TCOD_random_t mersenne, TCOD_dice_t dice) { + int rolls; + int result = 0; + for (rolls = 0; rolls < dice.nb_rolls; rolls++) + result += TCOD_random_get_i(mersenne,1,dice.nb_faces); + return (int)((result + dice.addsub) * dice.multiplier); +} + +int TCOD_random_dice_roll_s (TCOD_random_t mersenne, const char * s) { + return TCOD_random_dice_roll(mersenne,TCOD_random_dice_new(s)); +} diff --git a/tcod_sys/libtcod/src/libtcod/mersenne_types.h b/tcod_sys/libtcod/src/libtcod/mersenne_types.h new file mode 100644 index 000000000..c387f15b5 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/mersenne_types.h @@ -0,0 +1,59 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_RANDOM_TYPES_H +#define _TCOD_RANDOM_TYPES_H +struct TCOD_Random; +typedef struct TCOD_Random TCOD_Random; +typedef struct TCOD_Random *TCOD_random_t; + +/* dice roll */ +typedef struct { + int nb_rolls; + int nb_faces; + float multiplier; + float addsub; +} TCOD_dice_t; + +/* PRNG algorithms */ +typedef enum { + TCOD_RNG_MT, + TCOD_RNG_CMWC +} TCOD_random_algo_t; + +typedef enum { + TCOD_DISTRIBUTION_LINEAR, + TCOD_DISTRIBUTION_GAUSSIAN, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE, + TCOD_DISTRIBUTION_GAUSSIAN_INVERSE, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE +} TCOD_distribution_t; +#endif /* _TCOD_RANDOM_TYPES_H */ diff --git a/tcod_sys/libtcod/src/libtcod/mouse.cpp b/tcod_sys/libtcod/src/libtcod/mouse.cpp new file mode 100644 index 000000000..51ebff3a4 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/mouse.cpp @@ -0,0 +1,48 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "mouse.hpp" + +void TCODMouse::showCursor(bool visible) { + TCOD_mouse_show_cursor(visible); +} + +bool TCODMouse::isCursorVisible() { + return TCOD_mouse_is_cursor_visible() != 0; +} + +void TCODMouse::move(int x, int y) { + TCOD_mouse_move(x,y); +} + +TCOD_mouse_t TCODMouse::getStatus() { + return TCOD_mouse_get_status(); +} diff --git a/tcod_sys/libtcod/src/libtcod/mouse.h b/tcod_sys/libtcod/src/libtcod/mouse.h new file mode 100644 index 000000000..c36669ba6 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/mouse.h @@ -0,0 +1,55 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_MOUSE_H +#define _TCOD_MOUSE_H + +#include "portability.h" + +#include "mouse_types.h" + +#ifdef __cplusplus +extern "C" { +#endif +TCOD_DEPRECATED("Use SDL to handle the mouse cursor.") +TCODLIB_API void TCOD_mouse_show_cursor(bool visible); +TCOD_DEPRECATED("Use SDL to check the mouse state.") +TCODLIB_API TCOD_mouse_t TCOD_mouse_get_status(void); +TCOD_DEPRECATED("Use SDL to handle the mouse cursor.") +TCODLIB_API bool TCOD_mouse_is_cursor_visible(void); +TCOD_DEPRECATED("Use SDL to handle the mouse cursor.") +TCODLIB_API void TCOD_mouse_move(int x, int y); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_mouse_includes_touch(bool enable); +#ifdef __cplusplus +} +#endif +#endif /* _TCOD_MOUSE_H */ diff --git a/tcod_sys/libtcod/include/mouse.hpp b/tcod_sys/libtcod/src/libtcod/mouse.hpp similarity index 54% rename from tcod_sys/libtcod/include/mouse.hpp rename to tcod_sys/libtcod/src/libtcod/mouse.hpp index ac40cfc61..9e0c2bac8 100644 --- a/tcod_sys/libtcod/include/mouse.hpp +++ b/tcod_sys/libtcod/src/libtcod/mouse.hpp @@ -1,37 +1,39 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_MOUSE_HPP #define _TCOD_MOUSE_HPP #include "mouse.h" -#ifdef TCOD_CONSOLE_SUPPORT - #include "mouse_types.h" class TCODLIB_API TCODMouse { @@ -84,6 +86,4 @@ public : static TCOD_mouse_t getStatus(); }; -#endif /* TCOD_CONSOLE_SUPPORT */ - #endif /* _TCOD_MOUSE_HPP */ diff --git a/tcod_sys/libtcod/src/libtcod/mouse_types.h b/tcod_sys/libtcod/src/libtcod/mouse_types.h new file mode 100644 index 000000000..d6c4590c3 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/mouse_types.h @@ -0,0 +1,51 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_MOUSE_TYPES_H +#define _TCOD_MOUSE_TYPES_H + +#include "portability.h" +/* mouse data */ +typedef struct { + int x,y; /* absolute position */ + int dx,dy; /* movement since last update in pixels */ + int cx,cy; /* cell coordinates in the root console */ + int dcx,dcy; /* movement since last update in console cells */ + bool lbutton ; /* left button status */ + bool rbutton ; /* right button status */ + bool mbutton ; /* middle button status */ + bool lbutton_pressed ; /* left button pressed event */ + bool rbutton_pressed ; /* right button pressed event */ + bool mbutton_pressed ; /* middle button pressed event */ + bool wheel_up ; /* wheel up event */ + bool wheel_down ; /* wheel down event */ +} TCOD_mouse_t; +#endif /* _TCOD_MOUSE_TYPES_H */ diff --git a/tcod_sys/libtcod/src/libtcod/namegen.cpp b/tcod_sys/libtcod/src/libtcod/namegen.cpp new file mode 100644 index 000000000..f0baa2b2f --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/namegen.cpp @@ -0,0 +1,56 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +/* +* Mingos' NameGen +* This file was written by Dominik "Mingos" Marczuk. +*/ +#include "namegen.hpp" + +void TCODNamegen::parse (const char * filename, TCODRandom * random) { + TCOD_namegen_parse (filename, random ? random->data : NULL); +} + +char * TCODNamegen::generate (char * name, bool allocate) { + return TCOD_namegen_generate (name, allocate); +} + +char * TCODNamegen::generateCustom (char * name, char * rule, bool allocate) { + return TCOD_namegen_generate_custom (name, rule, allocate); +} + +TCOD_list_t TCODNamegen::getSets (void) { + return TCOD_namegen_get_sets (); +} + +void TCODNamegen::destroy (void) { + TCOD_namegen_destroy (); +} diff --git a/tcod_sys/libtcod/src/libtcod/namegen.h b/tcod_sys/libtcod/src/libtcod/namegen.h new file mode 100644 index 000000000..68889d72d --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/namegen.h @@ -0,0 +1,64 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +/* +* Mingos' NameGen +* This file was written by Dominik "Mingos" Marczuk. +*/ + +#ifndef _TCOD_NAMEGEN_H +#define _TCOD_NAMEGEN_H + +#include "portability.h" +#include "list.h" +#include "mersenne.h" + +#ifdef __cplusplus +extern "C" { +#endif +/* the generator typedef */ +struct TCOD_NameGen; +typedef struct TCOD_NameGen *TCOD_namegen_t; + +/* parse a file with syllable sets */ +TCODLIB_API void TCOD_namegen_parse (const char * filename, TCOD_random_t random); +/* generate a name */ +TCODLIB_API char * TCOD_namegen_generate (char * name, bool allocate); +/* generate a name using a custom generation rule */ +TCODLIB_API char * TCOD_namegen_generate_custom (char * name, char * rule, bool allocate); +/* retrieve the list of all available syllable set names */ +TCODLIB_API TCOD_list_t TCOD_namegen_get_sets (void); +/* delete a generator */ +TCODLIB_API void TCOD_namegen_destroy (void); +#ifdef __cplusplus +} +#endif +#endif diff --git a/tcod_sys/libtcod/include/namegen.hpp b/tcod_sys/libtcod/src/libtcod/namegen.hpp similarity index 89% rename from tcod_sys/libtcod/include/namegen.hpp rename to tcod_sys/libtcod/src/libtcod/namegen.hpp index 82a07d8c2..0a0ab7b25 100644 --- a/tcod_sys/libtcod/include/namegen.hpp +++ b/tcod_sys/libtcod/src/libtcod/namegen.hpp @@ -1,294 +1,298 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/* -* Mingos' NameGen -* This file was written by Dominik "Mingos" Marczuk. -*/ - -#ifndef _TCOD_NAMEGEN_HPP -#define _TCOD_NAMEGEN_HPP - -#include "list.hpp" -#include "mersenne.hpp" -#include "namegen.h" -/** - @PageName namegen - @PageCategory Roguelike toolkits - @PageTitle Name generator - @PageDesc This tool allows one to generate random names out of custom made syllable sets. - */ -class TCODLIB_API TCODNamegen { - public: - /** - @PageName namegen_init - @PageFather namegen - @PageTitle Creating a generator - @FuncDesc In order to be able to generate names, the name generator needs to be fed proper data. It will then be ready to generate random names defined in the file(s) it is fed. Syllable set parsing is achieved via the following. - Note 1: Each file will be parsed once only. If, for some reason, you would like to parse the same file twice, you will need to destroy the generator first, which will empty the list of parsed files along with erasing all the data retrieved from those files. - - Note 2: The generator can be fed data multiple times if you have it in separate files. Just make sure the structure names in them aren't duplicated, otherwise they will be silently ignored. - - Note 3: In the C++ version, you are not obliged to specify the random number generator. If you skip it in the function call, the generator will assume you would like to use an instance of the default generator. - - @Cpp static void TCODNamegen::parse (const char * filename, TCODRandom * random = NULL) - @C void TCOD_namegen_parse (const char * filename, TCOD_random_t random) - @Py namegen_parse (filename, random = 0) - @C# - static void TCODNameGenerator::parse(string filename) - static void TCODNameGenerator::parse(string filename, TCODRandom random) - @Param filename The file where the desired syllable set is saved, along with its relative parh, for instance, "data/names.txt". - @Param random A random number generator object. Use NULL for the default random number generator - @CppEx - TCODNamegen::parse("data/names.txt",TCODRandom::getInstance()); - TCODNamegen::parse("data/names2.txt"); - @CEx TCOD_namegen_parse("data/names.txt",TCOD_random_get_instance()); - @PyEx libtcod.namegen_parse('data/names.txt') - */ - static void parse (const char * filename, TCODRandom * random = NULL); - - /** - @PageName namegen_init - @FuncTitle Destroying a generator - @FuncDesc To release the resources used by a name generator, you may call: - This will free all memory used by the generator. In order to generate a name again, you have to parse a file again. - @Cpp static void TCODNamegen::destroy (void) - @C void TCOD_namegen_destroy (void) - @Py namegen_destroy () - @C# static void TCODNameGenerator::destroy() - */ - static void destroy (void); - - /** - @PageName namegen_generate - @PageTitle Generating a name - @PageFather namegen - @FuncTitle Generating a default name - @FuncDesc The following will output a random name generated using one of the generation rules specified in the syllable set: - Should you choose to allocate memory for the output, you need to remember to deallocate it once you don't need the name anymore using the free() function. This applies to C++ as well (delete won't work - you have to use free()). - - On the other hand, should you choose not to allocate memory, be aware that subsequent calls will overwrite the previously returned pointer, so make sure to copy the output using strcpy(), strdup() or other means of your choosing. - - The name you specify needs to be in one of the files the generator has previously parsed (see Creating a generator). If such a name doesn't exist, a warning will be displayed and NULL will be returned. - @Cpp static char * TCODNamegen::generate (char * name, bool allocate = false) - @C char * TCOD_namegen_generate (char * name, bool allocate) - @Py namegen_generate (name, allocate = 0) - @C# string TCODNameGenerator::generate (string name) - @Param name The structure name you wish to refer to, for instance, "celtic female". - For more about how structure names work, please refer to those chapters. - @Param allocate Whether memory should be allocated for the output or not. - @CppEx - TCODNamegen::parse("data/names.txt",TCODRandom::getInstance()); - char * myName = TCODNamegen::generate("fantasy female"); - @CEx - TCOD_namegen_parse("data/names.txt",TCOD_random_get_instance()); - char * my_name = TCOD_namegen_generate("Celtic male",false); - @PyEx - libtcod.namegen_parse('data/names.txt') - name = libtcod.namegen_generate('Nordic female') - */ - static char * generate (char * name, bool allocate = false); - - /** - @PageName namegen_generate - @FuncTitle Generating a custom name - @FuncDesc It is also possible to generate a name using custom generation rules. This overrides the random choice of a generation rule from the syllable set. Please refer to chapter 16.5 to learn about the name generation rules syntax. - @Cpp static char * TCODNamegen::generateCustom (char * name, char * rule, bool allocate = false) - @C char * TCOD_namegen_generate_custom (char * name, char * rule, bool allocate) - @Py namegen_generate_custom (name, rule, allocate = 0) - @C# string TCODNameGenerator::generateCustom (string name, string rule) - @Param name The structure name you wish to refer to, for instance, "celtic female". - For more about how structure names work, please refer to those chapters. - @Param rule The name generation rule. See this chapter for more details. - @Param allocate Whether memory should be allocated for the output or not. - @CppEx - TCODNamegen::parse("data/names.txt",TCODRandom::getInstance()); - char * myName = TCODNamegen::generateCustom("Nordic male","$s$e"); - @CEx - TCOD_namegen_parse("data/names.txt",TCOD_random_get_instance()); - char * my_name = TCOD_namegen_generate_custom("Mesopotamian female","$s$e",false); - @PyEx - libtcod.namegen_parse('data/names.txt') - name = libtcod.namegen_generate_custom('Nordic female','$s$e') - */ - static char * generateCustom (char * name, char * rule, bool allocate = false); - - /** - @PageName namegen_generate - @FuncTitle Retrieving available set names - @FuncDesc If you wish to check the sylable set names that are currently available, you may call: - This will create a list with all the available syllable set names. Remember to delete that list after you don't need it anymore! - @Cpp static TCODList TCODNamegen::getSets () - @C TCOD_list_t TCOD_namegen_get_sets () - @Py namegen_get_sets () - @C# static IEnumerable TCODNameGenerator::getSets() - */ - static TCOD_list_t getSets (void); - - /** - @PageName namegen_file - @PageFather namegen - @PageTitle Syllable set configuration - @PageDesc Configuring the syllable set is vital to obtaining high quality randomly generated names. Please refer to the following subchapters for detailed information: - */ - - /** - @PageName namegen_file_1 - @PageFather namegen_file - @PageTitle Syllable set basic structure - @PageDesc The syllable sets need to be written in one or more text files that will be opened and parsed by the generator. - -The data uses a standard TCODParser file and data should be inserted according to the general rules of creating a configuration file. For more information, please refer to The libtcod config file format. - -The structure type that's defined in the generator is "name". This structure type must also be accompanied by a structure name. It will be used for identification purposes in the generator. For instance, if you use a structure name "fantasy female", you will be able to access this syllable set by creating a generator using "fantasy female" syllables. In the initialisation function, this is the "const char * name" argument. - -The structure contains different members, all of which must be of TCOD_TYPE_STRING type. The tokens inside the strings, be them phonemes or syllables, form a single string, but are separated with separator characters. Characters used for token separation are all characters that are not Latin upper- or lowercase characters, dashes or apostrophes. A comma, a space or a comma+space are all perfectly valid, human-readable separators. In order to use a character inside a string that would normally be considered a separator, precede it with a slash (eg. "/:", "/.", "/!", etc.). An exception to this rule is the space character, which can also be achieved by using an underscore (eg. "the_Great"). - -The structure members that may thus be defined are: -

phonemesVocals -phonemesConsonants -syllablesPre -syllablesStart -syllablesMiddle -syllablesEnd -syllablesPost -

- -All of those strings are considered optional. However, if you don't define a string, but reference it in the name generation rules, you will see a warning displayed on stderr about missing data. - */ - - /** - @PageName namegen_file_2 - @PageFather namegen_file - @PageTitle Illegal strings - @PageDesc Another optional property is -

illegal

- -This property contains strings that are considered illegal and thus not desired in your names. Should a generated name contain any of the tokens specified in this string, it will be discarded and replaced by a new one. Illegal strings may be as short as single characters or as long as entire names. However, it is best to create a syllable set that generates very few names that sound bad. Otherwise, the illegal list might become very long. - -Be aware that the generator will automatically correct or reject certain words, so you don't need to place every undesired possibility in this string. - -The generator will correct the following: - - * leading spaces ("_NAME") - * ending spaces ("NAME_") - * double spaces ("NAME1__NAME2") - -It will generate a new name in the following cases: - - * triple characters ("Raaagnar") - * two-character adjacent repetitions ("Bobofur" is wrong, but "Bombofur" is OK) - * three-character (or more) repetitions, whether adjacent or not ("Bombombur", "Dagbjoerdag", "Gwaerdygwaern") - -Remember that all of this is case-insensitive, so you don't need to care about uppercase/lowercase distinction in your illegal strings. - */ - - /** - @PageName namegen_file_3 - @PageFather namegen_file - @PageTitle Rules - @PageDesc There's one last string that's contained within the structure: -

rules

- -It is mandatory, so not defining it will trigger an error. It defines how the generator should join the supplied data in order to generate a name. This string uses a syntax of its own, which is also used when specifying a rule when generating a custom name (see chapter 16.2). - -The rules are parsed pretty much the same way as all other strings, so all rules regarding separators and special characters apply as well. However, you can additionally use a set of wildcards and frequency markers. Each wildcard is preceded by the dollar sign ('$'), while frequency markers are preceded by the per cent sign ('%'). Here's the complete wildcard list: - - - - - - - - - - - - - -
WildcardExampleDescription
$[INT]P$P, $25PUse a random Pre syllable.
The optional integer value denotes the per cent chance of adding the syllable.
$[INT]s$s, $25sUse a random Start syllable.
$[INT]m$m, $25mUse a random Middle syllable.
$[INT]e$e, $25eUse a random End syllable.
$[INT]p$p, $25pUse a random Post syllable.
$[INT]v$v, $25vUse a random vocal.
$[INT]c$c, $25cUse a random consonant.
$[INT]?$?, $25?Use a random phoneme (vocal or consonant).
%INT%50, %25Frequency marker. Denotes the per cent chance for the rule to be accepted if it's picked.
If the rule is not accepted, another roll is made to choose a name generation rule.
It's used to reduce the frequency a given rule is chosen with.
This marker may only appear at the beginning of a rule.
- */ - - /** - @PageName namegen_file_4 - @PageFather namegen_file - @PageTitle Example structure - @PageDesc Consider this example structure. It does not contain syllables, but rather full names. -

name "king" { - syllablesStart = "Alexander, Augustus, Casimir, Henry, John, Louis, Sigismund," - "Stanislao, Stephen, Wenceslaus" - syllablesMiddle = "I, II, III, IV, V" - syllablesEnd = "Bathory, Herman, Jogaila, Lambert, of_Bohemia, of_France," - "of_Hungary, of_Masovia, of_Poland, of_Valois, of_Varna, Probus," - "Spindleshanks, Tanglefoot, the_Bearded, the_Black, the_Bold, the_Brave," - "the_Chaste, the_Curly, the_Elbow-high, the_Exile, the_Great," - "the_Jagiellonian, the_Just, the_Old, the_Pious, the_Restorer, the_Saxon," - "the_Strong, the_Wheelwright, the_White, Vasa, Wrymouth" - rules = "%50$s, $s_$m, $s_$50m_$e" -}

- -The above structure only uses three syllable lists and has three different rules. Let's analyse them one by one. - -%50$s - this will simply output a random Start syllable, but this rule is not intended to be picked with the same frequency as the others, so the frequency marker at the beginning ("%50") ensures that 50% of the time this syllable will be rejected and a different one will be picked. - -$s_$m - this will output a Start syllable and a Middle syllable, separated with a space. - -$s_$50m_$e - This will output a Start syllable, followed by a Middle syllable, followed by an End sylable, all separated with spaces. However, the Middle syllable has only 50% chance of appearing at all, so 50% of the time the rule will actually produce a Start syllable followed directly by an End syllable, separated with a space. - -As you may have noticed, the third rule may produce a double space if the Middle syllable is not chosen. You do not have to worry about such cases, as the generator will automatically reduce all double spaces to single spaces, and leading/ending spaces will be removed completely. - -Output from this example set would contain kings' names based on the names of real monarchs of Poland. Have a look at the sample: -

Alexander IV -Alexander -Sigismund -Stanislao V -Stanislao -Henry I of Poland -Augustus V -Stanislao I the Pious -Sigismund IV the Brave -John the Great -Henry the Old -John the Bold -Stanislao II the Saxon -Wenceslaus of France -John Probus -Louis V -Wenceslaus Lambert -Stanislao Spindleshanks -Henry Herman -Alexander the Old -Louis V the Curly -Wenceslaus II -Augustus IV -Alexander V -Augustus Probus -

- */ -}; - -#endif +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +/* +* Mingos' NameGen +* This file was written by Dominik "Mingos" Marczuk. +*/ + +#ifndef _TCOD_NAMEGEN_HPP +#define _TCOD_NAMEGEN_HPP + +#include "list.hpp" +#include "mersenne.hpp" +#include "namegen.h" +/** + @PageName namegen + @PageCategory Roguelike toolkits + @PageTitle Name generator + @PageDesc This tool allows one to generate random names out of custom made syllable sets. + */ +class TCODLIB_API TCODNamegen { + public: + /** + @PageName namegen_init + @PageFather namegen + @PageTitle Creating a generator + @FuncDesc In order to be able to generate names, the name generator needs to be fed proper data. It will then be ready to generate random names defined in the file(s) it is fed. Syllable set parsing is achieved via the following. + Note 1: Each file will be parsed once only. If, for some reason, you would like to parse the same file twice, you will need to destroy the generator first, which will empty the list of parsed files along with erasing all the data retrieved from those files. + + Note 2: The generator can be fed data multiple times if you have it in separate files. Just make sure the structure names in them aren't duplicated, otherwise they will be silently ignored. + + Note 3: In the C++ version, you are not obliged to specify the random number generator. If you skip it in the function call, the generator will assume you would like to use an instance of the default generator. + + @Cpp static void TCODNamegen::parse (const char * filename, TCODRandom * random = NULL) + @C void TCOD_namegen_parse (const char * filename, TCOD_random_t random) + @Py namegen_parse (filename, random = 0) + @C# + static void TCODNameGenerator::parse(string filename) + static void TCODNameGenerator::parse(string filename, TCODRandom random) + @Param filename The file where the desired syllable set is saved, along with its relative parh, for instance, "data/names.txt". + @Param random A random number generator object. Use NULL for the default random number generator + @CppEx + TCODNamegen::parse("data/names.txt",TCODRandom::getInstance()); + TCODNamegen::parse("data/names2.txt"); + @CEx TCOD_namegen_parse("data/names.txt",TCOD_random_get_instance()); + @PyEx libtcod.namegen_parse('data/names.txt') + */ + static void parse (const char * filename, TCODRandom * random = NULL); + + /** + @PageName namegen_init + @FuncTitle Destroying a generator + @FuncDesc To release the resources used by a name generator, you may call: + This will free all memory used by the generator. In order to generate a name again, you have to parse a file again. + @Cpp static void TCODNamegen::destroy (void) + @C void TCOD_namegen_destroy (void) + @Py namegen_destroy () + @C# static void TCODNameGenerator::destroy() + */ + static void destroy (void); + + /** + @PageName namegen_generate + @PageTitle Generating a name + @PageFather namegen + @FuncTitle Generating a default name + @FuncDesc The following will output a random name generated using one of the generation rules specified in the syllable set: + Should you choose to allocate memory for the output, you need to remember to deallocate it once you don't need the name anymore using the free() function. This applies to C++ as well (delete won't work - you have to use free()). + + On the other hand, should you choose not to allocate memory, be aware that subsequent calls will overwrite the previously returned pointer, so make sure to copy the output using strcpy(), strdup() or other means of your choosing. + + The name you specify needs to be in one of the files the generator has previously parsed (see Creating a generator). If such a name doesn't exist, a warning will be displayed and NULL will be returned. + @Cpp static char * TCODNamegen::generate (char * name, bool allocate = false) + @C char * TCOD_namegen_generate (char * name, bool allocate) + @Py namegen_generate (name, allocate = 0) + @C# string TCODNameGenerator::generate (string name) + @Param name The structure name you wish to refer to, for instance, "celtic female". + For more about how structure names work, please refer to those chapters. + @Param allocate Whether memory should be allocated for the output or not. + @CppEx + TCODNamegen::parse("data/names.txt",TCODRandom::getInstance()); + char * myName = TCODNamegen::generate("fantasy female"); + @CEx + TCOD_namegen_parse("data/names.txt",TCOD_random_get_instance()); + char * my_name = TCOD_namegen_generate("Celtic male",false); + @PyEx + libtcod.namegen_parse('data/names.txt') + name = libtcod.namegen_generate('Nordic female') + */ + static char * generate (char * name, bool allocate = false); + + /** + @PageName namegen_generate + @FuncTitle Generating a custom name + @FuncDesc It is also possible to generate a name using custom generation rules. This overrides the random choice of a generation rule from the syllable set. Please refer to chapter 16.5 to learn about the name generation rules syntax. + @Cpp static char * TCODNamegen::generateCustom (char * name, char * rule, bool allocate = false) + @C char * TCOD_namegen_generate_custom (char * name, char * rule, bool allocate) + @Py namegen_generate_custom (name, rule, allocate = 0) + @C# string TCODNameGenerator::generateCustom (string name, string rule) + @Param name The structure name you wish to refer to, for instance, "celtic female". + For more about how structure names work, please refer to those chapters. + @Param rule The name generation rule. See this chapter for more details. + @Param allocate Whether memory should be allocated for the output or not. + @CppEx + TCODNamegen::parse("data/names.txt",TCODRandom::getInstance()); + char * myName = TCODNamegen::generateCustom("Nordic male","$s$e"); + @CEx + TCOD_namegen_parse("data/names.txt",TCOD_random_get_instance()); + char * my_name = TCOD_namegen_generate_custom("Mesopotamian female","$s$e",false); + @PyEx + libtcod.namegen_parse('data/names.txt') + name = libtcod.namegen_generate_custom('Nordic female','$s$e') + */ + static char * generateCustom (char * name, char * rule, bool allocate = false); + + /** + @PageName namegen_generate + @FuncTitle Retrieving available set names + @FuncDesc If you wish to check the sylable set names that are currently available, you may call: + This will create a list with all the available syllable set names. Remember to delete that list after you don't need it anymore! + @Cpp static TCODList TCODNamegen::getSets () + @C TCOD_list_t TCOD_namegen_get_sets () + @Py namegen_get_sets () + @C# static IEnumerable TCODNameGenerator::getSets() + */ + static TCOD_list_t getSets (void); + + /** + @PageName namegen_file + @PageFather namegen + @PageTitle Syllable set configuration + @PageDesc Configuring the syllable set is vital to obtaining high quality randomly generated names. Please refer to the following subchapters for detailed information: + */ + + /** + @PageName namegen_file_1 + @PageFather namegen_file + @PageTitle Syllable set basic structure + @PageDesc The syllable sets need to be written in one or more text files that will be opened and parsed by the generator. + +The data uses a standard TCODParser file and data should be inserted according to the general rules of creating a configuration file. For more information, please refer to The libtcod config file format. + +The structure type that's defined in the generator is "name". This structure type must also be accompanied by a structure name. It will be used for identification purposes in the generator. For instance, if you use a structure name "fantasy female", you will be able to access this syllable set by creating a generator using "fantasy female" syllables. In the initialisation function, this is the "const char * name" argument. + +The structure contains different members, all of which must be of TCOD_TYPE_STRING type. The tokens inside the strings, be them phonemes or syllables, form a single string, but are separated with separator characters. Characters used for token separation are all characters that are not Latin upper- or lowercase characters, dashes or apostrophes. A comma, a space or a comma+space are all perfectly valid, human-readable separators. In order to use a character inside a string that would normally be considered a separator, precede it with a slash (eg. "/:", "/.", "/!", etc.). An exception to this rule is the space character, which can also be achieved by using an underscore (eg. "the_Great"). + +The structure members that may thus be defined are: +

phonemesVocals +phonemesConsonants +syllablesPre +syllablesStart +syllablesMiddle +syllablesEnd +syllablesPost +

+ +All of those strings are considered optional. However, if you don't define a string, but reference it in the name generation rules, you will see a warning displayed on stderr about missing data. + */ + + /** + @PageName namegen_file_2 + @PageFather namegen_file + @PageTitle Illegal strings + @PageDesc Another optional property is +

illegal

+ +This property contains strings that are considered illegal and thus not desired in your names. Should a generated name contain any of the tokens specified in this string, it will be discarded and replaced by a new one. Illegal strings may be as short as single characters or as long as entire names. However, it is best to create a syllable set that generates very few names that sound bad. Otherwise, the illegal list might become very long. + +Be aware that the generator will automatically correct or reject certain words, so you don't need to place every undesired possibility in this string. + +The generator will correct the following: + + * leading spaces ("_NAME") + * ending spaces ("NAME_") + * double spaces ("NAME1__NAME2") + +It will generate a new name in the following cases: + + * triple characters ("Raaagnar") + * two-character adjacent repetitions ("Bobofur" is wrong, but "Bombofur" is OK) + * three-character (or more) repetitions, whether adjacent or not ("Bombombur", "Dagbjoerdag", "Gwaerdygwaern") + +Remember that all of this is case-insensitive, so you don't need to care about uppercase/lowercase distinction in your illegal strings. + */ + + /** + @PageName namegen_file_3 + @PageFather namegen_file + @PageTitle Rules + @PageDesc There's one last string that's contained within the structure: +

rules

+ +It is mandatory, so not defining it will trigger an error. It defines how the generator should join the supplied data in order to generate a name. This string uses a syntax of its own, which is also used when specifying a rule when generating a custom name (see chapter 16.2). + +The rules are parsed pretty much the same way as all other strings, so all rules regarding separators and special characters apply as well. However, you can additionally use a set of wildcards and frequency markers. Each wildcard is preceded by the dollar sign ('$'), while frequency markers are preceded by the per cent sign ('%'). Here's the complete wildcard list: + + + + + + + + + + + + + +
WildcardExampleDescription
$[INT]P$P, $25PUse a random Pre syllable.
The optional integer value denotes the per cent chance of adding the syllable.
$[INT]s$s, $25sUse a random Start syllable.
$[INT]m$m, $25mUse a random Middle syllable.
$[INT]e$e, $25eUse a random End syllable.
$[INT]p$p, $25pUse a random Post syllable.
$[INT]v$v, $25vUse a random vocal.
$[INT]c$c, $25cUse a random consonant.
$[INT]?$?, $25?Use a random phoneme (vocal or consonant).
%INT%50, %25Frequency marker. Denotes the per cent chance for the rule to be accepted if it's picked.
If the rule is not accepted, another roll is made to choose a name generation rule.
It's used to reduce the frequency a given rule is chosen with.
This marker may only appear at the beginning of a rule.
+ */ + + /** + @PageName namegen_file_4 + @PageFather namegen_file + @PageTitle Example structure + @PageDesc Consider this example structure. It does not contain syllables, but rather full names. +

name "king" { + syllablesStart = "Alexander, Augustus, Casimir, Henry, John, Louis, Sigismund," + "Stanislao, Stephen, Wenceslaus" + syllablesMiddle = "I, II, III, IV, V" + syllablesEnd = "Bathory, Herman, Jogaila, Lambert, of_Bohemia, of_France," + "of_Hungary, of_Masovia, of_Poland, of_Valois, of_Varna, Probus," + "Spindleshanks, Tanglefoot, the_Bearded, the_Black, the_Bold, the_Brave," + "the_Chaste, the_Curly, the_Elbow-high, the_Exile, the_Great," + "the_Jagiellonian, the_Just, the_Old, the_Pious, the_Restorer, the_Saxon," + "the_Strong, the_Wheelwright, the_White, Vasa, Wrymouth" + rules = "%50$s, $s_$m, $s_$50m_$e" +}

+ +The above structure only uses three syllable lists and has three different rules. Let's analyse them one by one. + +%50$s - this will simply output a random Start syllable, but this rule is not intended to be picked with the same frequency as the others, so the frequency marker at the beginning ("%50") ensures that 50% of the time this syllable will be rejected and a different one will be picked. + +$s_$m - this will output a Start syllable and a Middle syllable, separated with a space. + +$s_$50m_$e - This will output a Start syllable, followed by a Middle syllable, followed by an End sylable, all separated with spaces. However, the Middle syllable has only 50% chance of appearing at all, so 50% of the time the rule will actually produce a Start syllable followed directly by an End syllable, separated with a space. + +As you may have noticed, the third rule may produce a double space if the Middle syllable is not chosen. You do not have to worry about such cases, as the generator will automatically reduce all double spaces to single spaces, and leading/ending spaces will be removed completely. + +Output from this example set would contain kings' names based on the names of real monarchs of Poland. Have a look at the sample: +

Alexander IV +Alexander +Sigismund +Stanislao V +Stanislao +Henry I of Poland +Augustus V +Stanislao I the Pious +Sigismund IV the Brave +John the Great +Henry the Old +John the Bold +Stanislao II the Saxon +Wenceslaus of France +John Probus +Louis V +Wenceslaus Lambert +Stanislao Spindleshanks +Henry Herman +Alexander the Old +Louis V the Curly +Wenceslaus II +Augustus IV +Alexander V +Augustus Probus +

+ */ +}; + +#endif diff --git a/tcod_sys/libtcod/src/namegen_c.c b/tcod_sys/libtcod/src/libtcod/namegen_c.c similarity index 90% rename from tcod_sys/libtcod/src/namegen_c.c rename to tcod_sys/libtcod/src/libtcod/namegen_c.c index dc699a2c5..8ed03b33c 100644 --- a/tcod_sys/libtcod/src/namegen_c.c +++ b/tcod_sys/libtcod/src/libtcod/namegen_c.c @@ -1,641 +1,648 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/* -* Mingos' NameGen -* This file was written by Dominik "Mingos" Marczuk. -*/ -#include - -#include -#include -#include -#include - -#include - -/* ------------ * - * the typedefs * - * ------------ */ - -/* the struct containing a definition of an unprocessed syllable set */ -typedef struct { - char * name; - char * vocals; - char * consonants; - char * pre; - char * start; - char * middle; - char * end; - char * post; - char * illegal; - char * rules; -} namegen_syllables_t; - -/* and the generator struct */ -typedef struct { - /* the name that will be called */ - char * name; - /* needs to use a random number generator */ - TCOD_random_t random; - /* the lists with all the data */ - TCOD_list_t vocals; - TCOD_list_t consonants; - TCOD_list_t syllables_pre; - TCOD_list_t syllables_start; - TCOD_list_t syllables_middle; - TCOD_list_t syllables_end; - TCOD_list_t syllables_post; - TCOD_list_t illegal_strings; - TCOD_list_t rules; -} namegen_t; - -/* ------------------- * - * variables and stuff * - * ------------------- */ - -/* the list containing the generators */ -TCOD_list_t namegen_generators_list = NULL; - -/* the file parser */ -TCOD_parser_t namegen_parser; -/* parsed files list */ -TCOD_list_t parsed_files = NULL; -/* the data that will be filled out */ -namegen_syllables_t * parser_data = NULL; -namegen_t * parser_output = NULL; -/* this one's needed to correctly update the generators with RNG pointer */ -TCOD_random_t namegen_random; - -/* the string that will be pointed to upon generating a name */ -char * namegen_name = NULL; -/* for keeping track of the size of output names */ -size_t namegen_name_size; - -/* ------------------------------------ * - * stuff to operate on the syllable set * - * ------------------------------------ */ - -/* initialise a syllable set */ -namegen_syllables_t * namegen_syllables_new (void) { - namegen_syllables_t * data = calloc(sizeof(namegen_syllables_t),1); - return data; -} - -/* free a syllables set */ -void namegen_syllables_delete (namegen_syllables_t * data) { - if (data->vocals) free(data->vocals); - if (data->consonants) free(data->consonants); - if (data->pre) free(data->pre); - if (data->start) free(data->start); - if (data->middle) free(data->middle); - if (data->end) free(data->end); - if (data->post) free(data->post); - if (data->illegal) free(data->illegal); - if (data->rules) free(data->rules); - free(data->name); - free(data); -} - -/* ---------------------------------- * - * stuff to operate on the generators * - * ---------------------------------- */ - -/* create a new generator */ -namegen_t * namegen_generator_new (void) { - namegen_t * data = malloc(sizeof(namegen_t)); - data->name = NULL; - /* assign the rng */ - data->random = TCOD_random_get_instance(); - /* create the lists */ - data->vocals = TCOD_list_new(); - data->consonants = TCOD_list_new(); - data->syllables_pre = TCOD_list_new(); - data->syllables_start = TCOD_list_new(); - data->syllables_middle = TCOD_list_new(); - data->syllables_end = TCOD_list_new(); - data->syllables_post = TCOD_list_new(); - data->illegal_strings = TCOD_list_new(); - data->rules = TCOD_list_new(); - return (TCOD_namegen_t)data; -} - -/* check whether a given generator already exists */ -bool namegen_generator_check (const char * name) { - /* if the list is not created yet, create it */ - if (namegen_generators_list == NULL) { - namegen_generators_list = TCOD_list_new(); - return false; - } - /* otherwise, scan it for the name */ - else { - namegen_t ** it; - for (it = (namegen_t**)TCOD_list_begin(namegen_generators_list); it < (namegen_t**)TCOD_list_end(namegen_generators_list); it++) { - if (strcmp((*it)->name,name) == 0) return true; - } - return false; - } -} - -/* retrieve available generator names */ -void namegen_get_sets_on_error (void) { - namegen_t ** it; - fprintf (stderr,"Registered syllable sets are:\n"); - for (it = (namegen_t**)TCOD_list_begin(namegen_generators_list); it < (namegen_t**)TCOD_list_end(namegen_generators_list); it++) { - fprintf (stderr," * \"%s\"\n",(*it)->name); - } -} - -/* get the appropriate syllables set */ -namegen_t * namegen_generator_get (const char * name) { - if (namegen_generator_check(name) == true) { - namegen_t ** it; - for (it = (namegen_t**)TCOD_list_begin(namegen_generators_list); it != (namegen_t**)TCOD_list_end(namegen_generators_list); it++) { - if (strcmp((*it)->name,name) == 0) return (*it); - } - } - /* and if there's no such set... */ - else - fprintf(stderr,"Generator \"%s\" could not be retrieved.\n",name); - return NULL; -} - - - -/* destroy a generator */ -void namegen_generator_delete (namegen_t * generator) { - namegen_t * data = generator; - free(data->name); - data->random = NULL; - TCOD_list_clear_and_delete(data->vocals); - TCOD_list_clear_and_delete(data->consonants); - TCOD_list_clear_and_delete(data->syllables_pre); - TCOD_list_clear_and_delete(data->syllables_start); - TCOD_list_clear_and_delete(data->syllables_middle); - TCOD_list_clear_and_delete(data->syllables_end); - TCOD_list_clear_and_delete(data->syllables_post); - TCOD_list_clear_and_delete(data->illegal_strings); - TCOD_list_clear_and_delete(data->rules); - free(data); -} - -/* ------------------------------ * - * Populating namegen_t with data * - * ------------------------------ */ - -/* fill the pointed list with syllable data by extracting tokens */ -void namegen_populate_list (char * source, TCOD_list_t list, bool wildcards) { - size_t len = strlen(source); - size_t i = 0; - char * token = malloc(strlen(source)+1); /* tokens will typically be many and very short, but let's be cautious. What if the entire string is a single token?*/ - memset(token,'\0',strlen(source)+1); - do { - /* do the tokenising using an iterator immitation :) */ - char * it = source + i; - /* append a normal character */ - if ((*it >= 'a' && *it <= 'z') || (*it >= 'A' && *it <= 'Z') || *it == '\'' || *it == '-') - strncat(token,it,1); - /* special character */ - else if (*it == '/') { - if (wildcards == true) strncat(token,it++,2); - else strncat(token,++it,1); - i++; - } - /* underscore is converted to space */ - else if (*it == '_') { - if (wildcards == true) strncat(token,it,1); - else strcat(token," "); - } - /* add wildcards if they are allowed */ - else if (wildcards == true && (*it == '$' || *it == '%' || (*it >= '0' && *it <= '9'))) - strncat(token,it,1); - /* all other characters are treated as separators and cause adding the current token to the list */ - else if (strlen(token) > 0) { - TCOD_list_push(list,TCOD_strdup(token)); - memset(token,'\0',strlen(source)+1); - } - } while (++i <= len); - free(token); -} - -/* populate all lists of a namegen_t struct */ -void namegen_populate (namegen_t * dst, namegen_syllables_t * src) { - if (dst == NULL || src == NULL) { - fprintf(stderr,"Couldn't populate the name generator with data.\n"); - exit(1); - } - if (src->vocals != NULL) namegen_populate_list (src->vocals,dst->vocals,false); - if (src->consonants != NULL) namegen_populate_list (src->consonants,dst->consonants,false); - if (src->pre != NULL) namegen_populate_list (src->pre,dst->syllables_pre,false); - if (src->start != NULL) namegen_populate_list (src->start,dst->syllables_start,false); - if (src->middle != NULL) namegen_populate_list (src->middle,dst->syllables_middle,false); - if (src->end != NULL) namegen_populate_list (src->end,dst->syllables_end,false); - if (src->post != NULL) namegen_populate_list (src->post,dst->syllables_post,false); - if (src->illegal != NULL) namegen_populate_list (src->illegal,dst->illegal_strings,false); - if (src->rules != NULL) namegen_populate_list (src->rules,dst->rules,true); - dst->name = TCOD_strdup(src->name); -} - -/* -------------------- * - * parser-related stuff * - * -------------------- */ - -/* preparing the parser */ -void namegen_parser_prepare (void) { - static bool namegen_parser_ready = false; - if (namegen_parser_ready == true) return; - else { - TCOD_parser_struct_t parser_name ; - namegen_parser = TCOD_parser_new(); - parser_name = TCOD_parser_new_struct(namegen_parser, "name"); - TCOD_struct_add_property(parser_name, "phonemesVocals", TCOD_TYPE_STRING, false); - TCOD_struct_add_property(parser_name, "phonemesConsonants", TCOD_TYPE_STRING, false); - TCOD_struct_add_property(parser_name, "syllablesPre", TCOD_TYPE_STRING, false); - TCOD_struct_add_property(parser_name, "syllablesStart", TCOD_TYPE_STRING, false); - TCOD_struct_add_property(parser_name, "syllablesMiddle", TCOD_TYPE_STRING, false); - TCOD_struct_add_property(parser_name, "syllablesEnd", TCOD_TYPE_STRING, false); - TCOD_struct_add_property(parser_name, "syllablesPost", TCOD_TYPE_STRING, false); - TCOD_struct_add_property(parser_name, "illegal", TCOD_TYPE_STRING, false); - TCOD_struct_add_property(parser_name, "rules", TCOD_TYPE_STRING, true); - namegen_parser_ready = true; - } -} - -/* parser listener */ -bool namegen_parser_new_struct (TCOD_parser_struct_t str, const char *name) { - parser_data = namegen_syllables_new(); - return true; -} - -bool namegen_parser_flag (const char *name) { - return true; -} - -bool namegen_parser_property(const char *name, TCOD_value_type_t type, TCOD_value_t value) { - if (strcmp(name,"syllablesStart") == 0) parser_data->start = TCOD_strdup(value.s); - else if (strcmp(name,"syllablesMiddle") == 0) parser_data->middle = TCOD_strdup(value.s); - else if (strcmp(name,"syllablesEnd") == 0) parser_data->end = TCOD_strdup(value.s); - else if (strcmp(name,"syllablesPre") == 0) parser_data->pre = TCOD_strdup(value.s); - else if (strcmp(name,"syllablesPost") == 0) parser_data->post = TCOD_strdup(value.s); - else if (strcmp(name,"phonemesVocals") == 0) parser_data->vocals = TCOD_strdup(value.s); - else if (strcmp(name,"phonemesConsonants") == 0) parser_data->consonants = TCOD_strdup(value.s); - else if (strcmp(name,"rules") == 0) parser_data->rules = TCOD_strdup(value.s); - else if (strcmp(name,"illegal") == 0) { /* illegal strings are converted to lowercase */ - char * str ; - int i; - parser_data->illegal = TCOD_strdup(value.s); - str = parser_data->illegal; - for(i = 0; i < (int)strlen(str); i++) str[i] = (char)(tolower(str[i])); - } - else return false; - return true; -} - -bool namegen_parser_end_struct(TCOD_parser_struct_t str, const char *name) { - /* if there's no syllable set by this name, add it to the list */ - if (namegen_generator_check(name) == false) { - parser_data->name = TCOD_strdup(name); - parser_output = namegen_generator_new(); - namegen_populate(parser_output,parser_data); - parser_output->random = namegen_random; - if (namegen_generators_list == NULL) namegen_generators_list = TCOD_list_new(); - TCOD_list_push(namegen_generators_list, (const void*)parser_output); - } - /* free the allocated memory to prevent a memory leak */ - namegen_syllables_delete(parser_data); - return true; -} - -void namegen_parser_error(const char *msg) { - fprintf(stderr,"%s\n",msg); - exit(1); -} - -TCOD_parser_listener_t namegen_listener = { - namegen_parser_new_struct, - namegen_parser_flag, - namegen_parser_property, - namegen_parser_end_struct, - namegen_parser_error -}; - -/* run the parser */ -void namegen_parser_run (const char * filename) { - char ** it; - /* prepare the parser --- this will be executed only once */ - namegen_parser_prepare(); - if (parsed_files == NULL) parsed_files = TCOD_list_new(); - if (TCOD_list_size(parsed_files) > 0) { - for (it = (char **)TCOD_list_begin(parsed_files); it != (char **)TCOD_list_end(parsed_files); it++) - if (strcmp(*it,filename) == 0) return; - } - /* if the file hasn't been parsed yet, add its name to the list so that it's never parsed twice */ - TCOD_list_push(parsed_files,(const void *)TCOD_strdup(filename)); - /* run the parser */ - TCOD_parser_run(namegen_parser,filename,&namegen_listener); -} - -/* --------------- * - * rubbish pruning * - * --------------- */ - -/* search for occurrences of triple characters (case-insensitive) */ -bool namegen_word_has_triples (char * str) { - char * it = str; - char c = (char)(tolower(*it)); - int cnt = 1; - bool has_triples = false; - it++; - while (*it != '\0') { - if ((char)(tolower(*it)) == c) cnt++; - else { - cnt = 1; - c = (char)(tolower(*it)); - } - if (cnt >= 3) has_triples = true; - it++; - } - return has_triples; -} - -/* search for occurrences of illegal strings */ -bool namegen_word_has_illegal (namegen_t * data, char * str) { - /* convert word to lowercase */ - char * haystack = TCOD_strdup(str); - int i; - for(i = 0; i < (int)strlen(haystack); i++) haystack[i] = (char)(tolower(haystack[i])); - /* look for illegal strings */ - if (TCOD_list_size(data->illegal_strings) > 0) { - char ** it; - for (it = (char**)TCOD_list_begin(data->illegal_strings); it != (char**)TCOD_list_end(data->illegal_strings); it++) { - if (strstr(haystack,*it) != NULL) { - free(haystack); - return true; - } - } - } - free(haystack); - return false; -} - -/* removes double spaces, as well as leading and ending spaces */ -void namegen_word_prune_spaces (char * str) { - char * s; - char * data = str; - /* remove leading spaces */ - while (data[0] == ' ') memmove (data, data+1, strlen(data)); - /* reduce double spaces to single spaces */ - while ((s = strstr(data," ")) != NULL) memmove (s, s+1, strlen(s)); - /* remove the final space */ - while (data[strlen(data)-1] == ' ') data[strlen(data)-1] = '\0'; -} - -/* prune repeated "syllables", such as Arnarn */ -bool namegen_word_prune_syllables (char *str) { - char * data = TCOD_strdup(str); - size_t len = strlen(data); /* length of the string */ - char check[8]; - size_t i; /* iteration in for loops */ - /* change to lowercase */ - for (i = 0; i < len; i++) data[i] = (char)(tolower(data[i])); - /* start pruning */ - /* 2-character direct repetitions */ - for (i = 0; i < len - 4; i++) { - memset(check,'\0',8); - strncpy(check,data+i,2); - strncat(check,data+i,2); - if (strstr(data,check) != NULL) { - free(data); - return true; - } - } - /* 3-character repetitions (anywhere in the word) - prunes everything, even 10-char repetitions */ - for (i = 0; i < len - 6; i++) { - memset(check,'\0',8); - strncpy(check,data+i,3); - if (strstr(data+i+3,check) != NULL) { - free(data); - return true; - } - } - free(data); - return false; -} - -/* everything stacked together */ -bool namegen_word_is_ok (namegen_t * data, char * str) { - namegen_word_prune_spaces(str); - return - (strlen(str)>0) & - (!namegen_word_has_triples(str)) & - (!namegen_word_has_illegal(data,str)) & - (!namegen_word_prune_syllables(str)); -} - -/* ---------------------------- * - * publicly available functions * - * ---------------------------- */ - -/* parse a new syllable sets file - allocates a new data structure and fills it with necessary content */ -void TCOD_namegen_parse (const char * filename, TCOD_random_t random) { - /* check for file existence */ - FILE * in = fopen(filename,"r"); - if (in == NULL) { - fprintf(stderr,"File \"%s\" not found!\n",filename); - return; - } - fclose(in); - /* set namegen RNG */ - namegen_random = random; - /* run the proper parser - add the file's contents to the data structures */ - namegen_parser_run(filename); -} - -/* generate a name using a given generation rule */ -char * TCOD_namegen_generate_custom (char * name, char * rule, bool allocate) { - namegen_t * data; - size_t buflen = 1024; - char * buf ; - size_t rule_len ; - if (namegen_generator_check(name)) data = namegen_generator_get(name); - else { - fprintf(stderr,"The name \"%s\" has not been found.\n",name); - namegen_get_sets_on_error(); - return NULL; - } - buf = malloc(buflen); - rule_len = strlen(rule); - /* let the show begin! */ - do { - char * it = rule; - memset(buf,'\0',buflen); - while (it <= rule + rule_len) { - /* make sure the buffer is large enough */ - if (strlen(buf) >= buflen) { - char * tmp ; - while (strlen(buf) >= buflen) buflen *= 2; - tmp = malloc(buflen); - strcpy(tmp,buf); - free(buf); - buf = tmp; - } - /* append a normal character */ - if ((*it >= 'a' && *it <= 'z') || (*it >= 'A' && *it <= 'Z') || *it == '\'' || *it == '-') - strncat(buf,it,1); - /* special character */ - else if (*it == '/') { - it++; - strncat(buf,it,1); - } - /* underscore is converted to space */ - else if (*it == '_') strcat(buf," "); - /* interpret a wildcard */ - else if (*it == '$') { - int chance = 100; - it++; - /* food for the randomiser */ - if (*it >= '0' && *it <= '9') { - chance = 0; - while (*it >= '0' && *it <= '9') { - chance *= 10; - chance += (int)(*it) - (int)('0'); - it++; - } - } - /* ok, so the chance of wildcard occurrence is calculated, now evaluate it */ - if (chance >= TCOD_random_get_int(data->random,0,100)) { - TCOD_list_t lst; - switch (*it) { - case 'P': lst = data->syllables_pre; break; - case 's': lst = data->syllables_start; break; - case 'm': lst = data->syllables_middle; break; - case 'e': lst = data->syllables_end; break; - case 'p': lst = data->syllables_post; break; - case 'v': lst = data->vocals; break; - case 'c': lst = data->consonants; break; - case '?': lst = (TCOD_random_get_int(data->random,0,1) == 0 ? data->vocals : data->consonants); break; - default: - fprintf(stderr,"Wrong rules syntax encountered!\n"); - exit(1); - break; - } - if (TCOD_list_size(lst) == 0) - fprintf(stderr,"No data found in the requested string (wildcard *%c). Check your name generation rule %s.\n",*it,rule); - else - strcat(buf,(char*)TCOD_list_get(lst,TCOD_random_get_int(data->random,0,TCOD_list_size(lst)-1))); - } - } - it++; - } - } while (!namegen_word_is_ok(data,buf)); - /* prune the spare spaces out */ - namegen_word_prune_spaces(buf); - /* return the name accordingly */ - if (allocate == true) return buf; - else { - /* take care of ensuring the recipient is sized properly */ - if (namegen_name == NULL) { - namegen_name_size = 64; - namegen_name = malloc (namegen_name_size); - } - while (strlen(buf) > namegen_name_size - 1) { - namegen_name_size *= 2; - free(namegen_name); - namegen_name = malloc(namegen_name_size); - } - strcpy(namegen_name,buf); - free(buf); - return namegen_name; - } -} - -/* generate a name with one of the rules from the file */ -char * TCOD_namegen_generate (char * name, bool allocate) { - namegen_t * data; - int rule_number; - int chance; - char * rule_rolled; - int truncation; - char * rule_parsed ; - char * ret ; - if (namegen_generator_check(name)) data = namegen_generator_get(name); - else { - fprintf(stderr,"The name \"%s\" has not been found.\n",name); - namegen_get_sets_on_error(); - return NULL; - } - /* check if the rules list is present */ - if (TCOD_list_size(data->rules) == 0) { - fprintf(stderr,"The rules list is empty!\n"); - exit(1); - } - /* choose the rule */ - do { - rule_number = TCOD_random_get_int(data->random,0,TCOD_list_size(data->rules)-1); - rule_rolled = (char*)TCOD_list_get(data->rules,rule_number); - chance = 100; - truncation = 0; - if (rule_rolled[0] == '%') { - truncation = 1; - chance = 0; - while (rule_rolled[truncation] >= '0' && rule_rolled[truncation] <= '9') { - chance *= 10; - chance += (int)(rule_rolled[truncation]) - (int)('0'); - truncation++; - } - } - } while (TCOD_random_get_int(data->random,0,100) > chance); - /* OK, we've got ourselves a new rule! */ - rule_parsed = TCOD_strdup(rule_rolled+truncation); - ret = TCOD_namegen_generate_custom(name,rule_parsed,allocate); - free(rule_parsed); - return ret; -} - -/* retrieve the list of all available syllable set names */ -TCOD_list_t TCOD_namegen_get_sets (void) { - TCOD_list_t l = TCOD_list_new(); - if (namegen_generators_list != NULL) { - namegen_t ** it; - for (it = (namegen_t**)TCOD_list_begin(namegen_generators_list); it < (namegen_t**)TCOD_list_end(namegen_generators_list); it++) { - TCOD_list_push(l,(const void*)((*it)->name)); - } - } - return l; -} - -/* delete all the generators */ -void TCOD_namegen_destroy (void) { - /* delete all generators */ - namegen_t ** it; - for (it = (namegen_t**)TCOD_list_begin(namegen_generators_list); it < (namegen_t**)TCOD_list_end(namegen_generators_list); it++) - namegen_generator_delete(*it); - /* clear the generators list */ - TCOD_list_clear(namegen_generators_list); - /* get rid of the parsed files list */ - TCOD_list_clear_and_delete(parsed_files); -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +/* +* Mingos' NameGen +* This file was written by Dominik "Mingos" Marczuk. +*/ +#include "namegen.h" + +#include +#include +#include +#include + +#include "parser.h" + +/* ------------ * + * the typedefs * + * ------------ */ + +/* the struct containing a definition of an unprocessed syllable set */ +typedef struct { + char * name; + char * vocals; + char * consonants; + char * pre; + char * start; + char * middle; + char * end; + char * post; + char * illegal; + char * rules; +} namegen_syllables_t; + +/* and the generator struct */ +typedef struct TCOD_NameGen { + /* the name that will be called */ + char * name; + /* needs to use a random number generator */ + TCOD_random_t random; + /* the lists with all the data */ + TCOD_list_t vocals; + TCOD_list_t consonants; + TCOD_list_t syllables_pre; + TCOD_list_t syllables_start; + TCOD_list_t syllables_middle; + TCOD_list_t syllables_end; + TCOD_list_t syllables_post; + TCOD_list_t illegal_strings; + TCOD_list_t rules; +} namegen_t; + +/* ------------------- * + * variables and stuff * + * ------------------- */ + +/* the list containing the generators */ +TCOD_list_t namegen_generators_list = NULL; + +/* the file parser */ +TCOD_parser_t namegen_parser; +/* parsed files list */ +TCOD_list_t parsed_files = NULL; +/* the data that will be filled out */ +namegen_syllables_t * parser_data = NULL; +namegen_t * parser_output = NULL; +/* this one's needed to correctly update the generators with RNG pointer */ +TCOD_random_t namegen_random; + +/* the string that will be pointed to upon generating a name */ +char * namegen_name = NULL; +/* for keeping track of the size of output names */ +size_t namegen_name_size; + +/* ------------------------------------ * + * stuff to operate on the syllable set * + * ------------------------------------ */ + +/* initialise a syllable set */ +namegen_syllables_t * namegen_syllables_new (void) { + namegen_syllables_t * data = calloc(sizeof(namegen_syllables_t),1); + return data; +} + +/* free a syllables set */ +void namegen_syllables_delete (namegen_syllables_t * data) { + if (data->vocals) free(data->vocals); + if (data->consonants) free(data->consonants); + if (data->pre) free(data->pre); + if (data->start) free(data->start); + if (data->middle) free(data->middle); + if (data->end) free(data->end); + if (data->post) free(data->post); + if (data->illegal) free(data->illegal); + if (data->rules) free(data->rules); + free(data->name); + free(data); +} + +/* ---------------------------------- * + * stuff to operate on the generators * + * ---------------------------------- */ + +/* create a new generator */ +namegen_t * namegen_generator_new (void) { + namegen_t * data = malloc(sizeof(namegen_t)); + data->name = NULL; + /* assign the rng */ + data->random = TCOD_random_get_instance(); + /* create the lists */ + data->vocals = TCOD_list_new(); + data->consonants = TCOD_list_new(); + data->syllables_pre = TCOD_list_new(); + data->syllables_start = TCOD_list_new(); + data->syllables_middle = TCOD_list_new(); + data->syllables_end = TCOD_list_new(); + data->syllables_post = TCOD_list_new(); + data->illegal_strings = TCOD_list_new(); + data->rules = TCOD_list_new(); + return (TCOD_namegen_t)data; +} + +/* check whether a given generator already exists */ +bool namegen_generator_check (const char * name) { + /* if the list is not created yet, create it */ + if (namegen_generators_list == NULL) { + namegen_generators_list = TCOD_list_new(); + return false; + } + /* otherwise, scan it for the name */ + else { + namegen_t ** it; + for (it = (namegen_t**)TCOD_list_begin(namegen_generators_list); it < (namegen_t**)TCOD_list_end(namegen_generators_list); it++) { + if (strcmp((*it)->name,name) == 0) return true; + } + return false; + } +} + +/* retrieve available generator names */ +void namegen_get_sets_on_error (void) { + namegen_t ** it; + fprintf (stderr,"Registered syllable sets are:\n"); + for (it = (namegen_t**)TCOD_list_begin(namegen_generators_list); it < (namegen_t**)TCOD_list_end(namegen_generators_list); it++) { + fprintf (stderr," * \"%s\"\n",(*it)->name); + } +} + +/* get the appropriate syllables set */ +namegen_t * namegen_generator_get (const char * name) { + if (namegen_generator_check(name) == true) { + namegen_t ** it; + for (it = (namegen_t**)TCOD_list_begin(namegen_generators_list); it != (namegen_t**)TCOD_list_end(namegen_generators_list); it++) { + if (strcmp((*it)->name,name) == 0) return (*it); + } + } + /* and if there's no such set... */ + else + fprintf(stderr,"Generator \"%s\" could not be retrieved.\n",name); + return NULL; +} + + + +/* destroy a generator */ +void namegen_generator_delete (namegen_t * generator) { + namegen_t * data = generator; + free(data->name); + data->random = NULL; + TCOD_list_clear_and_delete(data->vocals); + TCOD_list_clear_and_delete(data->consonants); + TCOD_list_clear_and_delete(data->syllables_pre); + TCOD_list_clear_and_delete(data->syllables_start); + TCOD_list_clear_and_delete(data->syllables_middle); + TCOD_list_clear_and_delete(data->syllables_end); + TCOD_list_clear_and_delete(data->syllables_post); + TCOD_list_clear_and_delete(data->illegal_strings); + TCOD_list_clear_and_delete(data->rules); + free(data); +} + +/* ------------------------------ * + * Populating namegen_t with data * + * ------------------------------ */ + +/* fill the pointed list with syllable data by extracting tokens */ +void namegen_populate_list (char * source, TCOD_list_t list, bool wildcards) { + size_t len = strlen(source); + size_t i = 0; + char * token = malloc(strlen(source)+1); /* tokens will typically be many and very short, but let's be cautious. What if the entire string is a single token?*/ + memset(token,'\0',strlen(source)+1); + do { + /* do the tokenising using an iterator immitation :) */ + char * it = source + i; + /* append a normal character */ + if ((*it >= 'a' && *it <= 'z') || (*it >= 'A' && *it <= 'Z') || *it == '\'' || *it == '-') + strncat(token,it,1); + /* special character */ + else if (*it == '/') { + if (wildcards == true) strncat(token,it++,2); + else strncat(token,++it,1); + i++; + } + /* underscore is converted to space */ + else if (*it == '_') { + if (wildcards == true) strncat(token,it,1); + else strcat(token," "); + } + /* add wildcards if they are allowed */ + else if (wildcards == true && (*it == '$' || *it == '%' || (*it >= '0' && *it <= '9'))) + strncat(token,it,1); + /* all other characters are treated as separators and cause adding the current token to the list */ + else if (strlen(token) > 0) { + TCOD_list_push(list,TCOD_strdup(token)); + memset(token,'\0',strlen(source)+1); + } + } while (++i <= len); + free(token); +} + +/* populate all lists of a namegen_t struct */ +void namegen_populate (namegen_t * dst, namegen_syllables_t * src) { + if (dst == NULL || src == NULL) { + fprintf(stderr,"Couldn't populate the name generator with data.\n"); + exit(1); + } + if (src->vocals != NULL) namegen_populate_list (src->vocals,dst->vocals,false); + if (src->consonants != NULL) namegen_populate_list (src->consonants,dst->consonants,false); + if (src->pre != NULL) namegen_populate_list (src->pre,dst->syllables_pre,false); + if (src->start != NULL) namegen_populate_list (src->start,dst->syllables_start,false); + if (src->middle != NULL) namegen_populate_list (src->middle,dst->syllables_middle,false); + if (src->end != NULL) namegen_populate_list (src->end,dst->syllables_end,false); + if (src->post != NULL) namegen_populate_list (src->post,dst->syllables_post,false); + if (src->illegal != NULL) namegen_populate_list (src->illegal,dst->illegal_strings,false); + if (src->rules != NULL) namegen_populate_list (src->rules,dst->rules,true); + dst->name = TCOD_strdup(src->name); +} + +/* -------------------- * + * parser-related stuff * + * -------------------- */ + +/* preparing the parser */ +void namegen_parser_prepare (void) { + static bool namegen_parser_ready = false; + if (namegen_parser_ready == true) return; + else { + TCOD_parser_struct_t parser_name ; + namegen_parser = TCOD_parser_new(); + parser_name = TCOD_parser_new_struct(namegen_parser, "name"); + TCOD_struct_add_property(parser_name, "phonemesVocals", TCOD_TYPE_STRING, false); + TCOD_struct_add_property(parser_name, "phonemesConsonants", TCOD_TYPE_STRING, false); + TCOD_struct_add_property(parser_name, "syllablesPre", TCOD_TYPE_STRING, false); + TCOD_struct_add_property(parser_name, "syllablesStart", TCOD_TYPE_STRING, false); + TCOD_struct_add_property(parser_name, "syllablesMiddle", TCOD_TYPE_STRING, false); + TCOD_struct_add_property(parser_name, "syllablesEnd", TCOD_TYPE_STRING, false); + TCOD_struct_add_property(parser_name, "syllablesPost", TCOD_TYPE_STRING, false); + TCOD_struct_add_property(parser_name, "illegal", TCOD_TYPE_STRING, false); + TCOD_struct_add_property(parser_name, "rules", TCOD_TYPE_STRING, true); + namegen_parser_ready = true; + } +} + +/* parser listener */ +bool namegen_parser_new_struct (TCOD_parser_struct_t str, const char *name) { + (void)str; (void)name; // Ignored parameters. + parser_data = namegen_syllables_new(); + return true; +} + +bool namegen_parser_flag (const char *name) { + (void)name; // Ignored parameter. + return true; +} + +bool namegen_parser_property(const char *name, TCOD_value_type_t type, TCOD_value_t value) { + (void)type; // Ignored parameter. + if (strcmp(name,"syllablesStart") == 0) parser_data->start = TCOD_strdup(value.s); + else if (strcmp(name,"syllablesMiddle") == 0) parser_data->middle = TCOD_strdup(value.s); + else if (strcmp(name,"syllablesEnd") == 0) parser_data->end = TCOD_strdup(value.s); + else if (strcmp(name,"syllablesPre") == 0) parser_data->pre = TCOD_strdup(value.s); + else if (strcmp(name,"syllablesPost") == 0) parser_data->post = TCOD_strdup(value.s); + else if (strcmp(name,"phonemesVocals") == 0) parser_data->vocals = TCOD_strdup(value.s); + else if (strcmp(name,"phonemesConsonants") == 0) parser_data->consonants = TCOD_strdup(value.s); + else if (strcmp(name,"rules") == 0) parser_data->rules = TCOD_strdup(value.s); + else if (strcmp(name,"illegal") == 0) { /* illegal strings are converted to lowercase */ + char * str ; + int i; + parser_data->illegal = TCOD_strdup(value.s); + str = parser_data->illegal; + for(i = 0; i < (int)strlen(str); i++) str[i] = (char)(tolower(str[i])); + } + else return false; + return true; +} + +bool namegen_parser_end_struct(TCOD_parser_struct_t str, const char *name) { + (void)str; // Ignored parameter. + /* if there's no syllable set by this name, add it to the list */ + if (namegen_generator_check(name) == false) { + parser_data->name = TCOD_strdup(name); + parser_output = namegen_generator_new(); + namegen_populate(parser_output,parser_data); + parser_output->random = namegen_random; + if (namegen_generators_list == NULL) namegen_generators_list = TCOD_list_new(); + TCOD_list_push(namegen_generators_list, (const void*)parser_output); + } + /* free the allocated memory to prevent a memory leak */ + namegen_syllables_delete(parser_data); + return true; +} + +void namegen_parser_error(const char *msg) { + fprintf(stderr,"%s\n",msg); + exit(1); +} + +TCOD_parser_listener_t namegen_listener = { + namegen_parser_new_struct, + namegen_parser_flag, + namegen_parser_property, + namegen_parser_end_struct, + namegen_parser_error +}; + +/* run the parser */ +void namegen_parser_run (const char * filename) { + char ** it; + /* prepare the parser --- this will be executed only once */ + namegen_parser_prepare(); + if (parsed_files == NULL) parsed_files = TCOD_list_new(); + if (TCOD_list_size(parsed_files) > 0) { + for (it = (char **)TCOD_list_begin(parsed_files); it != (char **)TCOD_list_end(parsed_files); it++) + if (strcmp(*it,filename) == 0) return; + } + /* if the file hasn't been parsed yet, add its name to the list so that it's never parsed twice */ + TCOD_list_push(parsed_files,(const void *)TCOD_strdup(filename)); + /* run the parser */ + TCOD_parser_run(namegen_parser,filename,&namegen_listener); +} + +/* --------------- * + * rubbish pruning * + * --------------- */ + +/* search for occurrences of triple characters (case-insensitive) */ +bool namegen_word_has_triples (char * str) { + char * it = str; + char c = (char)(tolower(*it)); + int cnt = 1; + bool has_triples = false; + it++; + while (*it != '\0') { + if ((char)(tolower(*it)) == c) cnt++; + else { + cnt = 1; + c = (char)(tolower(*it)); + } + if (cnt >= 3) has_triples = true; + it++; + } + return has_triples; +} + +/* search for occurrences of illegal strings */ +bool namegen_word_has_illegal (namegen_t * data, char * str) { + /* convert word to lowercase */ + char * haystack = TCOD_strdup(str); + int i; + for(i = 0; i < (int)strlen(haystack); i++) haystack[i] = (char)(tolower(haystack[i])); + /* look for illegal strings */ + if (TCOD_list_size(data->illegal_strings) > 0) { + char ** it; + for (it = (char**)TCOD_list_begin(data->illegal_strings); it != (char**)TCOD_list_end(data->illegal_strings); it++) { + if (strstr(haystack,*it) != NULL) { + free(haystack); + return true; + } + } + } + free(haystack); + return false; +} + +/* removes double spaces, as well as leading and ending spaces */ +void namegen_word_prune_spaces (char * str) { + char * s; + char * data = str; + /* remove leading spaces */ + while (data[0] == ' ') memmove (data, data+1, strlen(data)); + /* reduce double spaces to single spaces */ + while ((s = strstr(data," ")) != NULL) memmove (s, s+1, strlen(s)); + /* remove the final space */ + while (data[strlen(data)-1] == ' ') data[strlen(data)-1] = '\0'; +} + +/* prune repeated "syllables", such as Arnarn */ +bool namegen_word_prune_syllables (char *str) { + char * data = TCOD_strdup(str); + int len = (int)strlen(data); + char check[8]; + /* change to lowercase */ + for (int i = 0; i < len; i++) data[i] = (char)(tolower(data[i])); + /* start pruning */ + /* 2-character direct repetitions */ + for (int i = 0; i < len - 4; i++) { + memset(check,'\0',8); + strncpy(check,data+i,2); + strncat(check,data+i,2); + if (strstr(data,check) != NULL) { + free(data); + return true; + } + } + /* 3-character repetitions (anywhere in the word) - prunes everything, even 10-char repetitions */ + for (int i = 0; i < len - 6; i++) { + memset(check,'\0',8); + strncpy(check,data+i,3); + if (strstr(data+i+3,check) != NULL) { + free(data); + return true; + } + } + free(data); + return false; +} + +/* everything stacked together */ +bool namegen_word_is_ok (namegen_t * data, char * str) { + namegen_word_prune_spaces(str); + return + (strlen(str)>0) & + (!namegen_word_has_triples(str)) & + (!namegen_word_has_illegal(data,str)) & + (!namegen_word_prune_syllables(str)); +} + +/* ---------------------------- * + * publicly available functions * + * ---------------------------- */ + +/* parse a new syllable sets file - allocates a new data structure and fills it with necessary content */ +void TCOD_namegen_parse (const char * filename, TCOD_random_t random) { + /* check for file existence */ + FILE * in = fopen(filename,"r"); + if (in == NULL) { + fprintf(stderr,"File \"%s\" not found!\n",filename); + return; + } + fclose(in); + /* set namegen RNG */ + namegen_random = random; + /* run the proper parser - add the file's contents to the data structures */ + namegen_parser_run(filename); +} + +/* generate a name using a given generation rule */ +char * TCOD_namegen_generate_custom (char * name, char * rule, bool allocate) { + namegen_t * data; + size_t buflen = 1024; + char * buf ; + size_t rule_len ; + if (namegen_generator_check(name)) data = namegen_generator_get(name); + else { + fprintf(stderr,"The name \"%s\" has not been found.\n",name); + namegen_get_sets_on_error(); + return NULL; + } + buf = malloc(buflen); + rule_len = strlen(rule); + /* let the show begin! */ + do { + char * it = rule; + memset(buf,'\0',buflen); + while (it <= rule + rule_len) { + /* make sure the buffer is large enough */ + if (strlen(buf) >= buflen) { + char * tmp ; + while (strlen(buf) >= buflen) buflen *= 2; + tmp = malloc(buflen); + strcpy(tmp,buf); + free(buf); + buf = tmp; + } + /* append a normal character */ + if ((*it >= 'a' && *it <= 'z') || (*it >= 'A' && *it <= 'Z') || *it == '\'' || *it == '-') + strncat(buf,it,1); + /* special character */ + else if (*it == '/') { + it++; + strncat(buf,it,1); + } + /* underscore is converted to space */ + else if (*it == '_') strcat(buf," "); + /* interpret a wildcard */ + else if (*it == '$') { + int chance = 100; + it++; + /* food for the randomiser */ + if (*it >= '0' && *it <= '9') { + chance = 0; + while (*it >= '0' && *it <= '9') { + chance *= 10; + chance += (int)(*it) - (int)('0'); + it++; + } + } + /* ok, so the chance of wildcard occurrence is calculated, now evaluate it */ + if (chance >= TCOD_random_get_int(data->random,0,100)) { + TCOD_list_t lst; + switch (*it) { + case 'P': lst = data->syllables_pre; break; + case 's': lst = data->syllables_start; break; + case 'm': lst = data->syllables_middle; break; + case 'e': lst = data->syllables_end; break; + case 'p': lst = data->syllables_post; break; + case 'v': lst = data->vocals; break; + case 'c': lst = data->consonants; break; + case '?': lst = (TCOD_random_get_int(data->random,0,1) == 0 ? data->vocals : data->consonants); break; + default: + fprintf(stderr,"Wrong rules syntax encountered!\n"); + exit(1); + break; + } + if (TCOD_list_size(lst) == 0) + fprintf(stderr,"No data found in the requested string (wildcard *%c). Check your name generation rule %s.\n",*it,rule); + else + strcat(buf,(char*)TCOD_list_get(lst,TCOD_random_get_int(data->random,0,TCOD_list_size(lst)-1))); + } + } + it++; + } + } while (!namegen_word_is_ok(data,buf)); + /* prune the spare spaces out */ + namegen_word_prune_spaces(buf); + /* return the name accordingly */ + if (allocate == true) return buf; + else { + /* take care of ensuring the recipient is sized properly */ + if (namegen_name == NULL) { + namegen_name_size = 64; + namegen_name = malloc (namegen_name_size); + } + while (strlen(buf) > namegen_name_size - 1) { + namegen_name_size *= 2; + free(namegen_name); + namegen_name = malloc(namegen_name_size); + } + strcpy(namegen_name,buf); + free(buf); + return namegen_name; + } +} + +/* generate a name with one of the rules from the file */ +char * TCOD_namegen_generate (char * name, bool allocate) { + namegen_t * data; + int rule_number; + int chance; + char * rule_rolled; + int truncation; + char * rule_parsed ; + char * ret ; + if (namegen_generator_check(name)) data = namegen_generator_get(name); + else { + fprintf(stderr,"The name \"%s\" has not been found.\n",name); + namegen_get_sets_on_error(); + return NULL; + } + /* check if the rules list is present */ + if (TCOD_list_size(data->rules) == 0) { + fprintf(stderr,"The rules list is empty!\n"); + exit(1); + } + /* choose the rule */ + do { + rule_number = TCOD_random_get_int(data->random,0,TCOD_list_size(data->rules)-1); + rule_rolled = (char*)TCOD_list_get(data->rules,rule_number); + chance = 100; + truncation = 0; + if (rule_rolled[0] == '%') { + truncation = 1; + chance = 0; + while (rule_rolled[truncation] >= '0' && rule_rolled[truncation] <= '9') { + chance *= 10; + chance += (int)(rule_rolled[truncation]) - (int)('0'); + truncation++; + } + } + } while (TCOD_random_get_int(data->random,0,100) > chance); + /* OK, we've got ourselves a new rule! */ + rule_parsed = TCOD_strdup(rule_rolled+truncation); + ret = TCOD_namegen_generate_custom(name,rule_parsed,allocate); + free(rule_parsed); + return ret; +} + +/* retrieve the list of all available syllable set names */ +TCOD_list_t TCOD_namegen_get_sets (void) { + TCOD_list_t l = TCOD_list_new(); + if (namegen_generators_list != NULL) { + namegen_t ** it; + for (it = (namegen_t**)TCOD_list_begin(namegen_generators_list); it < (namegen_t**)TCOD_list_end(namegen_generators_list); it++) { + TCOD_list_push(l,(const void*)((*it)->name)); + } + } + return l; +} + +/* delete all the generators */ +void TCOD_namegen_destroy (void) { + /* delete all generators */ + namegen_t ** it; + for (it = (namegen_t**)TCOD_list_begin(namegen_generators_list); it < (namegen_t**)TCOD_list_end(namegen_generators_list); it++) + namegen_generator_delete(*it); + /* clear the generators list */ + TCOD_list_clear(namegen_generators_list); + /* get rid of the parsed files list */ + TCOD_list_clear_and_delete(parsed_files); +} diff --git a/tcod_sys/libtcod/src/noise.cpp b/tcod_sys/libtcod/src/libtcod/noise.cpp similarity index 50% rename from tcod_sys/libtcod/src/noise.cpp rename to tcod_sys/libtcod/src/libtcod/noise.cpp index d731cb9dc..d5f0ac585 100644 --- a/tcod_sys/libtcod/src/noise.cpp +++ b/tcod_sys/libtcod/src/libtcod/noise.cpp @@ -1,72 +1,76 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -TCODNoise::TCODNoise(int dimensions, TCOD_noise_type_t type) { - data = TCOD_noise_new(dimensions, TCOD_NOISE_DEFAULT_HURST, TCOD_NOISE_DEFAULT_LACUNARITY, TCODRandom::getInstance()->data); - TCOD_noise_set_type(data,type); -} - -TCODNoise::TCODNoise(int dimensions, TCODRandom *random, TCOD_noise_type_t type) { - data = TCOD_noise_new(dimensions, TCOD_NOISE_DEFAULT_HURST, TCOD_NOISE_DEFAULT_LACUNARITY, random->data); - TCOD_noise_set_type(data,type); -} - -TCODNoise::TCODNoise(int dimensions, float hurst, float lacunarity, TCOD_noise_type_t type) { - data = TCOD_noise_new(dimensions, hurst, lacunarity, TCODRandom::getInstance()->data); - TCOD_noise_set_type(data,type); -} - -TCODNoise::TCODNoise(int dimensions, float hurst, float lacunarity, TCODRandom *random, TCOD_noise_type_t type) { - data = TCOD_noise_new(dimensions, hurst, lacunarity, random->data); - TCOD_noise_set_type(data,type); -} - -void TCODNoise::setType(TCOD_noise_type_t type) { - TCOD_noise_set_type(data,type); -} - -float TCODNoise::get (float *f, TCOD_noise_type_t type) { - if (type == TCOD_NOISE_DEFAULT) return TCOD_noise_get(data,f); - else return TCOD_noise_get_ex(data,f,type); -} - -float TCODNoise::getFbm (float *f, float octaves, TCOD_noise_type_t type) { - if (type == TCOD_NOISE_DEFAULT) return TCOD_noise_get_fbm(data,f,octaves); - else return TCOD_noise_get_fbm_ex(data,f,octaves,type); -} - -float TCODNoise::getTurbulence (float *f, float octaves, TCOD_noise_type_t type) { - if (type == TCOD_NOISE_DEFAULT) return TCOD_noise_get_turbulence(data,f,octaves); - else return TCOD_noise_get_turbulence_ex(data,f,octaves,type); -} - -TCODNoise::~TCODNoise() { - TCOD_noise_delete(data); -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "noise.hpp" + +#include +TCODNoise::TCODNoise(int dimensions, TCOD_noise_type_t type) { + data = TCOD_noise_new(dimensions, TCOD_NOISE_DEFAULT_HURST, TCOD_NOISE_DEFAULT_LACUNARITY, TCODRandom::getInstance()->data); + TCOD_noise_set_type(data,type); +} + +TCODNoise::TCODNoise(int dimensions, TCODRandom *random, TCOD_noise_type_t type) { + data = TCOD_noise_new(dimensions, TCOD_NOISE_DEFAULT_HURST, TCOD_NOISE_DEFAULT_LACUNARITY, random->data); + TCOD_noise_set_type(data,type); +} + +TCODNoise::TCODNoise(int dimensions, float hurst, float lacunarity, TCOD_noise_type_t type) { + data = TCOD_noise_new(dimensions, hurst, lacunarity, TCODRandom::getInstance()->data); + TCOD_noise_set_type(data,type); +} + +TCODNoise::TCODNoise(int dimensions, float hurst, float lacunarity, TCODRandom *random, TCOD_noise_type_t type) { + data = TCOD_noise_new(dimensions, hurst, lacunarity, random->data); + TCOD_noise_set_type(data,type); +} + +void TCODNoise::setType(TCOD_noise_type_t type) { + TCOD_noise_set_type(data,type); +} + +float TCODNoise::get (float *f, TCOD_noise_type_t type) { + if (type == TCOD_NOISE_DEFAULT) return TCOD_noise_get(data,f); + else return TCOD_noise_get_ex(data,f,type); +} + +float TCODNoise::getFbm (float *f, float octaves, TCOD_noise_type_t type) { + if (type == TCOD_NOISE_DEFAULT) return TCOD_noise_get_fbm(data,f,octaves); + else return TCOD_noise_get_fbm_ex(data,f,octaves,type); +} + +float TCODNoise::getTurbulence (float *f, float octaves, TCOD_noise_type_t type) { + if (type == TCOD_NOISE_DEFAULT) return TCOD_noise_get_turbulence(data,f,octaves); + else return TCOD_noise_get_turbulence_ex(data,f,octaves,type); +} + +TCODNoise::~TCODNoise() { + TCOD_noise_delete(data); +} diff --git a/tcod_sys/libtcod/src/libtcod/noise.h b/tcod_sys/libtcod/src/libtcod/noise.h new file mode 100644 index 000000000..2db35a3d7 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/noise.h @@ -0,0 +1,81 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_PERLIN_H +#define _TCOD_PERLIN_H + +#include "portability.h" +#include "mersenne_types.h" +#include "noise_defaults.h" + +typedef enum { + TCOD_NOISE_PERLIN = 1, + TCOD_NOISE_SIMPLEX = 2, + TCOD_NOISE_WAVELET = 4, + TCOD_NOISE_DEFAULT = 0 +} TCOD_noise_type_t; + +typedef struct TCOD_Noise { + int ndim; + /** Randomized map of indexes into buffer */ + unsigned char map[256]; + /** Random 256 x ndim buffer */ + float buffer[256][TCOD_NOISE_MAX_DIMENSIONS]; + /* fractal stuff */ + float H; + float lacunarity; + float exponent[TCOD_NOISE_MAX_OCTAVES]; + float *waveletTileData; + TCOD_random_t rand; + /* noise type */ + TCOD_noise_type_t noise_type; +} TCOD_Noise; +typedef TCOD_Noise *TCOD_noise_t; +#ifdef __cplusplus +extern "C" { +#endif +/* create a new noise object */ +TCODLIB_API TCOD_noise_t TCOD_noise_new(int dimensions, float hurst, float lacunarity, TCOD_random_t random); + +/* simplified API */ +TCODLIB_API void TCOD_noise_set_type (TCOD_noise_t noise, TCOD_noise_type_t type); +TCODLIB_API float TCOD_noise_get_ex (TCOD_noise_t noise, float *f, TCOD_noise_type_t type); +TCODLIB_API float TCOD_noise_get_fbm_ex (TCOD_noise_t noise, float *f, float octaves, TCOD_noise_type_t type); +TCODLIB_API float TCOD_noise_get_turbulence_ex (TCOD_noise_t noise, float *f, float octaves, TCOD_noise_type_t type); +TCODLIB_API float TCOD_noise_get (TCOD_noise_t noise, float *f); +TCODLIB_API float TCOD_noise_get_fbm (TCOD_noise_t noise, float *f, float octaves); +TCODLIB_API float TCOD_noise_get_turbulence (TCOD_noise_t noise, float *f, float octaves); +/* delete the noise object */ +TCODLIB_API void TCOD_noise_delete(TCOD_noise_t noise); +#ifdef __cplusplus +} +#endif +#endif diff --git a/tcod_sys/libtcod/include/noise.hpp b/tcod_sys/libtcod/src/libtcod/noise.hpp similarity index 89% rename from tcod_sys/libtcod/include/noise.hpp rename to tcod_sys/libtcod/src/libtcod/noise.hpp index 915b9cd4a..41ecee6c6 100644 --- a/tcod_sys/libtcod/include/noise.hpp +++ b/tcod_sys/libtcod/src/libtcod/noise.hpp @@ -1,30 +1,34 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_PERLIN_HPP #define _TCOD_PERLIN_HPP diff --git a/tcod_sys/libtcod/src/noise_c.c b/tcod_sys/libtcod/src/libtcod/noise_c.c similarity index 88% rename from tcod_sys/libtcod/src/noise_c.c rename to tcod_sys/libtcod/src/libtcod/noise_c.c index c91d23491..8c6fbb177 100644 --- a/tcod_sys/libtcod/src/noise_c.c +++ b/tcod_sys/libtcod/src/libtcod/noise_c.c @@ -1,805 +1,811 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include - -#include -#include - -#define WAVELET_TILE_SIZE 32 -#define WAVELET_ARAD 16 - -#define SIMPLEX_SCALE 0.5f -#define WAVELET_SCALE 2.0f - -typedef struct { - int ndim; - unsigned char map[256]; /* Randomized map of indexes into buffer */ - float buffer[256][TCOD_NOISE_MAX_DIMENSIONS]; /* Random 256 x ndim buffer */ - /* fractal stuff */ - float H; - float lacunarity; - float exponent[TCOD_NOISE_MAX_OCTAVES]; - float *waveletTileData; - TCOD_random_t rand; - /* noise type */ - TCOD_noise_type_t noise_type; -} perlin_data_t; - -static float lattice( perlin_data_t *data, int ix, float fx, int iy, float fy, int iz, float fz, int iw, float fw) -{ - int n[4] = {ix, iy, iz, iw}; - float f[4] = {fx, fy, fz, fw}; - int nIndex = 0; - int i; - float value = 0; - for(i=0; indim; i++) - nIndex = data->map[(nIndex + n[i]) & 0xFF]; - for(i=0; indim; i++) - value += data->buffer[nIndex][i] * f[i]; - return value; -} - -#define DEFAULT_SEED 0x15687436 -#define DELTA 1e-6f -#define SWAP(a, b, t) t = a; a = b; b = t - -#define FLOOR(a) ((a)> 0 ? ((int)a) : (((int)a)-1) ) -#define CUBIC(a) ( a * a * (3 - 2*a) ) - -static void normalize(perlin_data_t *data, float *f) -{ - float magnitude = 0; - int i; - for(i=0; indim; i++) - magnitude += f[i]*f[i]; - magnitude = 1.0f / (float)sqrt(magnitude); - for(i=0; indim; i++) - f[i] *= magnitude; -} - - -TCOD_noise_t TCOD_noise_new(int ndim, float hurst, float lacunarity, TCOD_random_t random) -{ - perlin_data_t *data=(perlin_data_t *)calloc(sizeof(perlin_data_t),1); - int i, j; - unsigned char tmp; - float f = 1; - data->rand = random ? random : TCOD_random_get_instance(); - data->ndim = ndim; - for(i=0; i<256; i++) - { - data->map[i] = (unsigned char)i; - for(j=0; jndim; j++) - data->buffer[i][j] = TCOD_random_get_float(data->rand,-0.5, 0.5); - normalize(data,data->buffer[i]); - } - - while(--i) - { - j = TCOD_random_get_int(data->rand,0, 255); - SWAP(data->map[i], data->map[j], tmp); - } - - data->H = hurst; - data->lacunarity = lacunarity; - for(i=0; iexponent[i] = 1.0f / f; - f *= lacunarity; - } - data->noise_type = TCOD_NOISE_DEFAULT; - return (TCOD_noise_t)data; -} - -float TCOD_noise_perlin( TCOD_noise_t noise, float *f ) -{ - perlin_data_t *data=(perlin_data_t *)noise; - int n[TCOD_NOISE_MAX_DIMENSIONS]; /* Indexes to pass to lattice function */ - int i; - float r[TCOD_NOISE_MAX_DIMENSIONS]; /* Remainders to pass to lattice function */ - float w[TCOD_NOISE_MAX_DIMENSIONS]; /* Cubic values to pass to interpolation function */ - float value; - - for(i=0; indim; i++) - { - n[i] = FLOOR(f[i]); - r[i] = f[i] - n[i]; - w[i] = CUBIC(r[i]); - } - - switch(data->ndim) - { - case 1: - value = LERP(lattice(data,n[0], r[0],0,0,0,0,0,0), - lattice(data,n[0]+1, r[0]-1,0,0,0,0,0,0), - w[0]); - break; - case 2: - value = LERP(LERP(lattice(data,n[0], r[0], n[1], r[1],0,0,0,0), - lattice(data,n[0]+1, r[0]-1, n[1], r[1],0,0,0,0), - w[0]), - LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1,0,0,0,0), - lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1,0,0,0,0), - w[0]), - w[1]); - break; - case 3: - value = LERP(LERP(LERP(lattice(data,n[0], r[0], n[1], r[1], n[2], r[2],0,0), - lattice(data,n[0]+1, r[0]-1, n[1], r[1], n[2], r[2],0,0), - w[0]), - LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1, n[2], r[2],0,0), - lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1, n[2], r[2],0,0), - w[0]), - w[1]), - LERP(LERP(lattice(data,n[0], r[0], n[1], r[1], n[2]+1, r[2]-1,0,0), - lattice(data,n[0]+1, r[0]-1, n[1], r[1], n[2]+1, r[2]-1,0,0), - w[0]), - LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1, n[2]+1, r[2]-1,0,0), - lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1, n[2]+1, r[2]-1,0,0), - w[0]), - w[1]), - w[2]); - break; - case 4: - default: - value = LERP(LERP(LERP(LERP(lattice(data,n[0], r[0], n[1], r[1], n[2], r[2], n[3], r[3]), - lattice(data,n[0]+1, r[0]-1, n[1], r[1], n[2], r[2], n[3], r[3]), - w[0]), - LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1, n[2], r[2], n[3], r[3]), - lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1, n[2], r[2], n[3], r[3]), - w[0]), - w[1]), - LERP(LERP(lattice(data,n[0], r[0], n[1], r[1], n[2]+1, r[2]-1, n[3], r[3]), - lattice(data,n[0]+1, r[0]-1, n[1], r[1], n[2]+1, r[2]-1, n[3], r[3]), - w[0]), - LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1, n[2]+1, r[2]-1,0,0), - lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1, n[2]+1, r[2]-1, n[3], r[3]), - w[0]), - w[1]), - w[2]), - LERP(LERP(LERP(lattice(data,n[0], r[0], n[1], r[1], n[2], r[2], n[3]+1, r[3]-1), - lattice(data,n[0]+1, r[0]-1, n[1], r[1], n[2], r[2], n[3]+1, r[3]-1), - w[0]), - LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1, n[2], r[2], n[3]+1, r[3]-1), - lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1, n[2], r[2], n[3]+1, r[3]-1), - w[0]), - w[1]), - LERP(LERP(lattice(data,n[0], r[0], n[1], r[1], n[2]+1, r[2]-1, n[3]+1, r[3]-1), - lattice(data,n[0]+1, r[0]-1, n[1], r[1], n[2]+1, r[2]-1, n[3]+1, r[3]-1), - w[0]), - LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1, n[2]+1, r[2]-1,0,0), - lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1, n[2]+1, r[2]-1, n[3]+1, r[3]-1), - w[0]), - w[1]), - w[2]), - w[3]); - break; - } - return CLAMP(-0.99999f, 0.99999f, value); -} - -static int absmod(int x, int n) { - int m=x%n; - return m < 0 ? m+n : m; -} - -/* simplex noise, adapted from Ken Perlin's presentation at Siggraph 2001 */ -/* and Stefan Gustavson implementation */ - -#define TCOD_NOISE_SIMPLEX_GRADIENT_1D(n,h,x) { float grad; h &= 0xF; grad=1.0f+(h & 7); if ( h & 8 ) grad = -grad; n = grad * x; } - -#define TCOD_NOISE_SIMPLEX_GRADIENT_2D(n,h,x,y) { float u,v; h &= 0x7; if ( h < 4 ) { u=x; v=2.0f*y; } else { u=y; v=2.0f*x; } n = ((h & 1) ? -u : u) + ((h & 2) ? -v :v ); } - -#define TCOD_NOISE_SIMPLEX_GRADIENT_3D(n,h,x,y,z) { float u,v; h &= 0xF; u = (h < 8 ? x : y); v = (h < 4 ? y : ( h == 12 || h == 14 ? x : z ) ); n= ((h & 1) ? -u : u ) + ((h & 2) ? -v : v); } - -#define TCOD_NOISE_SIMPLEX_GRADIENT_4D(n,h,x,y,z,t) { float u,v,w; h &= 0x1F; u = (h < 24 ? x:y); v = (h < 16 ? y:z); w = (h < 8 ? z:t); n= ((h & 1) ? -u : u ) + ((h & 2) ? -v : v) + ((h & 4) ? -w : w);} - -static float simplex[64][4] = { - {0,1,2,3},{0,1,3,2},{0,0,0,0},{0,2,3,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,2,3,0}, - {0,2,1,3},{0,0,0,0},{0,3,1,2},{0,3,2,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,3,2,0}, - {0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}, - {1,2,0,3},{0,0,0,0},{1,3,0,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,3,0,1},{2,3,1,0}, - {1,0,2,3},{1,0,3,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,0,3,1},{0,0,0,0},{2,1,3,0}, - {0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}, - {2,0,1,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,0,1,2},{3,0,2,1},{0,0,0,0},{3,1,2,0}, - {2,1,0,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,1,0,2},{0,0,0,0},{3,2,0,1},{3,2,1,0}, - -}; - -float TCOD_noise_simplex(TCOD_noise_t noise, float *f) { - perlin_data_t *data=(perlin_data_t *)noise; - switch(data->ndim) { - case 1 : - { - int i0=(int)FLOOR(f[0]*SIMPLEX_SCALE); - int i1=i0+1; - float x0 = f[0]*SIMPLEX_SCALE - i0; - float x1 = x0 - 1.0f; - float t0 = 1.0f - x0*x0; - float t1 = 1.0f - x1*x1; - float n0,n1; - t0 = t0*t0; - t1 = t1*t1; - i0=data->map[i0&0xFF]; - TCOD_NOISE_SIMPLEX_GRADIENT_1D(n0,i0,x0); - n0*=t0*t0; - i1=data->map[i1&0xFF]; - TCOD_NOISE_SIMPLEX_GRADIENT_1D(n1,i1,x1); - n1*=t1*t1; - return 0.25f * (n0+n1); - } - break; - case 2 : - { - #define F2 0.366025403f /* 0.5f * (sqrtf(3.0f)-1.0f); */ - #define G2 0.211324865f /* (3.0f - sqrtf(3.0f))/6.0f; */ - - float s = (f[0]+f[1])*F2*SIMPLEX_SCALE; - float xs = f[0]*SIMPLEX_SCALE+s; - float ys = f[1]*SIMPLEX_SCALE+s; - int i=FLOOR(xs); - int j=FLOOR(ys); - float t = (i+j)*G2; - float xo = i-t; - float yo = j-t; - float x0 = f[0]*SIMPLEX_SCALE-xo; - float y0 = f[1]*SIMPLEX_SCALE-yo; - int i1,j1,ii = absmod(i ,256),jj = absmod(j, 256); - float n0,n1,n2,x1,y1,x2,y2,t0,t1,t2; - if ( x0 > y0 ) { - i1=1;j1=0; - } else { - i1=0;j1=1; - } - x1 = x0 - i1 + G2; - y1 = y0 - j1 + G2; - x2 = x0 - 1.0f + 2.0f * G2; - y2 = y0 - 1.0f + 2.0f * G2; - t0 = 0.5f - x0*x0 - y0*y0; - if ( t0 < 0.0f ) { - n0 = 0.0f; - } else { - int idx = (ii + data->map[jj])&0xFF; - t0 *= t0; - idx=data->map[idx]; - TCOD_NOISE_SIMPLEX_GRADIENT_2D(n0,idx,x0,y0); - n0 *= t0*t0; - } - t1 = 0.5f - x1*x1 -y1*y1; - if ( t1 < 0.0f ) { - n1 = 0.0f; - } else { - int idx = (ii + i1 + data->map[(jj+j1)&0xFF]) & 0xFF; - t1 *= t1; - idx=data->map[idx]; - TCOD_NOISE_SIMPLEX_GRADIENT_2D(n1,idx,x1,y1); - n1 *= t1*t1; - } - t2 = 0.5f - x2*x2 -y2*y2; - if ( t2 < 0.0f ) { - n2 = 0.0f; - } else { - int idx = (ii + 1 + data->map[(jj+1)&0xFF]) & 0xFF; - t2 *= t2; - idx=data->map[idx]; - TCOD_NOISE_SIMPLEX_GRADIENT_2D(n2,idx,x2,y2); - n2 *= t2*t2; - } - return 40.0f * (n0+n1+n2); - } - break; - case 3 : - { - #define F3 0.333333333f - #define G3 0.166666667f - float n0,n1,n2,n3; - float s =(f[0]+f[1]+f[2])*F3*SIMPLEX_SCALE; - float xs=f[0]*SIMPLEX_SCALE+s; - float ys=f[1]*SIMPLEX_SCALE+s; - float zs=f[2]*SIMPLEX_SCALE+s; - int i=FLOOR(xs); - int j=FLOOR(ys); - int k=FLOOR(zs); - float t=(float)(i+j+k)*G3; - float xo = i-t; - float yo = j-t; - float zo = k-t; - float x0 = f[0]*SIMPLEX_SCALE-xo; - float y0 = f[1]*SIMPLEX_SCALE-yo; - float z0 = f[2]*SIMPLEX_SCALE-zo; - int i1,j1,k1,i2,j2,k2,ii,jj,kk; - float x1,y1,z1,x2,y2,z2,x3,y3,z3,t0,t1,t2,t3; - if ( x0 >= y0 ) { - if ( y0 >= z0 ) { - i1=1;j1=0;k1=0;i2=1;j2=1;k2=0; - } else if ( x0 >= z0 ) { - i1=1;j1=0;k1=0;i2=1;j2=0;k2=1; - } else { - i1=0;j1=0;k1=1;i2=1;j2=0;k2=1; - } - } else { - if ( y0 < z0 ) { - i1=0;j1=0;k1=1;i2=0;j2=1;k2=1; - } else if ( x0 < z0 ) { - i1=0;j1=1;k1=0;i2=0;j2=1;k2=1; - } else { - i1=0;j1=1;k1=0;i2=1;j2=1;k2=0; - } - } - x1 = x0 -i1 + G3; - y1 = y0 -j1 + G3; - z1 = z0 -k1 + G3; - x2 = x0 -i2 + 2.0f*G3; - y2 = y0 -j2 + 2.0f*G3; - z2 = z0 -k2 + 2.0f*G3; - x3 = x0 - 1.0f +3.0f * G3; - y3 = y0 - 1.0f +3.0f * G3; - z3 = z0 - 1.0f +3.0f * G3; - ii = absmod(i, 256); - jj = absmod(j, 256); - kk = absmod(k, 256); - t0 = 0.6f - x0*x0 -y0*y0 -z0*z0; - if ( t0 < 0.0f ) n0 = 0.0f; - else { - int idx = data->map[ (ii + data->map[ (jj + data->map[ kk ]) &0xFF ])& 0xFF ]; - t0 *= t0; - TCOD_NOISE_SIMPLEX_GRADIENT_3D(n0,idx,x0,y0,z0); - n0 *= t0*t0; - } - t1 = 0.6f - x1*x1 -y1*y1 -z1*z1; - if ( t1 < 0.0f ) n1 = 0.0f; - else { - int idx = data->map[ (ii + i1 + data->map[ (jj + j1 + data->map[ (kk + k1)& 0xFF ]) &0xFF ])& 0xFF ]; - t1 *= t1; - TCOD_NOISE_SIMPLEX_GRADIENT_3D(n1,idx,x1,y1,z1); - n1 *= t1*t1; - } - t2 = 0.6f - x2*x2 -y2*y2 -z2*z2; - if ( t2 < 0.0f ) n2 = 0.0f; - else { - int idx = data->map[ (ii + i2 + data->map[ (jj + j2 + data->map[ (kk + k2)& 0xFF ]) &0xFF ])& 0xFF ]; - t2 *= t2; - TCOD_NOISE_SIMPLEX_GRADIENT_3D(n2,idx,x2,y2,z2); - n2 *= t2*t2; - } - t3 = 0.6f - x3*x3 -y3*y3 -z3*z3; - if ( t3 < 0.0f ) n3 = 0.0f; - else { - int idx = data->map[ (ii + 1 + data->map[ (jj + 1 + data->map[ (kk + 1)& 0xFF ]) &0xFF ])& 0xFF ]; - t3 *= t3; - TCOD_NOISE_SIMPLEX_GRADIENT_3D(n3,idx,x3,y3,z3); - n3 *= t3*t3; - } - return 32.0f * (n0+n1+n2+n3); - - } - break; - case 4 : - { - #define F4 0.309016994f /* (sqrtf(5.0f)-1.0f)/4.0f */ - #define G4 0.138196601f /* (5.0f - sqrtf(5.0f))/20.0f */ - float n0,n1,n2,n3,n4; - float s = (f[0]+f[1]+f[2]+f[3])*F4 * SIMPLEX_SCALE; - float xs=f[0]*SIMPLEX_SCALE+s; - float ys=f[1]*SIMPLEX_SCALE+s; - float zs=f[2]*SIMPLEX_SCALE+s; - float ws=f[3]*SIMPLEX_SCALE+s; - int i=FLOOR(xs); - int j=FLOOR(ys); - int k=FLOOR(zs); - int l=FLOOR(ws); - float t=(float)(i+j+k+l)*G4; - float xo = i-t; - float yo = j-t; - float zo = k-t; - float wo = l-t; - float x0 = f[0]*SIMPLEX_SCALE-xo; - float y0 = f[1]*SIMPLEX_SCALE-yo; - float z0 = f[2]*SIMPLEX_SCALE-zo; - float w0 = f[3]*SIMPLEX_SCALE-wo; - int c1 = (x0 > y0 ? 32 : 0); - int c2 = (x0 > z0 ? 16 : 0); - int c3 = (y0 > z0 ? 8 : 0); - int c4 = (x0 > w0 ? 4 : 0); - int c5 = (y0 > w0 ? 2 : 0); - int c6 = (z0 > w0 ? 1 : 0); - int c = c1+c2+c3+c4+c5+c6; - - - int i1,j1,k1,l1,i2,j2,k2,l2,i3,j3,k3,l3,ii,jj,kk,ll; - float x1,y1,z1,w1,x2,y2,z2,w2,x3,y3,z3,w3,x4,y4,z4,w4,t0,t1,t2,t3,t4; - i1 = simplex[c][0] >= 3 ? 1:0; - j1 = simplex[c][1] >= 3 ? 1:0; - k1 = simplex[c][2] >= 3 ? 1:0; - l1 = simplex[c][3] >= 3 ? 1:0; - - i2 = simplex[c][0] >= 2 ? 1:0; - j2 = simplex[c][1] >= 2 ? 1:0; - k2 = simplex[c][2] >= 2 ? 1:0; - l2 = simplex[c][3] >= 2 ? 1:0; - - i3 = simplex[c][0] >= 1 ? 1:0; - j3 = simplex[c][1] >= 1 ? 1:0; - k3 = simplex[c][2] >= 1 ? 1:0; - l3 = simplex[c][3] >= 1 ? 1:0; - - x1 = x0 -i1 + G4; - y1 = y0 -j1 + G4; - z1 = z0 -k1 + G4; - w1 = w0 -l1 + G4; - x2 = x0 -i2 + 2.0f*G4; - y2 = y0 -j2 + 2.0f*G4; - z2 = z0 -k2 + 2.0f*G4; - w2 = w0 -l2 + 2.0f*G4; - x3 = x0 -i3 + 3.0f*G4; - y3 = y0 -j3 + 3.0f*G4; - z3 = z0 -k3 + 3.0f*G4; - w3 = w0 -l3 + 3.0f*G4; - x4 = x0 - 1.0f +4.0f * G4; - y4 = y0 - 1.0f +4.0f * G4; - z4 = z0 - 1.0f +4.0f * G4; - w4 = w0 - 1.0f +4.0f * G4; - - ii = absmod(i, 256); - jj = absmod(j, 256); - kk = absmod(k, 256); - ll = absmod(l, 256); - - t0 = 0.6f - x0*x0 -y0*y0 -z0*z0 -w0*w0; - if ( t0 < 0.0f ) n0 = 0.0f; - else { - int idx = data->map[ (ii + data->map[ (jj + data->map[ (kk + data->map[ ll ] ) &0xFF]) &0xFF ])& 0xFF ]; - t0 *= t0; - TCOD_NOISE_SIMPLEX_GRADIENT_4D(n0,idx,x0,y0,z0,w0); - n0 *= t0*t0; - } - t1 = 0.6f - x1*x1 -y1*y1 -z1*z1 -w1*w1; - if ( t1 < 0.0f ) n1 = 0.0f; - else { - int idx = data->map[ (ii + i1 + data->map[ (jj + j1 + data->map[ (kk + k1 + data->map[ (ll+l1)&0xFF])& 0xFF ]) &0xFF ])& 0xFF ]; - t1 *= t1; - TCOD_NOISE_SIMPLEX_GRADIENT_4D(n1,idx,x1,y1,z1,w1); - n1 *= t1*t1; - } - t2 = 0.6f - x2*x2 -y2*y2 -z2*z2 -w2*w2; - if ( t2 < 0.0f ) n2 = 0.0f; - else { - int idx = data->map[ (ii + i2 + data->map[ (jj + j2 + data->map[ (kk + k2 + data->map[(ll+l2)&0xFF])& 0xFF ]) &0xFF ])& 0xFF ]; - t2 *= t2; - TCOD_NOISE_SIMPLEX_GRADIENT_4D(n2,idx,x2,y2,z2,w2); - n2 *= t2*t2; - } - t3 = 0.6f - x3*x3 -y3*y3 -z3*z3 -w3*w3; - if ( t3 < 0.0f ) n3 = 0.0f; - else { - int idx = data->map[ (ii + i3 + data->map[ (jj + j3 + data->map[ (kk + k3 + data->map[(ll+l3)&0xFF])& 0xFF ]) &0xFF ])& 0xFF ]; - t3 *= t3; - TCOD_NOISE_SIMPLEX_GRADIENT_4D(n3,idx,x3,y3,z3,w3); - n3 *= t3*t3; - } - t4 = 0.6f - x4*x4 -y4*y4 -z4*z4 -w4*w4; - if ( t4 < 0.0f ) n4 = 0.0f; - else { - int idx = data->map[ (ii + 1 + data->map[ (jj + 1 + data->map[ (kk + 1 + data->map[(ll+1)&0xFF])& 0xFF ]) &0xFF ])& 0xFF ]; - t4 *= t4; - TCOD_NOISE_SIMPLEX_GRADIENT_4D(n4,idx,x4,y4,z4,w4); - n4 *= t4*t4; - } - return 27.0f * (n0+n1+n2+n3+n4); - - } - break; - } - return 0.0f; -} - -typedef float (*TCOD_noise_func_t)( TCOD_noise_t noise, float *f ); - -static float TCOD_noise_fbm_int(TCOD_noise_t noise, float *f, float octaves, TCOD_noise_func_t func ) { - float tf[TCOD_NOISE_MAX_DIMENSIONS]; - perlin_data_t *data=(perlin_data_t *)noise; - /* Initialize locals */ - double value = 0; - int i,j; - memcpy(tf,f,sizeof(float)*data->ndim); - - /* Inner loop of spectral construction, where the fractal is built */ - for(i=0; i<(int)octaves; i++) - { - value += (double)(func(noise,tf)) * data->exponent[i]; - for (j=0; j < data->ndim; j++) tf[j] *= data->lacunarity; - } - - /* Take care of remainder in octaves */ - octaves -= (int)octaves; - if(octaves > DELTA) - value += (double)(octaves * func(noise,tf)) * data->exponent[i]; - return CLAMP(-0.99999f, 0.99999f, (float)value); -} - -float TCOD_noise_fbm_perlin( TCOD_noise_t noise, float *f, float octaves ) -{ - return TCOD_noise_fbm_int(noise,f,octaves,TCOD_noise_perlin); -} - -float TCOD_noise_fbm_simplex( TCOD_noise_t noise, float *f, float octaves ) -{ - return TCOD_noise_fbm_int(noise,f,octaves,TCOD_noise_simplex); -} - -static float TCOD_noise_turbulence_int( TCOD_noise_t noise, float *f, float octaves, TCOD_noise_func_t func ) -{ - float tf[TCOD_NOISE_MAX_DIMENSIONS]; - perlin_data_t *data=(perlin_data_t *)noise; - /* Initialize locals */ - double value = 0; - int i,j; - memcpy(tf,f,sizeof(float)*data->ndim); - - /* Inner loop of spectral construction, where the fractal is built */ - for(i=0; i<(int)octaves; i++) - { - float nval=func(noise,tf); - value += (double)(ABS(nval)) * data->exponent[i]; - for (j=0; j < data->ndim; j++) tf[j] *= data->lacunarity; - } - - /* Take care of remainder in octaves */ - octaves -= (int)octaves; - if(octaves > DELTA) { - float nval=func(noise,tf); - value += (double)(octaves * ABS(nval)) * data->exponent[i]; - } - return CLAMP(-0.99999f, 0.99999f, (float)value); -} - -float TCOD_noise_turbulence_perlin( TCOD_noise_t noise, float *f, float octaves ) { - return TCOD_noise_turbulence_int(noise,f,octaves,TCOD_noise_perlin); -} - -float TCOD_noise_turbulence_simplex( TCOD_noise_t noise, float *f, float octaves ) { - return TCOD_noise_turbulence_int(noise,f,octaves,TCOD_noise_simplex); -} - -/* wavelet noise, adapted from Robert L. Cook and Tony Derose 'Wavelet noise' paper */ - -static void TCOD_noise_wavelet_downsample(float *from, float *to, int stride) { - static float acoeffs[2*WAVELET_ARAD]= { - 0.000334f, -0.001528f, 0.000410f, 0.003545f, -0.000938f, -0.008233f, 0.002172f, 0.019120f, - -0.005040f,-0.044412f, 0.011655f, 0.103311f, -0.025936f, -0.243780f, 0.033979f, 0.655340f, - 0.655340f, 0.033979f,-0.243780f,-0.025936f, 0.103311f, 0.011655f,-0.044412f,-0.005040f, - 0.019120f, 0.002172f,-0.008233f,-0.000938f, 0.003546f, 0.000410f,-0.001528f, 0.000334f, - }; - static float *a = &acoeffs[WAVELET_ARAD]; - int i; - for (i=0; i < WAVELET_TILE_SIZE/2; i++) { - int k; - to[i*stride]=0; - for (k=2*i-WAVELET_ARAD; k <2*i+WAVELET_ARAD; k++) { - to[i*stride] += a[k-2*i]* from[ absmod(k,WAVELET_TILE_SIZE) * stride ]; - } - } -} - -static void TCOD_noise_wavelet_upsample(float *from, float *to, int stride) { - static float pcoeffs[4]= { 0.25f, 0.75f, 0.75f, 0.25f }; - static float *p = &pcoeffs[2]; - int i; - for (i=0; i < WAVELET_TILE_SIZE; i++) { - int k; - to[i*stride]=0; - for (k=i/2; k rand,-1.0f,1.0f); - } - for (iy=0; iy < WAVELET_TILE_SIZE; iy++ ) { - for (iz=0; iz < WAVELET_TILE_SIZE; iz++ ) { - i = iy * WAVELET_TILE_SIZE + iz * WAVELET_TILE_SIZE * WAVELET_TILE_SIZE; - TCOD_noise_wavelet_downsample(&noise[i], &temp1[i], 1); - TCOD_noise_wavelet_upsample(&temp1[i], &temp2[i], 1); - } - } - for (ix=0; ix < WAVELET_TILE_SIZE; ix++ ) { - for (iz=0; iz < WAVELET_TILE_SIZE; iz++ ) { - i = ix + iz * WAVELET_TILE_SIZE * WAVELET_TILE_SIZE; - TCOD_noise_wavelet_downsample(&temp2[i], &temp1[i], WAVELET_TILE_SIZE); - TCOD_noise_wavelet_upsample(&temp1[i], &temp2[i], WAVELET_TILE_SIZE); - } - } - for (ix=0; ix < WAVELET_TILE_SIZE; ix++ ) { - for (iy=0; iy < WAVELET_TILE_SIZE; iy++ ) { - i = ix + iy * WAVELET_TILE_SIZE; - TCOD_noise_wavelet_downsample(&temp2[i], &temp1[i], WAVELET_TILE_SIZE * WAVELET_TILE_SIZE); - TCOD_noise_wavelet_upsample(&temp1[i], &temp2[i], WAVELET_TILE_SIZE * WAVELET_TILE_SIZE); - } - } - for (i=0; i < WAVELET_TILE_SIZE*WAVELET_TILE_SIZE*WAVELET_TILE_SIZE; i++ ) { - noise[i] -= temp2[i]; - } - offset = WAVELET_TILE_SIZE/2; - if ( (offset & 1) == 0 ) offset++; - for (i=0,ix=0; ix < WAVELET_TILE_SIZE; ix++ ) { - for (iy=0; iy < WAVELET_TILE_SIZE; iy++ ) { - for (iz=0; iz < WAVELET_TILE_SIZE; iz++ ) { - temp1[i++]=noise[ absmod(ix+offset,WAVELET_TILE_SIZE) - + absmod(iy+offset,WAVELET_TILE_SIZE)*WAVELET_TILE_SIZE - + absmod(iz+offset,WAVELET_TILE_SIZE)*WAVELET_TILE_SIZE*WAVELET_TILE_SIZE - ]; - } - } - } - for (i=0; i < WAVELET_TILE_SIZE*WAVELET_TILE_SIZE*WAVELET_TILE_SIZE; i++ ) { - noise[i] += temp1[i]; - } - data->waveletTileData=noise; - free(temp1); - free(temp2); -} - -float TCOD_noise_wavelet (TCOD_noise_t noise, float *f) { - perlin_data_t *data=(perlin_data_t *)noise; - float pf[3]; - int i; - int p[3],c[3],mid[3],n=WAVELET_TILE_SIZE; - float w[3][3],t,result=0.0f; - if ( data->ndim > 3 ) return 0.0f; /* not supported */ - if (! data->waveletTileData ) TCOD_noise_wavelet_init(noise); - for (i=0; i < data->ndim; i++ ) pf[i]=f[i]*WAVELET_SCALE; - for (i=data->ndim; i < 3; i++ ) pf[i]=0.0f; - for (i=0; i < 3; i++ ) { - mid[i]=(int)ceil(pf[i]-0.5f); - t=mid[i] - (pf[i]-0.5f); - w[i][0]=t*t*0.5f; - w[i][2]=(1.0f-t)*(1.0f-t)*0.5f; - w[i][1]=1.0f - w[i][0]-w[i][2]; - } - for (p[2]=-1; p[2]<=1; p[2]++) { - for (p[1]=-1; p[1]<=1; p[1]++) { - for (p[0]=-1; p[0]<=1; p[0]++) { - float weight=1.0f; - for (i=0;i<3;i++) { - c[i]=absmod(mid[i]+p[i],n); - weight *= w[i][p[i]+1]; - } - result += weight * data->waveletTileData[ c[2]*n*n + c[1]*n + c[0] ]; - } - } - } - return CLAMP(-1.0f,1.0f,result); -} - -float TCOD_noise_fbm_wavelet(TCOD_noise_t noise, float *f, float octaves) { - return TCOD_noise_fbm_int(noise,f,octaves,TCOD_noise_wavelet); -} - -float TCOD_noise_turbulence_wavelet(TCOD_noise_t noise, float *f, float octaves) { - return TCOD_noise_turbulence_int(noise,f,octaves,TCOD_noise_wavelet); -} - -void TCOD_noise_set_type (TCOD_noise_t noise, TCOD_noise_type_t type) { - ((perlin_data_t *)noise)->noise_type = type; -} - -float TCOD_noise_get_ex (TCOD_noise_t noise, float *f, TCOD_noise_type_t type) { - switch (type) { - case (TCOD_NOISE_PERLIN): return TCOD_noise_perlin(noise,f); break; - case (TCOD_NOISE_SIMPLEX): return TCOD_noise_simplex(noise,f); break; - case (TCOD_NOISE_WAVELET): return TCOD_noise_wavelet(noise,f); break; - default: - switch (((perlin_data_t *)noise)->noise_type) { - case (TCOD_NOISE_PERLIN): return TCOD_noise_perlin(noise,f); break; - case (TCOD_NOISE_SIMPLEX): return TCOD_noise_simplex(noise,f); break; - case (TCOD_NOISE_WAVELET): return TCOD_noise_wavelet(noise,f); break; - default: return TCOD_noise_simplex(noise,f); break; - } - break; - } -} - -float TCOD_noise_get_fbm_ex (TCOD_noise_t noise, float *f, float octaves, TCOD_noise_type_t type) { - switch (type) { - case (TCOD_NOISE_PERLIN): return TCOD_noise_fbm_perlin(noise,f,octaves); break; - case (TCOD_NOISE_SIMPLEX): return TCOD_noise_fbm_simplex(noise,f,octaves); break; - case (TCOD_NOISE_WAVELET): return TCOD_noise_fbm_wavelet(noise,f,octaves); break; - default: - switch (((perlin_data_t *)noise)->noise_type) { - case (TCOD_NOISE_PERLIN): return TCOD_noise_fbm_perlin(noise,f,octaves); break; - case (TCOD_NOISE_SIMPLEX): return TCOD_noise_fbm_simplex(noise,f,octaves); break; - case (TCOD_NOISE_WAVELET): return TCOD_noise_fbm_wavelet(noise,f,octaves); break; - default: return TCOD_noise_fbm_simplex(noise,f,octaves); break; - } - break; - } -} - -float TCOD_noise_get_turbulence_ex (TCOD_noise_t noise, float *f, float octaves, TCOD_noise_type_t type) { - switch (type) { - case (TCOD_NOISE_PERLIN): return TCOD_noise_turbulence_perlin(noise,f,octaves); break; - case (TCOD_NOISE_SIMPLEX): return TCOD_noise_turbulence_simplex(noise,f,octaves); break; - case (TCOD_NOISE_WAVELET): return TCOD_noise_turbulence_wavelet(noise,f,octaves); break; - default: - switch (((perlin_data_t *)noise)->noise_type) { - case (TCOD_NOISE_PERLIN): return TCOD_noise_turbulence_perlin(noise,f,octaves); break; - case (TCOD_NOISE_SIMPLEX): return TCOD_noise_turbulence_simplex(noise,f,octaves); break; - case (TCOD_NOISE_WAVELET): return TCOD_noise_turbulence_wavelet(noise,f,octaves); break; - default: return TCOD_noise_turbulence_simplex(noise,f,octaves); break; - } - break; - } -} - -float TCOD_noise_get (TCOD_noise_t noise, float *f) { - switch (((perlin_data_t *)noise)->noise_type) { - case (TCOD_NOISE_PERLIN): return TCOD_noise_perlin(noise,f); break; - case (TCOD_NOISE_SIMPLEX): return TCOD_noise_simplex(noise,f); break; - case (TCOD_NOISE_WAVELET): return TCOD_noise_wavelet(noise,f); break; - default: return TCOD_noise_simplex(noise,f); break; - } -} - -float TCOD_noise_get_fbm (TCOD_noise_t noise, float *f, float octaves) { - switch (((perlin_data_t *)noise)->noise_type) { - case (TCOD_NOISE_PERLIN): return TCOD_noise_fbm_perlin(noise,f,octaves); break; - case (TCOD_NOISE_SIMPLEX): return TCOD_noise_fbm_simplex(noise,f,octaves); break; - case (TCOD_NOISE_WAVELET): return TCOD_noise_fbm_wavelet(noise,f,octaves); break; - default: return TCOD_noise_fbm_simplex(noise,f,octaves); break; - } -} - -float TCOD_noise_get_turbulence (TCOD_noise_t noise, float *f, float octaves) { - switch (((perlin_data_t *)noise)->noise_type) { - case (TCOD_NOISE_PERLIN): return TCOD_noise_turbulence_perlin(noise,f,octaves); break; - case (TCOD_NOISE_SIMPLEX): return TCOD_noise_turbulence_simplex(noise,f,octaves); break; - case (TCOD_NOISE_WAVELET): return TCOD_noise_turbulence_wavelet(noise,f,octaves); break; - default: return TCOD_noise_turbulence_simplex(noise,f,octaves); break; - } -} - -void TCOD_noise_delete(TCOD_noise_t noise) { - if (((perlin_data_t *)noise)->waveletTileData) { - free(((perlin_data_t *)noise)->waveletTileData); - } - free((perlin_data_t *)noise); -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "noise.h" + +#include +#include +#include +#include + +#include "mersenne.h" +#include "utility.h" + +#define WAVELET_TILE_SIZE 32 +#define WAVELET_ARAD 16 + +#define SIMPLEX_SCALE 0.5f +#define WAVELET_SCALE 2.0f + +typedef TCOD_Noise perlin_data_t; + +/** + * Return a floating point value clamped between -1.0f and 1.0f exclusively. + * + * The return value excludes -1.0f and 1.0f to avoid rounding issues. + */ +static float clamp_signed_f(float value) { + static const float LOW = -1.0f + FLT_EPSILON; + static const float HIGH = 1.0f - FLT_EPSILON; + if (value < LOW) { return LOW; } + if (value > HIGH) { return HIGH; } + return value; +} + +static float lattice( perlin_data_t *data, int ix, float fx, int iy, float fy, int iz, float fz, int iw, float fw) +{ + int n[4] = {ix, iy, iz, iw}; + float f[4] = {fx, fy, fz, fw}; + int nIndex = 0; + int i; + float value = 0; + for(i=0; indim; i++) + nIndex = data->map[(nIndex + n[i]) & 0xFF]; + for(i=0; indim; i++) + value += data->buffer[nIndex][i] * f[i]; + return value; +} + +#define DEFAULT_SEED 0x15687436 +#define DELTA 1e-6f +#define SWAP(a, b, t) t = a; a = b; b = t + +#define FLOOR(a) ((a) > 0 ? (int)(a) : ((int)(a) - 1) ) +#define CUBIC(a) ((a) * (a) * (3 - 2 * (a))) + +static void normalize(perlin_data_t *data, float *f) +{ + float magnitude = 0; + int i; + for(i=0; indim; i++) + magnitude += f[i]*f[i]; + magnitude = 1.0f / (float)sqrt(magnitude); + for(i=0; indim; i++) + f[i] *= magnitude; +} + + +TCOD_noise_t TCOD_noise_new(int ndim, float hurst, float lacunarity, TCOD_random_t random) +{ + perlin_data_t *data=(perlin_data_t *)calloc(sizeof(perlin_data_t),1); + int i, j; + unsigned char tmp; + float f = 1; + data->rand = random ? random : TCOD_random_get_instance(); + data->ndim = ndim; + for(i=0; i<256; i++) + { + data->map[i] = (unsigned char)i; + for(j=0; jndim; j++) + data->buffer[i][j] = TCOD_random_get_float(data->rand,-0.5, 0.5); + normalize(data,data->buffer[i]); + } + + while(--i) + { + j = TCOD_random_get_int(data->rand,0, 255); + SWAP(data->map[i], data->map[j], tmp); + } + + data->H = hurst; + data->lacunarity = lacunarity; + for(i=0; iexponent[i] = 1.0f / f; + f *= lacunarity; + } + data->noise_type = TCOD_NOISE_DEFAULT; + return (TCOD_noise_t)data; +} + +float TCOD_noise_perlin( TCOD_noise_t noise, float *f ) +{ + perlin_data_t *data=(perlin_data_t *)noise; + int n[TCOD_NOISE_MAX_DIMENSIONS]; /* Indexes to pass to lattice function */ + int i; + float r[TCOD_NOISE_MAX_DIMENSIONS]; /* Remainders to pass to lattice function */ + float w[TCOD_NOISE_MAX_DIMENSIONS]; /* Cubic values to pass to interpolation function */ + float value; + + for(i=0; indim; i++) + { + n[i] = FLOOR(f[i]); + r[i] = f[i] - n[i]; + w[i] = CUBIC(r[i]); + } + + switch(data->ndim) + { + case 1: + value = LERP(lattice(data,n[0], r[0],0,0,0,0,0,0), + lattice(data,n[0]+1, r[0]-1,0,0,0,0,0,0), + w[0]); + break; + case 2: + value = LERP(LERP(lattice(data,n[0], r[0], n[1], r[1],0,0,0,0), + lattice(data,n[0]+1, r[0]-1, n[1], r[1],0,0,0,0), + w[0]), + LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1,0,0,0,0), + lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1,0,0,0,0), + w[0]), + w[1]); + break; + case 3: + value = LERP(LERP(LERP(lattice(data,n[0], r[0], n[1], r[1], n[2], r[2],0,0), + lattice(data,n[0]+1, r[0]-1, n[1], r[1], n[2], r[2],0,0), + w[0]), + LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1, n[2], r[2],0,0), + lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1, n[2], r[2],0,0), + w[0]), + w[1]), + LERP(LERP(lattice(data,n[0], r[0], n[1], r[1], n[2]+1, r[2]-1,0,0), + lattice(data,n[0]+1, r[0]-1, n[1], r[1], n[2]+1, r[2]-1,0,0), + w[0]), + LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1, n[2]+1, r[2]-1,0,0), + lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1, n[2]+1, r[2]-1,0,0), + w[0]), + w[1]), + w[2]); + break; + case 4: + default: + value = LERP(LERP(LERP(LERP(lattice(data,n[0], r[0], n[1], r[1], n[2], r[2], n[3], r[3]), + lattice(data,n[0]+1, r[0]-1, n[1], r[1], n[2], r[2], n[3], r[3]), + w[0]), + LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1, n[2], r[2], n[3], r[3]), + lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1, n[2], r[2], n[3], r[3]), + w[0]), + w[1]), + LERP(LERP(lattice(data,n[0], r[0], n[1], r[1], n[2]+1, r[2]-1, n[3], r[3]), + lattice(data,n[0]+1, r[0]-1, n[1], r[1], n[2]+1, r[2]-1, n[3], r[3]), + w[0]), + LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1, n[2]+1, r[2]-1,0,0), + lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1, n[2]+1, r[2]-1, n[3], r[3]), + w[0]), + w[1]), + w[2]), + LERP(LERP(LERP(lattice(data,n[0], r[0], n[1], r[1], n[2], r[2], n[3]+1, r[3]-1), + lattice(data,n[0]+1, r[0]-1, n[1], r[1], n[2], r[2], n[3]+1, r[3]-1), + w[0]), + LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1, n[2], r[2], n[3]+1, r[3]-1), + lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1, n[2], r[2], n[3]+1, r[3]-1), + w[0]), + w[1]), + LERP(LERP(lattice(data,n[0], r[0], n[1], r[1], n[2]+1, r[2]-1, n[3]+1, r[3]-1), + lattice(data,n[0]+1, r[0]-1, n[1], r[1], n[2]+1, r[2]-1, n[3]+1, r[3]-1), + w[0]), + LERP(lattice(data,n[0], r[0], n[1]+1, r[1]-1, n[2]+1, r[2]-1,0,0), + lattice(data,n[0]+1, r[0]-1, n[1]+1, r[1]-1, n[2]+1, r[2]-1, n[3]+1, r[3]-1), + w[0]), + w[1]), + w[2]), + w[3]); + break; + } + return clamp_signed_f(value); +} + +static int absmod(int x, int n) { + int m=x%n; + return m < 0 ? m+n : m; +} + +/* simplex noise, adapted from Ken Perlin's presentation at Siggraph 2001 */ +/* and Stefan Gustavson implementation */ + +#define TCOD_NOISE_SIMPLEX_GRADIENT_1D(n,h,x) { float grad; h &= 0xF; grad=1.0f+(h & 7); if ( h & 8 ) grad = -grad; n = grad * x; } + +#define TCOD_NOISE_SIMPLEX_GRADIENT_2D(n,h,x,y) { float u,v; h &= 0x7; if ( h < 4 ) { u=x; v=2.0f*y; } else { u=y; v=2.0f*x; } n = ((h & 1) ? -u : u) + ((h & 2) ? -v :v ); } + +#define TCOD_NOISE_SIMPLEX_GRADIENT_3D(n,h,x,y,z) { float u,v; h &= 0xF; u = (h < 8 ? x : y); v = (h < 4 ? y : ( h == 12 || h == 14 ? x : z ) ); n= ((h & 1) ? -u : u ) + ((h & 2) ? -v : v); } + +#define TCOD_NOISE_SIMPLEX_GRADIENT_4D(n,h,x,y,z,t) { float u,v,w; h &= 0x1F; u = (h < 24 ? x:y); v = (h < 16 ? y:z); w = (h < 8 ? z:t); n= ((h & 1) ? -u : u ) + ((h & 2) ? -v : v) + ((h & 4) ? -w : w);} + +static float simplex[64][4] = { + {0,1,2,3},{0,1,3,2},{0,0,0,0},{0,2,3,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,2,3,0}, + {0,2,1,3},{0,0,0,0},{0,3,1,2},{0,3,2,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,3,2,0}, + {0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}, + {1,2,0,3},{0,0,0,0},{1,3,0,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,3,0,1},{2,3,1,0}, + {1,0,2,3},{1,0,3,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,0,3,1},{0,0,0,0},{2,1,3,0}, + {0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}, + {2,0,1,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,0,1,2},{3,0,2,1},{0,0,0,0},{3,1,2,0}, + {2,1,0,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,1,0,2},{0,0,0,0},{3,2,0,1},{3,2,1,0}, + +}; + +float TCOD_noise_simplex(TCOD_noise_t noise, float *f) { + perlin_data_t *data=(perlin_data_t *)noise; + switch(data->ndim) { + case 1 : + { + int i0=(int)FLOOR(f[0]*SIMPLEX_SCALE); + int i1=i0+1; + float x0 = f[0]*SIMPLEX_SCALE - i0; + float x1 = x0 - 1.0f; + float t0 = 1.0f - x0*x0; + float t1 = 1.0f - x1*x1; + float n0,n1; + t0 = t0*t0; + t1 = t1*t1; + i0=data->map[i0&0xFF]; + TCOD_NOISE_SIMPLEX_GRADIENT_1D(n0,i0,x0); + n0*=t0*t0; + i1=data->map[i1&0xFF]; + TCOD_NOISE_SIMPLEX_GRADIENT_1D(n1,i1,x1); + n1*=t1*t1; + return 0.25f * (n0+n1); + } + break; + case 2 : + { + #define F2 0.366025403f /* 0.5f * (sqrtf(3.0f)-1.0f); */ + #define G2 0.211324865f /* (3.0f - sqrtf(3.0f))/6.0f; */ + + float s = (f[0]+f[1])*F2*SIMPLEX_SCALE; + float xs = f[0]*SIMPLEX_SCALE+s; + float ys = f[1]*SIMPLEX_SCALE+s; + int i=FLOOR(xs); + int j=FLOOR(ys); + float t = (i+j)*G2; + float xo = i-t; + float yo = j-t; + float x0 = f[0]*SIMPLEX_SCALE-xo; + float y0 = f[1]*SIMPLEX_SCALE-yo; + int i1,j1,ii = absmod(i ,256),jj = absmod(j, 256); + float n0,n1,n2,x1,y1,x2,y2,t0,t1,t2; + if ( x0 > y0 ) { + i1=1;j1=0; + } else { + i1=0;j1=1; + } + x1 = x0 - i1 + G2; + y1 = y0 - j1 + G2; + x2 = x0 - 1.0f + 2.0f * G2; + y2 = y0 - 1.0f + 2.0f * G2; + t0 = 0.5f - x0*x0 - y0*y0; + if ( t0 < 0.0f ) { + n0 = 0.0f; + } else { + int idx = (ii + data->map[jj])&0xFF; + t0 *= t0; + idx=data->map[idx]; + TCOD_NOISE_SIMPLEX_GRADIENT_2D(n0,idx,x0,y0); + n0 *= t0*t0; + } + t1 = 0.5f - x1*x1 -y1*y1; + if ( t1 < 0.0f ) { + n1 = 0.0f; + } else { + int idx = (ii + i1 + data->map[(jj+j1)&0xFF]) & 0xFF; + t1 *= t1; + idx=data->map[idx]; + TCOD_NOISE_SIMPLEX_GRADIENT_2D(n1,idx,x1,y1); + n1 *= t1*t1; + } + t2 = 0.5f - x2*x2 -y2*y2; + if ( t2 < 0.0f ) { + n2 = 0.0f; + } else { + int idx = (ii + 1 + data->map[(jj+1)&0xFF]) & 0xFF; + t2 *= t2; + idx=data->map[idx]; + TCOD_NOISE_SIMPLEX_GRADIENT_2D(n2,idx,x2,y2); + n2 *= t2*t2; + } + return 40.0f * (n0+n1+n2); + } + break; + case 3 : + { + #define F3 0.333333333f + #define G3 0.166666667f + float n0,n1,n2,n3; + float s =(f[0]+f[1]+f[2])*F3*SIMPLEX_SCALE; + float xs=f[0]*SIMPLEX_SCALE+s; + float ys=f[1]*SIMPLEX_SCALE+s; + float zs=f[2]*SIMPLEX_SCALE+s; + int i=FLOOR(xs); + int j=FLOOR(ys); + int k=FLOOR(zs); + float t=(float)(i+j+k)*G3; + float xo = i-t; + float yo = j-t; + float zo = k-t; + float x0 = f[0]*SIMPLEX_SCALE-xo; + float y0 = f[1]*SIMPLEX_SCALE-yo; + float z0 = f[2]*SIMPLEX_SCALE-zo; + int i1,j1,k1,i2,j2,k2,ii,jj,kk; + float x1,y1,z1,x2,y2,z2,x3,y3,z3,t0,t1,t2,t3; + if ( x0 >= y0 ) { + if ( y0 >= z0 ) { + i1=1;j1=0;k1=0;i2=1;j2=1;k2=0; + } else if ( x0 >= z0 ) { + i1=1;j1=0;k1=0;i2=1;j2=0;k2=1; + } else { + i1=0;j1=0;k1=1;i2=1;j2=0;k2=1; + } + } else { + if ( y0 < z0 ) { + i1=0;j1=0;k1=1;i2=0;j2=1;k2=1; + } else if ( x0 < z0 ) { + i1=0;j1=1;k1=0;i2=0;j2=1;k2=1; + } else { + i1=0;j1=1;k1=0;i2=1;j2=1;k2=0; + } + } + x1 = x0 -i1 + G3; + y1 = y0 -j1 + G3; + z1 = z0 -k1 + G3; + x2 = x0 -i2 + 2.0f*G3; + y2 = y0 -j2 + 2.0f*G3; + z2 = z0 -k2 + 2.0f*G3; + x3 = x0 - 1.0f +3.0f * G3; + y3 = y0 - 1.0f +3.0f * G3; + z3 = z0 - 1.0f +3.0f * G3; + ii = absmod(i, 256); + jj = absmod(j, 256); + kk = absmod(k, 256); + t0 = 0.6f - x0*x0 -y0*y0 -z0*z0; + if ( t0 < 0.0f ) n0 = 0.0f; + else { + int idx = data->map[ (ii + data->map[ (jj + data->map[ kk ]) &0xFF ])& 0xFF ]; + t0 *= t0; + TCOD_NOISE_SIMPLEX_GRADIENT_3D(n0,idx,x0,y0,z0); + n0 *= t0*t0; + } + t1 = 0.6f - x1*x1 -y1*y1 -z1*z1; + if ( t1 < 0.0f ) n1 = 0.0f; + else { + int idx = data->map[ (ii + i1 + data->map[ (jj + j1 + data->map[ (kk + k1)& 0xFF ]) &0xFF ])& 0xFF ]; + t1 *= t1; + TCOD_NOISE_SIMPLEX_GRADIENT_3D(n1,idx,x1,y1,z1); + n1 *= t1*t1; + } + t2 = 0.6f - x2*x2 -y2*y2 -z2*z2; + if ( t2 < 0.0f ) n2 = 0.0f; + else { + int idx = data->map[ (ii + i2 + data->map[ (jj + j2 + data->map[ (kk + k2)& 0xFF ]) &0xFF ])& 0xFF ]; + t2 *= t2; + TCOD_NOISE_SIMPLEX_GRADIENT_3D(n2,idx,x2,y2,z2); + n2 *= t2*t2; + } + t3 = 0.6f - x3*x3 -y3*y3 -z3*z3; + if ( t3 < 0.0f ) n3 = 0.0f; + else { + int idx = data->map[ (ii + 1 + data->map[ (jj + 1 + data->map[ (kk + 1)& 0xFF ]) &0xFF ])& 0xFF ]; + t3 *= t3; + TCOD_NOISE_SIMPLEX_GRADIENT_3D(n3,idx,x3,y3,z3); + n3 *= t3*t3; + } + return 32.0f * (n0+n1+n2+n3); + + } + break; + case 4 : + { + #define F4 0.309016994f /* (sqrtf(5.0f)-1.0f)/4.0f */ + #define G4 0.138196601f /* (5.0f - sqrtf(5.0f))/20.0f */ + float n0,n1,n2,n3,n4; + float s = (f[0]+f[1]+f[2]+f[3])*F4 * SIMPLEX_SCALE; + float xs=f[0]*SIMPLEX_SCALE+s; + float ys=f[1]*SIMPLEX_SCALE+s; + float zs=f[2]*SIMPLEX_SCALE+s; + float ws=f[3]*SIMPLEX_SCALE+s; + int i=FLOOR(xs); + int j=FLOOR(ys); + int k=FLOOR(zs); + int l=FLOOR(ws); + float t=(float)(i+j+k+l)*G4; + float xo = i-t; + float yo = j-t; + float zo = k-t; + float wo = l-t; + float x0 = f[0]*SIMPLEX_SCALE-xo; + float y0 = f[1]*SIMPLEX_SCALE-yo; + float z0 = f[2]*SIMPLEX_SCALE-zo; + float w0 = f[3]*SIMPLEX_SCALE-wo; + int c1 = (x0 > y0 ? 32 : 0); + int c2 = (x0 > z0 ? 16 : 0); + int c3 = (y0 > z0 ? 8 : 0); + int c4 = (x0 > w0 ? 4 : 0); + int c5 = (y0 > w0 ? 2 : 0); + int c6 = (z0 > w0 ? 1 : 0); + int c = c1+c2+c3+c4+c5+c6; + + + int i1,j1,k1,l1,i2,j2,k2,l2,i3,j3,k3,l3,ii,jj,kk,ll; + float x1,y1,z1,w1,x2,y2,z2,w2,x3,y3,z3,w3,x4,y4,z4,w4,t0,t1,t2,t3,t4; + i1 = simplex[c][0] >= 3 ? 1:0; + j1 = simplex[c][1] >= 3 ? 1:0; + k1 = simplex[c][2] >= 3 ? 1:0; + l1 = simplex[c][3] >= 3 ? 1:0; + + i2 = simplex[c][0] >= 2 ? 1:0; + j2 = simplex[c][1] >= 2 ? 1:0; + k2 = simplex[c][2] >= 2 ? 1:0; + l2 = simplex[c][3] >= 2 ? 1:0; + + i3 = simplex[c][0] >= 1 ? 1:0; + j3 = simplex[c][1] >= 1 ? 1:0; + k3 = simplex[c][2] >= 1 ? 1:0; + l3 = simplex[c][3] >= 1 ? 1:0; + + x1 = x0 -i1 + G4; + y1 = y0 -j1 + G4; + z1 = z0 -k1 + G4; + w1 = w0 -l1 + G4; + x2 = x0 -i2 + 2.0f*G4; + y2 = y0 -j2 + 2.0f*G4; + z2 = z0 -k2 + 2.0f*G4; + w2 = w0 -l2 + 2.0f*G4; + x3 = x0 -i3 + 3.0f*G4; + y3 = y0 -j3 + 3.0f*G4; + z3 = z0 -k3 + 3.0f*G4; + w3 = w0 -l3 + 3.0f*G4; + x4 = x0 - 1.0f +4.0f * G4; + y4 = y0 - 1.0f +4.0f * G4; + z4 = z0 - 1.0f +4.0f * G4; + w4 = w0 - 1.0f +4.0f * G4; + + ii = absmod(i, 256); + jj = absmod(j, 256); + kk = absmod(k, 256); + ll = absmod(l, 256); + + t0 = 0.6f - x0*x0 -y0*y0 -z0*z0 -w0*w0; + if ( t0 < 0.0f ) n0 = 0.0f; + else { + int idx = data->map[ (ii + data->map[ (jj + data->map[ (kk + data->map[ ll ] ) &0xFF]) &0xFF ])& 0xFF ]; + t0 *= t0; + TCOD_NOISE_SIMPLEX_GRADIENT_4D(n0,idx,x0,y0,z0,w0); + n0 *= t0*t0; + } + t1 = 0.6f - x1*x1 -y1*y1 -z1*z1 -w1*w1; + if ( t1 < 0.0f ) n1 = 0.0f; + else { + int idx = data->map[ (ii + i1 + data->map[ (jj + j1 + data->map[ (kk + k1 + data->map[ (ll+l1)&0xFF])& 0xFF ]) &0xFF ])& 0xFF ]; + t1 *= t1; + TCOD_NOISE_SIMPLEX_GRADIENT_4D(n1,idx,x1,y1,z1,w1); + n1 *= t1*t1; + } + t2 = 0.6f - x2*x2 -y2*y2 -z2*z2 -w2*w2; + if ( t2 < 0.0f ) n2 = 0.0f; + else { + int idx = data->map[ (ii + i2 + data->map[ (jj + j2 + data->map[ (kk + k2 + data->map[(ll+l2)&0xFF])& 0xFF ]) &0xFF ])& 0xFF ]; + t2 *= t2; + TCOD_NOISE_SIMPLEX_GRADIENT_4D(n2,idx,x2,y2,z2,w2); + n2 *= t2*t2; + } + t3 = 0.6f - x3*x3 -y3*y3 -z3*z3 -w3*w3; + if ( t3 < 0.0f ) n3 = 0.0f; + else { + int idx = data->map[ (ii + i3 + data->map[ (jj + j3 + data->map[ (kk + k3 + data->map[(ll+l3)&0xFF])& 0xFF ]) &0xFF ])& 0xFF ]; + t3 *= t3; + TCOD_NOISE_SIMPLEX_GRADIENT_4D(n3,idx,x3,y3,z3,w3); + n3 *= t3*t3; + } + t4 = 0.6f - x4*x4 -y4*y4 -z4*z4 -w4*w4; + if ( t4 < 0.0f ) n4 = 0.0f; + else { + int idx = data->map[ (ii + 1 + data->map[ (jj + 1 + data->map[ (kk + 1 + data->map[(ll+1)&0xFF])& 0xFF ]) &0xFF ])& 0xFF ]; + t4 *= t4; + TCOD_NOISE_SIMPLEX_GRADIENT_4D(n4,idx,x4,y4,z4,w4); + n4 *= t4*t4; + } + return 27.0f * (n0+n1+n2+n3+n4); + + } + break; + } + return 0.0f; +} + +typedef float (*TCOD_noise_func_t)( TCOD_noise_t noise, float *f ); + +static float TCOD_noise_fbm_int(TCOD_noise_t noise, float *f, float octaves, TCOD_noise_func_t func ) { + float tf[TCOD_NOISE_MAX_DIMENSIONS]; + perlin_data_t *data=(perlin_data_t *)noise; + /* Initialize locals */ + float value = 0; + int i,j; + memcpy(tf,f,sizeof(float)*data->ndim); + + /* Inner loop of spectral construction, where the fractal is built */ + for(i=0; i<(int)octaves; i++) + { + value += func(noise,tf) * data->exponent[i]; + for (j=0; j < data->ndim; j++) tf[j] *= data->lacunarity; + } + + /* Take care of remainder in octaves */ + octaves -= (int)octaves; + if(octaves > DELTA) + value += octaves * func(noise,tf) * data->exponent[i]; + return clamp_signed_f(value); +} + +float TCOD_noise_fbm_perlin( TCOD_noise_t noise, float *f, float octaves ) +{ + return TCOD_noise_fbm_int(noise,f,octaves,TCOD_noise_perlin); +} + +float TCOD_noise_fbm_simplex( TCOD_noise_t noise, float *f, float octaves ) +{ + return TCOD_noise_fbm_int(noise,f,octaves,TCOD_noise_simplex); +} + +static float TCOD_noise_turbulence_int( TCOD_noise_t noise, float *f, float octaves, TCOD_noise_func_t func ) +{ + float tf[TCOD_NOISE_MAX_DIMENSIONS]; + perlin_data_t *data=(perlin_data_t *)noise; + /* Initialize locals */ + float value = 0; + int i,j; + memcpy(tf,f,sizeof(float)*data->ndim); + + /* Inner loop of spectral construction, where the fractal is built */ + for(i=0; i<(int)octaves; i++) + { + float nval=func(noise,tf); + value += ABS(nval) * data->exponent[i]; + for (j=0; j < data->ndim; j++) tf[j] *= data->lacunarity; + } + + /* Take care of remainder in octaves */ + octaves -= (int)octaves; + if(octaves > DELTA) { + float nval=func(noise,tf); + value += octaves * ABS(nval) * data->exponent[i]; + } + return clamp_signed_f(value); +} + +float TCOD_noise_turbulence_perlin( TCOD_noise_t noise, float *f, float octaves ) { + return TCOD_noise_turbulence_int(noise,f,octaves,TCOD_noise_perlin); +} + +float TCOD_noise_turbulence_simplex( TCOD_noise_t noise, float *f, float octaves ) { + return TCOD_noise_turbulence_int(noise,f,octaves,TCOD_noise_simplex); +} + +/* wavelet noise, adapted from Robert L. Cook and Tony Derose 'Wavelet noise' paper */ + +static void TCOD_noise_wavelet_downsample(float *from, float *to, int stride) { + static float acoeffs[2*WAVELET_ARAD]= { + 0.000334f, -0.001528f, 0.000410f, 0.003545f, -0.000938f, -0.008233f, 0.002172f, 0.019120f, + -0.005040f,-0.044412f, 0.011655f, 0.103311f, -0.025936f, -0.243780f, 0.033979f, 0.655340f, + 0.655340f, 0.033979f,-0.243780f,-0.025936f, 0.103311f, 0.011655f,-0.044412f,-0.005040f, + 0.019120f, 0.002172f,-0.008233f,-0.000938f, 0.003546f, 0.000410f,-0.001528f, 0.000334f, + }; + static float *a = &acoeffs[WAVELET_ARAD]; + int i; + for (i=0; i < WAVELET_TILE_SIZE/2; i++) { + int k; + to[i*stride]=0; + for (k=2*i-WAVELET_ARAD; k <2*i+WAVELET_ARAD; k++) { + to[i*stride] += a[k-2*i]* from[ absmod(k,WAVELET_TILE_SIZE) * stride ]; + } + } +} + +static void TCOD_noise_wavelet_upsample(float *from, float *to, int stride) { + static float pcoeffs[4]= { 0.25f, 0.75f, 0.75f, 0.25f }; + static float *p = &pcoeffs[2]; + int i; + for (i=0; i < WAVELET_TILE_SIZE; i++) { + int k; + to[i*stride]=0; + for (k=i/2; k rand,-1.0f,1.0f); + } + for (iy=0; iy < WAVELET_TILE_SIZE; iy++ ) { + for (iz=0; iz < WAVELET_TILE_SIZE; iz++ ) { + i = iy * WAVELET_TILE_SIZE + iz * WAVELET_TILE_SIZE * WAVELET_TILE_SIZE; + TCOD_noise_wavelet_downsample(&noise[i], &temp1[i], 1); + TCOD_noise_wavelet_upsample(&temp1[i], &temp2[i], 1); + } + } + for (ix=0; ix < WAVELET_TILE_SIZE; ix++ ) { + for (iz=0; iz < WAVELET_TILE_SIZE; iz++ ) { + i = ix + iz * WAVELET_TILE_SIZE * WAVELET_TILE_SIZE; + TCOD_noise_wavelet_downsample(&temp2[i], &temp1[i], WAVELET_TILE_SIZE); + TCOD_noise_wavelet_upsample(&temp1[i], &temp2[i], WAVELET_TILE_SIZE); + } + } + for (ix=0; ix < WAVELET_TILE_SIZE; ix++ ) { + for (iy=0; iy < WAVELET_TILE_SIZE; iy++ ) { + i = ix + iy * WAVELET_TILE_SIZE; + TCOD_noise_wavelet_downsample(&temp2[i], &temp1[i], WAVELET_TILE_SIZE * WAVELET_TILE_SIZE); + TCOD_noise_wavelet_upsample(&temp1[i], &temp2[i], WAVELET_TILE_SIZE * WAVELET_TILE_SIZE); + } + } + for (i=0; i < WAVELET_TILE_SIZE*WAVELET_TILE_SIZE*WAVELET_TILE_SIZE; i++ ) { + noise[i] -= temp2[i]; + } + offset = WAVELET_TILE_SIZE/2; + if ( (offset & 1) == 0 ) offset++; + for (i=0,ix=0; ix < WAVELET_TILE_SIZE; ix++ ) { + for (iy=0; iy < WAVELET_TILE_SIZE; iy++ ) { + for (iz=0; iz < WAVELET_TILE_SIZE; iz++ ) { + temp1[i++]=noise[ absmod(ix+offset,WAVELET_TILE_SIZE) + + absmod(iy+offset,WAVELET_TILE_SIZE)*WAVELET_TILE_SIZE + + absmod(iz+offset,WAVELET_TILE_SIZE)*WAVELET_TILE_SIZE*WAVELET_TILE_SIZE + ]; + } + } + } + for (i=0; i < WAVELET_TILE_SIZE*WAVELET_TILE_SIZE*WAVELET_TILE_SIZE; i++ ) { + noise[i] += temp1[i]; + } + data->waveletTileData=noise; + free(temp1); + free(temp2); +} + +float TCOD_noise_wavelet (TCOD_noise_t noise, float *f) { + perlin_data_t *data=(perlin_data_t *)noise; + float pf[3]; + int i; + int p[3],c[3],mid[3],n=WAVELET_TILE_SIZE; + float w[3][3],t,result=0.0f; + if ( data->ndim > 3 ) return 0.0f; /* not supported */ + if (! data->waveletTileData ) TCOD_noise_wavelet_init(noise); + for (i=0; i < data->ndim; i++ ) pf[i]=f[i]*WAVELET_SCALE; + for (i=data->ndim; i < 3; i++ ) pf[i]=0.0f; + for (i=0; i < 3; i++ ) { + mid[i]=(int)ceil(pf[i]-0.5f); + t=mid[i] - (pf[i]-0.5f); + w[i][0]=t*t*0.5f; + w[i][2]=(1.0f-t)*(1.0f-t)*0.5f; + w[i][1]=1.0f - w[i][0]-w[i][2]; + } + for (p[2]=-1; p[2]<=1; p[2]++) { + for (p[1]=-1; p[1]<=1; p[1]++) { + for (p[0]=-1; p[0]<=1; p[0]++) { + float weight=1.0f; + for (i=0;i<3;i++) { + c[i]=absmod(mid[i]+p[i],n); + weight *= w[i][p[i]+1]; + } + result += weight * data->waveletTileData[ c[2]*n*n + c[1]*n + c[0] ]; + } + } + } + return clamp_signed_f(result); +} + +float TCOD_noise_fbm_wavelet(TCOD_noise_t noise, float *f, float octaves) { + return TCOD_noise_fbm_int(noise,f,octaves,TCOD_noise_wavelet); +} + +float TCOD_noise_turbulence_wavelet(TCOD_noise_t noise, float *f, float octaves) { + return TCOD_noise_turbulence_int(noise,f,octaves,TCOD_noise_wavelet); +} + +void TCOD_noise_set_type (TCOD_noise_t noise, TCOD_noise_type_t type) { + ((perlin_data_t *)noise)->noise_type = type; +} + +float TCOD_noise_get_ex (TCOD_noise_t noise, float *f, TCOD_noise_type_t type) { + switch (type) { + case (TCOD_NOISE_PERLIN): return TCOD_noise_perlin(noise,f); break; + case (TCOD_NOISE_SIMPLEX): return TCOD_noise_simplex(noise,f); break; + case (TCOD_NOISE_WAVELET): return TCOD_noise_wavelet(noise,f); break; + default: + switch (((perlin_data_t *)noise)->noise_type) { + case (TCOD_NOISE_PERLIN): return TCOD_noise_perlin(noise,f); break; + case (TCOD_NOISE_SIMPLEX): return TCOD_noise_simplex(noise,f); break; + case (TCOD_NOISE_WAVELET): return TCOD_noise_wavelet(noise,f); break; + default: return TCOD_noise_simplex(noise,f); break; + } + break; + } +} + +float TCOD_noise_get_fbm_ex (TCOD_noise_t noise, float *f, float octaves, TCOD_noise_type_t type) { + switch (type) { + case (TCOD_NOISE_PERLIN): return TCOD_noise_fbm_perlin(noise,f,octaves); break; + case (TCOD_NOISE_SIMPLEX): return TCOD_noise_fbm_simplex(noise,f,octaves); break; + case (TCOD_NOISE_WAVELET): return TCOD_noise_fbm_wavelet(noise,f,octaves); break; + default: + switch (((perlin_data_t *)noise)->noise_type) { + case (TCOD_NOISE_PERLIN): return TCOD_noise_fbm_perlin(noise,f,octaves); break; + case (TCOD_NOISE_SIMPLEX): return TCOD_noise_fbm_simplex(noise,f,octaves); break; + case (TCOD_NOISE_WAVELET): return TCOD_noise_fbm_wavelet(noise,f,octaves); break; + default: return TCOD_noise_fbm_simplex(noise,f,octaves); break; + } + break; + } +} + +float TCOD_noise_get_turbulence_ex (TCOD_noise_t noise, float *f, float octaves, TCOD_noise_type_t type) { + switch (type) { + case (TCOD_NOISE_PERLIN): return TCOD_noise_turbulence_perlin(noise,f,octaves); break; + case (TCOD_NOISE_SIMPLEX): return TCOD_noise_turbulence_simplex(noise,f,octaves); break; + case (TCOD_NOISE_WAVELET): return TCOD_noise_turbulence_wavelet(noise,f,octaves); break; + default: + switch (((perlin_data_t *)noise)->noise_type) { + case (TCOD_NOISE_PERLIN): return TCOD_noise_turbulence_perlin(noise,f,octaves); break; + case (TCOD_NOISE_SIMPLEX): return TCOD_noise_turbulence_simplex(noise,f,octaves); break; + case (TCOD_NOISE_WAVELET): return TCOD_noise_turbulence_wavelet(noise,f,octaves); break; + default: return TCOD_noise_turbulence_simplex(noise,f,octaves); break; + } + break; + } +} + +float TCOD_noise_get (TCOD_noise_t noise, float *f) { + switch (((perlin_data_t *)noise)->noise_type) { + case (TCOD_NOISE_PERLIN): return TCOD_noise_perlin(noise,f); break; + case (TCOD_NOISE_SIMPLEX): return TCOD_noise_simplex(noise,f); break; + case (TCOD_NOISE_WAVELET): return TCOD_noise_wavelet(noise,f); break; + default: return TCOD_noise_simplex(noise,f); break; + } +} + +float TCOD_noise_get_fbm (TCOD_noise_t noise, float *f, float octaves) { + switch (((perlin_data_t *)noise)->noise_type) { + case (TCOD_NOISE_PERLIN): return TCOD_noise_fbm_perlin(noise,f,octaves); break; + case (TCOD_NOISE_SIMPLEX): return TCOD_noise_fbm_simplex(noise,f,octaves); break; + case (TCOD_NOISE_WAVELET): return TCOD_noise_fbm_wavelet(noise,f,octaves); break; + default: return TCOD_noise_fbm_simplex(noise,f,octaves); break; + } +} + +float TCOD_noise_get_turbulence (TCOD_noise_t noise, float *f, float octaves) { + switch (((perlin_data_t *)noise)->noise_type) { + case (TCOD_NOISE_PERLIN): return TCOD_noise_turbulence_perlin(noise,f,octaves); break; + case (TCOD_NOISE_SIMPLEX): return TCOD_noise_turbulence_simplex(noise,f,octaves); break; + case (TCOD_NOISE_WAVELET): return TCOD_noise_turbulence_wavelet(noise,f,octaves); break; + default: return TCOD_noise_turbulence_simplex(noise,f,octaves); break; + } +} + +void TCOD_noise_delete(TCOD_noise_t noise) { + if (((perlin_data_t *)noise)->waveletTileData) { + free(((perlin_data_t *)noise)->waveletTileData); + } + free((perlin_data_t *)noise); +} diff --git a/tcod_sys/libtcod/src/libtcod/noise_defaults.h b/tcod_sys/libtcod/src/libtcod/noise_defaults.h new file mode 100644 index 000000000..2225f0604 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/noise_defaults.h @@ -0,0 +1,40 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_NOISE_DEFAULTS +#define _TCOD_NOISE_DEFAULTS + +#define TCOD_NOISE_MAX_OCTAVES 128 +#define TCOD_NOISE_MAX_DIMENSIONS 4 +#define TCOD_NOISE_DEFAULT_HURST 0.5f +#define TCOD_NOISE_DEFAULT_LACUNARITY 2.0f + +#endif /* _TCOD_NOISE_DEFAULTS */ diff --git a/tcod_sys/libtcod/src/parser.cpp b/tcod_sys/libtcod/src/libtcod/parser.cpp similarity index 68% rename from tcod_sys/libtcod/src/parser.cpp rename to tcod_sys/libtcod/src/libtcod/parser.cpp index 2aa8a8b48..14b592d68 100644 --- a/tcod_sys/libtcod/src/parser.cpp +++ b/tcod_sys/libtcod/src/libtcod/parser.cpp @@ -1,189 +1,197 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include -#include -#include - -const char *TCODParserStruct::getName() const { - return TCOD_struct_get_name(data); -} - -TCODParserStruct* TCODParserStruct::addProperty(const char *propname, TCOD_value_type_t type, bool mandatory) { - TCOD_struct_add_property(data,propname,type,mandatory); - return this; -} - -TCODParserStruct* TCODParserStruct::addListProperty(const char *propname, TCOD_value_type_t type, bool mandatory) { - TCOD_struct_add_list_property(data,propname,type,mandatory); - return this; -} - -TCODParserStruct* TCODParserStruct::addValueList(const char *propname, const char **value_list, bool mandatory) { - TCOD_struct_add_value_list(data,propname,value_list,mandatory); - return this; -} - -TCODParserStruct* TCODParserStruct::addFlag(const char *propname) { - TCOD_struct_add_flag(data,propname); - return this; -} - -TCODParserStruct* TCODParserStruct::addStructure(TCODParserStruct *sub_entity) { - TCOD_struct_add_structure(data,sub_entity->data); - return this; -} - -bool TCODParserStruct::isPropertyMandatory(const char *propname) const { - return TCOD_struct_is_mandatory(data,propname) != 0; -} - -TCOD_value_type_t TCODParserStruct::getPropertyType(const char *propname) const { - return TCOD_struct_get_type(data,propname); -} - -TCODParserStruct *TCODParser::newStructure(const char *name) { - TCODParserStruct *ent = new TCODParserStruct(); - ent->data = TCOD_parser_new_struct(data,(char *)name); - defs.push(ent); - return ent; -} - -static ITCODParserListener *listener=NULL; -static TCODParser *parser=NULL; -extern "C" bool new_struct(TCOD_parser_struct_t def,const char *name) { - for ( TCODParserStruct **idef=parser->defs.begin(); idef != parser->defs.end(); idef++) { - if ( (*idef)->data == def ) { - return listener->parserNewStruct(parser,*idef,name) ? 1 : 0; - } - } - // not found. autodeclaring struct - TCODParserStruct *idef = new TCODParserStruct(); - idef->data = def; - parser->defs.push(idef); - return listener->parserNewStruct(parser,idef,name) ? 1 : 0; -} -extern "C" bool new_flag(const char *name) { - return listener->parserFlag(parser,name) ? 1 : 0; -} -extern "C" bool new_property(const char *propname, TCOD_value_type_t type, TCOD_value_t value) { - return listener->parserProperty(parser,propname,type, value) ? 1 : 0; -} -extern "C" bool end_struct(TCOD_parser_struct_t def, const char *name) { - for ( TCODParserStruct **idef=parser->defs.begin(); idef != parser->defs.end(); idef++) { - if ( (*idef)->data == def ) { - return listener->parserEndStruct(parser,*idef,name) ? 1 : 0; - } - } - return 0; -} - -extern "C" void error(const char *msg) { - listener->error(msg); -} - -static TCOD_parser_listener_t c_to_cpp_listener = { - new_struct, - new_flag, - new_property, - end_struct, - error -}; - -TCODParser::TCODParser() { - data = TCOD_parser_new(); -} - -TCODParser::~TCODParser() { - TCOD_parser_delete(data); -} - -void TCODParser::run(const char *filename, ITCODParserListener *_listener) { - listener=_listener; - parser=this; - if ( listener ) TCOD_parser_run(data,(char *)filename,&c_to_cpp_listener); - else TCOD_parser_run(data,(char *)filename, NULL); -} - -TCOD_value_type_t TCODParser::newCustomType(TCOD_parser_custom_t custom_type_parser) { - return TCOD_parser_new_custom_type(data,custom_type_parser); -} - -void TCODParser::error(const char *msg, ...) { - char buf[2048]; - va_list ap; - va_start(ap,msg); - vsprintf(buf,msg,ap); - va_end(ap); - TCOD_parser_error(buf); -} - -// default parser - -bool TCODParser::hasProperty(const char *name) const { - return TCOD_parser_has_property(data,name) != 0; -} - -bool TCODParser::getBoolProperty(const char *name) const { - return TCOD_parser_get_bool_property(data,name) != 0; -} - -int TCODParser::getIntProperty(const char *name) const { - return TCOD_parser_get_int_property(data,name); -} - -int TCODParser::getCharProperty(const char *name) const { - return TCOD_parser_get_char_property(data,name); -} - -float TCODParser::getFloatProperty(const char *name) const { - return TCOD_parser_get_float_property(data,name); -} - -TCODColor TCODParser::getColorProperty(const char *name) const { - return TCOD_parser_get_color_property(data,name); -} - -TCOD_dice_t TCODParser::getDiceProperty(const char *name) const { - return TCOD_parser_get_dice_property(data,name); -} - -const char * TCODParser::getStringProperty(const char *name) const { - return TCOD_parser_get_string_property(data,name); -} - -void * TCODParser::getCustomProperty(const char *name) const { - return TCOD_parser_get_custom_property(data,name); -} - -TCOD_list_t TCODParser::getListProperty(const char *name, TCOD_value_type_t type) const { - return TCOD_parser_get_list_property(data,name,type); -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "parser.hpp" + +#include +#include +#include +#include +#include + +const char *TCODParserStruct::getName() const { + return TCOD_struct_get_name(data); +} + +TCODParserStruct* TCODParserStruct::addProperty(const char *propname, TCOD_value_type_t type, bool mandatory) { + TCOD_struct_add_property(data,propname,type,mandatory); + return this; +} + +TCODParserStruct* TCODParserStruct::addListProperty(const char *propname, TCOD_value_type_t type, bool mandatory) { + TCOD_struct_add_list_property(data,propname,type,mandatory); + return this; +} + +TCODParserStruct* TCODParserStruct::addValueList(const char *propname, const char **value_list, bool mandatory) { + TCOD_struct_add_value_list(data,propname,value_list,mandatory); + return this; +} + +TCODParserStruct* TCODParserStruct::addFlag(const char *propname) { + TCOD_struct_add_flag(data,propname); + return this; +} + +TCODParserStruct* TCODParserStruct::addStructure(TCODParserStruct *sub_entity) { + TCOD_struct_add_structure(data,sub_entity->data); + return this; +} + +bool TCODParserStruct::isPropertyMandatory(const char *propname) const { + return TCOD_struct_is_mandatory(data,propname) != 0; +} + +TCOD_value_type_t TCODParserStruct::getPropertyType(const char *propname) const { + return TCOD_struct_get_type(data,propname); +} + +TCODParserStruct *TCODParser::newStructure(const char *name) { + TCODParserStruct *ent = new TCODParserStruct(); + ent->data = TCOD_parser_new_struct(data, name); + defs.push(ent); + return ent; +} + +static ITCODParserListener *listener=NULL; +static TCODParser *parser=NULL; +extern "C" bool new_struct(TCOD_parser_struct_t def,const char *name) { + for ( TCODParserStruct **idef=parser->defs.begin(); idef != parser->defs.end(); idef++) { + if ( (*idef)->data == def ) { + return listener->parserNewStruct(parser,*idef,name) ? 1 : 0; + } + } + // not found. autodeclaring struct + TCODParserStruct *idef = new TCODParserStruct(); + idef->data = def; + parser->defs.push(idef); + return listener->parserNewStruct(parser,idef,name) ? 1 : 0; +} +extern "C" bool new_flag(const char *name) { + return listener->parserFlag(parser,name) ? 1 : 0; +} +extern "C" bool new_property(const char *propname, TCOD_value_type_t type, TCOD_value_t value) { + return listener->parserProperty(parser,propname,type, value) ? 1 : 0; +} +extern "C" bool end_struct(TCOD_parser_struct_t def, const char *name) { + for ( TCODParserStruct **idef=parser->defs.begin(); idef != parser->defs.end(); idef++) { + if ( (*idef)->data == def ) { + return listener->parserEndStruct(parser,*idef,name) ? 1 : 0; + } + } + return 0; +} + +extern "C" void error(const char *msg) { + listener->error(msg); +} + +static TCOD_parser_listener_t c_to_cpp_listener = { + new_struct, + new_flag, + new_property, + end_struct, + error +}; + +TCODParser::TCODParser() { + data = TCOD_parser_new(); +} + +TCODParser::~TCODParser() { + TCOD_parser_delete(data); +} + +void TCODParser::run(const char *filename, ITCODParserListener *_listener) +{ + listener = _listener; + parser = this; + if (listener) { + TCOD_parser_run(data, filename, &c_to_cpp_listener); + } else { + TCOD_parser_run(data, filename, NULL); + } +} + +TCOD_value_type_t TCODParser::newCustomType(TCOD_parser_custom_t custom_type_parser) { + return TCOD_parser_new_custom_type(data,custom_type_parser); +} + +void TCODParser::error(const char *msg, ...) { + char buf[2048]; + va_list ap; + va_start(ap,msg); + vsprintf(buf,msg,ap); + va_end(ap); + TCOD_parser_error("%s", buf); +} + +// default parser + +bool TCODParser::hasProperty(const char *name) const { + return TCOD_parser_has_property(data,name) != 0; +} + +bool TCODParser::getBoolProperty(const char *name) const { + return TCOD_parser_get_bool_property(data,name) != 0; +} + +int TCODParser::getIntProperty(const char *name) const { + return TCOD_parser_get_int_property(data,name); +} + +int TCODParser::getCharProperty(const char *name) const { + return TCOD_parser_get_char_property(data,name); +} + +float TCODParser::getFloatProperty(const char *name) const { + return TCOD_parser_get_float_property(data,name); +} + +TCODColor TCODParser::getColorProperty(const char *name) const { + return TCOD_parser_get_color_property(data,name); +} + +TCOD_dice_t TCODParser::getDiceProperty(const char *name) const { + return TCOD_parser_get_dice_property(data,name); +} + +const char * TCODParser::getStringProperty(const char *name) const { + return TCOD_parser_get_string_property(data,name); +} + +void * TCODParser::getCustomProperty(const char *name) const { + return TCOD_parser_get_custom_property(data,name); +} + +TCOD_list_t TCODParser::getListProperty(const char *name, TCOD_value_type_t type) const { + return TCOD_parser_get_list_property(data,name,type); +} diff --git a/tcod_sys/libtcod/include/parser.h b/tcod_sys/libtcod/src/libtcod/parser.h similarity index 74% rename from tcod_sys/libtcod/include/parser.h rename to tcod_sys/libtcod/src/libtcod/parser.h index 2f1110ff8..4a977647d 100644 --- a/tcod_sys/libtcod/include/parser.h +++ b/tcod_sys/libtcod/src/libtcod/parser.h @@ -1,34 +1,38 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_PARSER_H #define _TCOD_PARSER_H -#include "libtcod_portability.h" +#include "portability.h" #include "color.h" #include "list.h" #include "lex.h" @@ -96,7 +100,8 @@ typedef union { } TCOD_value_t; /* parser structures */ -typedef void *TCOD_parser_struct_t; +struct TCOD_ParserStruct; +typedef struct TCOD_ParserStruct *TCOD_parser_struct_t; TCODLIB_API const char *TCOD_struct_get_name(TCOD_parser_struct_t def); TCODLIB_API void TCOD_struct_add_property(TCOD_parser_struct_t def, const char *name,TCOD_value_type_t type, bool mandatory); TCODLIB_API void TCOD_struct_add_list_property(TCOD_parser_struct_t def, const char *name,TCOD_value_type_t type, bool mandatory); @@ -121,14 +126,16 @@ typedef struct { typedef TCOD_value_t (*TCOD_parser_custom_t)(TCOD_lex_t *lex, TCOD_parser_listener_t *listener, TCOD_parser_struct_t str, char *propname); /* the parser */ -typedef void *TCOD_parser_t; +struct TCOD_Parser; +typedef struct TCOD_Parser *TCOD_parser_t; TCODLIB_API TCOD_parser_t TCOD_parser_new(void); -TCODLIB_API TCOD_parser_struct_t TCOD_parser_new_struct(TCOD_parser_t parser, char *name); +TCODLIB_API TCOD_parser_struct_t TCOD_parser_new_struct(TCOD_parser_t parser, const char *name); TCODLIB_API TCOD_value_type_t TCOD_parser_new_custom_type(TCOD_parser_t parser,TCOD_parser_custom_t custom_type_parser); TCODLIB_API void TCOD_parser_run(TCOD_parser_t parser, const char *filename, TCOD_parser_listener_t *listener); TCODLIB_API void TCOD_parser_delete(TCOD_parser_t parser); /* error during parsing. can be called by the parser listener */ +TCODLIB_FORMAT(1, 2) TCODLIB_API void TCOD_parser_error(const char *msg, ...); /* default parser listener */ TCODLIB_API bool TCOD_parser_has_property(TCOD_parser_t parser, const char *name); @@ -145,7 +152,7 @@ TCODLIB_API TCOD_list_t TCOD_parser_get_list_property(TCOD_parser_t parser, cons /* parser internals (may be used by custom type parsers) */ /* parser structures */ -typedef struct { +typedef struct TCOD_ParserStruct { char *name; /* entity type name */ /* list of flags */ TCOD_list_t flags; @@ -157,7 +164,7 @@ typedef struct { TCOD_list_t structs; } TCOD_struct_int_t; /* the parser */ -typedef struct { +typedef struct TCOD_Parser { /* list of structures */ TCOD_list_t structs; /* list of custom type parsers */ diff --git a/tcod_sys/libtcod/include/parser.hpp b/tcod_sys/libtcod/src/libtcod/parser.hpp similarity index 95% rename from tcod_sys/libtcod/include/parser.hpp rename to tcod_sys/libtcod/src/libtcod/parser.hpp index a77ae79d3..deae84b1c 100644 --- a/tcod_sys/libtcod/include/parser.hpp +++ b/tcod_sys/libtcod/src/libtcod/parser.hpp @@ -1,30 +1,34 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_PARSER_HPP #define _TCOD_PARSER_HPP diff --git a/tcod_sys/libtcod/src/parser_c.c b/tcod_sys/libtcod/src/libtcod/parser_c.c similarity index 88% rename from tcod_sys/libtcod/src/parser_c.c rename to tcod_sys/libtcod/src/libtcod/parser_c.c index c9d5d6b72..4623d54ad 100644 --- a/tcod_sys/libtcod/src/parser_c.c +++ b/tcod_sys/libtcod/src/libtcod/parser_c.c @@ -1,933 +1,940 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include -#include - -#include - -#define BIG_NAME_LEN 128 - -#define DEF_NAME(d) (((TCOD_struct_int_t *)d)->name) -#define DEF_FLAGS(d) (((TCOD_struct_int_t *)d)->flags) -#define DEF_PROPS(d) (((TCOD_struct_int_t *)d)->props) -#define DEF_LISTS(d) (((TCOD_struct_int_t *)d)->lists) - -/* definition property */ -typedef struct { - char *name; - TCOD_value_type_t value; - bool mandat; -} TCOD_struct_prop_t; - -static TCOD_lex_t *lex=NULL; - -static const char *symbols[] = { - "{","}","=","/","+","-","[","]",",","#",NULL -}; - -static const char *keywords[] = { - "struct","bool","char","int","float","string","color","dice",NULL -}; - -static TCOD_parser_listener_t *listener=NULL; - -static bool default_new_struct(TCOD_parser_struct_t str,const char *name); -static bool default_new_flag(const char *name); -static bool default_new_property(const char *propname, TCOD_value_type_t type, TCOD_value_t value); -static bool default_end_struct(TCOD_parser_struct_t str, const char *name); -static void default_error(const char *msg); - -static TCOD_parser_listener_t default_listener = { - default_new_struct, - default_new_flag, - default_new_property, - default_end_struct, - default_error -}; - -static bool string_copy(char *dest, char *source, int len) { - if ( source == NULL ) return false; - strncpy(dest,source,len); - dest[len-1]='\0'; - if ( strlen(source) >= (unsigned)len ) return false; - return true; -} - -void TCOD_parser_error(const char *msg, ...) { - char buf[2048]; - char buf2[2048]; - va_list ap; - va_start(ap,msg); - vsprintf(buf,msg,ap); - va_end(ap); - sprintf(buf2,"error in %s line %d : %s",lex->filename,lex->file_line,buf); - listener->error(buf2); - lex->token_type = TCOD_LEX_ERROR; -} - -const char *TCOD_struct_get_name(TCOD_parser_struct_t def) { - return ((TCOD_struct_int_t *)def)->name; -} - -/* add a property to an entity definition */ -void TCOD_struct_add_property(TCOD_parser_struct_t def,const char *name,TCOD_value_type_t type, bool mandatory) { - TCOD_struct_prop_t *prop=(TCOD_struct_prop_t *)calloc(1,sizeof(TCOD_struct_prop_t)); - prop->name=TCOD_strdup(name); - prop->value=type; - prop->mandat=mandatory; - TCOD_list_push(DEF_PROPS(def),(void *)prop); -} - -/* add a list property to an entity definition */ -void TCOD_struct_add_list_property(TCOD_parser_struct_t def,const char *name,TCOD_value_type_t type, bool mandatory) { - TCOD_struct_add_property(def,name,type|TCOD_TYPE_LIST,mandatory); -} - -void TCOD_struct_add_value_list_sized(TCOD_parser_struct_t def,const char *name, const char **value_list, int size, bool mandatory) { - char ** newArray = NULL; - /* duplicate value list to avoid issues with C# garbage collector */ - TCOD_value_type_t type = (TCOD_value_type_t)((int)TCOD_TYPE_VALUELIST00 + TCOD_list_size(DEF_LISTS(def))); - int i = 0; - - if(size) newArray = calloc(size+1, sizeof(char*)); - - for(i = 0 ; i < size ; i++) - newArray[i] = TCOD_strdup(value_list[i]); - newArray[size] = NULL; - - TCOD_struct_add_property(def,name,type,mandatory); - TCOD_list_push(DEF_LISTS(def),(void *)newArray); -} - -/* add a value-list property to an entity definition */ -void TCOD_struct_add_value_list(TCOD_parser_struct_t def,const char *name, const char **value_list, bool mandatory) { - int size = 0; - if(value_list) - { - while(value_list[size] != NULL) - { - size++; - }; - } - TCOD_struct_add_value_list_sized(def, name, value_list, size, mandatory); -} - - -/* add a flag (simplified bool value) to an entity definition */ -/* a flag cannot be mandatory. if present => true, if omitted => false */ -void TCOD_struct_add_flag(TCOD_parser_struct_t def,const char *propname) { - TCOD_list_push(DEF_FLAGS(def),(void *)TCOD_strdup(propname)); -} - -/* add a sub-entity to an entity definition */ -void TCOD_struct_add_structure(TCOD_parser_struct_t def, TCOD_parser_struct_t sub_definition) { - TCOD_list_push(((TCOD_struct_int_t *)def)->structs,(const void *)sub_definition); -} - -/* check if given property is mandatory for this entity definition */ -bool TCOD_struct_is_mandatory(TCOD_parser_struct_t def, const char *propname) { - TCOD_struct_prop_t **iprop; - for (iprop=(TCOD_struct_prop_t **)TCOD_list_begin(DEF_PROPS(def)); iprop!=(TCOD_struct_prop_t **)TCOD_list_end(DEF_PROPS(def));iprop++) { - if ( strcmp((*iprop)->name,propname) == 0 ) return (*iprop)->mandat; - } - return false; -} - -/* returns the type of given property */ -/* NONE if the property does not exist */ -TCOD_value_type_t TCOD_struct_get_type(TCOD_parser_struct_t def, const char *propname) { - TCOD_struct_prop_t **iprop; - char **iflag; - for (iprop=(TCOD_struct_prop_t **)TCOD_list_begin(DEF_PROPS(def)); iprop!=(TCOD_struct_prop_t **)TCOD_list_end(DEF_PROPS(def));iprop++) { - if ( strcmp((*iprop)->name,propname) == 0 ) return (*iprop)->value; - } - for (iflag=(char **)TCOD_list_begin(DEF_FLAGS(def)); iflag!=(char **)TCOD_list_end(DEF_FLAGS(def));iflag++) { - if ( strcmp((*iflag),propname) == 0 ) return TCOD_TYPE_BOOL; - } - return TCOD_TYPE_NONE; -} - -TCOD_value_t TCOD_parse_bool_value(void) { - TCOD_value_t ret; - if ( strcmp(lex->tok,"true") == 0 ) ret.b=true; - else if ( strcmp(lex->tok,"false") == 0 ) ret.b=false; - else TCOD_parser_error("parseBoolValue : unknown value %s for bool. 'true' or 'false' expected",lex->tok); - return ret; -} - -TCOD_value_t TCOD_parse_char_value(void) { - TCOD_value_t ret; - if ( lex->token_type != TCOD_LEX_CHAR && lex->token_type != TCOD_LEX_INTEGER ) - TCOD_parser_error("parseCharValue : char constant expected instead of '%s'",lex->tok); - ret.c=lex->token_int_val; - return ret; -} - -TCOD_value_t TCOD_parse_integer_value(void) { - TCOD_value_t ret; - if ( lex->token_type != TCOD_LEX_INTEGER ) - TCOD_parser_error("parseIntegerValue : integer constant expected instead of '%s'",lex->tok); - ret.i=lex->token_int_val; - return ret; -} - -TCOD_value_t TCOD_parse_float_value(void) { - TCOD_value_t ret; - if ( lex->token_type != TCOD_LEX_FLOAT && lex->token_type != TCOD_LEX_INTEGER ) - TCOD_parser_error("parseFloatValue : float constant expected instead of '%s'",lex->tok); - if ( lex->token_type == TCOD_LEX_FLOAT ) ret.f=lex->token_float_val; - else ret.f=(float)lex->token_int_val; - return ret; -} - -TCOD_value_t TCOD_parse_string_value(void) { - TCOD_value_t ret; - TCOD_list_t l; - bool end=false; - char **s; - size_t slen=0; - l=TCOD_list_new(); - if ( lex->token_type != TCOD_LEX_STRING ) TCOD_parser_error("parseStringValue : string constant expected instead of '%s'",lex->tok); - while ( !end ) { - TCOD_lex_t save; - TCOD_list_push(l,(void *)TCOD_strdup(lex->tok)); - TCOD_lex_savepoint(lex,&save); - if (TCOD_lex_parse(lex) != TCOD_LEX_STRING) { - end=true; - TCOD_lex_restore(lex,&save); - } - } - for (s=(char **)TCOD_list_begin(l); s != (char **)TCOD_list_end(l); s++ ) { - slen += strlen(*s); - } - ret.s=(char *)calloc(sizeof(char),slen+1); - for (s=(char **)TCOD_list_begin(l); s != (char **)TCOD_list_end(l); s++ ) { - strcat(ret.s,*s); - free(*s); - } - TCOD_list_delete(l); - return ret; -} - -TCOD_value_t TCOD_parse_color_value(void) { - TCOD_value_t ret; - if ( lex->token_type == TCOD_LEX_SYMBOL && lex->tok[0]=='#') { - char tmp[128]=""; - int tok=TCOD_lex_parse(lex); - /* format : col = #FFFFFF */ - strcat(tmp,"#"); - if ( tok == TCOD_LEX_IDEN || tok == TCOD_LEX_INTEGER ) { - strcat(tmp,lex->tok); - strcpy(lex->tok,tmp); - if ( strlen(lex->tok) < 7 && tok == TCOD_LEX_INTEGER ) { - /* special case of #12AABB => symbol # + - integer 12 + iden AABB */ - tok=TCOD_lex_parse(lex); - if ( tok == TCOD_LEX_IDEN ) { - strcat(tmp,lex->tok); - strcpy(lex->tok,tmp); - } - } - lex->token_type = TCOD_LEX_STRING; - } - } - if ( lex->token_type != TCOD_LEX_STRING ) TCOD_parser_error("parseColorValue : string constant expected instead of '%s'",lex->tok); - if (lex->tok[0] == '#') { - int r,g,b; - if ( strlen(lex->tok) != 7 ) TCOD_parser_error("parseColorValue : bad color format. '#rrggbb' expected instead of '%s'",lex->tok); - /* web format : #rrggbb */ - r=(TCOD_lex_hextoint(lex->tok[1])<<4) + TCOD_lex_hextoint(lex->tok[2]); - g=(TCOD_lex_hextoint(lex->tok[3])<<4) + TCOD_lex_hextoint(lex->tok[4]); - b=(TCOD_lex_hextoint(lex->tok[5])<<4) + TCOD_lex_hextoint(lex->tok[6]); - ret.col.r=r; - ret.col.g=g; - ret.col.b=b; - } else { - /* standard format : rrr,ggg,bbb */ - char *begin=lex->tok; - char *end=strchr(begin,','); - bool ok=true; - if (! end) ok=false; - else { - *end=0; - ret.col.r=atoi(begin); - begin=end+1; - end=strchr(begin,','); - if ( !end ) ok=false; - else { - ret.col.g=atoi(begin); - begin=end+1; - ret.col.b=atoi(begin); - } - - } - if (!ok) TCOD_parser_error("parseColorValue : bad color format 'rrr,ggg,bbb' expected instead of '%s'",lex->tok); - } - return ret; -} - -TCOD_value_t TCOD_parse_dice_value(void) { - /* dice format : [(x|*)](D|d)[(+|-)] */ - TCOD_value_t ret; - bool minus=false; - char *begin; - char *ptr; - ret.dice.multiplier=1.0f; - ret.dice.addsub=0.0f; - begin=lex->tok; - ptr=strchr(begin,'x'); - if (! ptr ) ptr=strchr(begin,'*'); - if ( ptr ) { - /* parse multiplier */ - *ptr=0; - ret.dice.multiplier=(float)atof(lex->tok); - begin=ptr+1; - } - ptr=strchr(begin,'D'); - if (!ptr ) ptr=strchr(begin,'d'); - if (! ptr ) TCOD_parser_error("parseDiceValue : bad dice format. [(x|*)](D|d)[(+|-)] expected instead of '%s'",lex->tok); - *ptr=0; - /* parse nb_rolls */ - ret.dice.nb_rolls=atoi(begin); - begin=ptr+1; - ptr=strchr(begin,'+'); - if (! ptr) { - ptr = strchr(begin,'-'); - if ( ptr ) minus=true; - } - if (ptr) *ptr=0; - /* parse nb_faces */ - ret.dice.nb_faces=atoi(begin); - if ( ptr ) { - /* parse addsub */ - begin=ptr+1; - ret.dice.addsub=(float)atof(begin); - if ( minus ) ret.dice.addsub=-ret.dice.addsub; - } - return ret; -} - -TCOD_value_t TCOD_parse_value_list_value(TCOD_struct_int_t *def,int listnum) { - TCOD_value_t ret; - int i=0; - char *value; - char **value_list=TCOD_list_get(def->lists,listnum); - if ( lex->token_type != TCOD_LEX_STRING) TCOD_parser_error("parseValueListValue : string constant expected instead of '%s'",lex->tok); - value= value_list[i]; - while ( value ) { - if ( strcmp(lex->tok,value) == 0 ) break; - i++; - value=value_list[i]; - } - if (! value ) TCOD_parser_error("parseValueListValue : incorrect value '%s'",lex->tok); - ret.s = value; - return ret; -} - - -TCOD_value_t TCOD_parse_property_value(TCOD_parser_int_t *parser, TCOD_parser_struct_t def, char *propname, bool list) { - TCOD_value_type_t type=TCOD_struct_get_type(def,propname); - TCOD_value_t ret={0}; - if (! list ) type &= ~ TCOD_TYPE_LIST; - if ( type & TCOD_TYPE_LIST ) { - type &= ~ TCOD_TYPE_LIST; - if ( strcmp(lex->tok,"[") != 0 ) { - TCOD_parser_error("'[' expected for list value instead of '%s'",lex->tok); - } - ret.list=TCOD_list_new(); - do { - TCOD_value_t val; - int tok=TCOD_lex_parse(lex); - if ( tok == TCOD_LEX_EOF || tok == TCOD_LEX_ERROR ) { - TCOD_parser_error("Missing ']' in list value"); - } - val=TCOD_parse_property_value(parser,def,propname,false); - if ( type == TCOD_TYPE_STRING || (type >= TCOD_TYPE_VALUELIST00 && type <= TCOD_TYPE_VALUELIST15 ) ) { - TCOD_list_push(ret.list,TCOD_strdup(val.s)); - } else { - TCOD_list_push(ret.list,val.custom); - } - TCOD_lex_parse(lex); - if ( strcmp(lex->tok,",") != 0 && strcmp(lex->tok,"]") != 0 ) { - TCOD_parser_error("',' or ']' expected in list value instead of '%s'",lex->tok); - } - } while ( strcmp(lex->tok,"]") != 0 ); - } else { - switch (type) { - case TCOD_TYPE_BOOL : return TCOD_parse_bool_value(); break; - case TCOD_TYPE_CHAR : return TCOD_parse_char_value(); break; - case TCOD_TYPE_INT : return TCOD_parse_integer_value(); break; - case TCOD_TYPE_FLOAT : return TCOD_parse_float_value(); break; - case TCOD_TYPE_STRING : return TCOD_parse_string_value(); break; - case TCOD_TYPE_COLOR : return TCOD_parse_color_value(); break; - case TCOD_TYPE_DICE : return TCOD_parse_dice_value(); break; - case TCOD_TYPE_VALUELIST00 : - case TCOD_TYPE_VALUELIST01 : - case TCOD_TYPE_VALUELIST02 : - case TCOD_TYPE_VALUELIST03 : - case TCOD_TYPE_VALUELIST04 : - case TCOD_TYPE_VALUELIST05 : - case TCOD_TYPE_VALUELIST06 : - case TCOD_TYPE_VALUELIST07 : - case TCOD_TYPE_VALUELIST08 : - case TCOD_TYPE_VALUELIST09 : - case TCOD_TYPE_VALUELIST10 : - case TCOD_TYPE_VALUELIST11 : - case TCOD_TYPE_VALUELIST12 : - case TCOD_TYPE_VALUELIST13 : - case TCOD_TYPE_VALUELIST14 : - case TCOD_TYPE_VALUELIST15 : { - int listnum = type - TCOD_TYPE_VALUELIST00; - return TCOD_parse_value_list_value((TCOD_struct_int_t *)def,listnum); break; - } - case TCOD_TYPE_CUSTOM00 : - case TCOD_TYPE_CUSTOM01 : - case TCOD_TYPE_CUSTOM02 : - case TCOD_TYPE_CUSTOM03 : - case TCOD_TYPE_CUSTOM04 : - case TCOD_TYPE_CUSTOM05 : - case TCOD_TYPE_CUSTOM06 : - case TCOD_TYPE_CUSTOM07 : - case TCOD_TYPE_CUSTOM08 : - case TCOD_TYPE_CUSTOM09 : - case TCOD_TYPE_CUSTOM10 : - case TCOD_TYPE_CUSTOM11 : - case TCOD_TYPE_CUSTOM12 : - case TCOD_TYPE_CUSTOM13 : - case TCOD_TYPE_CUSTOM14 : - case TCOD_TYPE_CUSTOM15 : - if ( parser->customs[type - TCOD_TYPE_CUSTOM00] ) { - return parser->customs[type-TCOD_TYPE_CUSTOM00](lex,listener,def,propname); - } else { - TCOD_parser_error("parse_property_value : no custom parser for property type %d for entity %s prop %s", - type,DEF_NAME(def),propname); - } - break; - default : TCOD_parser_error("parse_property_value : unknown property type %d for entity %s prop %s", - type,DEF_NAME(def),propname); break; - } - } - return ret; -} - -static bool TCOD_parser_parse_entity(TCOD_parser_int_t *parser, TCOD_struct_int_t *def) { - char *name=NULL; - if ( TCOD_lex_parse(lex) == TCOD_LEX_STRING ) { - /* entity type name */ - name=TCOD_strdup(lex->tok); - TCOD_lex_parse(lex); - } - if ( strcmp(lex->tok,"{") != 0 ) { - TCOD_parser_error("Parser::parseEntity : '{' expected"); - return false; - } - TCOD_lex_parse(lex); - while ( strcmp(lex->tok,"}") != 0 ) { - bool found=false; - char **iflag; - bool dynStruct=false; - TCOD_value_type_t dynType = TCOD_TYPE_NONE; - if ( lex->token_type == TCOD_LEX_KEYWORD ) { - /* dynamic property declaration */ - if ( strcmp(lex->tok,"bool") == 0 ) dynType=TCOD_TYPE_BOOL; - else if ( strcmp(lex->tok,"char") == 0 ) dynType=TCOD_TYPE_CHAR; - else if ( strcmp(lex->tok,"int") == 0 ) dynType=TCOD_TYPE_INT; - else if ( strcmp(lex->tok,"float") == 0 ) dynType=TCOD_TYPE_FLOAT; - else if ( strcmp(lex->tok,"string") == 0 ) dynType=TCOD_TYPE_STRING; - else if ( strcmp(lex->tok,"color") == 0 ) dynType=TCOD_TYPE_COLOR; - else if ( strcmp(lex->tok,"dice") == 0 ) dynType=TCOD_TYPE_DICE; - else if ( strcmp(lex->tok,"struct") == 0 ) dynStruct=true; - else { - TCOD_parser_error("Parser::parseEntity : dynamic declaration of '%s' not supported",lex->tok); - return false; - } - /* TODO : dynamically declared sub-structures */ - TCOD_lex_parse(lex); - if ( strcmp(lex->tok,"[") == 0 ) { - if ( dynType == TCOD_TYPE_NONE ) { - TCOD_parser_error("Parser::parseEntity : unexpected symbol '['"); - return false; - } - TCOD_lex_parse(lex); - if ( strcmp(lex->tok,"]") != 0 ) { - TCOD_parser_error("Parser::parseEntity : syntax error. ']' expected instead of '%s'",lex->tok); - return false; - } - dynType |= TCOD_TYPE_LIST; - TCOD_lex_parse(lex); - } - } - /* parse entity type content */ - if ( lex->token_type != TCOD_LEX_IDEN ) { - TCOD_parser_error("Parser::parseEntity : identifier expected"); - return false; - } - /* is it a flag ? */ - if (! dynStruct && dynType == TCOD_TYPE_NONE) { - for (iflag=(char **)TCOD_list_begin(def->flags);iflag!=(char **)TCOD_list_end(def->flags); iflag++) { - if ( strcmp(*iflag,lex->tok) == 0 ) { - found=true; - if (!listener->new_flag(lex->tok)) return false; - break; - } - } - } - if (!found && ! dynStruct) { - do { - /* is it a property ? */ - TCOD_struct_prop_t **iprop; - for (iprop=(TCOD_struct_prop_t **)TCOD_list_begin(def->props); iprop!=(TCOD_struct_prop_t **)TCOD_list_end(def->props);iprop++) { - if ( strcmp((*iprop)->name,lex->tok) == 0 ) { - char propname[BIG_NAME_LEN]; - string_copy(propname,lex->tok,BIG_NAME_LEN); - TCOD_lex_parse(lex); - if ( strcmp(lex->tok,"=") != 0 ) { - TCOD_parser_error("Parser::parseEntity : '=' expected"); - return false; - } - TCOD_lex_parse(lex); - if (!listener->new_property(propname,TCOD_struct_get_type(def,propname), - TCOD_parse_property_value(parser, (TCOD_parser_struct_t *)def,propname,true))) return false; - if ( lex->token_type == TCOD_LEX_ERROR ) return false; - found=true; - break; - } - } - if ( !found && dynType != TCOD_TYPE_NONE ) { - /* dynamically add a property to the current structure */ - TCOD_struct_add_property(def,lex->tok,dynType,false); - } - } while ( ! found && dynType != TCOD_TYPE_NONE); - } - if (! found ) { - /* is it a sub-entity type */ - char id[BIG_NAME_LEN*2 + 2]; - bool blockFound=false; - do { - TCOD_lex_t save; - char type[BIG_NAME_LEN]; - char *subname=NULL; - bool named=false; - TCOD_lex_savepoint(lex,&save); - string_copy(type,lex->tok,BIG_NAME_LEN); - strcpy(id,type); - if ( TCOD_lex_parse(lex) == TCOD_LEX_STRING ) { - /* # */ - TCOD_struct_int_t **sub; - strcat(id,"#"); - strcat(id,lex->tok); - named=true; - subname=TCOD_strdup(lex->tok); - TCOD_lex_restore(lex,&save); - for ( sub = (TCOD_struct_int_t **)TCOD_list_begin(def->structs); - sub != (TCOD_struct_int_t **)TCOD_list_end(def->structs); sub ++ ) { - if ( strcmp((*sub)->name,id) == 0 ) { - if (!listener->new_struct((TCOD_parser_struct_t *)(*sub),lex->tok)) return false; - if (!TCOD_parser_parse_entity(parser,*sub)) return false; - blockFound=true; - found=true; - break; - } - } - } else { - TCOD_lex_restore(lex,&save); - } - if (! blockFound ) { - /* alone */ - TCOD_struct_int_t **sub; - for ( sub = (TCOD_struct_int_t **)TCOD_list_begin(def->structs); - sub != (TCOD_struct_int_t **)TCOD_list_end(def->structs); sub ++ ) { - if ( strcmp((*sub)->name,type) == 0 ) { - if (!listener->new_struct((TCOD_parser_struct_t *)(*sub),subname)) return false; - if (!TCOD_parser_parse_entity(parser,*sub)) return false; - blockFound=true; - found=true; - break; - } - } - } - if (! blockFound && dynStruct ) { - /* unknown structure. auto-declaration */ - TCOD_struct_int_t **idef; - TCOD_struct_int_t *s=NULL; - for (idef=(TCOD_struct_int_t **)TCOD_list_begin(parser->structs); idef!=(TCOD_struct_int_t **)TCOD_list_end(parser->structs); idef ++) { - if ( strcmp((*idef)->name,id) == 0 ) { - s=*idef; - break; - } - } - if ( s == NULL && named ) { - /* look for general definition for entity # */ - for (idef=(TCOD_struct_int_t **)TCOD_list_begin(parser->structs); idef!=(TCOD_struct_int_t **)TCOD_list_end(parser->structs); idef ++) { - if ( strcmp((*idef)->name,type) == 0 ) { - s=*idef; - break; - } - } - } - if ( s == NULL ) { - /* dyn struct not found. create it */ - s = TCOD_parser_new_struct(parser,type); - } - TCOD_struct_add_structure(def,s); - } - } while (!blockFound && dynStruct ); - if (! blockFound ) { - TCOD_parser_error("Parser::parseEntity : entity type %s does not contain %s", - def->name,id); - return false; - } - } - TCOD_lex_parse(lex); - } - if (!listener->end_struct((TCOD_parser_struct_t *)def,name)) return false; - return true; -} - -/****************************************/ -/* generic parser */ -/****************************************/ - -TCOD_parser_t TCOD_parser_new(void) { - TCOD_parser_int_t *ent = (TCOD_parser_int_t*)calloc(1,sizeof(TCOD_parser_int_t)); - ent->structs=TCOD_list_new(); - return (TCOD_parser_t) ent; -} - -TCOD_value_type_t TCOD_parser_new_custom_type(TCOD_parser_t parser, TCOD_parser_custom_t custom_type_parser) { - TCOD_parser_int_t *p=(TCOD_parser_int_t *)parser; - TCOD_value_type_t type= TCOD_TYPE_CUSTOM00; - while ( p->customs[ type - TCOD_TYPE_CUSTOM00 ] && type < TCOD_TYPE_CUSTOM15 ) type=(TCOD_value_type_t)(type+1); - if ( p->customs[ type - TCOD_TYPE_CUSTOM00 ] ) { - /* no more custom types slots available */ - return TCOD_TYPE_NONE; - } - p->customs[type - TCOD_TYPE_CUSTOM00] = custom_type_parser; - return type; -} - -TCOD_parser_struct_t TCOD_parser_new_struct(TCOD_parser_t parser, char *name) { - TCOD_struct_int_t *ent = (TCOD_struct_int_t*)calloc(1,sizeof(TCOD_struct_int_t)); - ent->name=TCOD_strdup(name); - ent->flags=TCOD_list_new(); - ent->props=TCOD_list_new(); - ent->lists=TCOD_list_new(); - ent->structs=TCOD_list_new(); - TCOD_list_push(((TCOD_parser_int_t *)parser)->structs,ent); - return (TCOD_parser_struct_t )ent; -} - -void TCOD_parser_delete(TCOD_parser_t parser) { - TCOD_parser_int_t *p=(TCOD_parser_int_t *)parser; - TCOD_struct_int_t **idef; - TCOD_struct_prop_t **propCleanup; - - char *** listCleanup; - int listSize = 0; - - for (idef=(TCOD_struct_int_t **)TCOD_list_begin(p->structs); idef!= (TCOD_struct_int_t **)TCOD_list_end(p->structs); idef++) { - free((*idef)->name); - - for ( propCleanup = (TCOD_struct_prop_t**) TCOD_list_begin((*idef)->props); propCleanup != (TCOD_struct_prop_t**)TCOD_list_end((*idef)->props); propCleanup++ ) { - free((*propCleanup)->name); - } - TCOD_list_clear_and_delete((*idef)->props); - - - for ( listCleanup = (char ***) TCOD_list_begin((*idef)->lists); listCleanup != (char ***)TCOD_list_end((*idef)->lists); listCleanup++ ) { - while((*listCleanup)[listSize] != NULL) { - free((*listCleanup)[listSize]); - listSize++; - } - } - TCOD_list_clear_and_delete((*idef)->lists); - } - TCOD_list_clear_and_delete(p->structs); -} - -/* parse a file */ -static TCOD_list_t *default_props; -/* triggers callbacks in the listener for each event during parsing */ -void TCOD_parser_run(TCOD_parser_t parser, const char *filename, TCOD_parser_listener_t *_listener) { - TCOD_parser_int_t *p=(TCOD_parser_int_t *)parser; - if (! _listener && ! p->props ) p->props=TCOD_list_new(); - listener=_listener ? _listener : &default_listener; - default_props = p->props; - lex=TCOD_lex_new(symbols,keywords,"//","/*","*/",NULL,"\"",TCOD_LEX_FLAG_NESTING_COMMENT); - if (!TCOD_lex_set_data_file(lex,(char *)filename)) { - char buf[1024]; - sprintf(buf,"Fatal error : %s\n",TCOD_lex_get_last_error()); - listener->error(buf); - return; - } - while (1) { - bool named=false; - char id[ BIG_NAME_LEN*2 + 2 ]; - char type[ BIG_NAME_LEN ]; - TCOD_lex_t save; - TCOD_struct_int_t *def=NULL; - TCOD_struct_int_t **idef; - bool dynStruct=false; - TCOD_lex_parse(lex); - if ( lex->token_type == TCOD_LEX_EOF || lex->token_type == TCOD_LEX_ERROR ) break; - if ( lex->token_type == TCOD_LEX_KEYWORD ) { - if ( strcmp(lex->tok,"struct") == 0) { - /* level 0 dynamic structure declaration */ - dynStruct=true; - TCOD_lex_parse(lex); - } else { - TCOD_parser_error("Parser::parse : unexpected keyword '%s'",lex->tok); - return; - } - } - /* get entity type */ - if ( lex->token_type != TCOD_LEX_IDEN ) { - TCOD_parser_error("Parser::parse : identifier token expected"); - return; - } - string_copy(type,lex->tok,BIG_NAME_LEN); - strcpy(id,type); - TCOD_lex_savepoint(lex,&save); - if ( TCOD_lex_parse(lex) == TCOD_LEX_STRING ) { - /* named entity. id = # */ - strcat(id,"#"); - if ( strlen(lex->tok) >= BIG_NAME_LEN ) { - TCOD_parser_error("Parser::parse : name %s too long. Max %d characters", - lex->tok,BIG_NAME_LEN-1); - return; - } - strcat(id,lex->tok); - named=true; - } - TCOD_lex_restore(lex,&save); - do { - /* look for a definition for id */ - for (idef=(TCOD_struct_int_t **)TCOD_list_begin(p->structs); idef!=(TCOD_struct_int_t **)TCOD_list_end(p->structs); idef ++) { - if ( strcmp((*idef)->name,id) == 0 ) { - def=*idef; - break; - } - } - if ( def == NULL && named ) { - /* look for general definition for entity # */ - for (idef=(TCOD_struct_int_t **)TCOD_list_begin(p->structs); idef!=(TCOD_struct_int_t **)TCOD_list_end(p->structs); idef ++) { - if ( strcmp((*idef)->name,type) == 0 ) { - def=(*idef); - break; - } - } - } - if ( def == NULL && dynStruct ) { - /* dyn struct not found. create it */ - TCOD_parser_new_struct(parser,type); - } - } while ( def == NULL && dynStruct ); - if (def == NULL ) { - TCOD_parser_error("Parser::parse : unknown entity type %s",type); - return; - } else { - if (!listener->new_struct((TCOD_parser_struct_t)def,named ? strchr(id,'#')+1 : NULL )) return; - if (!TCOD_parser_parse_entity(p,def)) return; - } - } - if (lex->token_type == TCOD_LEX_ERROR) { - TCOD_parser_error("Parser::parse : error while parsing"); - return; - } - TCOD_lex_delete(lex); -} -/* default parser listener */ -typedef struct { - char *name; - TCOD_value_type_t type; - TCOD_value_t value; -} prop_t; -static char cur_prop_name[512]=""; -static bool default_new_struct(TCOD_parser_struct_t str,const char *name) { - if ( cur_prop_name[0] ) strcat(cur_prop_name,"."); - strcat(cur_prop_name,((TCOD_struct_int_t *)str)->name); - return true; -} - -static bool default_new_flag(const char *name) { - char tmp[512]; - prop_t *prop=(prop_t *)calloc(sizeof(prop_t),1); - sprintf(tmp,"%s.%s",cur_prop_name,name); - prop->name=TCOD_strdup(tmp); - prop->type=TCOD_TYPE_BOOL; - prop->value.b=true; - TCOD_list_push(default_props,prop); - return true; -} - -static bool default_new_property(const char *propname, TCOD_value_type_t type, TCOD_value_t value) { - char tmp[512]; - prop_t *prop=(prop_t *)calloc(sizeof(prop_t),1); - sprintf(tmp,"%s.%s",cur_prop_name,propname); - prop->name=TCOD_strdup(tmp); - prop->type=type; - prop->value=value; - TCOD_list_push(default_props,prop); - return true; -} - -static bool default_end_struct(TCOD_parser_struct_t str, const char *name) { - char *ptr=strrchr(cur_prop_name,'.'); - if ( ptr ) *ptr='\0'; - else cur_prop_name[0]='\0'; - return true; -} - -static void default_error(const char *msg) { - TCOD_fatal_nopar(msg); -} - -static const TCOD_value_t * TCOD_get_property(TCOD_parser_t parser, TCOD_value_type_t expectedType, const char *name) { - void **it; - char tmp[512],err[512]; - char *ptr,*curname; - TCOD_struct_int_t *str=NULL; - TCOD_value_type_t type; - TCOD_parser_int_t *p=(TCOD_parser_int_t *)parser; - if (! p->props ) return NULL; - for (it=TCOD_list_begin(p->props);it!=TCOD_list_end(p->props);it++) { - prop_t *prop=*((prop_t **)it); - if (strcmp(prop->name,name) == 0 ) { - /* property found. check type */ - if ( expectedType == TCOD_TYPE_STRING && prop->type >= TCOD_TYPE_VALUELIST00 - && prop->type <= TCOD_TYPE_VALUELIST15 ) return &prop->value; - if ( expectedType == TCOD_TYPE_CUSTOM00 && prop->type >= TCOD_TYPE_CUSTOM00 - && prop->type <= TCOD_TYPE_CUSTOM15 ) return &prop->value; - if (prop->type != expectedType ) { - sprintf(err,"Fatal error ! Try to read property '%s' width bad type\n",name); - default_error(err); - } - return &prop->value; - } - } - /* property not found. Check if it exists */ - strcpy(tmp,name); - ptr=strchr(tmp,'.'); - curname=tmp; - sprintf(err,"Fatal error ! Try to read unknown property '%s'\n",name); - while ( ptr ) { - bool found=false; - *ptr=0; - for (it=TCOD_list_begin(p->structs);!found && it!=TCOD_list_end(p->structs);it++) { - str=*((TCOD_struct_int_t **)it); - if ( strcmp(str->name,curname) == 0 ) found=true; - } - if ( ! found ) { - /* one of the structures is unknown */ - default_error(err); - } - curname=ptr+1; - ptr=strchr(curname,'.'); - } - if ( ! str ) { - /* no structure in name */ - default_error(err); - } - type = TCOD_struct_get_type((TCOD_parser_struct_t) str, curname); - if ( type == TCOD_TYPE_NONE ) { - /* property does not exist in structure */ - default_error(err); - } - /* optional property not defined in the file => ok */ - return NULL; -} - -bool TCOD_parser_has_property(TCOD_parser_t parser, const char *name) { - void **it; - TCOD_parser_int_t *p=(TCOD_parser_int_t *)parser; - if (! p->props ) return false; - for (it=TCOD_list_begin(p->props);it!=TCOD_list_end(p->props);it++) { - prop_t *prop=*((prop_t **)it); - if (strcmp(prop->name,name) == 0 ) { - return true; - } - } - return false; -} - -bool TCOD_parser_get_bool_property(TCOD_parser_t parser, const char *name) { - const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_BOOL,name); - return value ? value->b : false; -} - -int TCOD_parser_get_int_property(TCOD_parser_t parser, const char *name) { - const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_INT,name); - return value ? value->i : 0; -} - -int TCOD_parser_get_char_property(TCOD_parser_t parser, const char *name) { - const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_CHAR,name); - return value ? value->c : 0; -} - -float TCOD_parser_get_float_property(TCOD_parser_t parser, const char *name) { - const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_FLOAT,name); - return value ? value->f : 0.0f; -} - -const char * TCOD_parser_get_string_property(TCOD_parser_t parser, const char *name) { - const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_STRING,name); - return value ? value->s : NULL; -} - -TCOD_color_t TCOD_parser_get_color_property(TCOD_parser_t parser, const char *name) { - const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_COLOR,name); - return value ? value->col : TCOD_black; -} - -TCOD_dice_t TCOD_parser_get_dice_property(TCOD_parser_t parser, const char *name) { - static TCOD_dice_t default_dice={0,0,0.0f,0.0f}; - const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_DICE,name); - return value ? value->dice : default_dice; -} - -void TCOD_parser_get_dice_property_py(TCOD_parser_t parser, const char *name, TCOD_dice_t *dice) { - *dice=TCOD_parser_get_dice_property(parser,name); -} - -void * TCOD_parser_get_custom_property(TCOD_parser_t parser, const char *name) { - const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_CUSTOM00,name); - return value ? value->custom : NULL; -} - -TCOD_list_t TCOD_parser_get_list_property(TCOD_parser_t parser, const char *name, TCOD_value_type_t type) { - static TCOD_list_t empty_list=NULL; - const TCOD_value_t *value; - if (! empty_list ) empty_list=TCOD_list_new(); - value=TCOD_get_property(parser,TCOD_TYPE_LIST|type,name); - return value ? value->list : empty_list; -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "parser.h" + +#include +#include +#include +#include + +#include "libtcod_int.h" + +#define BIG_NAME_LEN 128 + +#define DEF_NAME(d) (((TCOD_struct_int_t *)d)->name) +#define DEF_FLAGS(d) (((TCOD_struct_int_t *)d)->flags) +#define DEF_PROPS(d) (((TCOD_struct_int_t *)d)->props) +#define DEF_LISTS(d) (((TCOD_struct_int_t *)d)->lists) + +/* definition property */ +typedef struct { + char *name; + TCOD_value_type_t value; + bool mandat; +} TCOD_struct_prop_t; + +static TCOD_lex_t *lex=NULL; + +static const char *symbols[] = { + "{","}","=","/","+","-","[","]",",","#",NULL +}; + +static const char *keywords[] = { + "struct","bool","char","int","float","string","color","dice",NULL +}; + +static TCOD_parser_listener_t *listener=NULL; + +static bool default_new_struct(TCOD_parser_struct_t str,const char *name); +static bool default_new_flag(const char *name); +static bool default_new_property(const char *propname, TCOD_value_type_t type, TCOD_value_t value); +static bool default_end_struct(TCOD_parser_struct_t str, const char *name); +static void default_error(const char *msg); + +static TCOD_parser_listener_t default_listener = { + default_new_struct, + default_new_flag, + default_new_property, + default_end_struct, + default_error +}; + +static bool string_copy(char *dest, char *source, int len) { + if ( source == NULL ) return false; + strncpy(dest,source,len); + dest[len-1]='\0'; + if ( strlen(source) >= (unsigned)len ) return false; + return true; +} + +void TCOD_parser_error(const char *msg, ...) { + char buf[2048] = ""; + char buf2[2048] = ""; + va_list ap; + va_start(ap,msg); + vsnprintf(buf, sizeof(buf) - 1, msg, ap); + va_end(ap); + snprintf(buf2, sizeof(buf2) - 1, + "error in %s line %d : %s", lex->filename, lex->file_line, buf); + listener->error(buf2); + lex->token_type = TCOD_LEX_ERROR; +} + +const char *TCOD_struct_get_name(TCOD_parser_struct_t def) { + return ((TCOD_struct_int_t *)def)->name; +} + +/* add a property to an entity definition */ +void TCOD_struct_add_property(TCOD_parser_struct_t def,const char *name,TCOD_value_type_t type, bool mandatory) { + TCOD_struct_prop_t *prop=(TCOD_struct_prop_t *)calloc(1,sizeof(TCOD_struct_prop_t)); + prop->name=TCOD_strdup(name); + prop->value=type; + prop->mandat=mandatory; + TCOD_list_push(DEF_PROPS(def),(void *)prop); +} + +/* add a list property to an entity definition */ +void TCOD_struct_add_list_property(TCOD_parser_struct_t def,const char *name,TCOD_value_type_t type, bool mandatory) { + TCOD_struct_add_property(def,name,type|TCOD_TYPE_LIST,mandatory); +} + +void TCOD_struct_add_value_list_sized(TCOD_parser_struct_t def,const char *name, const char **value_list, int size, bool mandatory) { + char ** newArray = NULL; + /* duplicate value list to avoid issues with C# garbage collector */ + TCOD_value_type_t type = (TCOD_value_type_t)((int)TCOD_TYPE_VALUELIST00 + TCOD_list_size(DEF_LISTS(def))); + int i = 0; + + if(size) newArray = calloc(size+1, sizeof(char*)); + + for(i = 0 ; i < size ; i++) + newArray[i] = TCOD_strdup(value_list[i]); + newArray[size] = NULL; + + TCOD_struct_add_property(def,name,type,mandatory); + TCOD_list_push(DEF_LISTS(def),(void *)newArray); +} + +/* add a value-list property to an entity definition */ +void TCOD_struct_add_value_list(TCOD_parser_struct_t def,const char *name, const char **value_list, bool mandatory) { + int size = 0; + if(value_list) + { + while(value_list[size] != NULL) + { + size++; + }; + } + TCOD_struct_add_value_list_sized(def, name, value_list, size, mandatory); +} + + +/* add a flag (simplified bool value) to an entity definition */ +/* a flag cannot be mandatory. if present => true, if omitted => false */ +void TCOD_struct_add_flag(TCOD_parser_struct_t def,const char *propname) { + TCOD_list_push(DEF_FLAGS(def),(void *)TCOD_strdup(propname)); +} + +/* add a sub-entity to an entity definition */ +void TCOD_struct_add_structure(TCOD_parser_struct_t def, TCOD_parser_struct_t sub_definition) { + TCOD_list_push(((TCOD_struct_int_t *)def)->structs,(const void *)sub_definition); +} + +/* check if given property is mandatory for this entity definition */ +bool TCOD_struct_is_mandatory(TCOD_parser_struct_t def, const char *propname) { + TCOD_struct_prop_t **iprop; + for (iprop=(TCOD_struct_prop_t **)TCOD_list_begin(DEF_PROPS(def)); iprop!=(TCOD_struct_prop_t **)TCOD_list_end(DEF_PROPS(def));iprop++) { + if ( strcmp((*iprop)->name,propname) == 0 ) return (*iprop)->mandat; + } + return false; +} + +/* returns the type of given property */ +/* NONE if the property does not exist */ +TCOD_value_type_t TCOD_struct_get_type(TCOD_parser_struct_t def, const char *propname) { + TCOD_struct_prop_t **iprop; + char **iflag; + for (iprop=(TCOD_struct_prop_t **)TCOD_list_begin(DEF_PROPS(def)); iprop!=(TCOD_struct_prop_t **)TCOD_list_end(DEF_PROPS(def));iprop++) { + if ( strcmp((*iprop)->name,propname) == 0 ) return (*iprop)->value; + } + for (iflag=(char **)TCOD_list_begin(DEF_FLAGS(def)); iflag!=(char **)TCOD_list_end(DEF_FLAGS(def));iflag++) { + if ( strcmp((*iflag),propname) == 0 ) return TCOD_TYPE_BOOL; + } + return TCOD_TYPE_NONE; +} + +TCOD_value_t TCOD_parse_bool_value(void) { + TCOD_value_t ret; + if ( strcmp(lex->tok,"true") == 0 ) ret.b=true; + else if ( strcmp(lex->tok,"false") == 0 ) ret.b=false; + else TCOD_parser_error("parseBoolValue : unknown value %s for bool. 'true' or 'false' expected",lex->tok); + return ret; +} + +TCOD_value_t TCOD_parse_char_value(void) { + TCOD_value_t ret; + if ( lex->token_type != TCOD_LEX_CHAR && lex->token_type != TCOD_LEX_INTEGER ) + TCOD_parser_error("parseCharValue : char constant expected instead of '%s'",lex->tok); + ret.c=lex->token_int_val; + return ret; +} + +TCOD_value_t TCOD_parse_integer_value(void) { + TCOD_value_t ret; + if ( lex->token_type != TCOD_LEX_INTEGER ) + TCOD_parser_error("parseIntegerValue : integer constant expected instead of '%s'",lex->tok); + ret.i=lex->token_int_val; + return ret; +} + +TCOD_value_t TCOD_parse_float_value(void) { + TCOD_value_t ret; + if ( lex->token_type != TCOD_LEX_FLOAT && lex->token_type != TCOD_LEX_INTEGER ) + TCOD_parser_error("parseFloatValue : float constant expected instead of '%s'",lex->tok); + if ( lex->token_type == TCOD_LEX_FLOAT ) ret.f=lex->token_float_val; + else ret.f=(float)lex->token_int_val; + return ret; +} + +TCOD_value_t TCOD_parse_string_value(void) { + TCOD_value_t ret; + TCOD_list_t l; + bool end=false; + char **s; + size_t slen=0; + l=TCOD_list_new(); + if ( lex->token_type != TCOD_LEX_STRING ) TCOD_parser_error("parseStringValue : string constant expected instead of '%s'",lex->tok); + while ( !end ) { + TCOD_lex_t save; + TCOD_list_push(l,(void *)TCOD_strdup(lex->tok)); + TCOD_lex_savepoint(lex,&save); + if (TCOD_lex_parse(lex) != TCOD_LEX_STRING) { + end=true; + TCOD_lex_restore(lex,&save); + } + } + for (s=(char **)TCOD_list_begin(l); s != (char **)TCOD_list_end(l); s++ ) { + slen += strlen(*s); + } + ret.s=(char *)calloc(sizeof(char),slen+1); + for (s=(char **)TCOD_list_begin(l); s != (char **)TCOD_list_end(l); s++ ) { + strcat(ret.s,*s); + free(*s); + } + TCOD_list_delete(l); + return ret; +} + +TCOD_value_t TCOD_parse_color_value(void) { + TCOD_value_t ret; + if ( lex->token_type == TCOD_LEX_SYMBOL && lex->tok[0]=='#') { + char tmp[128]=""; + int tok=TCOD_lex_parse(lex); + /* format : col = #FFFFFF */ + strcat(tmp,"#"); + if ( tok == TCOD_LEX_IDEN || tok == TCOD_LEX_INTEGER ) { + strcat(tmp,lex->tok); + strcpy(lex->tok,tmp); + if ( strlen(lex->tok) < 7 && tok == TCOD_LEX_INTEGER ) { + /* special case of #12AABB => symbol # + + integer 12 + iden AABB */ + tok=TCOD_lex_parse(lex); + if ( tok == TCOD_LEX_IDEN ) { + strcat(tmp,lex->tok); + strcpy(lex->tok,tmp); + } + } + lex->token_type = TCOD_LEX_STRING; + } + } + if ( lex->token_type != TCOD_LEX_STRING ) TCOD_parser_error("parseColorValue : string constant expected instead of '%s'",lex->tok); + if (lex->tok[0] == '#') { + int r,g,b; + if ( strlen(lex->tok) != 7 ) TCOD_parser_error("parseColorValue : bad color format. '#rrggbb' expected instead of '%s'",lex->tok); + /* web format : #rrggbb */ + r=(TCOD_lex_hextoint(lex->tok[1])<<4) + TCOD_lex_hextoint(lex->tok[2]); + g=(TCOD_lex_hextoint(lex->tok[3])<<4) + TCOD_lex_hextoint(lex->tok[4]); + b=(TCOD_lex_hextoint(lex->tok[5])<<4) + TCOD_lex_hextoint(lex->tok[6]); + ret.col.r=r; + ret.col.g=g; + ret.col.b=b; + } else { + /* standard format : rrr,ggg,bbb */ + char *begin=lex->tok; + char *end=strchr(begin,','); + bool ok=true; + if (! end) ok=false; + else { + *end=0; + ret.col.r=atoi(begin); + begin=end+1; + end=strchr(begin,','); + if ( !end ) ok=false; + else { + ret.col.g=atoi(begin); + begin=end+1; + ret.col.b=atoi(begin); + } + + } + if (!ok) TCOD_parser_error("parseColorValue : bad color format 'rrr,ggg,bbb' expected instead of '%s'",lex->tok); + } + return ret; +} + +TCOD_value_t TCOD_parse_dice_value(void) { + /* dice format : [(x|*)](D|d)[(+|-)] */ + TCOD_value_t ret; + bool minus=false; + char *begin; + char *ptr; + ret.dice.multiplier=1.0f; + ret.dice.addsub=0.0f; + begin=lex->tok; + ptr=strchr(begin,'x'); + if (! ptr ) ptr=strchr(begin,'*'); + if ( ptr ) { + /* parse multiplier */ + *ptr=0; + ret.dice.multiplier=(float)atof(lex->tok); + begin=ptr+1; + } + ptr=strchr(begin,'D'); + if (!ptr ) ptr=strchr(begin,'d'); + if (! ptr ) TCOD_parser_error("parseDiceValue : bad dice format. [(x|*)](D|d)[(+|-)] expected instead of '%s'",lex->tok); + *ptr=0; + /* parse nb_rolls */ + ret.dice.nb_rolls=atoi(begin); + begin=ptr+1; + ptr=strchr(begin,'+'); + if (! ptr) { + ptr = strchr(begin,'-'); + if ( ptr ) minus=true; + } + if (ptr) *ptr=0; + /* parse nb_faces */ + ret.dice.nb_faces=atoi(begin); + if ( ptr ) { + /* parse addsub */ + begin=ptr+1; + ret.dice.addsub=(float)atof(begin); + if ( minus ) ret.dice.addsub=-ret.dice.addsub; + } + return ret; +} + +TCOD_value_t TCOD_parse_value_list_value(TCOD_struct_int_t *def,int listnum) { + TCOD_value_t ret; + int i=0; + char *value; + char **value_list=TCOD_list_get(def->lists,listnum); + if ( lex->token_type != TCOD_LEX_STRING) TCOD_parser_error("parseValueListValue : string constant expected instead of '%s'",lex->tok); + value= value_list[i]; + while ( value ) { + if ( strcmp(lex->tok,value) == 0 ) break; + i++; + value=value_list[i]; + } + if (! value ) TCOD_parser_error("parseValueListValue : incorrect value '%s'",lex->tok); + ret.s = value; + return ret; +} + + +TCOD_value_t TCOD_parse_property_value(TCOD_parser_int_t *parser, TCOD_parser_struct_t def, char *propname, bool list) { + TCOD_value_type_t type=TCOD_struct_get_type(def,propname); + TCOD_value_t ret={0}; + if (! list ) type &= ~ TCOD_TYPE_LIST; + if ( type & TCOD_TYPE_LIST ) { + type &= ~ TCOD_TYPE_LIST; + if ( strcmp(lex->tok,"[") != 0 ) { + TCOD_parser_error("'[' expected for list value instead of '%s'",lex->tok); + } + ret.list=TCOD_list_new(); + do { + TCOD_value_t val; + int tok=TCOD_lex_parse(lex); + if ( tok == TCOD_LEX_EOF || tok == TCOD_LEX_ERROR ) { + TCOD_parser_error("Missing ']' in list value"); + } + val=TCOD_parse_property_value(parser,def,propname,false); + if ( type == TCOD_TYPE_STRING || (type >= TCOD_TYPE_VALUELIST00 && type <= TCOD_TYPE_VALUELIST15 ) ) { + TCOD_list_push(ret.list,TCOD_strdup(val.s)); + } else { + TCOD_list_push(ret.list,val.custom); + } + TCOD_lex_parse(lex); + if ( strcmp(lex->tok,",") != 0 && strcmp(lex->tok,"]") != 0 ) { + TCOD_parser_error("',' or ']' expected in list value instead of '%s'",lex->tok); + } + } while ( strcmp(lex->tok,"]") != 0 ); + } else { + switch (type) { + case TCOD_TYPE_BOOL : return TCOD_parse_bool_value(); break; + case TCOD_TYPE_CHAR : return TCOD_parse_char_value(); break; + case TCOD_TYPE_INT : return TCOD_parse_integer_value(); break; + case TCOD_TYPE_FLOAT : return TCOD_parse_float_value(); break; + case TCOD_TYPE_STRING : return TCOD_parse_string_value(); break; + case TCOD_TYPE_COLOR : return TCOD_parse_color_value(); break; + case TCOD_TYPE_DICE : return TCOD_parse_dice_value(); break; + case TCOD_TYPE_VALUELIST00 : + case TCOD_TYPE_VALUELIST01 : + case TCOD_TYPE_VALUELIST02 : + case TCOD_TYPE_VALUELIST03 : + case TCOD_TYPE_VALUELIST04 : + case TCOD_TYPE_VALUELIST05 : + case TCOD_TYPE_VALUELIST06 : + case TCOD_TYPE_VALUELIST07 : + case TCOD_TYPE_VALUELIST08 : + case TCOD_TYPE_VALUELIST09 : + case TCOD_TYPE_VALUELIST10 : + case TCOD_TYPE_VALUELIST11 : + case TCOD_TYPE_VALUELIST12 : + case TCOD_TYPE_VALUELIST13 : + case TCOD_TYPE_VALUELIST14 : + case TCOD_TYPE_VALUELIST15 : { + int listnum = type - TCOD_TYPE_VALUELIST00; + return TCOD_parse_value_list_value((TCOD_struct_int_t *)def,listnum); break; + } + case TCOD_TYPE_CUSTOM00 : + case TCOD_TYPE_CUSTOM01 : + case TCOD_TYPE_CUSTOM02 : + case TCOD_TYPE_CUSTOM03 : + case TCOD_TYPE_CUSTOM04 : + case TCOD_TYPE_CUSTOM05 : + case TCOD_TYPE_CUSTOM06 : + case TCOD_TYPE_CUSTOM07 : + case TCOD_TYPE_CUSTOM08 : + case TCOD_TYPE_CUSTOM09 : + case TCOD_TYPE_CUSTOM10 : + case TCOD_TYPE_CUSTOM11 : + case TCOD_TYPE_CUSTOM12 : + case TCOD_TYPE_CUSTOM13 : + case TCOD_TYPE_CUSTOM14 : + case TCOD_TYPE_CUSTOM15 : + if ( parser->customs[type - TCOD_TYPE_CUSTOM00] ) { + return parser->customs[type-TCOD_TYPE_CUSTOM00](lex,listener,def,propname); + } else { + TCOD_parser_error("parse_property_value : no custom parser for property type %d for entity %s prop %s", + type,DEF_NAME(def),propname); + } + break; + default : TCOD_parser_error("parse_property_value : unknown property type %d for entity %s prop %s", + type,DEF_NAME(def),propname); break; + } + } + return ret; +} + +static bool TCOD_parser_parse_entity(TCOD_parser_int_t *parser, TCOD_struct_int_t *def) { + char *name=NULL; + if ( TCOD_lex_parse(lex) == TCOD_LEX_STRING ) { + /* entity type name */ + name=TCOD_strdup(lex->tok); + TCOD_lex_parse(lex); + } + if ( strcmp(lex->tok,"{") != 0 ) { + TCOD_parser_error("Parser::parseEntity : '{' expected"); + return false; + } + TCOD_lex_parse(lex); + while ( strcmp(lex->tok,"}") != 0 ) { + bool found=false; + char **iflag; + bool dynStruct=false; + TCOD_value_type_t dynType = TCOD_TYPE_NONE; + if ( lex->token_type == TCOD_LEX_KEYWORD ) { + /* dynamic property declaration */ + if ( strcmp(lex->tok,"bool") == 0 ) dynType=TCOD_TYPE_BOOL; + else if ( strcmp(lex->tok,"char") == 0 ) dynType=TCOD_TYPE_CHAR; + else if ( strcmp(lex->tok,"int") == 0 ) dynType=TCOD_TYPE_INT; + else if ( strcmp(lex->tok,"float") == 0 ) dynType=TCOD_TYPE_FLOAT; + else if ( strcmp(lex->tok,"string") == 0 ) dynType=TCOD_TYPE_STRING; + else if ( strcmp(lex->tok,"color") == 0 ) dynType=TCOD_TYPE_COLOR; + else if ( strcmp(lex->tok,"dice") == 0 ) dynType=TCOD_TYPE_DICE; + else if ( strcmp(lex->tok,"struct") == 0 ) dynStruct=true; + else { + TCOD_parser_error("Parser::parseEntity : dynamic declaration of '%s' not supported",lex->tok); + return false; + } + /* TODO : dynamically declared sub-structures */ + TCOD_lex_parse(lex); + if ( strcmp(lex->tok,"[") == 0 ) { + if ( dynType == TCOD_TYPE_NONE ) { + TCOD_parser_error("Parser::parseEntity : unexpected symbol '['"); + return false; + } + TCOD_lex_parse(lex); + if ( strcmp(lex->tok,"]") != 0 ) { + TCOD_parser_error("Parser::parseEntity : syntax error. ']' expected instead of '%s'",lex->tok); + return false; + } + dynType |= TCOD_TYPE_LIST; + TCOD_lex_parse(lex); + } + } + /* parse entity type content */ + if ( lex->token_type != TCOD_LEX_IDEN ) { + TCOD_parser_error("Parser::parseEntity : identifier expected"); + return false; + } + /* is it a flag ? */ + if (! dynStruct && dynType == TCOD_TYPE_NONE) { + for (iflag=(char **)TCOD_list_begin(def->flags);iflag!=(char **)TCOD_list_end(def->flags); iflag++) { + if ( strcmp(*iflag,lex->tok) == 0 ) { + found=true; + if (!listener->new_flag(lex->tok)) return false; + break; + } + } + } + if (!found && ! dynStruct) { + do { + /* is it a property ? */ + TCOD_struct_prop_t **iprop; + for (iprop=(TCOD_struct_prop_t **)TCOD_list_begin(def->props); iprop!=(TCOD_struct_prop_t **)TCOD_list_end(def->props);iprop++) { + if ( strcmp((*iprop)->name,lex->tok) == 0 ) { + char propname[BIG_NAME_LEN]; + string_copy(propname,lex->tok,BIG_NAME_LEN); + TCOD_lex_parse(lex); + if ( strcmp(lex->tok,"=") != 0 ) { + TCOD_parser_error("Parser::parseEntity : '=' expected"); + return false; + } + TCOD_lex_parse(lex); + if (!listener->new_property(propname,TCOD_struct_get_type(def,propname), + TCOD_parse_property_value(parser, def, propname, true))) return false; + if ( lex->token_type == TCOD_LEX_ERROR ) return false; + found=true; + break; + } + } + if ( !found && dynType != TCOD_TYPE_NONE ) { + /* dynamically add a property to the current structure */ + TCOD_struct_add_property(def,lex->tok,dynType,false); + } + } while ( ! found && dynType != TCOD_TYPE_NONE); + } + if (! found ) { + /* is it a sub-entity type */ + char id[BIG_NAME_LEN*2 + 2]; + bool blockFound=false; + do { + TCOD_lex_t save; + char type[BIG_NAME_LEN]; + char *subname=NULL; + bool named=false; + TCOD_lex_savepoint(lex,&save); + string_copy(type,lex->tok,BIG_NAME_LEN); + strcpy(id,type); + if ( TCOD_lex_parse(lex) == TCOD_LEX_STRING ) { + /* # */ + TCOD_struct_int_t **sub; + strcat(id,"#"); + strcat(id,lex->tok); + named=true; + subname=TCOD_strdup(lex->tok); + TCOD_lex_restore(lex,&save); + for ( sub = (TCOD_struct_int_t **)TCOD_list_begin(def->structs); + sub != (TCOD_struct_int_t **)TCOD_list_end(def->structs); sub ++ ) { + if ( strcmp((*sub)->name,id) == 0 ) { + if (!listener->new_struct(*sub, lex->tok)) return false; + if (!TCOD_parser_parse_entity(parser,*sub)) return false; + blockFound=true; + found=true; + break; + } + } + } else { + TCOD_lex_restore(lex,&save); + } + if (! blockFound ) { + /* alone */ + TCOD_struct_int_t **sub; + for ( sub = (TCOD_struct_int_t **)TCOD_list_begin(def->structs); + sub != (TCOD_struct_int_t **)TCOD_list_end(def->structs); sub ++ ) { + if ( strcmp((*sub)->name,type) == 0 ) { + if (!listener->new_struct(*sub, subname)) return false; + if (!TCOD_parser_parse_entity(parser,*sub)) return false; + blockFound=true; + found=true; + break; + } + } + } + if (! blockFound && dynStruct ) { + /* unknown structure. auto-declaration */ + TCOD_struct_int_t **idef; + TCOD_struct_int_t *s=NULL; + for (idef=(TCOD_struct_int_t **)TCOD_list_begin(parser->structs); idef!=(TCOD_struct_int_t **)TCOD_list_end(parser->structs); idef ++) { + if ( strcmp((*idef)->name,id) == 0 ) { + s=*idef; + break; + } + } + if ( s == NULL && named ) { + /* look for general definition for entity # */ + for (idef=(TCOD_struct_int_t **)TCOD_list_begin(parser->structs); idef!=(TCOD_struct_int_t **)TCOD_list_end(parser->structs); idef ++) { + if ( strcmp((*idef)->name,type) == 0 ) { + s=*idef; + break; + } + } + } + if ( s == NULL ) { + /* dyn struct not found. create it */ + s = TCOD_parser_new_struct(parser,type); + } + TCOD_struct_add_structure(def,s); + } + } while (!blockFound && dynStruct ); + if (! blockFound ) { + TCOD_parser_error("Parser::parseEntity : entity type %s does not contain %s", + def->name,id); + return false; + } + } + TCOD_lex_parse(lex); + } + if (!listener->end_struct(def, name)) return false; + return true; +} + +/****************************************/ +/* generic parser */ +/****************************************/ + +TCOD_parser_t TCOD_parser_new(void) { + TCOD_parser_int_t *ent = (TCOD_parser_int_t*)calloc(1,sizeof(TCOD_parser_int_t)); + ent->structs=TCOD_list_new(); + return (TCOD_parser_t) ent; +} + +TCOD_value_type_t TCOD_parser_new_custom_type(TCOD_parser_t parser, TCOD_parser_custom_t custom_type_parser) { + TCOD_parser_int_t *p=(TCOD_parser_int_t *)parser; + TCOD_value_type_t type= TCOD_TYPE_CUSTOM00; + while ( p->customs[ type - TCOD_TYPE_CUSTOM00 ] && type < TCOD_TYPE_CUSTOM15 ) type=(TCOD_value_type_t)(type+1); + if ( p->customs[ type - TCOD_TYPE_CUSTOM00 ] ) { + /* no more custom types slots available */ + return TCOD_TYPE_NONE; + } + p->customs[type - TCOD_TYPE_CUSTOM00] = custom_type_parser; + return type; +} + +TCOD_parser_struct_t TCOD_parser_new_struct(TCOD_parser_t parser, const char *name) { + TCOD_struct_int_t *ent = (TCOD_struct_int_t*)calloc(1,sizeof(TCOD_struct_int_t)); + ent->name=TCOD_strdup(name); + ent->flags=TCOD_list_new(); + ent->props=TCOD_list_new(); + ent->lists=TCOD_list_new(); + ent->structs=TCOD_list_new(); + TCOD_list_push(((TCOD_parser_int_t *)parser)->structs,ent); + return (TCOD_parser_struct_t )ent; +} + +void TCOD_parser_delete(TCOD_parser_t parser) { + TCOD_parser_int_t *p=(TCOD_parser_int_t *)parser; + TCOD_struct_int_t **idef; + TCOD_struct_prop_t **propCleanup; + + char *** listCleanup; + int listSize = 0; + + for (idef=(TCOD_struct_int_t **)TCOD_list_begin(p->structs); idef!= (TCOD_struct_int_t **)TCOD_list_end(p->structs); idef++) { + free((*idef)->name); + + for ( propCleanup = (TCOD_struct_prop_t**) TCOD_list_begin((*idef)->props); propCleanup != (TCOD_struct_prop_t**)TCOD_list_end((*idef)->props); propCleanup++ ) { + free((*propCleanup)->name); + } + TCOD_list_clear_and_delete((*idef)->props); + + + for ( listCleanup = (char ***) TCOD_list_begin((*idef)->lists); listCleanup != (char ***)TCOD_list_end((*idef)->lists); listCleanup++ ) { + while((*listCleanup)[listSize] != NULL) { + free((*listCleanup)[listSize]); + listSize++; + } + } + TCOD_list_clear_and_delete((*idef)->lists); + } + TCOD_list_clear_and_delete(p->structs); +} + +/* parse a file */ +static struct TCOD_List *default_props; +/* triggers callbacks in the listener for each event during parsing */ +void TCOD_parser_run(TCOD_parser_t parser, const char *filename, TCOD_parser_listener_t *_listener) { + TCOD_parser_int_t *p=(TCOD_parser_int_t *)parser; + if (! _listener && ! p->props ) p->props=TCOD_list_new(); + listener=_listener ? _listener : &default_listener; + default_props = p->props; + lex=TCOD_lex_new(symbols,keywords,"//","/*","*/",NULL,"\"",TCOD_LEX_FLAG_NESTING_COMMENT); + if (!TCOD_lex_set_data_file(lex,(char *)filename)) { + char buf[1024]; + sprintf(buf,"Fatal error : %s\n",TCOD_lex_get_last_error()); + listener->error(buf); + return; + } + while (1) { + bool named=false; + char id[ BIG_NAME_LEN*2 + 2 ]; + char type[ BIG_NAME_LEN ]; + TCOD_lex_t save; + TCOD_struct_int_t *def=NULL; + TCOD_struct_int_t **idef; + bool dynStruct=false; + TCOD_lex_parse(lex); + if ( lex->token_type == TCOD_LEX_EOF || lex->token_type == TCOD_LEX_ERROR ) break; + if ( lex->token_type == TCOD_LEX_KEYWORD ) { + if ( strcmp(lex->tok,"struct") == 0) { + /* level 0 dynamic structure declaration */ + dynStruct=true; + TCOD_lex_parse(lex); + } else { + TCOD_parser_error("Parser::parse : unexpected keyword '%s'",lex->tok); + return; + } + } + /* get entity type */ + if ( lex->token_type != TCOD_LEX_IDEN ) { + TCOD_parser_error("Parser::parse : identifier token expected"); + return; + } + string_copy(type,lex->tok,BIG_NAME_LEN); + strcpy(id,type); + TCOD_lex_savepoint(lex,&save); + if ( TCOD_lex_parse(lex) == TCOD_LEX_STRING ) { + /* named entity. id = # */ + strcat(id,"#"); + if ( strlen(lex->tok) >= BIG_NAME_LEN ) { + TCOD_parser_error("Parser::parse : name %s too long. Max %d characters", + lex->tok,BIG_NAME_LEN-1); + return; + } + strcat(id,lex->tok); + named=true; + } + TCOD_lex_restore(lex,&save); + do { + /* look for a definition for id */ + for (idef=(TCOD_struct_int_t **)TCOD_list_begin(p->structs); idef!=(TCOD_struct_int_t **)TCOD_list_end(p->structs); idef ++) { + if ( strcmp((*idef)->name,id) == 0 ) { + def=*idef; + break; + } + } + if ( def == NULL && named ) { + /* look for general definition for entity # */ + for (idef=(TCOD_struct_int_t **)TCOD_list_begin(p->structs); idef!=(TCOD_struct_int_t **)TCOD_list_end(p->structs); idef ++) { + if ( strcmp((*idef)->name,type) == 0 ) { + def=(*idef); + break; + } + } + } + if ( def == NULL && dynStruct ) { + /* dyn struct not found. create it */ + TCOD_parser_new_struct(parser,type); + } + } while ( def == NULL && dynStruct ); + if (def == NULL ) { + TCOD_parser_error("Parser::parse : unknown entity type %s",type); + return; + } else { + if (!listener->new_struct((TCOD_parser_struct_t)def,named ? strchr(id,'#')+1 : NULL )) return; + if (!TCOD_parser_parse_entity(p,def)) return; + } + } + if (lex->token_type == TCOD_LEX_ERROR) { + TCOD_parser_error("Parser::parse : error while parsing"); + return; + } + TCOD_lex_delete(lex); +} +/* default parser listener */ +typedef struct { + char *name; + TCOD_value_type_t type; + TCOD_value_t value; +} prop_t; +static char cur_prop_name[512]=""; +static bool default_new_struct(TCOD_parser_struct_t str,const char *name) { + (void)name; // Ignored parameters. + if ( cur_prop_name[0] ) strcat(cur_prop_name,"."); + strcat(cur_prop_name,((TCOD_struct_int_t *)str)->name); + return true; +} + +static bool default_new_flag(const char *name) { + char tmp[512] = ""; + prop_t *prop=(prop_t *)calloc(sizeof(prop_t),1); + snprintf(tmp, sizeof(tmp) - 1, "%s.%s", cur_prop_name, name); + prop->name=TCOD_strdup(tmp); + prop->type=TCOD_TYPE_BOOL; + prop->value.b=true; + TCOD_list_push(default_props,prop); + return true; +} + +static bool default_new_property(const char *propname, TCOD_value_type_t type, TCOD_value_t value) { + char tmp[512] = ""; + prop_t *prop=(prop_t *)calloc(sizeof(prop_t),1); + snprintf(tmp, sizeof(tmp) - 1, "%s.%s", cur_prop_name, propname); + prop->name=TCOD_strdup(tmp); + prop->type=type; + prop->value=value; + TCOD_list_push(default_props,prop); + return true; +} + +static bool default_end_struct(TCOD_parser_struct_t str, const char *name) { + (void)str; (void)name; // Ignored parameters. + char *ptr=strrchr(cur_prop_name,'.'); + if ( ptr ) *ptr='\0'; + else cur_prop_name[0]='\0'; + return true; +} + +static void default_error(const char *msg) { + TCOD_fatal_nopar(msg); +} + +static const TCOD_value_t * TCOD_get_property(TCOD_parser_t parser, TCOD_value_type_t expectedType, const char *name) { + void **it; + char tmp[512],err[512]; + char *ptr,*curname; + TCOD_struct_int_t *str=NULL; + TCOD_value_type_t type; + TCOD_parser_int_t *p=(TCOD_parser_int_t *)parser; + if (! p->props ) return NULL; + for (it=TCOD_list_begin(p->props);it!=TCOD_list_end(p->props);it++) { + prop_t *prop=*((prop_t **)it); + if (strcmp(prop->name,name) == 0 ) { + /* property found. check type */ + if ( expectedType == TCOD_TYPE_STRING && prop->type >= TCOD_TYPE_VALUELIST00 + && prop->type <= TCOD_TYPE_VALUELIST15 ) return &prop->value; + if ( expectedType == TCOD_TYPE_CUSTOM00 && prop->type >= TCOD_TYPE_CUSTOM00 + && prop->type <= TCOD_TYPE_CUSTOM15 ) return &prop->value; + if (prop->type != expectedType ) { + sprintf(err,"Fatal error ! Try to read property '%s' width bad type\n",name); + default_error(err); + } + return &prop->value; + } + } + /* property not found. Check if it exists */ + strcpy(tmp,name); + ptr=strchr(tmp,'.'); + curname=tmp; + sprintf(err,"Fatal error ! Try to read unknown property '%s'\n",name); + while ( ptr ) { + bool found=false; + *ptr=0; + for (it=TCOD_list_begin(p->structs);!found && it!=TCOD_list_end(p->structs);it++) { + str=*((TCOD_struct_int_t **)it); + if ( strcmp(str->name,curname) == 0 ) found=true; + } + if ( ! found ) { + /* one of the structures is unknown */ + default_error(err); + } + curname=ptr+1; + ptr=strchr(curname,'.'); + } + if ( ! str ) { + /* no structure in name */ + default_error(err); + } + type = TCOD_struct_get_type((TCOD_parser_struct_t) str, curname); + if ( type == TCOD_TYPE_NONE ) { + /* property does not exist in structure */ + default_error(err); + } + /* optional property not defined in the file => ok */ + return NULL; +} + +bool TCOD_parser_has_property(TCOD_parser_t parser, const char *name) { + void **it; + TCOD_parser_int_t *p=(TCOD_parser_int_t *)parser; + if (! p->props ) return false; + for (it=TCOD_list_begin(p->props);it!=TCOD_list_end(p->props);it++) { + prop_t *prop=*((prop_t **)it); + if (strcmp(prop->name,name) == 0 ) { + return true; + } + } + return false; +} + +bool TCOD_parser_get_bool_property(TCOD_parser_t parser, const char *name) { + const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_BOOL,name); + return value ? value->b : false; +} + +int TCOD_parser_get_int_property(TCOD_parser_t parser, const char *name) { + const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_INT,name); + return value ? value->i : 0; +} + +int TCOD_parser_get_char_property(TCOD_parser_t parser, const char *name) { + const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_CHAR,name); + return value ? value->c : 0; +} + +float TCOD_parser_get_float_property(TCOD_parser_t parser, const char *name) { + const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_FLOAT,name); + return value ? value->f : 0.0f; +} + +const char * TCOD_parser_get_string_property(TCOD_parser_t parser, const char *name) { + const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_STRING,name); + return value ? value->s : NULL; +} + +TCOD_color_t TCOD_parser_get_color_property(TCOD_parser_t parser, const char *name) { + const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_COLOR,name); + return value ? value->col : TCOD_black; +} + +TCOD_dice_t TCOD_parser_get_dice_property(TCOD_parser_t parser, const char *name) { + static TCOD_dice_t default_dice={0,0,0.0f,0.0f}; + const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_DICE,name); + return value ? value->dice : default_dice; +} + +void TCOD_parser_get_dice_property_py(TCOD_parser_t parser, const char *name, TCOD_dice_t *dice) { + *dice=TCOD_parser_get_dice_property(parser,name); +} + +void * TCOD_parser_get_custom_property(TCOD_parser_t parser, const char *name) { + const TCOD_value_t *value=TCOD_get_property(parser,TCOD_TYPE_CUSTOM00,name); + return value ? value->custom : NULL; +} + +TCOD_list_t TCOD_parser_get_list_property(TCOD_parser_t parser, const char *name, TCOD_value_type_t type) { + static TCOD_list_t empty_list=NULL; + const TCOD_value_t *value; + if (! empty_list ) empty_list=TCOD_list_new(); + value=TCOD_get_property(parser,TCOD_TYPE_LIST|type,name); + return value ? value->list : empty_list; +} diff --git a/tcod_sys/libtcod/src/libtcod/path.cpp b/tcod_sys/libtcod/src/libtcod/path.cpp new file mode 100644 index 000000000..d08730392 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/path.cpp @@ -0,0 +1,152 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "path.hpp" + + +TCODPath::TCODPath(const TCODMap *map, float diagonalCost) { + data = TCOD_path_new_using_map(map->data, diagonalCost); +} + +TCODPath::~TCODPath() { + TCOD_path_delete(data); +} + +float TCOD_path_func(int xFrom, int yFrom, int xTo,int yTo, void *data) { + TCODPath::WrapperData *cppData = static_cast(data); + return cppData->listener->getWalkCost(xFrom,yFrom,xTo,yTo,cppData->userData); +} + +TCODPath::TCODPath( + int width, int height, + const ITCODPathCallback *listener, void *userData, float diagonalCost) +{ + cppData.listener = listener; + cppData.userData = userData; + data = TCOD_path_new_using_function( + width, height, + TCOD_path_func, static_cast(&cppData), diagonalCost); +} + + +bool TCODPath::compute(int ox, int oy, int dx, int dy) { + return TCOD_path_compute(data,ox,oy,dx,dy) != 0; +} + +bool TCODPath::walk(int *x, int *y, bool recalculateWhenNeeded) { + return TCOD_path_walk(data,x,y,recalculateWhenNeeded) != 0; +} + +bool TCODPath::isEmpty() const { + return TCOD_path_is_empty(data) != 0; +} + +void TCODPath::reverse() { + TCOD_path_reverse(data); +} + +int TCODPath::size() const { + return TCOD_path_size(data); +} + +void TCODPath::get(int index, int *x, int *y) const { + return TCOD_path_get(data,index,x,y); +} + +void TCODPath::getOrigin(int *x,int *y) const { + TCOD_path_get_origin(data,x,y); +} + +void TCODPath::getDestination(int *x,int *y) const { + TCOD_path_get_destination(data,x,y); +} + +// ----------------- // +// Dijkstra // +// written by Mingos // +// ----------------- // + +//ctor +TCODDijkstra::TCODDijkstra (TCODMap *map, float diagonalCost) { + data = TCOD_dijkstra_new(map->data,diagonalCost); +} + +//another ctor +TCODDijkstra::TCODDijkstra ( + int width, int height, + const ITCODPathCallback *listener, void *userData, float diagonalCost) +{ + cppData.listener = listener; + cppData.userData = userData; + data = TCOD_dijkstra_new_using_function( + width, height, TCOD_path_func, static_cast(&cppData), diagonalCost); +} + +//dtor +TCODDijkstra::~TCODDijkstra (void) { + TCOD_dijkstra_delete(data); +} + +//compute distances grid +void TCODDijkstra::compute (int rootX, int rootY) { + TCOD_dijkstra_compute(data,rootX,rootY); +} + +//retrieve distance to a given cell +float TCODDijkstra::getDistance (int x, int y) { + return TCOD_dijkstra_get_distance(data,x,y); +} + +//create a path +bool TCODDijkstra::setPath (int toX, int toY) { + return (TCOD_dijkstra_path_set(data,toX,toY) != 0); +} + +void TCODDijkstra::reverse() { + TCOD_dijkstra_reverse(data); +} + +//walk a path +bool TCODDijkstra::walk (int *x, int *y) { + return TCOD_dijkstra_path_walk(data,x,y) != 0; +} + +bool TCODDijkstra::isEmpty() const { + return TCOD_dijkstra_is_empty(data) != 0; +} + +int TCODDijkstra::size() const { + return TCOD_dijkstra_size(data); +} + +void TCODDijkstra::get(int index, int *x, int *y) const { + return TCOD_dijkstra_get(data,index,x,y); +} diff --git a/tcod_sys/libtcod/src/libtcod/path.h b/tcod_sys/libtcod/src/libtcod/path.h new file mode 100644 index 000000000..5c4e32dc5 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/path.h @@ -0,0 +1,91 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_PATH_H +#define _TCOD_PATH_H + +#include "portability.h" +#include "fov_types.h" +#include "list.h" + +#ifdef __cplusplus +extern "C" { +#endif +typedef float (*TCOD_path_func_t)( int xFrom, int yFrom, int xTo, int yTo, void *user_data ); +struct TCOD_Path; +typedef struct TCOD_Path *TCOD_path_t; + +TCODLIB_API TCOD_path_t TCOD_path_new_using_map(TCOD_map_t map, float diagonalCost); +TCODLIB_API TCOD_path_t TCOD_path_new_using_function(int map_width, int map_height, TCOD_path_func_t func, void *user_data, float diagonalCost); + +TCODLIB_API bool TCOD_path_compute(TCOD_path_t path, int ox,int oy, int dx, int dy); +TCODLIB_API bool TCOD_path_walk(TCOD_path_t path, int *x, int *y, bool recalculate_when_needed); +TCODLIB_API bool TCOD_path_is_empty(TCOD_path_t path); +TCODLIB_API int TCOD_path_size(TCOD_path_t path); +TCODLIB_API void TCOD_path_reverse(TCOD_path_t path); +TCODLIB_API void TCOD_path_get(TCOD_path_t path, int index, int *x, int *y); +TCODLIB_API void TCOD_path_get_origin(TCOD_path_t path, int *x, int *y); +TCODLIB_API void TCOD_path_get_destination(TCOD_path_t path, int *x, int *y); +TCODLIB_API void TCOD_path_delete(TCOD_path_t path); + +/* Dijkstra stuff - by Mingos*/ +/** + * Dijkstra data structure + * + * All attributes are considered private. + */ +typedef struct TCOD_Dijkstra { + int diagonal_cost; + int width, height, nodes_max; + TCOD_map_t map; /* a TCODMap with walkability data */ + TCOD_path_func_t func; + void *user_data; + unsigned int * distances; /* distances grid */ + unsigned int * nodes; /* the processed nodes */ + TCOD_list_t path; +} TCOD_Dijkstra; +typedef struct TCOD_Dijkstra *TCOD_dijkstra_t; + +TCODLIB_API TCOD_dijkstra_t TCOD_dijkstra_new (TCOD_map_t map, float diagonalCost); +TCODLIB_API TCOD_dijkstra_t TCOD_dijkstra_new_using_function(int map_width, int map_height, TCOD_path_func_t func, void *user_data, float diagonalCost); +TCODLIB_API void TCOD_dijkstra_compute (TCOD_dijkstra_t dijkstra, int root_x, int root_y); +TCODLIB_API float TCOD_dijkstra_get_distance (TCOD_dijkstra_t dijkstra, int x, int y); +TCODLIB_API bool TCOD_dijkstra_path_set (TCOD_dijkstra_t dijkstra, int x, int y); +TCODLIB_API bool TCOD_dijkstra_is_empty(TCOD_dijkstra_t path); +TCODLIB_API int TCOD_dijkstra_size(TCOD_dijkstra_t path); +TCODLIB_API void TCOD_dijkstra_reverse(TCOD_dijkstra_t path); +TCODLIB_API void TCOD_dijkstra_get(TCOD_dijkstra_t path, int index, int *x, int *y); +TCODLIB_API bool TCOD_dijkstra_path_walk (TCOD_dijkstra_t dijkstra, int *x, int *y); +TCODLIB_API void TCOD_dijkstra_delete (TCOD_dijkstra_t dijkstra); +#ifdef __cplusplus +} +#endif +#endif diff --git a/tcod_sys/libtcod/include/path.hpp b/tcod_sys/libtcod/src/libtcod/path.hpp similarity index 90% rename from tcod_sys/libtcod/include/path.hpp rename to tcod_sys/libtcod/src/libtcod/path.hpp index d32c7228b..e47764eae 100644 --- a/tcod_sys/libtcod/include/path.hpp +++ b/tcod_sys/libtcod/src/libtcod/path.hpp @@ -1,554 +1,558 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_PATH_HPP -#define _TCOD_PATH_HPP - -#include "fov.hpp" -#include "path.h" - -class TCODLIB_API ITCODPathCallback { -public : - virtual ~ITCODPathCallback() {} - virtual float getWalkCost( int xFrom, int yFrom, int xTo, int yTo, void *userData ) const = 0; -}; - -/** - @PageName path - @PageTitle Path finding - @PageCategory Roguelike toolkits - @PageDesc This toolkit allows one to easily calculate the optimal path between two points in your dungeon by using either the A* algorithm or Dijkstra's algorithm. -Please note that the paths generated with the two algorithms may differ slightly. Due to how they're implemented, A* will usually prefer diagonal moves over orthogonal, while Dijkstra will have the opposite preference. In other words, paths from point X to point Y will look like this: -
-Dijkstra:      A*:
-..........   ..........
-.X........   .X*.......
-..*.......   ...**.....
-...*......   .....**...
-....****Y.   .......*Y.
-..........   ..........
-
- */ -class TCODLIB_API TCODPath { -public : - /** - @PageName path_init - @PageFather path - @PageTitle Creating a path - @FuncTitle Allocating a pathfinder from a map - @FuncDesc First, you have to allocate a path using a map from the Field of view module. - @Cpp - TCODPath::TCODPath(const TCODMap *map, float diagonalCost=1.41f) - TCODDijkstra::TCODDijkstra(const TCODMap *map, float diagonalCost=1.41f) - @C - TCOD_path_t TCOD_path_new_using_map(TCOD_map_t map, float diagonalCost) - TCOD_dijkstra_t TCOD_dijkstra_new(TCOD_map_t map, float diagonalCost) - @Py - path_new_using_map(map, diagonalCost=1.41) - dijkstra_new(map, diagonalCost=1.41) - @C# - TCODPath(TCODMap map, float diagonalCost) - TCODPath(TCODMap map) - TCODDijkstra(TCODMap map, float diagonalCost) - TCODDijkstra(TCODMap map) - @Param map The map. The path finder will use the 'walkable' property of the cells to find a path. - @Param diagonalCost Cost of a diagonal movement compared to an horizontal or vertical movement. On a standard cartesian map, it should be sqrt(2) (1.41f). - It you want the same cost for all movements, use 1.0f. - If you don't want the path finder to use diagonal movements, use 0.0f. - @CppEx - // A* : - TCODMap *myMap = new TCODMap(50,50); - TCODPath *path = new TCODPath(myMap); // allocate the path - // Dijkstra: - TCODMap *myMap = new TCODMap(50,50); - TCODDijkstra *dijkstra = new TCODDijkstra(myMap); // allocate the path - @CEx - // A* : - TCOD_map_t my_map=TCOD_map_new(50,50,true); - TCOD_path_t path = TCOD_path_new_using_map(my_map,1.41f); - // Dijkstra : - TCOD_map_t my_map=TCOD_map_new(50,50,true); - TCOD_dijkstra_t dijk = TCOD_dijkstra_new(my_map,1.41f); - @PyEx - # A* : - my_map=libtcod.map_new(50,50,True) - path = libtcod.path_new_using_map(my_map) - # Dijkstra - my_map=libtcod.map_new(50,50,True) - dijk = libtcod.dijkstra_new(my_map) - */ - TCODPath(const TCODMap *map, float diagonalCost=1.41f); - /** - @PageName path_init - @FuncTitle Allocating a pathfinder using a callback - @FuncDesc Since the walkable status of a cell may depend on a lot of parameters (the creature type, the weather, the terrain type...), you can also create a path by providing a function rather than relying on a TCODMap. - @Cpp - // Callback : - class ITCODPathCallback { - public: virtual float getWalkCost( int xFrom, int yFrom, int xTo, int yTo, void *userData ) const = 0; - }; - // A* constructor: - TCODPath::TCODPath(int width, int height, const ITCODPathCallback *callback, void *userData, float diagonalCost=1.41f) - // Dijkstra constructor - TCODDijkstra::TCODDijkstra(int width, int height, const ITCODPathCallback *callback, void *userData, float diagonalCost=1.41f) - @C - typedef float (*TCOD_path_func_t)( int xFrom, int yFrom, int xTo, int yTo, void *user_data ) - TCOD_path_t TCOD_path_new_using_function(int width, int height, TCOD_path_func_t callback, void *user_data, float diagonalCost) - TCOD_dijkstra_t TCOD_dijkstra_new_using_function(int width, int height, TCOD_path_func_t callback, void *user_data, float diagonalCost) - @Py - def path_func(xFrom,yFrom,xTo,yTo,userData) : ... - path_new_using_function(width, height, path_func, user_data=0, diagonalCost=1.41) - dijkstra_new_using_function(width, height, path_func, user_data=0, diagonalCost=1.41) - @C# - TCODPath(int width, int height, ITCODPathCallback listener, float diagonalCost) - TCODPath(int width, int height, ITCODPathCallback listener) - TCODDijkstra(int width, int height, ITCODPathCallback listener, float diagonalCost) - TCODDijkstra(int width, int height, ITCODPathCallback listener) - @Param width,height The size of the map (in map cells). - @Param callback A custom function that must return the walk cost from coordinates xFrom,yFrom to coordinates xTo,yTo. - The cost must be > 0.0f if the cell xTo,yTo is walkable. - It must be equal to 0.0f if it's not. - You must not take additional cost due to diagonal movements into account as it's already done by the pathfinder. - @Param userData Custom data that will be passed to the function. - @Param diagonalCost Cost of a diagonal movement compared to an horizontal or vertical movement. On a standard cartesian map, it should be sqrt(2) (1.41f). - It you want the same cost for all movements, use 1.0f. - If you don't want the path finder to use diagonal movements, use 0.0f. - @CppEx - class MyCallback : public ITCODPathCallback { - public : - float getWalkCost(int xFrom, int yFrom, int xTo, int yTo, void *userData ) const { ... } - }; - TCODPath *path = new TCODPath(50,50,new MyCallback(),NULL); // allocate the path - TCODDijkstra *dijkstra = new TCODDijkstra(50,50,new MyCallback(),NULL); // allocate Dijkstra - @CEx - float my_func(int xFrom, int yFrom, int xTo, int yTo, void *user_data) { ... } - TCOD_path_t path = TCOD_path_new_using_function(50,50,my_func,NULL,1.41f); - TCOD_dijkstra_t dijkstra = TCOD_dijkstra_new_using_function(50,50,my_func,NULL,1.41f); - @PyEx - def my_func(xFrom, yFrom, xTo, yTo, user_data) : - # return a float cost for this movement - return 1.0 - path = libtcod.path_new_using_function(50,50,my_func) - dijkstra = libtcod.dijkstra_new_using_function(50,50,my_func) - */ - TCODPath(int width, int height, const ITCODPathCallback *listener, void *userData, float diagonalCost=1.41f); - - /** - @PageName path_init - @FuncTitle Destroying a path - @FuncDesc To release the resources used by a path, destroy it with : - @Cpp - TCODPath::~TCODPath() - TCODDijkstra::~TCODDijkstra() - @C - void TCOD_path_delete(TCOD_path_t path) - void TCOD_dijkstra_delete(TCOD_dijkstra_t dijkstra) - @Py - path_delete(path) - dijkstra_delete(dijkstra) - @C# - void TCODPath::Dispose() - void TCODDijkstra::Dispose() - @Param path In the C version, the path handler returned by one of the TCOD_path_new_* function. - @Param dijkstra In the C version, the path handler returned by one of the TCOD_dijkstra_new* function. - @CppEx - TCODPath *path = new TCODPath(myMap); // allocate the path - // use the path... - delete path; // destroy the path - - TCODDijkstra *dijkstra = new TCODDijkstra(myMap); // allocate the path - // use the path... - delete dijkstra; // destroy the path - @CEx - TCOD_path_t path = TCOD_path_new_using_map(my_map); - // use the path ... - TCOD_path_delete(path); - - TCOD_dijkstra_t dijkstra = TCOD_dijkstra_new(my_map); - // use the path ... - TCOD_dijkstra_delete(dijkstra); - @PyEx - path = libtcod.path_new_using_map(my_map) - # use the path ... - libtcod.path_delete(path) - - dijkstra = libtcod.dijkstra_new(my_map) - # use the path ... - libtcod.dijkstra_delete(dijkstra) - */ - virtual ~TCODPath(); - - /** - @PageName path_compute - @PageFather path - @PageTitle Computing the path - @FuncTitle Computing an A* path - @FuncDesc Once you created a TCODPath object, you can compute the path between two points: - @Cpp bool TCODPath::compute(int ox, int oy, int dx, int dy) - @C bool TCOD_path_compute(TCOD_path_t path, int ox,int oy, int dx, int dy) - @Py path_compute(path, ox, oy, dx, dy) - @C# void TCODPath::compute(int ox, int oy, int dx, int dy) - @Param path In the C version, the path handler returned by a creation function. - @Param ox,oy Coordinates of the origin of the path. - @Param dx,dy Coordinates of the destination of the path. - Both points should be inside the map, and at a walkable position. The function returns false if there is no possible path. - @CppEx - TCODMap *myMap = new TCODMap(50,50); - TCODPath *path = new TCODPath(myMap); // allocate the path - path->compute(5,5,25,25); // calculate path from 5,5 to 25,25 - @CEx - TCOD_map_t my_map=TCOD_map_new(50,50); - TCOD_path_t path = TCOD_path_new_using_map(my_map); - TCOD_path_compute(path,5,5,25,25); - @PyEx - my_map=libtcod.map_new(50,50) - path = libtcod.path_new_using_map(my_map) - libtcod.path_compute(path,5,5,25,25) - */ - bool compute(int ox, int oy, int dx, int dy); - - /** - @PageName path_compute - @FuncTitle Reversing a path - @FuncDesc Once you computed a path, you can exchange origin and destination : - @Cpp - void TCODPath::reverse() - void TCODDijkstra::reverse() - @C - void TCOD_path_reverse(TCOD_path_t path) - void TCOD_dijkstra_reverse(TCOD_dijkstra_t dijkstra) - @Py - path_reverse(path) - dijkstra_reverse(dijkstra) - @C# - void TCODPath::reverse() - void TCODDijkstra::reverse() - @Param path In the C version, the path handler returned by a creation function. - @CppEx - TCODMap *myMap = new TCODMap(50,50); - TCODPath *path = new TCODPath(myMap); // allocate the path - path->compute(5,5,25,25); // calculate path from 5,5 to 25,25 - path->reverse(); // now the path goes from 25,25 to 5,5 - @CEx - TCOD_map_t my_map=TCOD_map_new(50,50); - TCOD_path_t path = TCOD_path_new_using_map(my_map); - TCOD_path_compute(path,5,5,25,25); // calculate path from 5,5 to 25,25 - TCOD_path_reverse(path); // now the path goes from 25,25 to 5,5 - @PyEx - my_map=libtcod.map_new(50,50) - path = libtcod.path_new_using_map(my_map) - libtcod.path_compute(path,5,5,25,25) # calculate path from 5,5 to 25,25 - libtcod.path_reverse(path) # now the path goes from 25,25 to 5,5 - */ - void reverse(); - - - /** - @PageName path_read - @PageTitle Reading path information - @PageFather path - @PageDescDesc Once the path has been computed, you can get information about it using of one those functions. - @FuncTitle Getting the path origin and destination - @FuncDesc - You can read the current origin and destination cells with getOrigin/getDestination. - Note that when you walk the path, the origin changes at each step. - @Cpp - void TCODPath::getOrigin(int *x,int *y) const - void TCODPath::getDestination(int *x,int *y) const - @C - void TCOD_path_get_origin(TCOD_path_t path, int *x, int *y) - void TCOD_path_get_destination(TCOD_path_t path, int *x, int *y) - @Py - path_get_origin(path) # returns x,y - path_get_destination(path) # returns x,y - @C# - void TCODPath::getOrigin(out int x, out int y) - void TCODPath::getDestination(out int x, out int y) - @Param path In the C version, the path handler returned by a creation function. - @Param x,y The function returns the cell coordinates in these variables - */ - void getOrigin(int *x,int *y) const; - void getDestination(int *x,int *y) const; - - /** - @PageName path_read - @FuncTitle Getting the path length - @FuncDesc You can get the number of steps needed to reach destination : - @Cpp - int TCODPath::size() const - int TCODDijkstra::size() const - @C - int TCOD_path_size(TCOD_path_t path) - int TCOD_dijkstra_size(TCOD_dijkstra_t dijkstra) - @Py - path_size(path) - dijkstra_size(dijkstra) - @C# - int TCODPath::size() - int TCODDijkstra::size() - @Param path, dijkstra In the C version, the path handler returned by a creation function. - */ - int size() const; - - /** - @PageName path_read - @FuncTitle Read the path cells' coordinates - @FuncDesc You can get the coordinates of each point along the path : - @Cpp - void TCODPath::get(int index, int *x, int *y) const - void TCODDijkstra::get(int index, int *x, int *y) const - @C - void TCOD_path_get(TCOD_path_t path, int index, int *x, int *y) - void TCOD_dijkstra_get(TCOD_dijkstra_t dijkstra, int index, int *x, int *y) - @Py - path_get(path, index) # returns x,y - dijkstra_get(dijkstra, index) # returns x,y - @C# - int TCODPath::size() - int TCODDijkstra::size() - @Param path, dijkstra In the C version, the path handler returned by a creation function. - @Param index Step number. - 0 <= index < path size - @Param x,y Address of the variables receiving the coordinates of the point. - @CppEx - for (int i=0; i < path->size(); i++ ) { - int x,y; - path->get(i,&x,&y); - printf ("Astar coord : %d %d\n", x,y ); - } - for (int i=0; i < dijkstra->size(); i++ ) { - int x,y; - dijkstra->get(i,&x,&y); - printf ("Dijkstra coord : %d %d\n", x,y ); - } - @CEx - int i; - for (i=0; i < TCOD_path_size(path); i++ ) { - int x,y; - TCOD_path_get(path,i,&x,&y); - printf ("Astar coord : %d %d\n", x,y ); - } - for (i=0; i < TCOD_dijkstra_size(dijkstra); i++ ) { - int x,y; - TCOD_dijkstra_get(dijkstra,i,&x,&y); - printf ("Dijsktra coord : %d %d\n", x,y ); - } - @PyEx - for i in range (libtcod.path_size(path)) : - x,y=libtcod.path_get(path,i) - print 'Astar coord : ',x,y - for i in range (libtcod.dijkstra_size(dijkstra)) : - x,y=libtcod.dijkstra_get(dijkstra,i) - print 'Dijkstra coord : ',x,y - */ - void get(int index, int *x, int *y) const; - - /** - @PageName path_read - @FuncTitle Checking if the path is empty - @FuncDesc If you want a creature to follow the path, a more convenient way is to walk the path : - You know when you reached destination when the path is empty : - @Cpp - bool TCODPath::isEmpty() const - bool TCODDijkstra::isEmpty() const - @C - bool TCOD_path_is_empty(TCOD_path_t path) - bool TCOD_dijkstra_is_empty(TCOD_dijkstra_t dijkstra) - @Py - path_is_empty(path) - dijkstra_is_empty(dijkstra) - @C# - bool TCODPath::isEmpty() - bool TCODDijkstra::isEmpty() - @Param path, dijkstra In the C version, the path handler returned by a creation function. - */ - bool isEmpty() const; - - /** - @PageName path_read - @FuncTitle Walking the path - @FuncDesc You can walk the path and go to the next step with : - Note that walking the path consume one step (and decrease the path size by one). The function returns false if recalculateWhenNeeded is false and the next cell on the path is no longer walkable, or if recalculateWhenNeeded is true, the next cell on the path is no longer walkable and no other path has been found. Also note that recalculateWhenNeeded only applies to A*. - @Cpp - bool TCODPath::walk(int *x, int *y, bool recalculateWhenNeeded) - bool TCODDijkstra::walk(int *x, int *y) - @C - bool TCOD_path_walk(TCOD_path_t path, int *x, int *y, bool recalculate_when_needed) - bool TCOD_dijkstra_walk(TCOD_dijkstra_t dijkstra, int *x, int *y) - @Py - path_walk(TCOD_path_t path, recalculate_when_needed) # returns x,y or None,None if no path - dijkstra_walk(TCOD_dijkstra_t dijkstra) - @C# - bool TCODPath::walk(ref int x, ref int y, bool recalculateWhenNeeded) - bool TCODDijkstra::walk(ref int x, ref int y) - @Param path, dijkstra In the C version, the path handler returned by a creation function. - @Param x,y Address of the variables receiving the coordinates of the next point. - @Param recalculateWhenNeeded If the next point is no longer walkable (another creature may be in the way), recalculate a new path and walk it. - @CppEx - while (! path->isEmpty()) { - int x,y; - if (path->walk(&x,&y,true)) { - printf ("Astar coord: %d %d\n",x,y ); - } else { - printf ("I'm stuck!\n" ); - break; - } - } - while (! dijkstra->isEmpty()) { - int x,y; - if (dijkstra->walk(&x,&y)) { - printf ("Dijkstra coord: %d %d\n",x,y ); - } else { - printf ("I'm stuck!\n" ); - break; - } - } - @CEx - while (! TCOD_path_is_empty(path)) { - int x,y; - if (TCOD_path_walk(path,&x,&y,true)) { - printf ("Astar coord: %d %d\n",x,y ); - } else { - printf ("I'm stuck!\n" ); - break; - } - } - while (! TCOD_dijkstra_is_empty(dijkstra)) { - int x,y; - if (TCOD_dijkstra_walk(dijkstra,&x,&y)) { - printf ("Dijkstra coord: %d %d\n",x,y ); - } else { - printf ("I'm stuck!\n" ); - break; - } - } - @PyEx - while not libtcod.path_is_empty(path)) : - x,y=libtcod.path_walk(path,True) - if not x is None : - print 'Astar coord: ',x,y - else : - print "I'm stuck!" - break - while not libtcod.dijkstra_is_empty(dijkstra)) : - x,y=libtcod.dijkstra_walk(dijkstra,True) - if not x is None : - print 'Dijkstra coord: ',x,y - else : - print "I'm stuck!" - break - */ - bool walk(int *x, int *y, bool recalculateWhenNeeded); - -protected : - friend float TCOD_path_func(int xFrom, int yFrom, int xTo,int yTo, void *data); - TCOD_path_t data; - struct WrapperData { - void *userData; - const ITCODPathCallback *listener; - } cppData; -}; - -//Dijkstra kit -class TCODLIB_API TCODDijkstra { - public: - TCODDijkstra (TCODMap *map, float diagonalCost=1.41f); - TCODDijkstra (int width, int height, const ITCODPathCallback *listener, void *userData, float diagonalCost=1.41f); - ~TCODDijkstra (void); - /** - @PageName path_compute - @FuncTitle Computing a Dijkstra grid - @FuncDesc In case of Dijkstra, this works in a slightly different way. In order to be able to compute a path, Dijkstra must first analyse the distances from the selected root (origin) node to all other nodes: - @Cpp void TCODDijkstra::compute(int rootX, int rootY) - @C void TCOD_dijkstra_compute(TCOD_dijkstra_t dijkstra, int root_x, int root_y) - @Py dijkstra_compute(dijkstra, root_x, root_y) - @C# void TCODDijkstra::compute(int rootX, int rootY) - @Param dijkstra In the C version, the path handler returned by a creation function. - @Param root_x,root_y Coordinates of the root node (origin) of the path. - The coordinates should be inside the map, at a walkable position. Otherwise, the function's behaviour will be undefined. - */ - void compute (int rootX, int rootY); - - /** - @PageName path_compute - @FuncTitle Computing a path from a Dijkstra grid - @FuncDesc After the map is analysed and all the distances from the root node are known, an unlimited number of paths can be set, all originating at the root node, using: - The path setting function will return true if there's a path from the root node to the destination node. Otherwise, it will return false. - @Cpp bool TCODDijkstra::setPath(int toX, int toY) - @C bool TCOD_dijkstra_path_set(TCOD_dijkstra_t dijkstra, int to_x, int to_y) - @Py dijkstra_path_set(dijkstra, to_x, to_y) - @C# bool TCODDijkstra::setPath(int toX, int toY) - @Param dijkstra In the C version, the path handler returned by a creation function. - @Param to_x,to_y Coordinates of the destination node of the path. - @CppEx - TCODMap *myMap = new TCODMap(50,50); - TCODDijkstra *dijkstra = new TCODDijkstra(myMap); // allocate the path - dijkstra->compute(25,25); // calculate distance from 25,25 to all other nodes - dijkstra->setPath(5,5); // calculate a path to node 5,5 - dijkstra->setPath(45,45); //calculate another path from the same origin - @CEx - TCOD_map_t my_map=TCOD_map_new(50,50); - TCOD_dijkstra_t dijkstra = TCOD_dijkstra_new(my_map); - TCOD_dijkstra_compute(dijkstra,25,25); - TCOD_dijkstra_path_set(dijkstra,5,5); - TCOD_dijkstra_path_set(dijkstra,45,45); - @PyEx - my_map=libtcod.map_new(50,50) - dijkstra = libtcod.dijkstra_new(my_map) - libtcod.dijkstra_compute(dijkstra,25,25) - libtcod.dijkstra_path_set(dijkstra,5,5) - libtcod.dijkstra_path_set(dijkstra,45,45) - */ - bool setPath (int toX, int toY); - - /** - @PageName path_read - @FuncTitle Getting the distance from a cell to the root node - @FuncDesc You can get the distance of any set of coordinates from the root node: - Note that if the coordinates x,y are outside of the map or are a non-walkable position, the function will return -1.0f. This functionality is only available for Dijkstra's algorithm. - @Cpp float TCODDijkstra::getDistance(int x, int y) - @C float TCOD_dijkstra_get_distance(TCOD_dijkstra_t dijkstra, int x, int y) - @Py dijkstra_get_distance(dijkstra, x, y) - @C# float TCODDijkstra::getDistance(int x, int y) - @Param dijkstra In the C version, the path handler returned by a creation function. - @Param x,y The coordinates whose distance from the root node are to be checked - */ - float getDistance (int x, int y); - bool walk (int *x, int *y); - bool isEmpty() const; - void reverse(); - int size() const; - void get(int index, int *x, int *y) const; - private: - TCOD_dijkstra_t data; - struct WrapperData { - void *userData; - const ITCODPathCallback *listener; - } cppData; -}; - -#endif +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_PATH_HPP +#define _TCOD_PATH_HPP + +#include "fov.hpp" +#include "path.h" + +class TCODLIB_API ITCODPathCallback { +public : + virtual ~ITCODPathCallback() {} + virtual float getWalkCost( int xFrom, int yFrom, int xTo, int yTo, void *userData ) const = 0; +}; + +/** + @PageName path + @PageTitle Path finding + @PageCategory Roguelike toolkits + @PageDesc This toolkit allows one to easily calculate the optimal path between two points in your dungeon by using either the A* algorithm or Dijkstra's algorithm. +Please note that the paths generated with the two algorithms may differ slightly. Due to how they're implemented, A* will usually prefer diagonal moves over orthogonal, while Dijkstra will have the opposite preference. In other words, paths from point X to point Y will look like this: +
+Dijkstra:      A*:
+..........   ..........
+.X........   .X*.......
+..*.......   ...**.....
+...*......   .....**...
+....****Y.   .......*Y.
+..........   ..........
+
+ */ +class TCODLIB_API TCODPath { +public : + /** + @PageName path_init + @PageFather path + @PageTitle Creating a path + @FuncTitle Allocating a pathfinder from a map + @FuncDesc First, you have to allocate a path using a map from the Field of view module. + @Cpp + TCODPath::TCODPath(const TCODMap *map, float diagonalCost=1.41f) + TCODDijkstra::TCODDijkstra(const TCODMap *map, float diagonalCost=1.41f) + @C + TCOD_path_t TCOD_path_new_using_map(TCOD_map_t map, float diagonalCost) + TCOD_dijkstra_t TCOD_dijkstra_new(TCOD_map_t map, float diagonalCost) + @Py + path_new_using_map(map, diagonalCost=1.41) + dijkstra_new(map, diagonalCost=1.41) + @C# + TCODPath(TCODMap map, float diagonalCost) + TCODPath(TCODMap map) + TCODDijkstra(TCODMap map, float diagonalCost) + TCODDijkstra(TCODMap map) + @Param map The map. The path finder will use the 'walkable' property of the cells to find a path. + @Param diagonalCost Cost of a diagonal movement compared to an horizontal or vertical movement. On a standard cartesian map, it should be sqrt(2) (1.41f). + It you want the same cost for all movements, use 1.0f. + If you don't want the path finder to use diagonal movements, use 0.0f. + @CppEx + // A* : + TCODMap *myMap = new TCODMap(50,50); + TCODPath *path = new TCODPath(myMap); // allocate the path + // Dijkstra: + TCODMap *myMap = new TCODMap(50,50); + TCODDijkstra *dijkstra = new TCODDijkstra(myMap); // allocate the path + @CEx + // A* : + TCOD_map_t my_map=TCOD_map_new(50,50,true); + TCOD_path_t path = TCOD_path_new_using_map(my_map,1.41f); + // Dijkstra : + TCOD_map_t my_map=TCOD_map_new(50,50,true); + TCOD_dijkstra_t dijk = TCOD_dijkstra_new(my_map,1.41f); + @PyEx + # A* : + my_map=libtcod.map_new(50,50,True) + path = libtcod.path_new_using_map(my_map) + # Dijkstra + my_map=libtcod.map_new(50,50,True) + dijk = libtcod.dijkstra_new(my_map) + */ + TCODPath(const TCODMap *map, float diagonalCost=1.41f); + /** + @PageName path_init + @FuncTitle Allocating a pathfinder using a callback + @FuncDesc Since the walkable status of a cell may depend on a lot of parameters (the creature type, the weather, the terrain type...), you can also create a path by providing a function rather than relying on a TCODMap. + @Cpp + // Callback : + class ITCODPathCallback { + public: virtual float getWalkCost( int xFrom, int yFrom, int xTo, int yTo, void *userData ) const = 0; + }; + // A* constructor: + TCODPath::TCODPath(int width, int height, const ITCODPathCallback *callback, void *userData, float diagonalCost=1.41f) + // Dijkstra constructor + TCODDijkstra::TCODDijkstra(int width, int height, const ITCODPathCallback *callback, void *userData, float diagonalCost=1.41f) + @C + typedef float (*TCOD_path_func_t)( int xFrom, int yFrom, int xTo, int yTo, void *user_data ) + TCOD_path_t TCOD_path_new_using_function(int width, int height, TCOD_path_func_t callback, void *user_data, float diagonalCost) + TCOD_dijkstra_t TCOD_dijkstra_new_using_function(int width, int height, TCOD_path_func_t callback, void *user_data, float diagonalCost) + @Py + def path_func(xFrom,yFrom,xTo,yTo,userData) : ... + path_new_using_function(width, height, path_func, user_data=0, diagonalCost=1.41) + dijkstra_new_using_function(width, height, path_func, user_data=0, diagonalCost=1.41) + @C# + TCODPath(int width, int height, ITCODPathCallback listener, float diagonalCost) + TCODPath(int width, int height, ITCODPathCallback listener) + TCODDijkstra(int width, int height, ITCODPathCallback listener, float diagonalCost) + TCODDijkstra(int width, int height, ITCODPathCallback listener) + @Param width,height The size of the map (in map cells). + @Param callback A custom function that must return the walk cost from coordinates xFrom,yFrom to coordinates xTo,yTo. + The cost must be > 0.0f if the cell xTo,yTo is walkable. + It must be equal to 0.0f if it's not. + You must not take additional cost due to diagonal movements into account as it's already done by the pathfinder. + @Param userData Custom data that will be passed to the function. + @Param diagonalCost Cost of a diagonal movement compared to an horizontal or vertical movement. On a standard cartesian map, it should be sqrt(2) (1.41f). + It you want the same cost for all movements, use 1.0f. + If you don't want the path finder to use diagonal movements, use 0.0f. + @CppEx + class MyCallback : public ITCODPathCallback { + public : + float getWalkCost(int xFrom, int yFrom, int xTo, int yTo, void *userData ) const { ... } + }; + TCODPath *path = new TCODPath(50,50,new MyCallback(),NULL); // allocate the path + TCODDijkstra *dijkstra = new TCODDijkstra(50,50,new MyCallback(),NULL); // allocate Dijkstra + @CEx + float my_func(int xFrom, int yFrom, int xTo, int yTo, void *user_data) { ... } + TCOD_path_t path = TCOD_path_new_using_function(50,50,my_func,NULL,1.41f); + TCOD_dijkstra_t dijkstra = TCOD_dijkstra_new_using_function(50,50,my_func,NULL,1.41f); + @PyEx + def my_func(xFrom, yFrom, xTo, yTo, user_data) : + # return a float cost for this movement + return 1.0 + path = libtcod.path_new_using_function(50,50,my_func) + dijkstra = libtcod.dijkstra_new_using_function(50,50,my_func) + */ + TCODPath(int width, int height, const ITCODPathCallback *listener, void *userData, float diagonalCost=1.41f); + + /** + @PageName path_init + @FuncTitle Destroying a path + @FuncDesc To release the resources used by a path, destroy it with : + @Cpp + TCODPath::~TCODPath() + TCODDijkstra::~TCODDijkstra() + @C + void TCOD_path_delete(TCOD_path_t path) + void TCOD_dijkstra_delete(TCOD_dijkstra_t dijkstra) + @Py + path_delete(path) + dijkstra_delete(dijkstra) + @C# + void TCODPath::Dispose() + void TCODDijkstra::Dispose() + @Param path In the C version, the path handler returned by one of the TCOD_path_new_* function. + @Param dijkstra In the C version, the path handler returned by one of the TCOD_dijkstra_new* function. + @CppEx + TCODPath *path = new TCODPath(myMap); // allocate the path + // use the path... + delete path; // destroy the path + + TCODDijkstra *dijkstra = new TCODDijkstra(myMap); // allocate the path + // use the path... + delete dijkstra; // destroy the path + @CEx + TCOD_path_t path = TCOD_path_new_using_map(my_map); + // use the path ... + TCOD_path_delete(path); + + TCOD_dijkstra_t dijkstra = TCOD_dijkstra_new(my_map); + // use the path ... + TCOD_dijkstra_delete(dijkstra); + @PyEx + path = libtcod.path_new_using_map(my_map) + # use the path ... + libtcod.path_delete(path) + + dijkstra = libtcod.dijkstra_new(my_map) + # use the path ... + libtcod.dijkstra_delete(dijkstra) + */ + virtual ~TCODPath(); + + /** + @PageName path_compute + @PageFather path + @PageTitle Computing the path + @FuncTitle Computing an A* path + @FuncDesc Once you created a TCODPath object, you can compute the path between two points: + @Cpp bool TCODPath::compute(int ox, int oy, int dx, int dy) + @C bool TCOD_path_compute(TCOD_path_t path, int ox,int oy, int dx, int dy) + @Py path_compute(path, ox, oy, dx, dy) + @C# void TCODPath::compute(int ox, int oy, int dx, int dy) + @Param path In the C version, the path handler returned by a creation function. + @Param ox,oy Coordinates of the origin of the path. + @Param dx,dy Coordinates of the destination of the path. + Both points should be inside the map, and at a walkable position. The function returns false if there is no possible path. + @CppEx + TCODMap *myMap = new TCODMap(50,50); + TCODPath *path = new TCODPath(myMap); // allocate the path + path->compute(5,5,25,25); // calculate path from 5,5 to 25,25 + @CEx + TCOD_map_t my_map=TCOD_map_new(50,50); + TCOD_path_t path = TCOD_path_new_using_map(my_map); + TCOD_path_compute(path,5,5,25,25); + @PyEx + my_map=libtcod.map_new(50,50) + path = libtcod.path_new_using_map(my_map) + libtcod.path_compute(path,5,5,25,25) + */ + bool compute(int ox, int oy, int dx, int dy); + + /** + @PageName path_compute + @FuncTitle Reversing a path + @FuncDesc Once you computed a path, you can exchange origin and destination : + @Cpp + void TCODPath::reverse() + void TCODDijkstra::reverse() + @C + void TCOD_path_reverse(TCOD_path_t path) + void TCOD_dijkstra_reverse(TCOD_dijkstra_t dijkstra) + @Py + path_reverse(path) + dijkstra_reverse(dijkstra) + @C# + void TCODPath::reverse() + void TCODDijkstra::reverse() + @Param path In the C version, the path handler returned by a creation function. + @CppEx + TCODMap *myMap = new TCODMap(50,50); + TCODPath *path = new TCODPath(myMap); // allocate the path + path->compute(5,5,25,25); // calculate path from 5,5 to 25,25 + path->reverse(); // now the path goes from 25,25 to 5,5 + @CEx + TCOD_map_t my_map=TCOD_map_new(50,50); + TCOD_path_t path = TCOD_path_new_using_map(my_map); + TCOD_path_compute(path,5,5,25,25); // calculate path from 5,5 to 25,25 + TCOD_path_reverse(path); // now the path goes from 25,25 to 5,5 + @PyEx + my_map=libtcod.map_new(50,50) + path = libtcod.path_new_using_map(my_map) + libtcod.path_compute(path,5,5,25,25) # calculate path from 5,5 to 25,25 + libtcod.path_reverse(path) # now the path goes from 25,25 to 5,5 + */ + void reverse(); + + + /** + @PageName path_read + @PageTitle Reading path information + @PageFather path + @PageDescDesc Once the path has been computed, you can get information about it using of one those functions. + @FuncTitle Getting the path origin and destination + @FuncDesc + You can read the current origin and destination cells with getOrigin/getDestination. + Note that when you walk the path, the origin changes at each step. + @Cpp + void TCODPath::getOrigin(int *x,int *y) const + void TCODPath::getDestination(int *x,int *y) const + @C + void TCOD_path_get_origin(TCOD_path_t path, int *x, int *y) + void TCOD_path_get_destination(TCOD_path_t path, int *x, int *y) + @Py + path_get_origin(path) # returns x,y + path_get_destination(path) # returns x,y + @C# + void TCODPath::getOrigin(out int x, out int y) + void TCODPath::getDestination(out int x, out int y) + @Param path In the C version, the path handler returned by a creation function. + @Param x,y The function returns the cell coordinates in these variables + */ + void getOrigin(int *x,int *y) const; + void getDestination(int *x,int *y) const; + + /** + @PageName path_read + @FuncTitle Getting the path length + @FuncDesc You can get the number of steps needed to reach destination : + @Cpp + int TCODPath::size() const + int TCODDijkstra::size() const + @C + int TCOD_path_size(TCOD_path_t path) + int TCOD_dijkstra_size(TCOD_dijkstra_t dijkstra) + @Py + path_size(path) + dijkstra_size(dijkstra) + @C# + int TCODPath::size() + int TCODDijkstra::size() + @Param path, dijkstra In the C version, the path handler returned by a creation function. + */ + int size() const; + + /** + @PageName path_read + @FuncTitle Read the path cells' coordinates + @FuncDesc You can get the coordinates of each point along the path : + @Cpp + void TCODPath::get(int index, int *x, int *y) const + void TCODDijkstra::get(int index, int *x, int *y) const + @C + void TCOD_path_get(TCOD_path_t path, int index, int *x, int *y) + void TCOD_dijkstra_get(TCOD_dijkstra_t dijkstra, int index, int *x, int *y) + @Py + path_get(path, index) # returns x,y + dijkstra_get(dijkstra, index) # returns x,y + @C# + int TCODPath::size() + int TCODDijkstra::size() + @Param path, dijkstra In the C version, the path handler returned by a creation function. + @Param index Step number. + 0 <= index < path size + @Param x,y Address of the variables receiving the coordinates of the point. + @CppEx + for (int i=0; i < path->size(); i++ ) { + int x,y; + path->get(i,&x,&y); + printf ("Astar coord : %d %d\n", x,y ); + } + for (int i=0; i < dijkstra->size(); i++ ) { + int x,y; + dijkstra->get(i,&x,&y); + printf ("Dijkstra coord : %d %d\n", x,y ); + } + @CEx + int i; + for (i=0; i < TCOD_path_size(path); i++ ) { + int x,y; + TCOD_path_get(path,i,&x,&y); + printf ("Astar coord : %d %d\n", x,y ); + } + for (i=0; i < TCOD_dijkstra_size(dijkstra); i++ ) { + int x,y; + TCOD_dijkstra_get(dijkstra,i,&x,&y); + printf ("Dijsktra coord : %d %d\n", x,y ); + } + @PyEx + for i in range (libtcod.path_size(path)) : + x,y=libtcod.path_get(path,i) + print 'Astar coord : ',x,y + for i in range (libtcod.dijkstra_size(dijkstra)) : + x,y=libtcod.dijkstra_get(dijkstra,i) + print 'Dijkstra coord : ',x,y + */ + void get(int index, int *x, int *y) const; + + /** + @PageName path_read + @FuncTitle Checking if the path is empty + @FuncDesc If you want a creature to follow the path, a more convenient way is to walk the path : + You know when you reached destination when the path is empty : + @Cpp + bool TCODPath::isEmpty() const + bool TCODDijkstra::isEmpty() const + @C + bool TCOD_path_is_empty(TCOD_path_t path) + bool TCOD_dijkstra_is_empty(TCOD_dijkstra_t dijkstra) + @Py + path_is_empty(path) + dijkstra_is_empty(dijkstra) + @C# + bool TCODPath::isEmpty() + bool TCODDijkstra::isEmpty() + @Param path, dijkstra In the C version, the path handler returned by a creation function. + */ + bool isEmpty() const; + + /** + @PageName path_read + @FuncTitle Walking the path + @FuncDesc You can walk the path and go to the next step with : + Note that walking the path consume one step (and decrease the path size by one). The function returns false if recalculateWhenNeeded is false and the next cell on the path is no longer walkable, or if recalculateWhenNeeded is true, the next cell on the path is no longer walkable and no other path has been found. Also note that recalculateWhenNeeded only applies to A*. + @Cpp + bool TCODPath::walk(int *x, int *y, bool recalculateWhenNeeded) + bool TCODDijkstra::walk(int *x, int *y) + @C + bool TCOD_path_walk(TCOD_path_t path, int *x, int *y, bool recalculate_when_needed) + bool TCOD_dijkstra_walk(TCOD_dijkstra_t dijkstra, int *x, int *y) + @Py + path_walk(TCOD_path_t path, recalculate_when_needed) # returns x,y or None,None if no path + dijkstra_walk(TCOD_dijkstra_t dijkstra) + @C# + bool TCODPath::walk(ref int x, ref int y, bool recalculateWhenNeeded) + bool TCODDijkstra::walk(ref int x, ref int y) + @Param path, dijkstra In the C version, the path handler returned by a creation function. + @Param x,y Address of the variables receiving the coordinates of the next point. + @Param recalculateWhenNeeded If the next point is no longer walkable (another creature may be in the way), recalculate a new path and walk it. + @CppEx + while (! path->isEmpty()) { + int x,y; + if (path->walk(&x,&y,true)) { + printf ("Astar coord: %d %d\n",x,y ); + } else { + printf ("I'm stuck!\n" ); + break; + } + } + while (! dijkstra->isEmpty()) { + int x,y; + if (dijkstra->walk(&x,&y)) { + printf ("Dijkstra coord: %d %d\n",x,y ); + } else { + printf ("I'm stuck!\n" ); + break; + } + } + @CEx + while (! TCOD_path_is_empty(path)) { + int x,y; + if (TCOD_path_walk(path,&x,&y,true)) { + printf ("Astar coord: %d %d\n",x,y ); + } else { + printf ("I'm stuck!\n" ); + break; + } + } + while (! TCOD_dijkstra_is_empty(dijkstra)) { + int x,y; + if (TCOD_dijkstra_walk(dijkstra,&x,&y)) { + printf ("Dijkstra coord: %d %d\n",x,y ); + } else { + printf ("I'm stuck!\n" ); + break; + } + } + @PyEx + while not libtcod.path_is_empty(path)) : + x,y=libtcod.path_walk(path,True) + if not x is None : + print 'Astar coord: ',x,y + else : + print "I'm stuck!" + break + while not libtcod.dijkstra_is_empty(dijkstra)) : + x,y=libtcod.dijkstra_walk(dijkstra,True) + if not x is None : + print 'Dijkstra coord: ',x,y + else : + print "I'm stuck!" + break + */ + bool walk(int *x, int *y, bool recalculateWhenNeeded); + +protected : + friend float TCOD_path_func(int xFrom, int yFrom, int xTo,int yTo, void *data); + TCOD_path_t data; + struct WrapperData { + void *userData; + const ITCODPathCallback *listener; + } cppData; +}; + +//Dijkstra kit +class TCODLIB_API TCODDijkstra { + public: + TCODDijkstra (TCODMap *map, float diagonalCost=1.41f); + TCODDijkstra (int width, int height, const ITCODPathCallback *listener, void *userData, float diagonalCost=1.41f); + ~TCODDijkstra (void); + /** + @PageName path_compute + @FuncTitle Computing a Dijkstra grid + @FuncDesc In case of Dijkstra, this works in a slightly different way. In order to be able to compute a path, Dijkstra must first analyse the distances from the selected root (origin) node to all other nodes: + @Cpp void TCODDijkstra::compute(int rootX, int rootY) + @C void TCOD_dijkstra_compute(TCOD_dijkstra_t dijkstra, int root_x, int root_y) + @Py dijkstra_compute(dijkstra, root_x, root_y) + @C# void TCODDijkstra::compute(int rootX, int rootY) + @Param dijkstra In the C version, the path handler returned by a creation function. + @Param root_x,root_y Coordinates of the root node (origin) of the path. + The coordinates should be inside the map, at a walkable position. Otherwise, the function's behaviour will be undefined. + */ + void compute (int rootX, int rootY); + + /** + @PageName path_compute + @FuncTitle Computing a path from a Dijkstra grid + @FuncDesc After the map is analysed and all the distances from the root node are known, an unlimited number of paths can be set, all originating at the root node, using: + The path setting function will return true if there's a path from the root node to the destination node. Otherwise, it will return false. + @Cpp bool TCODDijkstra::setPath(int toX, int toY) + @C bool TCOD_dijkstra_path_set(TCOD_dijkstra_t dijkstra, int to_x, int to_y) + @Py dijkstra_path_set(dijkstra, to_x, to_y) + @C# bool TCODDijkstra::setPath(int toX, int toY) + @Param dijkstra In the C version, the path handler returned by a creation function. + @Param to_x,to_y Coordinates of the destination node of the path. + @CppEx + TCODMap *myMap = new TCODMap(50,50); + TCODDijkstra *dijkstra = new TCODDijkstra(myMap); // allocate the path + dijkstra->compute(25,25); // calculate distance from 25,25 to all other nodes + dijkstra->setPath(5,5); // calculate a path to node 5,5 + dijkstra->setPath(45,45); //calculate another path from the same origin + @CEx + TCOD_map_t my_map=TCOD_map_new(50,50); + TCOD_dijkstra_t dijkstra = TCOD_dijkstra_new(my_map); + TCOD_dijkstra_compute(dijkstra,25,25); + TCOD_dijkstra_path_set(dijkstra,5,5); + TCOD_dijkstra_path_set(dijkstra,45,45); + @PyEx + my_map=libtcod.map_new(50,50) + dijkstra = libtcod.dijkstra_new(my_map) + libtcod.dijkstra_compute(dijkstra,25,25) + libtcod.dijkstra_path_set(dijkstra,5,5) + libtcod.dijkstra_path_set(dijkstra,45,45) + */ + bool setPath (int toX, int toY); + + /** + @PageName path_read + @FuncTitle Getting the distance from a cell to the root node + @FuncDesc You can get the distance of any set of coordinates from the root node: + Note that if the coordinates x,y are outside of the map or are a non-walkable position, the function will return -1.0f. This functionality is only available for Dijkstra's algorithm. + @Cpp float TCODDijkstra::getDistance(int x, int y) + @C float TCOD_dijkstra_get_distance(TCOD_dijkstra_t dijkstra, int x, int y) + @Py dijkstra_get_distance(dijkstra, x, y) + @C# float TCODDijkstra::getDistance(int x, int y) + @Param dijkstra In the C version, the path handler returned by a creation function. + @Param x,y The coordinates whose distance from the root node are to be checked + */ + float getDistance (int x, int y); + bool walk (int *x, int *y); + bool isEmpty() const; + void reverse(); + int size() const; + void get(int index, int *x, int *y) const; + private: + TCOD_dijkstra_t data; + struct WrapperData { + void *userData; + const ITCODPathCallback *listener; + } cppData; +}; + +#endif diff --git a/tcod_sys/libtcod/src/path_c.c b/tcod_sys/libtcod/src/libtcod/path_c.c similarity index 84% rename from tcod_sys/libtcod/src/path_c.c rename to tcod_sys/libtcod/src/libtcod/path_c.c index d1142d5c3..4f5b3316f 100644 --- a/tcod_sys/libtcod/src/path_c.c +++ b/tcod_sys/libtcod/src/libtcod/path_c.c @@ -1,692 +1,675 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include -#include - -#include -enum { NORTH_WEST,NORTH, NORTH_EAST, WEST,NONE,EAST, SOUTH_WEST,SOUTH,SOUTH_EAST }; -typedef unsigned char dir_t; - -/* convert dir_t to dx,dy */ -static int dirx[]={-1,0,1,-1,0,1,-1,0,1}; -static int diry[]={-1,-1,-1,0,0,0,1,1,1}; -static int invdir[] = {SOUTH_EAST,SOUTH,SOUTH_WEST,EAST,NONE,WEST,NORTH_EAST,NORTH,NORTH_WEST}; - -typedef struct { - int ox,oy; /* coordinates of the creature position */ - int dx,dy; /* coordinates of the creature's destination */ - TCOD_list_t path; /* list of dir_t to follow the path */ - int w,h; /* map size */ - float *grid; /* wxh djikstra distance grid (covered distance) */ - float *heur; /* wxh A* score grid (covered distance + estimated remaining distance) */ - dir_t *prev; /* wxh 'previous' grid : direction to the previous cell */ - float diagonalCost; - TCOD_list_t heap; /* min_heap used in the algorithm. stores the offset in grid/heur (offset=x+y*w) */ - TCOD_map_t map; - TCOD_path_func_t func; - void *user_data; -} TCOD_path_data_t; - -/* small layer on top of TCOD_list_t to implement a binary heap (min_heap) */ -static void heap_sift_down(TCOD_path_data_t *path, TCOD_list_t heap) { - /* sift-down : move the first element of the heap down to its right place */ - int cur=0; - int end = TCOD_list_size(heap)-1; - int child=1; - uintptr_t *array=(uintptr_t *)TCOD_list_begin(heap); - while ( child <= end ) { - int toSwap=cur; - uintptr_t off_cur=array[cur]; - float cur_dist=path->heur[off_cur]; - float swapValue=cur_dist; - uintptr_t off_child=array[child]; - float child_dist=path->heur[off_child]; - if ( child_dist < cur_dist ) { - toSwap=child; - swapValue=child_dist; - } - if ( child < end ) { - /* get the min between child and child+1 */ - uintptr_t off_child2=array[child+1]; - float child2_dist=path->heur[off_child2]; - if ( swapValue > child2_dist ) { - toSwap=child+1; - swapValue=child2_dist; - } - } - if ( toSwap != cur ) { - /* get down one level */ - uintptr_t tmp = array[toSwap]; - array[toSwap]=array[cur]; - array[cur]=tmp; - cur=toSwap; - } else return; - child=cur*2+1; - } -} - -static void heap_sift_up(TCOD_path_data_t *path, TCOD_list_t heap) { - /* sift-up : move the last element of the heap up to its right place */ - int end = TCOD_list_size(heap)-1; - int child=end; - uintptr_t *array=(uintptr_t *)TCOD_list_begin(heap); - while ( child > 0 ) { - uintptr_t off_child=array[child]; - float child_dist=path->heur[off_child]; - int parent = (child-1)/2; - uintptr_t off_parent=array[parent]; - float parent_dist=path->heur[off_parent]; - if ( parent_dist > child_dist ) { - /* get up one level */ - uintptr_t tmp = array[child]; - array[child]=array[parent]; - array[parent]=tmp; - child=parent; - } else return; - } -} - -/* add a coordinate pair in the heap so that the heap root always contains the minimum A* score */ -static void heap_add(TCOD_path_data_t *path, TCOD_list_t heap, int x, int y) { - /* append the new value to the end of the heap */ - uintptr_t off=x+y*path->w; - TCOD_list_push(heap,(void *)off); - /* bubble the value up to its real position */ - heap_sift_up(path,heap); -} - -/* get the coordinate pair with the minimum A* score from the heap */ -static uint32_t heap_get(TCOD_path_data_t *path,TCOD_list_t heap) { - /* return the first value of the heap (minimum score) */ - uintptr_t *array=(uintptr_t *)TCOD_list_begin(heap); - int end=TCOD_list_size(heap)-1; - uint32_t off=(uint32_t)(array[0]); - /* take the last element and put it at first position (heap root) */ - array[0] = array[end]; - TCOD_list_pop(heap); - /* and bubble it down to its real position */ - heap_sift_down(path,heap); - return off; -} - -/* this is the slow part, when we change the heuristic of a cell already in the heap */ -static void heap_reorder(TCOD_path_data_t *path, uint32_t offset) { - uintptr_t *array=(uintptr_t *)TCOD_list_begin(path->heap); - uintptr_t *end=(uintptr_t *)TCOD_list_end(path->heap); - uintptr_t *cur=array; - uintptr_t off_idx=0; - float value; - int idx=0; - int heap_size=TCOD_list_size(path->heap); - /* find the node corresponding to offset ... SLOW !! */ - while (cur != end) { - if (*cur == offset ) break; - cur++;idx++; - } - if ( cur == end ) return; - off_idx=array[idx]; - value=path->heur[off_idx]; - if ( idx > 0 ) { - int parent=(idx-1)/2; - /* compare to its parent */ - uintptr_t off_parent=array[parent]; - float parent_value=path->heur[off_parent]; - if (value < parent_value) { - /* smaller. bubble it up */ - while ( idx > 0 && value < parent_value ) { - /* swap with parent */ - array[parent]=off_idx; - array[idx] = off_parent; - idx=parent; - if ( idx > 0 ) { - parent=(idx-1)/2; - off_parent=array[parent]; - parent_value=path->heur[off_parent]; - } - } - return; - } - } - /* compare to its sons */ - while ( idx*2+1 < heap_size ) { - int child=idx*2+1; - uintptr_t off_child=array[child]; - int toSwap=idx; - int child2; - float swapValue=value; - if ( path->heur[off_child] < value ) { - /* swap with son1 ? */ - toSwap=child; - swapValue=path->heur[off_child]; - } - child2 = child+1; - if ( child2 < heap_size ) { - uintptr_t off_child2=array[child2]; - if ( path->heur[off_child2] < swapValue) { - /* swap with son2 */ - toSwap=child2; - } - } - if ( toSwap != idx ) { - /* bigger. bubble it down */ - uintptr_t tmp = array[toSwap]; - array[toSwap]=array[idx]; - array[idx] = tmp; - idx=toSwap; - } else return; - } -} - - -/* private functions */ -static void TCOD_path_push_cell(TCOD_path_data_t *path, int x, int y); -static void TCOD_path_get_cell(TCOD_path_data_t *path, int *x, int *y, float *distance); -static void TCOD_path_set_cells(TCOD_path_data_t *path); -static float TCOD_path_walk_cost(TCOD_path_data_t *path, int xFrom, int yFrom, int xTo, int yTo); - -static TCOD_path_data_t *TCOD_path_new_intern(int w, int h) { - TCOD_path_data_t *path=(TCOD_path_data_t *)calloc(sizeof(TCOD_path_data_t),1); - path->w=w; - path->h=h; - path->grid=(float *)calloc(sizeof(float),w*h); - path->heur=(float *)calloc(sizeof(float),w*h); - path->prev=(dir_t *)calloc(sizeof(dir_t),w*h); - if (! path->grid || ! path->heur || ! path->prev ) { - TCOD_fatal("Fatal error : path finding module cannot allocate djikstra grids (size %dx%d)\n",w,h); - exit(1); - } - path->path=TCOD_list_new(); - path->heap=TCOD_list_new(); - return path; -} - -TCOD_path_t TCOD_path_new_using_map(TCOD_map_t map, float diagonalCost) { - TCOD_path_data_t *path; - TCOD_IFNOT(map != NULL) return NULL; - path=TCOD_path_new_intern(TCOD_map_get_width(map),TCOD_map_get_height(map)); - path->map=map; - path->diagonalCost=diagonalCost; - return (TCOD_path_t)path; -} - -TCOD_path_t TCOD_path_new_using_function(int map_width, int map_height, TCOD_path_func_t func, void *user_data, float diagonalCost) { - TCOD_path_data_t *path; - TCOD_IFNOT(func != NULL && map_width > 0 && map_height > 0) return NULL; - path=TCOD_path_new_intern(map_width,map_height); - path->func=func; - path->user_data=user_data; - path->diagonalCost=diagonalCost; - return (TCOD_path_t)path; -} - -bool TCOD_path_compute(TCOD_path_t p, int ox,int oy, int dx, int dy) { - TCOD_path_data_t *path=(TCOD_path_data_t *)p; - TCOD_IFNOT(p != NULL) return false; - path->ox=ox; - path->oy=oy; - path->dx=dx; - path->dy=dy; - TCOD_list_clear(path->path); - TCOD_list_clear(path->heap); - if ( ox == dx && oy == dy ) return true; /* trivial case */ - /* check that origin and destination are inside the map */ - TCOD_IFNOT((unsigned)ox < (unsigned)path->w && (unsigned)oy < (unsigned)path->h) return false; - TCOD_IFNOT((unsigned)dx < (unsigned)path->w && (unsigned)dy < (unsigned)path->h) return false; - /* initialize djikstra grids */ - memset(path->grid,0,sizeof(float)*path->w*path->h); - memset(path->prev,NONE,sizeof(dir_t)*path->w*path->h); - path->heur[ ox + oy * path->w ] = 1.0f; /* anything != 0 */ - TCOD_path_push_cell(path,ox,oy); /* put the origin cell as a bootstrap */ - /* fill the djikstra grid until we reach dx,dy */ - TCOD_path_set_cells(path); - if ( path->grid[dx + dy * path->w] == 0 ) return false; /* no path found */ - /* there is a path. retrieve it */ - do { - /* walk from destination to origin, using the 'prev' array */ - int step=path->prev[ dx + dy * path->w ]; - TCOD_list_push(path->path,(void *)(uintptr_t)step); - dx -= dirx[step]; - dy -= diry[step]; - } while ( dx != ox || dy != oy ); - return true; -} - -void TCOD_path_reverse(TCOD_path_t p) { - int tmp,i; - TCOD_path_data_t *path=(TCOD_path_data_t *)p; - TCOD_IFNOT(p != NULL) return ; - tmp=path->ox; - path->ox=path->dx; - path->dx=tmp; - tmp=path->oy; - path->oy=path->dy; - path->dy=tmp; - for (i=0; i < TCOD_list_size(path->path); i++) { - int d=(int)(uintptr_t)TCOD_list_get(path->path,i); - d = invdir[d]; - TCOD_list_set(path->path,(void *)(uintptr_t)d,i); - } -} - -bool TCOD_path_walk(TCOD_path_t p, int *x, int *y, bool recalculate_when_needed) { - int newx,newy; - int d; - TCOD_path_data_t *path=(TCOD_path_data_t *)p; - TCOD_IFNOT(p != NULL) return false; - if ( TCOD_path_is_empty(path) ) return false; - d=(int)(uintptr_t)TCOD_list_pop(path->path); - newx=path->ox + dirx[d]; - newy=path->oy + diry[d]; - /* check if the path is still valid */ - if ( TCOD_path_walk_cost(path,path->ox,path->oy,newx,newy) <= 0.0f ) { - /* path is blocked */ - if (! recalculate_when_needed ) return false; /* don't walk */ - /* calculate a new path */ - if (! TCOD_path_compute(path, path->ox,path->oy, path->dx,path->dy) ) return false ; /* cannot find a new path */ - return TCOD_path_walk(p,x,y,true); /* walk along the new path */ - } - if ( x ) *x=newx; - if ( y ) *y=newy; - path->ox=newx; - path->oy=newy; - return true; -} - -bool TCOD_path_is_empty(TCOD_path_t p) { - TCOD_path_data_t *path=(TCOD_path_data_t *)p; - TCOD_IFNOT(p != NULL) return true; - return TCOD_list_is_empty(path->path); -} - -int TCOD_path_size(TCOD_path_t p) { - TCOD_path_data_t *path=(TCOD_path_data_t *)p; - TCOD_IFNOT(p != NULL) return 0; - return TCOD_list_size(path->path); -} - -void TCOD_path_get(TCOD_path_t p, int index, int *x, int *y) { - int pos; - TCOD_path_data_t *path=(TCOD_path_data_t *)p; - TCOD_IFNOT(p != NULL) return; - if ( x ) *x=path->ox; - if ( y ) *y=path->oy; - pos = TCOD_list_size(path->path)-1; - do { - int step=(int)(uintptr_t)TCOD_list_get(path->path,pos); - if ( x ) *x += dirx[step]; - if ( y ) *y += diry[step]; - pos--;index--; - } while (index >= 0); -} - -void TCOD_path_delete(TCOD_path_t p) { - TCOD_path_data_t *path=(TCOD_path_data_t *)p; - TCOD_IFNOT(p != NULL) return; - if ( path->grid ) free(path->grid); - if ( path->heur ) free(path->heur); - if ( path->prev ) free(path->prev); - if ( path->path ) TCOD_list_delete(path->path); - if ( path->heap ) TCOD_list_delete(path->heap); - free(path); -} - -/* private stuff */ -/* add a new unvisited cells to the cells-to-treat list - * the list is in fact a min_heap. Cell at index i has its sons at 2*i+1 and 2*i+2 - */ -static void TCOD_path_push_cell(TCOD_path_data_t *path, int x, int y) { - heap_add(path,path->heap,x,y); -} - -/* get the best cell from the heap */ -static void TCOD_path_get_cell(TCOD_path_data_t *path, int *x, int *y, float *distance) { - uint32_t offset = heap_get(path,path->heap); - *x=(offset % path->w); - *y=(offset / path->w); - *distance=path->grid[offset]; -} -/* fill the grid, starting from the origin until we reach the destination */ -static void TCOD_path_set_cells(TCOD_path_data_t *path) { - while ( path->grid[path->dx + path->dy * path->w ] == 0 && ! TCOD_list_is_empty(path->heap) ) { - - int x,y,i,imax; - float distance; - TCOD_path_get_cell(path,&x,&y,&distance); - imax= ( path->diagonalCost == 0.0f ? 4 : 8) ; - for (i=0; i < imax; i++ ) { - /* convert i to dx,dy */ - static int idirx[]={0,-1,1,0,-1,1,-1,1}; - static int idiry[]={-1,0,0,1,-1,-1,1,1}; - /* convert i to direction */ - static dir_t prevdirs[] = { - NORTH, WEST, EAST, SOUTH, NORTH_WEST, NORTH_EAST,SOUTH_WEST,SOUTH_EAST - }; - /* coordinate of the adjacent cell */ - int cx=x+idirx[i]; - int cy=y+idiry[i]; - if ( cx >= 0 && cy >= 0 && cx < path->w && cy < path->h ) { - float walk_cost = TCOD_path_walk_cost(path,x,y,cx,cy); - if ( walk_cost > 0.0f ) { - /* in of the map and walkable */ - float covered=distance + walk_cost * (i>=4 ? path->diagonalCost : 1.0f); - float previousCovered = path->grid[cx + cy * path->w ]; - if ( previousCovered == 0 ) { - /* put a new cell in the heap */ - int offset=cx + cy * path->w; - /* A* heuristic : remaining distance */ - float remaining=(float)sqrt((cx-path->dx)*(cx-path->dx)+(cy-path->dy)*(cy-path->dy)); - path->grid[ offset ] = covered; - path->heur[ offset ] = covered + remaining; - path->prev[ offset ] = prevdirs[i]; - TCOD_path_push_cell(path,cx,cy); - } else if ( previousCovered > covered ) { - /* we found a better path to a cell already in the heap */ - int offset=cx + cy * path->w; - path->grid[ offset ] = covered; - path->heur[ offset ] -= (previousCovered - covered); /* fix the A* score */ - path->prev[ offset ] = prevdirs[i]; - /* reorder the heap */ - heap_reorder(path,offset); - } - } - } - } - } -} - -/* check if a cell is walkable (from the pathfinder point of view) */ -static float TCOD_path_walk_cost(TCOD_path_data_t *path, int xFrom, int yFrom, int xTo, int yTo) { - if ( path->map ) return TCOD_map_is_walkable(path->map,xTo,yTo) ? 1.0f : 0.0f; - return path->func(xFrom,yFrom,xTo,yTo,path->user_data); -} - -void TCOD_path_get_origin(TCOD_path_t p, int *x, int *y) { - TCOD_path_data_t *path=(TCOD_path_data_t *)p; - TCOD_IFNOT(p != NULL) return; - if ( x ) *x=path->ox; - if ( y ) *y=path->oy; -} - -void TCOD_path_get_destination(TCOD_path_t p, int *x, int *y) { - TCOD_path_data_t *path=(TCOD_path_data_t *)p; - TCOD_IFNOT(p != NULL) return; - if ( x ) *x=path->dx; - if ( y ) *y=path->dy; -} - -/* ------------------------------------------------------- * - * Dijkstra * - * written by Mingos * - * ----------------- * - * A floodfill-like algo that will calculate all distances * - * to all accessible cells (nodes) from a given root node. * - * ------------------------------------------------------- */ - -/* Dijkstra data structure */ -typedef struct { - int diagonal_cost; - int width, height, nodes_max; - TCOD_map_t map; /* a TCODMap with walkability data */ - TCOD_path_func_t func; - void *user_data; - unsigned int * distances; /* distances grid */ - unsigned int * nodes; /* the processed nodes */ - TCOD_list_t path; -} dijkstra_t; - -/* create a Dijkstra object */ -TCOD_dijkstra_t TCOD_dijkstra_new (TCOD_map_t map, float diagonalCost) { - dijkstra_t * data ; - TCOD_IFNOT(map != NULL) return NULL; - data = malloc(sizeof(dijkstra_t)); - data->map = map; - data->func = NULL; - data->user_data=NULL; - data->distances = malloc(TCOD_map_get_nb_cells(data->map)*sizeof(int)); - data->nodes = malloc(TCOD_map_get_nb_cells(data->map)*sizeof(int)); - data->diagonal_cost = (int)((diagonalCost * 100.0f)+0.1f); /* because (int)(1.41f*100.0f) == 140!!! */ - data->width = TCOD_map_get_width(data->map); - data->height = TCOD_map_get_height(data->map); - data->nodes_max = TCOD_map_get_nb_cells(data->map); - data->path = TCOD_list_new(); - return (TCOD_dijkstra_t)data; -} - -TCOD_dijkstra_t TCOD_dijkstra_new_using_function(int map_width, int map_height, TCOD_path_func_t func, void *user_data, float diagonalCost) { - dijkstra_t * data; - TCOD_IFNOT(func != NULL && map_width > 0 && map_height > 0) return NULL; - data = malloc(sizeof(dijkstra_t)); - data->map = NULL; - data->func = func; - data->user_data=user_data; - data->distances = malloc(map_width*map_height*sizeof(int)*4); - data->nodes = malloc(map_width*map_height*sizeof(int)*4); - data->diagonal_cost = (int)((diagonalCost * 100.0f)+0.1f); /* because (int)(1.41f*100.0f) == 140!!! */ - data->width = map_width; - data->height = map_height; - data->nodes_max = map_width*map_height; - data->path = TCOD_list_new(); - return (TCOD_dijkstra_t)data; -} - - -/* compute a Dijkstra grid */ -void TCOD_dijkstra_compute (TCOD_dijkstra_t dijkstra, int root_x, int root_y) { - dijkstra_t * data = (dijkstra_t*)dijkstra; - /* map size data */ - unsigned int mx = data->width; - unsigned int my = data->height; - unsigned int mmax = data->nodes_max; - /* encode the root coords in one integer */ - unsigned int root = (root_y * mx) + root_x; - /* some stuff to walk through the nodes table */ - unsigned int index = 0; /* the index of the first node in queue */ - unsigned int last_index = 1; /* total nb of registered queue indices */ - unsigned int * nodes = data->nodes; /* table of nodes to which the indices above apply */ - /* ok, here's the order of node processing: W, S, E, N, NW, NE, SE, SW */ - static int dx[8] = { -1, 0, 1, 0, -1, 1, 1, -1 }; - static int dy[8] = { 0, -1, 0, 1, -1, -1, 1, 1 }; - /* and distances for each index */ - int dd[8] = { 100, 100, 100, 100, data->diagonal_cost, data->diagonal_cost, data->diagonal_cost, data->diagonal_cost }; - /* if diagonal_cost is 0, disallow diagonal moves */ - int imax = (data->diagonal_cost == 0 ? 4 : 8); - /* aight, now set the distances table and set everything to infinity */ - unsigned int * distances = data->distances; - TCOD_IFNOT(data != NULL) return; - TCOD_IFNOT((unsigned)root_x < (unsigned)mx && (unsigned)root_y < (unsigned)my) return; - memset(distances,0xFFFFFFFF,mmax*sizeof(int)); - memset(nodes,0xFFFFFFFF,mmax*sizeof(int)); - /* data for root node is known... */ - distances[root] = 0; - nodes[index] = root; /*set starting note to root */ - /* and the loop */ - do { - unsigned int x, y; - int i; - if (nodes[index] == 0xFFFFFFFF) { - continue; - } - - /* coordinates of currently processed node */ - x = nodes[index] % mx; - y = nodes[index] / mx; - - /* check adjacent nodes */ - for(i=0;imap ) dt += dd[i]; - else { - /* distance given by the user callback */ - userDist=data->func(x,y,tx,ty,data->user_data); - dt += (unsigned int)(userDist*dd[i]); - } - /* ..., encode coordinates, ... */ - new_node = (ty * mx) + tx; - /* and check if the node's eligible for queuing */ - if (distances[new_node] > dt) { - unsigned int j; - /* if not walkable, don't process it */ - if (data->map && !TCOD_map_is_walkable(data->map,tx,ty)) continue; - else if ( data->func && userDist <= 0.0f ) continue; - distances[new_node] = dt; /* set processed node's distance */ - /* place the processed node in the queue before the last queued node with greater distance */ - j = last_index - 1; - while (distances[nodes[j]] >= distances[new_node]) { - /* this ensures that if the node has been queued previously, but with a higher distance, it's removed */ - if (nodes[j] == new_node) { - int k = j; - while ((unsigned)k <= last_index) { - nodes[k] = nodes[k+1]; - k++; - } - last_index--; - } - else nodes[j+1] = nodes[j]; - j--; - } - last_index++; /* increase total indices count */ - nodes[j+1] = new_node; /* and finally put the node where it belongs in the queue */ - } - } - } - } while (mmax > ++index); -} - -/* get distance from source */ -float TCOD_dijkstra_get_distance (TCOD_dijkstra_t dijkstra, int x, int y) { - dijkstra_t * data = (dijkstra_t*)dijkstra; - unsigned int * distances; - TCOD_IFNOT(data != NULL) return -1.0f; - TCOD_IFNOT ((unsigned)x < (unsigned)data->width && (unsigned)y < (unsigned)data->height) return -1.0f; - if (data->distances[(y*data->width)+x] == 0xFFFFFFFF) return -1.0f; - distances = data->distances; - return ((float)distances[(y * data->width) + x] * 0.01f); -} - -unsigned int dijkstra_get_int_distance (dijkstra_t * data, int x, int y) { - unsigned int * distances = data->distances; - return distances[(y * data->width) + x]; -} - -/* create a path */ -bool TCOD_dijkstra_path_set (TCOD_dijkstra_t dijkstra, int x, int y) { - dijkstra_t * data = (dijkstra_t*)dijkstra; - int px = x, py = y; - static int dx[9] = { -1, 0, 1, 0, -1, 1, 1, -1, 0 }; - static int dy[9] = { 0, -1, 0, 1, -1, -1, 1, 1, 0 }; - unsigned int distances[8] = {0}; - int lowest_index; - int imax = (data->diagonal_cost == 0 ? 4 : 8); - TCOD_IFNOT(data != NULL) return false; - TCOD_IFNOT((unsigned)x < (unsigned)data->width && (unsigned)y < (unsigned)data->height) return false; - /* check that destination is reachable */ - if ( dijkstra_get_int_distance(data,x,y) == 0xFFFFFFFF ) return false; - TCOD_list_clear(data->path); - do { - unsigned int lowest; - int i; - TCOD_list_push(data->path,(const void*)(uintptr_t)((py * data->width) + px)); - for(i=0;iwidth && (unsigned)cy < (unsigned)data->height) distances[i] = dijkstra_get_int_distance(data,cx,cy); - else distances[i] = 0xFFFFFFFF; - } - lowest = dijkstra_get_int_distance(data,px,py); - lowest_index = 8; - for(i=0;ipath); - return true; -} - -void TCOD_dijkstra_reverse(TCOD_dijkstra_t dijkstra) { - dijkstra_t * data = (dijkstra_t*)dijkstra; - TCOD_IFNOT(data != NULL) return; - TCOD_list_reverse(data->path); -} - -/* walk the path */ -bool TCOD_dijkstra_path_walk (TCOD_dijkstra_t dijkstra, int *x, int *y) { - dijkstra_t * data = (dijkstra_t*)dijkstra; - TCOD_IFNOT(data != NULL) return false; - if (TCOD_list_is_empty(data->path)) return false; - else { - unsigned int node = (unsigned int)(uintptr_t)TCOD_list_pop(data->path); - if ( x ) *x = (int)(node % data->width); - if ( y ) *y = (int)(node / data->width); - } - return true; -} - -/* delete a Dijkstra object */ -void TCOD_dijkstra_delete (TCOD_dijkstra_t dijkstra) { - dijkstra_t * data = (dijkstra_t*)dijkstra; - TCOD_IFNOT(data != NULL) return; - if ( data->distances ) free(data->distances); - if ( data->nodes ) free(data->nodes); - if ( data->path ) TCOD_list_delete(data->path); - free(data); -} - -bool TCOD_dijkstra_is_empty(TCOD_dijkstra_t p) { - dijkstra_t * data = (dijkstra_t*)p; - TCOD_IFNOT(data != NULL) return true; - return TCOD_list_is_empty(data->path); -} - -int TCOD_dijkstra_size(TCOD_dijkstra_t p) { - dijkstra_t * data = (dijkstra_t*)p; - TCOD_IFNOT(data != NULL) return 0; - return TCOD_list_size(data->path); -} - -void TCOD_dijkstra_get(TCOD_dijkstra_t p, int index, int *x, int *y) { - dijkstra_t * data = (dijkstra_t*)p; - unsigned int node ; - TCOD_IFNOT(data != NULL) return; - node = (unsigned int)(uintptr_t)TCOD_list_get(data->path,TCOD_list_size(data->path)-index-1); - if ( x ) *x = (int)(node % data->width); - if ( y ) *y = (int)(node / data->width); -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "path.h" + +#include +#include +#include +#include + +#include "libtcod_int.h" +enum { NORTH_WEST,NORTH, NORTH_EAST, WEST,NONE,EAST, SOUTH_WEST,SOUTH,SOUTH_EAST }; +typedef unsigned char dir_t; + +/* convert dir_t to dx,dy */ +static int dirx[]={-1,0,1,-1,0,1,-1,0,1}; +static int diry[]={-1,-1,-1,0,0,0,1,1,1}; +static int invdir[] = {SOUTH_EAST,SOUTH,SOUTH_WEST,EAST,NONE,WEST,NORTH_EAST,NORTH,NORTH_WEST}; + +typedef struct TCOD_Path { + int ox,oy; /* coordinates of the creature position */ + int dx,dy; /* coordinates of the creature's destination */ + TCOD_list_t path; /* list of dir_t to follow the path */ + int w,h; /* map size */ + float *grid; /* wxh djikstra distance grid (covered distance) */ + float *heur; /* wxh A* score grid (covered distance + estimated remaining distance) */ + dir_t *prev; /* wxh 'previous' grid : direction to the previous cell */ + float diagonalCost; + TCOD_list_t heap; /* min_heap used in the algorithm. stores the offset in grid/heur (offset=x+y*w) */ + TCOD_map_t map; + TCOD_path_func_t func; + void *user_data; +} TCOD_path_data_t; + +/* small layer on top of TCOD_list_t to implement a binary heap (min_heap) */ +static void heap_sift_down(TCOD_path_data_t *path, TCOD_list_t heap) { + /* sift-down : move the first element of the heap down to its right place */ + int cur=0; + int end = TCOD_list_size(heap)-1; + int child=1; + uintptr_t *array=(uintptr_t *)TCOD_list_begin(heap); + while ( child <= end ) { + int toSwap=cur; + uintptr_t off_cur=array[cur]; + float cur_dist=path->heur[off_cur]; + float swapValue=cur_dist; + uintptr_t off_child=array[child]; + float child_dist=path->heur[off_child]; + if ( child_dist < cur_dist ) { + toSwap=child; + swapValue=child_dist; + } + if ( child < end ) { + /* get the min between child and child+1 */ + uintptr_t off_child2=array[child+1]; + float child2_dist=path->heur[off_child2]; + if ( swapValue > child2_dist ) { + toSwap=child+1; + swapValue=child2_dist; + } + } + if ( toSwap != cur ) { + /* get down one level */ + uintptr_t tmp = array[toSwap]; + array[toSwap]=array[cur]; + array[cur]=tmp; + cur=toSwap; + } else return; + child=cur*2+1; + } +} + +static void heap_sift_up(TCOD_path_data_t *path, TCOD_list_t heap) { + /* sift-up : move the last element of the heap up to its right place */ + int end = TCOD_list_size(heap)-1; + int child=end; + uintptr_t *array=(uintptr_t *)TCOD_list_begin(heap); + while ( child > 0 ) { + uintptr_t off_child=array[child]; + float child_dist=path->heur[off_child]; + int parent = (child-1)/2; + uintptr_t off_parent=array[parent]; + float parent_dist=path->heur[off_parent]; + if ( parent_dist > child_dist ) { + /* get up one level */ + uintptr_t tmp = array[child]; + array[child]=array[parent]; + array[parent]=tmp; + child=parent; + } else return; + } +} + +/* add a coordinate pair in the heap so that the heap root always contains the minimum A* score */ +static void heap_add(TCOD_path_data_t *path, TCOD_list_t heap, int x, int y) { + /* append the new value to the end of the heap */ + uintptr_t off=x+y*path->w; + TCOD_list_push(heap,(void *)off); + /* bubble the value up to its real position */ + heap_sift_up(path,heap); +} + +/* get the coordinate pair with the minimum A* score from the heap */ +static uint32_t heap_get(TCOD_path_data_t *path,TCOD_list_t heap) { + /* return the first value of the heap (minimum score) */ + uintptr_t *array=(uintptr_t *)TCOD_list_begin(heap); + int end=TCOD_list_size(heap)-1; + uint32_t off=(uint32_t)(array[0]); + /* take the last element and put it at first position (heap root) */ + array[0] = array[end]; + TCOD_list_pop(heap); + /* and bubble it down to its real position */ + heap_sift_down(path,heap); + return off; +} + +/* this is the slow part, when we change the heuristic of a cell already in the heap */ +static void heap_reorder(TCOD_path_data_t *path, uint32_t offset) { + uintptr_t *array=(uintptr_t *)TCOD_list_begin(path->heap); + uintptr_t *end=(uintptr_t *)TCOD_list_end(path->heap); + uintptr_t *cur=array; + uintptr_t off_idx=0; + float value; + int idx=0; + int heap_size=TCOD_list_size(path->heap); + /* find the node corresponding to offset ... SLOW !! */ + while (cur != end) { + if (*cur == offset ) break; + cur++;idx++; + } + if ( cur == end ) return; + off_idx=array[idx]; + value=path->heur[off_idx]; + if ( idx > 0 ) { + int parent=(idx-1)/2; + /* compare to its parent */ + uintptr_t off_parent=array[parent]; + float parent_value=path->heur[off_parent]; + if (value < parent_value) { + /* smaller. bubble it up */ + while ( idx > 0 && value < parent_value ) { + /* swap with parent */ + array[parent]=off_idx; + array[idx] = off_parent; + idx=parent; + if ( idx > 0 ) { + parent=(idx-1)/2; + off_parent=array[parent]; + parent_value=path->heur[off_parent]; + } + } + return; + } + } + /* compare to its sons */ + while ( idx*2+1 < heap_size ) { + int child=idx*2+1; + uintptr_t off_child=array[child]; + int toSwap=idx; + int child2; + float swapValue=value; + if ( path->heur[off_child] < value ) { + /* swap with son1 ? */ + toSwap=child; + swapValue=path->heur[off_child]; + } + child2 = child+1; + if ( child2 < heap_size ) { + uintptr_t off_child2=array[child2]; + if ( path->heur[off_child2] < swapValue) { + /* swap with son2 */ + toSwap=child2; + } + } + if ( toSwap != idx ) { + /* bigger. bubble it down */ + uintptr_t tmp = array[toSwap]; + array[toSwap]=array[idx]; + array[idx] = tmp; + idx=toSwap; + } else return; + } +} + + +/* private functions */ +static void TCOD_path_push_cell(TCOD_path_data_t *path, int x, int y); +static void TCOD_path_get_cell(TCOD_path_data_t *path, int *x, int *y, float *distance); +static void TCOD_path_set_cells(TCOD_path_data_t *path); +static float TCOD_path_walk_cost(TCOD_path_data_t *path, int xFrom, int yFrom, int xTo, int yTo); + +static TCOD_path_data_t *TCOD_path_new_intern(int w, int h) { + TCOD_path_data_t *path=(TCOD_path_data_t *)calloc(sizeof(TCOD_path_data_t),1); + path->w=w; + path->h=h; + path->grid=(float *)calloc(sizeof(float),w*h); + path->heur=(float *)calloc(sizeof(float),w*h); + path->prev=(dir_t *)calloc(sizeof(dir_t),w*h); + if (! path->grid || ! path->heur || ! path->prev ) { + TCOD_fatal("Fatal error : path finding module cannot allocate djikstra grids (size %dx%d)\n",w,h); + exit(1); + } + path->path=TCOD_list_new(); + path->heap=TCOD_list_new(); + return path; +} + +TCOD_path_t TCOD_path_new_using_map(TCOD_map_t map, float diagonalCost) { + TCOD_path_data_t *path; + TCOD_IFNOT(map != NULL) return NULL; + path=TCOD_path_new_intern(TCOD_map_get_width(map),TCOD_map_get_height(map)); + path->map=map; + path->diagonalCost=diagonalCost; + return (TCOD_path_t)path; +} + +TCOD_path_t TCOD_path_new_using_function(int map_width, int map_height, TCOD_path_func_t func, void *user_data, float diagonalCost) { + TCOD_path_data_t *path; + TCOD_IFNOT(func != NULL && map_width > 0 && map_height > 0) return NULL; + path=TCOD_path_new_intern(map_width,map_height); + path->func=func; + path->user_data=user_data; + path->diagonalCost=diagonalCost; + return (TCOD_path_t)path; +} + +bool TCOD_path_compute(TCOD_path_t p, int ox,int oy, int dx, int dy) { + TCOD_path_data_t *path=(TCOD_path_data_t *)p; + TCOD_IFNOT(p != NULL) return false; + path->ox=ox; + path->oy=oy; + path->dx=dx; + path->dy=dy; + TCOD_list_clear(path->path); + TCOD_list_clear(path->heap); + if ( ox == dx && oy == dy ) return true; /* trivial case */ + /* check that origin and destination are inside the map */ + TCOD_IFNOT((unsigned)ox < (unsigned)path->w && (unsigned)oy < (unsigned)path->h) return false; + TCOD_IFNOT((unsigned)dx < (unsigned)path->w && (unsigned)dy < (unsigned)path->h) return false; + /* initialize djikstra grids */ + memset(path->grid,0,sizeof(float)*path->w*path->h); + memset(path->prev,NONE,sizeof(dir_t)*path->w*path->h); + path->heur[ ox + oy * path->w ] = 1.0f; /* anything != 0 */ + TCOD_path_push_cell(path,ox,oy); /* put the origin cell as a bootstrap */ + /* fill the djikstra grid until we reach dx,dy */ + TCOD_path_set_cells(path); + if ( path->grid[dx + dy * path->w] == 0 ) return false; /* no path found */ + /* there is a path. retrieve it */ + do { + /* walk from destination to origin, using the 'prev' array */ + int step=path->prev[ dx + dy * path->w ]; + TCOD_list_push(path->path,(void *)(uintptr_t)step); + dx -= dirx[step]; + dy -= diry[step]; + } while ( dx != ox || dy != oy ); + return true; +} + +void TCOD_path_reverse(TCOD_path_t p) { + int tmp,i; + TCOD_path_data_t *path=(TCOD_path_data_t *)p; + TCOD_IFNOT(p != NULL) return ; + tmp=path->ox; + path->ox=path->dx; + path->dx=tmp; + tmp=path->oy; + path->oy=path->dy; + path->dy=tmp; + for (i=0; i < TCOD_list_size(path->path); i++) { + int d=(int)(uintptr_t)TCOD_list_get(path->path,i); + d = invdir[d]; + TCOD_list_set(path->path,(void *)(uintptr_t)d,i); + } +} + +bool TCOD_path_walk(TCOD_path_t p, int *x, int *y, bool recalculate_when_needed) { + int newx,newy; + int d; + TCOD_path_data_t *path=(TCOD_path_data_t *)p; + TCOD_IFNOT(p != NULL) return false; + if ( TCOD_path_is_empty(path) ) return false; + d=(int)(uintptr_t)TCOD_list_pop(path->path); + newx=path->ox + dirx[d]; + newy=path->oy + diry[d]; + /* check if the path is still valid */ + if ( TCOD_path_walk_cost(path,path->ox,path->oy,newx,newy) <= 0.0f ) { + /* path is blocked */ + if (! recalculate_when_needed ) return false; /* don't walk */ + /* calculate a new path */ + if (! TCOD_path_compute(path, path->ox,path->oy, path->dx,path->dy) ) return false ; /* cannot find a new path */ + return TCOD_path_walk(p,x,y,true); /* walk along the new path */ + } + if ( x ) *x=newx; + if ( y ) *y=newy; + path->ox=newx; + path->oy=newy; + return true; +} + +bool TCOD_path_is_empty(TCOD_path_t p) { + TCOD_path_data_t *path=(TCOD_path_data_t *)p; + TCOD_IFNOT(p != NULL) return true; + return TCOD_list_is_empty(path->path); +} + +int TCOD_path_size(TCOD_path_t p) { + TCOD_path_data_t *path=(TCOD_path_data_t *)p; + TCOD_IFNOT(p != NULL) return 0; + return TCOD_list_size(path->path); +} + +void TCOD_path_get(TCOD_path_t p, int index, int *x, int *y) { + int pos; + TCOD_path_data_t *path=(TCOD_path_data_t *)p; + TCOD_IFNOT(p != NULL) return; + if ( x ) *x=path->ox; + if ( y ) *y=path->oy; + pos = TCOD_list_size(path->path)-1; + do { + int step=(int)(uintptr_t)TCOD_list_get(path->path,pos); + if ( x ) *x += dirx[step]; + if ( y ) *y += diry[step]; + pos--;index--; + } while (index >= 0); +} + +void TCOD_path_delete(TCOD_path_t p) { + TCOD_path_data_t *path=(TCOD_path_data_t *)p; + TCOD_IFNOT(p != NULL) return; + if ( path->grid ) free(path->grid); + if ( path->heur ) free(path->heur); + if ( path->prev ) free(path->prev); + if ( path->path ) TCOD_list_delete(path->path); + if ( path->heap ) TCOD_list_delete(path->heap); + free(path); +} + +/* private stuff */ +/* add a new unvisited cells to the cells-to-treat list + * the list is in fact a min_heap. Cell at index i has its sons at 2*i+1 and 2*i+2 + */ +static void TCOD_path_push_cell(TCOD_path_data_t *path, int x, int y) { + heap_add(path,path->heap,x,y); +} + +/* get the best cell from the heap */ +static void TCOD_path_get_cell(TCOD_path_data_t *path, int *x, int *y, float *distance) { + uint32_t offset = heap_get(path,path->heap); + *x=(offset % path->w); + *y=(offset / path->w); + *distance=path->grid[offset]; +} +/* fill the grid, starting from the origin until we reach the destination */ +static void TCOD_path_set_cells(TCOD_path_data_t *path) { + while ( path->grid[path->dx + path->dy * path->w ] == 0 && ! TCOD_list_is_empty(path->heap) ) { + + int x,y,i,imax; + float distance; + TCOD_path_get_cell(path,&x,&y,&distance); + imax= ( path->diagonalCost == 0.0f ? 4 : 8) ; + for (i=0; i < imax; i++ ) { + /* convert i to dx,dy */ + static int idirx[]={0,-1,1,0,-1,1,-1,1}; + static int idiry[]={-1,0,0,1,-1,-1,1,1}; + /* convert i to direction */ + static dir_t prevdirs[] = { + NORTH, WEST, EAST, SOUTH, NORTH_WEST, NORTH_EAST,SOUTH_WEST,SOUTH_EAST + }; + /* coordinate of the adjacent cell */ + int cx=x+idirx[i]; + int cy=y+idiry[i]; + if ( cx >= 0 && cy >= 0 && cx < path->w && cy < path->h ) { + float walk_cost = TCOD_path_walk_cost(path,x,y,cx,cy); + if ( walk_cost > 0.0f ) { + /* in of the map and walkable */ + float covered=distance + walk_cost * (i>=4 ? path->diagonalCost : 1.0f); + float previousCovered = path->grid[cx + cy * path->w ]; + if ( previousCovered == 0 ) { + /* put a new cell in the heap */ + int offset=cx + cy * path->w; + /* A* heuristic : remaining distance */ + float remaining=(float)sqrt((cx-path->dx)*(cx-path->dx)+(cy-path->dy)*(cy-path->dy)); + path->grid[ offset ] = covered; + path->heur[ offset ] = covered + remaining; + path->prev[ offset ] = prevdirs[i]; + TCOD_path_push_cell(path,cx,cy); + } else if ( previousCovered > covered ) { + /* we found a better path to a cell already in the heap */ + int offset=cx + cy * path->w; + path->grid[ offset ] = covered; + path->heur[ offset ] -= (previousCovered - covered); /* fix the A* score */ + path->prev[ offset ] = prevdirs[i]; + /* reorder the heap */ + heap_reorder(path,offset); + } + } + } + } + } +} + +/* check if a cell is walkable (from the pathfinder point of view) */ +static float TCOD_path_walk_cost(TCOD_path_data_t *path, int xFrom, int yFrom, int xTo, int yTo) { + if ( path->map ) return TCOD_map_is_walkable(path->map,xTo,yTo) ? 1.0f : 0.0f; + return path->func(xFrom,yFrom,xTo,yTo,path->user_data); +} + +void TCOD_path_get_origin(TCOD_path_t p, int *x, int *y) { + TCOD_path_data_t *path=(TCOD_path_data_t *)p; + TCOD_IFNOT(p != NULL) return; + if ( x ) *x=path->ox; + if ( y ) *y=path->oy; +} + +void TCOD_path_get_destination(TCOD_path_t p, int *x, int *y) { + TCOD_path_data_t *path=(TCOD_path_data_t *)p; + TCOD_IFNOT(p != NULL) return; + if ( x ) *x=path->dx; + if ( y ) *y=path->dy; +} + +/* ------------------------------------------------------- * + * Dijkstra * + * written by Mingos * + * ----------------- * + * A floodfill-like algo that will calculate all distances * + * to all accessible cells (nodes) from a given root node. * + * ------------------------------------------------------- */ + +/* create a Dijkstra object */ +TCOD_dijkstra_t TCOD_dijkstra_new (TCOD_map_t map, float diagonalCost) { + TCOD_Dijkstra* data; + TCOD_IFNOT(map != NULL) return NULL; + data = malloc(sizeof(TCOD_Dijkstra)); + data->map = map; + data->func = NULL; + data->user_data=NULL; + data->distances = malloc(TCOD_map_get_nb_cells(data->map)*sizeof(int)); + data->nodes = malloc(TCOD_map_get_nb_cells(data->map)*sizeof(int)); + data->diagonal_cost = (int)((diagonalCost * 100.0f)+0.1f); /* because (int)(1.41f*100.0f) == 140!!! */ + data->width = TCOD_map_get_width(data->map); + data->height = TCOD_map_get_height(data->map); + data->nodes_max = TCOD_map_get_nb_cells(data->map); + data->path = TCOD_list_new(); + return data; +} + +TCOD_dijkstra_t TCOD_dijkstra_new_using_function(int map_width, int map_height, TCOD_path_func_t func, void *user_data, float diagonalCost) { + TCOD_Dijkstra* data; + TCOD_IFNOT(func != NULL && map_width > 0 && map_height > 0) return NULL; + data = malloc(sizeof(TCOD_Dijkstra)); + data->map = NULL; + data->func = func; + data->user_data=user_data; + data->distances = malloc(map_width*map_height*sizeof(int)*4); + data->nodes = malloc(map_width*map_height*sizeof(int)*4); + data->diagonal_cost = (int)((diagonalCost * 100.0f)+0.1f); /* because (int)(1.41f*100.0f) == 140!!! */ + data->width = map_width; + data->height = map_height; + data->nodes_max = map_width*map_height; + data->path = TCOD_list_new(); + return data; +} + + +/* compute a Dijkstra grid */ +void TCOD_dijkstra_compute (TCOD_Dijkstra* data, int root_x, int root_y) { + /* map size data */ + unsigned int mx = data->width; + unsigned int my = data->height; + unsigned int mmax = data->nodes_max; + /* encode the root coords in one integer */ + unsigned int root = (root_y * mx) + root_x; + /* some stuff to walk through the nodes table */ + unsigned int index = 0; /* the index of the first node in queue */ + unsigned int last_index = 1; /* total nb of registered queue indices */ + unsigned int * nodes = data->nodes; /* table of nodes to which the indices above apply */ + /* ok, here's the order of node processing: W, S, E, N, NW, NE, SE, SW */ + static int dx[8] = { -1, 0, 1, 0, -1, 1, 1, -1 }; + static int dy[8] = { 0, -1, 0, 1, -1, -1, 1, 1 }; + /* and distances for each index */ + int dd[8] = { 100, 100, 100, 100, data->diagonal_cost, data->diagonal_cost, data->diagonal_cost, data->diagonal_cost }; + /* if diagonal_cost is 0, disallow diagonal moves */ + int imax = (data->diagonal_cost == 0 ? 4 : 8); + /* aight, now set the distances table and set everything to infinity */ + unsigned int * distances = data->distances; + TCOD_IFNOT(data != NULL) return; + TCOD_IFNOT((unsigned)root_x < (unsigned)mx && (unsigned)root_y < (unsigned)my) return; + memset(distances,0xFFFFFFFF,mmax*sizeof(int)); + memset(nodes,0xFFFFFFFF,mmax*sizeof(int)); + /* data for root node is known... */ + distances[root] = 0; + nodes[index] = root; /*set starting note to root */ + /* and the loop */ + do { + unsigned int x, y; + int i; + if (nodes[index] == 0xFFFFFFFF) { + continue; + } + + /* coordinates of currently processed node */ + x = nodes[index] % mx; + y = nodes[index] / mx; + + /* check adjacent nodes */ + for(i=0;imap ) dt += dd[i]; + else { + /* distance given by the user callback */ + userDist=data->func(x,y,tx,ty,data->user_data); + dt += (unsigned int)(userDist*dd[i]); + } + /* ..., encode coordinates, ... */ + new_node = (ty * mx) + tx; + /* and check if the node's eligible for queuing */ + if (distances[new_node] > dt) { + unsigned int j; + /* if not walkable, don't process it */ + if (data->map && !TCOD_map_is_walkable(data->map,tx,ty)) continue; + else if ( data->func && userDist <= 0.0f ) continue; + distances[new_node] = dt; /* set processed node's distance */ + /* place the processed node in the queue before the last queued node with greater distance */ + j = last_index - 1; + while (distances[nodes[j]] >= distances[new_node]) { + /* this ensures that if the node has been queued previously, but with a higher distance, it's removed */ + if (nodes[j] == new_node) { + int k = j; + while ((unsigned)k <= last_index) { + nodes[k] = nodes[k+1]; + k++; + } + last_index--; + } + else nodes[j+1] = nodes[j]; + j--; + } + last_index++; /* increase total indices count */ + nodes[j+1] = new_node; /* and finally put the node where it belongs in the queue */ + } + } + } + } while (mmax > ++index); +} + +/* get distance from source */ +float TCOD_dijkstra_get_distance (TCOD_Dijkstra* data, int x, int y) { + unsigned int * distances; + TCOD_IFNOT(data != NULL) return -1.0f; + TCOD_IFNOT ((unsigned)x < (unsigned)data->width && (unsigned)y < (unsigned)data->height) return -1.0f; + if (data->distances[(y*data->width)+x] == 0xFFFFFFFF) return -1.0f; + distances = data->distances; + return ((float)distances[(y * data->width) + x] * 0.01f); +} + +unsigned int dijkstra_get_int_distance (TCOD_Dijkstra* data, int x, int y) { + unsigned int * distances = data->distances; + return distances[(y * data->width) + x]; +} + +/* create a path */ +bool TCOD_dijkstra_path_set (TCOD_Dijkstra* data, int x, int y) { + int px = x, py = y; + static int dx[9] = { -1, 0, 1, 0, -1, 1, 1, -1, 0 }; + static int dy[9] = { 0, -1, 0, 1, -1, -1, 1, 1, 0 }; + unsigned int distances[8] = {0}; + int lowest_index; + int imax = (data->diagonal_cost == 0 ? 4 : 8); + TCOD_IFNOT(data != NULL) return false; + TCOD_IFNOT((unsigned)x < (unsigned)data->width && (unsigned)y < (unsigned)data->height) return false; + /* check that destination is reachable */ + if ( dijkstra_get_int_distance(data,x,y) == 0xFFFFFFFF ) return false; + TCOD_list_clear(data->path); + do { + unsigned int lowest; + int i; + TCOD_list_push(data->path,(const void*)(uintptr_t)((py * data->width) + px)); + for(i=0;iwidth && (unsigned)cy < (unsigned)data->height) distances[i] = dijkstra_get_int_distance(data,cx,cy); + else distances[i] = 0xFFFFFFFF; + } + lowest = dijkstra_get_int_distance(data,px,py); + lowest_index = 8; + for(i=0;ipath); + return true; +} + +void TCOD_dijkstra_reverse(TCOD_Dijkstra* data) { + TCOD_IFNOT(data != NULL) return; + TCOD_list_reverse(data->path); +} + +/* walk the path */ +bool TCOD_dijkstra_path_walk (TCOD_Dijkstra* data, int *x, int *y) { + TCOD_IFNOT(data != NULL) return false; + if (TCOD_list_is_empty(data->path)) return false; + else { + unsigned int node = (unsigned int)(uintptr_t)TCOD_list_pop(data->path); + if ( x ) *x = (int)(node % data->width); + if ( y ) *y = (int)(node / data->width); + } + return true; +} + +/* delete a Dijkstra object */ +void TCOD_dijkstra_delete (TCOD_Dijkstra* data) { + TCOD_IFNOT(data != NULL) return; + if ( data->distances ) free(data->distances); + if ( data->nodes ) free(data->nodes); + if ( data->path ) TCOD_list_delete(data->path); + free(data); +} + +bool TCOD_dijkstra_is_empty(TCOD_Dijkstra* data) { + TCOD_IFNOT(data != NULL) return true; + return TCOD_list_is_empty(data->path); +} + +int TCOD_dijkstra_size(TCOD_Dijkstra* data) { + TCOD_IFNOT(data != NULL) return 0; + return TCOD_list_size(data->path); +} + +void TCOD_dijkstra_get(TCOD_Dijkstra* data, int index, int *x, int *y) { + unsigned int node ; + TCOD_IFNOT(data != NULL) return; + node = (unsigned int)(uintptr_t)TCOD_list_get(data->path,TCOD_list_size(data->path)-index-1); + if ( x ) *x = (int)(node % data->width); + if ( y ) *y = (int)(node / data->width); +} diff --git a/tcod_sys/libtcod/src/libtcod/pathfinder.c b/tcod_sys/libtcod/src/libtcod/pathfinder.c new file mode 100644 index 000000000..1e9f88a33 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinder.c @@ -0,0 +1,279 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "pathfinder.h" + +#include + +static void* array_index(const struct TCOD_ArrayData* arr, const int* index) +{ + unsigned char* ptr = arr->data; + for (int i = 0; i < arr->ndim; ++i) { + ptr += arr->strides[i] * index[i]; + } + return (void*)ptr; +} + +static int array_get(const struct TCOD_ArrayData* arr, const int* index) +{ + void* ptr = array_index(arr, index); + switch (arr->int_type) { + case 1: return *(uint8_t*)ptr; + case 2: return *(uint16_t*)ptr; + case 4: return *(uint32_t*)ptr; + case 8: return *(uint64_t*)ptr; + case -1: return *(int8_t*)ptr; + case -2: return *(int16_t*)ptr; + case -4: return *(int32_t*)ptr; + case -8: return *(int64_t*)ptr; + default: return 0; + } +} + +static void array_set( + const struct TCOD_ArrayData* arr, const int* index, int value) +{ + void* ptr = array_index(arr, index); + switch (arr->int_type) { + case 1: *(uint8_t*)ptr = (uint8_t)value; return; + case 2: *(uint16_t*)ptr = (uint16_t)value; return; + case 4: *(uint32_t*)ptr = (uint32_t)value; return; + case 8: *(uint64_t*)ptr = (uint64_t)value; return; + case -1: *(int8_t*)ptr = (int8_t)value; return; + case -2: *(int16_t*)ptr = (int16_t)value; return; + case -4: *(int32_t*)ptr = (int32_t)value; return; + case -8: *(int64_t*)ptr = (int64_t)value; return; + default: return; + } +} + +static bool array_is_max(const struct TCOD_ArrayData* arr, const int* index) +{ + void* ptr = array_index(arr, index); + switch (arr->int_type) { + case 1: return *(uint8_t*)ptr == 0xff; + case 2: return *(uint16_t*)ptr == 0xffff; + case 4: return *(uint32_t*)ptr == 0xffffffff; + case 8: return *(uint64_t*)ptr == 0xffffffffffffffff; + case -1: return *(int8_t*)ptr == 0x7f; + case -2: return *(int16_t*)ptr == 0x7fff; + case -4: return *(int32_t*)ptr == 0x7fffffff; + case -8: return *(int64_t*)ptr == 0x7fffffffffffffff; + default: return 0; + } +} + +typedef void (*ArrayTraverseFunc)(void* userdata, const int* index); + +static void array_recursion( + struct TCOD_ArrayData* arr, + ArrayTraverseFunc callback, + void* userdata, + int* index, + int cursor) +{ + for (index[cursor] = 0; (size_t)index[cursor] < arr->shape[cursor]; + ++index[cursor]) { + if (cursor + 1 == arr->ndim) { + callback(userdata, index); + } else { + array_recursion(arr, callback, userdata, index, cursor + 1); + } + } +} + +static void array_traverse( + struct TCOD_ArrayData* arr, ArrayTraverseFunc callback, void* userdata) +{ + int index[TCOD_PATHFINDER_MAX_DIMENSIONS + 1]; + array_recursion(arr, callback, userdata, index, 0); +} + +static bool TCOD_pf_in_bounds( + const struct TCOD_Pathfinder* path, const int* index) +{ + for (int i = 0; i < path->ndim; ++i) { + if (0 < index[i] || (size_t)index[i] >= path->shape[i]) { return false; } + } + return true; +} + +static void TCOD_pf_add_edge( + struct TCOD_Pathfinder* path, const int* origin, const int* dest, int cost) +{ + if (!TCOD_pf_in_bounds(path, dest)) { return; } + int total_dist = array_get(&path->distance, origin) + cost; + if (array_get(&path->distance, dest) >= total_dist) { return; } + array_set(&path->distance, dest, total_dist); + TCOD_minheap_push(&path->heap, total_dist, dest); + if(path->traversal.data) { + int travel_index[TCOD_PATHFINDER_MAX_DIMENSIONS + 1]; + for (int i = 0; i < path->ndim; ++i) { travel_index[i] = origin[i]; } + for (int i = 0; i < path->ndim; ++i) { + travel_index[path->ndim] = i; + array_set(&path->traversal, travel_index, dest[i]); + } + } +} + +static void TCOD_pf_basic2d_edges( + struct TCOD_Pathfinder* path, const int* origin) +{ + if (path->graph.cardinal > 0) { + const int dest[] = { + origin[0] - 1, origin[1], + origin[0], origin[1] - 1, + origin[0], origin[1] + 1, + origin[0] + 1, origin[1], + }; + for (size_t i = 0; i < sizeof(dest) / sizeof(dest[0]); i += 2) { + TCOD_pf_add_edge(path, origin, &dest[i], path->graph.cardinal); + } + } + if (path->graph.diagonal > 0) { + const int dest[] = { + origin[0] - 1, origin[1] - 1, + origin[0] - 1, origin[1] + 1, + origin[0] + 1, origin[1] - 1, + origin[0] + 1, origin[1] + 1, + }; + for (size_t i = 0; i < sizeof(dest) / sizeof(dest[0]); i += 2) { + TCOD_pf_add_edge(path, origin, &dest[i], path->graph.diagonal); + } + } +} + +int TCOD_pf_compute_step(struct TCOD_Pathfinder* path) +{ + if (!path) { return -1; } + if (path->heap.size == 0) { return 0; } + int current_pos[TCOD_PATHFINDER_MAX_DIMENSIONS]; + TCOD_minheap_pop(&path->heap, current_pos); + TCOD_pf_basic2d_edges(path, current_pos); + return 0; +} + +struct TCOD_Pathfinder* TCOD_pf_new(int ndim, const size_t* shape) +{ + struct TCOD_Pathfinder* path = calloc(sizeof(struct TCOD_Pathfinder), 1); + if (!path) { return NULL; } + path->ndim = (int8_t)ndim; + for (int i = 0; i < ndim; ++i) { path->shape[i] = shape[i]; } + TCOD_heap_init(&path->heap, sizeof(int) * (size_t)path->ndim); + return path; +} + +void TCOD_pf_delete(struct TCOD_Pathfinder* path) +{ + if (!path) { return; } + TCOD_heap_uninit(&path->heap); + free(path); +} + +void TCOD_pf_set_distance_pointer( + struct TCOD_Pathfinder* path, + void* data, + int int_type, + const size_t* strides) +{ + if (!path) { return; } + path->distance.ndim = path->ndim; + path->distance.int_type = int_type; + path->distance.data = data; + for (int i = 0; i < path->ndim; ++i) { + path->distance.strides[i] = strides[i]; + path->distance.shape[i] = path->shape[i]; + } +} + +void TCOD_pf_set_graph2d_pointer( + struct TCOD_Pathfinder* path, + void* data, + int int_type, + const size_t* strides, + int cardinal, + int diagonal) +{ + if (!path) { return; } + path->graph.cost.ndim = path->ndim; + path->graph.cost.int_type = int_type; + path->graph.cost.data = data; + for (int i = 0; i < path->ndim; ++i) { + path->graph.cost.strides[i] = strides[i]; + path->graph.cost.shape[i] = path->shape[i]; + } + path->graph.cardinal = cardinal; + path->graph.diagonal = diagonal; +} + +void TCOD_pf_set_traversal_pointer( + struct TCOD_Pathfinder* path, + void* data, + int int_type, + const size_t* strides) +{ + if (!path) { return; } + path->traversal.ndim = path->ndim + 1; + path->traversal.int_type = int_type; + path->traversal.data = data; + for (int i = 0; i < path->traversal.ndim; ++i) { + path->traversal.strides[i] = strides[i]; + if (i == path->ndim) { + path->traversal.shape[i] = path->ndim; + } else { + path->traversal.shape[i] = strides[i]; + } + } +} + +void TCOD_pf_recompile_cb(void* userdata, const int* index) +{ + struct TCOD_Pathfinder* path = (struct TCOD_Pathfinder*)userdata; + if (array_is_max(&path->distance, index)) { return; } + TCOD_minheap_push(&path->heap, array_get(&path->distance, index), index); +} + +int TCOD_pf_recompile(struct TCOD_Pathfinder* path) +{ + if (!path) { return -1; } + TCOD_heap_clear(&path->heap); + array_traverse(&path->distance, &TCOD_pf_recompile_cb, path); + return 0; +} + +int TCOD_pf_compute(struct TCOD_Pathfinder* path) +{ + if (!path) { return -1; } + while (path->heap.size) { + TCOD_pf_compute_step(path); + } + return 0; +} diff --git a/tcod_sys/libtcod/src/libtcod/pathfinder.h b/tcod_sys/libtcod/src/libtcod/pathfinder.h new file mode 100644 index 000000000..925775d1d --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinder.h @@ -0,0 +1,96 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef TCOD_PATHFINDER_H +#define TCOD_PATHFINDER_H + +#include +#include +#include + +#include "portability.h" +#include "heapq.h" + +#define TCOD_PATHFINDER_MAX_DIMENSIONS 4 + +struct TCOD_ArrayData { + int8_t ndim; + int int_type; + size_t shape[TCOD_PATHFINDER_MAX_DIMENSIONS + 1]; + size_t strides[TCOD_PATHFINDER_MAX_DIMENSIONS + 1]; + unsigned char* data; +}; + +struct TCOD_BasicGraph2D { + struct TCOD_ArrayData cost; + int cardinal; + int diagonal; +}; + +struct TCOD_Pathfinder { + int8_t ndim; + size_t shape[TCOD_PATHFINDER_MAX_DIMENSIONS]; + bool owns_distance; + bool owns_graph; + bool owns_traversal; + struct TCOD_ArrayData distance; + struct TCOD_BasicGraph2D graph; + struct TCOD_ArrayData traversal; + struct TCOD_Heap heap; +}; + +TCODLIB_CAPI struct TCOD_Pathfinder* TCOD_pf_new(int ndim, const size_t* shape); +TCODLIB_CAPI void TCOD_pf_delete(struct TCOD_Pathfinder* path); + +TCODLIB_CAPI void TCOD_pf_set_distance_pointer( + struct TCOD_Pathfinder* path, + void* data, + int int_type, + const size_t* strides); +TCODLIB_CAPI void TCOD_pf_set_graph2d_pointer( + struct TCOD_Pathfinder* path, + void* data, + int int_type, + const size_t* strides, + int cardinal, + int diagonal); +TCODLIB_CAPI void TCOD_pf_set_traversal_pointer( + struct TCOD_Pathfinder* path, + void* data, + int int_type, + const size_t* strides); + +TCODLIB_CAPI int TCOD_pf_recompile(struct TCOD_Pathfinder* path); +TCODLIB_CAPI int TCOD_pf_compute(struct TCOD_Pathfinder* path); +TCODLIB_CAPI int TCOD_pf_compute_step(struct TCOD_Pathfinder* path); + + +#endif // TCOD_PATHFINDER_H diff --git a/tcod_sys/libtcod/src/libtcod/pathfinder_frontier.c b/tcod_sys/libtcod/src/libtcod/pathfinder_frontier.c new file mode 100644 index 000000000..13b22a363 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinder_frontier.c @@ -0,0 +1,106 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "pathfinder_frontier.h" + +#include + +struct TCOD_Frontier* TCOD_frontier_new(int ndim) +{ + if (ndim <= 0 || TCOD_PATHFINDER_MAX_DIMENSIONS < ndim) { + TCOD_set_errorvf("Can not make a pathfinder with %i dimensions.", ndim); + return NULL; + } + struct TCOD_Frontier* frontier = calloc(sizeof(*frontier), 1); + if (!frontier) { + TCOD_set_errorv("Out of memory allocating pathfinder."); + return NULL; + } + frontier->ndim = ndim; + TCOD_heap_init(&frontier->heap, sizeof(int) * (ndim + 1)); + return frontier; +} +void TCOD_frontier_delete(struct TCOD_Frontier* frontier) +{ + if (!frontier) { return; } + TCOD_heap_uninit(&frontier->heap); + free(frontier); +} +TCOD_Error TCOD_frontier_pop(struct TCOD_Frontier* frontier) +{ + if (!frontier) { + TCOD_set_errorv("Pointer argument must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + if (frontier->heap.size == 0) { + TCOD_set_errorv("Heap is empty."); + return TCOD_E_ERROR; + } + int node[TCOD_PATHFINDER_MAX_DIMENSIONS + 1]; + TCOD_minheap_pop(&frontier->heap, node); + frontier->active_dist = node[0]; + for (int i = 0; i < frontier->ndim; ++i) { + frontier->active_index[i] = node[i + 1]; + } + return TCOD_E_OK; +} +TCOD_Error TCOD_frontier_push( + struct TCOD_Frontier* frontier, const int* index, int dist, int heuristic) +{ + if (!frontier) { + TCOD_set_errorv("Pointer argument must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + int node[TCOD_PATHFINDER_MAX_DIMENSIONS + 1]; + node[0] = dist; + for (int i = 0; i < frontier->ndim; ++i) { + node[i + 1] = index[i]; + } + TCOD_minheap_push(&frontier->heap, heuristic, node); + return TCOD_E_OK; +} +int TCOD_frontier_size(const struct TCOD_Frontier* frontier) +{ + if (!frontier) { + TCOD_set_errorv("Pointer argument must not be NULL."); + return 0; + } + return frontier->heap.size; +} +TCOD_Error TCOD_frontier_clear(struct TCOD_Frontier* frontier) +{ + if (!frontier) { + TCOD_set_errorv("Pointer argument must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + TCOD_heap_clear(&frontier->heap); + return TCOD_E_OK; +} diff --git a/tcod_sys/libtcod/src/libtcod/pathfinder_frontier.h b/tcod_sys/libtcod/src/libtcod/pathfinder_frontier.h new file mode 100644 index 000000000..92ca5d165 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinder_frontier.h @@ -0,0 +1,99 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef TCOD_PATHFINDER_FRONTIER_H +#define TCOD_PATHFINDER_FRONTIER_H + +#include + +#include "config.h" +#include "error.h" +#include "heapq.h" + +#define TCOD_PATHFINDER_MAX_DIMENSIONS 4 + +struct TCOD_Frontier { + int8_t ndim; + int active_dist; + int active_index[TCOD_PATHFINDER_MAX_DIMENSIONS]; + struct TCOD_Heap heap; +}; +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +/** + Create a new pathfinder frontier. + + `ndim` is the number of dimensions. Must be in the range `1 <= n <= 4`. + */ +TCOD_PUBLIC TCOD_NODISCARD struct TCOD_Frontier* TCOD_frontier_new(int ndim); +/** + Delete a pathfinder frontier. + */ +TCOD_PUBLIC void TCOD_frontier_delete(struct TCOD_Frontier* frontier); +/** + Pop the next node from this frontier. + + The popped node variables will placed in the `active_dist` and + `active_index` attributes. + */ +TCOD_PUBLIC TCOD_Error TCOD_frontier_pop(struct TCOD_Frontier* frontier); +/** + Add a node to this frontier. + + `index[frontier->ndim]` is the position of the node to add to the frontier. + + `dist` is the total distance of the node. This should be a low number + like 0, but can also be a negative number such as `INT_MIN`. + When adding a node as an edge then `dist` is `frontier->active_dist` plus + the cost of the edge. + + `heuristic` is the true priority of the node, used to affect node order. + For Dijkstra-like algorithms this should be the same as `dist`. + For A* this should be `dist` plus the maximum possible distance to the + goal. + */ +TCOD_PUBLIC TCOD_Error TCOD_frontier_push( + struct TCOD_Frontier* frontier, const int* index, int dist, int heuristic); +/** + Return the current number of nodes in this frontier. + */ +TCOD_PUBLIC TCOD_NODISCARD int TCOD_frontier_size( + const struct TCOD_Frontier* frontier); +/** + Remove all nodes from this frontier. + */ +TCOD_PUBLIC TCOD_Error TCOD_frontier_clear(struct TCOD_Frontier* frontier); +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus +#endif // TCOD_PATHFINDER_FRONTIER_H diff --git a/tcod_sys/libtcod/src/libtcod/pathfinding/astar.cpp b/tcod_sys/libtcod/src/libtcod/pathfinding/astar.cpp new file mode 100644 index 000000000..2dad3c1dd --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinding/astar.cpp @@ -0,0 +1,32 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "astar.h" diff --git a/tcod_sys/libtcod/src/libtcod/pathfinding/astar.h b/tcod_sys/libtcod/src/libtcod/pathfinding/astar.h new file mode 100644 index 000000000..7d01f1049 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinding/astar.h @@ -0,0 +1,107 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_PATHFINDING_ASTAR_H_ +#define LIBTCOD_PATHFINDING_ASTAR_H_ +#ifdef __cplusplus +#include +#include +#include +#include +#include +#include +#include + +#include "graph.h" +namespace tcod { +namespace pathfinding { +template +inline void astar( + DistMatrix& dist_map, + const Graph& graph, + const IndexType& goal_point, + const NewEdgeFunc& on_new_edge) +{ + using dist_type = typename DistMatrix::value_type; + const dist_type MAX_DIST = std::numeric_limits::max(); + using heap_node = std::tuple; + auto heap_compare = [](const heap_node& a, const heap_node& b) { + return std::get<0>(a) > std::get<0>(b); + }; + std::vector heap; + for (ptrdiff_t i = 0; i < dist_map.get_shape().at(0); ++i) { + for (ptrdiff_t j = 0; j < dist_map.get_shape().at(1); ++j) { + if (dist_map[{i, j}] >= MAX_DIST) { continue; } + heap.emplace_back(heap_node{ dist_map[{i, j}] + graph.heuristic({i, j}, goal_point), {i, j} }); + } + } + std::make_heap(heap.begin(), heap.end(), heap_compare); + while (heap.size()) { + const IndexType current_point = std::get<1>(heap.front()); + if (current_point == goal_point) { break; } + std::pop_heap(heap.begin(), heap.end(), heap_compare); + heap.pop_back(); + const dist_type current_distance = dist_map[current_point]; + auto add_edge = [&](const IndexType& next, const dist_type& cost) { + dist_type next_distance = current_distance + cost; + if (dist_map[next] <= next_distance) { return; } + dist_map[next] = next_distance; + on_new_edge(current_point, next); + heap.emplace_back(heap_node{ next_distance + graph.heuristic(next, goal_point), next }); + std::push_heap(heap.begin(), heap.end(), heap_compare); + }; + graph.with_edges(add_edge, current_point); + } +} +template +inline void astar( + DistMatrix& dist_map, + const Graph& graph, + const IndexType& goal_point) +{ + auto on_new_edge = [](auto, auto){}; + astar(dist_map, graph, goal_point, on_new_edge); +} +template +inline void astar2d( + DistMatrix& dist_map, + const CostMatrix& cost_map, + const IndexType& goal_point, + int cardinal=1, + int diagonal=1) +{ + auto graph = SimpleGraph2D(cost_map, cardinal, diagonal); + astar(dist_map, graph, goal_point); +} +} // namespace pathfinding +} // namespace tcod +#endif // __cplusplus +#endif // LIBTCOD_PATHFINDING_ASTAR_H_ diff --git a/tcod_sys/libtcod/src/libtcod/pathfinding/breadth-first.cpp b/tcod_sys/libtcod/src/libtcod/pathfinding/breadth-first.cpp new file mode 100644 index 000000000..b50a23282 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinding/breadth-first.cpp @@ -0,0 +1,32 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "breadth-first.h" diff --git a/tcod_sys/libtcod/src/libtcod/pathfinding/breadth-first.h b/tcod_sys/libtcod/src/libtcod/pathfinding/breadth-first.h new file mode 100644 index 000000000..7a8ae68aa --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinding/breadth-first.h @@ -0,0 +1,85 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_PATHFINDING_BREADTH_FIRST_H_ +#define LIBTCOD_PATHFINDING_BREADTH_FIRST_H_ +#ifdef __cplusplus +#include +#include +#include +#include +#endif // __cplusplus +#include "graph.h" + +#ifdef __cplusplus +namespace tcod { +namespace pathfinding { +template +inline void breadth_first( + DistMatrix& dist_map, + const Graph& graph, + const std::initializer_list>& start) +{ + using cost_type = typename DistMatrix::value_type; + const cost_type MAX_COST = std::numeric_limits::max(); + using index_type = std::array; + for (const auto& start_point : start) { + dist_map.at(start_point) = 0; + } + std::queue queue(start); + while (queue.size()) { + const index_type current_point = queue.front(); + queue.pop(); + auto add_edge = [&](const index_type& next_point, auto) { + if (dist_map[next_point] < MAX_COST) { return; } + dist_map[next_point] = dist_map[current_point] + 1; + queue.push(next_point); + }; + graph.with_edges(add_edge, current_point); + } +} +template +inline void breadth_first2d( + DistMatrix& dist_map, + const CostMatrix& cost_map, + const std::initializer_list>& start, + int cardinal=1, + int diagonal=1) +{ + auto graph = SimpleGraph2D(cost_map, cardinal, diagonal); + breadth_first(dist_map, graph, start); +} +} // namespace tcod +} // namespace pathfinding +#endif // __cplusplus + + +#endif // LIBTCOD_PATHFINDING_BREADTH_FIRST_H_ diff --git a/tcod_sys/libtcod/src/libtcod/pathfinding/dijkstra.cpp b/tcod_sys/libtcod/src/libtcod/pathfinding/dijkstra.cpp new file mode 100644 index 000000000..1894e7aae --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinding/dijkstra.cpp @@ -0,0 +1,32 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "dijkstra.h" diff --git a/tcod_sys/libtcod/src/libtcod/pathfinding/dijkstra.h b/tcod_sys/libtcod/src/libtcod/pathfinding/dijkstra.h new file mode 100644 index 000000000..7d373ae17 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinding/dijkstra.h @@ -0,0 +1,189 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_PATHFINDING_DIJKSTRA_H_ +#define LIBTCOD_PATHFINDING_DIJKSTRA_H_ +#ifdef __cplusplus +#include +#include +#include +#include +#include +#include +#include +#include +#endif // __cplusplus +#include "generic.h" +#include "graph.h" +#include "../utility/vector2.h" + +#ifdef __cplusplus +namespace tcod { +namespace pathfinding { +/** + * Create an unsorted heap from a distance map. + */ +template +auto dijkstra_make_heap(const GridType& dist_grid) +{ + const typename GridType::value_type MAX_DIST = + std::numeric_limits::max(); + using node_type = std::tuple>; + std::vector heap = {}; + for (IndexSize y = 0; y < dist_grid.height(); ++y) { + for (IndexSize x = 0; x < dist_grid.width(); ++x) { + if (dist_grid.at({ y, x }) == MAX_DIST) { continue; } + heap.emplace_back(node_type(dist_grid.at({ y, x }), { y, x })); + } + } + return heap; +} +/** + * Recompute a Dijkstra distance map. + */ +template +void dijkstra_compute(DistGrid& dist_grid, const CostGrid& cost_grid, + CostType cardinal=2, CostType diagonal=3, + PathGrid* path_grid=nullptr) +{ + using dist_type = typename DistGrid::value_type; + using index_type = std::array; + + if (cost_grid.width() > dist_grid.width() || cost_grid.height() > dist_grid.height()) { + throw std::invalid_argument("cost_grid must be smaller than the dist_grid."); + } + if (path_grid && (path_grid->width() > dist_grid.width() || path_grid->height() > dist_grid.height())) { + throw std::invalid_argument("path_grid must be smaller than the dist_grid."); + } + + auto distance_at = [&](index_type index) -> dist_type& { + return dist_grid[index]; + }; + auto get_edges = [&](index_type index, auto new_edge) { + for (const auto& edge : EDGES_) { + std::array other_pos{ + index.at(0) + std::get<0>(edge), + index.at(1) + std::get<1>(edge), + }; + if ((std::get<0>(edge) && (other_pos.at(0) < 0 || other_pos.at(0) >= dist_grid.height())) || + (std::get<1>(edge) && (other_pos.at(1) < 0 || other_pos.at(1) >= dist_grid.width()))) { + continue; + } + auto cost = cost_grid[other_pos]; + const bool is_diagonal = std::get<0>(edge) && std::get<1>(edge); + cost *= is_diagonal ? diagonal : cardinal; + if (cost <= 0) { continue; } + new_edge(other_pos, cost); + } + }; + auto is_goal = [](auto, auto) { return 0; }; + auto heuristic = [](auto dist, auto){ return dist; }; + auto mark_path = [&](auto index, auto next) { + if(path_grid) { (*path_grid)[index] = next; } + }; + + Pathfinder pathfinder; + pathfinder.set_heap(dijkstra_make_heap(dist_grid), heuristic); + pathfinder.compute(distance_at, get_edges, is_goal, heuristic, mark_path); +} +template +inline bool dijktra_heap_sort_(const HeapNode& a, const HeapNode& b) noexcept +{ + return std::get<0>(a) > std::get<0>(b); +} +template +inline void dijkstra( + DistMatrix& dist_map, + const Graph& graph, + const GoalFunc& goal_func, // goal_func(position) -> bool + const EdgeFunc& edge_func) // edge_func(origin, destination) +{ + using dist_type = typename DistMatrix::value_type; + const dist_type MAX_DIST = std::numeric_limits::max(); + using index_type = std::array; + using heap_node = std::tuple; + auto heap_compare = [](const heap_node& a, const heap_node& b) { + return std::get<0>(a) > std::get<0>(b); + }; + std::vector heap; + for (ptrdiff_t i = 0; i < dist_map.get_shape().at(0); ++i) { + for (ptrdiff_t j = 0; j < dist_map.get_shape().at(1); ++j) { + if (dist_map[{i, j}] >= MAX_DIST) { continue; } + heap.emplace_back(heap_node{ dist_map[{i, j}], {i, j} }); + } + } + std::make_heap(heap.begin(), heap.end(), heap_compare); + while (heap.size()) { + const heap_node current_node = heap.front(); + if(goal_func(std::get<1>(current_node))) { + return; + } + std::pop_heap(heap.begin(), heap.end(), heap_compare); + heap.pop_back(); + const dist_type& current_distance = std::get<0>(current_node); + const index_type& current_point = std::get<1>(current_node); + auto add_edge = [&](const index_type& next, const dist_type& cost) { + dist_type next_distance = current_distance + cost; + if (dist_map[next] <= next_distance) { return; } + dist_map[next] = next_distance; + heap.emplace_back(heap_node{ next_distance, next }); + std::push_heap(heap.begin(), heap.end(), heap_compare); + edge_func(current_point, next); + }; + graph.with_edges(add_edge, current_point); + } +} +template +inline void dijkstra( + DistMatrix& dist_map, + const Graph& graph) +{ + const auto goal_func = [](auto){ return 0; }; + const auto edge_func = [](auto, auto){ return; }; + return dijkstra(dist_map, graph, goal_func, edge_func); +} +template +inline void dijkstra2d( + DistMatrix& dist_map, + const CostMatrix& cost_map, + int cardinal=1, + int diagonal=1) +{ + auto graph = SimpleGraph2D(cost_map, cardinal, diagonal); + dijkstra(dist_map, graph); +} +} // namespace pathfinding +} // namespace tcod +#endif // __cplusplus +#endif // LIBTCOD_PATHFINDING_DIJKSTRA_H_ diff --git a/tcod_sys/libtcod/src/libtcod/pathfinding/generic.cpp b/tcod_sys/libtcod/src/libtcod/pathfinding/generic.cpp new file mode 100644 index 000000000..3948281d5 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinding/generic.cpp @@ -0,0 +1,32 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "generic.h" diff --git a/tcod_sys/libtcod/src/libtcod/pathfinding/generic.h b/tcod_sys/libtcod/src/libtcod/pathfinding/generic.h new file mode 100644 index 000000000..496a2ba0a --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinding/generic.h @@ -0,0 +1,179 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_PATHFINDING_GENERIC_H_ +#define LIBTCOD_PATHFINDING_GENERIC_H_ +#ifdef __cplusplus +#include +#include +#include +#include +#include +#include +#include +#include +#endif // __cplusplus +#include "../utility/vector2.h" + +#ifdef __cplusplus +namespace tcod { +namespace pathfinding { +template +class Pathfinder +{ + public: + using heap_node = std::tuple; + using heap_type = std::vector; + Pathfinder() = default; + /** + * Continue the computation until is_goal is met or the heap runs empty. + * + * distance_at(IndexType index) -> DistType& + * Return a reference to the distance value at index. This function will + * read and write to these values. + * + * get_edges(IndexType index, auto new_edge) + * Get the edges for index. Edges are added using the new_edge callback: + * new_edge(IndexType destination, DistType cost) + * + * is_goal(DistType dist, IndexType index) -> bool + * When this returns True or when all paths are exhausted the computation + * will end. + * + * heuristic(DistType dist, IndexType index) -> DistType + * Determine the order of when nodes will be checked. The lowest values + * are checked before higher values. + * + * mark_path(IndexType current, IndexType next) + * Provides the best path from the current index so far. + */ + template + void compute( + DistanceAt& distance_at, + GetEdges& get_edges, + IsGoal& is_goal, + Heuristic& heuristic, + MarkPath& mark_path) + { + auto compare = [&](const heap_node& a, const heap_node& b) { + return heuristic(std::get<0>(a), std::get<1>(a)) > heuristic(std::get<0>(b), std::get<1>(b)); + }; + while (heap_.size()) { + std::pop_heap(heap_.begin(), heap_.end(), compare); + const heap_node current_node = heap_.back(); + heap_.pop_back(); + if (is_goal(std::get<0>(current_node), std::get<1>(current_node))) { + return; + } + const DistType& current_dist = std::get<0>(current_node); + const IndexType& current_pos = std::get<1>(current_node); + if (current_dist > distance_at(current_pos)) { continue; } + auto edge_lambda = [&](IndexType dest, DistType cost) { + add_edge(current_pos, dest, cost, distance_at, heuristic, mark_path, compare); + }; + get_edges(current_pos, edge_lambda); + } + } + /** + * Configure the heap. + */ + template + void set_heap(heap_type&& heap, const Heuristic& heuristic) noexcept + { + auto compare = [&](const heap_node& a, const heap_node& b) { + return heuristic(std::get<0>(a), std::get<1>(a)) < heuristic(std::get<0>(b), std::get<1>(b)); + }; + heap_ = std::move(heap); + std::make_heap(heap_.begin(), heap_.end(), compare); + } + private: + /** + * Compute an edge, adding the results to the distance map and heap. + */ + template + void add_edge(IndexType origin, IndexType dest, DistType cost, + DistanceAt& distance_at, Heuristic& heuristic, + MarkPath& mark_path, CompareFunc& compare) + { + if (cost <= 0) { return; } + DistType distance = distance_at(origin) + cost; + if (distance >= distance_at(dest)) { return; } + distance_at(dest) = distance; + mark_path(dest, origin); + heap_.emplace_back(heuristic(distance, dest), dest); + std::push_heap(heap_.begin(), heap_.end(), compare); + } + /** + * A priority queue of which nodes to check next. + */ + heap_type heap_ = {}; +}; +/** + * Clear a distance map by setting all values to maximum. + */ +template +void distance_clear(DistGrid& dist_grid) noexcept +{ + for (auto& i : dist_grid) { + i = std::numeric_limits::max(); + } +} +/** + * Clear a path map, setting all paths to themselves. + */ +template +void path_clear(Vector2& path_grid) noexcept +{ + for (ptrdiff_t y = 0; y < path_grid.height(); ++y) { + for (ptrdiff_t x = 0; x < path_grid.width(); ++x) { + path_grid.at({ y, x }) = { y, x }; + } + } +} +template +auto get_path(const Vector2& path_grid, + const IndexType& start) -> std::vector +{ + std::vector path; + IndexType current = start; + IndexType next = path_grid.at(current); + while (current != next) { + path.emplace_back(next); + current = next; + next = path_grid.at(current); + } + return path; +} +} // namespace pathfinding +} // namespace tcod +#endif // __cplusplus +#endif // LIBTCOD_PATHFINDING_GENERIC_H_ diff --git a/tcod_sys/libtcod/src/libtcod/pathfinding/graph.cpp b/tcod_sys/libtcod/src/libtcod/pathfinding/graph.cpp new file mode 100644 index 000000000..103030252 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinding/graph.cpp @@ -0,0 +1,32 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "graph.h" diff --git a/tcod_sys/libtcod/src/libtcod/pathfinding/graph.h b/tcod_sys/libtcod/src/libtcod/pathfinding/graph.h new file mode 100644 index 000000000..8957e7a79 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinding/graph.h @@ -0,0 +1,121 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_PATHFINDING_GRAPH_H_ +#define LIBTCOD_PATHFINDING_GRAPH_H_ +#ifdef __cplusplus +#include +#include +#include +#include +#include +#include +#endif // __cplusplus +#ifdef __cplusplus +namespace tcod { +namespace pathfinding { +/** + * Private hard-coded edge positions. + * + * {i, j} + */ +static constexpr std::array, 8> EDGES_{ { + {-1, 0}, {1, 0}, {0, -1}, {0, 1}, + {-1, -1}, {1, -1}, {-1, 1}, {1, 1}, +} }; + +template +class SimpleGraph2D +{ + public: + SimpleGraph2D(std::shared_ptr cost, + int cardinal=1, int diagonal=1) + : cost_{std::move(cost)}, + edges_{make_edges(cardinal, diagonal)}, + cardinal_{cardinal}, + diagonal_{diagonal} + {} + SimpleGraph2D(const CostMatrix& cost, int cardinal=1, int diagonal=1) + : SimpleGraph2D{std::make_shared(cost), cardinal, diagonal} + {} + SimpleGraph2D(CostMatrix&& cost, int cardinal=1, int diagonal=1) + : SimpleGraph2D{std::make_shared(cost), cardinal, diagonal} + {} + /** + * Calls `edge_func(index, cost) -> void` with the edges from `index`. + * + * Within the lambda parameters `index` is the destination node, and `cost` + * is the cost between nodes. + */ + template + void with_edges(const F& edge_func, const index_type& index) const + { + for (const auto& edge : edges_) { + if (std::get<2>(edge) <= 0) { continue; } + index_type node{ + index.at(0) + std::get<0>(edge), index.at(1) + std::get<1>(edge) + }; + if (!cost_->in_range(node)) { continue; } + int cost = std::get<2>(edge) * (*cost_)[node]; + if (cost <= 0) { continue; } + edge_func(node, cost); + } + } + /** + * Return the heuristic between two points. + */ + template + int heuristic(const index_type& a, const index_type& b) const + { + index_type diff{std::abs(a.at(0) - b.at(0)), std::abs(a.at(1) - b.at(1))}; + int diagonal = std::min(diff.at(0), diff.at(1)); + int cardinal = std::max(diff.at(0), diff.at(1)) - diagonal; + return cardinal * cardinal_ + diagonal * diagonal_; + } + private: + using edge_array = std::array, 8>; + std::shared_ptr cost_; + edge_array edges_; + int cardinal_; + int diagonal_; + static edge_array make_edges(int cardinal, int diagonal) + { + return edge_array{{ + {-1, 0, cardinal}, {1, 0, cardinal}, {0, -1, cardinal}, {0, 1, cardinal}, + {-1, -1, diagonal}, {1, -1, diagonal}, {-1, 1, diagonal}, {1, 1, diagonal}, + }}; + } +}; + +} // namespace pathfinding +} // namespace tcod +#endif // __cplusplus +#endif // LIBTCOD_PATHFINDING_GRAPH_H_ diff --git a/tcod_sys/libtcod/src/libtcod/pathfinding/hill-climb.cpp b/tcod_sys/libtcod/src/libtcod/pathfinding/hill-climb.cpp new file mode 100644 index 000000000..9e96b02f2 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinding/hill-climb.cpp @@ -0,0 +1,32 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "hill-climb.h" diff --git a/tcod_sys/libtcod/src/libtcod/pathfinding/hill-climb.h b/tcod_sys/libtcod/src/libtcod/pathfinding/hill-climb.h new file mode 100644 index 000000000..6f271e441 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/pathfinding/hill-climb.h @@ -0,0 +1,75 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_PATHFINDING_HILL_CLIMB_H_ +#define LIBTCOD_PATHFINDING_HILL_CLIMB_H_ +#ifdef __cplusplus +#include +#include +namespace tcod { +namespace pathfinding { +template +inline auto simple_hillclimb( + const DistMatrix& cost_map, + const Graph& graph, + const IndexType& start, + const Compare& compare) +-> std::vector +{ + std::vector results; + IndexType current = start; + IndexType next = start; + auto find_next = [&](const IndexType& checked_index, auto) { + if (compare(cost_map[checked_index], cost_map[next])) { + next = checked_index; + } + }; + do { + current = next; + results.emplace_back(current); + graph.with_edges(find_next, current); + } while (cost_map[current] != cost_map[next]); + return results; +} +template +inline auto simple_hillclimb( + const DistMatrix& cost_map, + const Graph& graph, + const IndexType& start) +-> std::vector +{ + return simple_hillclimb(cost_map, graph, start, + std::less()); +} +} // namespace pathfinding +} // namespace tcod +#endif // __cplusplus +#endif // LIBTCOD_PATHFINDING_HILL_CLIMB_H_ diff --git a/tcod_sys/libtcod/src/libtcod/portability.h b/tcod_sys/libtcod/src/libtcod/portability.h new file mode 100644 index 000000000..a415a2f36 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/portability.h @@ -0,0 +1,131 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_PORTABILITY_H +#define LIBTCOD_PORTABILITY_H +#include "config.h" +/* uncomment to disable unicode support */ +/*#define NO_UNICODE */ + +/* uncomment to disable opengl support */ +/*#define NO_OPENGL */ + +/* os identification + TCOD_WINDOWS : OS is windows + TCOD_LINUX : OS is Linux + TCOD_MACOSX : OS is Mac OS X + TCOD_HAIKU : OS is Haiku */ + +/* compiler identification + TCOD_VISUAL_STUDIO : compiler is Microsoft Visual Studio + TCOD_MINGW32 : compiler is Mingw32 + TCOD_GCC : compiler is gcc/g++ */ + +/* word size + TCOD_64BITS : 64 bits OS + TCOD_WIN64 : 64 bits Windows + TCOD_WIN32 : 32 bits Windows + TCOD_LINUX64 : 64 bits Linux + TCOD_LINUX32 : 32 bits Linux + TCOD_FREEBSD64 : 64 bits FreeBSD + TCOD_FREEBSD32 : 32 bits FreeBSD */ + +#if defined( _MSC_VER ) +# define TCOD_VISUAL_STUDIO +# define TCOD_WINDOWS +# ifdef _WIN64 +# define TCOD_WIN64 +# define TCOD_64BITS +# else +# define TCOD_WIN32 +# endif +#elif defined( __MINGW32__ ) +# define TCOD_WINDOWS +# define TCOD_MINGW32 +# ifdef _WIN64 +# define TCOD_WIN64 +# define TCOD_64BITS +# else +# define TCOD_WIN32 +# endif +#elif defined( __HAIKU__ ) +# define TCOD_HAIKU +# define TCOD_GCC +# if __WORDSIZE == 64 +# define TCOD_64BITS +# endif +#elif defined( __linux ) +# define TCOD_LINUX +# define TCOD_GCC +# if __WORDSIZE == 64 +# define TCOD_LINUX64 +# define TCOD_64BITS +# else +# define TCOD_LINUX32 +# endif +#elif defined( __FreeBSD__ ) +# define TCOD_FREEBSD +# define TCOD_GCC +# if __WORDSIZE == 64 +# define TCOD_FREEBSD64 +# define TCOD_64BITS +# else +# define TCOD_FREEBSD32 +# endif +#elif defined (__APPLE__) && defined (__MACH__) +# define TCOD_MACOSX +# define TCOD_GCC +# if __WORDSIZE == 64 +# define TCOD_64BITS +# endif +#endif + +/* unicode rendering functions support */ +#ifndef NO_UNICODE +#include +#endif + +/* int types */ +#include + +/* bool type */ +#include + +/* ansi C lacks support for those functions */ +TCODLIB_CAPI char *TCOD_strdup(const char *s); +TCODLIB_CAPI int TCOD_strcasecmp(const char *s1, const char *s2); +TCODLIB_CAPI int TCOD_strncasecmp(const char *s1, const char *s2, size_t n); + +/* Define vswprintf across platforms. */ +#ifdef _WIN32 +#define vswprintf _vsnwprintf /* Windows */ +#endif /* _WIN32 */ +#endif /* LIBTCOD_PORTABILITY_H */ diff --git a/tcod_sys/libtcod/src/libtcod/renderer_gl.c b/tcod_sys/libtcod/src/libtcod/renderer_gl.c new file mode 100644 index 000000000..8469875c0 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/renderer_gl.c @@ -0,0 +1,178 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "renderer_gl.h" + +#include "error.h" + +#include +#include "../vendor/glad.h" +/** + * Return a rectangle shaped for a tile at `x`,`y`. + */ +static SDL_Rect get_aligned_tile( + const struct TCOD_Tileset* tileset, int x, int y) +{ + SDL_Rect tile_rect = { + x * tileset->tile_width, + y * tileset->tile_height, + tileset->tile_width, + tileset->tile_height + }; + return tile_rect; +} +/** + * Return the rectangle for the tile at `tile_id`. + */ +static SDL_Rect get_gl_atlas_tile( + const struct TCOD_TilesetAtlasOpenGL* atlas, int tile_id) +{ + return get_aligned_tile( + atlas->tileset, + tile_id % atlas->texture_columns, + tile_id / atlas->texture_columns + ); +} +/** + * Upload a single tile to the atlas texture. + */ +static int upload_gl_tile(struct TCOD_TilesetAtlasOpenGL* atlas, int tile_id) +{ + SDL_Rect dest = get_gl_atlas_tile(atlas, tile_id); + glBindTexture(GL_TEXTURE_2D, atlas->texture); + glTexSubImage2D( + GL_TEXTURE_2D, + 0, + dest.x, + dest.y, + dest.w, + dest.h, + GL_RGBA, + GL_UNSIGNED_BYTE, + atlas->tileset->pixels + (tile_id * atlas->tileset->tile_length)); + glBindTexture(GL_TEXTURE_2D, 0); + return 0; +} +/** + * Setup a atlas texture and upload the tileset graphics. + */ +TCOD_NODISCARD +static int prepare_gl_atlas(struct TCOD_TilesetAtlasOpenGL* atlas) +{ + int new_size = atlas->texture_size ? atlas->texture_size : 64; + int max_size; + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); + int rows; + int columns; + while (1) { + rows = new_size / atlas->tileset->tile_width; + columns = new_size / atlas->tileset->tile_height; + if (rows * columns >= atlas->tileset->tiles_capacity) { break; } + new_size *= 2; + } + if (new_size > max_size) { + TCOD_set_errorv("Tried to allocate a texture size above the maximum limit!"); + return TCOD_E_ERROR; + } + if (new_size != atlas->texture_size) { + atlas->texture_size = new_size; + atlas->texture_columns = columns; + atlas->texture_rows = rows; + glBindTexture(GL_TEXTURE_2D, atlas->texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexImage2D( + GL_TEXTURE_2D, + 0, + GL_RGBA, + atlas->texture_size, + atlas->texture_size, + 0, + GL_RGBA, + GL_UNSIGNED_BYTE, + NULL); + glBindTexture(GL_TEXTURE_2D, 0); + switch (glGetError()) { + case GL_NO_ERROR: + break; + case GL_OUT_OF_MEMORY: + TCOD_set_errorv("Out of memory while allocating texture."); + return TCOD_E_OUT_OF_MEMORY; + default: + TCOD_set_errorv("Unkown OpenGL error while allocating texture."); + return TCOD_E_ERROR; + } + for (int i = 0; i < atlas->tileset->tiles_count; ++i) { + if (upload_gl_tile(atlas, i) < 0) { + return -1; + } + } + return 1; // Atlas texture has been resized and refreshed. + } + return 0; // No action. +} +/** + * Respond to changes in a tileset. + */ +static int gl_atlas_on_tile_changed( + struct TCOD_TilesetObserver* observer, int tile_id) +{ + struct TCOD_TilesetAtlasOpenGL* atlas = observer->userdata; + if (prepare_gl_atlas(atlas) == 1) { + return 0; // Tile updated as a side-effect of prepare_gl_atlas. + } + return upload_gl_tile(atlas, tile_id); +} +struct TCOD_TilesetAtlasOpenGL* TCOD_gl_atlas_new(struct TCOD_Tileset* tileset) +{ + if (!tileset) { return NULL; } + struct TCOD_TilesetAtlasOpenGL* atlas = calloc(sizeof(*atlas), 1); + if (!atlas) { return NULL; } + atlas->observer = TCOD_tileset_observer_new(tileset); + if (!atlas->observer) { TCOD_gl_atlas_delete(atlas); return NULL; } + atlas->tileset = tileset; + atlas->tileset->ref_count += 1; + atlas->observer->userdata = atlas; + atlas->observer->on_tile_changed = gl_atlas_on_tile_changed; + glGenTextures(1, &atlas->texture); + if (prepare_gl_atlas(atlas) < 0) { + TCOD_gl_atlas_delete(atlas); + return NULL; + } + return atlas; +} +void TCOD_gl_atlas_delete(struct TCOD_TilesetAtlasOpenGL* atlas) +{ + if (!atlas) { return; } + if (atlas->tileset) { TCOD_tileset_delete(atlas->tileset); } + if (atlas->texture) { glDeleteTextures(1, &atlas->texture); } + free(atlas); +} diff --git a/tcod_sys/libtcod/src/libtcod/renderer_gl.h b/tcod_sys/libtcod/src/libtcod/renderer_gl.h new file mode 100644 index 000000000..e16eaa344 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/renderer_gl.h @@ -0,0 +1,69 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_RENDERER_GL_H_ +#define LIBTCOD_RENDERER_GL_H_ +#include "config.h" + +#include + +#include "tileset.h" + +struct TCOD_TilesetAtlasOpenGL { + struct TCOD_Tileset* tileset; + struct TCOD_TilesetObserver* observer; + uint32_t texture; + int texture_size; + int texture_columns; + int texture_rows; +}; + +struct TCOD_RendererGLCommon { + struct SDL_Window* window; + void* glcontext; + struct TCOD_TilesetAtlasOpenGL* atlas; + uint32_t sdl_subsystems; + // Mouse cursor transform values of the last viewport used. + double last_offset_x; + double last_offset_y; + double last_scale_x; + double last_scale_y; +}; + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +struct TCOD_TilesetAtlasOpenGL* TCOD_gl_atlas_new(struct TCOD_Tileset* tileset); +void TCOD_gl_atlas_delete(struct TCOD_TilesetAtlasOpenGL* atlas); +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus +#endif // LIBTCOD_RENDERER_GL_H_ diff --git a/tcod_sys/libtcod/src/libtcod/renderer_gl1.c b/tcod_sys/libtcod/src/libtcod/renderer_gl1.c new file mode 100644 index 000000000..395e5a4e1 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/renderer_gl1.c @@ -0,0 +1,321 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "renderer_gl1.h" + +#include + +#include +#include "../vendor/glad.h" + +#include "console.h" +#include "context_viewport.h" +#include "renderer_gl.h" +#include "renderer_gl_internal.h" +/** + * Attribute data for the foreground vertices. + */ +struct ForegroundVertexBuffer { + int16_t vertex[2]; // Simple vertex integers. + TCOD_ColorRGBA color; // Foreground color. + float tex_uv[2]; // Texture coordinates. +}; +/** + * Get the texture coordinates for a codepoint. + */ +static void get_tex_coord(const struct TCOD_TilesetAtlasOpenGL* atlas, int ch, struct ForegroundVertexBuffer* out) +{ + const struct TCOD_Tileset* tileset = atlas->tileset; + float tex_tile_width = 1.0f / atlas->texture_size * tileset->tile_width; + float tex_tile_height = 1.0f / atlas->texture_size * tileset->tile_height; + int tile_id = 0; + if (ch < tileset->character_map_length) { + tile_id = tileset->character_map[ch]; + } + int x = tile_id % atlas->texture_columns; + int y = tile_id / atlas->texture_columns; + out[0].tex_uv[0] = x * tex_tile_width; + out[0].tex_uv[1] = y * tex_tile_height; + out[1].tex_uv[0] = (x + 1) * tex_tile_width; + out[1].tex_uv[1] = y * tex_tile_height; + out[2].tex_uv[0] = x * tex_tile_width; + out[2].tex_uv[1] = (y + 1) * tex_tile_height; + out[3].tex_uv[0] = (x + 1) * tex_tile_width; + out[3].tex_uv[1] = (y + 1) * tex_tile_height; +} +/** + * Render the background. + */ +static TCOD_Error render_background(struct TCOD_Context* context, const TCOD_Console* console) +{ + struct TCOD_RendererGL1* renderer = context->contextdata; + // Setup background texture. + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, renderer->background_texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + if (renderer->background_width < console->w || renderer->background_height < console->h) { + int max_size; + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); + if (renderer->background_width == 0) { renderer->background_width = 2; } + if (renderer->background_height == 0) { renderer->background_height = 2; } + while (renderer->background_width < console->w) { + renderer->background_width *= 2; + } + while (renderer->background_height < console->h) { + renderer->background_height *= 2; + } + if (renderer->background_width > max_size || renderer->background_height > max_size) { + renderer->background_width = 0; + renderer->background_height = 0; + TCOD_set_errorv("Tried to allocate a texture size above the maximum limit!"); + return TCOD_E_ERROR; + } + glTexImage2D( + GL_TEXTURE_2D, + 0, + GL_RGBA, + renderer->background_width, + renderer->background_height, + 0, + GL_RGBA, + GL_UNSIGNED_BYTE, + NULL); + } + + // Upload background color to a texture. + TCOD_ColorRGBA* color = malloc(sizeof(*color) * console->elements); + if (!color) { + TCOD_set_errorv("Out of memory."); + return TCOD_E_OUT_OF_MEMORY; + } + for (int y = 0; y < console->h; ++y) { + for (int x = 0; x < console->w; ++x) { + int i = y * console->w + x; + color[i] = console->tiles[i].bg; + } + } + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, console->w, console->h, GL_RGBA, GL_UNSIGNED_BYTE, color); + free(color); + + // Setup OpenGL. + glEnable(GL_TEXTURE_2D); + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glClientActiveTexture(GL_TEXTURE0); + + // Render background. + int16_t bg_vertex[] = {0, 0, console->w, 0, 0, console->h, console->w, console->h}; + float bg_tex_w = (float)console->w / renderer->background_width; + float bg_tex_h = (float)console->h / renderer->background_height; + float bg_tex_coord[] = {0, 0, bg_tex_w, 0, 0, bg_tex_h, bg_tex_w, bg_tex_h}; + uint8_t bg_indices[] = {0, 1, 2, 3, 2, 1}; + glVertexPointer(2, GL_SHORT, 0, bg_vertex); + glTexCoordPointer(2, GL_FLOAT, 0, bg_tex_coord); + glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, bg_indices); + + // Clean up. + glDisableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisable(GL_TEXTURE_2D); + return TCOD_E_OK; +} +/** + * Render the alpha-transparent foreground characters. + */ +static TCOD_Error render_foreground(struct TCOD_Context* context, const TCOD_Console* console) +{ + struct TCOD_RendererGL1* renderer = context->contextdata; + // Setup OpenGL. + glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, renderer->common.atlas->texture); + // Use GL_NEAREST to prevent tileset bleeding. + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glClientActiveTexture(GL_TEXTURE0); + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + // Prepare buffers. + uint16_t* indices = malloc(sizeof(*indices) * console->w * 6); + struct ForegroundVertexBuffer* buffer = malloc(sizeof(*buffer) * console->w * 4); + if (!indices || !buffer) { + free(indices); + free(buffer); + TCOD_set_errorv("Out of memory."); + return TCOD_E_OUT_OF_MEMORY; + } + glVertexPointer(2, GL_SHORT, sizeof(*buffer), (char*)buffer + offsetof(struct ForegroundVertexBuffer, vertex)); + glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(*buffer), (char*)buffer + offsetof(struct ForegroundVertexBuffer, color)); + glTexCoordPointer(2, GL_FLOAT, sizeof(*buffer), (char*)buffer + offsetof(struct ForegroundVertexBuffer, tex_uv)); + for (int x = 0; x < console->w; ++x) { + indices[x * 6] = x * 4; + indices[x * 6 + 1] = x * 4 + 1; + indices[x * 6 + 2] = x * 4 + 2; + indices[x * 6 + 3] = x * 4 + 2; + indices[x * 6 + 4] = x * 4 + 3; + indices[x * 6 + 5] = x * 4 + 1; + } + + // Render characters. + for (int y = 0; y < console->h; ++y) { + for (int x = 0; x < console->w; ++x) { + int console_i = y * console->w + x; + // Buffer vertices are in a "Z" shape. + buffer[x * 4].vertex[0] = x; + buffer[x * 4].vertex[1] = y; + buffer[x * 4 + 1].vertex[0] = x + 1; + buffer[x * 4 + 1].vertex[1] = y; + buffer[x * 4 + 2].vertex[0] = x; + buffer[x * 4 + 2].vertex[1] = y + 1; + buffer[x * 4 + 3].vertex[0] = x + 1; + buffer[x * 4 + 3].vertex[1] = y + 1; + buffer[x * 4].color = console->tiles[console_i].fg; + buffer[x * 4 + 1].color = buffer[x * 4].color; + buffer[x * 4 + 2].color = buffer[x * 4].color; + buffer[x * 4 + 3].color = buffer[x * 4].color; + get_tex_coord(renderer->common.atlas, + console->tiles[console_i].ch, &buffer[x * 4]); + } + glDrawElements(GL_TRIANGLES, console->w * 6, GL_UNSIGNED_SHORT, indices); + } + + // Clean up. + glDisableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_COLOR_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glBindTexture(GL_TEXTURE_2D, 0); + glDisable(GL_BLEND); + glDisable(GL_TEXTURE_2D); + free(buffer); + free(indices); + return TCOD_E_OK; +} +/** + * Render the console onto the screen. + */ +static TCOD_Error gl1_accumulate( + struct TCOD_Context* context, + const TCOD_Console* console, + const struct TCOD_ViewportOptions* viewport) +{ + struct TCOD_RendererGL1* renderer = context->contextdata; + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + float matrix[16]; + gl_get_viewport_scale( + renderer->common.atlas, console, viewport, matrix, &renderer->common); + matrix[0] /= console->w; + matrix[5] /= -console->h; + matrix[13] = -matrix[13]; + glLoadMatrixf(matrix); + + TCOD_Error err; + if ((err = render_background(context, console)) < 0) { return err; } + if ((err = render_foreground(context, console)) < 0) { return err; } + glFlush(); + if (glGetError()) { + TCOD_set_errorv("Unexpected OpenGL error."); + return TCOD_E_ERROR; + } + return TCOD_E_OK; +} +/** + * Clear, render, and swap the screen. + */ +static TCOD_Error gl1_present( + struct TCOD_Context* context, + const TCOD_Console* console, + const struct TCOD_ViewportOptions* viewport) +{ + if (!viewport) { viewport = &TCOD_VIEWPORT_DEFAULT_; } + struct TCOD_RendererGL1* renderer = context->contextdata; + int window_width; + int window_height; + SDL_GL_GetDrawableSize(renderer->common.window, &window_width, &window_height); + glViewport(0, 0, window_width, window_height); + glClearColor( + (float)viewport->clear_color.r / 255.0f, + (float)viewport->clear_color.g / 255.0f, + (float)viewport->clear_color.b / 255.0f, + (float)viewport->clear_color.a / 255.0f); + glClear(GL_COLOR_BUFFER_BIT); + TCOD_Error err = gl1_accumulate(context, console, viewport); + SDL_GL_SwapWindow(renderer->common.window); + return err; +} +void gl1_destructor(struct TCOD_Context* context) +{ + struct TCOD_RendererGL1* renderer = context->contextdata; + if (!renderer) { return; } + if (renderer->background_texture) { glDeleteTextures(1, &renderer->background_texture); } + TCOD_renderer_gl_common_uninit(&renderer->common); + free(renderer); +} +TCODLIB_API TCOD_NODISCARD +struct TCOD_Context* TCOD_renderer_init_gl1( + int pixel_width, + int pixel_height, + const char* title, + int window_flags, + bool vsync, + struct TCOD_Tileset* tileset) +{ + struct TCOD_Context* context = TCOD_context_new_(); + if (!context) { return NULL; } + context->type = TCOD_RENDERER_OPENGL; + struct TCOD_RendererGL1* renderer = calloc(sizeof(*renderer), 1); + if (!renderer) { TCOD_context_delete(context); return NULL; } + context->destructor_ = gl1_destructor; + context->contextdata = renderer; + TCOD_Error err = TCOD_renderer_gl_common_init( + pixel_width, + pixel_height, + title, + window_flags, + vsync, + tileset, + 1, + 1, + SDL_GL_CONTEXT_PROFILE_CORE, + context); + if (err < 0) { + TCOD_context_delete(context); + return NULL; + } + context->accumulate_ = gl1_accumulate; + context->present_ = gl1_present; + return context; +} diff --git a/tcod_sys/libtcod/src/libtcod/renderer_gl1.h b/tcod_sys/libtcod/src/libtcod/renderer_gl1.h new file mode 100644 index 000000000..7e6890adc --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/renderer_gl1.h @@ -0,0 +1,59 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_RENDERER_GL1_H_ +#define LIBTCOD_RENDERER_GL1_H_ +#include "config.h" + +#include + +#include "tileset.h" +#include "renderer_gl.h" + +struct SDL_Window; + +struct TCOD_RendererGL1 { + struct TCOD_RendererGLCommon common; + uint32_t background_texture; + int background_width; + int background_height; +}; + +TCOD_PUBLIC TCOD_NODISCARD +struct TCOD_Context* TCOD_renderer_init_gl1( + int width, + int height, + const char* title, + int window_flags, + bool vsync, + struct TCOD_Tileset* tileset); + +#endif // LIBTCOD_RENDERER_GL1_H_ diff --git a/tcod_sys/libtcod/src/libtcod/renderer_gl2.c b/tcod_sys/libtcod/src/libtcod/renderer_gl2.c new file mode 100644 index 000000000..8f840ddcd --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/renderer_gl2.c @@ -0,0 +1,434 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "renderer_gl2.h" + +#include + +#include +#include "../vendor/glad.h" + +#include "console.h" +#include "context_viewport.h" +#include "renderer_gl.h" +#include "renderer_gl_internal.h" +static const char* VERTEX_SOURCE = "\ +uniform mat4 mvp_matrix; // Model-view-projection matrix\n\ +attribute vec2 a_vertex; // Simple vertex quad.\n\ +uniform vec2 v_console_shape; // The true size of the textures.\n\ +uniform vec2 v_console_size; // The relative size of the console textures.\n\ +varying vec2 v_coord; // Simple quad coordinate.\n\ +void main(void)\n\ +{\n\ + gl_Position = mvp_matrix * vec4(a_vertex, 0.0, 1.0);\n\ + v_coord = vec2(a_vertex.x, 1.0 - a_vertex.y); // Flip Y\n\ + // Expand to console coordinates.\n\ + v_coord *= v_console_shape * v_console_size;\n\ +}\n\ +"; +static const char* FRAGMENT_SOURCE = "\ +uniform vec2 v_tiles_shape; // Tileset columns/rows.\n\ +uniform vec2 v_tiles_size; // Tileset texture size.\n\ +uniform sampler2D t_tileset;\n\ +\n\ +uniform vec2 v_console_shape; // The true size of the textures.\n\ +uniform sampler2D t_console_tile; // Packed tileset coordinates.\n\ +uniform sampler2D t_console_fg;\n\ +uniform sampler2D t_console_bg;\n\ +\n\ +varying vec2 v_coord; // Console coordinates.\n\ +\n\ +void main(void)\n\ +{\n\ + vec2 tile_size = v_tiles_size / v_tiles_shape;\n\ + // The sample coordinate for per-tile console variables.\n\ + vec2 console_pos = floor(v_coord);\n\ + console_pos += vec2(0.5, 0.5); // Offset to the center (for sampling.)\n\ + console_pos /= v_console_shape; // Scale to fit in t_console_X textures.\n\ +\n\ + // Coordinates within a tile.\n\ + vec2 tile_interp = fract(v_coord);\n\ +\n\ + vec4 tile_encoded = vec4(texture2D(t_console_tile, console_pos));\n\ +\n\ + // Unpack tileset index.\n\ + vec2 tile_address = vec2(\n\ + tile_encoded.x * float(0xff) + tile_encoded.y * float(0xff00),\n\ + tile_encoded.z * float(0xff) + tile_encoded.w * float(0xff00)\n\ + );\n\ +\n\ + // Clamp the edges of tile_interp to prevent alias bleeding.\n\ + tile_interp = clamp(tile_interp, 0.5 / tile_size, 1.0 - 0.5 / tile_size);\n\ +\n\ + // Apply tile_interp and scale.\n\ + tile_address = (tile_address + tile_interp) / v_tiles_shape;\n\ +\n\ + vec4 tile_color = texture2D(t_tileset, tile_address);\n\ +\n\ + vec4 bg = texture2D(t_console_bg, console_pos);\n\ + vec4 fg = texture2D(t_console_fg, console_pos);\n\ + fg.rgb *= tile_color.rgb;\n\ +\n\ + gl_FragColor = mix(bg, fg, tile_color.a);\n\ +}\n\ +"; +/** + * Compile the shader program and return error status. + */ +static TCOD_Error gl2_build_shader(uint32_t* program_out) +{ + uint32_t program = glCreateProgram(); + uint32_t v_shader = glCreateShader(GL_VERTEX_SHADER); + uint32_t f_shader = glCreateShader(GL_FRAGMENT_SHADER); + // Move shader ownership to the program. + glAttachShader(program, v_shader); + glDeleteShader(v_shader); + glAttachShader(program, f_shader); + glDeleteShader(f_shader); + // Compile shaders. + glShaderSource(v_shader, 1, &VERTEX_SOURCE, NULL); + glShaderSource(f_shader, 1, &FRAGMENT_SOURCE, NULL); + glCompileShader(v_shader); + glCompileShader(f_shader); + // Check and return shader errors. + int status; + char log[4096]; + int log_length; + glGetShaderInfoLog(v_shader, sizeof(log), &log_length, log); + glGetShaderiv(v_shader, GL_COMPILE_STATUS, &status); + if (!status) { + TCOD_set_errorvf("Failed to compile vertex shader:\n%s", log); + glDeleteProgram(program); + return TCOD_E_ERROR; + } + if (log_length) { + SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Vertex shader compile log:\n%s", log); + } + glGetShaderInfoLog(f_shader, sizeof(log), &log_length, log); + glGetShaderiv(f_shader, GL_COMPILE_STATUS, &status); + if (!status) { + TCOD_set_errorvf("Failed to compile fragment shader:\n%s", log); + glDeleteProgram(program); + return TCOD_E_ERROR; + } + if (log_length) { + SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Fragment shader compile log:\n%s", log); + } + // Link shader program. + glLinkProgram(program); + // Check shader program for errors. + glGetProgramInfoLog(program, sizeof(log), &log_length, log); + glGetProgramiv(program, GL_LINK_STATUS, &status); + if (!status) { + TCOD_set_errorvf("Failed to link shader program:\n%s", log); + glDeleteProgram(program); + return TCOD_E_ERROR; + } + if (log_length) { + SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Shader program link log:\n%s", log); + } + *program_out = program; + return TCOD_E_OK; +} +/** + * Grow texture sizes if they're too small. + */ +TCOD_NODISCARD +static TCOD_Error resize_textures( + struct TCOD_RendererGL2* renderer, const TCOD_Console* console) +{ + if (console->w > renderer->console_width || console->h > renderer->console_height) { + if (renderer->console_width == 0) { renderer->console_width = 2; } + if (renderer->console_height == 0) { renderer->console_height = 2; } + while (renderer->console_width < console->w) { renderer->console_width *= 2; } + while (renderer->console_height < console->w) { renderer->console_height *= 2; } + for (int i = 0; i < 3; ++i) { + glBindTexture(GL_TEXTURE_2D, renderer->console_textures[i]); + glTexImage2D( + GL_TEXTURE_2D, + 0, + GL_RGBA, + renderer->console_width, + renderer->console_height, + 0, + GL_RGBA, + GL_UNSIGNED_BYTE, + NULL); + } + glBindTexture(GL_TEXTURE_2D, 0); + } + if (glGetError()) { + TCOD_set_errorv("Unexpected OpenGL error."); + return TCOD_E_ERROR; + } + return TCOD_E_OK;; +} +/** + * Get the texture coordinates for a codepoint. + */ +static void get_tex_coord( + const struct TCOD_TilesetAtlasOpenGL* atlas, int ch, uint8_t* out) +{ + const struct TCOD_Tileset* tileset = atlas->tileset; + int tile_id = 0; + if (ch < tileset->character_map_length) { + tile_id = tileset->character_map[ch]; + } + int x = tile_id % atlas->texture_columns; + int y = tile_id / atlas->texture_columns; + out[0] = x & 0xff; + out[1] = x >> 8; + out[2] = y & 0xff; + out[3] = y >> 8; +} +TCOD_NODISCARD +static TCOD_Error render( + struct TCOD_RendererGL2* renderer, + const TCOD_Console* console, + const struct TCOD_ViewportOptions* viewport) +{ + uint8_t* ch_buffer = malloc(sizeof(*ch_buffer) * console->elements * 4); + TCOD_ColorRGBA* fg_buffer = malloc(sizeof(*fg_buffer) * console->elements); + TCOD_ColorRGBA* bg_buffer = malloc(sizeof(*bg_buffer) * console->elements); + if (!ch_buffer || !fg_buffer || !bg_buffer) { + free(ch_buffer); + free(fg_buffer); + free(bg_buffer); + TCOD_set_errorv("Out of memory."); + return TCOD_E_OUT_OF_MEMORY; + } + for (int i = 0; i < console->elements; ++i) { + get_tex_coord(renderer->common.atlas, console->tiles[i].ch, ch_buffer + i * 4); + fg_buffer[i] = console->tiles[i].fg; + bg_buffer[i] = console->tiles[i].bg; + } + glBindTexture(GL_TEXTURE_2D, renderer->console_textures[0]); // ch + glTexSubImage2D( + GL_TEXTURE_2D, 0, 0, 0, console->w, console->h, GL_RGBA, GL_UNSIGNED_BYTE, ch_buffer + ); + glBindTexture(GL_TEXTURE_2D, renderer->console_textures[1]); // fg + glTexSubImage2D( + GL_TEXTURE_2D, 0, 0, 0, console->w, console->h, GL_RGBA, GL_UNSIGNED_BYTE, fg_buffer + ); + glBindTexture(GL_TEXTURE_2D, renderer->console_textures[2]); // bg + glTexSubImage2D( + GL_TEXTURE_2D, 0, 0, 0, console->w, console->h, GL_RGBA, GL_UNSIGNED_BYTE, bg_buffer + ); + free(ch_buffer); + free(fg_buffer); + free(bg_buffer); + + glUseProgram(renderer->program); + int mvp_matrix = glGetUniformLocation(renderer->program, "mvp_matrix"); + int a_vertex = glGetAttribLocation(renderer->program, "a_vertex"); + int v_console_shape = glGetUniformLocation(renderer->program, "v_console_shape"); + int v_console_size = glGetUniformLocation(renderer->program, "v_console_size"); + int v_tiles_shape = glGetUniformLocation(renderer->program, "v_tiles_shape"); + int v_tiles_size = glGetUniformLocation(renderer->program, "v_tiles_size"); + int t_tileset = glGetUniformLocation(renderer->program, "t_tileset"); + int t_console_bg = glGetUniformLocation(renderer->program, "t_console_bg"); + int t_console_fg = glGetUniformLocation(renderer->program, "t_console_fg"); + int t_console_tile = glGetUniformLocation(renderer->program, "t_console_tile"); + + float matrix[4*4]; + gl_get_viewport_scale( + renderer->common.atlas, console, viewport, matrix, &renderer->common); + glUniformMatrix4fv(mvp_matrix, 1, GL_FALSE, matrix); + + // Upload data of texture shapes. + const struct TCOD_TilesetAtlasOpenGL* atlas = renderer->common.atlas; + + float tiles_shape[2] = { + (float)atlas->texture_size / atlas->tileset->tile_width, + (float)atlas->texture_size / atlas->tileset->tile_height, + }; + glUniform2fv(v_tiles_shape, 1, tiles_shape); + float tiles_size[2] = { + atlas->texture_columns * atlas->tileset->tile_width, + atlas->texture_rows * atlas->tileset->tile_height, + }; + glUniform2fv(v_tiles_size, 1, tiles_size); + + float console_shape[2] = {renderer->console_width, renderer->console_height}; + glUniform2fv(v_console_shape, 1, console_shape); + float console_size[2] = { + (float)console->w / console_shape[0], + (float)console->h / console_shape[1], + }; + glUniform2fv(v_console_size, 1, console_size); + + // Bind textures to program. + glActiveTexture(GL_TEXTURE0 + 3); // Tileset atlas. + glBindTexture(GL_TEXTURE_2D, atlas->texture); + // Texels are clamped by the shader, GL_LINEAR can be used without bleeding. + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glUniform1i(t_tileset, 3); + glActiveTexture(GL_TEXTURE0 + 0); // Tile position. + glBindTexture(GL_TEXTURE_2D, renderer->console_textures[0]); + glUniform1i(t_console_tile, 0); + glActiveTexture(GL_TEXTURE0 + 1); // Foreground color. + glBindTexture(GL_TEXTURE_2D, renderer->console_textures[1]); + glUniform1i(t_console_fg, 1); + glActiveTexture(GL_TEXTURE0 + 2); // Background color. + glBindTexture(GL_TEXTURE_2D, renderer->console_textures[2]); + glUniform1i(t_console_bg, 2); + + // Bind vertex array. + glBindBuffer(GL_ARRAY_BUFFER, renderer->vertex_buffer); + glEnableVertexAttribArray(a_vertex); + glVertexAttribPointer(a_vertex, 2, GL_BYTE, GL_FALSE, 0, 0); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + glBindBuffer(GL_ARRAY_BUFFER, 0); + glActiveTexture(GL_TEXTURE0 + 3); + glBindTexture(GL_TEXTURE_2D, 0); + glActiveTexture(GL_TEXTURE0 + 2); + glBindTexture(GL_TEXTURE_2D, 0); + glActiveTexture(GL_TEXTURE0 + 1); + glBindTexture(GL_TEXTURE_2D, 0); + glActiveTexture(GL_TEXTURE0 + 0); + glBindTexture(GL_TEXTURE_2D, 0); + glUseProgram(0); + if (glGetError()) { + TCOD_set_errorv("Unexpected OpenGL error."); + return TCOD_E_ERROR; + } + return TCOD_E_OK; +} +/** + * Render the console onto the screen. + */ +static TCOD_Error gl2_accumulate( + struct TCOD_Context* context, + const TCOD_Console* console, + const struct TCOD_ViewportOptions* viewport) +{ + struct TCOD_RendererGL2* renderer = context->contextdata; + TCOD_Error err; + if ((err = resize_textures(renderer, console)) < 0) { return err; } + if ((err = render(renderer, console, viewport)) < 0) { return err; } + + glFlush(); + if (glGetError()) { + TCOD_set_errorv("Unexpected OpenGL error."); + return TCOD_E_ERROR; + } + return TCOD_E_OK; +} +/** + * Clear, render, and swap the screen. + */ +static TCOD_Error gl2_present( + struct TCOD_Context* context, + const TCOD_Console* console, + const struct TCOD_ViewportOptions* viewport) +{ + if (!viewport) { viewport = &TCOD_VIEWPORT_DEFAULT_; } + struct TCOD_RendererGL2* renderer = context->contextdata; + int window_width; + int window_height; + SDL_GL_GetDrawableSize(renderer->common.window, &window_width, &window_height); + glViewport(0, 0, window_width, window_height); + glClearColor( + (float)viewport->clear_color.r / 255.0f, + (float)viewport->clear_color.g / 255.0f, + (float)viewport->clear_color.b / 255.0f, + (float)viewport->clear_color.a / 255.0f); + glClear(GL_COLOR_BUFFER_BIT); + TCOD_Error err = gl2_accumulate(context, console, viewport); + SDL_GL_SwapWindow(renderer->common.window); + return err; +} +void gl2_destructor(struct TCOD_Context* context) +{ + struct TCOD_RendererGL2* renderer = context->contextdata; + if (!renderer) { return; } + glDeleteBuffers(1, &renderer->vertex_buffer); + glDeleteTextures(3, renderer->console_textures); + glDeleteProgram(renderer->program); + TCOD_renderer_gl_common_uninit(&renderer->common); + free(renderer); +} +TCODLIB_API TCOD_NODISCARD +struct TCOD_Context* TCOD_renderer_new_gl2( + int pixel_width, + int pixel_height, + const char* title, + int window_flags, + bool vsync, + struct TCOD_Tileset* tileset) +{ + struct TCOD_Context* context = TCOD_context_new_(); + if (!context) { return NULL; } + context->type = TCOD_RENDERER_OPENGL2; + struct TCOD_RendererGL2* renderer = calloc(sizeof(*renderer), 1); + if (!renderer) { TCOD_context_delete(context); return NULL; } + context->destructor_ = gl2_destructor; + context->contextdata = renderer; + TCOD_Error err = TCOD_renderer_gl_common_init( + pixel_width, + pixel_height, + title, + window_flags, + vsync, + tileset, + 2, + 0, + SDL_GL_CONTEXT_PROFILE_CORE, + context); + if (err < 0) { + TCOD_context_delete(context); + return NULL; + } + if (gl2_build_shader(&renderer->program) < 0) { + TCOD_context_delete(context); + return NULL; + } + + glGenTextures(3, renderer->console_textures); + for (int i = 0; i < 3; ++i) { + glBindTexture(GL_TEXTURE_2D, renderer->console_textures[i]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + } + glBindTexture(GL_TEXTURE_2D, 0); + + glGenBuffers(1, &renderer->vertex_buffer); + glBindBuffer(GL_ARRAY_BUFFER, renderer->vertex_buffer); + const uint8_t VERTEX_BUFFER_DATA[8] = {0, 0, 0, 1, 1, 0, 1, 1}; + glBufferData(GL_ARRAY_BUFFER, 8, VERTEX_BUFFER_DATA, GL_STATIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, 0); + + context->accumulate_ = gl2_accumulate; + context->present_ = gl2_present; + return context; +} diff --git a/tcod_sys/libtcod/src/libtcod/renderer_gl2.glslf b/tcod_sys/libtcod/src/libtcod/renderer_gl2.glslf new file mode 100644 index 000000000..6260c31d2 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/renderer_gl2.glslf @@ -0,0 +1,44 @@ +uniform vec2 v_tiles_shape; // Tileset columns/rows. +uniform vec2 v_tiles_size; // Tileset texture size. +uniform sampler2D t_tileset; + +uniform vec2 v_console_shape; // The true size of the textures. +uniform sampler2D t_console_tile; // Packed tileset coordinates. +uniform sampler2D t_console_fg; +uniform sampler2D t_console_bg; + +varying vec2 v_coord; // Console coordinates. + +void main(void) +{ + vec2 tile_size = v_tiles_size / v_tiles_shape; + // The sample coordinate for per-tile console variables. + vec2 console_pos = floor(v_coord); + console_pos += vec2(0.5, 0.5); // Offset to the center (for sampling.) + console_pos /= v_console_shape; // Scale to fit in t_console_X textures. + + // Coordinates within a tile. + vec2 tile_interp = fract(v_coord); + + vec4 tile_encoded = vec4(texture2D(t_console_tile, console_pos)); + + // Unpack tileset index. + vec2 tile_address = vec2( + tile_encoded.x * float(0xff) + tile_encoded.y * float(0xff00), + tile_encoded.z * float(0xff) + tile_encoded.w * float(0xff00) + ); + + // Clamp the edges of tile_interp to prevent alias bleeding. + tile_interp = clamp(tile_interp, 0.5 / tile_size, 1.0 - 0.5 / tile_size); + + // Apply tile_interp and scale. + tile_address = (tile_address + tile_interp) / v_tiles_shape; + + vec4 tile_color = texture2D(t_tileset, tile_address); + + vec4 bg = texture2D(t_console_bg, console_pos); + vec4 fg = texture2D(t_console_fg, console_pos); + fg.rgb *= tile_color.rgb; + + gl_FragColor = mix(bg, fg, tile_color.a); +} diff --git a/tcod_sys/libtcod/src/libtcod/renderer_gl2.glslv b/tcod_sys/libtcod/src/libtcod/renderer_gl2.glslv new file mode 100644 index 000000000..281421e08 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/renderer_gl2.glslv @@ -0,0 +1,16 @@ +uniform mat4 mvp_matrix; // Model-view-projection matrix + +attribute vec2 a_vertex; // Simple vertex quad. + +uniform vec2 v_console_shape; // The true size of the textures. +uniform vec2 v_console_size; // The relative size of the console textures. + +varying vec2 v_coord; // Simple quad coordinate. + +void main(void) +{ + gl_Position = mvp_matrix * vec4(a_vertex, 0.0, 1.0); + v_coord = vec2(a_vertex.x, 1.0 - a_vertex.y); // Flip Y + // Expand to console coordinates. + v_coord *= v_console_shape * v_console_size; +} diff --git a/tcod_sys/libtcod/src/libtcod/renderer_gl2.h b/tcod_sys/libtcod/src/libtcod/renderer_gl2.h new file mode 100644 index 000000000..75a2f8045 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/renderer_gl2.h @@ -0,0 +1,60 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_RENDERER_GL2_H_ +#define LIBTCOD_RENDERER_GL2_H_ +#include "config.h" + +#include + +#include "tileset.h" +#include "renderer_gl.h" + +struct SDL_Window; + +struct TCOD_RendererGL2 { + struct TCOD_RendererGLCommon common; + uint32_t program; + uint32_t console_textures[3]; // ch, fg, bg + int console_width; + int console_height; + uint32_t vertex_buffer; +}; + +TCOD_PUBLIC TCOD_NODISCARD +struct TCOD_Context* TCOD_renderer_new_gl2( + int width, + int height, + const char* title, + int window_flags, + bool vsync, + struct TCOD_Tileset* tileset); +#endif // LIBTCOD_RENDERER_GL2_H_ diff --git a/tcod_sys/libtcod/src/libtcod/renderer_gl_internal.h b/tcod_sys/libtcod/src/libtcod/renderer_gl_internal.h new file mode 100644 index 000000000..689e703c7 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/renderer_gl_internal.h @@ -0,0 +1,245 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_RENDERER_GL_INTERNAL_H_ +#define LIBTCOD_RENDERER_GL_INTERNAL_H_ +#include "config.h" + +#include +#include + +#include "libtcod_int.h" +#include "renderer_gl.h" + +#include +#include "../vendor/glad.h" +#include "../vendor/lodepng.h" + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +/** + * Save a screen capture. + */ +static TCOD_Error gl_screenshot(struct TCOD_Context* context, const char* filename) +{ + (void)context; // Unused parameter. + int rect[4]; + glGetIntegerv(GL_VIEWPORT, rect); + TCOD_ColorRGBA* pixels = malloc(sizeof(*pixels) * rect[2] * rect[3]); + if (!pixels) { + TCOD_set_errorv("Could not allocae memory for a screenshot."); + return TCOD_E_OUT_OF_MEMORY; + } + glReadPixels(0, 0, rect[2], rect[3], GL_RGBA, GL_UNSIGNED_BYTE, pixels); + // Flip image on Y axis. + for (int y = 0; y < rect[3] / 2; ++y) { + for (int x = 0; x < rect[2]; ++x) { + TCOD_ColorRGBA tmp = pixels[y * rect[2] + x]; + pixels[y * rect[2] + x] = pixels[(rect[3] - 1 - y) * rect[2] + x]; + pixels[(rect[3] - 1 - y) * rect[2] + x] = tmp; + } + } + lodepng_encode32_file(filename, (const unsigned char*)pixels, (unsigned)rect[2], (unsigned)rect[3]); + free(pixels); + return TCOD_E_OK; +} +/** + * Return the SDL2 window. + */ +static struct SDL_Window* gl_get_sdl_window(struct TCOD_Context* context) +{ + struct TCOD_RendererGLCommon* renderer = context->contextdata; + return renderer->window; +} +/** + * Convert pixel coordinates to tile coordinates. + */ +static void gl_pixel_to_tile(struct TCOD_Context* self, double* x, double* y) +{ + struct TCOD_RendererGLCommon* renderer = self->contextdata; + *x = (*x - renderer->last_offset_x) * renderer->last_scale_x; + *y = (*y - renderer->last_offset_y) * renderer->last_scale_y; +} +/** + Change the atlas to the given tileset. + */ +static TCOD_Error gl_set_tileset( + struct TCOD_Context* self, TCOD_Tileset* tileset) +{ + struct TCOD_RendererGLCommon* renderer = self->contextdata; + struct TCOD_TilesetAtlasOpenGL* atlas = TCOD_gl_atlas_new(tileset); + if (!atlas) { return TCOD_E_ERROR; } + if (renderer->atlas) { TCOD_gl_atlas_delete(renderer->atlas); } + renderer->atlas = atlas; + return TCOD_E_OK; +} +static TCOD_Error gl_recommended_console_size( + struct TCOD_Context* self, int* columns, int* rows) +{ + struct TCOD_RendererGLCommon* context = self->contextdata; + int w; + int h; + SDL_GL_GetDrawableSize(context->window, &w, &h); + if (columns) { *columns = w / context->atlas->tileset->tile_width; } + if (rows) { *rows = h / context->atlas->tileset->tile_height; } + return TCOD_E_OK; +} +static void TCOD_renderer_gl_common_uninit(struct TCOD_RendererGLCommon* common) +{ + if (common->atlas) { + TCOD_gl_atlas_delete(common->atlas); + common->atlas = NULL; + } + if (common->glcontext) { + SDL_GL_DeleteContext(common->glcontext); + common->glcontext = NULL; + } + if (common->window) { + SDL_DestroyWindow(common->window); + common->window = NULL; + } + SDL_QuitSubSystem(common->sdl_subsystems); + common->sdl_subsystems = 0; +} +TCOD_NODISCARD +static TCOD_Error TCOD_renderer_gl_common_init( + int pixel_width, + int pixel_height, + const char* title, + int window_flags, + bool vsync, + struct TCOD_Tileset* tileset, + int gl_major, + int gl_minor, + int gl_profile, + struct TCOD_Context* out) +{ + out->get_sdl_window_ = gl_get_sdl_window; + out->pixel_to_tile_ = gl_pixel_to_tile; + out->save_screenshot_ = gl_screenshot; + out->set_tileset = gl_set_tileset; + out->cb_recommended_console_size_ = gl_recommended_console_size; + struct TCOD_RendererGLCommon* renderer = out->contextdata; + if (!tileset) { return TCOD_E_ERROR; } + if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) { + TCOD_set_errorvf("Could not initialize SDL:\n%s", SDL_GetError()); + return TCOD_E_ERROR; + } + renderer->sdl_subsystems = SDL_INIT_VIDEO; + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, gl_major); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, gl_minor); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, gl_profile); + renderer->window = SDL_CreateWindow( + title, + SDL_WINDOWPOS_UNDEFINED, + SDL_WINDOWPOS_UNDEFINED, + pixel_width, + pixel_height, + window_flags | SDL_WINDOW_OPENGL); + if (!renderer->window) { + TCOD_set_errorvf("Could not create SDL window:\n%s", SDL_GetError()); + TCOD_renderer_gl_common_uninit(renderer); + return TCOD_E_ERROR; + } + renderer->glcontext = SDL_GL_CreateContext(renderer->window); + if (!renderer->glcontext) { + TCOD_set_errorvf("Could not create GL context:\n%s", SDL_GetError()); + TCOD_renderer_gl_common_uninit(renderer); + return TCOD_E_ERROR; + } + if(!gladLoadGLLoader(SDL_GL_GetProcAddress)) { + TCOD_set_errorv("Failed to invoke the GLAD loader."); + TCOD_renderer_gl_common_uninit(renderer); + return TCOD_E_ERROR; + } + SDL_GL_SetSwapInterval(vsync); + if (out->set_tileset(out, tileset) < 0) { + TCOD_renderer_gl_common_uninit(renderer); + return TCOD_E_ERROR; + } + return TCOD_E_OK; +} +static inline float minf(float a, float b) { + return a < b ? a : b; +} +static inline float maxf(float a, float b) { + return a > b ? a : b; +} +static inline float clampf(float v, float low, float high) { + return maxf(low, minf(v, high)); +} +static void gl_get_viewport_scale( + const struct TCOD_TilesetAtlasOpenGL* atlas, + const struct TCOD_Console* console, + const struct TCOD_ViewportOptions* viewport, + float matrix_4x4_out[16], + struct TCOD_RendererGLCommon* common_out) +{ + if (!viewport) { viewport = &TCOD_VIEWPORT_DEFAULT_; } + SDL_Rect gl_viewport; + glGetIntegerv(GL_VIEWPORT, (int*)&gl_viewport); + const int tile_width = atlas->tileset->tile_width; + const int tile_height = atlas->tileset->tile_height; + float scale_w = (float)gl_viewport.w / (float)(console->w * tile_width); + float scale_h = (float)gl_viewport.h / (float)(console->h * tile_height); + if (viewport->integer_scaling) { + scale_w = scale_w <= 1.0f ? scale_w : floorf(scale_w); + scale_h = scale_h <= 1.0f ? scale_h : floorf(scale_h); + } + if (viewport->keep_aspect) { + scale_w = scale_h = minf(scale_w, scale_h); + } + scale_w *= (float)(console->w * tile_width) / (float)gl_viewport.w; + scale_h *= (float)(console->h * tile_height) / (float)gl_viewport.h; + float translate_x = ((1.0f - scale_w) * clampf(viewport->align_x, 0, 1)); + float translate_y = ((1.0f - scale_h) * clampf(viewport->align_y, 0, 1)); + translate_x = roundf(translate_x * gl_viewport.w) / gl_viewport.w; + translate_y = roundf(translate_y * gl_viewport.h) / gl_viewport.h; + float matrix[4*4] = { + 2.0f * scale_w, 0, 0, 0, + 0, 2.0f * scale_h, 0, 0, + 0, 0, 1, 0, + -1.0f + 2.0f * translate_x, -1.0f + 2.0f * translate_y, 1, 1, + }; + memcpy(matrix_4x4_out, matrix, sizeof(matrix)); + // Track viewport scaling for mouse coordinates. + common_out->last_offset_x = (double)translate_x * (double)gl_viewport.w; + common_out->last_offset_y = (double)translate_x * (double)gl_viewport.h; + common_out->last_scale_x = + (double)scale_w * (double)console->w / (double)gl_viewport.w; + common_out->last_scale_y = + (double)scale_h * (double)console->h / (double)gl_viewport.h; +} +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus +#endif // LIBTCOD_RENDERER_GL_INTERNAL_H_ diff --git a/tcod_sys/libtcod/src/libtcod/renderer_sdl2.c b/tcod_sys/libtcod/src/libtcod/renderer_sdl2.c new file mode 100644 index 000000000..4090a9047 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/renderer_sdl2.c @@ -0,0 +1,666 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "renderer_sdl2.h" + +#include "stdlib.h" +#include "math.h" + +#include +#include "../vendor/lodepng.h" +#include "libtcod_int.h" + +static inline float minf(float a, float b) { + return a < b ? a : b; +} +static inline float maxf(float a, float b) { + return a > b ? a : b; +} +static inline float clampf(float v, float low, float high) { + return maxf(low, minf(v, high)); +} +// ---------------------------------------------------------------------------- +// SDL2 Atlas +/** + * Return a rectangle shaped for a tile at `x`,`y`. + */ +static SDL_Rect get_aligned_tile( + const struct TCOD_Tileset* tileset, int x, int y) +{ + SDL_Rect tile_rect = { + x * tileset->tile_width, + y * tileset->tile_height, + tileset->tile_width, + tileset->tile_height + }; + return tile_rect; +} +/** + * Return the rectangle for the tile at `tile_id`. + */ +static SDL_Rect get_sdl2_atlas_tile( + const struct TCOD_TilesetAtlasSDL2* atlas, int tile_id) +{ + return get_aligned_tile( + atlas->tileset, + tile_id % atlas->texture_columns, + tile_id / atlas->texture_columns + ); +} +/** + * Upload a single tile to the atlas texture. + */ +static int update_sdl2_tile(struct TCOD_TilesetAtlasSDL2* atlas, int tile_id) +{ + const SDL_Rect dest = get_sdl2_atlas_tile(atlas, tile_id); + return SDL_UpdateTexture( + atlas->texture, + &dest, + atlas->tileset->pixels + (tile_id * atlas->tileset->tile_length), + atlas->tileset->tile_width * sizeof(*atlas->tileset->pixels)); +} +/** + * Setup a atlas texture and upload the tileset graphics. + */ +static int prepare_sdl2_atlas(struct TCOD_TilesetAtlasSDL2* atlas) +{ + if (!atlas) { return -1; } + int current_size = 0; + if (atlas->texture) { + SDL_QueryTexture(atlas->texture, NULL, NULL, ¤t_size, NULL); + } + int new_size = current_size ? current_size : 256; + int rows; + int columns; + while (1) { + rows = new_size / atlas->tileset->tile_width; + columns = new_size / atlas->tileset->tile_height; + if (rows * columns >= atlas->tileset->tiles_capacity) { break; } + new_size *= 2; + } + if (new_size != current_size) { + if (atlas->texture) { SDL_DestroyTexture(atlas->texture); } + atlas->texture = SDL_CreateTexture( + atlas->renderer, + SDL_PIXELFORMAT_RGBA32, + SDL_TEXTUREACCESS_STATIC, + new_size, + new_size); + if (!atlas->texture) { return -1; } + atlas->texture_columns = columns; + for (int i = 0; i < atlas->tileset->tiles_count; ++i) { + if (update_sdl2_tile(atlas, i) < 0) { + return -1; // Issue with SDL_UpdateTexture. + } + } + return 1; // Atlas texture has been resized and refreshed. + } + return 0; // No action. +} +/** + * Respond to changes in a tileset. + */ +static int sdl2_atlas_on_tile_changed( + struct TCOD_TilesetObserver* observer, int tile_id) +{ + struct TCOD_TilesetAtlasSDL2* atlas = observer->userdata; + if (prepare_sdl2_atlas(atlas) == 1) { + return 0; // Tile updated as a side-effect of prepare_sdl2_atlas. + } + return update_sdl2_tile(atlas, tile_id); +} +struct TCOD_TilesetAtlasSDL2* TCOD_sdl2_atlas_new( + struct SDL_Renderer* renderer, + struct TCOD_Tileset* tileset) +{ + if (!renderer || !tileset) { return NULL; } + struct TCOD_TilesetAtlasSDL2* atlas = calloc(sizeof(*atlas), 1); + if (!atlas) { return NULL; } + atlas->observer = TCOD_tileset_observer_new(tileset); + if (!atlas->observer) { TCOD_sdl2_atlas_delete(atlas); return NULL; } + atlas->renderer = renderer; + atlas->tileset = tileset; + atlas->tileset->ref_count += 1; + atlas->observer->userdata = atlas; + atlas->observer->on_tile_changed = sdl2_atlas_on_tile_changed; + prepare_sdl2_atlas(atlas); + return atlas; +} +void TCOD_sdl2_atlas_delete( + struct TCOD_TilesetAtlasSDL2* atlas) +{ + if (!atlas) { return; } + if (atlas->observer) { TCOD_tileset_observer_delete(atlas->observer); } + if (atlas->tileset) { TCOD_tileset_delete(atlas->tileset); } + if (atlas->texture) { SDL_DestroyTexture(atlas->texture); } + free(atlas); +} +/** + * Update a cache console by resetting tiles which point to the updated tile. + */ +static int cache_console_update( + struct TCOD_TilesetObserver* observer, int tile_id) +{ + struct TCOD_Console* console = observer->userdata; + for (int c = 0; c < observer->tileset->character_map_length; ++c) { + // Find codepoints that point to the tile_id. + if (observer->tileset->character_map[c] != tile_id) { continue; } + for (int i = 0; i < console->elements; ++i) { + // Compare matched codepoints to the cache console characters. + if (console->tiles[i].ch != c) { continue; } + console->tiles[i].ch = -1; + } + } + return 0; +} +/** + * Delete a consoles observer if it exists. + */ +static void cache_console_on_delete(struct TCOD_Console* console) +{ + if (!console->userdata) { return; } + TCOD_tileset_observer_delete(console->userdata); +} +/** + * Clear the observer of a console pointed to by this observer. + */ +static void cache_console_observer_delete(struct TCOD_TilesetObserver* observer) +{ + ((struct TCOD_Console*)observer->userdata)->userdata = NULL; +} +/** + * Setup the console at `cache` to match the current console size. + */ +TCOD_NODISCARD +static TCOD_Error setup_cache_console( + const struct TCOD_TilesetAtlasSDL2* atlas, + const struct TCOD_Console* console, + struct TCOD_Console** cache) +{ + if (!atlas) { + TCOD_set_errorv("Atlas can not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + if (!console) { + TCOD_set_errorv("Console can not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + if (!cache) { return TCOD_E_OK; } + if (*cache) { + if ((*cache)->w != console->w || (*cache)->h != console->h) { + TCOD_console_delete(*cache); + *cache = NULL; + } + } + if (!*cache) { + *cache = TCOD_console_new(console->w, console->h); + struct TCOD_TilesetObserver* observer = + TCOD_tileset_observer_new(atlas->tileset); + if (!*cache || !observer) { + TCOD_console_delete(*cache); + *cache = NULL; + TCOD_tileset_observer_delete(observer); + TCOD_set_errorv("Failed to create an internal cache console."); + return TCOD_E_OUT_OF_MEMORY; // Failed to allocate cache. + } + observer->userdata = *cache; + (*cache)->userdata = observer; + observer->on_tile_changed = cache_console_update; + (*cache)->on_delete = cache_console_on_delete; + observer->on_observer_delete = cache_console_observer_delete; + for (int i = 0; i < (*cache)->elements; ++i) { + (*cache)->tiles[i].ch = -1; + } + } + return TCOD_E_OK; +} +/** + Render a console onto the current render target. + + `atlas` is an SDL2 atlas created with `TCOD_sdl2_atlas_new`. + + `console` is the libtcod console you want to render. Must not be NULL. + + `cache` can be NULL, or a pointer to a console pointer. + `cache` should be NULL unless you are using a non-default render target. + + Returns a negative value on an error, check `TCOD_get_error`. + */ +static TCOD_Error TCOD_sdl2_render( + const struct TCOD_TilesetAtlasSDL2* atlas, + const struct TCOD_Console* console, + struct TCOD_Console** cache) +{ + if (!atlas) { + TCOD_set_errorv("Atlas must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + if (!console) { + TCOD_set_errorv("Console must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + TCOD_Error err = setup_cache_console(atlas, console, cache); + if (err < 0) { return err; } + SDL_SetRenderDrawBlendMode(atlas->renderer, SDL_BLENDMODE_NONE); + SDL_SetTextureBlendMode(atlas->texture, SDL_BLENDMODE_BLEND); + SDL_SetTextureAlphaMod(atlas->texture, 0xff); + for (int y = 0; y < console->h; ++y) { + for (int x = 0; x < console->w; ++x) { + const SDL_Rect dest = get_aligned_tile(atlas->tileset, x, y); + struct TCOD_ConsoleTile tile = console->tiles[console->w * y + x]; + if (tile.ch == 0x20) { + tile.ch = 0; // Tile is the space character. + } + if (tile.ch < 0 || tile.ch >= atlas->tileset->character_map_length) { + tile.ch = 0; // Tile is out-of-bounds. + } + if (tile.fg.a == 0) { + tile.ch = 0; // No foreground alpha. + } + if (tile.ch == 0) { + // Clear foreground color if the foreground glyph is skipped. + tile.fg.r = tile.fg.g = tile.fg.b = tile.fg.a = 0; + } + if (cache && *cache) { + const struct TCOD_ConsoleTile cached = + (*cache)->tiles[(*cache)->w * y + x]; + if (tile.ch == cached.ch + && tile.fg.r == cached.fg.r + && tile.fg.g == cached.fg.g + && tile.fg.b == cached.fg.b + && tile.fg.a == cached.fg.a + && tile.bg.r == cached.bg.r + && tile.bg.g == cached.bg.g + && tile.bg.b == cached.bg.b + && tile.bg.a == cached.bg.a) { + continue; + } + (*cache)->tiles[(*cache)->w * y + x] = tile; + } + // Fill the background of the tile with a solid color. + SDL_SetRenderDrawColor( + atlas->renderer, tile.bg.r, tile.bg.g, tile.bg.b, tile.bg.a); + SDL_RenderFillRect(atlas->renderer, &dest); + if (tile.ch == 0) { + continue; // Skip foreground glyph. + } + // Blend the foreground glyph on top of the background. + SDL_SetTextureColorMod(atlas->texture, tile.fg.r, tile.fg.g, tile.fg.b); + SDL_SetTextureAlphaMod(atlas->texture, tile.fg.a); + int tile_id = atlas->tileset->character_map[tile.ch]; + const SDL_Rect src = get_sdl2_atlas_tile(atlas, tile_id); + SDL_RenderCopy(atlas->renderer, atlas->texture, &src, &dest); + } + } + return TCOD_E_OK; +} +TCOD_Error TCOD_sdl2_render_texture( + const struct TCOD_TilesetAtlasSDL2* atlas, + const struct TCOD_Console* console, + struct TCOD_Console** cache, + struct SDL_Texture** target) +{ + if (!target) { // Render without a managed target. + return TCOD_sdl2_render(atlas, console, cache); + } + if (!atlas) { + TCOD_set_errorv("Atlas must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + if (!console) { + TCOD_set_errorv("Console must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + SDL_RendererInfo renderer_info; + SDL_GetRendererInfo(atlas->renderer, &renderer_info); + if (!(renderer_info.flags & SDL_RENDERER_TARGETTEXTURE)) { + return TCOD_set_errorv("SDL_RENDERER_TARGETTEXTURE is required."); + } + if (*target) { + int tex_width; + int tex_height; + SDL_QueryTexture(*target, NULL, NULL, + &tex_width, &tex_height); + if (tex_width != atlas->tileset->tile_width * console->w + || tex_height != atlas->tileset->tile_height * console->h) { + SDL_DestroyTexture(*target); + *target = NULL; + if (cache && *cache) { + TCOD_console_delete(*cache); + *cache = NULL; + } + } + } + if (!*target) { + *target = SDL_CreateTexture( + atlas->renderer, + SDL_PIXELFORMAT_RGBA32, + SDL_TEXTUREACCESS_TARGET, + atlas->tileset->tile_width * console->w, + atlas->tileset->tile_height * console->h); + if (!*target) { + return TCOD_set_errorv("Failed to create a new target texture."); + } + } + SDL_Texture* old_target = SDL_GetRenderTarget(atlas->renderer); + SDL_SetRenderTarget(atlas->renderer, *target); + TCOD_Error err = TCOD_sdl2_render(atlas, console, cache); + SDL_SetRenderTarget(atlas->renderer, old_target); + return err; +} +// ---------------------------------------------------------------------------- +// SDL2 Rendering +/** + * Handle events from SDL2. + * + * Target textures need to be reset on an SDL_RENDER_TARGETS_RESET event. + */ +static int sdl2_handle_event(void* userdata, SDL_Event* event) +{ + struct TCOD_RendererSDL2* context = userdata; + switch(event->type) { + case SDL_RENDER_TARGETS_RESET: + if (context->cache_console) { + TCOD_console_delete(context->cache_console); + context->cache_console = NULL; + } + break; + } + return 0; +} +/** + * Deconstruct an SDL2 rendering context. + */ +static void sdl2_destructor(struct TCOD_Context* self) +{ + struct TCOD_RendererSDL2* context = self->contextdata; + if (!context) { return; } + SDL_DelEventWatch(sdl2_handle_event, context); + if (context->cache_console) { TCOD_console_delete(context->cache_console); } + if (context->cache_texture) { SDL_DestroyTexture(context->cache_texture); } + if (context->renderer) { SDL_DestroyRenderer(context->renderer); } + if (context->window) { SDL_DestroyWindow(context->window); } + SDL_QuitSubSystem(context->sdl_subsystems); + free(context); +} +/** Return the destination rectangle for these inputs. */ +TCOD_NODISCARD static SDL_Rect get_destination_rect( + const struct TCOD_TilesetAtlasSDL2* atlas, + const struct TCOD_Console* console, + const struct TCOD_ViewportOptions* viewport) +{ + if (!viewport) { viewport = &TCOD_VIEWPORT_DEFAULT_; } + const int tile_width = atlas->tileset->tile_width; + const int tile_height = atlas->tileset->tile_height; + int output_w; + int output_h; + SDL_GetRendererOutputSize(atlas->renderer, &output_w, &output_h); + SDL_Rect out = {0, 0, output_w, output_h}; + float scale_w = (float)output_w / (float)(console->w * tile_width); + float scale_h = (float)output_h / (float)(console->h * tile_height); + if (viewport->integer_scaling) { + scale_w = scale_w <= 1.0f ? scale_w : floorf(scale_w); + scale_h = scale_h <= 1.0f ? scale_h : floorf(scale_h); + } + if (viewport->keep_aspect) { + scale_w = scale_h = minf(scale_w, scale_h); + } + out.w = (int)((float)(console->w * tile_width) * scale_w); + out.h = (int)((float)(console->h * tile_height) * scale_h); + out.x = (int)((float)(output_w - out.w) * clampf(viewport->align_x, 0, 1)); + out.y = (int)((float)(output_h - out.h) * clampf(viewport->align_y, 0, 1)); + return out; +} +/** + * Render to the SDL2 renderer without presenting the screen. + */ +static TCOD_Error sdl2_accumulate( + struct TCOD_Context* self, + const struct TCOD_Console* console, + const struct TCOD_ViewportOptions* viewport) +{ + struct TCOD_RendererSDL2* context = self->contextdata; + if (!context || !console) { return -1; } + TCOD_Error err = TCOD_sdl2_render_texture( + context->atlas, console, &context->cache_console, &context->cache_texture); + if (err < 0) { return err; } + SDL_Rect dest = get_destination_rect(context->atlas, console, viewport); + // Set mouse coordinate scaling. + context->last_offset_x = dest.x; + context->last_offset_y = dest.y; + context->last_scale_x = (double)console->w / (double)dest.w; + context->last_scale_y = (double)console->h / (double)dest.h; + if (!TCOD_ctx.sdl_cbk) { + // Normal rendering. + SDL_RenderCopy(context->renderer, context->cache_texture, NULL, &dest); + } else { + // Deprecated callback rendering. + int tex_width; + int tex_height; + SDL_QueryTexture(context->cache_texture, NULL, NULL, + &tex_width, &tex_height); + SDL_Surface* canvas = SDL_CreateRGBSurfaceWithFormat( + 0, tex_width, tex_height, 32, SDL_PIXELFORMAT_RGBA32); + SDL_SetRenderTarget(context->renderer, context->cache_texture); + SDL_RenderReadPixels( + context->renderer, + NULL, + SDL_PIXELFORMAT_RGBA32, + canvas->pixels, + tex_width * 4); + SDL_SetRenderTarget(context->renderer, NULL); + TCOD_ctx.sdl_cbk(canvas); + SDL_Texture* canvas_tex = SDL_CreateTextureFromSurface( + context->renderer, canvas); + SDL_RenderCopy(context->renderer, canvas_tex, NULL, &dest); + SDL_DestroyTexture(canvas_tex); + SDL_FreeSurface(canvas); + } + return TCOD_E_OK; +} +/** + * Clear, render, and present a libtcod console to the screen. + */ +static TCOD_Error sdl2_present( + struct TCOD_Context* self, + const struct TCOD_Console* console, + const struct TCOD_ViewportOptions* viewport) +{ + if (!viewport) { viewport = &TCOD_VIEWPORT_DEFAULT_; } + struct TCOD_RendererSDL2* context = self->contextdata; + SDL_SetRenderTarget(context->renderer, NULL); + SDL_SetRenderDrawColor( + context->renderer, + viewport->clear_color.r, + viewport->clear_color.g, + viewport->clear_color.b, + viewport->clear_color.a); + SDL_RenderClear(context->renderer); + TCOD_Error err = sdl2_accumulate(self, console, viewport); + if (err) { return err; } + SDL_RenderPresent(context->renderer); + return TCOD_E_OK; +} +/** + * Convert pixel coordinates to tile coordinates. + */ +static void sdl2_pixel_to_tile(struct TCOD_Context* self, double* x, double* y) +{ + struct TCOD_RendererSDL2* context = self->contextdata; + *x = (*x - context->last_offset_x) * context->last_scale_x; + *y = (*y - context->last_offset_y) * context->last_scale_y; +} +/** + * Save a PNG screen-shot to `file`. + */ +static TCOD_Error sdl2_save_screenshot(struct TCOD_Context* self, const char* filename) +{ + struct TCOD_RendererSDL2* context = self->contextdata; + if (!context->cache_texture) { + TCOD_set_errorv("Nothing to save before the first frame."); + lodepng_encode32_file(filename, NULL, 0, 0); + return TCOD_E_WARN; + } + SDL_SetRenderTarget(context->renderer, context->cache_texture); + int width; + int height; + SDL_QueryTexture(context->cache_texture, NULL, NULL, &width, &height); + void* pixels = malloc(sizeof(uint8_t) * 4 * width * height); + if (!pixels) { + SDL_SetRenderTarget(context->renderer, NULL); + TCOD_set_errorv("Out of memory."); + return TCOD_E_OUT_OF_MEMORY; + } + SDL_RenderReadPixels( + context->renderer, + NULL, + SDL_PIXELFORMAT_RGBA32, + pixels, + (int)(sizeof(uint8_t) * 4 * width)); + lodepng_encode32_file(filename, pixels, (unsigned)width, (unsigned)height); + free(pixels); + SDL_SetRenderTarget(context->renderer, NULL); + return TCOD_E_OK; +} +/** + * Return a pointer to the SDL2 window. + */ +static struct SDL_Window* sdl2_get_window(struct TCOD_Context* self) +{ + return ((struct TCOD_RendererSDL2*)self->contextdata)->window; +} +/** + * Return a pointer to the SDL2 renderer. + */ +static struct SDL_Renderer* sdl2_get_renderer(struct TCOD_Context* self) +{ + return ((struct TCOD_RendererSDL2*)self->contextdata)->renderer; +} +/** + Change the atlas to the given tileset. + */ +static TCOD_Error sdl2_set_tileset( + struct TCOD_Context* self, TCOD_Tileset* tileset) +{ + struct TCOD_RendererSDL2* context = self->contextdata; + struct TCOD_TilesetAtlasSDL2* atlas = + TCOD_sdl2_atlas_new(context->renderer, tileset); + if (!atlas) { return TCOD_E_ERROR; } + if (context->atlas) { TCOD_sdl2_atlas_delete(context->atlas); } + context->atlas = atlas; + if (context->cache_console) { + TCOD_console_delete(context->cache_console); + context->cache_console = NULL; + } + return TCOD_E_OK; +} +static TCOD_Error sdl2_recommended_console_size( + struct TCOD_Context* self, int* columns, int* rows) +{ + struct TCOD_RendererSDL2* context = self->contextdata; + int w; + int h; + if (SDL_GetRendererOutputSize(context->renderer, &w, &h) < 0) { + TCOD_set_errorvf("SDL Error: %s", SDL_GetError()); + return TCOD_E_ERROR; + } + if (columns) { *columns = w / context->atlas->tileset->tile_width; } + if (rows) { *rows = h / context->atlas->tileset->tile_height; } + return TCOD_E_OK; +} +struct TCOD_Context* TCOD_renderer_init_sdl2( + int pixel_width, + int pixel_height, + const char* title, + int window_flags, + int renderer_flags, + struct TCOD_Tileset* tileset) +{ + if (!tileset) { + TCOD_set_errorv("Tileset must not be NULL."); + return NULL; + } + struct TCOD_Context* context = TCOD_context_new_(); + if (!context) { return NULL; } + struct TCOD_RendererSDL2* sdl2_data = calloc(sizeof(*sdl2_data), 1); + if (!sdl2_data) { + TCOD_set_errorv("Out of memory."); + TCOD_context_delete(context); + return NULL; + } + if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) { + TCOD_context_delete(context); + TCOD_set_errorvf("Could not initialize SDL:\n%s", SDL_GetError()); + return NULL; + } + sdl2_data->sdl_subsystems = SDL_INIT_VIDEO; + context->type = TCOD_RENDERER_SDL2; + if (renderer_flags & SDL_RENDERER_SOFTWARE) { + context->type = TCOD_RENDERER_SDL; + } + context->contextdata = sdl2_data; + context->destructor_ = sdl2_destructor; + context->present_ = sdl2_present; + context->accumulate_ = sdl2_accumulate; + context->get_sdl_window_ = sdl2_get_window; + context->get_sdl_renderer_ = sdl2_get_renderer; + context->pixel_to_tile_ = sdl2_pixel_to_tile; + context->save_screenshot_ = sdl2_save_screenshot; + context->set_tileset = sdl2_set_tileset; + context->cb_recommended_console_size_ = sdl2_recommended_console_size; + + SDL_AddEventWatch(sdl2_handle_event, sdl2_data); + sdl2_data->window = SDL_CreateWindow( + title, + SDL_WINDOWPOS_UNDEFINED, + SDL_WINDOWPOS_UNDEFINED, + pixel_width, + pixel_height, + window_flags); + if (!sdl2_data->window) { + TCOD_set_errorvf("Could not create SDL window:\n%s", SDL_GetError()); + TCOD_context_delete(context); + return NULL; + } + renderer_flags |= SDL_RENDERER_TARGETTEXTURE; + sdl2_data->renderer = SDL_CreateRenderer(sdl2_data->window, -1, renderer_flags); + if (!sdl2_data->renderer) { + TCOD_set_errorvf("Could not create SDL renderer:\n%s", SDL_GetError()); + TCOD_context_delete(context); + return NULL; + } + if (context->set_tileset(context, tileset) < 0) { + TCOD_context_delete(context); + return NULL; + } + return context; +} + diff --git a/tcod_sys/libtcod/src/libtcod/renderer_sdl2.h b/tcod_sys/libtcod/src/libtcod/renderer_sdl2.h new file mode 100644 index 000000000..e60168f6a --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/renderer_sdl2.h @@ -0,0 +1,153 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_RENDERER_SDL2_H_ +#define LIBTCOD_RENDERER_SDL2_H_ + +#include "stdbool.h" + +#include "config.h" +#include "console.h" +#include "context.h" +#include "tileset.h" +#include "error.h" + +struct SDL_Window; +struct SDL_Renderer; +struct SDL_Texture; +/** + An SDL2 tileset atlas. This prepares a tileset for use with SDL2. + \rst + .. versionadded:: 1.16 + \endrst + */ +struct TCOD_TilesetAtlasSDL2 { + /** The renderer used to create this atlas. */ + struct SDL_Renderer* renderer; + /** The atlas texture. */ + struct SDL_Texture* texture; + /** The tileset used to create this atlas. Internal use only. */ + struct TCOD_Tileset* tileset; + /** Internal use only. */ + struct TCOD_TilesetObserver* observer; + /** Internal use only. */ + int texture_columns; +}; +typedef struct TCOD_TilesetAtlasSDL2 TCOD_TilesetAtlasSDL2; +/** + The renderer data for an SDL2 rendering context. + Internal use only. + */ +struct TCOD_RendererSDL2 { + struct SDL_Window* window; + struct SDL_Renderer* renderer; + struct TCOD_TilesetAtlasSDL2* atlas; + struct TCOD_Console* cache_console; + struct SDL_Texture* cache_texture; + uint32_t sdl_subsystems; + // Mouse cursor transform values of the last viewport used. + double last_offset_x; + double last_offset_y; + double last_scale_x; + double last_scale_y; +}; +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +/** + Return a libtcod rendering context using an SDL2 renderer. + */ +TCOD_PUBLIC TCOD_NODISCARD +struct TCOD_Context* TCOD_renderer_init_sdl2( + int width, + int height, + const char* title, + int window_flags, + int renderer_flags, + struct TCOD_Tileset* tileset); +/** + Return a new SDL2 atlas created from a tileset for an SDL2 renderer. + + You may delete the tileset if you no longer have use for it. + + Will return NULL on an error, you can check the error with + `TCOD_get_error`. + */ +TCOD_PUBLIC TCOD_NODISCARD +struct TCOD_TilesetAtlasSDL2* TCOD_sdl2_atlas_new( + struct SDL_Renderer* renderer, + struct TCOD_Tileset* tileset); +/** + Delete an SDL2 tileset atlas. + */ +TCOD_PUBLIC void TCOD_sdl2_atlas_delete(struct TCOD_TilesetAtlasSDL2* atlas); +/** + Render a console onto a managed target texture. + + `atlas` is an SDL2 atlas created with `TCOD_sdl2_atlas_new`. + The renderer used to make this `atlas` must support + `SDL_RENDERER_TARGETTEXTURE`, unless `target` is NULL. + + `console` is a non-NULL pointer to the libtcod console you want to render. + + `cache` can be NULL, or be pointer to a console pointer. + If `*cache` is NULL then a console will be created. + If `*cache` isn't NULL then the console pointed to might be deleted or + recreated, especially if it does not match the size of `console`. + + `target` can be NULL, or be pointer to where you want the output texture + to be placed. + The texture at `*target` may be deleted or recreated. When this function + is successful then the texture at `*target` will be non-NULL and will be + exactly fitted to the size of `console` and the tile size of `atlas`. + + If `target` is NULL when the current render target is used instead, the + drawn area will not be scaled to fit the render target. + + If SDL2 ever provides a `SDL_RENDER_TARGETS_RESET` event then the console + at `*cache` must be deleted and set to NULL, or else the next render will + only partially update the texture at `*target`. + + Returns a negative value on an error, check `TCOD_get_error`. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC TCOD_Error TCOD_sdl2_render_texture( + const struct TCOD_TilesetAtlasSDL2* atlas, + const struct TCOD_Console* console, + struct TCOD_Console** cache, + struct SDL_Texture** target); +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus +#endif // LIBTCOD_RENDERER_SDL2_H_ diff --git a/tcod_sys/libtcod/src/libtcod/sdl2/console_grid.glslf b/tcod_sys/libtcod/src/libtcod/sdl2/console_grid.glslf new file mode 100644 index 000000000..a8c8d5821 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/sdl2/console_grid.glslf @@ -0,0 +1,16 @@ +SHADER_STRINGIFY( +uniform sampler2D t_tileset; + +varying vec2 v_tile; +varying vec4 v_fg; +varying vec4 v_bg; + +void main(void) +{ + vec4 tile_color = texture2D(t_tileset, v_tile); + vec4 fg = v_fg; + fg.rgb *= tile_color.rgb; + + gl_FragColor = mix(v_bg, fg, tile_color.a); +} +) diff --git a/tcod_sys/libtcod/src/libtcod/sdl2/console_grid.glslv b/tcod_sys/libtcod/src/libtcod/sdl2/console_grid.glslv new file mode 100644 index 000000000..d46c1451d --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/sdl2/console_grid.glslv @@ -0,0 +1,22 @@ +SHADER_STRINGIFY( +uniform mat4 mvp_matrix; // Model-view-projection matrix +uniform mat3 tileset_matrix; + +attribute vec2 a_vertex; // Vertex quad array. + +attribute vec2 a_tile; // Tile coordinates. +attribute vec4 a_fg; // Text foreground color. +attribute vec4 a_bg; // Background color. + +varying vec2 v_tile; // Simple quad coordinate. +varying vec4 v_fg; +varying vec4 v_bg; + +void main(void) +{ + gl_Position = mvp_matrix * vec4(a_vertex, 0, 1); + v_tile = (tileset_matrix * vec3(a_tile, 1)).xy; + v_fg = a_fg; + v_bg = a_bg; +} +) diff --git a/tcod_sys/libtcod/src/libtcod/sdl2/event.cpp b/tcod_sys/libtcod/src/libtcod/sdl2/event.cpp new file mode 100644 index 000000000..d85555be8 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/sdl2/event.cpp @@ -0,0 +1,64 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "event.h" + +#include + +#include "../libtcod_int.h" + +#include +namespace tcod { +namespace sdl2 { +TCOD_event_t process_event(const union SDL_Event& ev, + TCOD_key_t& key) noexcept +{ + return TCOD_sys_handle_key_event(&ev, &key); +} +TCOD_event_t process_event(const union SDL_Event& ev, + TCOD_mouse_t& mouse) noexcept +{ + return TCOD_sys_handle_mouse_event(&ev, &mouse); +} +} // namespace sdl2 +} // namespace tcod +TCOD_event_t TCOD_sys_process_key_event( + const union SDL_Event* in, TCOD_key_t* out) +{ + if (!in || !out) { return TCOD_EVENT_NONE; } + return tcod::sdl2::process_event(*in, *out); +} +TCOD_event_t TCOD_sys_process_mouse_event( + const union SDL_Event* in, TCOD_mouse_t* out) +{ + if (!in || !out) { return TCOD_EVENT_NONE; } + return tcod::sdl2::process_event(*in, *out); +} diff --git a/tcod_sys/libtcod/src/libtcod/sdl2/event.h b/tcod_sys/libtcod/src/libtcod/sdl2/event.h new file mode 100644 index 000000000..e3d810e2a --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/sdl2/event.h @@ -0,0 +1,90 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_SDL2_EVENT_H_ +#define LIBTCOD_SDL2_EVENT_H_ + +#include "../console_types.h" +#include "../mouse.h" +#include "../sys.h" + +union SDL_Event; +#ifdef __cplusplus +namespace tcod { +namespace sdl2 { +/** + * Parse an SDL_Event into a key event and return the relevant TCOD_event_t. + * + * Returns TCOD_EVENT_NONE if the event wasn't keyboard related. + * \rst + * .. versionadded:: 1.11 + * \endrst + */ +TCODLIB_API +TCOD_event_t process_event(const union SDL_Event& in, + TCOD_key_t& out) noexcept; +/** + * Parse an SDL_Event into a mouse event and return the relevant TCOD_event_t. + * + * Returns TCOD_EVENT_NONE if the event wasn't mouse related. + * \rst + * .. versionadded:: 1.11 + * \endrst + */ +TCODLIB_API +TCOD_event_t process_event(const union SDL_Event& in, + TCOD_mouse_t& out) noexcept; +} // namespace sdl2 +} // namespace tcod +#endif // __cplusplus +/** + * Parse an SDL_Event into a key event and return the relevant TCOD_event_t. + * + * Returns TCOD_EVENT_NONE if the event wasn't keyboard related. + * \rst + * .. versionadded:: 1.11 + * \endrst + */ +TCODLIB_CAPI +TCOD_event_t TCOD_sys_process_key_event(const union SDL_Event* in, + TCOD_key_t* out); +/** + * Parse an SDL_Event into a mouse event and return the relevant TCOD_event_t. + * + * Returns TCOD_EVENT_NONE if the event wasn't mouse related. + * \rst + * .. versionadded:: 1.11 + * \endrst + */ +TCODLIB_CAPI +TCOD_event_t TCOD_sys_process_mouse_event(const union SDL_Event* in, + TCOD_mouse_t* out); +#endif // LIBTCOD_SDL2_EVENT_H_ diff --git a/tcod_sys/libtcod/src/libtcod/sdl2/gl2_ext_.h b/tcod_sys/libtcod/src/libtcod/sdl2/gl2_ext_.h new file mode 100644 index 000000000..953000881 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/sdl2/gl2_ext_.h @@ -0,0 +1,68 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_SDL2_GL2_EXT_H_ +#define LIBTCOD_SDL2_GL2_EXT_H_ +#include + +#include "../../vendor/glad.h" +namespace tcod { +namespace sdl2 { +class opengl_error : public std::runtime_error { + public: + explicit opengl_error(const std::string& what_arg) + : runtime_error(what_arg) + {}; +}; +inline void gl_check() { +#ifndef NDEBUG + switch(glGetError()) { + case GL_NO_ERROR: + return; + case GL_INVALID_ENUM: + throw opengl_error("GL_INVALID_ENUM"); + case GL_INVALID_VALUE: + throw opengl_error("GL_INVALID_VALUE"); + case GL_INVALID_OPERATION: + throw opengl_error("GL_INVALID_OPERATION"); + //case GL_INVALID_FRAMEBUFFER_OPERATION: + // throw opengl_error("GL_INVALID_FRAMEBUFFER_OPERATION"); + case GL_OUT_OF_MEMORY: + throw opengl_error("GL_OUT_OF_MEMORY"); + default: + throw opengl_error("Unknown OpenGL error."); + } +#endif // NDEBUG +} +inline void gl_debug() { gl_check(); } +} // namespace sdl2 +} // namespace tcod +#endif // LIBTCOD_SDL2_GL2_EXT_H_ diff --git a/tcod_sys/libtcod/src/sys.cpp b/tcod_sys/libtcod/src/libtcod/sys.cpp similarity index 67% rename from tcod_sys/libtcod/src/sys.cpp rename to tcod_sys/libtcod/src/libtcod/sys.cpp index f89e60690..114b2fc7a 100644 --- a/tcod_sys/libtcod/src/sys.cpp +++ b/tcod_sys/libtcod/src/libtcod/sys.cpp @@ -1,242 +1,245 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include - -#ifdef TCOD_OSUTIL_SUPPORT -void TCODSystem::sleepMilli(uint32_t milliseconds) { - TCOD_sys_sleep_milli(milliseconds); -} - -uint32_t TCODSystem::getElapsedMilli() { - return TCOD_sys_elapsed_milli(); -} - -float TCODSystem::getElapsedSeconds() { - return TCOD_sys_elapsed_seconds(); -} -#endif - -#ifndef TCOD_BARE -void TCODSystem::saveScreenshot(const char *filename) { - TCOD_sys_save_screenshot(filename); -} - -void TCODSystem::forceFullscreenResolution(int width, int height) { - TCOD_sys_force_fullscreen_resolution(width, height); -} - -void TCODSystem::setRenderer(TCOD_renderer_t renderer) { - TCOD_sys_set_renderer(renderer); -} -TCOD_event_t TCODSystem::waitForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush) { - return TCOD_sys_wait_for_event(eventMask,key,mouse,flush); -} - -TCOD_event_t TCODSystem::checkForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse) { - return TCOD_sys_check_for_event(eventMask,key,mouse); -} - -TCOD_renderer_t TCODSystem::getRenderer() { - return TCOD_sys_get_renderer(); -} -#endif - -#ifdef TCOD_OSUTIL_SUPPORT -void TCODSystem::setFps(int val) { - TCOD_sys_set_fps(val); -} - -int TCODSystem::getFps() { - return TCOD_sys_get_fps(); -} - -float TCODSystem::getLastFrameLength() { - return TCOD_sys_get_last_frame_length(); -} -#endif - -#ifndef TCOD_BARE -void TCODSystem::getCurrentResolution(int *w, int *h) { - TCOD_sys_get_current_resolution(w, h); -} - -void TCODSystem::getFullscreenOffsets(int *offx, int *offy) { - TCOD_sys_get_fullscreen_offsets(offx, offy); -} - -void TCODSystem::updateChar(int asciiCode, int fontx, int fonty,const TCODImage *img,int x,int y) { - TCOD_sys_update_char(asciiCode,fontx,fonty,img->data,x,y); -} - -void TCODSystem::getCharSize(int *w, int *h) { - TCOD_sys_get_char_size(w, h); -} -#endif - -// filesystem stuff -bool TCODSystem::createDirectory(const char *path) { - return TCOD_sys_create_directory(path) != 0; -} - -bool TCODSystem::deleteFile(const char *path) { - return TCOD_sys_delete_file(path) != 0; -} - -bool TCODSystem::deleteDirectory(const char *path) { - return TCOD_sys_delete_directory(path) != 0; -} - -bool TCODSystem::isDirectory(const char *path) { - return TCOD_sys_is_directory(path) != 0; -} - -TCOD_list_t TCODSystem::getDirectoryContent(const char *path, const char *pattern) { - return TCOD_sys_get_directory_content(path,pattern); -} - -bool TCODSystem::fileExists(const char * filename, ...) { - FILE * in; - bool ret = false; - char f[1024]; - va_list ap; - va_start(ap,filename); - vsprintf(f,filename,ap); - va_end(ap); - in = fopen(f,"rb"); - if (in != NULL) { - ret = true; - fclose(in); - } - return ret; -} - -bool TCODSystem::readFile(const char *filename, unsigned char **buf, size_t *size) { - return TCOD_sys_read_file(filename,buf,size) != 0; -} - -bool TCODSystem::writeFile(const char *filename, unsigned char *buf, uint32_t size) { - return TCOD_sys_write_file(filename,buf,size) != 0; -} - -#ifndef TCOD_BARE -// clipboard stuff -bool TCODSystem::setClipboard(const char *value) { - return TCOD_sys_clipboard_set(value) != 0; -} - -char *TCODSystem::getClipboard() { - return TCOD_sys_clipboard_get(); -} -#endif - -// thread stuff -int TCODSystem::getNumCores() { - return TCOD_sys_get_num_cores(); -} - -TCOD_thread_t TCODSystem::newThread(int (*func)(void *), void *data) { - return TCOD_thread_new(func,data); -} - -void TCODSystem::deleteThread(TCOD_thread_t th) { - TCOD_thread_delete(th); -} - -void TCODSystem::waitThread(TCOD_thread_t th) { - TCOD_thread_wait(th); -} - -// mutex -TCOD_mutex_t TCODSystem::newMutex() { - return TCOD_mutex_new(); -} - -void TCODSystem::mutexIn(TCOD_mutex_t mut) { - TCOD_mutex_in(mut); -} - -void TCODSystem::mutexOut(TCOD_mutex_t mut) { - TCOD_mutex_out(mut); -} - -void TCODSystem::deleteMutex(TCOD_mutex_t mut) { - TCOD_mutex_delete(mut); -} - -// semaphore -TCOD_semaphore_t TCODSystem::newSemaphore(int initVal) { - return TCOD_semaphore_new(initVal); -} - -void TCODSystem::lockSemaphore(TCOD_semaphore_t sem) { - TCOD_semaphore_lock(sem); -} - -void TCODSystem::unlockSemaphore(TCOD_semaphore_t sem) { - TCOD_semaphore_unlock(sem); -} - -void TCODSystem::deleteSemaphore( TCOD_semaphore_t sem) { - TCOD_semaphore_delete(sem); -} - -// condition -TCOD_cond_t TCODSystem::newCondition() { - return TCOD_condition_new(); -} - -void TCODSystem::signalCondition(TCOD_cond_t cond) { - TCOD_condition_signal(cond); -} - -void TCODSystem::broadcastCondition(TCOD_cond_t cond) { - TCOD_condition_broadcast(cond); -} - -void TCODSystem::waitCondition(TCOD_cond_t cond, TCOD_mutex_t mut) { - TCOD_condition_wait(cond, mut); -} - -void TCODSystem::deleteCondition( TCOD_cond_t cond) { - TCOD_condition_delete(cond); -} - -// custom post-renderer -static ITCODSDLRenderer *post_renderer=NULL; -extern "C" void TCOD_CRenderer(void *sdl_surface) { - if ( post_renderer ) post_renderer->render(sdl_surface); -} -void TCODSystem::registerSDLRenderer(ITCODSDLRenderer *renderer) { - ::post_renderer = renderer; -#ifndef TCOD_BARE - TCOD_sys_register_SDL_renderer(TCOD_CRenderer); -#endif -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "sys.hpp" + +#include +#include + +#include "error.h" +#include "libtcod_int.h" +#include "console_init.h" + +void TCODSystem::sleepMilli(uint32_t milliseconds) { + TCOD_sys_sleep_milli(milliseconds); +} + +uint32_t TCODSystem::getElapsedMilli() { + return TCOD_sys_elapsed_milli(); +} + +float TCODSystem::getElapsedSeconds() { + return TCOD_sys_elapsed_seconds(); +} + +void TCODSystem::saveScreenshot(const char *filename) { + TCOD_sys_save_screenshot(filename); +} + +void TCODSystem::forceFullscreenResolution(int width, int height) { + TCOD_sys_force_fullscreen_resolution(width, height); +} + +void TCODSystem::setRenderer(TCOD_renderer_t renderer) { + if (TCOD_ctx.engine && renderer == TCOD_sys_get_renderer()) { return; } + auto err = TCOD_console_init_root( + TCOD_ctx.root->w, + TCOD_ctx.root->h, + TCOD_ctx.window_title, + TCOD_console_is_fullscreen(), + renderer); + tcod::check_throw_error(err); +} +TCOD_event_t TCODSystem::waitForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush) { + return TCOD_sys_wait_for_event(eventMask,key,mouse,flush); +} + +TCOD_event_t TCODSystem::checkForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse) { + return TCOD_sys_check_for_event(eventMask,key,mouse); +} + +TCOD_renderer_t TCODSystem::getRenderer() { + return TCOD_sys_get_renderer(); +} + +void TCODSystem::setFps(int val) { + TCOD_sys_set_fps(val); +} + +int TCODSystem::getFps() { + return TCOD_sys_get_fps(); +} + +float TCODSystem::getLastFrameLength() { + return TCOD_sys_get_last_frame_length(); +} + +void TCODSystem::getCurrentResolution(int *w, int *h) { + TCOD_sys_get_current_resolution(w, h); +} + +void TCODSystem::getFullscreenOffsets(int *offx, int *offy) { + TCOD_sys_get_fullscreen_offsets(offx, offy); +} + +void TCODSystem::updateChar(int asciiCode, int fontx, int fonty,const TCODImage *img,int x,int y) { + TCOD_sys_update_char(asciiCode,fontx,fonty,img->data,x,y); +} + +void TCODSystem::getCharSize(int *w, int *h) { + TCOD_sys_get_char_size(w, h); +} + +// filesystem stuff +bool TCODSystem::createDirectory(const char *path) { + return TCOD_sys_create_directory(path) != 0; +} + +bool TCODSystem::deleteFile(const char *path) { + return TCOD_sys_delete_file(path) != 0; +} + +bool TCODSystem::deleteDirectory(const char *path) { + return TCOD_sys_delete_directory(path) != 0; +} + +bool TCODSystem::isDirectory(const char *path) { + return TCOD_sys_is_directory(path) != 0; +} + +TCOD_list_t TCODSystem::getDirectoryContent(const char *path, const char *pattern) { + return TCOD_sys_get_directory_content(path,pattern); +} + +bool TCODSystem::fileExists(const char * filename, ...) { + FILE * in; + bool ret = false; + char f[1024]; + va_list ap; + va_start(ap,filename); + vsprintf(f,filename,ap); + va_end(ap); + in = fopen(f,"rb"); + if (in != NULL) { + ret = true; + fclose(in); + } + return ret; +} + +bool TCODSystem::readFile(const char *filename, unsigned char **buf, size_t *size) { + return TCOD_sys_read_file(filename,buf,size) != 0; +} + +bool TCODSystem::writeFile(const char *filename, unsigned char *buf, uint32_t size) { + return TCOD_sys_write_file(filename,buf,size) != 0; +} + +// clipboard stuff +bool TCODSystem::setClipboard(const char *value) { + return TCOD_sys_clipboard_set(value) != 0; +} + +char *TCODSystem::getClipboard() { + return TCOD_sys_clipboard_get(); +} + +// thread stuff +int TCODSystem::getNumCores() { + return TCOD_sys_get_num_cores(); +} + +TCOD_thread_t TCODSystem::newThread(int (*func)(void *), void *data) { + return TCOD_thread_new(func,data); +} + +void TCODSystem::deleteThread(TCOD_thread_t th) { + TCOD_thread_delete(th); +} + +void TCODSystem::waitThread(TCOD_thread_t th) { + TCOD_thread_wait(th); +} + +// mutex +TCOD_mutex_t TCODSystem::newMutex() { + return TCOD_mutex_new(); +} + +void TCODSystem::mutexIn(TCOD_mutex_t mut) { + TCOD_mutex_in(mut); +} + +void TCODSystem::mutexOut(TCOD_mutex_t mut) { + TCOD_mutex_out(mut); +} + +void TCODSystem::deleteMutex(TCOD_mutex_t mut) { + TCOD_mutex_delete(mut); +} + +// semaphore +TCOD_semaphore_t TCODSystem::newSemaphore(int initVal) { + return TCOD_semaphore_new(initVal); +} + +void TCODSystem::lockSemaphore(TCOD_semaphore_t sem) { + TCOD_semaphore_lock(sem); +} + +void TCODSystem::unlockSemaphore(TCOD_semaphore_t sem) { + TCOD_semaphore_unlock(sem); +} + +void TCODSystem::deleteSemaphore( TCOD_semaphore_t sem) { + TCOD_semaphore_delete(sem); +} + +// condition +TCOD_cond_t TCODSystem::newCondition() { + return TCOD_condition_new(); +} + +void TCODSystem::signalCondition(TCOD_cond_t cond) { + TCOD_condition_signal(cond); +} + +void TCODSystem::broadcastCondition(TCOD_cond_t cond) { + TCOD_condition_broadcast(cond); +} + +void TCODSystem::waitCondition(TCOD_cond_t cond, TCOD_mutex_t mut) { + TCOD_condition_wait(cond, mut); +} + +void TCODSystem::deleteCondition( TCOD_cond_t cond) { + TCOD_condition_delete(cond); +} + +// custom post-renderer +static ITCODSDLRenderer *post_renderer=NULL; +extern "C" void TCOD_CRenderer(struct SDL_Surface* sdl_surface) { + if (post_renderer) { post_renderer->render(sdl_surface); } +} +void TCODSystem::registerSDLRenderer(ITCODSDLRenderer *renderer) { + ::post_renderer = renderer; + TCOD_sys_register_SDL_renderer(TCOD_CRenderer); +} diff --git a/tcod_sys/libtcod/include/sys.h b/tcod_sys/libtcod/src/libtcod/sys.h similarity index 57% rename from tcod_sys/libtcod/include/sys.h rename to tcod_sys/libtcod/src/libtcod/sys.h index d6169b19d..5403c64d3 100644 --- a/tcod_sys/libtcod/include/sys.h +++ b/tcod_sys/libtcod/src/libtcod/sys.h @@ -1,147 +1,180 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_SYS_H -#define _TCOD_SYS_H - -#include "libtcod_portability.h" -#include "list.h" -#include "image.h" -#include "mouse_types.h" - -#ifdef __cplusplus -extern "C" { -#endif -TCODLIB_API void TCOD_sys_startup(void); -TCODLIB_API void TCOD_sys_shutdown(void); - -#ifdef TCOD_OSUTIL_SUPPORT -TCODLIB_API uint32_t TCOD_sys_elapsed_milli(void); -TCODLIB_API float TCOD_sys_elapsed_seconds(void); -TCODLIB_API void TCOD_sys_sleep_milli(uint32_t val); -TCODLIB_API void TCOD_sys_set_fps(int val); -TCODLIB_API int TCOD_sys_get_fps(void); -TCODLIB_API float TCOD_sys_get_last_frame_length(void); -#endif - -#ifndef TCOD_BARE -TCODLIB_API void TCOD_sys_save_screenshot(const char *filename); -TCODLIB_API void TCOD_sys_force_fullscreen_resolution(int width, int height); -TCODLIB_API void TCOD_sys_set_renderer(TCOD_renderer_t renderer); -TCODLIB_API TCOD_renderer_t TCOD_sys_get_renderer(void); -TCODLIB_API void TCOD_sys_get_current_resolution(int *w, int *h); -TCODLIB_API void TCOD_sys_get_fullscreen_offsets(int *offx, int *offy); -TCODLIB_API void TCOD_sys_get_char_size(int *w, int *h); -#endif - -#ifdef TCOD_IMAGE_SUPPORT -TCODLIB_API void TCOD_sys_update_char(int asciiCode, int fontx, int fonty, TCOD_image_t img, int x, int y); -#endif - -#ifndef TCOD_BARE -TCODLIB_API void *TCOD_sys_get_SDL_window(void); -TCODLIB_API void *TCOD_sys_get_SDL_renderer(void); -#endif - -#ifndef TCOD_BARE -typedef enum { - TCOD_EVENT_NONE=0, - TCOD_EVENT_KEY_PRESS=1, - TCOD_EVENT_KEY_RELEASE=2, - TCOD_EVENT_KEY=TCOD_EVENT_KEY_PRESS|TCOD_EVENT_KEY_RELEASE, - TCOD_EVENT_MOUSE_MOVE=4, - TCOD_EVENT_MOUSE_PRESS=8, - TCOD_EVENT_MOUSE_RELEASE=16, - TCOD_EVENT_MOUSE=TCOD_EVENT_MOUSE_MOVE|TCOD_EVENT_MOUSE_PRESS|TCOD_EVENT_MOUSE_RELEASE, -/* #ifdef TCOD_TOUCH_INPUT */ - TCOD_EVENT_FINGER_MOVE=32, - TCOD_EVENT_FINGER_PRESS=64, - TCOD_EVENT_FINGER_RELEASE=128, - TCOD_EVENT_FINGER=TCOD_EVENT_FINGER_MOVE|TCOD_EVENT_FINGER_PRESS|TCOD_EVENT_FINGER_RELEASE, -/* #endif */ - TCOD_EVENT_ANY=TCOD_EVENT_KEY|TCOD_EVENT_MOUSE|TCOD_EVENT_FINGER, -} TCOD_event_t; -TCODLIB_API TCOD_event_t TCOD_sys_wait_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush); -TCODLIB_API TCOD_event_t TCOD_sys_check_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse); -#endif - -/* filesystem stuff */ -TCODLIB_API bool TCOD_sys_create_directory(const char *path); -TCODLIB_API bool TCOD_sys_delete_file(const char *path); -TCODLIB_API bool TCOD_sys_delete_directory(const char *path); -TCODLIB_API bool TCOD_sys_is_directory(const char *path); -TCODLIB_API TCOD_list_t TCOD_sys_get_directory_content(const char *path, const char *pattern); -TCODLIB_API bool TCOD_sys_file_exists(const char * filename, ...); -TCODLIB_API bool TCOD_sys_read_file(const char *filename, unsigned char **buf, size_t *size); -TCODLIB_API bool TCOD_sys_write_file(const char *filename, unsigned char *buf, uint32_t size); - -#ifndef TCOD_BARE -/* clipboard */ -TCODLIB_API bool TCOD_sys_clipboard_set(const char *value); -TCODLIB_API char *TCOD_sys_clipboard_get(void); -#endif - -/* thread stuff */ -typedef void *TCOD_thread_t; -typedef void *TCOD_semaphore_t; -typedef void *TCOD_mutex_t; -typedef void *TCOD_cond_t; -/* threads */ -TCODLIB_API TCOD_thread_t TCOD_thread_new(int (*func)(void *), void *data); -TCODLIB_API void TCOD_thread_delete(TCOD_thread_t th); -TCODLIB_API int TCOD_sys_get_num_cores(void); -TCODLIB_API void TCOD_thread_wait(TCOD_thread_t th); -/* mutex */ -TCODLIB_API TCOD_mutex_t TCOD_mutex_new(void); -TCODLIB_API void TCOD_mutex_in(TCOD_mutex_t mut); -TCODLIB_API void TCOD_mutex_out(TCOD_mutex_t mut); -TCODLIB_API void TCOD_mutex_delete(TCOD_mutex_t mut); -/* semaphore */ -TCODLIB_API TCOD_semaphore_t TCOD_semaphore_new(int initVal); -TCODLIB_API void TCOD_semaphore_lock(TCOD_semaphore_t sem); -TCODLIB_API void TCOD_semaphore_unlock(TCOD_semaphore_t sem); -TCODLIB_API void TCOD_semaphore_delete( TCOD_semaphore_t sem); -/* condition */ -TCODLIB_API TCOD_cond_t TCOD_condition_new(void); -TCODLIB_API void TCOD_condition_signal(TCOD_cond_t sem); -TCODLIB_API void TCOD_condition_broadcast(TCOD_cond_t sem); -TCODLIB_API void TCOD_condition_wait(TCOD_cond_t sem, TCOD_mutex_t mut); -TCODLIB_API void TCOD_condition_delete( TCOD_cond_t sem); -/* dynamic library */ -typedef void *TCOD_library_t; -TCODLIB_API TCOD_library_t TCOD_load_library(const char *path); -TCODLIB_API void * TCOD_get_function_address(TCOD_library_t library, const char *function_name); -TCODLIB_API void TCOD_close_library(TCOD_library_t); -/* SDL renderer callback */ -#ifndef TCOD_BARE -typedef void (*SDL_renderer_t) (void *sdl_renderer); -TCODLIB_API void TCOD_sys_register_SDL_renderer(SDL_renderer_t renderer); -#endif -#ifdef __cplusplus -} -#endif -#endif +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_SYS_H +#define _TCOD_SYS_H + +#include "portability.h" +#include "list.h" +#include "image.h" +#include "mouse_types.h" + +#ifdef __cplusplus +extern "C" { +#endif +TCODLIB_API void TCOD_sys_startup(void); +TCODLIB_API void TCOD_sys_shutdown(void); + +TCODLIB_API uint32_t TCOD_sys_elapsed_milli(void); +TCODLIB_API float TCOD_sys_elapsed_seconds(void); +TCODLIB_API void TCOD_sys_sleep_milli(uint32_t val); +TCODLIB_API void TCOD_sys_set_fps(int val); +TCODLIB_API int TCOD_sys_get_fps(void); +TCODLIB_API float TCOD_sys_get_last_frame_length(void); + +TCODLIB_API void TCOD_sys_save_screenshot(const char *filename); +TCODLIB_API void TCOD_sys_force_fullscreen_resolution(int width, int height); +TCODLIB_API TCOD_NODISCARD int TCOD_sys_set_renderer(TCOD_renderer_t renderer); +TCODLIB_API TCOD_renderer_t TCOD_sys_get_renderer(void); +TCODLIB_API void TCOD_sys_get_current_resolution(int *w, int *h); +TCODLIB_API void TCOD_sys_get_fullscreen_offsets(int *offx, int *offy); +TCODLIB_API void TCOD_sys_get_char_size(int *w, int *h); + +/** + * Upload a tile to the active tileset. + * + * `asciiCode` is the Unicode codepoint for this tile. + * + * `fontx` and `fonty` are the tile-coordinates on the active tilemap. + * + * `img` is the tile to upload. + * + * `x` and `y` are the upper-left pixel-coordinates of the tile on the `img`. + */ +TCODLIB_API void TCOD_sys_update_char(int asciiCode, int fontx, int fonty, TCOD_image_t img, int x, int y); + +TCODLIB_API struct SDL_Window* TCOD_sys_get_SDL_window(void); +TCODLIB_API struct SDL_Renderer* TCOD_sys_get_SDL_renderer(void); + +typedef enum { + TCOD_EVENT_NONE=0, + TCOD_EVENT_KEY_PRESS=1, + TCOD_EVENT_KEY_RELEASE=2, + TCOD_EVENT_KEY=TCOD_EVENT_KEY_PRESS|TCOD_EVENT_KEY_RELEASE, + TCOD_EVENT_MOUSE_MOVE=4, + TCOD_EVENT_MOUSE_PRESS=8, + TCOD_EVENT_MOUSE_RELEASE=16, + TCOD_EVENT_MOUSE=TCOD_EVENT_MOUSE_MOVE|TCOD_EVENT_MOUSE_PRESS|TCOD_EVENT_MOUSE_RELEASE, +/* #ifdef TCOD_TOUCH_INPUT */ + TCOD_EVENT_FINGER_MOVE=32, + TCOD_EVENT_FINGER_PRESS=64, + TCOD_EVENT_FINGER_RELEASE=128, + TCOD_EVENT_FINGER=TCOD_EVENT_FINGER_MOVE|TCOD_EVENT_FINGER_PRESS|TCOD_EVENT_FINGER_RELEASE, +/* #endif */ + TCOD_EVENT_ANY=TCOD_EVENT_KEY|TCOD_EVENT_MOUSE|TCOD_EVENT_FINGER, +} TCOD_event_t; +TCODLIB_API TCOD_event_t TCOD_sys_wait_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush); +TCODLIB_API TCOD_event_t TCOD_sys_check_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse); + +/* filesystem stuff */ +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API bool TCOD_sys_create_directory(const char *path); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API bool TCOD_sys_delete_file(const char *path); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API bool TCOD_sys_delete_directory(const char *path); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API bool TCOD_sys_is_directory(const char *path); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API TCOD_list_t TCOD_sys_get_directory_content(const char *path, const char *pattern); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API bool TCOD_sys_file_exists(const char * filename, ...); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API bool TCOD_sys_read_file(const char *filename, unsigned char **buf, size_t *size); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API bool TCOD_sys_write_file(const char *filename, unsigned char *buf, uint32_t size); + +/* clipboard */ +TCOD_DEPRECATED("Use the SDL2 API to handle the clipboard.") +TCODLIB_API bool TCOD_sys_clipboard_set(const char *value); +TCOD_DEPRECATED("Use the SDL2 API to handle the clipboard.") +TCODLIB_API char *TCOD_sys_clipboard_get(void); + +/* thread stuff */ +typedef void *TCOD_thread_t; +typedef void *TCOD_semaphore_t; +typedef void *TCOD_mutex_t; +typedef void *TCOD_cond_t; +/* threads */ +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API TCOD_thread_t TCOD_thread_new(int (*func)(void *), void *data); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_thread_delete(TCOD_thread_t th); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API int TCOD_sys_get_num_cores(void); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_thread_wait(TCOD_thread_t th); +/* mutex */ +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API TCOD_mutex_t TCOD_mutex_new(void); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_mutex_in(TCOD_mutex_t mut); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_mutex_out(TCOD_mutex_t mut); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_mutex_delete(TCOD_mutex_t mut); +/* semaphore */ +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API TCOD_semaphore_t TCOD_semaphore_new(int initVal); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_semaphore_lock(TCOD_semaphore_t sem); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_semaphore_unlock(TCOD_semaphore_t sem); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_semaphore_delete( TCOD_semaphore_t sem); +/* condition */ +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API TCOD_cond_t TCOD_condition_new(void); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_condition_signal(TCOD_cond_t sem); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_condition_broadcast(TCOD_cond_t sem); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_condition_wait(TCOD_cond_t sem, TCOD_mutex_t mut); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_condition_delete( TCOD_cond_t sem); +/* dynamic library */ +typedef void *TCOD_library_t; +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API TCOD_library_t TCOD_load_library(const char *path); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void * TCOD_get_function_address(TCOD_library_t library, const char *function_name); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_close_library(TCOD_library_t); +/* SDL renderer callback */ +struct SDL_Surface; +typedef void (*SDL_renderer_t) (struct SDL_Surface* sdl_renderer); +TCOD_DEPRECATED_NOMESSAGE +TCODLIB_API void TCOD_sys_register_SDL_renderer(SDL_renderer_t renderer); +#ifdef __cplusplus +} +#endif +#endif diff --git a/tcod_sys/libtcod/include/sys.hpp b/tcod_sys/libtcod/src/libtcod/sys.hpp similarity index 90% rename from tcod_sys/libtcod/include/sys.hpp rename to tcod_sys/libtcod/src/libtcod/sys.hpp index c344ef47d..385fe82c5 100644 --- a/tcod_sys/libtcod/include/sys.hpp +++ b/tcod_sys/libtcod/src/libtcod/sys.hpp @@ -1,561 +1,583 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _TCOD_SYS_HPP -#define _TCOD_SYS_HPP - -#include "image.hpp" -#include "mouse.hpp" -#include "sys.h" -/** - - @PageName system - @PageCategory Core - @PageTitle System layer - @PageDesc This toolkit contains some system specific miscellaneous utilities. Use them is you want your code to be easily portable. - */ - -class TCODLIB_API ITCODSDLRenderer { -public : - virtual ~ITCODSDLRenderer() {} - virtual void render(void *sdlSurface) = 0; -}; - -class TCODLIB_API TCODSystem { -public : - /** - @PageName system_time - @PageFather system - @PageTitle High precision time functions - @PageDesc These are functions specifically aimed at real time game development. - @FuncTitle Limit the frames per second - @FuncDesc The setFps function allows you to limit the number of frames per second. - If a frame is rendered faster than expected, the TCOD_console_flush function will wait so that the frame rate never exceed this value. - You can call this function during your game initialization. - You can dynamically change the frame rate. Just call this function once again. - You should always limit the frame rate, except during benchmarks, else your game will use 100% of the CPU power - @Cpp static void TCODSystem::setFps(int val) - @C void TCOD_sys_set_fps(int val) - @Py sys_set_fps(val) - @C# static void TCODSystem::setFps(int val) - @Lua tcod.system.setFps(val) - @Param val Maximum number of frames per second. 0 means unlimited frame rate. - */ - static void setFps(int val); - - /** - @PageName system_time - @FuncTitle Get the number of frames rendered during the last second - @FuncDesc The value returned by this function is updated every second. - @Cpp static int TCODSystem::getFps() - @C int TCOD_sys_get_fps() - @Py sys_get_fps() - @C# static int TCODSystem::getFps() - @Lua tcod.system.getFps() - */ - static int getFps(); - - /** - @PageName system_time - @FuncTitle Get the duration of the last frame - @FuncDesc This function returns the length in seconds of the last rendered frame. - You can use this value to update every time dependent object in the world. - @Cpp static float TCODSystem::getLastFrameLength() - @C float TCOD_sys_get_last_frame_length() - @Py sys_get_last_frame_length() - @C# static float TCODSystem::getLastFrameLength() - @Lua tcod.system.getLastFrameLength() - @CppEx - // moving an objet at 5 console cells per second - float x=0,y=0; // object coordinates - x += 5 * TCODSystem::getLastFrameLength(); - TCODConsole::root->putChar((int)(x),(int)(y),'X'); - @CEx - float x=0,y=0; - x += 5 * TCOD_sys_get_last_frame_length(); - TCOD_console_put_char(NULL,(int)(x),(int)(y),'X'); - @PyEx - x=0.0 - y=0.0 - x += 5 * libtcod.sys_get_last_frame_length() - libtcod.console_put_char(0,int(x),int(y),'X') - @LuaEx - -- moving an objet at 5 console cells per second - x=0 - y=0 -- object coordinates - x = x + 5 * tcod.system.getLastFrameLength() - libtcod.TCODConsole_root:putChar(x,y,'X') - */ - static float getLastFrameLength(); - -#ifdef TCOD_OSUTIL_SUPPORT - /** - @PageName system_time - @FuncTitle Pause the program - @FuncDesc Use this function to stop the program execution for a specified number of milliseconds. - @Cpp static void TCODSystem::sleepMilli(uint32_t val) - @C void TCOD_sys_sleep_milli(uint32_t val) - @Py sys_sleep_milli(val) - @C# static void TCODSystem::sleepMilli(uint val) - @Lua tcod.system.sleepMilli(val) - @Param val number of milliseconds before the function returns - */ - static void sleepMilli(uint32_t val); - - /** - @PageName system_time - @FuncTitle Get global timer in milliseconds - @FuncDesc This function returns the number of milliseconds since the program has started. - @Cpp static uint32_t TCODSystem::getElapsedMilli() - @C uint32_t TCOD_sys_elapsed_milli() - @Py sys_elapsed_milli() - @C# static uint TCODSystem::getElapsedMilli() - @Lua tcod.system.getElapsedMilli() - */ - static uint32_t getElapsedMilli(); - - /** - @PageName system_time - @FuncTitle Get global timer in seconds - @FuncDesc This function returns the number of seconds since the program has started. - @Cpp static float TCODSystem::getElapsedSeconds() - @C float TCOD_sys_elapsed_seconds() - @Py sys_elapsed_seconds() - @C# static float TCODSystem::getElapsedSeconds() - @Lua tcod.system.getElapsedSeconds() - */ - static float getElapsedSeconds(); -#endif - -#ifdef TCOD_CONSOLE_SUPPORT - /** - @PageName console_blocking_input - @FuncTitle Waiting for any event (mouse or keyboard) - @FuncDesc This function waits for an event from the user. The eventMask shows what events we're waiting for. - The return value indicate what event was actually triggered. Values in key and mouse structures are updated accordingly. - If flush is false, the function waits only if there are no pending events, else it returns the first event in the buffer. - @Cpp typedef enum { - TCOD_EVENT_NONE=0, - TCOD_EVENT_KEY_PRESS=1, - TCOD_EVENT_KEY_RELEASE=2, - TCOD_EVENT_KEY=TCOD_EVENT_KEY_PRESS|TCOD_EVENT_KEY_RELEASE, - TCOD_EVENT_MOUSE_MOVE=4, - TCOD_EVENT_MOUSE_PRESS=8, - TCOD_EVENT_MOUSE_RELEASE=16, - TCOD_EVENT_MOUSE=TCOD_EVENT_MOUSE_MOVE|TCOD_EVENT_MOUSE_PRESS|TCOD_EVENT_MOUSE_RELEASE, - TCOD_EVENT_ANY=TCOD_EVENT_KEY|TCOD_EVENT_MOUSE, - } TCOD_event_t; - static TCOD_event_t TCODSystem::waitForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush) - @C TCOD_event_t TCOD_sys_wait_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush) - @Py sys_wait_for_event(eventMask,key,mouse,flush) - @Param eventMask event types to wait for (other types are discarded) - @Param key updated in case of a key event. Can be null if eventMask contains no key event type - @Param mouse updated in case of a mouse event. Can be null if eventMask contains no mouse event type - @Param flush if true, all pending events are flushed from the buffer. Else, return the first available event - @CppEx - TCOD_key_t key; - TCOD_mouse_t mouse; - TCOD_event_t ev = TCODSystem::waitForEvent(TCOD_EVENT_ANY,&key,&mouse,true); - if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... } - @CEx - TCOD_key_t key; - TCOD_mouse_t mouse; - TCOD_event_t ev = TCOD_sys_wait_for_event(TCOD_EVENT_ANY,&key,&mouse,true); - if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... } - */ - static TCOD_event_t waitForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush); - - /** - @PageName console_non_blocking_input - @FuncTitle Checking for any event (mouse or keyboard) - @FuncDesc This function checks if an event from the user is in the buffer. The eventMask shows what events we're waiting for. - The return value indicate what event was actually found. Values in key and mouse structures are updated accordingly. - @Cpp typedef enum { - TCOD_EVENT_KEY_PRESS=1, - TCOD_EVENT_KEY_RELEASE=2, - TCOD_EVENT_KEY=TCOD_EVENT_KEY_PRESS|TCOD_EVENT_KEY_RELEASE, - TCOD_EVENT_MOUSE_MOVE=4, - TCOD_EVENT_MOUSE_PRESS=8, - TCOD_EVENT_MOUSE_RELEASE=16, - TCOD_EVENT_MOUSE=TCOD_EVENT_MOUSE_MOVE|TCOD_EVENT_MOUSE_PRESS|TCOD_EVENT_MOUSE_RELEASE, - TCOD_EVENT_ANY=TCOD_EVENT_KEY|TCOD_EVENT_MOUSE, - } TCOD_event_t; - static TCOD_event_t TCODSystem::checkForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse) - @C TCOD_event_t TCOD_sys_check_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse) - @Py sys_check_for_event(eventMask,key,mouse) - @Param eventMask event types to wait for (other types are discarded) - @Param key updated in case of a key event. Can be null if eventMask contains no key event type - @Param mouse updated in case of a mouse event. Can be null if eventMask contains no mouse event type - @CppEx - TCOD_key_t key; - TCOD_mouse_t mouse; - TCOD_event_t ev = TCODSystem::checkForEvent(TCOD_EVENT_ANY,&key,&mouse); - if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... } - @CEx - TCOD_key_t key; - TCOD_mouse_t mouse; - TCOD_event_t ev = TCOD_sys_check_for_event(TCOD_EVENT_ANY,&key,&mouse); - if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... } - */ - static TCOD_event_t checkForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse); -#endif - -#ifndef TCOD_BARE - /** - @PageName system_screenshots - @PageFather system - @PageTitle Easy screenshots - @FuncDesc This function allows you to save the current game screen in a png file, or possibly a bmp file if you provide a filename ending with .bmp. - @Cpp static void TCODSystem::saveScreenshot(const char *filename) - @C void TCOD_sys_save_screenshot(const char *filename) - @Py sys_save_screenshot(filename) - @C# static void TCODSystem::saveScreenshot(string filename); - @Lua tcod.system.saveScreenshot(filename) - @Param filename Name of the file. If NULL, a filename is automatically generated with the form "./screenshotNNN.png", NNN being the first free number (if a file named screenshot000.png already exist, screenshot001.png will be used, and so on...). - */ - static void saveScreenshot(const char *filename); -#endif - - /** - @PageName system_filesystem - @PageFather system - @PageTitle Filesystem utilities - @PageDesc Those are a few function that cannot be easily implemented in a portable way in C/C++. They have no Python wrapper since Python provides its own builtin functions. All those functions return false if an error occurred. - @FuncTitle Create a directory - @Cpp static bool TCODSystem::createDirectory(const char *path) - @C bool TCOD_sys_create_directory(const char *path) - @Param path Directory path. The immediate father directory (/..) must exist and be writable. - */ - static bool createDirectory(const char *path); - - /** - @PageName system_filesystem - @FuncTitle Delete an empty directory - @Cpp static bool TCODSystem::deleteDirectory(const char *path) - @C bool TCOD_sys_delete_directory(const char *path) - @Param path directory path. This directory must exist, be writable and empty - */ - static bool deleteDirectory(const char *path); - - /** - @PageName system_filesystem - @FuncTitle Delete a file - @Cpp static bool TCODSystem::deleteFile(const char *path) - @C bool TCOD_sys_delete_file(const char *path) - @Param path File path. This file must exist and be writable. - */ - static bool deleteFile(const char *path); - - /** - @PageName system_filesystem - @FuncTitle Check if a path is a directory - @Cpp static bool TCODSystem::isDirectory(const char *path) - @C bool TCOD_sys_is_directory(const char *path) - @Param path a path to check - */ - static bool isDirectory(const char *path); - - /** - @PageName system_filesystem - @FuncTitle List files in a directory - @FuncDesc To get the list of entries in a directory (including sub-directories, except . and ..). - The returned list is allocated by the function and must be deleted by you. All the const char * inside must be also freed with TCODList::clearAndDelete. - @Cpp static TCODList TCODSystem::getDirectoryContent(const char *path, const char *pattern) - @C TCOD_list_t TCOD_sys_get_directory_content(const char *path) - @Param path a directory - @Param pattern If NULL or empty, returns all directory entries. Else returns only entries matching the pattern. The pattern is NOT a regular expression. It can only handle one '*' wildcard. Examples : *.png, saveGame*, font*.png - */ - static TCOD_list_t getDirectoryContent(const char *path, const char *pattern); - - /** - @PageName system_filesystem - @FuncTitle Check if a given file exists - @FuncDesc In order to check whether a given file exists in the filesystem. Useful for detecting errors caused by missing files. - @Cpp static bool TCODSystem::fileExists(const char *filename, ...) - @C bool TCOD_sys_file_exists(const char * filename, ...) - @Param filename the file name, using printf-like formatting - @Param ... optional arguments for filename formatting - @CppEx - if (!TCODSystem::fileExists("myfile.%s","txt")) { - fprintf(stderr,"no such file!"); - } - @CEx - if (!TCOD_sys_file_exists("myfile.%s","txt")) { - fprintf(stderr,"no such file!"); - } - */ - static bool fileExists(const char * filename, ...); - /** - @PageName system_filesystem - @FuncTitle Read the content of a file into memory - @FuncDesc This is a portable function to read the content of a file from disk or from the application apk (android). - buf must be freed with free(buf). - @Cpp static bool TCODSystem::readFile(const char *filename, unsigned char **buf, uint32_t *size) - @C bool TCOD_sys_read_file(const char *filename, unsigned char **buf, uint32_t *size) - @Param filename the file name - @Param buf a buffer to be allocated and filled with the file content - @Param size the size of the allocated buffer. - @CppEx - unsigned char *buf; - uint32_t size; - if (TCODSystem::readFile("myfile.dat",&buf,&size)) { - // do something with buf - free(buf); - } - @CEx - if (TCOD_sys_read_file("myfile.dat",&buf,&size)) { - // do something with buf - free(buf); - } - */ - static bool readFile(const char *filename, unsigned char **buf, size_t *size); - /** - @PageName system_filesystem - @FuncTitle Write the content of a memory buffer to a file - @FuncDesc This is a portable function to write some data to a file. - @Cpp static bool TCODSystem::writeFile(const char *filename, unsigned char *buf, uint32_t size) - @C bool TCOD_sys_write_file(const char *filename, unsigned char *buf, uint32_t size) - @Param filename the file name - @Param buf a buffer containing the data to write - @Param size the number of bytes to write. - @CppEx - TCODSystem::writeFile("myfile.dat",buf,size)); - @CEx - TCOD_sys_write_file("myfile.dat",buf,size)); - */ - static bool writeFile(const char *filename, unsigned char *buf, uint32_t size); - /** - @PageName system_sdlcbk - @PageFather system - @PageTitle Draw custom graphics on top of the root console - @PageDesc You can register a callback that will be called after the libtcod rendering phase, but before the screen buffer is swapped. This callback receives the screen SDL_Surface reference. - This makes it possible to use any SDL drawing functions (including openGL) on top of the libtcod console. - @FuncTitle Render custom graphics - @FuncDesc To disable the custom renderer, call the same method with a NULL parameter. - Note that to keep libtcod from requiring the SDL headers, the callback parameter is a void pointer. You have to include SDL headers and cast it to SDL_Surface in your code. - @Cpp - class TCODLIB_API ITCODSDLRenderer { - public : - virtual void render(void *sdlSurface) = 0; - }; - static void TCODSystem::registerSDLRenderer(ITCODSDLRenderer *callback); - @C - typedef void (*SDL_renderer_t) (void *sdl_surface); - void TCOD_sys_register_SDL_renderer(SDL_renderer_t callback) - @Py - def renderer ( sdl_surface ) : ... - TCOD_sys_register_SDL_renderer( callback ) - @Param callback The renderer to call before swapping the screen buffer. If NULL, custom rendering is disabled - @CppEx - class MyRenderer : public ITCODSDLRenderer { - public : - void render(void *sdlSurface) { - SDL_Surface *s = (SDL_Surface *)sdlSurface; - ... draw something on s - } - }; - TCODSystem::registerSDLRenderer(new MyRenderer()); - @CEx - void my_renderer( void *sdl_surface ) { - SDL_Surface *s = (SDL_Surface *)sdl_surface; - ... draw something on s - } - TCOD_sys_register_SDL_renderer(my_renderer); - @Py - def my_renderer(sdl_surface) : - ... draw something on sdl_surface using pygame - libtcod.sys_register_SDL_renderer(my_renderer) - */ - static void registerSDLRenderer(ITCODSDLRenderer *renderer); - - /** - @PageName system_sdlcbk - @FuncTitle Managing screen redraw - @FuncDesc libtcod is not aware of the part of the screen your SDL renderer has updated. If no change occurred in the console, it won't redraw them except if you tell him to do so with this function - @Cpp void TCODConsole::setDirty(int x, int y, int w, int h) - @C void TCOD_console_set_dirty(int x, int y, int w, int h) - @Py TCOD_console_set_dirty(x, y, w, h) - @Param x,y,w,h Part of the root console you want to redraw even if nothing has changed in the console back/fore/char. - */ - -#ifndef TCOD_BARE - /** - @PageName system_misc - @PageFather system - @PageTitle Miscellaneous utilities - @FuncTitle Using a custom resolution for the fullscreen mode - @FuncDesc This function allows you to force the use of a specific resolution in fullscreen mode. - The default resolution depends on the root console size and the font character size. - @Cpp static void TCODSystem::forceFullscreenResolution(int width, int height) - @C void TCOD_sys_force_fullscreen_resolution(int width, int height) - @Py sys_force_fullscreen_resolution(width, height) - @C# static void TCODSystem::forceFullscreenResolution(int width, int height); - @Lua tcod.system.forceFullscreenResolution(width,height) - @Param width,height Resolution to use when switching to fullscreen. - Will use the smallest available resolution so that : - resolution width >= width and resolution width >= root console width * font char width - resolution width >= height and resolution height >= root console height * font char height - @CppEx - TCODSystem::forceFullscreenResolution(800,600); // use 800x600 in fullscreen instead of 640x400 - TCODConsole::initRoot(80,50,"",true); // 80x50 console with 8x8 char => 640x400 default resolution - @CEx - TCOD_sys_force_fullscreen_resolution(800,600); - TCOD_console_init_root(80,50,"",true); - @PyEx - libtcod.sys_force_fullscreen_resolution(800,600) - libtcod.console_init_root(80,50,"",True) - @LuaEx - tcod.system.forceFullscreenResolution(800,600) -- use 800x600 in fullscreen instead of 640x400 - tcod.console.initRoot(80,50,"",true) -- 80x50 console with 8x8 char => 640x400 default resolution - */ - static void forceFullscreenResolution(int width, int height); - - /** - @PageName system_misc - @FuncTitle Get current resolution - @FuncDesc You can get the current screen resolution with getCurrentResolution. You can use it for example to get the desktop resolution before initializing the root console. - @Cpp static void TCODSystem::getCurrentResolution(int *width, int *height) - @C void TCOD_sys_get_current_resolution(int *width, int *height) - @Py sys_get_current_resolution() # returns w,h - @C# static void TCODSystem::getCurrentResolution(out int w, out int h); - @Param width,height contains current resolution when the function returns - */ - static void getCurrentResolution(int *w, int *h); - /** - @PageName system_misc - @FuncTitle Get fullscreen offset - @FuncDesc If the fullscreen resolution does not matches the console size in pixels, black borders are added. This function returns the position in pixels of the console top left corner in the screen. - @Cpp static void TCODSystem::getFullscreenOffsets(int *offx, int *offy) - @C void TCOD_sys_get_fullscreen_offsets(int *offx, int *offy) - @C# static void TCODSystem::getFullscreenOffsets(out int offx, out int offy); - @Param offx,offy contains the position of the console on the screen when using fullscreen mode. - */ - static void getFullscreenOffsets(int *offx, int *offy); - - /** - @PageName system_misc - @FuncTitle Get the font size - @FuncDesc You can get the size of the characters in the font - @Cpp static void TCODSystem::getCharSize(int *width, int *height) - @C void TCOD_sys_get_char_size(int *width, int *height) - @Py sys_get_char_size() # returns w,h - @C# static void TCODSystem::getCharSize(out int w, out int h); - @Param width,height contains a character size when the function returns - */ - static void getCharSize(int *w, int *h); - - /** - @PageName system_misc - @FuncTitle Dynamically updating the font bitmap - @FuncDesc You can dynamically change the bitmap of a character in the font. All cells using this ascii code will be updated at next flush call. - @Cpp static void TCODSystem::updateChar(int asciiCode, int fontx, int fonty,const TCODImage *img,int x,int y) - @C void TCOD_sys_update_char(int asciiCode, int fontx, int fonty, TCOD_image_t img, int x, int y) - @Py sys_update_char(asciiCode,fontx,fonty,img,x,y) - @Param asciiCode ascii code corresponding to the character to update - @Param fontx,fonty coordinate of the character in the bitmap font (in characters, not pixels) - @Param img image containing the new character bitmap - @Param x,y position in pixels of the top-left corner of the character in the image - */ - static void updateChar(int asciiCode, int fontx, int fonty,const TCODImage *img,int x,int y); -#endif - -#ifndef TCOD_BARE - /** - @PageName system_misc - @FuncTitle Dynamically change libtcod's internal renderer - @FuncDesc As of 1.5.1, libtcod contains 3 different renderers : - * SDL : historic libtcod renderer. Should work and be pretty fast everywhere - * OpenGL : requires OpenGL compatible video card. Might be much faster or much slower than SDL, depending on the drivers - * GLSDL : requires OpenGL 1.4 compatible video card with GL_ARB_shader_objects extension. Blazing fast if you have the proper hardware and drivers. - This function switches the current renderer dynamically. - @Cpp static void TCODSystem::setRenderer(TCOD_renderer_t renderer) - @C void TCOD_sys_set_renderer(TCOD_renderer_t renderer) - @Py sys_set_renderer(renderer) - @C# static void TCODSystem::setRenderer(TCODRendererType renderer); - @Param renderer Either TCOD_RENDERER_GLSL, TCOD_RENDERER_OPENGL or TCOD_RENDERER_SDL - */ - static void setRenderer(TCOD_renderer_t renderer); - - /** - @PageName system_misc - @FuncTitle Get the current internal renderer - @Cpp static TCOD_renderer_t TCODSystem::getRenderer() - @C TCOD_renderer_t TCOD_sys_get_renderer() - @Py sys_get_renderer() - @C# static TCODRendererType TCODSystem::getRenderer(); - */ - static TCOD_renderer_t getRenderer(); - - /** - @PageName system_clipboard - @PageTitle Clipboard integration - @PageDesc With these functions, you can copy data in your operating system's clipboard from the game or retrieve data from the clipboard. - @PageFather system - @FuncTitle Set current clipboard contents - @FuncDesc Takes UTF-8 text and copies it into the system clipboard. On Linux, because an application cannot access the system clipboard unless a window is open, if no window is open the call will do nothing. - @Cpp static bool TCODSystem::setClipboard(const char *value) - @C bool TCOD_sys_clipboard_set(const char *value) - @Py sys_clipboard_set(value) - @Param value UTF-8 text to copy into the clipboard - */ - static bool setClipboard(const char *value); - - /** - @PageName system_clipboard - @FuncTitle Get current clipboard contents - @FuncDesc Returns the UTF-8 text currently in the system clipboard. On Linux, because an application cannot access the system clipboard unless a window is open, if no window is open an empty string will be returned. For C and C++, note that the pointer is borrowed, and libtcod will take care of freeing the memory. - @Cpp static char *TCODSystem::getClipboard() - @C char *TCOD_sys_clipboard_get() - @Py sys_clipboard_get() # Returns UTF-8 string - */ - static char *getClipboard(); -#endif - - // thread stuff - static int getNumCores(); - static TCOD_thread_t newThread(int (*func)(void *), void *data); - static void deleteThread(TCOD_thread_t th); - static void waitThread(TCOD_thread_t th); - // mutex - static TCOD_mutex_t newMutex(); - static void mutexIn(TCOD_mutex_t mut); - static void mutexOut(TCOD_mutex_t mut); - static void deleteMutex(TCOD_mutex_t mut); - // semaphore - static TCOD_semaphore_t newSemaphore(int initVal); - static void lockSemaphore(TCOD_semaphore_t sem); - static void unlockSemaphore(TCOD_semaphore_t sem); - static void deleteSemaphore( TCOD_semaphore_t sem); - // condition - static TCOD_cond_t newCondition(); - static void signalCondition(TCOD_cond_t sem); - static void broadcastCondition(TCOD_cond_t sem); - static void waitCondition(TCOD_cond_t sem, TCOD_mutex_t mut); - static void deleteCondition( TCOD_cond_t sem); -}; - -#endif +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_SYS_HPP +#define _TCOD_SYS_HPP + +#include "image.hpp" +#include "mouse.hpp" +#include "sys.h" +/** + + @PageName system + @PageCategory Core + @PageTitle System layer + @PageDesc This toolkit contains some system specific miscellaneous utilities. Use them is you want your code to be easily portable. + */ + +class TCODLIB_API ITCODSDLRenderer { +public : + virtual ~ITCODSDLRenderer() {} + virtual void render(void *sdlSurface) = 0; +}; + +class TCODLIB_API TCODSystem { +public : + /** + @PageName system_time + @PageFather system + @PageTitle High precision time functions + @PageDesc These are functions specifically aimed at real time game development. + @FuncTitle Limit the frames per second + @FuncDesc The setFps function allows you to limit the number of frames per second. + If a frame is rendered faster than expected, the TCOD_console_flush function will wait so that the frame rate never exceed this value. + You can call this function during your game initialization. + You can dynamically change the frame rate. Just call this function once again. + You should always limit the frame rate, except during benchmarks, else your game will use 100% of the CPU power + @Cpp static void TCODSystem::setFps(int val) + @C void TCOD_sys_set_fps(int val) + @Py sys_set_fps(val) + @C# static void TCODSystem::setFps(int val) + @Lua tcod.system.setFps(val) + @Param val Maximum number of frames per second. 0 means unlimited frame rate. + */ + static void setFps(int val); + + /** + @PageName system_time + @FuncTitle Get the number of frames rendered during the last second + @FuncDesc The value returned by this function is updated every second. + @Cpp static int TCODSystem::getFps() + @C int TCOD_sys_get_fps() + @Py sys_get_fps() + @C# static int TCODSystem::getFps() + @Lua tcod.system.getFps() + */ + static int getFps(); + + /** + @PageName system_time + @FuncTitle Get the duration of the last frame + @FuncDesc This function returns the length in seconds of the last rendered frame. + You can use this value to update every time dependent object in the world. + @Cpp static float TCODSystem::getLastFrameLength() + @C float TCOD_sys_get_last_frame_length() + @Py sys_get_last_frame_length() + @C# static float TCODSystem::getLastFrameLength() + @Lua tcod.system.getLastFrameLength() + @CppEx + // moving an objet at 5 console cells per second + float x=0,y=0; // object coordinates + x += 5 * TCODSystem::getLastFrameLength(); + TCODConsole::root->putChar((int)(x),(int)(y),'X'); + @CEx + float x=0,y=0; + x += 5 * TCOD_sys_get_last_frame_length(); + TCOD_console_put_char(NULL,(int)(x),(int)(y),'X'); + @PyEx + x=0.0 + y=0.0 + x += 5 * libtcod.sys_get_last_frame_length() + libtcod.console_put_char(0,int(x),int(y),'X') + @LuaEx + -- moving an objet at 5 console cells per second + x=0 + y=0 -- object coordinates + x = x + 5 * tcod.system.getLastFrameLength() + libtcod.TCODConsole_root:putChar(x,y,'X') + */ + static float getLastFrameLength(); + + /** + @PageName system_time + @FuncTitle Pause the program + @FuncDesc Use this function to stop the program execution for a specified number of milliseconds. + @Cpp static void TCODSystem::sleepMilli(uint32_t val) + @C void TCOD_sys_sleep_milli(uint32_t val) + @Py sys_sleep_milli(val) + @C# static void TCODSystem::sleepMilli(uint val) + @Lua tcod.system.sleepMilli(val) + @Param val number of milliseconds before the function returns + */ + static void sleepMilli(uint32_t val); + + /** + @PageName system_time + @FuncTitle Get global timer in milliseconds + @FuncDesc This function returns the number of milliseconds since the program has started. + @Cpp static uint32_t TCODSystem::getElapsedMilli() + @C uint32_t TCOD_sys_elapsed_milli() + @Py sys_elapsed_milli() + @C# static uint TCODSystem::getElapsedMilli() + @Lua tcod.system.getElapsedMilli() + */ + static uint32_t getElapsedMilli(); + + /** + @PageName system_time + @FuncTitle Get global timer in seconds + @FuncDesc This function returns the number of seconds since the program has started. + @Cpp static float TCODSystem::getElapsedSeconds() + @C float TCOD_sys_elapsed_seconds() + @Py sys_elapsed_seconds() + @C# static float TCODSystem::getElapsedSeconds() + @Lua tcod.system.getElapsedSeconds() + */ + static float getElapsedSeconds(); + + /** + @PageName console_blocking_input + @FuncTitle Waiting for any event (mouse or keyboard) + @FuncDesc This function waits for an event from the user. The eventMask shows what events we're waiting for. + The return value indicate what event was actually triggered. Values in key and mouse structures are updated accordingly. + If flush is false, the function waits only if there are no pending events, else it returns the first event in the buffer. + @Cpp typedef enum { + TCOD_EVENT_NONE=0, + TCOD_EVENT_KEY_PRESS=1, + TCOD_EVENT_KEY_RELEASE=2, + TCOD_EVENT_KEY=TCOD_EVENT_KEY_PRESS|TCOD_EVENT_KEY_RELEASE, + TCOD_EVENT_MOUSE_MOVE=4, + TCOD_EVENT_MOUSE_PRESS=8, + TCOD_EVENT_MOUSE_RELEASE=16, + TCOD_EVENT_MOUSE=TCOD_EVENT_MOUSE_MOVE|TCOD_EVENT_MOUSE_PRESS|TCOD_EVENT_MOUSE_RELEASE, + TCOD_EVENT_ANY=TCOD_EVENT_KEY|TCOD_EVENT_MOUSE, + } TCOD_event_t; + static TCOD_event_t TCODSystem::waitForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush) + @C TCOD_event_t TCOD_sys_wait_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush) + @Py sys_wait_for_event(eventMask,key,mouse,flush) + @Param eventMask event types to wait for (other types are discarded) + @Param key updated in case of a key event. Can be null if eventMask contains no key event type + @Param mouse updated in case of a mouse event. Can be null if eventMask contains no mouse event type + @Param flush if true, all pending events are flushed from the buffer. Else, return the first available event + @CppEx + TCOD_key_t key; + TCOD_mouse_t mouse; + TCOD_event_t ev = TCODSystem::waitForEvent(TCOD_EVENT_ANY,&key,&mouse,true); + if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... } + @CEx + TCOD_key_t key; + TCOD_mouse_t mouse; + TCOD_event_t ev = TCOD_sys_wait_for_event(TCOD_EVENT_ANY,&key,&mouse,true); + if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... } + */ + static TCOD_event_t waitForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush); + + /** + @PageName console_non_blocking_input + @FuncTitle Checking for any event (mouse or keyboard) + @FuncDesc This function checks if an event from the user is in the buffer. The eventMask shows what events we're waiting for. + The return value indicate what event was actually found. Values in key and mouse structures are updated accordingly. + @Cpp typedef enum { + TCOD_EVENT_KEY_PRESS=1, + TCOD_EVENT_KEY_RELEASE=2, + TCOD_EVENT_KEY=TCOD_EVENT_KEY_PRESS|TCOD_EVENT_KEY_RELEASE, + TCOD_EVENT_MOUSE_MOVE=4, + TCOD_EVENT_MOUSE_PRESS=8, + TCOD_EVENT_MOUSE_RELEASE=16, + TCOD_EVENT_MOUSE=TCOD_EVENT_MOUSE_MOVE|TCOD_EVENT_MOUSE_PRESS|TCOD_EVENT_MOUSE_RELEASE, + TCOD_EVENT_ANY=TCOD_EVENT_KEY|TCOD_EVENT_MOUSE, + } TCOD_event_t; + static TCOD_event_t TCODSystem::checkForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse) + @C TCOD_event_t TCOD_sys_check_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse) + @Py sys_check_for_event(eventMask,key,mouse) + @Param eventMask event types to wait for (other types are discarded) + @Param key updated in case of a key event. Can be null if eventMask contains no key event type + @Param mouse updated in case of a mouse event. Can be null if eventMask contains no mouse event type + @CppEx + TCOD_key_t key; + TCOD_mouse_t mouse; + TCOD_event_t ev = TCODSystem::checkForEvent(TCOD_EVENT_ANY,&key,&mouse); + if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... } + @CEx + TCOD_key_t key; + TCOD_mouse_t mouse; + TCOD_event_t ev = TCOD_sys_check_for_event(TCOD_EVENT_ANY,&key,&mouse); + if ( ev == TCOD_EVENT_KEY_PRESS && key.c == 'i' ) { ... open inventory ... } + */ + static TCOD_event_t checkForEvent(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse); + + /** + @PageName system_screenshots + @PageFather system + @PageTitle Easy screenshots + @FuncDesc This function allows you to save the current game screen in a png file, or possibly a bmp file if you provide a filename ending with .bmp. + @Cpp static void TCODSystem::saveScreenshot(const char *filename) + @C void TCOD_sys_save_screenshot(const char *filename) + @Py sys_save_screenshot(filename) + @C# static void TCODSystem::saveScreenshot(string filename); + @Lua tcod.system.saveScreenshot(filename) + @Param filename Name of the file. If NULL, a filename is automatically generated with the form "./screenshotNNN.png", NNN being the first free number (if a file named screenshot000.png already exist, screenshot001.png will be used, and so on...). + */ + static void saveScreenshot(const char *filename); + + /** + @PageName system_filesystem + @PageFather system + @PageTitle Filesystem utilities + @PageDesc Those are a few function that cannot be easily implemented in a portable way in C/C++. They have no Python wrapper since Python provides its own builtin functions. All those functions return false if an error occurred. + @FuncTitle Create a directory + @Cpp static bool TCODSystem::createDirectory(const char *path) + @C bool TCOD_sys_create_directory(const char *path) + @Param path Directory path. The immediate father directory (/..) must exist and be writable. + */ + TCOD_DEPRECATED_NOMESSAGE + static bool createDirectory(const char *path); + + /** + @PageName system_filesystem + @FuncTitle Delete an empty directory + @Cpp static bool TCODSystem::deleteDirectory(const char *path) + @C bool TCOD_sys_delete_directory(const char *path) + @Param path directory path. This directory must exist, be writable and empty + */ + TCOD_DEPRECATED_NOMESSAGE + static bool deleteDirectory(const char *path); + + /** + @PageName system_filesystem + @FuncTitle Delete a file + @Cpp static bool TCODSystem::deleteFile(const char *path) + @C bool TCOD_sys_delete_file(const char *path) + @Param path File path. This file must exist and be writable. + */ + TCOD_DEPRECATED_NOMESSAGE + static bool deleteFile(const char *path); + + /** + @PageName system_filesystem + @FuncTitle Check if a path is a directory + @Cpp static bool TCODSystem::isDirectory(const char *path) + @C bool TCOD_sys_is_directory(const char *path) + @Param path a path to check + */ + TCOD_DEPRECATED_NOMESSAGE + static bool isDirectory(const char *path); + + /** + @PageName system_filesystem + @FuncTitle List files in a directory + @FuncDesc To get the list of entries in a directory (including sub-directories, except . and ..). + The returned list is allocated by the function and must be deleted by you. All the const char * inside must be also freed with TCODList::clearAndDelete. + @Cpp static TCODList TCODSystem::getDirectoryContent(const char *path, const char *pattern) + @C TCOD_list_t TCOD_sys_get_directory_content(const char *path) + @Param path a directory + @Param pattern If NULL or empty, returns all directory entries. Else returns only entries matching the pattern. The pattern is NOT a regular expression. It can only handle one '*' wildcard. Examples : *.png, saveGame*, font*.png + */ + TCOD_DEPRECATED_NOMESSAGE + static TCOD_list_t getDirectoryContent(const char *path, const char *pattern); + + /** + @PageName system_filesystem + @FuncTitle Check if a given file exists + @FuncDesc In order to check whether a given file exists in the filesystem. Useful for detecting errors caused by missing files. + @Cpp static bool TCODSystem::fileExists(const char *filename, ...) + @C bool TCOD_sys_file_exists(const char * filename, ...) + @Param filename the file name, using printf-like formatting + @Param ... optional arguments for filename formatting + @CppEx + if (!TCODSystem::fileExists("myfile.%s","txt")) { + fprintf(stderr,"no such file!"); + } + @CEx + if (!TCOD_sys_file_exists("myfile.%s","txt")) { + fprintf(stderr,"no such file!"); + } + */ + TCOD_DEPRECATED_NOMESSAGE + static bool fileExists(const char * filename, ...); + /** + @PageName system_filesystem + @FuncTitle Read the content of a file into memory + @FuncDesc This is a portable function to read the content of a file from disk or from the application apk (android). + buf must be freed with free(buf). + @Cpp static bool TCODSystem::readFile(const char *filename, unsigned char **buf, uint32_t *size) + @C bool TCOD_sys_read_file(const char *filename, unsigned char **buf, uint32_t *size) + @Param filename the file name + @Param buf a buffer to be allocated and filled with the file content + @Param size the size of the allocated buffer. + @CppEx + unsigned char *buf; + uint32_t size; + if (TCODSystem::readFile("myfile.dat",&buf,&size)) { + // do something with buf + free(buf); + } + @CEx + if (TCOD_sys_read_file("myfile.dat",&buf,&size)) { + // do something with buf + free(buf); + } + */ + TCOD_DEPRECATED_NOMESSAGE + static bool readFile(const char *filename, unsigned char **buf, size_t *size); + /** + @PageName system_filesystem + @FuncTitle Write the content of a memory buffer to a file + @FuncDesc This is a portable function to write some data to a file. + @Cpp static bool TCODSystem::writeFile(const char *filename, unsigned char *buf, uint32_t size) + @C bool TCOD_sys_write_file(const char *filename, unsigned char *buf, uint32_t size) + @Param filename the file name + @Param buf a buffer containing the data to write + @Param size the number of bytes to write. + @CppEx + TCODSystem::writeFile("myfile.dat",buf,size)); + @CEx + TCOD_sys_write_file("myfile.dat",buf,size)); + */ + TCOD_DEPRECATED_NOMESSAGE + static bool writeFile(const char *filename, unsigned char *buf, uint32_t size); + /** + @PageName system_sdlcbk + @PageFather system + @PageTitle Draw custom graphics on top of the root console + @PageDesc You can register a callback that will be called after the libtcod rendering phase, but before the screen buffer is swapped. This callback receives the screen SDL_Surface reference. + This makes it possible to use any SDL drawing functions (including openGL) on top of the libtcod console. + @FuncTitle Render custom graphics + @FuncDesc To disable the custom renderer, call the same method with a NULL parameter. + Note that to keep libtcod from requiring the SDL headers, the callback parameter is a void pointer. You have to include SDL headers and cast it to SDL_Surface in your code. + @Cpp + class TCODLIB_API ITCODSDLRenderer { + public : + virtual void render(void *sdlSurface) = 0; + }; + static void TCODSystem::registerSDLRenderer(ITCODSDLRenderer *callback); + @C + typedef void (*SDL_renderer_t) (void *sdl_surface); + void TCOD_sys_register_SDL_renderer(SDL_renderer_t callback) + @Py + def renderer ( sdl_surface ) : ... + TCOD_sys_register_SDL_renderer( callback ) + @Param callback The renderer to call before swapping the screen buffer. If NULL, custom rendering is disabled + @CppEx + class MyRenderer : public ITCODSDLRenderer { + public : + void render(void *sdlSurface) { + SDL_Surface *s = (SDL_Surface *)sdlSurface; + ... draw something on s + } + }; + TCODSystem::registerSDLRenderer(new MyRenderer()); + @CEx + void my_renderer( void *sdl_surface ) { + SDL_Surface *s = (SDL_Surface *)sdl_surface; + ... draw something on s + } + TCOD_sys_register_SDL_renderer(my_renderer); + @Py + def my_renderer(sdl_surface) : + ... draw something on sdl_surface using pygame + libtcod.sys_register_SDL_renderer(my_renderer) + */ + TCOD_DEPRECATED_NOMESSAGE + static void registerSDLRenderer(ITCODSDLRenderer *renderer); + + /** + @PageName system_sdlcbk + @FuncTitle Managing screen redraw + @FuncDesc libtcod is not aware of the part of the screen your SDL renderer has updated. If no change occurred in the console, it won't redraw them except if you tell him to do so with this function + @Cpp void TCODConsole::setDirty(int x, int y, int w, int h) + @C void TCOD_console_set_dirty(int x, int y, int w, int h) + @Py TCOD_console_set_dirty(x, y, w, h) + @Param x,y,w,h Part of the root console you want to redraw even if nothing has changed in the console back/fore/char. + */ + + /** + @PageName system_misc + @PageFather system + @PageTitle Miscellaneous utilities + @FuncTitle Using a custom resolution for the fullscreen mode + @FuncDesc This function allows you to force the use of a specific resolution in fullscreen mode. + The default resolution depends on the root console size and the font character size. + @Cpp static void TCODSystem::forceFullscreenResolution(int width, int height) + @C void TCOD_sys_force_fullscreen_resolution(int width, int height) + @Py sys_force_fullscreen_resolution(width, height) + @C# static void TCODSystem::forceFullscreenResolution(int width, int height); + @Lua tcod.system.forceFullscreenResolution(width,height) + @Param width,height Resolution to use when switching to fullscreen. + Will use the smallest available resolution so that : + resolution width >= width and resolution width >= root console width * font char width + resolution width >= height and resolution height >= root console height * font char height + @CppEx + TCODSystem::forceFullscreenResolution(800,600); // use 800x600 in fullscreen instead of 640x400 + TCODConsole::initRoot(80,50,"",true); // 80x50 console with 8x8 char => 640x400 default resolution + @CEx + TCOD_sys_force_fullscreen_resolution(800,600); + TCOD_console_init_root(80,50,"",true); + @PyEx + libtcod.sys_force_fullscreen_resolution(800,600) + libtcod.console_init_root(80,50,"",True) + @LuaEx + tcod.system.forceFullscreenResolution(800,600) -- use 800x600 in fullscreen instead of 640x400 + tcod.console.initRoot(80,50,"",true) -- 80x50 console with 8x8 char => 640x400 default resolution + */ + static void forceFullscreenResolution(int width, int height); + + /** + @PageName system_misc + @FuncTitle Get current resolution + @FuncDesc You can get the current screen resolution with getCurrentResolution. You can use it for example to get the desktop resolution before initializing the root console. + @Cpp static void TCODSystem::getCurrentResolution(int *width, int *height) + @C void TCOD_sys_get_current_resolution(int *width, int *height) + @Py sys_get_current_resolution() # returns w,h + @C# static void TCODSystem::getCurrentResolution(out int w, out int h); + @Param width,height contains current resolution when the function returns + */ + static void getCurrentResolution(int *w, int *h); + /** + @PageName system_misc + @FuncTitle Get fullscreen offset + @FuncDesc If the fullscreen resolution does not matches the console size in pixels, black borders are added. This function returns the position in pixels of the console top left corner in the screen. + @Cpp static void TCODSystem::getFullscreenOffsets(int *offx, int *offy) + @C void TCOD_sys_get_fullscreen_offsets(int *offx, int *offy) + @C# static void TCODSystem::getFullscreenOffsets(out int offx, out int offy); + @Param offx,offy contains the position of the console on the screen when using fullscreen mode. + */ + static void getFullscreenOffsets(int *offx, int *offy); + + /** + @PageName system_misc + @FuncTitle Get the font size + @FuncDesc You can get the size of the characters in the font + @Cpp static void TCODSystem::getCharSize(int *width, int *height) + @C void TCOD_sys_get_char_size(int *width, int *height) + @Py sys_get_char_size() # returns w,h + @C# static void TCODSystem::getCharSize(out int w, out int h); + @Param width,height contains a character size when the function returns + */ + static void getCharSize(int *w, int *h); + + /** + @PageName system_misc + @FuncTitle Dynamically updating the font bitmap + @FuncDesc You can dynamically change the bitmap of a character in the font. All cells using this ascii code will be updated at next flush call. + @Cpp static void TCODSystem::updateChar(int asciiCode, int fontx, int fonty,const TCODImage *img,int x,int y) + @C void TCOD_sys_update_char(int asciiCode, int fontx, int fonty, TCOD_image_t img, int x, int y) + @Py sys_update_char(asciiCode,fontx,fonty,img,x,y) + @Param asciiCode ascii code corresponding to the character to update + @Param fontx,fonty coordinate of the character in the bitmap font (in characters, not pixels) + @Param img image containing the new character bitmap + @Param x,y position in pixels of the top-left corner of the character in the image + */ + static void updateChar(int asciiCode, int fontx, int fonty,const TCODImage *img,int x,int y); + + /** + @PageName system_misc + @FuncTitle Dynamically change libtcod's internal renderer + @FuncDesc As of 1.5.1, libtcod contains 3 different renderers : + * SDL : historic libtcod renderer. Should work and be pretty fast everywhere + * OpenGL : requires OpenGL compatible video card. Might be much faster or much slower than SDL, depending on the drivers + * GLSDL : requires OpenGL 1.4 compatible video card with GL_ARB_shader_objects extension. Blazing fast if you have the proper hardware and drivers. + This function switches the current renderer dynamically. + @Cpp static void TCODSystem::setRenderer(TCOD_renderer_t renderer) + @C void TCOD_sys_set_renderer(TCOD_renderer_t renderer) + @Py sys_set_renderer(renderer) + @C# static void TCODSystem::setRenderer(TCODRendererType renderer); + @Param renderer Either TCOD_RENDERER_GLSL, TCOD_RENDERER_OPENGL or TCOD_RENDERER_SDL + */ + static void setRenderer(TCOD_renderer_t renderer); + + /** + @PageName system_misc + @FuncTitle Get the current internal renderer + @Cpp static TCOD_renderer_t TCODSystem::getRenderer() + @C TCOD_renderer_t TCOD_sys_get_renderer() + @Py sys_get_renderer() + @C# static TCODRendererType TCODSystem::getRenderer(); + */ + static TCOD_renderer_t getRenderer(); + + /** + @PageName system_clipboard + @PageTitle Clipboard integration + @PageDesc With these functions, you can copy data in your operating system's clipboard from the game or retrieve data from the clipboard. + @PageFather system + @FuncTitle Set current clipboard contents + @FuncDesc Takes UTF-8 text and copies it into the system clipboard. On Linux, because an application cannot access the system clipboard unless a window is open, if no window is open the call will do nothing. + @Cpp static bool TCODSystem::setClipboard(const char *value) + @C bool TCOD_sys_clipboard_set(const char *value) + @Py sys_clipboard_set(value) + @Param value UTF-8 text to copy into the clipboard + */ + TCOD_DEPRECATED_NOMESSAGE + static bool setClipboard(const char *value); + + /** + @PageName system_clipboard + @FuncTitle Get current clipboard contents + @FuncDesc Returns the UTF-8 text currently in the system clipboard. On Linux, because an application cannot access the system clipboard unless a window is open, if no window is open an empty string will be returned. For C and C++, note that the pointer is borrowed, and libtcod will take care of freeing the memory. + @Cpp static char *TCODSystem::getClipboard() + @C char *TCOD_sys_clipboard_get() + @Py sys_clipboard_get() # Returns UTF-8 string + */ + TCOD_DEPRECATED_NOMESSAGE + static char *getClipboard(); + + // thread stuff + TCOD_DEPRECATED_NOMESSAGE + static int getNumCores(); + TCOD_DEPRECATED_NOMESSAGE + static TCOD_thread_t newThread(int (*func)(void *), void *data); + TCOD_DEPRECATED_NOMESSAGE + static void deleteThread(TCOD_thread_t th); + TCOD_DEPRECATED_NOMESSAGE + static void waitThread(TCOD_thread_t th); + // mutex + TCOD_DEPRECATED_NOMESSAGE + static TCOD_mutex_t newMutex(); + TCOD_DEPRECATED_NOMESSAGE + static void mutexIn(TCOD_mutex_t mut); + TCOD_DEPRECATED_NOMESSAGE + static void mutexOut(TCOD_mutex_t mut); + TCOD_DEPRECATED_NOMESSAGE + static void deleteMutex(TCOD_mutex_t mut); + // semaphore + TCOD_DEPRECATED_NOMESSAGE + static TCOD_semaphore_t newSemaphore(int initVal); + TCOD_DEPRECATED_NOMESSAGE + static void lockSemaphore(TCOD_semaphore_t sem); + TCOD_DEPRECATED_NOMESSAGE + static void unlockSemaphore(TCOD_semaphore_t sem); + TCOD_DEPRECATED_NOMESSAGE + static void deleteSemaphore( TCOD_semaphore_t sem); + // condition + TCOD_DEPRECATED_NOMESSAGE + static TCOD_cond_t newCondition(); + TCOD_DEPRECATED_NOMESSAGE + static void signalCondition(TCOD_cond_t sem); + TCOD_DEPRECATED_NOMESSAGE + static void broadcastCondition(TCOD_cond_t sem); + TCOD_DEPRECATED_NOMESSAGE + static void waitCondition(TCOD_cond_t sem, TCOD_mutex_t mut); + TCOD_DEPRECATED_NOMESSAGE + static void deleteCondition( TCOD_cond_t sem); +}; + +#endif diff --git a/tcod_sys/libtcod/src/sys_c.c b/tcod_sys/libtcod/src/libtcod/sys_c.c similarity index 63% rename from tcod_sys/libtcod/src/sys_c.c rename to tcod_sys/libtcod/src/libtcod/sys_c.c index 4689d7bff..4b53d031e 100644 --- a/tcod_sys/libtcod/src/sys_c.c +++ b/tcod_sys/libtcod/src/libtcod/sys_c.c @@ -1,559 +1,547 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include -#include -#include -#include - -#if defined (__APPLE__) && defined (__MACH__) -/* Is this necessary now the custom clipboard stuff is gone? */ -#include -#endif -#include "libtcod_int.h" -#include "libtcod_version.h" -#ifdef TCOD_WINDOWS -#include -#else -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -bool TCOD_sys_create_directory(const char *path) { -#ifdef TCOD_WINDOWS - return (CreateDirectory(path,NULL) != 0 || GetLastError() == ERROR_ALREADY_EXISTS); -#else - return mkdir(path,0755) == 0 || errno == EEXIST; -#endif -} - -bool TCOD_sys_delete_file(const char *path) { -#ifdef TCOD_WINDOWS - return DeleteFile(path) != 0; -#else - return unlink(path) == 0 || errno == ENOENT; -#endif -} - -bool TCOD_sys_delete_directory(const char *path) { -#ifdef TCOD_WINDOWS - return RemoveDirectory(path) != 0; -#else - return rmdir(path) == 0 || errno == ENOENT; -#endif -} - - -bool TCOD_sys_is_directory(const char *path) { -#ifdef TCOD_WINDOWS - DWORD type=GetFileAttributes(path); - return ( type & FILE_ATTRIBUTE_DIRECTORY) != 0 ; -#else - DIR *d=opendir(path); - if ( d ) { closedir(d); return true; } - return false; -#endif -} - - -static bool filename_match(const char *name, const char *pattern) { - char *ptr; - if ( pattern == NULL || pattern[0] == 0 ) return true; - ptr=strchr(pattern,'*'); - if ( ! ptr ) return strcmp(name,pattern) == 0; - if ( ptr != name && strncmp(name,pattern, ptr - pattern) != 0 ) return false; - return strcmp( name + strlen(name) - strlen(ptr+1), ptr+1) == 0; -} - -TCOD_list_t TCOD_sys_get_directory_content(const char *path, const char *pattern) { - TCOD_list_t list=TCOD_list_new(); -#ifdef TCOD_WINDOWS - WIN32_FIND_DATA FileData; - HANDLE hList; - char dname[ 512 ]; - sprintf(dname, "%s\\*",path); - hList = FindFirstFile(dname, &FileData); - if (hList == INVALID_HANDLE_VALUE) - { - return list; - } - do - { - if ( ! (strcmp(FileData.cFileName,".") == 0 || strcmp(FileData.cFileName,"..") == 0 ) ) - { - if ( filename_match(FileData.cFileName,pattern) ) - TCOD_list_push(list,TCOD_strdup(FileData.cFileName)); - } - - } while ( FindNextFile(hList, &FileData) ); - FindClose(hList); -#else - DIR *dir = opendir(path); - struct dirent *dirent = NULL; - if ( ! dir ) return list; - while ( ( dirent = readdir(dir) ) ) - { - if ( ! (strcmp(dirent->d_name,".") == 0 || strcmp(dirent->d_name,"..") == 0 ) ) - { - if ( filename_match(dirent->d_name,pattern) ) - TCOD_list_push(list,TCOD_strdup(dirent->d_name)); - } - } - closedir(dir); -#endif - return list; -} - -/* thread stuff */ -#ifdef TCOD_WINDOWS -/* Helper function to count set bits in the processor mask. */ -static DWORD CountSetBits(ULONG_PTR bitMask) -{ - DWORD LSHIFT = sizeof(ULONG_PTR)*8 - 1; - DWORD bitSetCount = 0; - ULONG_PTR bitTest = (ULONG_PTR)1 << LSHIFT; - DWORD i; - - for (i = 0; i <= LSHIFT; ++i) - { - bitSetCount += ((bitMask & bitTest)?1:0); - bitTest/=2; - } - - return bitSetCount; -} -#endif - -int TCOD_sys_get_num_cores(void) { -#ifdef TCOD_WINDOWS - /* what a crap !!! works only on xp sp3 & vista */ - typedef enum _PROCESSOR_CACHE_TYPE { - CacheUnified, - CacheInstruction, - CacheData, - CacheTrace - } PROCESSOR_CACHE_TYPE; - - typedef struct _CACHE_DESCRIPTOR { - BYTE Level; - BYTE Associativity; - WORD LineSize; - DWORD Size; - PROCESSOR_CACHE_TYPE Type; - } CACHE_DESCRIPTOR; - typedef enum _LOGICAL_PROCESSOR_RELATIONSHIP { - RelationProcessorCore, - RelationNumaNode, - RelationCache, - RelationProcessorPackage - } LOGICAL_PROCESSOR_RELATIONSHIP; - - typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION { - ULONG_PTR ProcessorMask; - LOGICAL_PROCESSOR_RELATIONSHIP Relationship; - union { - struct { - BYTE Flags; - } ProcessorCore; - struct { - DWORD NodeNumber; - } NumaNode; - CACHE_DESCRIPTOR Cache; - ULONGLONG Reserved[2]; - }; - } SYSTEM_LOGICAL_PROCESSOR_INFORMATION, - *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION; - typedef BOOL (WINAPI *LPFN_GLPI)( - PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, - PDWORD); - - LPFN_GLPI glpi; - BOOL done = FALSE; - PSYSTEM_LOGICAL_PROCESSOR_INFORMATION buffer = NULL; - PSYSTEM_LOGICAL_PROCESSOR_INFORMATION ptr = NULL; - DWORD returnLength = 0; - DWORD logicalProcessorCount = 0; - DWORD byteOffset = 0; - - glpi = (LPFN_GLPI) GetProcAddress( - GetModuleHandle(TEXT("kernel32")), - "GetLogicalProcessorInformation"); - if (! glpi) { - return 1; - } - - while (!done) { - DWORD rc = glpi(buffer, &returnLength); - - if (FALSE == rc) - { - if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - if (buffer) - free(buffer); - - buffer = (PSYSTEM_LOGICAL_PROCESSOR_INFORMATION)malloc( - returnLength); - - if (NULL == buffer) { - return 1; - } - } else { - return 1; - } - } else { - done = TRUE; - } - } - - ptr = buffer; - - while (byteOffset + sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION) <= returnLength) { - switch (ptr->Relationship) { - case RelationProcessorCore: - /* A hyperthreaded core supplies more than one logical processor. */ - logicalProcessorCount += CountSetBits(ptr->ProcessorMask); - break; - default: break; - } - byteOffset += sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION); - ptr++; - } - - free(buffer); - - return logicalProcessorCount; -#else - return sysconf(_SC_NPROCESSORS_ONLN); -#endif -} - -TCOD_thread_t TCOD_thread_new(int (*func)(void *), void *data) -{ -#ifdef TCOD_WINDOWS - HANDLE ret = CreateThread(NULL,0,(DWORD (WINAPI *)( LPVOID ))func,data,0,NULL); - return (TCOD_thread_t)ret; -#else - pthread_t id; - int iret; - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED); - iret =pthread_create(&id,&attr,(void *(*)(void *))func,data); - if ( iret != 0 ) id=0; - return (TCOD_thread_t)id; -#endif -} - -void TCOD_thread_delete(TCOD_thread_t th) -{ -#ifdef TCOD_WINDOWS - CloseHandle((HANDLE)th); -#endif -} - -void TCOD_thread_wait(TCOD_thread_t th) { -#ifdef TCOD_WINDOWS - WaitForSingleObject((HANDLE)th,INFINITE); -#else - pthread_t id=(pthread_t)th; - pthread_join(id,NULL); -#endif -} - -TCOD_mutex_t TCOD_mutex_new() -{ -#ifdef TCOD_WINDOWS - CRITICAL_SECTION *cs = (CRITICAL_SECTION *)calloc(sizeof(CRITICAL_SECTION),1); - InitializeCriticalSection(cs); - return (TCOD_mutex_t)cs; -#else - static pthread_mutex_t tmp=PTHREAD_MUTEX_INITIALIZER; - pthread_mutex_t *mut = (pthread_mutex_t *)calloc(sizeof(pthread_mutex_t),1); - *mut = tmp; - return (TCOD_mutex_t)mut; -#endif -} - -void TCOD_mutex_in(TCOD_mutex_t mut) -{ -#ifdef TCOD_WINDOWS - EnterCriticalSection((CRITICAL_SECTION *)mut); -#else - pthread_mutex_lock((pthread_mutex_t *)mut); -#endif -} - -void TCOD_mutex_out(TCOD_mutex_t mut) -{ -#ifdef TCOD_WINDOWS - LeaveCriticalSection((CRITICAL_SECTION *)mut); -#else - pthread_mutex_unlock((pthread_mutex_t *)mut); -#endif -} - -void TCOD_mutex_delete(TCOD_mutex_t mut) -{ -#ifdef TCOD_WINDOWS - DeleteCriticalSection((CRITICAL_SECTION *)mut); - free(mut); -#else - pthread_mutex_destroy((pthread_mutex_t *)mut); - free(mut); -#endif -} - -TCOD_semaphore_t TCOD_semaphore_new(int initVal) -{ -#ifdef TCOD_WINDOWS - HANDLE ret = CreateSemaphore(NULL,initVal,255,NULL); - return (TCOD_semaphore_t)ret; -#else - sem_t *ret = (sem_t *)calloc(sizeof(sem_t),1); - if ( ret ) sem_init(ret,0,initVal); - return (TCOD_semaphore_t) ret; -#endif -} - -void TCOD_semaphore_lock(TCOD_semaphore_t sem) -{ -#ifdef TCOD_WINDOWS - WaitForSingleObject((HANDLE)sem,INFINITE); -#else - if ( sem ) sem_wait((sem_t *)sem); -#endif -} - -void TCOD_semaphore_unlock(TCOD_semaphore_t sem) -{ -#ifdef TCOD_WINDOWS - ReleaseSemaphore((HANDLE)sem,1,NULL); -#else - if ( sem ) sem_post((sem_t *)sem); -#endif -} - -void TCOD_semaphore_delete( TCOD_semaphore_t sem) -{ -#ifdef TCOD_WINDOWS - CloseHandle((HANDLE)sem); -#else - if ( sem ) - { - sem_destroy((sem_t *)sem); - free (sem); - } -#endif -} - -#ifdef TCOD_WINDOWS -/* poor win32 API has no thread conditions */ -typedef struct { - int nbSignals; - int nbWaiting; - TCOD_mutex_t mutex; - TCOD_semaphore_t waiting; - TCOD_semaphore_t waitDone; -} cond_t; -#endif - -TCOD_cond_t TCOD_condition_new(void) { -#ifdef TCOD_WINDOWS - cond_t *ret = (cond_t *)calloc(sizeof(cond_t),1); - ret->mutex = TCOD_mutex_new(); - ret->waiting = TCOD_semaphore_new(0); - ret->waitDone = TCOD_semaphore_new(0); - return (TCOD_cond_t)ret; -#else - pthread_cond_t *ret = (pthread_cond_t *)calloc(sizeof(pthread_cond_t),1); - if ( ret ) pthread_cond_init(ret,NULL); - return (TCOD_cond_t) ret; -#endif -} - -void TCOD_condition_signal(TCOD_cond_t pcond) { -#ifdef TCOD_WINDOWS - cond_t *cond=(cond_t *)pcond; - if ( cond ) { - TCOD_mutex_in(cond->mutex); - if ( cond->nbWaiting > cond->nbSignals ) { - cond->nbSignals++; - TCOD_semaphore_unlock(cond->waiting); - TCOD_mutex_out(cond->mutex); - TCOD_semaphore_lock(cond->waitDone); - } else { - TCOD_mutex_out(cond->mutex); - } - } -#else - if ( pcond ) { - pthread_cond_signal((pthread_cond_t *)pcond); - } -#endif -} - -void TCOD_condition_broadcast(TCOD_cond_t pcond) { -#ifdef TCOD_WINDOWS - cond_t *cond=(cond_t *)pcond; - if ( cond ) { - TCOD_mutex_in(cond->mutex); - if ( cond->nbWaiting > cond->nbSignals ) { - int nbUnlock=cond->nbWaiting-cond->nbSignals; - int i; - cond->nbSignals=cond->nbWaiting; - for (i=nbUnlock; i > 0; i--) { - TCOD_semaphore_unlock(cond->waiting); - } - TCOD_mutex_out(cond->mutex); - for (i=nbUnlock; i > 0; i--) { - TCOD_semaphore_lock(cond->waitDone); - } - } else { - TCOD_mutex_out(cond->mutex); - } - } -#else - if ( pcond ) { - pthread_cond_broadcast((pthread_cond_t *)pcond); - } -#endif -} - -void TCOD_condition_wait(TCOD_cond_t pcond, TCOD_mutex_t mut) { -#ifdef TCOD_WINDOWS - cond_t *cond=(cond_t *)pcond; - if ( cond ) { - TCOD_mutex_in(cond->mutex); - cond->nbWaiting++; - TCOD_mutex_out(cond->mutex); - TCOD_mutex_out(mut); - TCOD_semaphore_lock(cond->waiting); - TCOD_mutex_in(cond->mutex); - if ( cond->nbSignals > 0 ) { - TCOD_semaphore_unlock(cond->waitDone); - cond->nbSignals--; - } - cond->nbWaiting--; - TCOD_mutex_out(cond->mutex); - } -#else - if ( pcond && mut ) { - pthread_cond_wait((pthread_cond_t *)pcond, (pthread_mutex_t *)mut); - } -#endif -} - -void TCOD_condition_delete( TCOD_cond_t pcond) { -#ifdef TCOD_WINDOWS - cond_t *cond=(cond_t *)pcond; - if ( cond ) { - TCOD_mutex_delete(cond->mutex); - TCOD_semaphore_delete(cond->waiting); - TCOD_semaphore_delete(cond->waitDone); - free(cond); - } -#else - if ( pcond ) { - pthread_cond_destroy((pthread_cond_t *)pcond); - free (pcond); - } -#endif -} - -#ifndef TCOD_BARE -void TCOD_sys_get_fullscreen_offsets(int *offx, int *offy) { - if ( offx ) *offx = TCOD_ctx.fullscreen_offsetx; - if ( offy ) *offy = TCOD_ctx.fullscreen_offsety; -} -#else -void TCOD_sys_startup(void) { - //TCOD_ctx.max_font_chars = 256; - //alloc_ascii_tables(); -} - -void TCOD_sys_shutdown(void) { -} - -bool TCOD_sys_read_file(const char *filename, unsigned char **buf, size_t *size) { - return false; -} - -bool TCOD_sys_write_file(const char *filename, unsigned char *buf, uint32_t size) { - return false; -} -#endif /* TCOD_BARE */ - -void TCOD_fatal(const char *fmt, ...) { - va_list ap; - TCOD_sys_shutdown(); - printf("%s\n", TCOD_STRVERSIONNAME); - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - printf("\n"); - exit(1); -} - -void TCOD_fatal_nopar(const char *msg) { - TCOD_sys_shutdown(); - printf("%s\n%s\n", TCOD_STRVERSIONNAME, msg); - exit(1); -} - -/* dynamic library support */ -#ifdef TCOD_WINDOWS -TCOD_library_t TCOD_load_library(const char *path) { - return (TCOD_library_t)LoadLibrary(path); -} -void * TCOD_get_function_address(TCOD_library_t library, const char *function_name) { - return (void *)GetProcAddress((HMODULE)library,function_name); -} -void TCOD_close_library(TCOD_library_t library) { - FreeLibrary((HMODULE)library); -} -#else -TCOD_library_t TCOD_load_library(const char *path) { - void *l=dlopen(path,RTLD_LAZY); - return (TCOD_library_t)l; -} -void * TCOD_get_function_address(TCOD_library_t library, const char *function_name) { - return dlsym(library,(char *)function_name); -} -void TCOD_close_library(TCOD_library_t library) { - dlclose(library); -} -#endif +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "sys.h" + +#include +#include +#include +#include +#include +#include + +#include "libtcod_int.h" +#include "version.h" +#ifdef TCOD_WINDOWS +#define NOMINMAX 1 +#include +#else +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +bool TCOD_sys_create_directory(const char *path) { +#ifdef TCOD_WINDOWS + return (CreateDirectory(path,NULL) != 0 || GetLastError() == ERROR_ALREADY_EXISTS); +#else + return mkdir(path,0755) == 0 || errno == EEXIST; +#endif +} + +bool TCOD_sys_delete_file(const char *path) { +#ifdef TCOD_WINDOWS + return DeleteFile(path) != 0; +#else + return unlink(path) == 0 || errno == ENOENT; +#endif +} + +bool TCOD_sys_delete_directory(const char *path) { +#ifdef TCOD_WINDOWS + return RemoveDirectory(path) != 0; +#else + return rmdir(path) == 0 || errno == ENOENT; +#endif +} + + +bool TCOD_sys_is_directory(const char *path) { +#ifdef TCOD_WINDOWS + DWORD type=GetFileAttributes(path); + return ( type & FILE_ATTRIBUTE_DIRECTORY) != 0 ; +#else + DIR *d=opendir(path); + if ( d ) { closedir(d); return true; } + return false; +#endif +} + + +static bool filename_match(const char *name, const char *pattern) { + const char *ptr; + if ( pattern == NULL || pattern[0] == 0 ) return true; + ptr=strchr(pattern,'*'); + if ( ! ptr ) return strcmp(name,pattern) == 0; + if ( ptr != name && strncmp(name,pattern, ptr - pattern) != 0 ) return false; + return strcmp( name + strlen(name) - strlen(ptr+1), ptr+1) == 0; +} + +TCOD_list_t TCOD_sys_get_directory_content(const char *path, const char *pattern) { + TCOD_list_t list=TCOD_list_new(); +#ifdef TCOD_WINDOWS + WIN32_FIND_DATA FileData; + HANDLE hList; + char dname[ 512 ]; + sprintf(dname, "%s\\*",path); + hList = FindFirstFile(dname, &FileData); + if (hList == INVALID_HANDLE_VALUE) + { + return list; + } + do + { + if ( ! (strcmp(FileData.cFileName,".") == 0 || strcmp(FileData.cFileName,"..") == 0 ) ) + { + if ( filename_match(FileData.cFileName,pattern) ) + TCOD_list_push(list,TCOD_strdup(FileData.cFileName)); + } + + } while ( FindNextFile(hList, &FileData) ); + FindClose(hList); +#else + DIR *dir = opendir(path); + struct dirent *dirent = NULL; + if ( ! dir ) return list; + while ( ( dirent = readdir(dir) ) ) + { + if ( ! (strcmp(dirent->d_name,".") == 0 || strcmp(dirent->d_name,"..") == 0 ) ) + { + if ( filename_match(dirent->d_name,pattern) ) + TCOD_list_push(list,TCOD_strdup(dirent->d_name)); + } + } + closedir(dir); +#endif + return list; +} + +/* thread stuff */ +#ifdef TCOD_WINDOWS +/* Helper function to count set bits in the processor mask. */ +static DWORD CountSetBits(ULONG_PTR bitMask) +{ + DWORD LSHIFT = sizeof(ULONG_PTR)*8 - 1; + DWORD bitSetCount = 0; + ULONG_PTR bitTest = (ULONG_PTR)1 << LSHIFT; + DWORD i; + + for (i = 0; i <= LSHIFT; ++i) + { + bitSetCount += ((bitMask & bitTest)?1:0); + bitTest/=2; + } + + return bitSetCount; +} +#endif + +int TCOD_sys_get_num_cores(void) { +#ifdef TCOD_WINDOWS + /* what a crap !!! works only on xp sp3 & vista */ + typedef enum _PROCESSOR_CACHE_TYPE { + CacheUnified, + CacheInstruction, + CacheData, + CacheTrace + } PROCESSOR_CACHE_TYPE; + + typedef struct _CACHE_DESCRIPTOR { + BYTE Level; + BYTE Associativity; + WORD LineSize; + DWORD Size; + PROCESSOR_CACHE_TYPE Type; + } CACHE_DESCRIPTOR; + typedef enum _LOGICAL_PROCESSOR_RELATIONSHIP { + RelationProcessorCore, + RelationNumaNode, + RelationCache, + RelationProcessorPackage + } LOGICAL_PROCESSOR_RELATIONSHIP; + + typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION { + ULONG_PTR ProcessorMask; + LOGICAL_PROCESSOR_RELATIONSHIP Relationship; + union { + struct { + BYTE Flags; + } ProcessorCore; + struct { + DWORD NodeNumber; + } NumaNode; + CACHE_DESCRIPTOR Cache; + ULONGLONG Reserved[2]; + } Union; + } SYSTEM_LOGICAL_PROCESSOR_INFORMATION, + *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION; + typedef BOOL (WINAPI *LPFN_GLPI)( + PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, + PDWORD); + + LPFN_GLPI glpi; + BOOL done = FALSE; + PSYSTEM_LOGICAL_PROCESSOR_INFORMATION buffer = NULL; + PSYSTEM_LOGICAL_PROCESSOR_INFORMATION ptr = NULL; + DWORD returnLength = 0; + DWORD logicalProcessorCount = 0; + DWORD byteOffset = 0; + + glpi = (LPFN_GLPI)GetProcAddress(GetModuleHandle(TEXT("kernel32")), + "GetLogicalProcessorInformation"); + if (! glpi) { + return 1; + } + + while (!done) { + DWORD rc = glpi(buffer, &returnLength); + + if (FALSE == rc) + { + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { + if (buffer) + free(buffer); + + buffer = malloc(returnLength); + + if (NULL == buffer) { + return 1; + } + } else { + return 1; + } + } else { + done = TRUE; + } + } + + ptr = buffer; + + while (byteOffset + sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION) <= returnLength) { + switch (ptr->Relationship) { + case RelationProcessorCore: + /* A hyperthreaded core supplies more than one logical processor. */ + logicalProcessorCount += CountSetBits(ptr->ProcessorMask); + break; + default: break; + } + byteOffset += sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION); + ptr++; + } + + free(buffer); + + return logicalProcessorCount; +#else + return sysconf(_SC_NPROCESSORS_ONLN); +#endif +} + +TCOD_thread_t TCOD_thread_new(int (*func)(void *), void *data) +{ +#ifdef TCOD_WINDOWS + HANDLE ret = CreateThread( + NULL, 0, (DWORD (WINAPI*)(LPVOID))func, data, 0, NULL); + return ret; +#else + pthread_t id; + int iret; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED); + iret =pthread_create(&id, &attr, (void *(*)(void *))func, data); + if ( iret != 0 ) id=0; + return (TCOD_thread_t)id; +#endif +} + +void TCOD_thread_delete(TCOD_thread_t th) +{ +#ifdef TCOD_WINDOWS + CloseHandle(th); +#endif +} + +void TCOD_thread_wait(TCOD_thread_t th) { +#ifdef TCOD_WINDOWS + WaitForSingleObject(th, INFINITE); +#else + pthread_t id = (pthread_t)th; + pthread_join(id,NULL); +#endif +} + +TCOD_mutex_t TCOD_mutex_new() +{ +#ifdef TCOD_WINDOWS + CRITICAL_SECTION *cs = calloc(sizeof(CRITICAL_SECTION), 1); + InitializeCriticalSection(cs); + return cs; +#else + static pthread_mutex_t tmp=PTHREAD_MUTEX_INITIALIZER; + pthread_mutex_t *mut = calloc(sizeof(pthread_mutex_t), 1); + *mut = tmp; + return (TCOD_mutex_t)mut; +#endif +} + +void TCOD_mutex_in(TCOD_mutex_t mut) +{ +#ifdef TCOD_WINDOWS + EnterCriticalSection((CRITICAL_SECTION*)mut); +#else + pthread_mutex_lock((pthread_mutex_t*)mut); +#endif +} + +void TCOD_mutex_out(TCOD_mutex_t mut) +{ +#ifdef TCOD_WINDOWS + LeaveCriticalSection((CRITICAL_SECTION*)mut); +#else + pthread_mutex_unlock((pthread_mutex_t*)mut); +#endif +} + +void TCOD_mutex_delete(TCOD_mutex_t mut) +{ +#ifdef TCOD_WINDOWS + DeleteCriticalSection((CRITICAL_SECTION*)mut); + free(mut); +#else + pthread_mutex_destroy((pthread_mutex_t*)mut); + free(mut); +#endif +} + +TCOD_semaphore_t TCOD_semaphore_new(int initVal) +{ +#ifdef TCOD_WINDOWS + HANDLE ret = CreateSemaphore(NULL,initVal,255,NULL); + return ret; +#else + sem_t *ret = calloc(sizeof(sem_t), 1); + if ( ret ) sem_init(ret, 0, initVal); + return (TCOD_semaphore_t)ret; +#endif +} + +void TCOD_semaphore_lock(TCOD_semaphore_t sem) +{ +#ifdef TCOD_WINDOWS + WaitForSingleObject(sem, INFINITE); +#else + if ( sem ) sem_wait((sem_t*)sem); +#endif +} + +void TCOD_semaphore_unlock(TCOD_semaphore_t sem) +{ +#ifdef TCOD_WINDOWS + ReleaseSemaphore(sem, 1, NULL); +#else + if ( sem ) sem_post((sem_t*)sem); +#endif +} + +void TCOD_semaphore_delete( TCOD_semaphore_t sem) +{ +#ifdef TCOD_WINDOWS + CloseHandle(sem); +#else + if ( sem ) + { + sem_destroy((sem_t*)sem); + free (sem); + } +#endif +} + +#ifdef TCOD_WINDOWS +/* poor win32 API has no thread conditions */ +typedef struct { + int nbSignals; + int nbWaiting; + TCOD_mutex_t mutex; + TCOD_semaphore_t waiting; + TCOD_semaphore_t waitDone; +} cond_t; +#endif + +TCOD_cond_t TCOD_condition_new(void) { +#ifdef TCOD_WINDOWS + cond_t *ret = calloc(sizeof(cond_t), 1); + ret->mutex = TCOD_mutex_new(); + ret->waiting = TCOD_semaphore_new(0); + ret->waitDone = TCOD_semaphore_new(0); + return ret; +#else + pthread_cond_t *ret = calloc(sizeof(pthread_cond_t), 1); + if ( ret ) pthread_cond_init(ret,NULL); + return (TCOD_cond_t)ret; +#endif +} + +void TCOD_condition_signal(TCOD_cond_t pcond) { +#ifdef TCOD_WINDOWS + cond_t* cond = pcond; + if ( cond ) { + TCOD_mutex_in(cond->mutex); + if ( cond->nbWaiting > cond->nbSignals ) { + cond->nbSignals++; + TCOD_semaphore_unlock(cond->waiting); + TCOD_mutex_out(cond->mutex); + TCOD_semaphore_lock(cond->waitDone); + } else { + TCOD_mutex_out(cond->mutex); + } + } +#else + if ( pcond ) { + pthread_cond_signal((pthread_cond_t*)pcond); + } +#endif +} + +void TCOD_condition_broadcast(TCOD_cond_t pcond) { +#ifdef TCOD_WINDOWS + cond_t *cond = pcond; + if ( cond ) { + TCOD_mutex_in(cond->mutex); + if ( cond->nbWaiting > cond->nbSignals ) { + int nbUnlock=cond->nbWaiting-cond->nbSignals; + int i; + cond->nbSignals=cond->nbWaiting; + for (i=nbUnlock; i > 0; i--) { + TCOD_semaphore_unlock(cond->waiting); + } + TCOD_mutex_out(cond->mutex); + for (i=nbUnlock; i > 0; i--) { + TCOD_semaphore_lock(cond->waitDone); + } + } else { + TCOD_mutex_out(cond->mutex); + } + } +#else + if ( pcond ) { + pthread_cond_broadcast((pthread_cond_t*)pcond); + } +#endif +} + +void TCOD_condition_wait(TCOD_cond_t pcond, TCOD_mutex_t mut) { +#ifdef TCOD_WINDOWS + cond_t *cond = pcond; + if ( cond ) { + TCOD_mutex_in(cond->mutex); + cond->nbWaiting++; + TCOD_mutex_out(cond->mutex); + TCOD_mutex_out(mut); + TCOD_semaphore_lock(cond->waiting); + TCOD_mutex_in(cond->mutex); + if ( cond->nbSignals > 0 ) { + TCOD_semaphore_unlock(cond->waitDone); + cond->nbSignals--; + } + cond->nbWaiting--; + TCOD_mutex_out(cond->mutex); + } +#else + if ( pcond && mut ) { + pthread_cond_wait((pthread_cond_t*)pcond, (pthread_mutex_t*)mut); + } +#endif +} + +void TCOD_condition_delete( TCOD_cond_t pcond) { +#ifdef TCOD_WINDOWS + cond_t* cond = pcond; + if ( cond ) { + TCOD_mutex_delete(cond->mutex); + TCOD_semaphore_delete(cond->waiting); + TCOD_semaphore_delete(cond->waitDone); + free(cond); + } +#else + if ( pcond ) { + pthread_cond_destroy((pthread_cond_t*)pcond); + free (pcond); + } +#endif +} + +void TCOD_sys_get_fullscreen_offsets(int *offx, int *offy) { + if ( offx ) *offx = TCOD_ctx.fullscreen_offsetx; + if ( offy ) *offy = TCOD_ctx.fullscreen_offsety; +} +/** + * Print formatted text as an error and then forcefully terminate the program. + */ +void TCOD_fatal(const char *fmt, ...) +{ + va_list ap; + TCOD_sys_shutdown(); + fprintf(stderr, "%s FATAL ERROR:\n", TCOD_STRVERSIONNAME); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + fprintf(stderr, "\n"); + exit(EXIT_FAILURE); +} +void TCOD_fatal_nopar(const char *msg) +{ + TCOD_fatal("%s", msg); +} + +/* dynamic library support */ +#ifdef TCOD_WINDOWS +TCOD_library_t TCOD_load_library(const char *path) +{ + return (TCOD_library_t)LoadLibrary(path); +} +void* TCOD_get_function_address( + TCOD_library_t library, const char *function_name) +{ + return (void*)GetProcAddress((HMODULE)library, function_name); +} +void TCOD_close_library(TCOD_library_t library) +{ + FreeLibrary((HMODULE)library); +} +#else +TCOD_library_t TCOD_load_library(const char *path) +{ + void *l = dlopen(path, RTLD_LAZY); + return l; +} +void * TCOD_get_function_address(TCOD_library_t library, const char *function_name) { + return dlsym(library, function_name); +} +void TCOD_close_library(TCOD_library_t library) { + dlclose(library); +} +#endif diff --git a/tcod_sys/libtcod/src/libtcod/sys_sdl_c.c b/tcod_sys/libtcod/src/libtcod/sys_sdl_c.c new file mode 100644 index 000000000..b3c71500f --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/sys_sdl_c.c @@ -0,0 +1,1258 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "mouse.h" +#include "sys.h" + +#include +#include +#include +#include + +#include +#include "console.h" +#include "console_etc.h" +#include "libtcod_int.h" +#include "parser.h" +#include "console_init.h" +#include "error.h" +#include "globals.h" + +#if defined(__ANDROID__) +#define TCOD_TOUCH_INPUT +#define MAX_TOUCH_FINGERS 5 + +typedef struct { + int nupdates; /* how many updates have happened since the first finger was pressed. */ + uint32_t ticks0; /* current number of ticks at start of touch event sequence. */ + SDL_FingerID finger_id; /* the last finger which was pressed. */ + int coords[MAX_TOUCH_FINGERS][2]; /* absolute position of each finger. */ + int coords_delta[MAX_TOUCH_FINGERS][2]; /* absolute position of each finger. */ + int consolecoords[MAX_TOUCH_FINGERS][2]; /* cell coordinates in the root console for each finger. */ + int consolecoords_delta[MAX_TOUCH_FINGERS][2]; /* cell coordinates in the root console for each finger. */ + int nfingers; /* number of unique fingers employed at any time during this. */ + int nfingerspressed; /* number of those fingers currently still pressed. */ + SDL_FingerID finger_ids[MAX_TOUCH_FINGERS]; + char fingerspressed[MAX_TOUCH_FINGERS]; +} TCOD_touch_t; +#endif + +/* to enable bitmap locking. Is there any use ?? makes the OSX port renderer to fail */ +/*#define USE_SDL_LOCKS */ + +/* image support stuff */ +bool TCOD_sys_check_bmp(const char *filename); +SDL_Surface *TCOD_sys_read_bmp(const char *filename); +void TCOD_sys_write_bmp(SDL_Surface *surf, const char *filename); +bool TCOD_sys_check_png(const char *filename); +SDL_Surface *TCOD_sys_read_png(const char *filename); +void TCOD_sys_write_png(SDL_Surface *surf, const char *filename); + +typedef struct { + const char *extension; + bool (*check_type)(const char *filename); + SDL_Surface *(*read)(const char *filename); + void (*write)(SDL_Surface *surf, const char *filename); +} image_support_t; + +static image_support_t image_type[] = { + { "BMP", TCOD_sys_check_bmp, TCOD_sys_read_bmp, TCOD_sys_write_bmp }, + { "PNG", TCOD_sys_check_png, TCOD_sys_read_png, TCOD_sys_write_png }, + { NULL, NULL, NULL, NULL }, +}; + +scale_data_t scale_data = {0}; +float scale_factor = 1.0f; +SDL_Surface* charmap = NULL; +#define MAX_SCALE_FACTOR 5.0f + +/* mouse stuff */ +#ifdef TCOD_TOUCH_INPUT +static bool mouse_touch=true; +#endif + +/* minimum length for a frame (when fps are limited) */ +static int min_frame_length=0; +static int min_frame_length_backup=0; +/* number of frames in the last second */ +static int fps=0; +/* current number of frames */ +static int cur_fps=0; +/* length of the last rendering loop */ +static float last_frame_length=0.0f; + +static bool key_status[TCODK_CHAR+1] = {0}; +int oldFade=-1; + +/* convert SDL vk to a char (depends on the keyboard layout) */ +typedef struct { + SDL_Keycode sdl_key; + int tcod_key; +} vk_to_c_entry; +#define NUM_VK_TO_C_ENTRIES 10 +static vk_to_c_entry vk_to_c[NUM_VK_TO_C_ENTRIES]; +/** + Converts TCOD_FONT_LAYOUT_TCOD tile position to Extended ASCII code-point. + */ +static const int tcod_codec_eascii_[256] = { + 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, 91, 92, 93, 94, 95, 96, 123, 124, 125, 126, 176, 177, 178, 179, 196, + 197, 180, 193, 195, 194, 192, 218, 191, 217, 226, 227, 228, 229, 230, 231, 232, + 24, 25, 27, 26, 30, 31, 17, 16, 18, 29, 224, 225, 9, 10, 186, 205, + 206, 185, 202, 204, 203, 200, 201, 187, 188, 0, 0, 0, 0, 0, 0, 0, + 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, 0, 0, 0, 0, 0, 0, + 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, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; +/** + Converts TCOD_FONT_LAYOUT_TCOD tile position to Unicode. + */ +static const int tcod_codec_[256] = { + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x7B, + 0x7C, 0x7D, 0x7E,0x2591,0x2592,0x2593,0x2502,0x2500, +0x253C,0x2524,0x2534,0x251C,0x252C,0x2514,0x250C,0x2510, +0x2518,0x2598,0x259D,0x2580,0x2596,0x259A,0x2590,0x2597, +0x2191,0x2193,0x2190,0x2192,0x25B2,0x25BC,0x25C4,0x25BA, +0x2195,0x2194,0x2610,0x2611,0x25CB,0x25C9,0x2551,0x2550, +0x256C,0x2563,0x2569,0x2560,0x2566,0x255A,0x2554,0x2557, +0x255D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, + 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, + 0x59, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, + 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, + 0x79, 0x7A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +/** + Converts Code Page 437 tile index to Unicode. + */ +static const int cp437_codec_[256] = { +0x0000, 0x263A, 0x263B, 0x2665, 0x2666, 0x2663, 0x2660, 0x2022, +0x25D8, 0x25CB, 0x25D9, 0x2642, 0x2640, 0x266A, 0x266B, 0x263C, +0x25BA, 0x25C4, 0x2195, 0x203C, 0x00B6, 0x00A7, 0x25AC, 0x21A8, +0x2191, 0x2193, 0x2192, 0x2190, 0x221F, 0x2194, 0x25B2, 0x25BC, +0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, +0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, +0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, +0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, +0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, +0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, +0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, +0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, +0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, +0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, +0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, +0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, +0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, +0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5, +0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, +0x00FF, 0x00D6, 0x00DC, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192, +0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, +0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, +0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, +0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, +0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, +0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, +0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, +0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, +0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4, +0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229, +0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, +0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0, +}; +void TCOD_sys_register_SDL_renderer(SDL_renderer_t renderer) { + TCOD_ctx.sdl_cbk=renderer; +} +/** See TCOD_console_map_ascii_code_to_font */ +void TCOD_sys_map_ascii_to_font(int asciiCode, int fontCharX, int fontCharY) { + if (!TCOD_ctx.tileset) { return; } + TCOD_tileset_assign_tile( + TCOD_ctx.tileset, + TCOD_ctx.tileset->virtual_columns * fontCharY + fontCharX, + asciiCode); +} +/** + * Set a code-point to point to an already existing code-point. + */ +static void TCOD_sys_map_clone_(int new_codepoint, int old_codepoint) { + if (!TCOD_ctx.tileset) { return; } + if (old_codepoint < 0) { return; } + if (old_codepoint >= TCOD_ctx.tileset->character_map_length) { return; } + TCOD_sys_map_ascii_to_font( + new_codepoint, TCOD_ctx.tileset->character_map[old_codepoint], 0); +} +/** + * Decode the font layout depending on the current flags. + */ +void TCOD_sys_decode_font_(void) +{ + if (!TCOD_ctx.tileset) { return; } + if (TCOD_ctx.font_flags & TCOD_FONT_LAYOUT_CP437) { + for (int i = 0; i < (int)(sizeof(cp437_codec_) / sizeof(*cp437_codec_)); ++i) { + TCOD_sys_map_ascii_to_font(cp437_codec_[i], i, 0); + } + } else if (TCOD_ctx.font_tcod_layout) { + for (int i = 0; i < (int)(sizeof(tcod_codec_) / sizeof(*tcod_codec_)); ++i) { + TCOD_sys_map_ascii_to_font(tcod_codec_[i], i, 0); + } + for (int i = 0; + i < (int)(sizeof(tcod_codec_eascii_) / sizeof(*tcod_codec_eascii_)); + ++i) { + TCOD_sys_map_ascii_to_font(tcod_codec_eascii_[i], i, 0); + } + } else { + if (TCOD_ctx.font_in_row) { + /* for font in row */ + for (int i = 0; i < TCOD_ctx.tileset->tiles_count; ++i) { + TCOD_sys_map_ascii_to_font(i, i, 0); + } + } else { + /* for font in column */ + for (int i = 0; i < TCOD_ctx.tileset->tiles_count; ++i) { + int fy = i % TCOD_ctx.tileset->virtual_columns; + int fx = i / TCOD_ctx.tileset->virtual_columns; + TCOD_sys_map_ascii_to_font(i, fx, fy); + } + } + TCOD_sys_map_clone_(0x2500, 0xC4); + TCOD_sys_map_clone_(0x2502, 0xB3); + TCOD_sys_map_clone_(0x250C, 0xDA); + TCOD_sys_map_clone_(0x2510, 0xBF); + TCOD_sys_map_clone_(0x2514, 0xC0); + TCOD_sys_map_clone_(0x2518, 0xD9); + } +} +void TCOD_sys_update_char(int asciiCode, int fontx, int fonty, + TCOD_Image* img, int x, int y) +{ + static const TCOD_color_t pink = {255, 0, 255}; + int img_width; + int img_height; + if (!img) { return; } + TCOD_image_get_size(img, &img_width, &img_height); + if (!TCOD_ctx.tileset) { return; } + int tile_id = fonty * TCOD_ctx.tileset->virtual_columns + fontx; + if (TCOD_tileset_reserve(TCOD_ctx.tileset, tile_id + 1) < 0) { return; } + struct TCOD_ColorRGBA* tile_out = + TCOD_ctx.tileset->pixels + tile_id * TCOD_ctx.tileset->tile_length; + for (int px = 0; px < TCOD_ctx.tileset->tile_width; ++px) { + for (int py = 0; py < TCOD_ctx.tileset->tile_height; ++py) { + TCOD_color_t col = TCOD_image_get_pixel(img, x + px, y + py); + struct TCOD_ColorRGBA* out = + tile_out + py * TCOD_ctx.tileset->tile_width + px; + if (TCOD_color_equals(col, pink)) { + *out = (TCOD_ColorRGBA){255, 255, 255, 0}; + continue; + } + *out = (TCOD_ColorRGBA){col.r, col.g, col.b, 255}; + } + } + TCOD_tileset_assign_tile(TCOD_ctx.tileset, tile_id, asciiCode); + TCOD_tileset_notify_tile_changed(TCOD_ctx.tileset, tile_id); +} +/** + * Older startup function, mostly called from TCOD_sys_init. + */ +void TCOD_sys_startup(void) {} +/** + * All shutdown routines call this function. + * + * Mostly used internally. TCOD_quit should be called to shutdown the library. + */ +void TCOD_sys_shutdown(void) +{ + if (TCOD_ctx.root) { + TCOD_console_delete(TCOD_ctx.root); + } + if (TCOD_ctx.engine){ + TCOD_context_delete(TCOD_ctx.engine); + TCOD_ctx.engine = NULL; + return; + } +} + +TCOD_Error TCOD_sys_load_player_config(void) +{ + const char *font; + int fullscreenWidth,fullscreenHeight; + if (!TCOD_sys_file_exists("./libtcod.cfg")) { + return TCOD_E_OK; + } + /* define file structure */ + TCOD_parser_t parser=TCOD_parser_new(); + TCOD_parser_struct_t libtcod = TCOD_parser_new_struct(parser, "libtcod"); + TCOD_struct_add_property(libtcod, "renderer", TCOD_TYPE_STRING, false); + TCOD_struct_add_property(libtcod, "font", TCOD_TYPE_STRING, false); + TCOD_struct_add_property(libtcod, "fontInRow", TCOD_TYPE_BOOL, false); + TCOD_struct_add_property(libtcod, "fontGreyscale", TCOD_TYPE_BOOL, false); + TCOD_struct_add_property(libtcod, "fontTcodLayout", TCOD_TYPE_BOOL, false); + TCOD_struct_add_property(libtcod, "fontNbCharHoriz", TCOD_TYPE_INT, false); + TCOD_struct_add_property(libtcod, "fontNbCharVertic", TCOD_TYPE_INT, false); + TCOD_struct_add_property(libtcod, "fullscreen", TCOD_TYPE_BOOL, false); + TCOD_struct_add_property(libtcod, "fullscreenWidth", TCOD_TYPE_INT, false); + TCOD_struct_add_property(libtcod, "fullscreenHeight", TCOD_TYPE_INT, false); + TCOD_struct_add_property(libtcod, "fullscreenScaling", TCOD_TYPE_BOOL, false); + + /* parse file */ + TCOD_parser_run(parser,"./libtcod.cfg",NULL); + + // Set user preferences. + // Custom fullscreen resolution. + TCOD_ctx.fullscreen = TCOD_parser_get_bool_property(parser, "libtcod.fullscreen"); + fullscreenWidth = TCOD_parser_get_int_property(parser, "libtcod.fullscreenWidth"); + fullscreenHeight = TCOD_parser_get_int_property(parser, "libtcod.fullscreenHeight"); + if (fullscreenWidth > 0) { TCOD_ctx.fullscreen_width = fullscreenWidth; } + if (fullscreenHeight > 0) { TCOD_ctx.fullscreen_height = fullscreenHeight; } + // Custom Font. + font = TCOD_parser_get_string_property(parser, "libtcod.font"); + if ( font != NULL ) { + /* custom font */ + if ( TCOD_sys_file_exists(font)) { + int fontNbCharHoriz,fontNbCharVertic; + strcpy(TCOD_ctx.font_file, font); + TCOD_ctx.font_in_row = TCOD_parser_get_bool_property(parser, "libtcod.fontInRow"); + TCOD_ctx.font_greyscale = TCOD_parser_get_bool_property(parser, "libtcod.fontGreyscale"); + TCOD_ctx.font_tcod_layout = TCOD_parser_get_bool_property(parser, "libtcod.fontTcodLayout"); + fontNbCharHoriz = TCOD_parser_get_int_property(parser, "libtcod.fontNbCharHoriz"); + fontNbCharVertic = TCOD_parser_get_int_property(parser, "libtcod.fontNbCharVertic"); + if (fontNbCharHoriz > 0) { TCOD_ctx.fontNbCharHoriz = fontNbCharHoriz; } + if (fontNbCharVertic > 0) { TCOD_ctx.fontNbCharVertic = fontNbCharVertic; } + if (charmap) { + SDL_FreeSurface(charmap); + charmap = NULL; + } + TCOD_Error err = TCOD_console_set_custom_font( + font, + (TCOD_ctx.font_in_row ? TCOD_FONT_LAYOUT_ASCII_INROW : TCOD_FONT_LAYOUT_ASCII_INCOL) + | (TCOD_ctx.font_greyscale ? TCOD_FONT_TYPE_GREYSCALE : 0) + | (TCOD_ctx.font_tcod_layout ? TCOD_FONT_LAYOUT_TCOD : 0), + fontNbCharHoriz, + fontNbCharVertic); + if (err < 0) { return err; } + } else { + printf ("Warning : font file '%s' does not exist\n", font); + } + } + printf("Warning: The use of libtcod.cfg is deprecated.\n"); + TCOD_set_error("The use of libtcod.cfg is deprecated."); + return TCOD_E_WARN; +} + +TCOD_renderer_t TCOD_sys_get_renderer(void) { + if (!TCOD_ctx.engine) { return TCOD_RENDERER_SDL2; } + return (TCOD_renderer_t)TCOD_context_get_renderer_type(TCOD_ctx.engine); +} + +int TCOD_sys_set_renderer(TCOD_renderer_t renderer) { + if (TCOD_ctx.engine && renderer == TCOD_sys_get_renderer()) { return 0; } + return TCOD_console_init_root( + TCOD_ctx.root->w, + TCOD_ctx.root->h, + TCOD_ctx.window_title, + TCOD_console_is_fullscreen(), + renderer + ); +} +TCOD_DEPRECATED_NOMESSAGE +static char* TCOD_strcasestr(const char *haystack, const char *needle) +{ + const char *startn = NULL, *np = NULL; + for (const char* p = haystack; *p; p++) { + if (np) { + if (toupper(*p) == toupper(*np)) { + if (!*++np) { return (char*)startn; } // Const cast. + } else { + np = 0; + } + } else if (toupper(*p) == toupper(*needle)) { + np = needle + 1; + startn = p; + } + } + return 0; +} + +void TCOD_sys_save_bitmap(SDL_Surface* bitmap, const char *filename) { + const image_support_t *img = image_type; + while (img->extension != NULL + && TCOD_strcasestr(filename,img->extension) == NULL ) { + ++img; + } + if (img->extension == NULL || img->write == NULL) { + img = image_type; // default to bmp + } + img->write(bitmap, filename); +} + +void TCOD_sys_save_screenshot(const char *filename) { + char buf[128]; + int idx = 0; + while (!filename) { + /* generate filename */ + FILE *access_file = NULL; + sprintf(buf, "./screenshot%03d.png", idx); + access_file = fopen(buf, "rb"); + if (!access_file) { + filename = buf; + } else { + idx++; + fclose(access_file); + } + } + if (TCOD_ctx.engine && TCOD_ctx.engine->save_screenshot_) { + TCOD_ctx.engine->save_screenshot_(TCOD_ctx.engine, filename); + } +} + +void TCOD_sys_set_fullscreen(bool fullscreen) { + TCOD_ctx.fullscreen=fullscreen; + struct SDL_Window* window = TCOD_sys_get_sdl_window(); + if (!window) { return; } + SDL_SetWindowFullscreen( + window, fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); +} + +void TCOD_sys_set_scale_factor(float value) +{ + scale_factor = value; + if (scale_factor + 1e-3f < scale_data.min_scale_factor) { + scale_factor = scale_data.min_scale_factor; + } else if (scale_factor - 1e-3f > MAX_SCALE_FACTOR) { + scale_factor = MAX_SCALE_FACTOR; + } +} + +void TCOD_sys_set_window_title(const char *title) { + strncpy(TCOD_ctx.window_title, title, sizeof(TCOD_ctx.window_title) - 1); + TCOD_ctx.window_title[sizeof(TCOD_ctx.window_title) - 1] = '\0'; + struct SDL_Window* window = TCOD_sys_get_sdl_window(); + if (window) { SDL_SetWindowTitle(window, title); } +} +/** + * Keep track of time and wait if the frame-rate is faster than the set FPS. + */ +void sync_time_(void) { + static uint32_t old_time = 0; + static uint32_t new_time = 0; + static uint32_t elapsed = 0; + int32_t frame_time; + int32_t time_to_wait; + + old_time = new_time; + new_time = TCOD_sys_elapsed_milli(); + /* If TCOD has been terminated and restarted. */ + if (old_time > new_time) + old_time = elapsed = 0; + if ( new_time / 1000 != elapsed ) { + /* update fps every second */ + fps = cur_fps; + cur_fps = 0; + elapsed = new_time / 1000; + } + /* if too fast, wait */ + frame_time = (new_time - old_time); + last_frame_length = frame_time * 0.001f; + cur_fps++; + time_to_wait = min_frame_length - frame_time; + if (old_time > 0 && time_to_wait > 0) { + TCOD_sys_sleep_milli(time_to_wait); + new_time = TCOD_sys_elapsed_milli(); + frame_time=(new_time - old_time); + } + last_frame_length = frame_time * 0.001f; +} + +static char TCOD_sys_get_vk(SDL_Keycode sdl_key) { + int i; + for (i = 0; i < NUM_VK_TO_C_ENTRIES; i++) { + if (vk_to_c[i].sdl_key == sdl_key) { + vk_to_c[i].sdl_key = 0; + return vk_to_c[i].tcod_key; + } + } + return 0; +} + +static void TCOD_sys_set_vk(SDL_Keycode sdl_key, char tcod_key) { + int i; + for (i = 0; i < NUM_VK_TO_C_ENTRIES; i++) { + if (vk_to_c[i].sdl_key == 0) { + vk_to_c[i].sdl_key = sdl_key; + vk_to_c[i].tcod_key = tcod_key; + break; + } + } +} + +static void TCOD_sys_convert_event(const SDL_Event *ev, TCOD_key_t *ret) { + const SDL_KeyboardEvent *kev=&ev->key; + /* SDL2 does not map keycodes and modifiers to characters, this is on the developer. + Presumably in order to avoid problems with different keyboard layouts, they + are expected to write their own key mapping editing code for the user. */ + if (SDLK_SCANCODE_MASK == (kev->keysym.sym & SDLK_SCANCODE_MASK)) + ret->c = 0; + else + ret->c = kev->keysym.sym; + if ( ( kev->keysym.mod & (KMOD_LCTRL|KMOD_RCTRL) ) != 0 ) { + /* when pressing CTRL-A, we don't get unicode for 'a', but unicode for CTRL-A = 1. Fix it */ + if ( kev->keysym.sym >= SDLK_a && kev->keysym.sym <= SDLK_z ) { + ret->c = 'a'+(kev->keysym.sym - SDLK_a); + } + } + if ( ev->type == SDL_KEYDOWN ) TCOD_sys_set_vk(kev->keysym.sym, ret->c); + else if (ev->type == SDL_KEYUP ) ret->c = TCOD_sys_get_vk(kev->keysym.sym); + switch(kev->keysym.sym) { + case SDLK_ESCAPE : ret->vk=TCODK_ESCAPE;break; + case SDLK_SPACE : ret->vk=TCODK_SPACE; break; + case SDLK_BACKSPACE : ret->vk=TCODK_BACKSPACE;break; + case SDLK_TAB : ret->vk=TCODK_TAB;break; + case SDLK_RETURN : ret->vk=TCODK_ENTER;break; + case SDLK_PAUSE : ret->vk=TCODK_PAUSE;break; + case SDLK_PAGEUP : ret->vk=TCODK_PAGEUP;break; + case SDLK_PAGEDOWN : ret->vk=TCODK_PAGEDOWN;break; + case SDLK_HOME : ret->vk=TCODK_HOME;break; + case SDLK_END : ret->vk=TCODK_END;break; + case SDLK_DELETE : ret->vk=TCODK_DELETE;break; + case SDLK_INSERT : ret->vk=TCODK_INSERT; break; + case SDLK_LALT : case SDLK_RALT : ret->vk=TCODK_ALT;break; + case SDLK_LCTRL : case SDLK_RCTRL : ret->vk=TCODK_CONTROL;break; + case SDLK_LSHIFT : case SDLK_RSHIFT : ret->vk=TCODK_SHIFT;break; + case SDLK_PRINTSCREEN : ret->vk=TCODK_PRINTSCREEN;break; + case SDLK_LEFT : ret->vk=TCODK_LEFT;break; + case SDLK_UP : ret->vk=TCODK_UP;break; + case SDLK_RIGHT : ret->vk=TCODK_RIGHT;break; + case SDLK_DOWN : ret->vk=TCODK_DOWN;break; + case SDLK_F1 : ret->vk=TCODK_F1;break; + case SDLK_F2 : ret->vk=TCODK_F2;break; + case SDLK_F3 : ret->vk=TCODK_F3;break; + case SDLK_F4 : ret->vk=TCODK_F4;break; + case SDLK_F5 : ret->vk=TCODK_F5;break; + case SDLK_F6 : ret->vk=TCODK_F6;break; + case SDLK_F7 : ret->vk=TCODK_F7;break; + case SDLK_F8 : ret->vk=TCODK_F8;break; + case SDLK_F9 : ret->vk=TCODK_F9;break; + case SDLK_F10 : ret->vk=TCODK_F10;break; + case SDLK_F11 : ret->vk=TCODK_F11;break; + case SDLK_F12 : ret->vk=TCODK_F12;break; + case SDLK_0 : ret->vk=TCODK_0;break; + case SDLK_1 : ret->vk=TCODK_1;break; + case SDLK_2 : ret->vk=TCODK_2;break; + case SDLK_3 : ret->vk=TCODK_3;break; + case SDLK_4 : ret->vk=TCODK_4;break; + case SDLK_5 : ret->vk=TCODK_5;break; + case SDLK_6 : ret->vk=TCODK_6;break; + case SDLK_7 : ret->vk=TCODK_7;break; + case SDLK_8 : ret->vk=TCODK_8;break; + case SDLK_9 : ret->vk=TCODK_9;break; + case SDLK_RGUI : ret->vk=TCODK_RWIN;break; + case SDLK_LGUI : ret->vk=TCODK_LWIN;break; + case SDLK_NUMLOCKCLEAR : ret->vk=TCODK_NUMLOCK;break; + case SDLK_KP_0 : ret->vk=TCODK_KP0;break; + case SDLK_KP_1 : ret->vk=TCODK_KP1;break; + case SDLK_KP_2 : ret->vk=TCODK_KP2;break; + case SDLK_KP_3 : ret->vk=TCODK_KP3;break; + case SDLK_KP_4 : ret->vk=TCODK_KP4;break; + case SDLK_KP_5 : ret->vk=TCODK_KP5;break; + case SDLK_KP_6 : ret->vk=TCODK_KP6;break; + case SDLK_KP_7 : ret->vk=TCODK_KP7;break; + case SDLK_KP_8 : ret->vk=TCODK_KP8;break; + case SDLK_KP_9 : ret->vk=TCODK_KP9;break; + case SDLK_KP_DIVIDE : ret->vk=TCODK_KPDIV;break; + case SDLK_KP_MULTIPLY : ret->vk=TCODK_KPMUL;break; + case SDLK_KP_PLUS : ret->vk=TCODK_KPADD;break; + case SDLK_KP_MINUS : ret->vk=TCODK_KPSUB;break; + case SDLK_KP_ENTER : ret->vk=TCODK_KPENTER;break; + case SDLK_KP_PERIOD : ret->vk=TCODK_KPDEC;break; + default : ret->vk=TCODK_CHAR; break; + } + +} +/** + * Parse an SDL key-up or key-down event and return the global key state. + */ +static TCOD_key_t TCOD_sys_SDLtoTCOD(const SDL_Event *ev, int flags) { + TCOD_key_t *ret = &TCOD_ctx.key_state; + ret->vk = TCODK_NONE; + ret->c = 0; + ret->pressed = 0; + switch (ev->type) { + case SDL_KEYUP: { + TCOD_key_t tmpkey; + switch(ev->key.keysym.sym) { + case SDLK_LALT: ret->lalt = 0; break; + case SDLK_RALT: ret->ralt = 0; break; + case SDLK_LCTRL: ret->lctrl = 0; break; + case SDLK_RCTRL: ret->rctrl = 0; break; + case SDLK_LSHIFT: ret->shift = 0; break; + case SDLK_RSHIFT: ret->shift = 0; break; + case SDLK_LGUI: ret->lmeta = 0; break; + case SDLK_RGUI: ret->rmeta = 0; break; + default: break; + } + TCOD_sys_convert_event(ev, &tmpkey); + key_status[tmpkey.vk] = false; + if (flags & TCOD_KEY_RELEASED) { + ret->vk = tmpkey.vk; + ret->c = tmpkey.c; + ret->pressed = 0; + } + break; + } + case SDL_KEYDOWN: { + TCOD_key_t tmpkey; + switch(ev->key.keysym.sym) { + case SDLK_LALT: ret->lalt = 1; break; + case SDLK_RALT: ret->ralt = 1; break; + case SDLK_LCTRL: ret->lctrl = 1; break; + case SDLK_RCTRL: ret->rctrl = 1; break; + case SDLK_LSHIFT: ret->shift = 1; break; + case SDLK_RSHIFT: ret->shift = 1; break; + case SDLK_LGUI: ret->lmeta = 1; break; + case SDLK_RGUI: ret->rmeta = 1; break; + default : break; + } + TCOD_sys_convert_event(ev, &tmpkey); + key_status[tmpkey.vk] = true; + if (flags & TCOD_KEY_PRESSED) { + ret->vk = tmpkey.vk; + ret->c = tmpkey.c; + ret->pressed = 1; + } + break; + } + } + return *ret; +} + +bool TCOD_sys_is_key_pressed(TCOD_keycode_t key) { + return key_status[key]; +} + +void TCOD_sys_unproject_screen_coords(int sx, int sy, int *ssx, int *ssy) { + if (scale_data.dst_display_width != 0 ) { + *ssx = (scale_data.src_x0 + ((sx - scale_data.dst_offset_x) * scale_data.src_copy_width) / scale_data.dst_display_width); + *ssy = (scale_data.src_y0 + ((sy - scale_data.dst_offset_y) * scale_data.src_copy_width) / scale_data.dst_display_width); + } else { + *ssx=sx - TCOD_ctx.fullscreen_offsetx; + *ssy=sy - TCOD_ctx.fullscreen_offsety; + } +} + +void TCOD_sys_convert_console_to_screen_coords(int cx, int cy, int *sx, int *sy) { + *sx = scale_data.dst_offset_x + ((cx * TCOD_ctx.font_width - scale_data.src_x0) * scale_data.dst_display_width) / scale_data.src_copy_width; + *sy = scale_data.dst_offset_y + ((cy * TCOD_ctx.font_height - scale_data.src_y0) * scale_data.dst_display_height) / scale_data.src_copy_height; +} + +void TCOD_sys_convert_screen_to_console_coords(int sx, int sy, int *cx, int *cy) { + int ssx, ssy; + TCOD_sys_unproject_screen_coords(sx, sy, &ssx, &ssy); + *cx = ssx / TCOD_ctx.font_width; + *cy = ssy / TCOD_ctx.font_height; +} +/** The global libtcod mouse state. */ +static TCOD_mouse_t tcod_mouse={0,0,0,0,0,0,0,0,false,false,false,false,false,false,false,false}; +/** + * Convert a pixel coordinate to a tile coordinate using global state. + */ +void TCOD_sys_pixel_to_tile(double* x, double* y) +{ + if (!x || !y) { return; } + if (TCOD_ctx.engine && TCOD_ctx.engine->pixel_to_tile_) { + TCOD_ctx.engine->pixel_to_tile_(TCOD_ctx.engine, x, y); + } else { + *x = (*x - TCOD_ctx.fullscreen_offsetx) / TCOD_ctx.font_width; + *y = (*y - TCOD_ctx.fullscreen_offsety) / TCOD_ctx.font_height; + } +} +/** + * Parse the coordinates and motion of an SDL event into a libtcod mouse + * struct. + */ +static void sdl_parse_mouse_(const SDL_Event* ev, TCOD_mouse_t* mouse) +{ + if (!ev || !mouse) { return; } + switch(ev->type) { + case SDL_MOUSEMOTION: + mouse->x = ev->motion.x; + mouse->y = ev->motion.y; + mouse->dx = ev->motion.xrel; + mouse->dy = ev->motion.yrel; + break; + case SDL_MOUSEWHEEL: + // Leave x,y attributes as is to preserve the original libtcod behaviour. + mouse->wheel_up = ev->wheel.y > 0; + mouse->wheel_down = ev->wheel.y < 0; + mouse->dx = mouse->dy = 0; + break; + case SDL_MOUSEBUTTONDOWN: + case SDL_MOUSEBUTTONUP: + mouse->x = ev->button.x; + mouse->y = ev->button.y; + mouse->dx = mouse->dy = 0; + break; + default: return; + } + if (TCOD_ctx.engine && TCOD_ctx.engine->pixel_to_tile_) { + double x = mouse->x; + double y = mouse->y; + TCOD_ctx.engine->pixel_to_tile_(TCOD_ctx.engine, &x, &y); + int cell_x = (int)x; + int cell_y = (int)y; + x = mouse->x - mouse->dx; + y = mouse->y - mouse->dy; + TCOD_ctx.engine->pixel_to_tile_(TCOD_ctx.engine, &x, &y); + int prev_cell_x = (int)x; + int prev_cell_y = (int)y; + mouse->cx = cell_x; + mouse->cy = cell_y; + mouse->dcx = cell_x - prev_cell_x; + mouse->dcy = cell_y - prev_cell_y; + } else { + mouse->cx = 0; + mouse->cy = 0; + mouse->dcx = 0; + mouse->dcy = 0; + } +} +/** + * Parse an SDL_Event into `mouse` and return the relevant TCOD_event_t. + * + * Returns 0 if the event wasn't mouse related. + */ +TCOD_event_t TCOD_sys_handle_mouse_event( + const SDL_Event* ev, TCOD_mouse_t* mouse) +{ + if (!ev) { return TCOD_EVENT_NONE; } + if (!mouse) { mouse = &tcod_mouse; } + sdl_parse_mouse_(ev, mouse); + switch(ev->type) { + case SDL_MOUSEMOTION: + return TCOD_EVENT_MOUSE_MOVE; + case SDL_MOUSEWHEEL: + return TCOD_EVENT_MOUSE_PRESS; + case SDL_MOUSEBUTTONDOWN: + switch (ev->button.button) { + case SDL_BUTTON_LEFT: mouse->lbutton = true; break; + case SDL_BUTTON_MIDDLE: mouse->mbutton = true; break; + case SDL_BUTTON_RIGHT: mouse->rbutton = true; break; + default: break; + } + return TCOD_EVENT_MOUSE_PRESS; + case SDL_MOUSEBUTTONUP: + switch (ev->button.button) { + case SDL_BUTTON_LEFT: + if (mouse->lbutton) { mouse->lbutton_pressed = true; } + mouse->lbutton = false; + break; + case SDL_BUTTON_MIDDLE: + if (mouse->mbutton) { mouse->mbutton_pressed = true; } + mouse->mbutton = false; + break; + case SDL_BUTTON_RIGHT: + if (mouse->rbutton) { mouse->rbutton_pressed = true; } + mouse->rbutton = false; + break; + } + return TCOD_EVENT_MOUSE_RELEASE; + default: + return TCOD_EVENT_NONE; + } +} +/** + * Parse an SDL_Event into `key` and return the relevant TCOD_event_t. + * + * Returns 0 if the event wasn't keyboard related. + */ +TCOD_event_t TCOD_sys_handle_key_event(const SDL_Event* ev, TCOD_key_t* key) +{ + if (!ev) { return TCOD_EVENT_NONE; } + if (!key) { key = &TCOD_ctx.key_state; } + switch(ev->type) { + case SDL_KEYDOWN: + *key = TCOD_sys_SDLtoTCOD(ev, TCOD_KEY_PRESSED); + return TCOD_EVENT_KEY_PRESS; + case SDL_KEYUP: + *key = TCOD_sys_SDLtoTCOD(ev, TCOD_KEY_RELEASED); + return TCOD_EVENT_KEY_RELEASE; + case SDL_TEXTINPUT: { + *key = TCOD_ctx.key_state; + key->vk = TCODK_TEXT; + key->c = 0; + key->pressed = 1; + strncpy(key->text, ev->text.text, TCOD_KEY_TEXT_SIZE); + return TCOD_EVENT_KEY_PRESS; + } + break; + default: + return TCOD_EVENT_NONE; + } +} +static TCOD_event_t TCOD_sys_handle_event( + SDL_Event *ev, TCOD_event_t eventMask, + TCOD_key_t *key, TCOD_mouse_t *mouse) +{ + int retMask = TCOD_EVENT_NONE; + /* printf("TCOD_sys_handle_event type=%04x\n", ev->type); */ + retMask |= TCOD_sys_handle_mouse_event(ev, mouse) & eventMask; + retMask |= TCOD_sys_handle_key_event(ev, key) & eventMask; + switch(ev->type) { + case SDL_QUIT : + TCOD_ctx.is_window_closed=true; + break; + case SDL_WINDOWEVENT : + /* At this point, there are some corner cases that need dealing with. So log this. */ + /* printf("SDL2 WINDOWEVENT: 0x%04x\n", ev->window.event); */ + switch (ev->window.event) { +#ifdef TCOD_ANDROID + case SDL_WINDOWEVENT_SIZE_CHANGED: + { + /* printf("SDL2 WINDOWEVENT (SDL_WINDOWEVENT_SIZE_CHANGED): 0x%04x w=%d h=%d\n", ev->window.event, ev->window.data1, ev->window.data2); */ + /* If the app is started while the device is locked, the screen will be in portrait mode. We need to rescale when it changes. */ + if (scale_data.surface_width != ev->window.data1 || scale_data.surface_height != ev->window.data1) + scale_data.force_recalc = 1; + break; + } +#endif + case SDL_WINDOWEVENT_ENTER: /**< Window has gained mouse focus */ + TCOD_ctx.app_has_mouse_focus=true; break; + case SDL_WINDOWEVENT_LEAVE: /**< Window has lost mouse focus */ + TCOD_ctx.app_has_mouse_focus=false; break; + case SDL_WINDOWEVENT_FOCUS_GAINED: + TCOD_ctx.app_is_active=true; break; + case SDL_WINDOWEVENT_FOCUS_LOST: + TCOD_ctx.app_is_active=false; break; + case SDL_WINDOWEVENT_EXPOSED: /**< Window has been returned to and needs a refresh. */ + break; +#ifdef NDEBUG_HMM + default: + TCOD_LOG(("SDL2 WINDOWEVENT (unknown): 0x%04x\n", ev->window.event)); + break; +#endif + } + break; + default : break; + } + return (TCOD_event_t)retMask; +} +/** + * Internal function containing code shared by TCOD_sys_wait_for_event + * and TCOD_sys_check_for_event + */ +static TCOD_event_t TCOD_sys_check_for_event_( + SDL_Event *ev, int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse) { + TCOD_event_t retMask = TCOD_EVENT_NONE; + tcod_mouse.lbutton_pressed = 0; + tcod_mouse.rbutton_pressed = 0; + tcod_mouse.mbutton_pressed = 0; + tcod_mouse.wheel_up = 0; + tcod_mouse.wheel_down = 0; + tcod_mouse.dx = 0; + tcod_mouse.dy = 0; + if (key) { + key->vk = TCODK_NONE; + key->c = 0; + key->text[0] = '\0'; + } + while (SDL_PollEvent(ev)) { + retMask = TCOD_sys_handle_event(ev, (TCOD_event_t)eventMask, + key, &tcod_mouse); + if (retMask & TCOD_EVENT_KEY) { + break; /* only one key event per frame */ + } + } + if (mouse) { *mouse = tcod_mouse; } + if (key && !(eventMask & retMask & TCOD_EVENT_KEY)) { + key->vk = TCODK_NONE; + key->c = 0; + key->text[0] = '\0'; + } + return retMask; +} +/** + * Wait for a specific type of event. + * + * \param eventMask A bit-mask of TCOD_event_t flags. + * \param key Optional pointer to a TCOD_key_t struct. + * \param mouse Optional pointer to a TCOD_mouse_t struct. + * \param flush This should always be false. + * \return A TCOD_event_t flag showing which event was actually processed. + * + * This function also returns when the SDL window is being closed. + */ +TCOD_event_t TCOD_sys_wait_for_event(int eventMask, TCOD_key_t *key, + TCOD_mouse_t *mouse, bool flush) { + SDL_Event ev; + TCOD_event_t retMask = TCOD_EVENT_NONE; + if (eventMask == 0) { return TCOD_EVENT_NONE; } + if (flush) { + while (SDL_PollEvent(NULL)) { + TCOD_sys_check_for_event_(&ev, 0, NULL, NULL); + } + } + do { + SDL_WaitEvent(NULL); + retMask = TCOD_sys_check_for_event_(&ev, eventMask, key, mouse); + } while (ev.type != SDL_QUIT && (retMask & eventMask) == 0); + return retMask; +} +/** + * Check for a specific type of event. + * + * \param eventMask A bit-mask of TCOD_event_t flags. + * \param key Optional pointer to a TCOD_key_t struct. + * \param mouse Optional pointer to a TCOD_mouse_t struct. + * \param flush This should always be false. + * \return A TCOD_event_t flag showing which event was actually processed. + */ +TCOD_event_t TCOD_sys_check_for_event( + int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse) { + SDL_Event ev; + return TCOD_sys_check_for_event_(&ev, eventMask, key, mouse); +} +/** + * Return a copy of the current mouse state. + */ +TCOD_mouse_t TCOD_mouse_get_status(void) { + return tcod_mouse; +} + +/* classic keyboard functions (based on generic events) */ +/** + * Return immediately with a recently pressed key. + * + * \param flags A TCOD_event_t bit-field, for example: `TCOD_EVENT_KEY_PRESS` + * \return A TCOD_key_t struct with a recently pressed key. + * If no event exists then the `vk` attribute will be `TCODK_NONE` + */ +TCOD_key_t TCOD_sys_check_for_keypress(int flags) { + TCOD_key_t key; + TCOD_event_t ev = TCOD_sys_check_for_event(flags & TCOD_EVENT_KEY, + &key, NULL); + if ((ev & TCOD_EVENT_KEY) == 0) { return (TCOD_key_t){0}; } + return key; +} +/** + * Wait for a key press event, then return it. + * + * \param flush If 1 then the event queue will be cleared before waiting for + * the next event. This should always be 0. + * \return A TCOD_key_t struct with the most recent key data. + */ +TCOD_key_t TCOD_sys_wait_for_keypress(bool flush) { + TCOD_key_t key; + TCOD_event_t ev = TCOD_sys_wait_for_event(TCOD_EVENT_KEY_PRESS, + &key, NULL, flush); + if ((ev & TCOD_EVENT_KEY_PRESS) == 0) { return (TCOD_key_t){0}; } + return key; +} + +void TCOD_sys_sleep_milli(uint32_t milliseconds) { + SDL_Delay(milliseconds); +} + +SDL_Surface* TCOD_sys_load_image(const char *filename) { + const image_support_t* img = image_type; + while (img->extension != NULL && !img->check_type(filename)) { img++; } + if (img->extension == NULL || img->read == NULL) { return NULL; } /* unknown format */ + return img->read(filename); +} + +void TCOD_sys_get_image_size(const SDL_Surface* image, int *w, int *h) +{ + *w = image->w; + *h = image->h; +} +TCOD_color_t TCOD_sys_get_image_pixel(const SDL_Surface* image, int x, int y) +{ + if (x < 0 || y < 0 || x >= image->w || y >= image->h) { return TCOD_black; } + uint8_t bpp = image->format->BytesPerPixel; + uint8_t* bits = image->pixels; + bits += y * image->pitch + x * bpp; + switch (bpp) { + case 1: + if (image->format->palette) { + SDL_Color col = image->format->palette->colors[(*bits)]; + return (TCOD_ColorRGB){col.r, col.g, col.b}; + } else { + return TCOD_black; + } + break; + default: + return (TCOD_ColorRGB){ + *((bits)+image->format->Rshift/8), + *((bits)+image->format->Gshift/8), + *((bits)+image->format->Bshift/8), + }; + } +} + +int TCOD_sys_get_image_alpha(const SDL_Surface *surf, int x, int y) +{ + if (x < 0 || y < 0 || x >= surf->w || y >= surf->h) { return 255; } + uint8_t bpp = surf->format->BytesPerPixel; + if (bpp != 4) { return 255; } + uint8_t* bits = surf->pixels; + bits += y * surf->pitch + x * bpp; + return bits[surf->format->Ashift / 8]; +} +uint32_t TCOD_sys_elapsed_milli(void) +{ + return SDL_GetTicks(); +} +float TCOD_sys_elapsed_seconds(void) +{ + static float div=1.0f / 1000.0f; + return SDL_GetTicks() * div; +} + +void TCOD_sys_force_fullscreen_resolution(int width, int height) { + TCOD_ctx.fullscreen_width=width; + TCOD_ctx.fullscreen_height=height; +} + +SDL_Surface* TCOD_sys_create_bitmap(int width, int height, TCOD_color_t *buf) +{ + int x,y; + SDL_PixelFormat fmt; + SDL_Surface *bitmap; + memset(&fmt,0,sizeof(SDL_PixelFormat)); + if ( charmap != NULL ) { + fmt = *charmap->format; + } else { + fmt.BitsPerPixel=24; + fmt.Amask=0; + if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) { + fmt.Rmask=0x0000FF; + fmt.Gmask=0x00FF00; + fmt.Bmask=0xFF0000; + } else { + fmt.Rmask=0xFF0000; + fmt.Gmask=0x00FF00; + fmt.Bmask=0x0000FF; + } + } + bitmap=SDL_CreateRGBSurface(SDL_SWSURFACE,width,height,fmt.BitsPerPixel,fmt.Rmask,fmt.Gmask,fmt.Bmask,fmt.Amask); + for (x=0; x < width; x++) { + for (y=0; y < height; y++) { + SDL_Rect rect; + uint32_t col=SDL_MapRGB(&fmt,buf[x+y*width].r,buf[x+y*width].g,buf[x+y*width].b); + rect.x=x; + rect.y=y; + rect.w=1; + rect.h=1; + SDL_FillRect(bitmap,&rect,col); + } + } + return bitmap; +} + +void TCOD_sys_delete_bitmap(SDL_Surface* bitmap) { + SDL_FreeSurface(bitmap); +} + +void TCOD_sys_set_fps(int val) { + if( val == 0 ) min_frame_length=0; + else min_frame_length=1000/val; +} + +void TCOD_sys_save_fps(void) { + min_frame_length_backup=min_frame_length; +} + +void TCOD_sys_restore_fps(void) { + min_frame_length=min_frame_length_backup; +} + +int TCOD_sys_get_fps(void) { + return fps; +} + +float TCOD_sys_get_last_frame_length(void) { + return last_frame_length; +} + +void TCOD_sys_get_char_size(int *w, int *h) { + if (TCOD_ctx.tileset) { + *w = TCOD_ctx.tileset->tile_width; + *h = TCOD_ctx.tileset->tile_height; + } else { + *w = TCOD_ctx.font_width; + *h = TCOD_ctx.font_height; + } +} + +void TCOD_sys_get_current_resolution(int *w, int *h) { + struct SDL_Window* window = TCOD_sys_get_sdl_window(); + if (!window) { return; } + SDL_GetWindowSize(window, w, h); +} + +/* image stuff */ +bool TCOD_sys_check_magic_number(const char *filename, size_t size, uint8_t*data) { + uint8_t tmp[128]; + size_t i; + SDL_RWops *rwops = SDL_RWFromFile(filename, "rb"); + if (!rwops) return false; + if ((i = rwops->read(rwops,tmp,size,1)) != 1) { + rwops->close(rwops); + return false; + } + rwops->close(rwops); + for (i = 0; i< size; i++) { + if (tmp[i] != data[i]) { return false; } + } + return true; +} + +SDL_Window* TCOD_sys_get_SDL_window(void) +{ + return TCOD_sys_get_sdl_window(); +} + +SDL_Renderer* TCOD_sys_get_SDL_renderer(void) +{ + return TCOD_sys_get_sdl_renderer(); +} + +/* mouse stuff */ +void TCOD_mouse_show_cursor(bool visible) { + SDL_ShowCursor(visible ? 1 : 0); +} + +bool TCOD_mouse_is_cursor_visible(void) { + return SDL_ShowCursor(-1) ? true : false; +} + +void TCOD_mouse_move(int x, int y) { + struct SDL_Window* window = TCOD_sys_get_sdl_window(); + if (!window) { return; } + SDL_WarpMouseInWindow(window, x, y); +} + +void TCOD_mouse_includes_touch(bool enable) +{ + (void)enable; +} + +/*clipboard stuff */ +bool TCOD_sys_clipboard_set(const char *text) { + return SDL_SetClipboardText(text) == 0; +} + +char *TCOD_sys_clipboard_get() { + /* + We hold onto the last clipboard text pointer SDL gave us. + For C API callers it can be considered a borrowed reference. + For Python ctypes API callers, the contents are copied into the Python string that is constructed from it. + */ + static char *last_clipboard_text = NULL; + static char BLANK[] = ""; + if (last_clipboard_text) { + SDL_free(last_clipboard_text); + } + last_clipboard_text = SDL_GetClipboardText(); + if (last_clipboard_text == NULL) { + last_clipboard_text = BLANK; + } + return last_clipboard_text; +} + +bool TCOD_sys_read_file(const char *filename, unsigned char **buf, size_t *size) +{ + /* get file size */ + SDL_RWops *rwops= SDL_RWFromFile(filename, "rb"); + if (!rwops) { return false; } + SDL_RWseek(rwops, 0, RW_SEEK_END); + size_t filesize = SDL_RWtell(rwops); + SDL_RWseek(rwops, 0, RW_SEEK_SET); + /* allocate buffer */ + *buf = (unsigned char*)malloc(sizeof(unsigned char) * filesize); + /* read from file */ + if (SDL_RWread(rwops, *buf, sizeof(unsigned char), filesize) != filesize) { + SDL_RWclose(rwops); + free(*buf); + return false; + } + SDL_RWclose(rwops); + *size=filesize; + return true; +} + +bool TCOD_sys_file_exists(const char * filename, ...) +{ + char f[1024]; + va_list ap; + va_start(ap, filename); + vsprintf(f, filename, ap); + va_end(ap); + SDL_RWops *rwops; + rwops = SDL_RWFromFile(f, "rb"); + if (rwops) { + SDL_RWclose(rwops); + return true; + } + return false; +} + +bool TCOD_sys_write_file(const char *filename, unsigned char *buf, uint32_t size) +{ + SDL_RWops *rwops= SDL_RWFromFile(filename, "wb"); + if (!rwops) { return false; } + SDL_RWwrite(rwops, buf, sizeof(unsigned char), size); + SDL_RWclose(rwops); + return true; +} diff --git a/tcod_sys/libtcod/src/libtcod/sys_sdl_img_bmp.c b/tcod_sys/libtcod/src/libtcod/sys_sdl_img_bmp.c new file mode 100644 index 000000000..654d2b9ae --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/sys_sdl_img_bmp.c @@ -0,0 +1,69 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "sys.h" + +#include + +#include "libtcod_int.h" +bool TCOD_sys_check_bmp(const char *filename) { + static uint8_t magic_number[]={0x42, 0x4d}; + return TCOD_sys_check_magic_number(filename,sizeof(magic_number),magic_number); +} + +SDL_Surface *TCOD_sys_read_bmp(const char *filename) { + SDL_Surface *ret=SDL_LoadBMP(filename); + if( !ret ) TCOD_fatal("SDL : %s",SDL_GetError()); + /* convert low color images to 24 bits */ + if ( ret->format->BytesPerPixel != 3 ) { + uint32_t rmask,gmask,bmask; + SDL_Surface * tmp; + if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) { + rmask=0xFF0000; + gmask=0x00FF00; + bmask=0x0000FF; + } else { + rmask=0x0000FF; + gmask=0x00FF00; + bmask=0xFF0000; + } + tmp=SDL_CreateRGBSurface(SDL_SWSURFACE,ret->w,ret->h,24, rmask, gmask, bmask, 0); + SDL_BlitSurface(ret,NULL,tmp,NULL); + SDL_FreeSurface(ret); + ret=tmp; + } + + return ret; +} + +void TCOD_sys_write_bmp(SDL_Surface *surf, const char *filename) { + SDL_SaveBMP(surf, filename); +} diff --git a/tcod_sys/libtcod/src/libtcod/sys_sdl_img_png.c b/tcod_sys/libtcod/src/libtcod/sys_sdl_img_png.c new file mode 100644 index 000000000..99126600f --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/sys_sdl_img_png.c @@ -0,0 +1,127 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "sys.h" + +#if !defined (__HAIKU__) && !defined (__ANDROID__) +#include +#include +#endif + +#include +#include "../vendor/lodepng.h" + +#include "libtcod_int.h" +bool TCOD_sys_check_png(const char *filename) { + static uint8_t magic_number[]={137, 80, 78, 71, 13, 10, 26, 10}; + return TCOD_sys_check_magic_number(filename,sizeof(magic_number),magic_number); +} + +SDL_Surface *TCOD_sys_read_png(const char *filename) { + unsigned error; + unsigned char* image; + unsigned width, height, y, bpp; + unsigned char* png; + size_t pngsize; + LodePNGState state; + SDL_Surface *bitmap; + unsigned char *source; + unsigned int rowsize; + + lodepng_state_init(&state); + /*optionally customize the state*/ + if (!TCOD_sys_read_file(filename,&png,&pngsize)) return NULL; + + lodepng_inspect(&width,&height,&state, png, pngsize); + bpp=lodepng_get_bpp(&state.info_png.color); + + if ( bpp == 24 ) { + /* don't convert to 32 bits because libtcod's 24bits renderer is faster */ + state.info_raw.colortype=LCT_RGB; + } else if ( bpp != 24 && bpp != 32 ) { + /* paletted png. convert to 24 bits */ + state.info_raw.colortype=LCT_RGB; + state.info_raw.bitdepth=8; + bpp=24; + } + error = lodepng_decode(&image, &width, &height, &state, png, pngsize); + free(png); + if(error) { + printf("error %u: %s\n", error, lodepng_error_text(error)); + lodepng_state_cleanup(&state); + return NULL; + } + + /* create the SDL surface */ + if (bpp == 32) { + bitmap = SDL_CreateRGBSurfaceWithFormat(0, width, height, 32, SDL_PIXELFORMAT_RGBA32); + } else { + bitmap = SDL_CreateRGBSurfaceWithFormat(0, width, height, 24, SDL_PIXELFORMAT_RGB24); + } + source=image; + rowsize=width*bpp/8; + for (y=0; y< height; y++ ) { + uint8_t* row_pointer = (uint8_t*)bitmap->pixels + y * bitmap->pitch; + memcpy(row_pointer,source,rowsize); + source+=rowsize; + } + + lodepng_state_cleanup(&state); + free(image); + return bitmap; +} + +void TCOD_sys_write_png(SDL_Surface *surf, const char *filename) { + unsigned char *image, *dest = malloc(surf->h * surf->w * 3 * sizeof(*dest)); + int x,y; + unsigned char *buf; + size_t size; + int error; + /* SDL uses 32bits format without alpha layer for screen. convert it to 24 bits */ + image=dest; + for (y=0; y< surf->h; y++ ) { + for (x=0; x < surf->w; x++ ) { + uint8_t* pixel = (uint8_t*)surf->pixels + + y * surf->pitch + x * surf->format->BytesPerPixel; + *dest++=*((pixel)+surf->format->Rshift/8); + *dest++=*((pixel)+surf->format->Gshift/8); + *dest++=*((pixel)+surf->format->Bshift/8); + } + } + error=lodepng_encode_memory(&buf,&size,image,surf->w,surf->h,LCT_RGB,8); + free(image); + if ( ! error ) { + TCOD_sys_write_file(filename, buf, (uint32_t)size); + free(buf); + } else { + printf("error %u: %s\n", error, lodepng_error_text(error)); + } +} diff --git a/tcod_sys/libtcod/src/libtcod/tileset.c b/tcod_sys/libtcod/src/libtcod/tileset.c new file mode 100644 index 000000000..f398b3aba --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/tileset.c @@ -0,0 +1,396 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "tileset.h" + +#include "stdbool.h" +#include "stdlib.h" +#include "string.h" + +#include "../vendor/lodepng.h" + +#include "color.h" + +// Starting sizes of arrays: +#define DEFAULT_TILES_LENGTH 256 +#define DEFAULT_CHARMAP_LENGTH 256 + +TCOD_Tileset* TCOD_tileset_new(int tile_width, int tile_height) +{ + TCOD_Tileset* tileset = calloc(sizeof(*tileset), 1); + if (!tileset) { return NULL; } + ++tileset->ref_count; + tileset->tile_width = tile_width; + tileset->tile_height = tile_height; + tileset->tile_length = tile_width * tile_height; + tileset->virtual_columns = 1; + return tileset; +} +void TCOD_tileset_delete(TCOD_Tileset* tileset) +{ + if (!tileset) { return; } + if (--tileset->ref_count != 0) { return; } + while (tileset->observer_list) { + TCOD_tileset_observer_delete(tileset->observer_list); + } + free(tileset->pixels); + free(tileset->character_map); + free(tileset); +} +struct TCOD_TilesetObserver* TCOD_tileset_observer_new( + struct TCOD_Tileset* tileset) +{ + if (!tileset) { return NULL; } + struct TCOD_TilesetObserver* observer = calloc(sizeof(*observer), 1); + observer->tileset = tileset; + observer->next = tileset->observer_list; + tileset->observer_list = observer; + return observer; +} +void TCOD_tileset_observer_delete(struct TCOD_TilesetObserver* observer) +{ + if (!observer) { return; } + for (struct TCOD_TilesetObserver** it = &observer->tileset->observer_list; + *it; it = &(*it)->next) { + if (*it != observer) { continue; } + *it = observer->next; + if (observer->on_observer_delete) { + observer->on_observer_delete(observer); + } + free(observer); + return; + } + return; +} +int TCOD_tileset_get_tile_width_(const TCOD_Tileset* tileset) +{ + return tileset ? tileset->tile_width : 0; +} +int TCOD_tileset_get_tile_height_(const TCOD_Tileset* tileset) +{ + return tileset ? tileset->tile_height : 0; +} +/** + * Reserve memory for the character mapping array. + */ +TCOD_NODISCARD +static TCOD_Error TCOD_tileset_charmap_reserve(TCOD_Tileset* tileset, int want) +{ + if (!tileset) { + TCOD_set_errorv("Tileset argument must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + if (want < 0) { + TCOD_set_errorv("Can not take a negative number."); + return TCOD_E_INVALID_ARGUMENT; + } + if (want <= tileset->character_map_length) { + return TCOD_E_OK; + } + int new_length = tileset->character_map_length; + if (new_length == 0) { new_length = DEFAULT_CHARMAP_LENGTH; } + while (want > new_length) { new_length *= 2; } + int* new_charmap = realloc( + tileset->character_map, sizeof(int) * new_length); + if (!new_charmap) { + TCOD_set_errorv("Could not allocate enough memory for the tileset."); + return TCOD_E_OUT_OF_MEMORY; + } + for (int i = tileset->character_map_length; i < new_length; ++i) { + new_charmap[i] = 0; + } + tileset->character_map_length = new_length; + tileset->character_map = new_charmap; + return TCOD_E_OK; +} +TCOD_Error TCOD_tileset_reserve(TCOD_Tileset* tileset, int want) +{ + if (!tileset) { + TCOD_set_errorv("Tileset argument must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + if (want < 0) { + TCOD_set_errorv("Can not take a negative number."); + return TCOD_E_INVALID_ARGUMENT; + } + if (want <= tileset->tiles_capacity) { + return TCOD_E_OK; + } + int new_capacity = tileset->tiles_capacity * 2; + if (new_capacity == 0) { new_capacity = DEFAULT_TILES_LENGTH; } + if (new_capacity < want) { new_capacity = want; } + struct TCOD_ColorRGBA* new_pixels = realloc( + tileset->pixels, + sizeof(tileset->pixels[0]) * new_capacity * tileset->tile_length); + if (!new_pixels) { + TCOD_set_errorv("Could not allocate enough memory for the tileset."); + return TCOD_E_OUT_OF_MEMORY; + } + for (int i = tileset->tiles_capacity * tileset->tile_length; + i < new_capacity * tileset->tile_length; ++i) { + // Clear allocated tiles. + new_pixels[i] = (struct TCOD_ColorRGBA){0, 0, 0, 0}; + } + tileset->tiles_capacity = new_capacity; + tileset->pixels = new_pixels; + if (tileset->tiles_count == 0) { + tileset->tiles_count = 1; // Keep tile at zero blank. + } + return TCOD_E_OK; +} +/** + * Return the tile ID that `codepoint` is assigned to. + * + * Returns 0 for unassigned codepoints. + */ +static int TCOD_tileset_get_tile_id( + const TCOD_Tileset* tileset, int codepoint) +{ + if (!tileset) { return 0; } + if (codepoint < 0 || codepoint >= tileset->character_map_length) { + return 0; + } + return tileset->character_map[codepoint]; +} +int TCOD_tileset_assign_tile( + struct TCOD_Tileset* tileset, int tile_id, int codepoint) +{ + if (tile_id < 0 || tile_id >= tileset->tiles_count) { + TCOD_set_errorv("Tile_ID is out of bounds."); + return TCOD_E_INVALID_ARGUMENT; + } + if (codepoint < 0) { + TCOD_set_errorv("Codepoint argument can not be negative."); + return TCOD_E_INVALID_ARGUMENT; + } + TCOD_Error err = TCOD_tileset_charmap_reserve(tileset, codepoint + 1); + if (err < 0) { return err; } + tileset->character_map[codepoint] = tile_id; + return tile_id; +} +/** + * Reserve space for an additional tile and return its ID. + * + * Returns a negative value on error. + */ +static int TCOD_tileset_generate_tile(struct TCOD_Tileset* tileset) +{ + TCOD_Error err = TCOD_tileset_reserve(tileset, tileset->tiles_count + 1); + if (err){ return err; } + return tileset->tiles_count++; +} +/** + * Ensure a tile exists for a codepoint and return its ID. + * + * If `codepoint` is zero then this is the same as + * `TCOD_tileset_generate_tile`. + * + * Returns a negative value on error. + */ +static int TCOD_tileset_generate_codepoint(struct TCOD_Tileset* tileset, + int codepoint) +{ + int tile_id = TCOD_tileset_get_tile_id(tileset, codepoint); + if (tile_id != 0) { return tile_id; } + tile_id = TCOD_tileset_generate_tile(tileset); + if (tile_id < 0) { return tile_id; } + return TCOD_tileset_assign_tile(tileset, tile_id, codepoint); +} +const struct TCOD_ColorRGBA* TCOD_tileset_get_tile( + const TCOD_Tileset* tileset, + int codepoint) +{ + if (!tileset) { return NULL; } + int tile_id = TCOD_tileset_get_tile_id(tileset, codepoint); + if (tile_id < 0) { + return NULL; // No tile for the given codepoint in this tileset. + } + return tileset->pixels + tileset->tile_length * tile_id; +} +TCOD_Error TCOD_tileset_get_tile_( + const TCOD_Tileset* tileset, + int codepoint, + struct TCOD_ColorRGBA* buffer) +{ + if (!tileset) { + TCOD_set_errorv("Tileset argument must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + const struct TCOD_ColorRGBA* tile = + TCOD_tileset_get_tile(tileset, codepoint); + if (!tile) { + TCOD_set_errorvf("Codepoint %i is not assigned to a tile in this tileset.", + codepoint); + return TCOD_E_INVALID_ARGUMENT; + } + if (!buffer) { + return TCOD_E_OK; // buffer is NULL, just return an OK status. + } + memcpy(buffer, tile, sizeof(*tile) * tileset->tile_length); + return TCOD_E_OK; // Tile exists and was copied to buffer. +} +void TCOD_tileset_notify_tile_changed(TCOD_Tileset* tileset, int tile_id) +{ + for (struct TCOD_TilesetObserver* it = tileset->observer_list; + it; it = it->next) { + if (it->on_tile_changed) { + it->on_tile_changed(it, tile_id); + } + } +} +static TCOD_Error TCOD_tileset_set_tile_rgba( + TCOD_Tileset* tileset, int codepoint, const void* pixels, int stride) +{ + int tile_id = TCOD_tileset_generate_codepoint(tileset, codepoint); + if (!pixels) { + TCOD_set_errorv("Pixels argument must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + if (tile_id < 0) { return (TCOD_Error)tile_id; } + for (int y = 0; y < tileset->tile_height; ++y) { + const char* ptr_in = pixels; + const struct TCOD_ColorRGBA* row_in = (const void*)(ptr_in + y * stride); + for (int x = 0; x < tileset->tile_width; ++x) { + tileset->pixels[ + tile_id * tileset->tile_length + y * tileset->tile_width + x + ] = row_in[x]; + } + } + TCOD_tileset_notify_tile_changed(tileset, tile_id); + return TCOD_E_OK; +} +TCOD_Error TCOD_tileset_set_tile_( + TCOD_Tileset* tileset, + int codepoint, + const struct TCOD_ColorRGBA* buffer) +{ + if (!tileset) { + TCOD_set_errorv("Tileset argument must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + return TCOD_tileset_set_tile_rgba(tileset, codepoint, buffer, + sizeof(*buffer) * tileset->tile_width); +} +static void upload_tile_by_id_normalized( + TCOD_Tileset* tileset, int tile_id, const void* pixels, int stride, + const struct TCOD_ColorRGBA* color_key) +{ + // Analyse this tiles traits. + bool has_color = false; + bool has_alpha = false; + for (int y = 0; y < tileset->tile_height; ++y) { + for (int x = 0; x < tileset->tile_width; ++x) { + const struct TCOD_ColorRGBA pixel = + ((struct TCOD_ColorRGBA*)((char*)pixels + y * stride))[x]; + if (pixel.a != 255) { has_alpha = true; } + if (pixel.r != pixel.g || pixel.r != pixel.b) { has_color = true; } + } + } + // Normalize and copy the tile. + for (int y = 0; y < tileset->tile_height; ++y) { + for (int x = 0; x < tileset->tile_width; ++x) { + struct TCOD_ColorRGBA pixel = + ((struct TCOD_ColorRGBA*)((char*)pixels + y * stride))[x]; + // Convert any grey-scale tiles to white-with-alpha. + if (!has_color && !has_alpha) { + pixel.a = pixel.r; + pixel.r = pixel.g = pixel.b = 0xff; + } + // Set key-color pixels to zero. + if (color_key && color_key->r == pixel.r && color_key->g == pixel.g + && color_key->b == pixel.b && color_key->a == pixel.a) { + pixel.r = pixel.g = pixel.b = pixel.a = 0; + } + tileset->pixels[tile_id * tileset->tile_length + + y * tileset->tile_width + x] = pixel; + } + } +} +TCOD_Tileset* TCOD_tileset_load( + const char* filename, int columns, int rows, int n, int* charmap) +{ + int font_tiles = columns * rows; + struct TCOD_ColorRGBA* font; + unsigned int font_width; + unsigned int font_height; + unsigned int lodepng_err; + lodepng_err = lodepng_decode32_file((unsigned char**)&font, + &font_width, &font_height, filename); + if (lodepng_err) { + TCOD_set_errorvf("Error loading font image:\n%s", + lodepng_error_text(lodepng_err)); + return NULL; // Error decoding file. + } + TCOD_Tileset* tileset = + TCOD_tileset_new(font_width / columns, font_height / rows); + if (!tileset) { free(font); return NULL; } + if (TCOD_tileset_reserve(tileset, font_tiles) < 0) { + TCOD_tileset_delete(NULL); + free(font); + return NULL; + } + tileset->tiles_count = font_tiles; + tileset->virtual_columns = columns; + // Check for a color key in the first tile. + struct TCOD_ColorRGBA* color_key = &font[0]; + for (int y = 0; y < tileset->tile_height; ++y) { + for (int x = 0; x < tileset->tile_width; ++x) { + struct TCOD_ColorRGBA pixel = font[y * font_width + x]; + if (color_key && ( + pixel.r != color_key->r || pixel.g != color_key->g + || pixel.b != color_key->b || pixel.a != color_key->a)) { + color_key = NULL; + } + } + } + for (int tile_id = 0; tile_id < font_tiles; ++tile_id) { + int font_x = tile_id % columns; + int font_y = tile_id / columns; + upload_tile_by_id_normalized( + tileset, + tile_id, + (font + + font_y * columns * tileset->tile_length + + font_x * tileset->tile_width), + sizeof(*font) * font_width, + color_key); + } + free(font); + if (!charmap) { n = font_tiles; } + for (int i = 0; i < n; ++i) { + int codepoint = charmap ? charmap[i] : i; + if (TCOD_tileset_assign_tile(tileset, i, codepoint) < 0) { + TCOD_tileset_delete(tileset); + return NULL; + } + } + return tileset; +} diff --git a/tcod_sys/libtcod/src/libtcod/tileset.h b/tcod_sys/libtcod/src/libtcod/tileset.h new file mode 100644 index 000000000..d0b54d9a1 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/tileset.h @@ -0,0 +1,188 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_TILESET_H_ +#define LIBTCOD_TILESET_H_ +#ifdef __cplusplus +#include +#endif // __cplusplus +#include "config.h" +#include "error.h" +#include "color.h" +struct TCOD_Tileset; +struct TCOD_TilesetObserver { + struct TCOD_Tileset* tileset; + struct TCOD_TilesetObserver* next; + void* userdata; + void (*on_observer_delete)(struct TCOD_TilesetObserver* observer); + int (*on_tile_changed)(struct TCOD_TilesetObserver* observer, int tile_id); +}; +struct TCOD_Tileset { + int tile_width; + int tile_height; + int tile_length; + int tiles_capacity; + int tiles_count; + struct TCOD_ColorRGBA* pixels; + int character_map_length; + int* character_map; + struct TCOD_TilesetObserver* observer_list; + int virtual_columns; + volatile int ref_count; +}; +typedef struct TCOD_Tileset TCOD_Tileset; +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +/** + * Create a new tile-set with the given tile size. + */ +TCOD_NODISCARD +TCOD_PUBLIC TCOD_Tileset* TCOD_tileset_new(int tile_width, int tile_height); +/** + * Delete a tile-set. + */ +TCOD_PUBLIC void TCOD_tileset_delete(TCOD_Tileset* tileset); +/** + * Return the pixel width of tiles in this tileset. + * + * The tileset functions are provisional, the API may change in the future. + */ +TCOD_NODISCARD +TCOD_PUBLIC int TCOD_tileset_get_tile_width_(const TCOD_Tileset* tileset); +/** + * Return the pixel height of tiles in this tileset. + * + * The tileset functions are provisional, the API may change in the future. + */ +TCOD_NODISCARD +TCOD_PUBLIC int TCOD_tileset_get_tile_height_(const TCOD_Tileset* tileset); +/** + * Fetch a tile, outputting its data to a pixel buffer. + * + * `codepoint` is the index for the tile. Unicode is recommend. + * + * `buffer` is a pointer to a contiguous row-major array of pixels. The tile + * data will be outputted here. This pointer can be NULL if you only want to + * know if the tileset has a specific tile. + * + * Returns 0 if the tile exists. Returns a negative value on an error or if + * the tileset does not have a tile for this codepoint. + * + * The tileset functions are provisional, the API may change in the future. + */ +TCOD_NODISCARD +TCOD_PUBLIC TCOD_Error TCOD_tileset_get_tile_( + const TCOD_Tileset* tileset, + int codepoint, + struct TCOD_ColorRGBA* buffer); +/** + * Upload a tile from a pixel buffer into this tileset. + * + * `codepoint` is the index for the tile. Unicode is recommend. + * + * `buffer` is a pointer to a contiguous row-major array of pixels. + * This can not be NULL. + * + * The tileset functions are provisional, the API may change in the future. + */ +TCOD_NODISCARD +TCOD_PUBLIC TCOD_Error TCOD_tileset_set_tile_( + TCOD_Tileset* tileset, + int codepoint, + const struct TCOD_ColorRGBA* buffer); +/** + * Load a font from a tilesheet. + */ +TCOD_NODISCARD +TCOD_PUBLIC TCOD_Tileset* TCOD_tileset_load( + const char* filename, int columns, int rows, int n, int* charmap); +/** + * Assign a codepoint to an existing tile based on its tile ID. + * + * Returns the tile ID on success. + * + * Returns a negative value on error. + */ +TCOD_NODISCARD +TCOD_PUBLIC int TCOD_tileset_assign_tile( + struct TCOD_Tileset* tileset, int tile_id, int codepoint); +/** + * Return a pointer to the tile for `codepoint`. + * + * Returns NULL if no tile exists for codepoint. + */ +TCOD_NODISCARD +TCOD_PUBLIC const struct TCOD_ColorRGBA* TCOD_tileset_get_tile( + const TCOD_Tileset* tileset, int codepoint); +/** + * Return a new observer to this tileset. + * + * For internal use. + */ +TCOD_NODISCARD +struct TCOD_TilesetObserver* TCOD_tileset_observer_new( + struct TCOD_Tileset* tileset); +/** + * Delete an existing observer. + * + * Will call this observers on_observer_delete callback. + * + * For internal use. + */ +void TCOD_tileset_observer_delete( + struct TCOD_TilesetObserver* observer); +/** + * Called to notify any observers that a tile has been changed. This may + * cause running atlases to update or mark cache consoles as dirty. + * + * For internal use. + */ +void TCOD_tileset_notify_tile_changed(TCOD_Tileset* tileset, int tile_id); +/** + * Reserve memory for a specific amount of tiles. + * + * For internal use. + */ +TCOD_NODISCARD +TCOD_Error TCOD_tileset_reserve(TCOD_Tileset* tileset, int desired); +#ifdef __cplusplus +} // extern "C" +namespace tcod { +struct TilesetDeleter { + void operator()(TCOD_Tileset* tileset) const { + TCOD_tileset_delete(tileset); + } +}; +typedef std::unique_ptr TilesetPtr; +} // namespace tcod +#endif // __cplusplus +#endif /* LIBTCOD_TILESET_TILESET_H_ */ diff --git a/tcod_sys/libtcod/src/libtcod/tileset_bdf.c b/tcod_sys/libtcod/src/libtcod/tileset_bdf.c new file mode 100644 index 000000000..1dea949bd --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/tileset_bdf.c @@ -0,0 +1,349 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "tileset_bdf.h" + +#include +#include +#include +#include +#include +#include + +#include "error.h" +/** + Load a file into memory. Returns NULL on failure. + + The returned buffer must be freed by the caller. + */ +TCOD_NODISCARD +static unsigned char* load_binary_file(const char* path, long int* size) { + if (!path) { TCOD_set_errorv("Given path was NULL."); return NULL; } + FILE* file = fopen(path, "rb"); + if (!file) { + TCOD_set_errorvf("Could not open file:\n%s", path); + return NULL; + } + fseek(file, 0, SEEK_END); + long int fsize = ftell(file); + fseek(file, 0, SEEK_SET); + unsigned char *buffer = malloc(fsize); + if (!buffer) { + TCOD_set_errorvf("Could not allocate %ld bytes for file.", fsize); + } + fread(buffer, 1, fsize, file); + fclose(file); + if (size) { *size = fsize; } + return buffer; +} +TCOD_Tileset* TCOD_load_bdf(const char* path) +{ + long int fsize; + unsigned char* buffer = load_binary_file(path, &fsize); + if (!buffer) { return NULL; } + TCOD_Tileset* tileset = TCOD_load_bdf_memory((int)fsize, buffer); + free(buffer); + return tileset; +} +struct BBox { + int width; + int height; + int xoffset; + int yoffset; +}; +struct BDFLoader { + /** The BDF data for this loader. */ + const char* const buffer; + /** A pointer to the end of buffer. */ + const char* const end; + /** The current position of the BDF parser. */ + const char* cursor; + /** The current line number under the cursor. */ + int line_number; + /** The tileset being setup by this loader. */ + TCOD_Tileset* tileset; + /** Font bounding box. */ + struct BBox bbox; +}; +/** + Check for a keyword. + + Return 0 and move the cursor past the keyword if it is found. + + Otherwise return -1 and do nothing. + */ +static int check_keyword(struct BDFLoader* loader, const char* keyword) +{ + ptrdiff_t key_length = (ptrdiff_t)strlen(keyword); + if (loader->end - loader->cursor < key_length) { return -1; } + if (strncmp(loader->cursor, keyword, (size_t)key_length) != 0) { + return -1; // No match. + } + if (!(loader->end - loader->cursor == key_length + || loader->cursor[key_length] == ' ' + || loader->cursor[key_length] == '\r' + || loader->cursor[key_length] == '\n')) { + return -1; + } + loader->cursor += key_length; + while (loader->cursor < loader->end && loader->cursor[0] == ' ') { + ++loader->cursor; + } + return 0; +} +/** + Advance the cursor to the next line. Returns -1 on error. + */ +static int goto_next_line(struct BDFLoader* loader) +{ + bool end_found = false; + while (loader->cursor < loader->end) { + if (loader->cursor[0] == '\r') { + ++loader->cursor; + end_found = true; + } + if (loader->cursor[0] == '\n') { + ++loader->cursor; + end_found = true; + } + if (end_found) { + ++loader->line_number; + return 0; + } + ++loader->cursor; + } + TCOD_set_errorv("Unexpected end of data stream."); + return -1; +} +/** + Return a number under the cursor and advance. + + This doesn't have any error handing currently. + */ +static int read_next_int(struct BDFLoader* loader) +{ + long int number = strtol(loader->cursor, (char**)&loader->cursor, 0); + return (int)number; +} +/** + Read the next two hexadecimal numbers in a bitmap line. + + Returns a byte in the uint8_t range or -1 on failure. + */ +static int read_next_bitmap_byte(struct BDFLoader* loader) +{ + if (loader->end - loader->cursor < 2) { return -1; } + // Fetch and verify the hexadecimal data so that strtoul can't fail. + char hexstring[3] = {loader->cursor[0], loader->cursor[1], 0}; + if (!isxdigit((int)hexstring[0]) || !isxdigit((int)hexstring[1])) { + TCOD_set_errorvf("Failed to unpack bitmap on line %d", loader->line_number); + return -1; + } + loader->cursor += 2; + return (int)strtoul(hexstring, NULL, 16); +} +/** + Handle BITMAP, parse the bitmap data into a tile for the tileset. + */ +static int parse_bitmap( + struct BDFLoader* loader, int codepoint, struct BBox* glyph_bbox) { + int offset_x = -loader->bbox.xoffset + glyph_bbox->xoffset; + int offset_y = (loader->bbox.height - glyph_bbox->height + + loader->bbox.yoffset - glyph_bbox->yoffset); + TCOD_ColorRGBA* pixels = malloc(loader->tileset->tile_length * sizeof(*pixels)); + for (int i = 0; i < loader->tileset->tile_length; ++i) { + pixels[i] = (TCOD_ColorRGBA){255, 255, 255, 0}; + } + for (int bitmap_y = 0; bitmap_y < glyph_bbox->height; ++bitmap_y) { + goto_next_line(loader); + int bitmask = 0; + for (int bitmap_x = 0; bitmap_x < glyph_bbox->width; ++bitmap_x) { + if (bitmap_x % 8 == 0) { + bitmask = read_next_bitmap_byte(loader); + if (bitmask < 0) { return -1; } + } + bool bit = bitmask & (1 << (7 - bitmap_x % 8)); + int target_x = bitmap_x + offset_x; + int target_y = bitmap_y + offset_y; + if (0 <= target_x && target_x < loader->tileset->tile_width && + 0 <= target_y && target_y < loader->tileset->tile_height) { + pixels[target_y * loader->tileset->tile_width + target_x].a = bit * 255; + } + } + } + int err = 0; + if (codepoint >= 0) { // Ignore "ENCODING -1". + err = TCOD_tileset_set_tile_(loader->tileset, codepoint, pixels); + } + free(pixels); + return err; +} +/** + Handle STARCHAR. + */ +static int parse_char(struct BDFLoader* loader) +{ + int codepoint = 0; + struct BBox glyph_bbox = {0, 0, 0, 0}; + while (goto_next_line(loader) == 0) { + if (check_keyword(loader, "ENDCHAR") == 0) { + return 0; + } else if (check_keyword(loader, "ENCODING") == 0) { + codepoint = read_next_int(loader); + } else if (check_keyword(loader, "BBX") == 0) { + glyph_bbox.width = read_next_int(loader); + glyph_bbox.height = read_next_int(loader); + glyph_bbox.xoffset = read_next_int(loader); + glyph_bbox.yoffset = read_next_int(loader); + } else if (check_keyword(loader, "BITMAP") == 0) { + if (parse_bitmap(loader, codepoint, &glyph_bbox) < 0) { return -1; } + } else if (check_keyword(loader, "SWIDTH") == 0) { + // Ignore. + } else if (check_keyword(loader, "DWIDTH") == 0) { + // Ignore. + } else if (check_keyword(loader, "SWIDTH1") == 0) { + // Ignore. + } else if (check_keyword(loader, "DWIDTH1") == 0) { + // Ignore. + } else if (check_keyword(loader, "VVECTOR") == 0) { + // Ignore. + } else { + TCOD_set_errorvf("Unknown keyword on line %d", loader->line_number); + return -1; + } + } + TCOD_set_errorv("Unexpected end of data stream."); + return -1; +} +/** + Handle CHARS, start converting bitmaps into tiles. + */ +static int parse_bdf_chars(struct BDFLoader* loader) +{ + if (!loader->tileset) { + TCOD_set_errorv("Missing FONTBOUNDINGBOX keyword."); + return -1; + } + int font_glyphs = read_next_int(loader); + int processed_glyphs = 0; + while (goto_next_line(loader) == 0) { + if (check_keyword(loader, "ENDFONT") == 0) { + if (font_glyphs != processed_glyphs) { + TCOD_set_errorvf("Expected %d glyphs, but processed %d.", + font_glyphs, processed_glyphs); + return -1; + } + return 0; + } else if (check_keyword(loader, "STARTCHAR") == 0) { + if (parse_char(loader) < 0) { return -1; } + ++processed_glyphs; + } else { + TCOD_set_errorvf("Unknown keyword on line %d", loader->line_number); + return -1; + } + } + TCOD_set_errorv("Unexpected end of data stream."); + return -1; +} +/** + Begins parsing the BDF data. + */ +static int parse_bdf(struct BDFLoader* loader) +{ + if (check_keyword(loader, "STARTFONT") < 0) { + TCOD_set_errorv("Could not find STARTFONT keyword in BDF file."); + return -1; + } + while (goto_next_line(loader) == 0) { + if (check_keyword(loader, "COMMENT") == 0) { + // Ignore. + } else if (check_keyword(loader, "CONTENTVERSION") == 0) { + // Ignore. + } else if (check_keyword(loader, "FONT") == 0) { + // Ignore. + } else if (check_keyword(loader, "SIZE") == 0) { + // Ignore. + } else if (check_keyword(loader, "FONTBOUNDINGBOX") == 0) { + if (loader->tileset) { + TCOD_set_errorv("Invalid multiple FONTBOUNDINGBOX keywords found."); + return -1; + } + loader->bbox.width = read_next_int(loader); + loader->bbox.height = read_next_int(loader); + loader->bbox.xoffset = read_next_int(loader); + loader->bbox.yoffset = read_next_int(loader); + loader->tileset = TCOD_tileset_new(loader->bbox.width, loader->bbox.height); + if (!loader->tileset) { return -1; } + } else if (check_keyword(loader, "METRICSSET") == 0) { + // Ignore. + } else if (check_keyword(loader, "STARTPROPERTIES") == 0) { + int n_properties = read_next_int(loader); + goto_next_line(loader); + while (n_properties--) { goto_next_line(loader); } + if (check_keyword(loader, "ENDPROPERTIES") < 0) { + TCOD_set_errorv("Incorrect number of properties."); + return -1; + } + } else if (check_keyword(loader, "CHARS") == 0) { + return parse_bdf_chars(loader); + } else if (check_keyword(loader, "SWIDTH") == 0) { + // Ignore. + } else if (check_keyword(loader, "DWIDTH") == 0) { + // Ignore. + } else if (check_keyword(loader, "SWIDTH1") == 0) { + // Ignore. + } else if (check_keyword(loader, "DWIDTH1") == 0) { + // Ignore. + } else if (check_keyword(loader, "VVECTOR") == 0) { + // Ignore. + } else { + TCOD_set_errorvf("Unknown keyword on line %d", loader->line_number); + return -1; + } + } + TCOD_set_errorv("Unexpected end of data stream."); + return -1; +} +TCOD_Tileset* TCOD_load_bdf_memory(int size, const unsigned char* buffer) +{ + struct BDFLoader loader = { + .buffer = (const char*)buffer, + .end = (const char*)buffer + size, + .cursor = (const char*)buffer, + .line_number = 0, + .tileset = NULL, + }; + if (parse_bdf(&loader) < 0) { + TCOD_tileset_delete(loader.tileset); + loader.tileset = NULL; + } + return loader.tileset; +} diff --git a/tcod_sys/libtcod/src/libtcod/tileset_bdf.h b/tcod_sys/libtcod/src/libtcod/tileset_bdf.h new file mode 100644 index 000000000..d97c256be --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/tileset_bdf.h @@ -0,0 +1,89 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_TILESET_BDF_H_ +#define LIBTCOD_TILESET_BDF_H_ + +#ifdef __cplusplus +#include +#endif // __cplusplus + +#include "config.h" +#include "tileset.h" + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +/** + Load a BDF font from a file path. + + For the best results, you should use a BDF font with a cell-based + monospace alignment. + + May return NULL on failure. See `TCOD_get_error` for the error message. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCODLIB_API TCOD_NODISCARD +TCOD_Tileset* TCOD_load_bdf(const char* path); +/** + Load a BDF font from memory. + + `size` is the byte length of `buffer`. `buffer` is the BDF data to load. + + May return NULL on failure. See `TCOD_get_error` for the error message. + + \rst + .. versionadded:: 1.16 + \endrst + */ +TCODLIB_API TCOD_NODISCARD +TCOD_Tileset* TCOD_load_bdf_memory(int size, const unsigned char* buffer); +#ifdef __cplusplus +} // extern "C" +namespace tcod { +/** + Load a Tileset from a BDF font file. + + Will throw on an error. + */ +TCOD_NODISCARD +inline auto load_bdf(const std::string& path) -> TilesetPtr +{ + TilesetPtr tileset {TCOD_load_bdf(path.c_str())}; + if (!tileset) { throw std::runtime_error(TCOD_get_error()); } + return tileset; +} +} // namespace tcod +#endif // __cplusplus +#endif // LIBTCOD_TILESET_BDF_H_ diff --git a/tcod_sys/libtcod/src/libtcod/tileset_fallback.c b/tcod_sys/libtcod/src/libtcod/tileset_fallback.c new file mode 100644 index 000000000..8174d740d --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/tileset_fallback.c @@ -0,0 +1,70 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "tileset_fallback.h" + +#include "stdlib.h" +#include "string.h" +#include "stdio.h" + +#include "tileset_truetype.h" +#include "error.h" +TCOD_Tileset* TCOD_tileset_load_fallback_font_(int tile_width, int tile_height) +{ +#if defined(_WIN32) // Windows. + const char* sys_root = getenv("SystemRoot"); + const char* filename = "\\Fonts\\LUCON.TTF"; + char path[4096] = ""; + strncpy(path, sys_root, sizeof(path) - 1); + strncat(path, filename, sizeof(path) - 1 - strlen(path)); + return TCOD_load_truetype_font_(path, tile_width, tile_height); +#elif defined(__APPLE__) // MacOS. + return TCOD_load_truetype_font_( + "/System/Library/Fonts/SFNSMono.ttf", + tile_width, tile_height); +#elif defined(__unix__) // Linux + FILE* pipe = popen("fc-match --format=%{file} monospace", "r"); + char path[4096] = ""; + if (!pipe) { + TCOD_set_errorv("Failed to run fc-match cmd."); + return NULL; + } + fgets(path, sizeof(path) - 1, pipe); + if (pclose(pipe) != 0) { + TCOD_set_errorv("Could not get a font from fc-match."); + return NULL; + } + return TCOD_load_truetype_font_(path, tile_width, tile_height); +#else + return NULL; + //throw std::runtime_error("Fallback font not supported for this OS."); +#endif +} diff --git a/tcod_sys/libtcod/src/libtcod/tileset_fallback.h b/tcod_sys/libtcod/src/libtcod/tileset_fallback.h new file mode 100644 index 000000000..3ea5f4124 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/tileset_fallback.h @@ -0,0 +1,65 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_TILESET_FALLBACK_H_ +#define LIBTCOD_TILESET_FALLBACK_H_ +#ifdef __cplusplus +#include +#endif // __cplusplus +#include "config.h" +#include "tileset.h" +#include "error.h" +/** + * Try to return a fall-back Tileset, may return NULL. + * + * Used when one is needed, but was not provided by the user. + */ +TCODLIB_CAPI TCOD_NODISCARD +TCOD_Tileset* TCOD_tileset_load_fallback_font_(int tile_width, int tile_height); +#ifdef __cplusplus +namespace tcod { +namespace tileset { +TCOD_NODISCARD +inline auto new_fallback_tileset(const std::array& tile_size = {0, 12}) +-> TilesetPtr +{ + TilesetPtr tileset{ + TCOD_tileset_load_fallback_font_(tile_size.at(0), tile_size.at(1)) + }; + if (!tileset) { + throw std::runtime_error(TCOD_get_error()); + } + return tileset; +} +} // namespace tileset +} // namespace tcod +#endif // __cplusplus +#endif // LIBTCOD_TILESET_FALLBACK_H_ diff --git a/tcod_sys/libtcod/src/libtcod/tileset_render.c b/tcod_sys/libtcod/src/libtcod/tileset_render.c new file mode 100644 index 000000000..6cf49ef62 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/tileset_render.c @@ -0,0 +1,136 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "tileset_render.h" + +#include +/** + Render a single tile. + */ +static void render_tile( + const TCOD_Tileset* tileset, + const struct TCOD_ConsoleTile* tile, + struct TCOD_ColorRGBA* out_rgba, + int stride) +{ + const TCOD_ColorRGBA* graphic = TCOD_tileset_get_tile(tileset, tile->ch); + for (int y = 0; y < tileset->tile_height; ++y) { + TCOD_ColorRGBA* out = (TCOD_ColorRGBA*)((char*)out_rgba + stride * y); + for (int x = 0; x < tileset->tile_width; ++x) { + if (graphic) { + // Multiply the foreground and tileset colors, then blend with bg. + struct TCOD_ColorRGBA rgba = tile->bg; + int graphic_i = y * tileset->tile_width + x; + struct TCOD_ColorRGBA fg = { + tile->fg.r * graphic[graphic_i].r / 255, + tile->fg.g * graphic[graphic_i].g / 255, + tile->fg.b * graphic[graphic_i].b / 255, + tile->fg.a * graphic[graphic_i].a / 255, + }; + TCOD_color_alpha_blend(&rgba, &fg); + out[x] = rgba; + } else { + out[x] = tile->bg; + } + } + } +} +TCOD_Error TCOD_tileset_render_to_surface( + const TCOD_Tileset* tileset, + const TCOD_Console* console, + TCOD_Console** cache, + struct SDL_Surface** surface_out) +{ + if (!tileset) { + TCOD_set_errorv("Tileset argument must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + if (!console) { + TCOD_set_errorv("Tileset argument must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + if (!surface_out) { + TCOD_set_errorv("Surface out argument must not be NULL."); + return TCOD_E_INVALID_ARGUMENT; + } + const int total_width = tileset->tile_width * console->w; + const int total_height = tileset->tile_height * console->h; + if (*surface_out) { + if ((*surface_out)->w != total_width + || (*surface_out)->h != total_height + || (*surface_out)->format->format != SDL_PIXELFORMAT_RGBA32) { + SDL_FreeSurface(*surface_out); + *surface_out = NULL; + } + } + if (!*surface_out) { + *surface_out = SDL_CreateRGBSurfaceWithFormat( + 0, total_width, total_height, 32, SDL_PIXELFORMAT_RGBA32); + } + if (cache) { + if (*cache) { + if ((*cache)->w != console->w || (*cache)->h != console->h) { + TCOD_console_delete(*cache); + *cache = NULL; + } + } + if (!*cache) { + *cache = TCOD_console_new(console->w, console->h); + } + } + for (int console_y = 0; console_y < console->h; ++console_y) { + for (int console_x = 0; console_x < console->w; ++console_x) { + // Get the console index and tileset graphic. + int console_i = console_y * console->w + console_x; + const struct TCOD_ConsoleTile* tile = &console->tiles[console_i]; + if (cache && *cache) { + const struct TCOD_ConsoleTile* cache_tile = &(*cache)->tiles[console_i]; + if (cache_tile->ch == tile->ch + && cache_tile->fg.r == tile->fg.r + && cache_tile->fg.g == tile->fg.g + && cache_tile->fg.b == tile->fg.b + && cache_tile->fg.a == tile->fg.a + && cache_tile->bg.r == tile->bg.r + && cache_tile->bg.g == tile->bg.g + && cache_tile->bg.b == tile->bg.b + && cache_tile->bg.a == tile->bg.a + ) { continue; } + } + TCOD_ColorRGBA* out = (TCOD_ColorRGBA*)( + (char*)(*surface_out)->pixels + + console_y * tileset->tile_height * (*surface_out)->pitch + + console_x * tileset->tile_width * sizeof(*out) + ); + render_tile(tileset, tile, out, (*surface_out)->pitch); + } + } + return TCOD_E_OK; +} diff --git a/tcod_sys/libtcod/src/libtcod/tileset_render.h b/tcod_sys/libtcod/src/libtcod/tileset_render.h new file mode 100644 index 000000000..41a5476b8 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/tileset_render.h @@ -0,0 +1,71 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_TILESET_RENDER_H_ +#define LIBTCOD_TILESET_RENDER_H_ + +#include "console.h" +#include "tileset.h" + +struct SDL_Surface; +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +/** + Render a console to a SDL_Surface with a software renderer. + + `tileset` is the tiles to render with, must not be NULL. + + `console` is the console to render, must not be NULL. + + `cache` is an optional pointer to a consoled used as a cache. The console + at `*cache` will be created or modified. The `cache` will be used to skip + drawing already drawn tiles on any subsequent calls. + + `surface_out` is a pointer to where to put the surface will be managed. + The surface at `*surface_out` will be created or modified and will change + to match the size of `console` and `tileset`. The pixel format will be + SDL_PIXELFORMAT_RGBA32. + + Returns a negative value on error, see `TCOD_get_error`. + \rst + .. versionadded:: 1.16 + \endrst + */ +TCOD_PUBLIC TCOD_Error TCOD_tileset_render_to_surface( + const TCOD_Tileset* tileset, + const TCOD_Console* console, + TCOD_Console** cache, + struct SDL_Surface** surface_out); +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus +#endif // LIBTCOD_TILESET_RENDER_H_ diff --git a/tcod_sys/libtcod/src/libtcod/tileset_truetype.c b/tcod_sys/libtcod/src/libtcod/tileset_truetype.c new file mode 100644 index 000000000..352a539f8 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/tileset_truetype.c @@ -0,0 +1,231 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "stdint.h" +#include "stdio.h" +#include "stdlib.h" + +#include "tileset_truetype.h" +#include "error.h" +#include "globals.h" +#include "../vendor/stb_truetype.h" +// You can look here for a reference on glyph metrics: +// https://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html +/** + * Return an entire file as a single data buffer. + * + * The returned buffer is allocated and must be freed manually. + */ +TCOD_NODISCARD +static unsigned char* alloc_read_whole_file(const char* path, int* size) { + if (!path) { TCOD_set_errorv("Given path was NULL."); return NULL; } + FILE* file = fopen(path, "rb"); + if (!file) { + TCOD_set_errorvf("Could not open file:\n%s", path); + return NULL; + } + fseek(file, 0, SEEK_END); + long int fsize = ftell(file); + fseek(file, 0, SEEK_SET); + unsigned char *buffer = malloc(fsize); + if (!buffer) { + TCOD_set_errorvf("Could not allocate %i bytes for file.", (int)fsize); + } + fread(buffer, 1, fsize, file); + fclose(file); + if (size) { *size = (int)fsize; } + return buffer; +} +struct BBox { + int xMin; + int yMin; + int xMax; + int yMax; +}; +int bbox_width(const struct BBox* bbox) +{ + return bbox->xMax - bbox->xMin; +} +int bbox_height(const struct BBox* bbox) +{ + return bbox->yMax - bbox->yMin; +} +struct FontLoader { + const stbtt_fontinfo* info; + float scale; + struct BBox font_bbox; + struct TCOD_Tileset* tileset; + struct TCOD_ColorRGBA* tile; + uint8_t* tile_alpha; + int ascent; + int descent; + int line_gap; + float align_x; + float align_y; +}; +/** + * Return the bounding box for this glyph. + */ +TCOD_NODISCARD +static struct BBox get_glyph_bbox(const stbtt_fontinfo* font_info, + int glyph, float scale) +{ + struct BBox bbox; + stbtt_GetGlyphBitmapBox(font_info, glyph, scale, scale, + &bbox.xMin, &bbox.yMin, &bbox.xMax, &bbox.yMax); + return bbox; +} +/** + * Return the shift needed to align this glyph with the current tile size. + */ +void get_glyph_shift(const struct FontLoader* loader, + int glyph, float* shift_x, float* shift_y) +{ + struct BBox bbox = get_glyph_bbox(loader->info, glyph, 1.0f); + *shift_x = (loader->tileset->tile_width - bbox_width(&bbox) * loader->scale) + * loader->align_x; + *shift_y = + (bbox.yMin + loader->ascent) * loader->scale + + (int)((loader->tileset->tile_height + - (loader->ascent - loader->descent) + * loader->scale) * loader->align_y); +} +/** + * Render the tile for a specific glyph. + */ +void render_glyph(const struct FontLoader* loader, int glyph) +{ + float shift_x; + float shift_y; + const struct TCOD_Tileset* tileset = loader->tileset; + get_glyph_shift(loader, glyph, &shift_x, &shift_y); + for (int i = 0; i < tileset->tile_length; ++i) { + loader->tile[i].r = loader->tile[i].g = loader->tile[i].b = 255; + loader->tile[i].a = 0; + loader->tile_alpha[i] = 0; + } + stbtt_MakeGlyphBitmapSubpixel( + loader->info, + loader->tile_alpha, + tileset->tile_width, tileset->tile_height, tileset->tile_width, + loader->scale, loader->scale, + shift_x, shift_y, + glyph); + for (int img_y = 0; img_y < tileset->tile_height; ++img_y) { + for (int img_x = 0; img_x < tileset->tile_width; ++img_x) { + int alpha_y = img_y - (int)shift_y; + int alpha_x = img_x - (int)shift_x; + if (alpha_y < 0 || tileset->tile_height <= alpha_y) { continue; } + if (alpha_x < 0 || tileset->tile_width <= alpha_x) { continue; } + loader->tile[img_y * tileset->tile_width + img_x].a = + loader->tile_alpha[alpha_y * tileset->tile_width + alpha_x]; + } + } +} +TCOD_NODISCARD +static struct TCOD_Tileset* tileset_from_ttf( + const stbtt_fontinfo* font_info, int tile_width, int tile_height) +{ + struct FontLoader loader = { + .info = font_info, + .scale = stbtt_ScaleForPixelHeight(font_info, tile_height), + .align_x = 0.5f, + .align_y = 0.5f, + }; + stbtt_GetFontBoundingBox( + font_info, &loader.font_bbox.xMin, &loader.font_bbox.yMin, + &loader.font_bbox.xMax, &loader.font_bbox.yMax); + stbtt_GetFontVMetrics(font_info, + &loader.ascent, &loader.descent, &loader.line_gap); + if (tile_width <= 0) { + tile_width = (int)((float)(bbox_width(&loader.font_bbox)) * loader.scale); + } + float font_width = bbox_width(&loader.font_bbox) * loader.scale; + if (font_width > tile_width) { + // Shrink the font to fit its tile width. + loader.scale *= (float)tile_width / font_width; + } + loader.tileset = TCOD_tileset_new(tile_width, tile_height); + loader.tile = malloc(sizeof(*loader.tile) * loader.tileset->tile_length); + loader.tile_alpha = + malloc(sizeof(*loader.tile_alpha) * loader.tileset->tile_length); + if (!loader.tileset || !loader.tile || !loader.tile_alpha) { + TCOD_tileset_delete(loader.tileset); + free(loader.tile); + free(loader.tile_alpha); + return NULL; + } + for (int codepoint = 1; codepoint <= 0x1ffff; ++codepoint) { + int glyph = stbtt_FindGlyphIndex(font_info, codepoint); + if (!glyph) { continue; } + render_glyph(&loader, glyph); + if(TCOD_tileset_set_tile_(loader.tileset, codepoint, loader.tile) < 0) { + TCOD_set_errorv("Out of memory while loading tileset."); + TCOD_tileset_delete(loader.tileset); + loader.tileset = NULL; + break; + } + } + free(loader.tile); + free(loader.tile_alpha); + return loader.tileset; +} + +TCODLIB_CAPI TCOD_Tileset* TCOD_load_truetype_font_( + const char* path, + int tile_width, + int tile_height) +{ + unsigned char* font_data = alloc_read_whole_file(path, NULL); + if (!font_data) { + return NULL; + } + stbtt_fontinfo font_info; + if (!stbtt_InitFont(&font_info, font_data, 0)) { + TCOD_set_errorvf("Failed to read font file:\n%s", path); + free(font_data); + return NULL; + } + struct TCOD_Tileset* tileset = tileset_from_ttf(&font_info, + tile_width, tile_height); + free(font_data); + return tileset; +} +int TCOD_tileset_load_truetype_( + const char* path, + int tile_width, + int tile_height) +{ + TCOD_Tileset* tileset = TCOD_load_truetype_font_(path, + tile_width, tile_height); + if (!tileset) { return TCOD_E_ERROR; } + return TCOD_E_OK; +} diff --git a/tcod_sys/libtcod/src/libtcod/tileset_truetype.h b/tcod_sys/libtcod/src/libtcod/tileset_truetype.h new file mode 100644 index 000000000..2f5689fa7 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/tileset_truetype.h @@ -0,0 +1,54 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_TILESET_TRUETYPE_H_ +#define LIBTCOD_TILESET_TRUETYPE_H_ +#include "config.h" +#include "tileset.h" +#include "error.h" + +/** + * Return a tileset from a TrueType font file. + */ +TCODLIB_CAPI TCOD_NODISCARD +TCOD_Tileset* TCOD_load_truetype_font_( + const char* path, + int tile_width, + int tile_height); +/** + * Set the global tileset from a TrueType font file. + */ +TCODLIB_CAPI TCOD_NODISCARD +TCOD_Error TCOD_tileset_load_truetype_( + const char* path, + int tile_width, + int tile_height); +#endif // LIBTCOD_TILESET_TRUETYPE_H_ diff --git a/tcod_sys/libtcod/src/libtcod/tree.h b/tcod_sys/libtcod/src/libtcod/tree.h new file mode 100644 index 000000000..13513a337 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/tree.h @@ -0,0 +1,51 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_TREE_H +#define _TCOD_TREE_H + +#include "portability.h" + +#ifdef __cplusplus +extern "C" { +#endif +typedef struct _TCOD_tree_t { + struct _TCOD_tree_t *next; + struct _TCOD_tree_t *father; + struct _TCOD_tree_t *sons; +} TCOD_tree_t; + +TCODLIB_API TCOD_tree_t *TCOD_tree_new(void); +TCODLIB_API void TCOD_tree_add_son(TCOD_tree_t *node, TCOD_tree_t *son); +#ifdef __cplusplus +} +#endif +#endif diff --git a/tcod_sys/libtcod/src/libtcod/tree.hpp b/tcod_sys/libtcod/src/libtcod/tree.hpp new file mode 100644 index 000000000..58449fadc --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/tree.hpp @@ -0,0 +1,57 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_TREE_HPP +#define _TCOD_TREE_HPP + +#include "tree.h" + +class TCODLIB_API TCODTree { +public : + TCODTree *next; + TCODTree *father; + TCODTree *sons; + + TCODTree() : next(NULL),father(NULL),sons(NULL){} + void addSon(TCODTree *data) { + data->father=this; + TCODTree *lastson = sons; + while ( lastson && lastson->next ) lastson=lastson->next; + if ( lastson ) { + lastson->next=data; + } else { + sons=data; + } + } + +}; + +#endif diff --git a/tcod_sys/libtcod/src/libtcod/tree_c.c b/tcod_sys/libtcod/src/libtcod/tree_c.c new file mode 100644 index 000000000..06b00af8e --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/tree_c.c @@ -0,0 +1,49 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "tree.h" + +#include + +TCOD_tree_t *TCOD_tree_new(void) { + return (TCOD_tree_t *)calloc(1,sizeof(TCOD_tree_t)); +} + +void TCOD_tree_add_son(TCOD_tree_t *node, TCOD_tree_t *son) { + TCOD_tree_t *lastson = node->sons; + son->father=node; + while ( lastson && lastson->next ) lastson=lastson->next; + if ( lastson ) { + lastson->next=son; + } else { + node->sons=son; + } +} diff --git a/tcod_sys/libtcod/src/libtcod/txtfield.cpp b/tcod_sys/libtcod/src/libtcod/txtfield.cpp new file mode 100644 index 000000000..798ff3dea --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/txtfield.cpp @@ -0,0 +1,75 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "txtfield.hpp" + +TCODText::TCODText(int x, int y, int w, int h, int max_chars){ + data=TCOD_text_init(x,y,w,h,max_chars); +} + +TCODText::TCODText(int w, int h, int max_chars){ + data=TCOD_text_init2(w,h,max_chars); +} + +TCODText::~TCODText(){ + TCOD_text_delete(data); +} + +void TCODText::setPos(int x, int y) { + TCOD_text_set_pos(data,x,y); +} + +void TCODText::setProperties(int cursor_char, int blink_interval, const char * prompt, int tab_size){ + TCOD_text_set_properties(data,cursor_char,blink_interval,prompt,tab_size); +} + +void TCODText::setColors(TCODColor fore, TCODColor back, float back_transparency){ + TCOD_color_t foreground = {fore.r,fore.g,fore.b}; + TCOD_color_t background = {back.r,back.g,back.b}; + TCOD_text_set_colors(data,foreground,background,back_transparency); +} + +bool TCODText::update(TCOD_key_t key){ + return TCOD_text_update(data,key) != 0; +} + +void TCODText::render(TCODConsole * con) +{ + TCOD_text_render(data,con->get_data()); +} + +const char *TCODText::getText(){ + return TCOD_text_get(data); +} + +void TCODText::reset(){ + TCOD_text_reset(data); +} diff --git a/tcod_sys/libtcod/src/libtcod/txtfield.h b/tcod_sys/libtcod/src/libtcod/txtfield.h new file mode 100644 index 000000000..747520b25 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/txtfield.h @@ -0,0 +1,60 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_TEXT_H_ +#define _TCOD_TEXT_H_ + +#include "portability.h" + +#include "color.h" +#include "console_types.h" + +#ifdef __cplusplus +extern "C" { +#endif +struct TCOD_Text; +typedef struct TCOD_Text *TCOD_text_t; + +TCODLIB_API TCOD_text_t TCOD_text_init(int x, int y, int w, int h, int max_chars); +TCODLIB_API TCOD_text_t TCOD_text_init2(int w, int h, int max_chars); +TCODLIB_API void TCOD_text_set_pos(TCOD_text_t txt, int x, int y); +TCODLIB_API void TCOD_text_set_properties(TCOD_text_t txt, int cursor_char, int blink_interval, const char * prompt, int tab_size); +TCODLIB_API void TCOD_text_set_colors(TCOD_text_t txt, TCOD_color_t fore, TCOD_color_t back, float back_transparency); +TCODLIB_API bool TCOD_text_update(TCOD_text_t txt, TCOD_key_t key); +TCODLIB_API void TCOD_text_render(TCOD_text_t txt, TCOD_console_t con); +TCODLIB_API const char * TCOD_text_get(TCOD_text_t txt); +TCODLIB_API void TCOD_text_reset(TCOD_text_t txt); +TCODLIB_API void TCOD_text_delete(TCOD_text_t txt); +#ifdef __cplusplus +} +#endif + +#endif /* _TCOD_TEXT_H_ */ diff --git a/tcod_sys/libtcod/src/libtcod/txtfield.hpp b/tcod_sys/libtcod/src/libtcod/txtfield.hpp new file mode 100644 index 000000000..0fbfcca60 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/txtfield.hpp @@ -0,0 +1,55 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_TEXT_HPP_ +#define _TCOD_TEXT_HPP_ + +#include "color.hpp" +#include "console.hpp" +#include "txtfield.h" + +class TCODLIB_API TCODText { +public : + TCODText(int x, int y, int w, int h, int max_chars); + TCODText(int w, int h, int max_chars); + ~TCODText(); + void setProperties(int cursor_char, int blink_interval, const char * prompt, int tab_size); + void setColors(TCODColor fore, TCODColor back, float back_transparency); + void setPos(int x, int y); + bool update(TCOD_key_t key); + void render(TCODConsole * con); + const char *getText(); + void reset(); +protected : + TCOD_text_t data; +}; + +#endif diff --git a/tcod_sys/libtcod/src/txtfield_c.c b/tcod_sys/libtcod/src/libtcod/txtfield_c.c similarity index 88% rename from tcod_sys/libtcod/src/txtfield_c.c rename to tcod_sys/libtcod/src/libtcod/txtfield_c.c index 3af7708f0..603910e2f 100644 --- a/tcod_sys/libtcod/src/txtfield_c.c +++ b/tcod_sys/libtcod/src/libtcod/txtfield_c.c @@ -1,689 +1,690 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#ifdef TCOD_CONSOLE_SUPPORT - -#include -#include - -#include -#include -#include - -#define MAX_INT 0x7FFFFFFF - -typedef struct { - int x, y; /* coordinates on parent console */ - int w, h; /* textfield display size */ - int max; /* maximum nb of characters */ - int interval; /* cursor blinking interval */ - int halfinterval; /* half of the above */ - int ascii_cursor; /* cursor char. 0 if none */ - int cursor_pos, sel_start,sel_end; /* cursor position in text, selection range */ - int tab_size; /* tab size, if 0, no tab */ - char * prompt; /* prompt to be displayed before the string */ - int textx,texty; /* coordinate of start of text (after prompt) */ - TCOD_console_t con; /* offscreen console that will contain the textfield */ - bool input_continue; /* controls whether ENTER has been pressed */ - int len; /* allocated size of the text */ - int curlen; /* current length of the text */ - TCOD_color_t back; /* background colour */ - TCOD_color_t fore; /* foreground colour */ - float transparency; /* background transparency */ - bool multiline; /* multiline support ? */ - char * text; /* the text itself */ -} text_t; - -/* ctor */ -TCOD_text_t TCOD_text_init (int x, int y, int w, int h, int max_chars) { - text_t * data = (text_t*)calloc(sizeof(text_t),1); - TCOD_IFNOT(w> 0 && h > 0) return data; - data->x = x; - data->y = y; - data->w = w; - data->h = h; - data->multiline = (h > 1); - data->max = (max_chars > 0 ? max_chars + 1 : MAX_INT); - data->interval = 800; - data->halfinterval = 400; - data->ascii_cursor = 0; - data->prompt = NULL; - data->textx = data->texty = 0; - data->con = TCOD_console_new(w,h); - data->sel_start = MAX_INT; - data->sel_end = -1; - /* - if (! data->multiline ) { - data->max = MIN(w - data->textx,data->max); - } else { - data->max = MIN(w*(h-data->texty) - data->textx,data->max); - } - */ - if (max_chars && max_chars > 0) data->max = max_chars; - else data->max = data->w * data->h; - data->input_continue = true; - data->len = MIN(64,data->max); - data->text = (char*)calloc(data->len,sizeof(char)); - data->back.r = data->back.g = data->back.b = 0; - data->fore.r = data->fore.g = data->fore.b = 255; - data->transparency = 1.0f; - return (TCOD_text_t)data; -} - -TCOD_text_t TCOD_text_init2(int w, int h, int max_chars) { - text_t * data = (text_t*)calloc(sizeof(text_t),1); - TCOD_IFNOT(w> 0 && h > 0) return data; - data->x = 0; - data->y = 0; - data->w = w; - data->h = h; - data->multiline = (h > 1); - data->max = (max_chars > 0 ? max_chars + 1 : MAX_INT); - data->interval = 800; - data->halfinterval = 400; - data->ascii_cursor = 0; - data->prompt = NULL; - data->textx = data->texty = 0; - data->con = TCOD_console_new(w,h); - data->sel_start = MAX_INT; - data->sel_end = -1; - /* - if (! data->multiline ) { - data->max = MIN(w - data->textx,data->max); - } else { - data->max = MIN(w*(h-data->texty) - data->textx,data->max); - } - */ - if (max_chars && max_chars > 0) data->max = max_chars; - else data->max = data->w * data->h; - data->input_continue = true; - data->len = MIN(64,data->max); - data->text = (char*)calloc(data->len,sizeof(char)); - data->back.r = data->back.g = data->back.b = 0; - data->fore.r = data->fore.g = data->fore.b = 255; - data->transparency = 1.0f; - return (TCOD_text_t)data; -} - -void TCOD_text_set_pos(TCOD_text_t txt, int x, int y) { - text_t * data = (text_t*)txt; - data->x=x; - data->y=y; -} - -/* set cursor and prompt */ -void TCOD_text_set_properties (TCOD_text_t txt, int cursor_char, int blink_interval, const char * prompt, int tab_size) { - text_t * data = (text_t*)txt; - TCOD_IFNOT(data && data->con ) return; - data->interval = blink_interval; - data->halfinterval = (blink_interval > 0 ? blink_interval / 2 : 0); - data->ascii_cursor = cursor_char; - if (data->prompt) free(data->prompt); - data->prompt = prompt ? TCOD_strdup(prompt) : NULL; - data->textx = data->texty = 0; - data->tab_size=tab_size; - if ( prompt ) { - const char *ptr=prompt; - while (*ptr) { - data->textx++; - if ( *ptr == '\n' || data->textx == data->w) { - data->textx=0;data->texty++; - } - ptr++; - } - } -} - -/* set colours */ -void TCOD_text_set_colors (TCOD_text_t txt, TCOD_color_t fore, TCOD_color_t back, float back_transparency) { - text_t * data = (text_t*)txt; - TCOD_IFNOT(data && data->con ) return; - data->back = back; - data->fore = fore; - data->transparency = back_transparency; -} - -/* increase the buffer size. internal function */ -static void allocate(text_t *data) { - char *tmp; - data->len *= 2; - tmp = (char*)calloc(data->len,sizeof(char)); - memcpy(tmp,data->text,data->len/2); - free(data->text); - data->text = tmp; -} - -/* insert a character at cursor position. internal function */ -static void insertChar(text_t *data, char c) { - char *ptr, *end; - if (data->cursor_pos + 1 == data->max) { - /* max size reached. replace the last char. don't increase text size */ - *(data->text + data->cursor_pos -1) = c; - return; - } - if (data->curlen + 1 == data->len ) allocate(data); - ptr=data->text + data->cursor_pos; - end=data->text + data->curlen; - do { - *(end+1) = *end; - end--; - } while ( end >= ptr ); - *ptr = c; - data->curlen++; - data->cursor_pos++; -} - -/* delete character at cursor position */ -static void deleteChar(text_t *data) { - char *ptr; - if ( data->cursor_pos == 0 ) return; - ptr=data->text + data->cursor_pos-1; - do { - *ptr = *(ptr+1); - ptr++; - } while (*ptr); - if ( data->cursor_pos > 0 ) { - data->cursor_pos--; - data->curlen--; - } -} - -/* convert current cursor_pos into console coordinates. internal function */ -static void get_cursor_coords(text_t *data, int *cx, int *cy) { - char *ptr; - if (data->multiline) { - int curcount=data->cursor_pos; - ptr=data->text; - *cx = data->textx; - *cy = data->texty; - while (curcount > 0 && *ptr) { - if ( *ptr == '\n') { - *cx=0; - (*cy)++; - } else { - (*cx)++; - if ( *cx == data->w ) { - *cx=0; - (*cy)++; - } - } - ptr++; - curcount--; - } - } else { - *cx = data->textx + data->cursor_pos; - *cy = data->texty; - } -} - -/* check if the text does not overflow the textfield */ -/* -not working... -static bool check_last_pos(text_t *data) { - int count = strlen(data->text); - int cx=data->textx; - int cy=data->texty; - char *ptr=data->text; - while ( count > 0 ) { - if ( *ptr == '\n') { - cx=0; - cy++; - } else { - cx++; - if ( cx == data->w ) { - cx=0; - cy++; - } - } - ptr++; - count--; - } - return ( cy < data->h ); -} -*/ - -/* set cursor_pos from coordinates. internal function */ -static void set_cursor_pos(text_t *data, int cx, int cy, bool clamp) { - if ( data->multiline ) { - int curx=data->textx,cury=data->texty; - char *ptr=data->text; - int newpos=0; - if ( clamp ) { - cy=MAX(data->texty,cy); - if ( cy == data->texty) cx = MAX(data->textx,cx); - } - /* find the right line */ - while ( *ptr && cury < cy && cury < data->h ) { - if (*ptr == '\n' || curx == data->w-1) { - curx=0;cury++; - } else curx++; - ptr++; - newpos++; - } - if ( cury >= data->h ) return; - if ( cury == cy ) { - /* check if cx can be reached */ - while ( *ptr && curx < cx && *ptr != '\n') { - ptr++; - curx++; - newpos++; - } - } - data->cursor_pos = newpos; - } else { - int newpos = cx - data->textx + (cy - data->texty)*data->w; - if ( clamp ) newpos = CLAMP(0,data->curlen,newpos); - if ( newpos >= 0 && newpos <= data->curlen ) data->cursor_pos = newpos; - } -} - - -/* decreases the selection range start */ -static void selectStart(text_t *data, int oldpos, TCOD_key_t key) { - if ( data->multiline && data->cursor_pos != oldpos ) { - if ( key.shift ) { - if ( data->sel_start > data->cursor_pos ) data->sel_start = data->cursor_pos; - else data->sel_end = data->cursor_pos; - } else { - data->sel_start=MAX_INT; - data->sel_end=-1; - } - } -} - -/* increases the selection range end */ -static void selectEnd(text_t *data, int oldpos, TCOD_key_t key) { - if ( data->multiline && data->cursor_pos != oldpos ) { - if ( key.shift ) { - if ( data->sel_end < data->cursor_pos ) data->sel_end = data->cursor_pos; - else data->sel_start = data->cursor_pos; - } else { - data->sel_start=MAX_INT; - data->sel_end=-1; - } - } -} - -enum { TYPE_SYMBOL, TYPE_ALPHANUM, TYPE_SPACE }; -static const char txt_symbols[]="&~\"#'{([-|`_\\^@)]=+}*/!:;.,?<>"; - -/* check whether a character is a space */ -/* this is needed because cctype isspace() returns rubbish for many diacritics */ -static bool is_space (int ch) { - bool ret; - switch (ch) { - case ' ': case '\n': case '\r': case '\t': ret = true; break; - default: ret = false; break; - } - return ret; -} - -static void typecheck (int * type, int ch) { - if (strchr(txt_symbols,ch)) *type = TYPE_SYMBOL; - else if (is_space(ch)) *type = TYPE_SPACE; - else *type = TYPE_ALPHANUM; -} - -/* go one word left */ -static void previous_word(text_t *data) { - /* current character type */ - if ( data->cursor_pos > 0 ) { - /* detect current char type (alphanum/space or symbol) */ - char *ptr=data->text + data->cursor_pos - 1; - int curtype, prevtype; - typecheck(&curtype,*ptr); - /* go back until char type changes from alphanumeric to something else */ - do { - data->cursor_pos--; - ptr--; - prevtype = curtype; - typecheck(&curtype,*ptr); - } while ( data->cursor_pos > 0 && !(curtype != TYPE_ALPHANUM && prevtype == TYPE_ALPHANUM)); - } -} - -/* go one word right */ -static void next_word(text_t *data) { - /* current character type */ - if ( data->text[data->cursor_pos] ) { - /* detect current char type (alphanum/space or symbol) */ - char *ptr=data->text + data->cursor_pos; - int curtype, prevtype; - typecheck(&curtype,*ptr); - /* go forth until char type changes from non alphanumeric to alphanumeric */ - do { - data->cursor_pos++; - ptr++; - prevtype = curtype; - typecheck(&curtype,*ptr); - } while ( *ptr && !(curtype == TYPE_ALPHANUM && prevtype != TYPE_ALPHANUM)); - } -} - -/* erase the selected text */ -static void deleteSelection(text_t *data) { - int count = data->sel_end-data->sel_start; - data->cursor_pos = data->sel_start+1; - while ( count > 0 ) { - deleteChar(data); - count--; - data->cursor_pos++; - } - data->cursor_pos--; - data->sel_start=MAX_INT; - data->sel_end=-1; -} - -/* copy selected text to clipboard */ -static void copy(text_t *data) { - if ( data->sel_end - data->sel_start > 0 ) { - char *clipbuf = (char*)calloc(data->sel_end - data->sel_start+1,1); - char *ptr=clipbuf; - int i; - for (i=data->sel_start; i != data->sel_end; i++) { - *ptr++ = data->text[i]; - } - TCOD_sys_clipboard_set(clipbuf); - free(clipbuf); - } -} - -/* cut selected text to clipboard */ -static void cut(text_t *data) { - if ( data->sel_end - data->sel_start > 0 ) { - char *clipbuf = (char*)calloc(data->sel_end - data->sel_start+1,1); - char *ptr=clipbuf; - int i; - for (i=data->sel_start; i != data->sel_end; i++) { - *ptr++ = data->text[i]; - } - TCOD_sys_clipboard_set(clipbuf); - free(clipbuf); - deleteSelection(data); - } -} - -/* paste from clipboard */ -static void paste(text_t *data) { - char *clipbuf=TCOD_sys_clipboard_get(); - if ( clipbuf ) { - if ( data->sel_start != MAX_INT ) { - deleteSelection(data); - } - while (*clipbuf) { - insertChar(data,*clipbuf++); - } - } -} - -/* update returns false if enter has been pressed, true otherwise */ -bool TCOD_text_update (TCOD_text_t txt, TCOD_key_t key) { - int cx,cy,oldpos; - text_t * data = (text_t*)txt; - TCOD_IFNOT(data && data->con ) return false; - oldpos = data->cursor_pos; - /* for real-time keyboard : only on key release */ - if ( key.pressed ) { - /* process keyboard input */ - switch (key.vk) { - case TCODK_BACKSPACE: /* get rid of the last character */ - if ( data->sel_start != MAX_INT ) { - deleteSelection(data); - } else { - deleteChar(data); - } - break; - case TCODK_DELETE: - if ( key.shift ) { - /* SHIFT-DELETE : cut to clipboard */ - cut(data); - } else { - if ( data->sel_start != MAX_INT ) { - deleteSelection(data); - } else if ( data->text[data->cursor_pos] ) { - data->cursor_pos++; - deleteChar(data); - } - } - break; - /* shift + arrow / home / end = selection */ - /* ctrl + arrow = word skipping. ctrl + shift + arrow = word selection */ - case TCODK_LEFT: - if ( data->multiline && key.shift && data->sel_end == -1) { - data->sel_end = data->cursor_pos; - } - if ( data->cursor_pos > 0 ) { - if ( key.lctrl || key.rctrl ) { - previous_word(data); - } else data->cursor_pos--; - selectStart(data,oldpos,key); - } - break; - case TCODK_RIGHT: - if ( data->multiline && key.shift && data->sel_start == MAX_INT ) { - data->sel_start = data->cursor_pos; - } - if ( data->text[data->cursor_pos] ) { - if ( key.lctrl || key.rctrl ) { - next_word(data); - } else data->cursor_pos++; - selectEnd(data,oldpos,key); - } - break; - case TCODK_UP : - get_cursor_coords(data,&cx,&cy); - if ( data->multiline && key.shift && data->sel_end == -1) { - data->sel_end = data->cursor_pos; - } - set_cursor_pos(data,cx,cy-1,false); - selectStart(data,oldpos,key); - break; - case TCODK_DOWN : - get_cursor_coords(data,&cx,&cy); - if ( data->multiline && key.shift && data->sel_start == MAX_INT ) { - data->sel_start = data->cursor_pos; - } - set_cursor_pos(data,cx,cy+1,false); - selectEnd(data,oldpos,key); - break; - case TCODK_HOME: - get_cursor_coords(data,&cx,&cy); - if ( data->multiline && key.shift && data->sel_end == -1) { - data->sel_end = data->cursor_pos; - } - if ( key.lctrl || key.rctrl ) { - set_cursor_pos(data,0,0,true); - } else { - set_cursor_pos(data,0,cy,true); - } - selectStart(data,oldpos,key); - break; - case TCODK_END: - get_cursor_coords(data,&cx,&cy); - if ( data->multiline && key.shift && data->sel_start == MAX_INT ) { - data->sel_start = data->cursor_pos; - } - if ( key.lctrl || key.rctrl ) { - set_cursor_pos(data,data->w,data->h,true); - } else { - set_cursor_pos(data,data->w-1,cy,true); - } - selectEnd(data,oldpos,key); - break; - case TCODK_ENTER: /* validate input */ - case TCODK_KPENTER: - if ( data->sel_start != MAX_INT ) { - deleteSelection(data); - } - if ( data->multiline ) { - get_cursor_coords(data,&cx,&cy); - if ( cy < data->h-1 ) insertChar(data,'\n'); - } else { - data->input_continue = false; - } - break; - case TCODK_TAB : - if (data->tab_size ) { - int count=data->tab_size; - if ( data->sel_start != MAX_INT ) { - deleteSelection(data); - } - while ( count > 0 ) { - insertChar(data,' '); - count--; - } - } - break; - default: { /* append a new character */ - if ( (key.c == 'c' || key.c=='C' || key.vk == TCODK_INSERT) && (key.lctrl || key.rctrl) ) { - /* CTRL-C or CTRL-INSERT : copy to clipboard */ - copy(data); - } else if ( (key.c == 'x' || key.c=='X') && (key.lctrl || key.rctrl) ) { - /* CTRL-X : cut to clipboard */ - cut(data); - } else if ( ((key.c == 'v' || key.c=='V') && (key.lctrl || key.rctrl)) - || ( key.vk == TCODK_INSERT && key.shift ) - ) { - /* CTRL-V or SHIFT-INSERT : paste from clipboard */ - paste(data); - } else if (key.c > 31) { - if ( data->sel_start != MAX_INT ) { - deleteSelection(data); - } - insertChar(data,(char)(key.c)); - } - break; - } - } - } - return data->input_continue; -} - -/* renders the textfield */ -void TCOD_text_render (TCOD_text_t txt, TCOD_console_t con) { - text_t * data = (text_t*)txt; - uint32_t time; - bool cursor_on; - char back=0; - int curx,cury,cursorx,cursory, curpos; - char *ptr; - TCOD_IFNOT(data && data->con ) return; - time = TCOD_sys_elapsed_milli(); - cursor_on = (int)( time % data->interval ) > data->halfinterval; - TCOD_console_set_default_background(data->con, data->back); - TCOD_console_set_default_foreground(data->con, data->fore); - TCOD_console_clear(data->con); - - /* compute cursor position */ - get_cursor_coords(data,&cursorx,&cursory); - - if ( cursor_on && data->ascii_cursor) { - /* save the character under cursor position */ - back = data->text[data->cursor_pos]; - data->text[data->cursor_pos] = data->ascii_cursor; - } - /* render prompt */ - if (data->prompt) TCOD_console_print_rect_ex(data->con,0,0,data->w,data->h,TCOD_BKGND_SET,TCOD_LEFT,"%s",data->prompt); - /* render text */ - curx=data->textx; - cury=data->texty; - ptr=data->text; - curpos=0; - while (*ptr) { - if ( *ptr == '\n') { - if ( (curx == 0 || curpos == 0 ) && curpos >= data->sel_start && curpos < data->sel_end ) { - /* inverted colors for selected empty lines */ - TCOD_console_set_char_background(data->con, curx, cury, data->fore, TCOD_BKGND_SET); - TCOD_console_set_char_foreground(data->con, curx, cury, data->back); - } - curx=0; - cury++; - } else { - if ( curpos >= data->sel_start && curpos < data->sel_end ) { - /* inverted colors for selection */ - TCOD_console_set_char_background(data->con, curx, cury, data->fore, TCOD_BKGND_SET); - TCOD_console_set_char_foreground(data->con, curx, cury, data->back); - } - TCOD_console_set_char(data->con,curx,cury,*ptr); - curx++; - if ( curx == data->w ) { - curx=0; - cury++; - } - } - ptr++; - curpos++; - } - if ( cursor_on ) { - if ( data->ascii_cursor) { - /* restore the character under cursor */ - data->text[data->cursor_pos] = back; - } else { - /* invert colors at cursor position */ - TCOD_console_set_char_background(data->con,cursorx,cursory,data->fore,TCOD_BKGND_SET); - TCOD_console_set_char_foreground(data->con,cursorx,cursory,data->back); - } - } else if (! cursor_on && ! data->ascii_cursor && data->multiline ) { - /* normal colors for cursor ( might be inside selection ) */ - TCOD_console_set_char_background(data->con,cursorx,cursory,data->back,TCOD_BKGND_SET); - TCOD_console_set_char_foreground(data->con,cursorx,cursory,data->fore); - } - TCOD_console_blit(data->con,0,0,data->w,data->h,con,data->x,data->y,1.0f,data->transparency); -} - -/* returns the text currently stored in the textfield object */ -const char * TCOD_text_get (TCOD_text_t txt) { - text_t * data = (text_t*)txt; - TCOD_IFNOT(data && data->con ) return ""; - return data->text; -} - -/* resets the text initial state */ -void TCOD_text_reset (TCOD_text_t txt) { - text_t * data = (text_t*)txt; - TCOD_IFNOT(data && data->con ) return; - memset(data->text,'\0',data->len); - data->curlen = 0; - data->cursor_pos = 0; - data->sel_start = MAX_INT; - data->sel_end = -1; - data->input_continue = true; -} - -/* destructor */ -void TCOD_text_delete (TCOD_text_t txt) { - text_t * data = (text_t*)txt; - TCOD_IFNOT(data && data->con ) return; - if ( data->text ) free(data->text); - if ( data->prompt ) free(data->prompt); - TCOD_console_delete(data->con); - free(data); -} - -#endif /* TCOD_CONSOLE_SUPPORT */ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "txtfield.h" + +#include +#include + +#include "console.h" +#include "console_printing.h" +#include "libtcod_int.h" +#include "utility.h" + +#define MAX_INT 0x7FFFFFFF + +typedef struct TCOD_Text { + int x, y; /* coordinates on parent console */ + int w, h; /* textfield display size */ + int max; /* maximum nb of characters */ + int interval; /* cursor blinking interval */ + int halfinterval; /* half of the above */ + int ascii_cursor; /* cursor char. 0 if none */ + int cursor_pos, sel_start,sel_end; /* cursor position in text, selection range */ + int tab_size; /* tab size, if 0, no tab */ + char * prompt; /* prompt to be displayed before the string */ + int textx,texty; /* coordinate of start of text (after prompt) */ + TCOD_console_t con; /* offscreen console that will contain the textfield */ + bool input_continue; /* controls whether ENTER has been pressed */ + int len; /* allocated size of the text */ + int curlen; /* current length of the text */ + TCOD_color_t back; /* background colour */ + TCOD_color_t fore; /* foreground colour */ + float transparency; /* background transparency */ + bool multiline; /* multiline support ? */ + char * text; /* the text itself */ +} text_t; + +/* ctor */ +TCOD_text_t TCOD_text_init (int x, int y, int w, int h, int max_chars) { + text_t * data = (text_t*)calloc(sizeof(text_t),1); + TCOD_IFNOT(w> 0 && h > 0) return data; + data->x = x; + data->y = y; + data->w = w; + data->h = h; + data->multiline = (h > 1); + data->max = (max_chars > 0 ? max_chars + 1 : MAX_INT); + data->interval = 800; + data->halfinterval = 400; + data->ascii_cursor = 0; + data->prompt = NULL; + data->textx = data->texty = 0; + data->con = TCOD_console_new(w,h); + data->sel_start = MAX_INT; + data->sel_end = -1; + /* + if (! data->multiline ) { + data->max = MIN(w - data->textx,data->max); + } else { + data->max = MIN(w*(h-data->texty) - data->textx,data->max); + } + */ + if (max_chars && max_chars > 0) data->max = max_chars; + else data->max = data->w * data->h; + data->input_continue = true; + data->len = MIN(64,data->max); + data->text = (char*)calloc(data->len,sizeof(char)); + data->back.r = data->back.g = data->back.b = 0; + data->fore.r = data->fore.g = data->fore.b = 255; + data->transparency = 1.0f; + return (TCOD_text_t)data; +} + +TCOD_text_t TCOD_text_init2(int w, int h, int max_chars) { + text_t * data = (text_t*)calloc(sizeof(text_t),1); + TCOD_IFNOT(w> 0 && h > 0) return data; + data->x = 0; + data->y = 0; + data->w = w; + data->h = h; + data->multiline = (h > 1); + data->max = (max_chars > 0 ? max_chars + 1 : MAX_INT); + data->interval = 800; + data->halfinterval = 400; + data->ascii_cursor = 0; + data->prompt = NULL; + data->textx = data->texty = 0; + data->con = TCOD_console_new(w,h); + data->sel_start = MAX_INT; + data->sel_end = -1; + /* + if (! data->multiline ) { + data->max = MIN(w - data->textx,data->max); + } else { + data->max = MIN(w*(h-data->texty) - data->textx,data->max); + } + */ + if (max_chars && max_chars > 0) data->max = max_chars; + else data->max = data->w * data->h; + data->input_continue = true; + data->len = MIN(64,data->max); + data->text = (char*)calloc(data->len,sizeof(char)); + data->back.r = data->back.g = data->back.b = 0; + data->fore.r = data->fore.g = data->fore.b = 255; + data->transparency = 1.0f; + return (TCOD_text_t)data; +} + +void TCOD_text_set_pos(TCOD_text_t txt, int x, int y) { + text_t * data = (text_t*)txt; + data->x=x; + data->y=y; +} + +/* set cursor and prompt */ +void TCOD_text_set_properties (TCOD_text_t txt, int cursor_char, int blink_interval, const char * prompt, int tab_size) { + text_t * data = (text_t*)txt; + TCOD_IFNOT(data && data->con ) return; + data->interval = blink_interval; + data->halfinterval = (blink_interval > 0 ? blink_interval / 2 : 0); + data->ascii_cursor = cursor_char; + if (data->prompt) free(data->prompt); + data->prompt = prompt ? TCOD_strdup(prompt) : NULL; + data->textx = data->texty = 0; + data->tab_size=tab_size; + if ( prompt ) { + const char *ptr=prompt; + while (*ptr) { + data->textx++; + if ( *ptr == '\n' || data->textx == data->w) { + data->textx=0;data->texty++; + } + ptr++; + } + } +} + +/* set colours */ +void TCOD_text_set_colors (TCOD_text_t txt, TCOD_color_t fore, TCOD_color_t back, float back_transparency) { + text_t * data = (text_t*)txt; + TCOD_IFNOT(data && data->con ) return; + data->back = back; + data->fore = fore; + data->transparency = back_transparency; +} + +/* increase the buffer size. internal function */ +static void allocate(text_t *data) { + char *tmp; + data->len *= 2; + tmp = (char*)calloc(data->len,sizeof(char)); + memcpy(tmp,data->text,data->len/2); + free(data->text); + data->text = tmp; +} + +/* insert a character at cursor position. internal function */ +static void insertChar(text_t *data, char c) { + char *ptr, *end; + if (data->cursor_pos + 1 == data->max) { + /* max size reached. replace the last char. don't increase text size */ + *(data->text + data->cursor_pos -1) = c; + return; + } + if (data->curlen + 1 == data->len ) allocate(data); + ptr=data->text + data->cursor_pos; + end=data->text + data->curlen; + do { + *(end+1) = *end; + end--; + } while ( end >= ptr ); + *ptr = c; + data->curlen++; + data->cursor_pos++; +} + +/* delete character at cursor position */ +static void deleteChar(text_t *data) { + char *ptr; + if ( data->cursor_pos == 0 ) return; + ptr=data->text + data->cursor_pos-1; + do { + *ptr = *(ptr+1); + ptr++; + } while (*ptr); + if ( data->cursor_pos > 0 ) { + data->cursor_pos--; + data->curlen--; + } +} + +/* convert current cursor_pos into console coordinates. internal function */ +static void get_cursor_coords(text_t *data, int *cx, int *cy) { + char *ptr; + if (data->multiline) { + int curcount=data->cursor_pos; + ptr=data->text; + *cx = data->textx; + *cy = data->texty; + while (curcount > 0 && *ptr) { + if ( *ptr == '\n') { + *cx=0; + (*cy)++; + } else { + (*cx)++; + if ( *cx == data->w ) { + *cx=0; + (*cy)++; + } + } + ptr++; + curcount--; + } + } else { + *cx = data->textx + data->cursor_pos; + *cy = data->texty; + } +} + +/* check if the text does not overflow the textfield */ +/* +not working... +static bool check_last_pos(text_t *data) { + int count = strlen(data->text); + int cx=data->textx; + int cy=data->texty; + char *ptr=data->text; + while ( count > 0 ) { + if ( *ptr == '\n') { + cx=0; + cy++; + } else { + cx++; + if ( cx == data->w ) { + cx=0; + cy++; + } + } + ptr++; + count--; + } + return ( cy < data->h ); +} +*/ + +/* set cursor_pos from coordinates. internal function */ +static void set_cursor_pos(text_t *data, int cx, int cy, bool clamp) { + if ( data->multiline ) { + int curx=data->textx,cury=data->texty; + char *ptr=data->text; + int newpos=0; + if ( clamp ) { + cy=MAX(data->texty,cy); + if ( cy == data->texty) cx = MAX(data->textx,cx); + } + /* find the right line */ + while ( *ptr && cury < cy && cury < data->h ) { + if (*ptr == '\n' || curx == data->w-1) { + curx=0;cury++; + } else curx++; + ptr++; + newpos++; + } + if ( cury >= data->h ) return; + if ( cury == cy ) { + /* check if cx can be reached */ + while ( *ptr && curx < cx && *ptr != '\n') { + ptr++; + curx++; + newpos++; + } + } + data->cursor_pos = newpos; + } else { + int newpos = cx - data->textx + (cy - data->texty)*data->w; + if ( clamp ) newpos = CLAMP(0,data->curlen,newpos); + if ( newpos >= 0 && newpos <= data->curlen ) data->cursor_pos = newpos; + } +} + + +/* decreases the selection range start */ +static void selectStart(text_t *data, int oldpos, TCOD_key_t key) { + if ( data->multiline && data->cursor_pos != oldpos ) { + if ( key.shift ) { + if ( data->sel_start > data->cursor_pos ) data->sel_start = data->cursor_pos; + else data->sel_end = data->cursor_pos; + } else { + data->sel_start=MAX_INT; + data->sel_end=-1; + } + } +} + +/* increases the selection range end */ +static void selectEnd(text_t *data, int oldpos, TCOD_key_t key) { + if ( data->multiline && data->cursor_pos != oldpos ) { + if ( key.shift ) { + if ( data->sel_end < data->cursor_pos ) data->sel_end = data->cursor_pos; + else data->sel_start = data->cursor_pos; + } else { + data->sel_start=MAX_INT; + data->sel_end=-1; + } + } +} + +enum { TYPE_SYMBOL, TYPE_ALPHANUM, TYPE_SPACE }; +static const char txt_symbols[]="&~\"#'{([-|`_\\^@)]=+}*/!:;.,?<>"; + +/* check whether a character is a space */ +/* this is needed because cctype isspace() returns rubbish for many diacritics */ +static bool is_space (int ch) { + bool ret; + switch (ch) { + case ' ': case '\n': case '\r': case '\t': ret = true; break; + default: ret = false; break; + } + return ret; +} + +static void typecheck (int * type, int ch) { + if (strchr(txt_symbols,ch)) *type = TYPE_SYMBOL; + else if (is_space(ch)) *type = TYPE_SPACE; + else *type = TYPE_ALPHANUM; +} + +/* go one word left */ +static void previous_word(text_t *data) { + /* current character type */ + if ( data->cursor_pos > 0 ) { + /* detect current char type (alphanum/space or symbol) */ + char *ptr=data->text + data->cursor_pos - 1; + int curtype, prevtype; + typecheck(&curtype,*ptr); + /* go back until char type changes from alphanumeric to something else */ + do { + data->cursor_pos--; + ptr--; + prevtype = curtype; + typecheck(&curtype,*ptr); + } while ( data->cursor_pos > 0 && !(curtype != TYPE_ALPHANUM && prevtype == TYPE_ALPHANUM)); + } +} + +/* go one word right */ +static void next_word(text_t *data) { + /* current character type */ + if ( data->text[data->cursor_pos] ) { + /* detect current char type (alphanum/space or symbol) */ + char *ptr=data->text + data->cursor_pos; + int curtype, prevtype; + typecheck(&curtype,*ptr); + /* go forth until char type changes from non alphanumeric to alphanumeric */ + do { + data->cursor_pos++; + ptr++; + prevtype = curtype; + typecheck(&curtype,*ptr); + } while ( *ptr && !(curtype == TYPE_ALPHANUM && prevtype != TYPE_ALPHANUM)); + } +} + +/* erase the selected text */ +static void deleteSelection(text_t *data) { + int count = data->sel_end-data->sel_start; + data->cursor_pos = data->sel_start+1; + while ( count > 0 ) { + deleteChar(data); + count--; + data->cursor_pos++; + } + data->cursor_pos--; + data->sel_start=MAX_INT; + data->sel_end=-1; +} + +/* copy selected text to clipboard */ +static void copy(text_t *data) { + if ( data->sel_end - data->sel_start > 0 ) { + char *clipbuf = (char*)calloc(data->sel_end - data->sel_start+1,1); + char *ptr=clipbuf; + int i; + for (i=data->sel_start; i != data->sel_end; i++) { + *ptr++ = data->text[i]; + } + TCOD_sys_clipboard_set(clipbuf); + free(clipbuf); + } +} + +/* cut selected text to clipboard */ +static void cut(text_t *data) { + if ( data->sel_end - data->sel_start > 0 ) { + char *clipbuf = (char*)calloc(data->sel_end - data->sel_start+1,1); + char *ptr=clipbuf; + int i; + for (i=data->sel_start; i != data->sel_end; i++) { + *ptr++ = data->text[i]; + } + TCOD_sys_clipboard_set(clipbuf); + free(clipbuf); + deleteSelection(data); + } +} + +/* paste from clipboard */ +static void paste(text_t *data) { + char *clipbuf=TCOD_sys_clipboard_get(); + if ( clipbuf ) { + if ( data->sel_start != MAX_INT ) { + deleteSelection(data); + } + while (*clipbuf) { + insertChar(data,*clipbuf++); + } + } +} + +/* update returns false if enter has been pressed, true otherwise */ +bool TCOD_text_update (TCOD_text_t txt, TCOD_key_t key) { + int cx,cy,oldpos; + text_t * data = (text_t*)txt; + TCOD_IFNOT(data && data->con ) return false; + oldpos = data->cursor_pos; + /* for real-time keyboard : only on key release */ + if ( key.pressed ) { + /* process keyboard input */ + switch (key.vk) { + case TCODK_BACKSPACE: /* get rid of the last character */ + if ( data->sel_start != MAX_INT ) { + deleteSelection(data); + } else { + deleteChar(data); + } + break; + case TCODK_DELETE: + if ( key.shift ) { + /* SHIFT-DELETE : cut to clipboard */ + cut(data); + } else { + if ( data->sel_start != MAX_INT ) { + deleteSelection(data); + } else if ( data->text[data->cursor_pos] ) { + data->cursor_pos++; + deleteChar(data); + } + } + break; + /* shift + arrow / home / end = selection */ + /* ctrl + arrow = word skipping. ctrl + shift + arrow = word selection */ + case TCODK_LEFT: + if ( data->multiline && key.shift && data->sel_end == -1) { + data->sel_end = data->cursor_pos; + } + if ( data->cursor_pos > 0 ) { + if ( key.lctrl || key.rctrl ) { + previous_word(data); + } else data->cursor_pos--; + selectStart(data,oldpos,key); + } + break; + case TCODK_RIGHT: + if ( data->multiline && key.shift && data->sel_start == MAX_INT ) { + data->sel_start = data->cursor_pos; + } + if ( data->text[data->cursor_pos] ) { + if ( key.lctrl || key.rctrl ) { + next_word(data); + } else data->cursor_pos++; + selectEnd(data,oldpos,key); + } + break; + case TCODK_UP : + get_cursor_coords(data,&cx,&cy); + if ( data->multiline && key.shift && data->sel_end == -1) { + data->sel_end = data->cursor_pos; + } + set_cursor_pos(data,cx,cy-1,false); + selectStart(data,oldpos,key); + break; + case TCODK_DOWN : + get_cursor_coords(data,&cx,&cy); + if ( data->multiline && key.shift && data->sel_start == MAX_INT ) { + data->sel_start = data->cursor_pos; + } + set_cursor_pos(data,cx,cy+1,false); + selectEnd(data,oldpos,key); + break; + case TCODK_HOME: + get_cursor_coords(data,&cx,&cy); + if ( data->multiline && key.shift && data->sel_end == -1) { + data->sel_end = data->cursor_pos; + } + if ( key.lctrl || key.rctrl ) { + set_cursor_pos(data,0,0,true); + } else { + set_cursor_pos(data,0,cy,true); + } + selectStart(data,oldpos,key); + break; + case TCODK_END: + get_cursor_coords(data,&cx,&cy); + if ( data->multiline && key.shift && data->sel_start == MAX_INT ) { + data->sel_start = data->cursor_pos; + } + if ( key.lctrl || key.rctrl ) { + set_cursor_pos(data,data->w,data->h,true); + } else { + set_cursor_pos(data,data->w-1,cy,true); + } + selectEnd(data,oldpos,key); + break; + case TCODK_ENTER: /* validate input */ + case TCODK_KPENTER: + if ( data->sel_start != MAX_INT ) { + deleteSelection(data); + } + if ( data->multiline ) { + get_cursor_coords(data,&cx,&cy); + if ( cy < data->h-1 ) insertChar(data,'\n'); + } else { + data->input_continue = false; + } + break; + case TCODK_TAB : + if (data->tab_size ) { + int count=data->tab_size; + if ( data->sel_start != MAX_INT ) { + deleteSelection(data); + } + while ( count > 0 ) { + insertChar(data,' '); + count--; + } + } + break; + default: { /* append a new character */ + if ( (key.c == 'c' || key.c=='C' || key.vk == TCODK_INSERT) && (key.lctrl || key.rctrl) ) { + /* CTRL-C or CTRL-INSERT : copy to clipboard */ + copy(data); + } else if ( (key.c == 'x' || key.c=='X') && (key.lctrl || key.rctrl) ) { + /* CTRL-X : cut to clipboard */ + cut(data); + } else if ( ((key.c == 'v' || key.c=='V') && (key.lctrl || key.rctrl)) + || ( key.vk == TCODK_INSERT && key.shift ) + ) { + /* CTRL-V or SHIFT-INSERT : paste from clipboard */ + paste(data); + } else if (key.c > 31) { + if ( data->sel_start != MAX_INT ) { + deleteSelection(data); + } + insertChar(data,(char)(key.c)); + } + break; + } + } + } + return data->input_continue; +} + +/* renders the textfield */ +void TCOD_text_render (TCOD_text_t txt, TCOD_console_t con) { + text_t * data = (text_t*)txt; + uint32_t time; + bool cursor_on; + char back=0; + int curx,cury,cursorx,cursory, curpos; + char *ptr; + TCOD_IFNOT(data && data->con ) return; + time = TCOD_sys_elapsed_milli(); + cursor_on = (int)( time % data->interval ) > data->halfinterval; + TCOD_console_set_default_background(data->con, data->back); + TCOD_console_set_default_foreground(data->con, data->fore); + TCOD_console_clear(data->con); + + /* compute cursor position */ + get_cursor_coords(data,&cursorx,&cursory); + + if ( cursor_on && data->ascii_cursor) { + /* save the character under cursor position */ + back = data->text[data->cursor_pos]; + data->text[data->cursor_pos] = data->ascii_cursor; + } + /* render prompt */ + if (data->prompt) TCOD_console_print_rect_ex(data->con,0,0,data->w,data->h,TCOD_BKGND_SET,TCOD_LEFT,"%s",data->prompt); + /* render text */ + curx=data->textx; + cury=data->texty; + ptr=data->text; + curpos=0; + while (*ptr) { + if ( *ptr == '\n') { + if ( (curx == 0 || curpos == 0 ) && curpos >= data->sel_start && curpos < data->sel_end ) { + /* inverted colors for selected empty lines */ + TCOD_console_set_char_background(data->con, curx, cury, data->fore, TCOD_BKGND_SET); + TCOD_console_set_char_foreground(data->con, curx, cury, data->back); + } + curx=0; + cury++; + } else { + if ( curpos >= data->sel_start && curpos < data->sel_end ) { + /* inverted colors for selection */ + TCOD_console_set_char_background(data->con, curx, cury, data->fore, TCOD_BKGND_SET); + TCOD_console_set_char_foreground(data->con, curx, cury, data->back); + } + TCOD_console_set_char(data->con,curx,cury,*ptr); + curx++; + if ( curx == data->w ) { + curx=0; + cury++; + } + } + ptr++; + curpos++; + } + if ( cursor_on ) { + if ( data->ascii_cursor) { + /* restore the character under cursor */ + data->text[data->cursor_pos] = back; + } else { + /* invert colors at cursor position */ + TCOD_console_set_char_background(data->con,cursorx,cursory,data->fore,TCOD_BKGND_SET); + TCOD_console_set_char_foreground(data->con,cursorx,cursory,data->back); + } + } else if (! cursor_on && ! data->ascii_cursor && data->multiline ) { + /* normal colors for cursor ( might be inside selection ) */ + TCOD_console_set_char_background(data->con,cursorx,cursory,data->back,TCOD_BKGND_SET); + TCOD_console_set_char_foreground(data->con,cursorx,cursory,data->fore); + } + TCOD_console_blit(data->con,0,0,data->w,data->h,con,data->x,data->y,1.0f,data->transparency); +} + +/* returns the text currently stored in the textfield object */ +const char * TCOD_text_get (TCOD_text_t txt) { + text_t * data = (text_t*)txt; + TCOD_IFNOT(data && data->con ) return ""; + return data->text; +} + +/* resets the text initial state */ +void TCOD_text_reset (TCOD_text_t txt) { + text_t * data = (text_t*)txt; + TCOD_IFNOT(data && data->con ) return; + memset(data->text,'\0',data->len); + data->curlen = 0; + data->cursor_pos = 0; + data->sel_start = MAX_INT; + data->sel_end = -1; + data->input_continue = true; +} + +/* destructor */ +void TCOD_text_delete (TCOD_text_t txt) { + text_t * data = (text_t*)txt; + TCOD_IFNOT(data && data->con ) return; + if ( data->text ) free(data->text); + if ( data->prompt ) free(data->prompt); + TCOD_console_delete(data->con); + free(data); +} diff --git a/tcod_sys/libtcod/src/libtcod/utility.h b/tcod_sys/libtcod/src/libtcod/utility.h new file mode 100644 index 000000000..4f7c50796 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/utility.h @@ -0,0 +1,43 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_UTILITY_H +#define LIBTCOD_UTILITY_H +/****************************************** + utility macros + ******************************************/ +#define MAX(a,b) (((a)>(b))?(a):(b)) +#define MIN(a,b) (((a)<(b))?(a):(b)) +#define ABS(a) ((a)<0?-(a):(a)) +#define CLAMP(a, b, x) ((x) < (a) ? (a) : ((x) > (b) ? (b) : (x))) +#define LERP(a, b, x) ( (a) + (x) * ((b) - (a)) ) + +#endif diff --git a/tcod_sys/libtcod/src/libtcod/utility/matrix.h b/tcod_sys/libtcod/src/libtcod/utility/matrix.h new file mode 100644 index 000000000..2127d6753 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/utility/matrix.h @@ -0,0 +1,248 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_UTILITY_MATRIX_H_ +#define LIBTCOD_UTILITY_MATRIX_H_ +#ifdef __cplusplus +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif // __cplusplus +#ifdef __cplusplus +namespace tcod { +template +class MatrixView { + public: + using value_type = T; + using size_type = ptrdiff_t; + using shape_type = std::array; + using strides_type = std::array; + using index_type = std::array; + MatrixView() = default; + MatrixView(T* ptr, const shape_type& shape, const strides_type& strides) + : data_{reinterpret_cast(ptr)}, shape_{shape}, strides_{strides} + {} + MatrixView(T* ptr, const shape_type& shape) + : MatrixView(ptr, shape, get_contiguous_strides(shape)) + {} + T& operator[](index_type index) noexcept + { + return *get_data_at(index); + } + const T& operator[](index_type index) const noexcept + { + return *get_data_at(index); + } + T& at(index_type index) + { + range_check(index); + return (*this)[index]; + } + const T& at(index_type index) const + { + range_check(index); + return (*this)[index]; + } + shape_type get_shape() const + { + return shape_; + } + bool in_range(size_type n) const noexcept + { + return 0 <= n && n < shape_.at(0); + } + bool in_range(index_type index) const noexcept + { + for (size_t i = 0; i < shape_.size(); ++i) { + if (index.at(i) < 0 || index.at(i) >= shape_.at(i)) { + return false; + } + } + return true; + } + private: + T* get_data_at(index_type index) + { + auto ptr = data_; + for (size_t i = 0; i < shape_.size(); ++i) { + ptr += index.at(i) * strides_.at(i); + } + return reinterpret_cast(ptr); + } + const T* get_data_at(index_type index) const + { + auto ptr = data_; + for (size_t i = 0; i < shape_.size(); ++i) { + ptr += index.at(i) * strides_.at(i); + } + return reinterpret_cast(ptr); + } + MatrixView get_submatrix(size_type n) + { + return { + data_ + n * strides_.at(0), + pop_array(shape_), + pop_array(strides_) + }; + } + void range_check(size_type n) const + { + if (in_range(n)) { return; } + throw std::out_of_range( + std::string("Out of bounds lookup {") + + std::to_string(n) + + "} on matrix of shape " + + array_as_string(shape_) + + "."); + } + void range_check(index_type index) const + { + if (in_range(index)) { return; } + throw std::out_of_range( + std::string("Out of bounds lookup ") + + array_as_string(index) + + " on matrix of shape " + + array_as_string(shape_) + + "."); + } + template + static std::string array_as_string(const ArrayType& arr) + { + std::string result{"{ "}; + for (const auto& it : arr) { + result += std::to_string(it); + if (it != arr.back()) { result += ", "; } + } + result += " }"; + return result; + } + auto pop_array(const std::array& array) const noexcept + -> std::array + { + std::array new_array; + std::copy(array[1], array.end(), new_array.begin()); + return new_array; + } + static strides_type get_contiguous_strides(shape_type shape) + { + strides_type strides; + size_type stride = static_cast(sizeof(T)); + for (size_type i = strides.size() - 1; i >= 0; --i) { + strides.at(i) = stride; + stride *= shape.at(i); + } + return strides; + } + char* data_{nullptr}; + shape_type shape_; + strides_type strides_; +}; +template +class Matrix { + public: + using view_type = MatrixView; + using value_type = typename view_type::value_type; + using size_type = typename view_type::size_type; + using shape_type = typename view_type::shape_type; + using strides_type = typename view_type::strides_type; + using index_type = typename view_type::shape_type; + Matrix() = default; + Matrix(const shape_type& shape) + : data_(get_size_from_shape(shape)), view_(data_.data(), shape) + {} + Matrix(const shape_type& shape, const value_type& fill) + : data_(get_size_from_shape(shape), fill), view_(data_.data(), shape) + {} + auto begin() noexcept + { + return data_.begin(); + } + auto begin() const noexcept + { + return data_.cbegin(); + } + auto end() noexcept + { + return data_.end(); + } + auto end() const noexcept + { + return data_.cend(); + } + value_type& operator[](index_type index) noexcept + { + return view_[index]; + } + const value_type& operator[](index_type index) const noexcept + { + return view_[index]; + } + value_type& at(index_type index) + { + return view_.at(index); + } + const value_type& at(index_type index) const + { + return view_.at(index); + } + shape_type get_shape() const + { + return view_.get_shape(); + } + bool in_range(size_type n) const noexcept + { + return view_.in_range(n); + } + bool in_range(index_type index) const noexcept + { + return view_.in_range(index); + } + private: + static size_t get_size_from_shape(const shape_type& shape) noexcept + { + size_t size = 1; + for (size_t i = 0; i < shape.size(); ++i) { + size *= shape.at(i); + } + return size; + } + std::vector data_; + view_type view_; +}; +} // namespace tcod +#endif // __cplusplus +#endif // LIBTCOD_UTILITY_MATRIX_H_ diff --git a/tcod_sys/libtcod/src/libtcod/utility/vector2.h b/tcod_sys/libtcod/src/libtcod/utility/vector2.h new file mode 100644 index 000000000..7b43f4876 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/utility/vector2.h @@ -0,0 +1,225 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_UTILITY_VECTOR2_H_ +#define LIBTCOD_UTILITY_VECTOR2_H_ +#ifdef __cplusplus +#include +#include +#include +#include +#include +#include +#include +#include +#endif // __cplusplus + +#ifdef __cplusplus +namespace tcod { +template +/** + * A 2-dimensional vector array. + */ +class Vector2 { + public: + using value_type = T; + using size_type = ptrdiff_t; + using iterator = typename std::vector::iterator; + using const_iterator = typename std::vector::const_iterator; + Vector2() = default; + explicit Vector2(size_type width, size_type height, const T& fill) + : width_(std::max(0, width)), + height_(std::max(0, height)), + vector_(width_ * height_, fill) + {} + explicit Vector2(size_type width, size_type height) + : width_(std::max(0, width)), + height_(std::max(0, height)), + vector_(width_ * height_) {} + explicit Vector2( + const std::initializer_list>& array) + : Vector2( + std::max(array, + [](auto a, auto b){ return a.size() < b.size(); }).size(), + array.size() + ) + { + auto iter_out = vector_.begin(); + for (const auto row : array) { + std::copy(row.begin(), row.end(), iter_out); + iter_out += width_; + } + } + Vector2(Vector2&&) = default; + Vector2& operator=(Vector2&&) = default; + Vector2(const Vector2&) = default; + Vector2& operator=(const Vector2&) = default; + /** Return the width of this 2d vector. */ + size_type width(void) const noexcept { return width_; } + /** Return the height of this 2d vector. */ + size_type height(void) const noexcept { return height_; } + value_type& operator[](const std::array& index) noexcept + { + return vector_[index[0] * width_ + index[1]]; + } + const value_type& operator[](const std::array& index) const noexcept + { + return vector_[index[0] * width_ + index[1]]; + } + value_type& at(const std::array& index) + { + range_check(index[1], index[0]); + return (*this)[index]; + } + const value_type& at(const std::array& index) const + { + range_check(index[1], index[0]); + return (*this)[index]; + } + /** + * Return a reference for the pixel at `x`,`y`. + * + * Throws std::out_of_range if `x` or `y` are out of bounds. + */ + T& atf(size_type x, size_type y) { + range_check(x, y); + return vector_.at(y * width_ + x); + } + /** + * Return a reference for the value at `index`. + */ + T& atf(const std::tuple& index) + { + return atf(std::get<0>(index), std::get<1>(index)); + } + T& atf(const std::array& index) + { + return atf(index.at(0), index.at(1)); + } + /** + * Return a constant reference for the pixel at `x`,`y`. + * + * Throws std::out_of_range if `x` or `y` are out of bounds. + */ + const T& atf(size_type x, size_type y) const + { + range_check(x, y); + return vector_.at(y * width_ + x); + } + const T& atf(const std::array& index) const + { + return atf(index.at(0), index.at(1)); + } + /** + * Return a constant reference for the value at `index`. + */ + const T& atf(const std::tuple& index) const + { + return atf(std::get<0>(index), std::get<1>(index)); + } + T* data() noexcept + { + return vector_.data(); + } + const T* data() const noexcept + { + return vector_.data(); + } + iterator begin() noexcept + { + return vector_.begin(); + } + iterator end() noexcept + { + return vector_.end(); + } + const_iterator begin() const noexcept + { + return vector_.begin(); + } + const_iterator end() const noexcept + { + return vector_.end(); + } + bool operator==(const Vector2& rhs) const noexcept + { + return width_ == rhs.width_ && vector_ == rhs.vector_; + } + private: + /** + * Return true if x and y are in the bounds of this canvas. + */ + bool in_boundsf(size_type x, size_type y) const noexcept { + return 0 <= x && x < width_ && 0 <= y && y < height_; + } + /** + * Immediately throws std::out_of_range if `x` or `y` are out of bounds. + */ + void range_check(size_type x, size_type y) const { + if (!in_boundsf(x, y)) { + throw std::out_of_range( + std::string("Out of bounds lookup {") + + std::to_string(x) + + ", " + + std::to_string(y) + + "} on Vector2 of size {" + + std::to_string(width_) + + ", " + + std::to_string(height_) + + "}."); + } + } + /** The width of this canvas. */ + size_type width_ = 0; + /** The height of this canvas. */ + size_type height_ = 0; + /** A 1d vector mapped to a 2d array of pixels. */ + std::vector vector_; +}; +template +std::ostream& operator<< (std::ostream &out, const Vector2& data) +{ + out << '{'; + for (int y = 0; y < data.height(); ++y) { + out << '{'; + for (int x = 0; x < data.width(); ++x) { + out << data.atf(x, y); + if (x != data.width() - 1) { out << ',' << ' '; } + } + out << '}'; + if (y != data.height() - 1) { out << ',' << ' '; } + } + out << '}'; + return out; +} +} // namespace tcod +#endif // __cplusplus +#endif // LIBTCOD_UTILITY_VECTOR2_H_ diff --git a/tcod_sys/libtcod/src/libtcod/version.h b/tcod_sys/libtcod/src/libtcod/version.h new file mode 100644 index 000000000..d530a8697 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/version.h @@ -0,0 +1,48 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef LIBTCOD_VERSION_H +#define LIBTCOD_VERSION_H + +#define TCOD_MAJOR_VERSION 1 +#define TCOD_MINOR_VERSION 16 +#define TCOD_PATCHLEVEL 0 + +#define TCOD_STRVERSION "1.16.0-alpha.12" + +#define TCOD_HEXVERSION (0x010000 * TCOD_MAJOR_VERSION \ + + 0x0100 * TCOD_MINOR_VERSION \ + + 0x01 * TCOD_PATCHLEVEL) +#define TCOD_TECHVERSION (TCOD_HEXVERSION * 0x100) + +#define TCOD_STRVERSIONNAME "libtcod " TCOD_STRVERSION + +#endif /* LIBTCOD_VERSION_H */ diff --git a/tcod_sys/libtcod/src/wrappers.c b/tcod_sys/libtcod/src/libtcod/wrappers.c similarity index 63% rename from tcod_sys/libtcod/src/wrappers.c rename to tcod_sys/libtcod/src/libtcod/wrappers.c index c9ce37b78..d8c1004b4 100644 --- a/tcod_sys/libtcod/src/wrappers.c +++ b/tcod_sys/libtcod/src/libtcod/wrappers.c @@ -1,377 +1,367 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include - -#include -#include -#include - -#define RED_MASK 0x0000FF -#define GREEN_MASK 0x00FF00 -#define BLUE_MASK 0xFF0000 - -TCOD_color_t int_to_color (colornum_t col) { - TCOD_color_t ret; - ret.r = col & RED_MASK; - ret.g = (col & GREEN_MASK) >> 8; - ret.b = (col & BLUE_MASK) >> 16; - return ret; -} - -#define color_to_int(col) (int)(((int)((col).b) << 16) | ((col).g << 8) | (col).r) - -bool TCOD_color_equals_wrapper (colornum_t c1, colornum_t c2) { - return TCOD_color_equals (int_to_color(c1), int_to_color(c2)); -} - -colornum_t TCOD_color_add_wrapper (colornum_t c1, colornum_t c2) { - return color_to_int(TCOD_color_add (int_to_color(c1), - int_to_color(c2))); -} - -colornum_t TCOD_color_subtract_wrapper (colornum_t c1, colornum_t c2) { - return color_to_int(TCOD_color_subtract (int_to_color(c1), - int_to_color(c2))); -} - -colornum_t TCOD_color_multiply_wrapper (colornum_t c1, colornum_t c2) -{ - return color_to_int(TCOD_color_multiply (int_to_color(c1), int_to_color(c2))); -} - -colornum_t TCOD_color_multiply_scalar_wrapper (colornum_t c1, float value) -{ - return color_to_int(TCOD_color_multiply_scalar (int_to_color(c1), - value)); -} - -colornum_t TCOD_color_lerp_wrapper(colornum_t c1, colornum_t c2, float coef) -{ - return color_to_int(TCOD_color_lerp (int_to_color(c1),int_to_color(c2), - coef)); -} - -void TCOD_color_get_HSV_wrapper(colornum_t c,float * h, - float * s, float * v) -{ - TCOD_color_get_HSV (int_to_color(c), h, s, v); -} - -float TCOD_color_get_hue_wrapper (colornum_t c) { - return TCOD_color_get_hue(int_to_color(c)); -} - -float TCOD_color_get_saturation_wrapper (colornum_t c) { - return TCOD_color_get_saturation(int_to_color(c)); -} - -float TCOD_color_get_value_wrapper (colornum_t c) { - return TCOD_color_get_value(int_to_color(c)); -} - -#ifdef TCOD_CONSOLE_SUPPORT - -colornum_t TCOD_console_get_default_background_wrapper(TCOD_console_t con) -{ - return color_to_int(TCOD_console_get_default_background (con)); -} - - -colornum_t TCOD_console_get_default_foreground_wrapper(TCOD_console_t con) -{ - return color_to_int(TCOD_console_get_default_foreground (con)); -} - - -void TCOD_console_set_default_background_wrapper(TCOD_console_t con, - colornum_t col) -{ - TCOD_console_set_default_background (con, - int_to_color(col)); -} - -void TCOD_console_set_default_foreground_wrapper(TCOD_console_t con, - colornum_t col) -{ - TCOD_console_set_default_foreground (con, - int_to_color(col)); -} - -colornum_t TCOD_console_get_char_foreground_wrapper(TCOD_console_t con, - int x, int y) -{ - return color_to_int(TCOD_console_get_char_foreground (con, x, y)); -} - -colornum_t TCOD_console_get_char_background_wrapper(TCOD_console_t con, - int x, int y) -{ - return color_to_int(TCOD_console_get_char_background (con, x, y)); -} - -void TCOD_console_set_char_background_wrapper(TCOD_console_t con,int x, int y, - colornum_t col, - TCOD_bkgnd_flag_t flag) -{ - TCOD_console_set_char_background (con, x, y, int_to_color(col), flag); -} - - -void TCOD_console_set_char_foreground_wrapper(TCOD_console_t con,int x, int y, - colornum_t col) -{ - TCOD_console_set_char_foreground (con, x, y, int_to_color(col)); -} - -void TCOD_console_put_char_ex_wrapper(TCOD_console_t con, int x, int y, - int c, colornum_t fore, colornum_t back) -{ - TCOD_console_put_char_ex (con, x, y, c, int_to_color(fore), - int_to_color(back)); -} - -void TCOD_console_set_fade_wrapper(uint8_t val, colornum_t fade) -{ - TCOD_console_set_fade (val, int_to_color(fade)); -} - -void TCOD_console_fill_background(TCOD_console_t con, int *r, int *g, int *b) { - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - int i; - TCOD_color_t *curcolor = TCOD_image_get_colors(dat->bg_colors); - for (i = 0; i < dat->w*dat->h; i++) { - curcolor->r = *r; - curcolor->g = *g; - curcolor->b = *b; - curcolor++; - r++; - g++; - b++; - } -} - -void TCOD_console_fill_foreground(TCOD_console_t con, int *r, int *g, int *b) { - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - int i; - TCOD_color_t *curcolor = TCOD_image_get_colors(dat->fg_colors); - for (i = 0; i < dat->w*dat->h; i++) { - curcolor->r = *r; - curcolor->g = *g; - curcolor->b = *b; - curcolor++; - r++; - g++; - b++; - } -} - -void TCOD_console_fill_char(TCOD_console_t con, int *arr) { - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - int i; - for (i = 0; i < dat->w*dat->h; i++) { - dat->ch_array[i] = arr[i]; - } -} - -colornum_t -TCOD_console_get_fading_color_wrapper () -{ - return color_to_int(TCOD_console_get_fading_color()); -} - -void TCOD_console_set_color_control_wrapper(TCOD_colctrl_t con, - colornum_t fore, - colornum_t back) -{ - TCOD_console_set_color_control (con, - int_to_color(fore), - int_to_color(back)); -} - -#endif /* TCOD_CONSOLE_SUPPORT */ - -#ifdef TCOD_IMAGE_SUPPORT -void TCOD_image_clear_wrapper(TCOD_image_t image, - colornum_t color) -{ - TCOD_image_clear (image, - int_to_color(color)); -} - -colornum_t TCOD_image_get_pixel_wrapper(TCOD_image_t image, - int x, int y) -{ - return color_to_int(TCOD_image_get_pixel (image, x, y)); -} - -colornum_t TCOD_image_get_mipmap_pixel_wrapper(TCOD_image_t image, - float x0,float y0, float x1, float y1) -{ - return color_to_int(TCOD_image_get_mipmap_pixel (image, - x0, y0, x1, y1)); -} - -void TCOD_image_put_pixel_wrapper(TCOD_image_t image,int x, int y, - colornum_t col) -{ - TCOD_image_put_pixel (image, x, y, - int_to_color( col)); -} - -void TCOD_image_set_key_color_wrapper(TCOD_image_t image, - colornum_t key_color) -{ - TCOD_image_set_key_color (image, - int_to_color(key_color)); -} -#endif /* TCOD_IMAGE_SUPPORT */ - -#ifdef TCOD_CONSOLE_SUPPORT - -bool TCOD_console_check_for_keypress_wrapper (TCOD_key_t *holder, int flags) -{ - *holder = TCOD_console_check_for_keypress(flags); - return (holder->vk != TCODK_NONE); -} - - -void TCOD_console_wait_for_keypress_wrapper (TCOD_key_t *holder, bool flush) -{ - *holder = TCOD_console_wait_for_keypress(flush); -} - -void TCOD_mouse_get_status_wrapper(TCOD_mouse_t *mouse) { - *mouse=TCOD_mouse_get_status(); -} - -/* Routines to draw hlines, vlines and frames using the double-lined - * characters. */ - -void TCOD_console_double_hline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag) { - int i; - for (i=x; i< x+l; i++) TCOD_console_put_char(con,i,y,TCOD_CHAR_DHLINE,flag); -} - -void TCOD_console_double_vline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag) { - int i; - for (i=y; i< y+l; i++) TCOD_console_put_char(con,x,i,TCOD_CHAR_DVLINE,flag); -} - - -void TCOD_console_print_double_frame(TCOD_console_t con,int x,int y,int w,int h, bool empty, TCOD_bkgnd_flag_t flag, const char *fmt, ...) { - TCOD_console_data_t *dat = con ? (TCOD_console_data_t *)con : TCOD_ctx.root; - TCOD_console_put_char(con,x,y,TCOD_CHAR_DNW,flag); - TCOD_console_put_char(con,x+w-1,y,TCOD_CHAR_DNE,flag); - TCOD_console_put_char(con,x,y+h-1,TCOD_CHAR_DSW,flag); - TCOD_console_put_char(con,x+w-1,y+h-1,TCOD_CHAR_DSE,flag); - TCOD_console_double_hline(con,x+1,y,w-2, flag); - TCOD_console_double_hline(con,x+1,y+h-1,w-2, flag); - TCOD_console_double_vline(con,x,y+1,h-2, flag); - TCOD_console_double_vline(con,x+w-1,y+1,h-2, flag); - if ( h > 2 ) { - TCOD_console_vline(con,x,y+1,h-2,flag); - TCOD_console_vline(con,x+w-1,y+1,h-2,flag); - if ( empty ) { - TCOD_console_rect(con,x+1,y+1,w-2,h-2,true,flag); - } - } - if (fmt) { - va_list ap; - int xs; - TCOD_color_t tmp; - char *title; - va_start(ap,fmt); - title = TCOD_console_vsprint(fmt,ap); - va_end(ap); - title[w-3]=0; /* truncate if needed */ - xs = x + (w-(int)strlen(title)-2)/2; - tmp=dat->back; /* swap colors */ - dat->back=dat->fore; - dat->fore=tmp; - TCOD_console_print_ex(con,xs,y,TCOD_BKGND_SET,TCOD_LEFT," %s ",title); - tmp=dat->back; /* swap colors */ - dat->back=dat->fore; - dat->fore=tmp; - } -} - - -char *TCOD_console_print_return_string(TCOD_console_t con,int x,int y, int rw, - int rh, TCOD_bkgnd_flag_t flag, - TCOD_alignment_t align, char *msg, bool can_split, bool count_only) { - TCOD_console_print_internal(con,x,y,rw,rh,flag,align,msg,can_split,count_only); - return msg; -} - -#endif /* TCOD_CONSOLE_SUPPORT */ - -colornum_t TCOD_parser_get_color_property_wrapper(TCOD_parser_t parser, const char *name) { - return color_to_int(TCOD_parser_get_color_property(parser,name)); -} - -int TCOD_namegen_get_nb_sets_wrapper(void) { - TCOD_list_t l=TCOD_namegen_get_sets(); - int nb = TCOD_list_size(l); - TCOD_list_delete(l); - return nb; -} - -void TCOD_namegen_get_sets_wrapper(char **sets) { - TCOD_list_t l=TCOD_namegen_get_sets(); - char **it; - int i=0; - for (it=(char**)TCOD_list_begin(l); it != (char **)TCOD_list_end(l); it++) { - sets[i++]=*it; - } -} - -#ifndef TCOD_BARE -int TCOD_sys_get_current_resolution_x() -{ - int x, y; - TCOD_sys_get_current_resolution(&x, &y); - return x; -} - -int TCOD_sys_get_current_resolution_y() -{ - int x, y; - TCOD_sys_get_current_resolution(&x, &y); - return y; -} -#endif - -#ifdef TCOD_CONSOLE_SUPPORT -void TCOD_console_set_key_color_wrapper (TCOD_console_t con, colornum_t c) -{ - TCOD_console_set_key_color(con, int_to_color(c)); -} -#endif +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "wrappers.h" + +#include +#include + +#include "console.h" +#include "console_drawing.h" +#include "console_etc.h" +#include "console_printing.h" +#include "libtcod_int.h" +#include "namegen.h" + +#define RED_MASK 0x0000FF +#define GREEN_MASK 0x00FF00 +#define BLUE_MASK 0xFF0000 + +TCOD_color_t int_to_color (colornum_t col) { + TCOD_color_t ret; + ret.r = col & RED_MASK; + ret.g = (col & GREEN_MASK) >> 8; + ret.b = (col & BLUE_MASK) >> 16; + return ret; +} + +static colornum_t color_to_int(const TCOD_ColorRGB color) +{ + return (color.b << 16) | (color.g << 8) | color.r; +} + +bool TCOD_color_equals_wrapper (colornum_t c1, colornum_t c2) { + return TCOD_color_equals (int_to_color(c1), int_to_color(c2)); +} + +colornum_t TCOD_color_add_wrapper (colornum_t c1, colornum_t c2) { + return color_to_int(TCOD_color_add(int_to_color(c1), int_to_color(c2))); +} + +colornum_t TCOD_color_subtract_wrapper (colornum_t c1, colornum_t c2) { + return color_to_int(TCOD_color_subtract(int_to_color(c1), int_to_color(c2))); +} + +colornum_t TCOD_color_multiply_wrapper (colornum_t c1, colornum_t c2) +{ + return color_to_int(TCOD_color_multiply(int_to_color(c1), int_to_color(c2))); +} + +colornum_t TCOD_color_multiply_scalar_wrapper (colornum_t c1, float value) +{ + return color_to_int(TCOD_color_multiply_scalar(int_to_color(c1), value)); +} + +colornum_t TCOD_color_lerp_wrapper(colornum_t c1, colornum_t c2, float coef) +{ + return color_to_int(TCOD_color_lerp(int_to_color(c1),int_to_color(c2),coef)); +} + +void TCOD_color_get_HSV_wrapper(colornum_t c,float * h, float * s, float * v) +{ + TCOD_color_get_HSV (int_to_color(c), h, s, v); +} + +float TCOD_color_get_hue_wrapper (colornum_t c) { + return TCOD_color_get_hue(int_to_color(c)); +} + +float TCOD_color_get_saturation_wrapper (colornum_t c) { + return TCOD_color_get_saturation(int_to_color(c)); +} + +float TCOD_color_get_value_wrapper (colornum_t c) { + return TCOD_color_get_value(int_to_color(c)); +} + +colornum_t TCOD_console_get_default_background_wrapper(TCOD_console_t con) +{ + return color_to_int(TCOD_console_get_default_background (con)); +} + + +colornum_t TCOD_console_get_default_foreground_wrapper(TCOD_console_t con) +{ + return color_to_int(TCOD_console_get_default_foreground (con)); +} + + +void TCOD_console_set_default_background_wrapper(TCOD_console_t con, + colornum_t col) +{ + TCOD_console_set_default_background (con, + int_to_color(col)); +} + +void TCOD_console_set_default_foreground_wrapper(TCOD_console_t con, + colornum_t col) +{ + TCOD_console_set_default_foreground (con, + int_to_color(col)); +} + +colornum_t TCOD_console_get_char_foreground_wrapper(TCOD_console_t con, + int x, int y) +{ + return color_to_int(TCOD_console_get_char_foreground (con, x, y)); +} + +colornum_t TCOD_console_get_char_background_wrapper(TCOD_console_t con, + int x, int y) +{ + return color_to_int(TCOD_console_get_char_background (con, x, y)); +} + +void TCOD_console_set_char_background_wrapper(TCOD_console_t con,int x, int y, + colornum_t col, + TCOD_bkgnd_flag_t flag) +{ + TCOD_console_set_char_background (con, x, y, int_to_color(col), flag); +} + + +void TCOD_console_set_char_foreground_wrapper(TCOD_console_t con,int x, int y, + colornum_t col) +{ + TCOD_console_set_char_foreground (con, x, y, int_to_color(col)); +} + +void TCOD_console_put_char_ex_wrapper(TCOD_console_t con, int x, int y, + int c, colornum_t fore, colornum_t back) +{ + TCOD_console_put_char_ex (con, x, y, c, int_to_color(fore), + int_to_color(back)); +} + +void TCOD_console_set_fade_wrapper(uint8_t val, colornum_t fade) +{ + TCOD_console_set_fade (val, int_to_color(fade)); +} + +void TCOD_console_fill_background(TCOD_Console* con, int *r, int *g, int *b) +{ + con = TCOD_console_validate_(con); + if (!con) { return; } + for (int i = 0; i < con->w * con->h; ++i) { + con->tiles[i].bg = (TCOD_ColorRGBA){ + (uint8_t)r[i], (uint8_t)g[i], (uint8_t)b[i], 255}; + } +} +void TCOD_console_fill_foreground(TCOD_Console* con, int *r, int *g, int *b) +{ + con = TCOD_console_validate_(con); + if (!con) { return; } + for (int i = 0; i < con->w * con->h; ++i) { + con->tiles[i].fg = (TCOD_ColorRGBA){ + (uint8_t)r[i], (uint8_t)g[i], (uint8_t)b[i], 255}; + } +} +void TCOD_console_fill_char(TCOD_Console* con, int *arr) +{ + con = TCOD_console_validate_(con); + if (!con) { return; } + for (int i = 0; i < con->w * con->h; ++i) { + con->tiles[i].ch = arr[i]; + } +} + +colornum_t +TCOD_console_get_fading_color_wrapper () +{ + return color_to_int(TCOD_console_get_fading_color()); +} + +void TCOD_console_set_color_control_wrapper(TCOD_colctrl_t con, + colornum_t fore, + colornum_t back) +{ + TCOD_console_set_color_control (con, + int_to_color(fore), + int_to_color(back)); +} + +void TCOD_image_clear_wrapper(TCOD_image_t image, + colornum_t color) +{ + TCOD_image_clear (image, + int_to_color(color)); +} + +colornum_t TCOD_image_get_pixel_wrapper(TCOD_image_t image, + int x, int y) +{ + return color_to_int(TCOD_image_get_pixel (image, x, y)); +} + +colornum_t TCOD_image_get_mipmap_pixel_wrapper(TCOD_image_t image, + float x0,float y0, float x1, float y1) +{ + return color_to_int(TCOD_image_get_mipmap_pixel (image, + x0, y0, x1, y1)); +} + +void TCOD_image_put_pixel_wrapper(TCOD_image_t image,int x, int y, + colornum_t col) +{ + TCOD_image_put_pixel (image, x, y, + int_to_color( col)); +} + +void TCOD_image_set_key_color_wrapper(TCOD_image_t image, + colornum_t key_color) +{ + TCOD_image_set_key_color (image, + int_to_color(key_color)); +} + +bool TCOD_console_check_for_keypress_wrapper (TCOD_key_t *holder, int flags) +{ + *holder = TCOD_console_check_for_keypress(flags); + return (holder->vk != TCODK_NONE); +} + + +void TCOD_console_wait_for_keypress_wrapper (TCOD_key_t *holder, bool flush) +{ + *holder = TCOD_console_wait_for_keypress(flush); +} + +void TCOD_mouse_get_status_wrapper(TCOD_mouse_t *mouse) { + *mouse=TCOD_mouse_get_status(); +} + +/* Routines to draw hlines, vlines and frames using the double-lined + * characters. */ + +void TCOD_console_double_hline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag) { + int i; + for (i=x; i< x+l; i++) TCOD_console_put_char(con,i,y,TCOD_CHAR_DHLINE,flag); +} + +void TCOD_console_double_vline(TCOD_console_t con,int x,int y, int l, TCOD_bkgnd_flag_t flag) { + int i; + for (i=y; i< y+l; i++) TCOD_console_put_char(con,x,i,TCOD_CHAR_DVLINE,flag); +} + +void TCOD_console_print_double_frame( + TCOD_Console* con, + int x, + int y, + int w, + int h, + bool empty, + TCOD_bkgnd_flag_t flag, + const char *fmt, + ...) +{ + struct TCOD_Console *dat = TCOD_console_validate_(con); + if (!dat) { return; } + TCOD_console_put_char(con,x,y,TCOD_CHAR_DNW,flag); + TCOD_console_put_char(con,x+w-1,y,TCOD_CHAR_DNE,flag); + TCOD_console_put_char(con,x,y+h-1,TCOD_CHAR_DSW,flag); + TCOD_console_put_char(con,x+w-1,y+h-1,TCOD_CHAR_DSE,flag); + TCOD_console_double_hline(con,x+1,y,w-2, flag); + TCOD_console_double_hline(con,x+1,y+h-1,w-2, flag); + TCOD_console_double_vline(con,x,y+1,h-2, flag); + TCOD_console_double_vline(con,x+w-1,y+1,h-2, flag); + if ( h > 2 ) { + TCOD_console_vline(con,x,y+1,h-2,flag); + TCOD_console_vline(con,x+w-1,y+1,h-2,flag); + if ( empty ) { + TCOD_console_rect(con,x+1,y+1,w-2,h-2,true,flag); + } + } + if (fmt) { + va_list ap; + int xs; + TCOD_color_t tmp; + char *title; + va_start(ap,fmt); + title = TCOD_console_vsprint(fmt,ap); + va_end(ap); + title[w-3]=0; /* truncate if needed */ + xs = x + (w - (int)strlen(title) - 2) / 2; + tmp=dat->back; /* swap colors */ + dat->back=dat->fore; + dat->fore=tmp; + TCOD_console_print_ex(con,xs,y,TCOD_BKGND_SET,TCOD_LEFT," %s ",title); + tmp=dat->back; /* swap colors */ + dat->back=dat->fore; + dat->fore=tmp; + } +} + + +char *TCOD_console_print_return_string(TCOD_console_t con,int x,int y, int rw, + int rh, TCOD_bkgnd_flag_t flag, + TCOD_alignment_t align, char *msg, bool can_split, bool count_only) { + TCOD_console_print_internal(con,x,y,rw,rh,flag,align,msg,can_split,count_only); + return msg; +} + +colornum_t TCOD_parser_get_color_property_wrapper(TCOD_parser_t parser, const char *name) { + return color_to_int(TCOD_parser_get_color_property(parser,name)); +} + +int TCOD_namegen_get_nb_sets_wrapper(void) { + TCOD_list_t l=TCOD_namegen_get_sets(); + int nb = TCOD_list_size(l); + TCOD_list_delete(l); + return nb; +} + +void TCOD_namegen_get_sets_wrapper(char **sets) { + TCOD_list_t l=TCOD_namegen_get_sets(); + char **it; + int i=0; + for (it = (char**)TCOD_list_begin(l); it != (char**)TCOD_list_end(l); ++it) { + sets[i++]=*it; + } +} + +int TCOD_sys_get_current_resolution_x() +{ + int x, y; + TCOD_sys_get_current_resolution(&x, &y); + return x; +} + +int TCOD_sys_get_current_resolution_y() +{ + int x, y; + TCOD_sys_get_current_resolution(&x, &y); + return y; +} + +void TCOD_console_set_key_color_wrapper (TCOD_console_t con, colornum_t c) +{ + TCOD_console_set_key_color(con, int_to_color(c)); +} diff --git a/tcod_sys/libtcod/include/wrappers.h b/tcod_sys/libtcod/src/libtcod/wrappers.h similarity index 74% rename from tcod_sys/libtcod/include/wrappers.h rename to tcod_sys/libtcod/src/libtcod/wrappers.h index ed0f6bf0c..4581b40af 100644 --- a/tcod_sys/libtcod/include/wrappers.h +++ b/tcod_sys/libtcod/src/libtcod/wrappers.h @@ -1,35 +1,40 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef WRAPPERS_H #define WRAPPERS_H -#include "libtcod_portability.h" +#include "portability.h" #include "console_types.h" +#include "console_printing.h" #include "image.h" #include "mouse.h" #include "parser.h" @@ -58,7 +63,6 @@ TCODLIB_API float TCOD_color_get_hue_wrapper (colornum_t c); TCODLIB_API float TCOD_color_get_saturation_wrapper (colornum_t c); TCODLIB_API float TCOD_color_get_value_wrapper(colornum_t c); -#ifdef TCOD_CONSOLE_SUPPORT /* console module */ /* TCODLIB_API void TCOD_console_set_custom_font_wrapper(const char *fontFile, int char_width, int char_height, int nb_char_horiz, @@ -111,9 +115,7 @@ TCODLIB_API char *TCOD_console_print_return_string(TCOD_console_t con,int x, bool can_split, bool count_only); TCODLIB_API void TCOD_console_set_key_color_wrapper (TCOD_console_t con, colornum_t c); -#endif -#ifdef TCOD_IMAGE_SUPPORT /* image module */ TCODLIB_API void TCOD_image_clear_wrapper(TCOD_image_t image, @@ -126,12 +128,9 @@ TCODLIB_API void TCOD_image_put_pixel_wrapper(TCOD_image_t image,int x, int y, colornum_t col); TCODLIB_API void TCOD_image_set_key_color_wrapper(TCOD_image_t image, colornum_t key_color); -#endif -#ifdef TCOD_CONSOLE_SUPPORT /* mouse module */ TCODLIB_API void TCOD_mouse_get_status_wrapper(TCOD_mouse_t *holder); -#endif /* parser module */ TCODLIB_API colornum_t TCOD_parser_get_color_property_wrapper(TCOD_parser_t parser, const char *name); diff --git a/tcod_sys/libtcod/src/libtcod/zip.cpp b/tcod_sys/libtcod/src/libtcod/zip.cpp new file mode 100644 index 000000000..9af4ed69c --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/zip.cpp @@ -0,0 +1,139 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "zip.hpp" + +TCODZip::TCODZip() { + data=TCOD_zip_new(); +} + +TCODZip::~TCODZip() { + TCOD_zip_delete(data); +} + +void TCODZip::putChar(char val) { + TCOD_zip_put_char(data,val); +} + +void TCODZip::putInt(int val) { + TCOD_zip_put_int(data,val); +} + +void TCODZip::putFloat(float val) { + TCOD_zip_put_float(data,val); +} + +void TCODZip::putString(const char *val) { + TCOD_zip_put_string(data,val); +} + +void TCODZip::putData(int nbBytes, const void *pdata) { + TCOD_zip_put_data(data,nbBytes,pdata); +} + +void TCODZip::putColor(const TCODColor *val) { + TCOD_color_t col; + col.r=val->r; + col.g=val->g; + col.b=val->b; + TCOD_zip_put_color(data,col); +} + +void TCODZip::putImage(const TCODImage *val) +{ + TCOD_zip_put_image(data,val->data); +} + +void TCODZip::putConsole(const TCODConsole *val) +{ + TCOD_zip_put_console(data, val->get_data()); +} + +void TCODZip::putRandom(const TCODRandom *val) +{ + TCOD_zip_put_random(data, val->get_data()); +} + +int TCODZip::saveToFile(const char *filename) { + return TCOD_zip_save_to_file(data,filename); +} + +int TCODZip::loadFromFile(const char *filename) { + return TCOD_zip_load_from_file(data,filename); +} + +char TCODZip::getChar() { + return TCOD_zip_get_char(data); +} + +int TCODZip::getInt() { + return TCOD_zip_get_int(data); +} + +float TCODZip::getFloat() { + return TCOD_zip_get_float(data); +} + +const char *TCODZip::getString() { + return TCOD_zip_get_string(data); +} + +int TCODZip::getData(int nbBytes, void *pdata) { + return TCOD_zip_get_data(data,nbBytes,pdata); +} + +TCODColor TCODZip::getColor() { + return TCODColor(TCOD_zip_get_color(data)); +} + +TCODImage *TCODZip::getImage() { + return new TCODImage(TCOD_zip_get_image(data)); +} + +TCODConsole *TCODZip::getConsole() { + return new TCODConsole(TCOD_zip_get_console(data)); +} + +TCODRandom *TCODZip::getRandom() { + return new TCODRandom(TCOD_zip_get_random(data)); +} + +uint32_t TCODZip::getCurrentBytes() const { + return TCOD_zip_get_current_bytes(data); +} + +uint32_t TCODZip::getRemainingBytes() const { + return TCOD_zip_get_remaining_bytes(data); +} + +void TCODZip::skipBytes(uint32_t nbBytes) { + TCOD_zip_skip_bytes(data,nbBytes); +} diff --git a/tcod_sys/libtcod/src/libtcod/zip.h b/tcod_sys/libtcod/src/libtcod/zip.h new file mode 100644 index 000000000..8a90e02e4 --- /dev/null +++ b/tcod_sys/libtcod/src/libtcod/zip.h @@ -0,0 +1,91 @@ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TCOD_ZIP_H +#define _TCOD_ZIP_H + +#include "portability.h" +#include "color.h" +#include "console_types.h" +#include "image.h" +#include "mersenne.h" + +#ifdef __cplusplus +extern "C" { +#endif +struct TCOD_Zip; +typedef struct TCOD_Zip *TCOD_zip_t; + +TCODLIB_API TCOD_zip_t TCOD_zip_new(void); +TCODLIB_API void TCOD_zip_delete(TCOD_zip_t zip); + +/* output interface */ +TCODLIB_API void TCOD_zip_put_char(TCOD_zip_t zip, char val); +TCODLIB_API void TCOD_zip_put_int(TCOD_zip_t zip, int val); +TCODLIB_API void TCOD_zip_put_float(TCOD_zip_t zip, float val); +TCODLIB_API void TCOD_zip_put_string(TCOD_zip_t zip, const char *val); +TCODLIB_API void TCOD_zip_put_color(TCOD_zip_t zip, const TCOD_color_t val); +TCODLIB_API void TCOD_zip_put_image(TCOD_zip_t zip, const TCOD_image_t val); +TCODLIB_API void TCOD_zip_put_console(TCOD_zip_t zip, const TCOD_Console* val); +/** + Write a TCOD_Random* object. + \rst + .. versionadded:: 1.16 + \endrst + */ +TCODLIB_API void TCOD_zip_put_random(TCOD_zip_t zip, const TCOD_Random *val); +TCODLIB_API void TCOD_zip_put_data(TCOD_zip_t zip, int nbBytes, const void *data); +TCODLIB_API uint32_t TCOD_zip_get_current_bytes(TCOD_zip_t zip); +TCODLIB_API int TCOD_zip_save_to_file(TCOD_zip_t zip, const char *filename); + +/* input interface */ +TCODLIB_API int TCOD_zip_load_from_file(TCOD_zip_t zip, const char *filename); +TCODLIB_API char TCOD_zip_get_char(TCOD_zip_t zip); +TCODLIB_API int TCOD_zip_get_int(TCOD_zip_t zip); +TCODLIB_API float TCOD_zip_get_float(TCOD_zip_t zip); +TCODLIB_API const char *TCOD_zip_get_string(TCOD_zip_t zip); +TCODLIB_API TCOD_color_t TCOD_zip_get_color(TCOD_zip_t zip); +TCODLIB_API TCOD_image_t TCOD_zip_get_image(TCOD_zip_t zip); +TCODLIB_API TCOD_console_t TCOD_zip_get_console(TCOD_zip_t zip); +/** + Read a TCOD_Random* object. + \rst + .. versionadded:: 1.16 + \endrst + */ +TCODLIB_API TCOD_random_t TCOD_zip_get_random(TCOD_zip_t zip); +TCODLIB_API int TCOD_zip_get_data(TCOD_zip_t zip, int nbBytes, void *data); +TCODLIB_API uint32_t TCOD_zip_get_remaining_bytes(TCOD_zip_t zip); +TCODLIB_API void TCOD_zip_skip_bytes(TCOD_zip_t zip, uint32_t nbBytes); +#ifdef __cplusplus +} +#endif +#endif diff --git a/tcod_sys/libtcod/include/zip.hpp b/tcod_sys/libtcod/src/libtcod/zip.hpp similarity index 81% rename from tcod_sys/libtcod/include/zip.hpp rename to tcod_sys/libtcod/src/libtcod/zip.hpp index 6e0680ede..0f2b3df0c 100644 --- a/tcod_sys/libtcod/include/zip.hpp +++ b/tcod_sys/libtcod/src/libtcod/zip.hpp @@ -1,36 +1,41 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef _TCOD_ZIP_HPP #define _TCOD_ZIP_HPP #include "color.hpp" #include "console.hpp" #include "image.hpp" +#include "mersenne.hpp" #include "zip.h" /** @PageName zip @@ -135,7 +140,6 @@ public : */ void putColor(const TCODColor *val); -#ifdef TCOD_IMAGE_SUPPORT /** @PageName zip_put @FuncTitle Putting an image in the buffer @@ -145,9 +149,7 @@ public : @Param val An image to store in the buffer */ void putImage(const TCODImage *val); -#endif -#ifdef TCOD_CONSOLE_SUPPORT /** @PageName zip_put @FuncTitle Putting a console in the buffer @@ -157,7 +159,16 @@ public : @Param val A console to store in the buffer */ void putConsole(const TCODConsole *val); -#endif + + /** + @PageName zip_put + @FuncTitle Putting a random number generator state in the buffer + @Cpp void TCODZip::putRandom(const TCOD_random_t val) + @C void TCOD_zip_put_random(TCOD_zip_t zip, const TCOD_random_t val) + @Param zip In the C version, the buffer handler, returned by the constructor. + @Param val An RNG state to store in the buffer + */ + void putRandom(const TCODRandom *val); /** @PageName zip_put @@ -267,7 +278,6 @@ public : */ TCODColor getColor(); -#ifdef TCOD_IMAGE_SUPPORT /** @PageName zip_load @FuncTitle Reading a color from the buffer @@ -276,9 +286,7 @@ public : @Param zip In the C version, the buffer handler, returned by the constructor. */ TCODImage *getImage(); -#endif -#ifdef TCOD_CONSOLE_SUPPORT /** @PageName zip_load @FuncTitle Reading a console from the buffer @@ -287,7 +295,15 @@ public : @Param zip In the C version, the buffer handler, returned by the constructor. */ TCODConsole *getConsole(); -#endif + + /** + @PageName zip_load + @FuncTitle Reading a random number generator state from the buffer + @Cpp TCODRandom *TCODZip::getRandom() + @C TCOD_random_t TCOD_zip_get_random(TCOD_zip_t zip) + @Param zip In the C version, the buffer handler, returned by the constructor. + */ + TCODRandom *getRandom(); /** @PageName zip_load diff --git a/tcod_sys/libtcod/src/zip_c.c b/tcod_sys/libtcod/src/libtcod/zip_c.c similarity index 81% rename from tcod_sys/libtcod/src/zip_c.c rename to tcod_sys/libtcod/src/libtcod/zip_c.c index 583865fbf..efe6671db 100644 --- a/tcod_sys/libtcod/src/zip_c.c +++ b/tcod_sys/libtcod/src/libtcod/zip_c.c @@ -1,390 +1,402 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include -#include -#include - -#include -#include -#include - -typedef struct { - TCOD_list_t buffer; /* list */ - uintptr_t ibuffer; /* byte buffer. bytes are send into buffer 4 by 4 (32 bits OS) or 8 by 8(64 bits OS) */ - int isize; /* number of bytes in ibuffer */ - int bsize; /* number of bytes in buffer */ - int offset; /* current reading position */ -} zip_data_t; - -TCOD_zip_t TCOD_zip_new(void) { - zip_data_t *ret=(zip_data_t *)calloc(sizeof(zip_data_t),1); - return (TCOD_zip_t)ret; -} - -void TCOD_zip_delete(TCOD_zip_t pzip) { - zip_data_t *zip=(zip_data_t *)pzip; - if ( zip->buffer != NULL ) TCOD_list_delete(zip->buffer); - free(zip); -} - - -/* output interface */ -void TCOD_zip_put_char(TCOD_zip_t pzip, char val) { - zip_data_t *zip=(zip_data_t *)pzip; - uintptr_t iv=(uintptr_t)(uint8_t)val; - /* store one byte in ibuffer */ - switch (zip->isize) { - case 0 : zip->ibuffer|=iv; break; - case 1 : zip->ibuffer|=(iv<<8); break; - case 2 : zip->ibuffer|=(iv<<16); break; - case 3 : zip->ibuffer|=(iv<<24); break; -#ifdef TCOD_64BITS - /* for 64 bits OS */ - case 4 : zip->ibuffer|=(iv<<32); break; - case 5 : zip->ibuffer|=(iv<<40); break; - case 6 : zip->ibuffer|=(iv<<48); break; - case 7 : zip->ibuffer|=(iv<<56); break; -#endif - } - zip->isize++; - zip->bsize++; - if (zip->isize == sizeof(uintptr_t) ) { - /* ibuffer full. send it to buffer */ - if (!zip->buffer) zip->buffer=TCOD_list_new(); - TCOD_list_push(zip->buffer,(void *)zip->ibuffer); - zip->isize = 0; - zip->ibuffer = 0; - } -} - -void TCOD_zip_put_int(TCOD_zip_t pzip, int val) { -#ifndef TCOD_64BITS - zip_data_t *zip=(zip_data_t *)pzip; - if ( zip->isize == 0 ) { - /* the buffer is padded. read 4 bytes */ - if (!zip->buffer) zip->buffer=TCOD_list_new(); - TCOD_list_push(zip->buffer,(void *)val); - zip->bsize += sizeof(uintptr_t); - } else { -#endif - /* the buffer is not padded. read 4x1 byte */ - TCOD_zip_put_char(pzip,(char)(val&0xFF)); - TCOD_zip_put_char(pzip,(char)((val&0xFF00)>>8)); - TCOD_zip_put_char(pzip,(char)((val&0xFF0000)>>16)); - TCOD_zip_put_char(pzip,(char)((val&0xFF000000)>>24)); -#ifndef TCOD_64BITS - } -#endif -} - -void TCOD_zip_put_float(TCOD_zip_t pzip, float val) { - TCOD_zip_put_int(pzip,* (int *)(&val) ); -} - -void TCOD_zip_put_string(TCOD_zip_t pzip, const char *val) { - if (val == NULL) TCOD_zip_put_int(pzip,-1); - else { - size_t l=strlen(val),i; - TCOD_zip_put_int(pzip,(int)l); - for (i=0; i <= l; i++) TCOD_zip_put_char(pzip,val[i]); - } -} - -void TCOD_zip_put_data(TCOD_zip_t pzip, int nbBytes, const void *data) { - if (data == NULL) TCOD_zip_put_int(pzip,-1); - else { - char *val=(char *)data; - int i; - TCOD_zip_put_int(pzip,nbBytes); - for (i=0; i< nbBytes; i++) TCOD_zip_put_char(pzip,val[i]); - } -} - -void TCOD_zip_put_color(TCOD_zip_t zip, const TCOD_color_t val) { - TCOD_zip_put_char(zip,val.r); - TCOD_zip_put_char(zip,val.g); - TCOD_zip_put_char(zip,val.b); -} - -#ifdef TCOD_IMAGE_SUPPORT -void TCOD_zip_put_image(TCOD_zip_t zip, const TCOD_image_t val) { - int w,h,x,y; - TCOD_image_get_size(val, &w,&h); - TCOD_zip_put_int(zip,w); - TCOD_zip_put_int(zip,h); - for (y=0; y < h; y++) { - for (x=0; x < w; x++ ) { - TCOD_zip_put_color(zip,TCOD_image_get_pixel(val,x,y)); - } - } -} -#endif - -#ifdef TCOD_CONSOLE_SUPPORT -void TCOD_zip_put_console(TCOD_zip_t zip, const TCOD_console_t val) { - int w,h,x,y; - w=TCOD_console_get_width(val); - h=TCOD_console_get_height(val); - TCOD_zip_put_int(zip,w); - TCOD_zip_put_int(zip,h); - for (y=0; y < h; y++) { - for (x=0; x < w; x++ ) { - TCOD_zip_put_char(zip,TCOD_console_get_char(val,x,y)); - TCOD_zip_put_color(zip,TCOD_console_get_char_foreground(val,x,y)); - TCOD_zip_put_color(zip,TCOD_console_get_char_background(val,x,y)); - } - } -} -#endif - -int TCOD_zip_save_to_file(TCOD_zip_t pzip, const char *filename) { - zip_data_t *zip=(zip_data_t *)pzip; - gzFile f=gzopen(filename,"wb"); - int l=zip->bsize, ret; - void *buf; - if (!f) return 0; - gzwrite(f,&l,sizeof(int)); - if (l==0) { - gzclose(f); - return 0; - } - if ( zip->isize > 0 ) { - /* send remaining bytes from ibuffer to buffer */ - if (!zip->buffer) zip->buffer=TCOD_list_new(); - TCOD_list_push(zip->buffer,(void *)zip->ibuffer); - zip->isize = 0; - zip->ibuffer = 0; - } - buf=(void *)TCOD_list_begin(zip->buffer); - ret=gzwrite(f,buf,l); - if (ret != l) { - gzclose(f); - return 0; - } - ret=gzclose(f); - if (ret != Z_OK) - return 0; - return l; -} - - -/* input interface */ -int TCOD_zip_load_from_file(TCOD_zip_t pzip, const char *filename) { - zip_data_t *zip=(zip_data_t *)pzip; - gzFile f=gzopen(filename,"rb"); - int l,lread; - void *buf; - int wordsize=sizeof(uintptr_t); - if (!f) return 0; - gzread(f,&l,sizeof(int)); - if (l==0) { - gzclose(f); - return 0; - } - if ( zip->buffer) { - TCOD_list_delete(zip->buffer); - memset(zip,0,sizeof(zip_data_t)); - } - zip->buffer=TCOD_list_allocate((l+wordsize-1)/wordsize); - TCOD_list_set_size(zip->buffer,(l+wordsize-1)/wordsize); - buf=(void *)TCOD_list_begin(zip->buffer); - lread=gzread(f,buf,l); - gzclose(f); - return lread == 0 ? l : lread; -} - -char TCOD_zip_get_char(TCOD_zip_t pzip) { - zip_data_t *zip=(zip_data_t *)pzip; - char c=0; - if ( zip->isize == 0 ) { - /* ibuffer is empty. get 4 or 8 new bytes from buffer */ - zip->ibuffer=(uintptr_t)TCOD_list_get(zip->buffer,zip->offset); - zip->offset++; - zip->isize=sizeof(uintptr_t); - } - /* read one byte from ibuffer */ -#ifdef TCOD_64BITS - switch(zip->isize) { - case 8: c= zip->ibuffer&0xFFL; break; - case 7: c= (zip->ibuffer>>8) & 0xFFL; break; - case 6: c= (zip->ibuffer>>16) & 0xFFL; break; - case 5: c= (zip->ibuffer>>24) & 0xFFL; break; - case 4: c= (zip->ibuffer>>32) & 0xFFL; break; - case 3: c= (zip->ibuffer>>40) & 0xFFL; break; - case 2: c= (zip->ibuffer>>48) & 0xFFL; break; - case 1: c= (zip->ibuffer>>56) & 0xFFL; break; - } -#else - switch(zip->isize) { - case 4: c= (char)(zip->ibuffer&0xFF); break; - case 3: c= (char)((zip->ibuffer&0xFF00)>>8); break; - case 2: c= (char)((zip->ibuffer&0xFF0000)>>16); break; - case 1: c= (char)((zip->ibuffer&0xFF000000)>>24); break; - } -#endif - zip->isize--; - return c; -} - -int TCOD_zip_get_int(TCOD_zip_t pzip) { -#ifndef TCOD_64BITS - zip_data_t *zip=(zip_data_t *)pzip; - if ( zip->isize == 0 ) { - /* buffer is padded. read 4 bytes */ - int i=(int)TCOD_list_get(zip->buffer,zip->offset); - zip->offset++; - return i; - } else { -#endif - /* buffer is not padded. read 4x 1 byte */ - uint32_t i1=(uint32_t)(uint8_t)TCOD_zip_get_char(pzip); - uint32_t i2=(uint32_t)(uint8_t)TCOD_zip_get_char(pzip); - uint32_t i3=(uint32_t)(uint8_t)TCOD_zip_get_char(pzip); - uint32_t i4=(uint32_t)(uint8_t)TCOD_zip_get_char(pzip); - - return i1 | (i2<<8) | (i3<<16) | (i4<<24); -#ifndef TCOD_64BITS - } -#endif -} - -float TCOD_zip_get_float(TCOD_zip_t pzip) { - int i=TCOD_zip_get_int(pzip); - return *(float *)(&i); -} - -TCOD_color_t TCOD_zip_get_color(TCOD_zip_t pzip) { - TCOD_color_t col; - col.r=TCOD_zip_get_char(pzip); - col.g=TCOD_zip_get_char(pzip); - col.b=TCOD_zip_get_char(pzip); - return col; -} - -const char *TCOD_zip_get_string(TCOD_zip_t pzip) { - zip_data_t *zip=(zip_data_t *)pzip; - int l=TCOD_zip_get_int(pzip); - const char *ret=(const char *)TCOD_list_begin(zip->buffer); - int boffset; /* offset in bytes */ - if ( l == -1 ) return NULL; - boffset=zip->offset*sizeof(uintptr_t)-zip->isize; /* current offset */ - ret += boffset; /* the string address in buffer */ - boffset += l+1; /* new offset */ - /* update ibuffer */ - zip->offset = (boffset+sizeof(uintptr_t)-1)/sizeof(uintptr_t); - zip->isize = boffset%sizeof(uintptr_t); - if ( zip->isize != 0 ) { - zip->isize=sizeof(uintptr_t)-zip->isize; - zip->ibuffer=(uintptr_t)TCOD_list_get(zip->buffer,zip->offset-1); - } - return ret; -} - -int TCOD_zip_get_data(TCOD_zip_t pzip, int nbBytes, void *data) { - zip_data_t *zip=(zip_data_t *)pzip; - int l=TCOD_zip_get_int(pzip),i; - const char *in=(const char *)TCOD_list_begin(zip->buffer); - char *out=(char *)data; - int boffset; /* offset in bytes */ - if ( l == -1 ) return 0; - boffset=zip->offset*sizeof(uintptr_t)-zip->isize; /* current offset */ - in += boffset; /* the data address in buffer */ - /* copy it to data */ - for (i=0; i < MIN(l,nbBytes); i++ ) { - *(out++)=*(in++); - boffset++; - } - /* update ibuffer */ - zip->offset = (boffset+sizeof(uintptr_t)-1)/sizeof(uintptr_t); - zip->isize = boffset%sizeof(uintptr_t); - if ( zip->isize != 0 ) { - zip->isize=sizeof(uintptr_t)-zip->isize; - zip->ibuffer=(uintptr_t)TCOD_list_get(zip->buffer,zip->offset-1); - } - return l; -} - -#ifdef TCOD_IMAGE_SUPPORT -TCOD_image_t TCOD_zip_get_image(TCOD_zip_t pzip) { - TCOD_image_t ret; - int w,h,x,y; - w=TCOD_zip_get_int(pzip); - h=TCOD_zip_get_int(pzip); - ret=TCOD_image_new(w,h); - for (y=0; y < h; y++) { - for (x=0; x < w; x++ ) { - TCOD_image_put_pixel(ret, x,y,TCOD_zip_get_color(pzip)); - } - } - return ret; -} -#endif - -#ifdef TCOD_CONSOLE_SUPPORT -TCOD_console_t TCOD_zip_get_console(TCOD_zip_t pzip) { - TCOD_console_t ret; - int w,h,x,y; - w=TCOD_zip_get_int(pzip); - h=TCOD_zip_get_int(pzip); - ret=TCOD_console_new(w,h); - for (y=0; y < h; y++) { - for (x=0; x < w; x++ ) { - TCOD_console_set_char(ret, x,y,TCOD_zip_get_char(pzip)); - TCOD_console_set_char_foreground(ret, x,y,TCOD_zip_get_color(pzip)); - TCOD_console_set_char_background(ret, x,y,TCOD_zip_get_color(pzip), TCOD_BKGND_SET); - } - } - return ret; -} -#endif - -uint32_t TCOD_zip_get_current_bytes(TCOD_zip_t pzip) { - zip_data_t *zip=(zip_data_t *)pzip; - if (!zip->buffer) zip->buffer=TCOD_list_new(); - return TCOD_list_size(zip->buffer)*sizeof(uintptr_t)+zip->isize; -} - -uint32_t TCOD_zip_get_remaining_bytes(TCOD_zip_t pzip) { - zip_data_t *zip=(zip_data_t *)pzip; - if (!zip->buffer) zip->buffer=TCOD_list_new(); - return (TCOD_list_size(zip->buffer) - zip->offset) * sizeof(uintptr_t) + zip->isize; -} - -void TCOD_zip_skip_bytes(TCOD_zip_t pzip, uint32_t nbBytes) { - zip_data_t *zip=(zip_data_t *)pzip; - uint32_t boffset=zip->offset*sizeof(uintptr_t)-zip->isize+ nbBytes; /* new offset */ - TCOD_IFNOT(boffset <= TCOD_list_size(zip->buffer)*sizeof(uintptr_t)) return; - zip->offset = (boffset+sizeof(uintptr_t)-1)/sizeof(uintptr_t); - zip->isize = boffset%sizeof(uintptr_t); - if ( zip->isize != 0 ) { - zip->isize=sizeof(uintptr_t)-zip->isize; - zip->ibuffer=(uintptr_t)TCOD_list_get(zip->buffer,zip->offset-1); - } -} +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "zip.h" + +#include +#include +#include + +#include "console.h" +#include "libtcod_int.h" +#include "utility.h" + +typedef struct TCOD_Zip { + TCOD_list_t buffer; /* list */ + uintptr_t ibuffer; /* byte buffer. bytes are send into buffer 4 by 4 (32 bits OS) or 8 by 8(64 bits OS) */ + int isize; /* number of bytes in ibuffer */ + int bsize; /* number of bytes in buffer */ + int offset; /* current reading position */ +} zip_data_t; + +TCOD_zip_t TCOD_zip_new(void) { + zip_data_t *ret=(zip_data_t *)calloc(sizeof(zip_data_t),1); + return (TCOD_zip_t)ret; +} + +void TCOD_zip_delete(TCOD_zip_t pzip) { + zip_data_t *zip=(zip_data_t *)pzip; + if ( zip->buffer != NULL ) TCOD_list_delete(zip->buffer); + free(zip); +} + + +/* output interface */ +void TCOD_zip_put_char(TCOD_zip_t pzip, char val) { + zip_data_t *zip=(zip_data_t *)pzip; + uintptr_t iv=(uintptr_t)(uint8_t)val; + /* store one byte in ibuffer */ + switch (zip->isize) { + case 0 : zip->ibuffer|=iv; break; + case 1 : zip->ibuffer|=(iv<<8); break; + case 2 : zip->ibuffer|=(iv<<16); break; + case 3 : zip->ibuffer|=(iv<<24); break; +#ifdef TCOD_64BITS + /* for 64 bits OS */ + case 4 : zip->ibuffer|=(iv<<32); break; + case 5 : zip->ibuffer|=(iv<<40); break; + case 6 : zip->ibuffer|=(iv<<48); break; + case 7 : zip->ibuffer|=(iv<<56); break; +#endif + } + zip->isize++; + zip->bsize++; + if (zip->isize == sizeof(uintptr_t) ) { + /* ibuffer full. send it to buffer */ + if (!zip->buffer) zip->buffer=TCOD_list_new(); + TCOD_list_push(zip->buffer,(void *)zip->ibuffer); + zip->isize = 0; + zip->ibuffer = 0; + } +} + +void TCOD_zip_put_int(TCOD_zip_t pzip, int val) { +#ifndef TCOD_64BITS + zip_data_t *zip=(zip_data_t *)pzip; + if ( zip->isize == 0 ) { + /* the buffer is padded. read 4 bytes */ + if (!zip->buffer) zip->buffer=TCOD_list_new(); + TCOD_list_push(zip->buffer,(void *)val); + zip->bsize += sizeof(uintptr_t); + } else { +#endif + /* the buffer is not padded. read 4x1 byte */ + TCOD_zip_put_char(pzip,(char)(val&0xFF)); + TCOD_zip_put_char(pzip,(char)((val&0xFF00)>>8)); + TCOD_zip_put_char(pzip,(char)((val&0xFF0000)>>16)); + TCOD_zip_put_char(pzip,(char)((val&0xFF000000)>>24)); +#ifndef TCOD_64BITS + } +#endif +} + +void TCOD_zip_put_float(TCOD_zip_t pzip, float val) { + TCOD_zip_put_int(pzip,* (int *)(&val) ); +} + +void TCOD_zip_put_string(TCOD_zip_t pzip, const char *val) { + if (val == NULL) TCOD_zip_put_int(pzip,-1); + else { + size_t l=strlen(val),i; + TCOD_zip_put_int(pzip,(int)l); + for (i=0; i <= l; i++) TCOD_zip_put_char(pzip,val[i]); + } +} + +void TCOD_zip_put_data(TCOD_zip_t pzip, int nbBytes, const void *data) { + if (data == NULL) TCOD_zip_put_int(pzip,-1); + else { + char *val=(char *)data; + int i; + TCOD_zip_put_int(pzip,nbBytes); + for (i=0; i< nbBytes; i++) TCOD_zip_put_char(pzip,val[i]); + } +} + +void TCOD_zip_put_color(TCOD_zip_t zip, const TCOD_color_t val) { + TCOD_zip_put_char(zip,val.r); + TCOD_zip_put_char(zip,val.g); + TCOD_zip_put_char(zip,val.b); +} + +void TCOD_zip_put_image(TCOD_zip_t zip, const TCOD_image_t val) { + int w,h,x,y; + TCOD_image_get_size(val, &w,&h); + TCOD_zip_put_int(zip,w); + TCOD_zip_put_int(zip,h); + for (y=0; y < h; y++) { + for (x=0; x < w; x++ ) { + TCOD_zip_put_color(zip,TCOD_image_get_pixel(val,x,y)); + } + } +} + +void TCOD_zip_put_console(TCOD_zip_t zip, const TCOD_Console* val) +{ + int w,h,x,y; + w=TCOD_console_get_width(val); + h=TCOD_console_get_height(val); + TCOD_zip_put_int(zip,w); + TCOD_zip_put_int(zip,h); + for (y=0; y < h; y++) { + for (x=0; x < w; x++ ) { + TCOD_zip_put_char(zip,TCOD_console_get_char(val,x,y)); + TCOD_zip_put_color(zip,TCOD_console_get_char_foreground(val,x,y)); + TCOD_zip_put_color(zip,TCOD_console_get_char_background(val,x,y)); + } + } +} + +void TCOD_zip_put_random(TCOD_zip_t zip, const TCOD_Random *val) { + int s = (int)sizeof(*val); + TCOD_zip_put_int(zip, s); + TCOD_zip_put_data(zip, s, val); +} + +int TCOD_zip_save_to_file(TCOD_zip_t pzip, const char *filename) { + zip_data_t *zip=(zip_data_t *)pzip; + gzFile f=gzopen(filename,"wb"); + int l=zip->bsize, ret; + void *buf; + if (!f) return 0; + gzwrite(f,&l,sizeof(int)); + if (l==0) { + gzclose(f); + return 0; + } + if ( zip->isize > 0 ) { + /* send remaining bytes from ibuffer to buffer */ + if (!zip->buffer) zip->buffer=TCOD_list_new(); + TCOD_list_push(zip->buffer,(void *)zip->ibuffer); + zip->isize = 0; + zip->ibuffer = 0; + } + buf=(void *)TCOD_list_begin(zip->buffer); + ret=gzwrite(f,buf,l); + if (ret != l) { + gzclose(f); + return 0; + } + ret=gzclose(f); + if (ret != Z_OK) + return 0; + return l; +} + + +/* input interface */ +int TCOD_zip_load_from_file(TCOD_zip_t pzip, const char *filename) { + zip_data_t *zip=(zip_data_t *)pzip; + gzFile f=gzopen(filename,"rb"); + int l,lread; + void *buf; + int wordsize=sizeof(uintptr_t); + if (!f) return 0; + gzread(f,&l,sizeof(int)); + if (l==0) { + gzclose(f); + return 0; + } + if ( zip->buffer) { + TCOD_list_delete(zip->buffer); + memset(zip,0,sizeof(zip_data_t)); + } + zip->buffer=TCOD_list_allocate((l+wordsize-1)/wordsize); + TCOD_list_set_size(zip->buffer,(l+wordsize-1)/wordsize); + buf=(void *)TCOD_list_begin(zip->buffer); + lread=gzread(f,buf,l); + gzclose(f); + return lread == 0 ? l : lread; +} + +char TCOD_zip_get_char(TCOD_zip_t pzip) { + zip_data_t *zip=(zip_data_t *)pzip; + char c=0; + if ( zip->isize == 0 ) { + /* ibuffer is empty. get 4 or 8 new bytes from buffer */ + zip->ibuffer=(uintptr_t)TCOD_list_get(zip->buffer,zip->offset); + zip->offset++; + zip->isize=sizeof(uintptr_t); + } + /* read one byte from ibuffer */ +#ifdef TCOD_64BITS + switch(zip->isize) { + case 8: c= zip->ibuffer&0xFFL; break; + case 7: c= (zip->ibuffer>>8) & 0xFFL; break; + case 6: c= (zip->ibuffer>>16) & 0xFFL; break; + case 5: c= (zip->ibuffer>>24) & 0xFFL; break; + case 4: c= (zip->ibuffer>>32) & 0xFFL; break; + case 3: c= (zip->ibuffer>>40) & 0xFFL; break; + case 2: c= (zip->ibuffer>>48) & 0xFFL; break; + case 1: c= (zip->ibuffer>>56) & 0xFFL; break; + } +#else + switch(zip->isize) { + case 4: c= (char)(zip->ibuffer&0xFF); break; + case 3: c= (char)((zip->ibuffer&0xFF00)>>8); break; + case 2: c= (char)((zip->ibuffer&0xFF0000)>>16); break; + case 1: c= (char)((zip->ibuffer&0xFF000000)>>24); break; + } +#endif + zip->isize--; + return c; +} + +int TCOD_zip_get_int(TCOD_zip_t pzip) { +#ifndef TCOD_64BITS + zip_data_t *zip=(zip_data_t *)pzip; + if ( zip->isize == 0 ) { + /* buffer is padded. read 4 bytes */ + int i=(int)TCOD_list_get(zip->buffer,zip->offset); + zip->offset++; + return i; + } else { +#endif + /* buffer is not padded. read 4x 1 byte */ + uint32_t i1=(uint32_t)(uint8_t)TCOD_zip_get_char(pzip); + uint32_t i2=(uint32_t)(uint8_t)TCOD_zip_get_char(pzip); + uint32_t i3=(uint32_t)(uint8_t)TCOD_zip_get_char(pzip); + uint32_t i4=(uint32_t)(uint8_t)TCOD_zip_get_char(pzip); + + return i1 | (i2<<8) | (i3<<16) | (i4<<24); +#ifndef TCOD_64BITS + } +#endif +} + +float TCOD_zip_get_float(TCOD_zip_t pzip) { + int i=TCOD_zip_get_int(pzip); + return *(float *)(&i); +} + +TCOD_color_t TCOD_zip_get_color(TCOD_zip_t pzip) { + TCOD_color_t col; + col.r=TCOD_zip_get_char(pzip); + col.g=TCOD_zip_get_char(pzip); + col.b=TCOD_zip_get_char(pzip); + return col; +} + +const char *TCOD_zip_get_string(TCOD_zip_t pzip) { + zip_data_t *zip=(zip_data_t *)pzip; + int l=TCOD_zip_get_int(pzip); + const char *ret=(const char *)TCOD_list_begin(zip->buffer); + int boffset; /* offset in bytes */ + if ( l == -1 ) return NULL; + boffset=zip->offset*sizeof(uintptr_t)-zip->isize; /* current offset */ + ret += boffset; /* the string address in buffer */ + boffset += l+1; /* new offset */ + /* update ibuffer */ + zip->offset = (boffset+sizeof(uintptr_t)-1)/sizeof(uintptr_t); + zip->isize = boffset%sizeof(uintptr_t); + if ( zip->isize != 0 ) { + zip->isize=sizeof(uintptr_t)-zip->isize; + zip->ibuffer=(uintptr_t)TCOD_list_get(zip->buffer,zip->offset-1); + } + return ret; +} + +int TCOD_zip_get_data(TCOD_zip_t pzip, int nbBytes, void *data) { + zip_data_t *zip=(zip_data_t *)pzip; + int l=TCOD_zip_get_int(pzip),i; + const char *in=(const char *)TCOD_list_begin(zip->buffer); + char *out=(char *)data; + int boffset; /* offset in bytes */ + if ( l == -1 ) return 0; + boffset=zip->offset*sizeof(uintptr_t)-zip->isize; /* current offset */ + in += boffset; /* the data address in buffer */ + /* copy it to data */ + for (i=0; i < MIN(l,nbBytes); i++ ) { + *(out++)=*(in++); + boffset++; + } + /* update ibuffer */ + zip->offset = (boffset+sizeof(uintptr_t)-1)/sizeof(uintptr_t); + zip->isize = boffset%sizeof(uintptr_t); + if ( zip->isize != 0 ) { + zip->isize=sizeof(uintptr_t)-zip->isize; + zip->ibuffer=(uintptr_t)TCOD_list_get(zip->buffer,zip->offset-1); + } + return l; +} + +TCOD_image_t TCOD_zip_get_image(TCOD_zip_t pzip) { + TCOD_image_t ret; + int w,h,x,y; + w=TCOD_zip_get_int(pzip); + h=TCOD_zip_get_int(pzip); + ret=TCOD_image_new(w,h); + for (y=0; y < h; y++) { + for (x=0; x < w; x++ ) { + TCOD_image_put_pixel(ret, x,y,TCOD_zip_get_color(pzip)); + } + } + return ret; +} + +TCOD_console_t TCOD_zip_get_console(TCOD_zip_t pzip) { + TCOD_console_t ret; + int w,h,x,y; + w=TCOD_zip_get_int(pzip); + h=TCOD_zip_get_int(pzip); + ret=TCOD_console_new(w,h); + for (y=0; y < h; y++) { + for (x=0; x < w; x++ ) { + TCOD_console_set_char(ret, x,y,TCOD_zip_get_char(pzip)); + TCOD_console_set_char_foreground(ret, x,y,TCOD_zip_get_color(pzip)); + TCOD_console_set_char_background(ret, x,y,TCOD_zip_get_color(pzip), TCOD_BKGND_SET); + } + } + return ret; +} + +TCODLIB_API TCOD_random_t TCOD_zip_get_random(TCOD_zip_t zip) +{ + TCOD_random_t ret; + size_t s = TCOD_zip_get_int(zip); + ret = (TCOD_random_t)malloc(s); + TCOD_zip_get_data(zip, s, ret); + return ret; +} + +uint32_t TCOD_zip_get_current_bytes(TCOD_zip_t pzip) { + zip_data_t *zip=(zip_data_t *)pzip; + if (!zip->buffer) zip->buffer=TCOD_list_new(); + return TCOD_list_size(zip->buffer)*sizeof(uintptr_t)+zip->isize; +} + +uint32_t TCOD_zip_get_remaining_bytes(TCOD_zip_t pzip) { + zip_data_t *zip=(zip_data_t *)pzip; + if (!zip->buffer) zip->buffer=TCOD_list_new(); + return (TCOD_list_size(zip->buffer) - zip->offset) * sizeof(uintptr_t) + zip->isize; +} + +void TCOD_zip_skip_bytes(TCOD_zip_t pzip, uint32_t nbBytes) { + zip_data_t *zip=(zip_data_t *)pzip; + uint32_t boffset=zip->offset*sizeof(uintptr_t)-zip->isize+ nbBytes; /* new offset */ + TCOD_IFNOT(boffset <= TCOD_list_size(zip->buffer)*sizeof(uintptr_t)) return; + zip->offset = (boffset+sizeof(uintptr_t)-1)/sizeof(uintptr_t); + zip->isize = boffset%sizeof(uintptr_t); + if ( zip->isize != 0 ) { + zip->isize=sizeof(uintptr_t)-zip->isize; + zip->ibuffer=(uintptr_t)TCOD_list_get(zip->buffer,zip->offset-1); + } +} diff --git a/tcod_sys/libtcod/src/libtcod_c.c b/tcod_sys/libtcod/src/libtcod_c.c index 72a2acf63..ed4e4e792 100644 --- a/tcod_sys/libtcod/src/libtcod_c.c +++ b/tcod_sys/libtcod/src/libtcod_c.c @@ -1,85 +1,74 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* BSD 3-Clause License + * + * Copyright © 2008-2020, Jice and the libtcod contributors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ /** \file libtcod_c.c * - * To statically link a C program with libtcod: + * To statically link a C/C++ program with libtcod: * - * * Add `libtcod_c.c` to your list of source files to compile. - * * Add libtcod's include directory. + * * Add `libtcod_c.c` and `libtcod.cpp` to your list of source files to + * compile. + * * Add `vendor/` as an include directory. * * Add `SDL2` to be dynamically linked, and add its include directory. * You can get the development libraries from: * https://www.libsdl.org/download-2.0.php * * Add `GL` to be dynamically linked. - * * Compile and link libtcod's src/png/lodepng.c file. + * * Compile and link libtcod's src/vendor/glad.c file. + * * Compile and link libtcod's src/vendor/lodepng.cpp file. + * * Compile and link `src/vendor/utf8proc/utf8proc.c`. * * Link with `zlib`, and add its include directory. You can include - * libtcod's src/zlib directory and compile all `.c` files in there to - * statically link it. - * * If you're using C++ then add `libtcod.cpp` to your source files. + * libtcod's src/vendor/zlib directory and compile all `.c` files in there + * to statically link it. * * You can define `NO_OPENGL` to remove the dependency on the GL library. * You can also define `TCOD_BARE` to remove the dependency on SDL2 and GL. */ #include "vendor/stb.c" -#include "bresenham_c.c" -#include "bsp_c.c" -#include "color_c.c" -#include "console_c.c" -#include "console_rexpaint.c" -#include "fov_c.c" -#include "fov_circular_raycasting.c" -#include "fov_diamond_raycasting.c" -#include "fov_permissive2.c" -#include "fov_recursive_shadowcasting.c" -#include "fov_restrictive.c" -#include "heightmap_c.c" -#include "image_c.c" -#include "lex_c.c" -#include "list_c.c" -#include "mersenne_c.c" -#include "namegen_c.c" -#include "noise_c.c" -#include "parser_c.c" -#include "path_c.c" -#include "sys_c.c" -#include "tree_c.c" -#include "txtfield_c.c" -#include "wrappers.c" -#include "zip_c.c" - -#ifndef TCOD_BARE -#include "sys_sdl_c.c" -#include "sys_sdl_img_bmp.c" -#include "sys_sdl_img_png.c" -#include "sys_sdl2_c.c" - -#ifndef NO_OPENGL -#include "sys_opengl_c.c" -#endif /* NO_OPENGL */ - -#endif /* TCOD_BARE */ +#include "libtcod/bresenham_c.c" +#include "libtcod/bsp_c.c" +#include "libtcod/color_c.c" +#include "libtcod/fov_c.c" +#include "libtcod/fov_circular_raycasting.c" +#include "libtcod/fov_diamond_raycasting.c" +#include "libtcod/fov_permissive2.c" +#include "libtcod/fov_recursive_shadowcasting.c" +#include "libtcod/fov_restrictive.c" +#include "libtcod/heightmap_c.c" +#include "libtcod/lex_c.c" +#include "libtcod/list_c.c" +#include "libtcod/mersenne_c.c" +#include "libtcod/namegen_c.c" +#include "libtcod/noise_c.c" +#include "libtcod/parser_c.c" +#include "libtcod/path_c.c" +#include "libtcod/tree_c.c" +#include "libtcod/txtfield_c.c" +#include "libtcod/zip_c.c" diff --git a/tcod_sys/libtcod/src/list_c.c b/tcod_sys/libtcod/src/list_c.c deleted file mode 100644 index 04fd3d6f8..000000000 --- a/tcod_sys/libtcod/src/list_c.c +++ /dev/null @@ -1,201 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include /* calloc */ -#include /* NULL/memcpy */ - -#include - -#define LIST(l) ((TCOD_list_int_t *)l) - -typedef struct { - void **array; - int fillSize; - int allocSize; -} TCOD_list_int_t; - -static void TCOD_list_allocate_int(TCOD_list_t l) { - void **newArray; - int newSize = LIST(l)->allocSize * 2; - if ( newSize == 0 ) newSize = 16; - newArray = (void **)calloc(sizeof(void *),newSize ); - if ( LIST(l)->array ) { - if ( LIST(l)->fillSize > 0 ) memcpy(newArray, LIST(l)->array, sizeof(void *)*LIST(l)->fillSize); - free(LIST(l)->array); - } - LIST(l)->array=newArray; - LIST(l)->allocSize=newSize; -} - -void TCOD_list_set_size(TCOD_list_t l, int size) { - LIST(l)->fillSize=MIN(size,LIST(l)->allocSize); -} - -TCOD_list_t TCOD_list_new(void) { - return (TCOD_list_t)calloc(1,sizeof(TCOD_list_int_t)); -} - -TCOD_list_t TCOD_list_allocate(int nb_elements) { - TCOD_list_t l=TCOD_list_new(); - LIST(l)->array = (void **)calloc(sizeof(void *),nb_elements); - LIST(l)->allocSize = nb_elements; - return l; -} - -TCOD_list_t TCOD_list_duplicate(TCOD_list_t l) { - int i=0; - void **t; - TCOD_list_int_t *ret=(TCOD_list_int_t *)TCOD_list_new(); - while ( ret->allocSize < LIST(l)->allocSize ) TCOD_list_allocate_int((TCOD_list_t)ret); - ret->fillSize=LIST(l)->fillSize; - for (t=TCOD_list_begin(l); t != TCOD_list_end(l); t++) { - ret->array[i++]=*t; - } - return (TCOD_list_t)ret; -} - -void TCOD_list_delete(TCOD_list_t l) { - if ( l ) { - if ( LIST(l)->array ) free(LIST(l)->array); - free(l); - } -} - -void TCOD_list_push(TCOD_list_t l, const void * elt) { - if ( LIST(l)->fillSize+1 >= LIST(l)->allocSize ) TCOD_list_allocate_int(l); - LIST(l)->array[LIST(l)->fillSize++] = (void *)elt; -} -void * TCOD_list_pop(TCOD_list_t l) { - if ( LIST(l)->fillSize == 0 ) return NULL; - return LIST(l)->array[--(LIST(l)->fillSize)]; -} -void * TCOD_list_peek(TCOD_list_t l) { - if ( LIST(l)->fillSize == 0 ) return NULL; - return LIST(l)->array[LIST(l)->fillSize-1]; -} -void TCOD_list_add_all(TCOD_list_t l, TCOD_list_t l2) { - void **curElt; - for ( curElt = TCOD_list_begin(l2); curElt != TCOD_list_end(l2); curElt ++) { - TCOD_list_push(l,*curElt); - } -} -void * TCOD_list_get(TCOD_list_t l,int idx) { - return LIST(l)->array[idx]; -} -void TCOD_list_set(TCOD_list_t l,const void *elt, int idx) { - if ( idx < 0 ) return; - while ( LIST(l)->allocSize < idx+1 ) TCOD_list_allocate_int(l); - LIST(l)->array[idx]=(void *)elt; - if ( idx+1 > LIST(l)->fillSize ) LIST(l)->fillSize = idx+1; -} -void ** TCOD_list_begin(TCOD_list_t l) { - if ( LIST(l)->fillSize == 0 ) return (void **)NULL; - return &LIST(l)->array[0]; -} -void ** TCOD_list_end(TCOD_list_t l) { - if ( LIST(l)->fillSize == 0 ) return (void **)NULL; - return &LIST(l)->array[LIST(l)->fillSize]; -} -void TCOD_list_reverse(TCOD_list_t l) { - void **head=TCOD_list_begin(l); - void **tail=TCOD_list_end(l) - 1; - while ( head < tail ) { - void *tmp=*head; - *head=*tail; - *tail=tmp; - head++; - tail--; - } -} -void **TCOD_list_remove_iterator(TCOD_list_t l, void **elt) { - void **curElt; - for ( curElt = elt; curElt < TCOD_list_end(l)-1; curElt ++) { - *curElt = *(curElt+1); - } - LIST(l)->fillSize--; - if ( LIST(l)->fillSize == 0 ) return ((void **)NULL)-1; - else return elt-1; -} -void TCOD_list_remove(TCOD_list_t l, const void * elt) { - void **curElt; - for ( curElt = TCOD_list_begin(l); curElt != TCOD_list_end(l); curElt ++) { - if ( *curElt == elt ) { - TCOD_list_remove_iterator(l,curElt); - return; - } - } -} -void **TCOD_list_remove_iterator_fast(TCOD_list_t l, void **elt) { - *elt = LIST(l)->array[LIST(l)->fillSize-1]; - LIST(l)->fillSize--; - if ( LIST(l)->fillSize == 0 ) return ((void **)NULL)-1; - else return elt-1; -} -void TCOD_list_remove_fast(TCOD_list_t l, const void * elt) { - void **curElt; - for ( curElt = TCOD_list_begin(l); curElt != TCOD_list_end(l); curElt ++) { - if ( *curElt == elt ) { - TCOD_list_remove_iterator_fast(l,curElt); - return; - } - } -} -bool TCOD_list_contains(TCOD_list_t l,const void * elt) { - void **curElt; - for ( curElt = TCOD_list_begin(l); curElt != TCOD_list_end(l); curElt ++) { - if ( *curElt == elt ) return true; - } - return false; -} -void TCOD_list_clear(TCOD_list_t l) { - LIST(l)->fillSize=0; -} -void TCOD_list_clear_and_delete(TCOD_list_t l) { - void **curElt; - for ( curElt = TCOD_list_begin(l); curElt != TCOD_list_end(l); curElt ++ ) { - free(*curElt); - } - LIST(l)->fillSize=0; -} -int TCOD_list_size(TCOD_list_t l) { - return LIST(l)->fillSize; -} -void **TCOD_list_insert_before(TCOD_list_t l,const void *elt,int before) { - int idx; - if ( LIST(l)->fillSize+1 >= LIST(l)->allocSize ) TCOD_list_allocate_int(l); - for (idx=LIST(l)->fillSize; idx > before; idx--) { - LIST(l)->array[idx]=LIST(l)->array[idx-1]; - } - LIST(l)->array[before]=(void *)elt; - LIST(l)->fillSize++; - return &LIST(l)->array[before]; -} -bool TCOD_list_is_empty(TCOD_list_t l) { - return ( LIST(l)->fillSize == 0 ); -} diff --git a/tcod_sys/libtcod/src/mersenne.cpp b/tcod_sys/libtcod/src/mersenne.cpp deleted file mode 100644 index bab46be81..000000000 --- a/tcod_sys/libtcod/src/mersenne.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include - -#include - -static TCODRandom *instance=(TCODRandom *)NULL; - -TCODRandom *TCODRandom::getInstance(void) { - if (! instance ) { - instance=new TCODRandom(TCOD_RNG_CMWC,true); - } - return instance; -} - -TCODRandom::TCODRandom(TCOD_random_algo_t algo, bool allocate) { - if ( allocate ) data = TCOD_random_new(algo); -} - -TCODRandom::TCODRandom(uint32_t seed, TCOD_random_algo_t algo) { - data=TCOD_random_new_from_seed(algo, seed); -} - -TCODRandom::~TCODRandom() { - TCOD_random_delete(data); -} - -TCODRandom *TCODRandom::save() const { - TCODRandom *ret=new TCODRandom(((mersenne_data_t *)data)->algo,false); - ret->data=TCOD_random_save(data); - return ret; -} - -void TCODRandom::restore(const TCODRandom *backup) { - TCOD_random_restore(data,backup->data); -} diff --git a/tcod_sys/libtcod/src/mouse.cpp b/tcod_sys/libtcod/src/mouse.cpp deleted file mode 100644 index b131f87d6..000000000 --- a/tcod_sys/libtcod/src/mouse.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#ifdef TCOD_CONSOLE_SUPPORT - -void TCODMouse::showCursor(bool visible) { - TCOD_mouse_show_cursor(visible); -} - -bool TCODMouse::isCursorVisible() { - return TCOD_mouse_is_cursor_visible() != 0; -} - -void TCODMouse::move(int x, int y) { - TCOD_mouse_move(x,y); -} - -TCOD_mouse_t TCODMouse::getStatus() { - return TCOD_mouse_get_status(); -} - -#endif diff --git a/tcod_sys/libtcod/src/namegen.cpp b/tcod_sys/libtcod/src/namegen.cpp deleted file mode 100644 index 55fab1f56..000000000 --- a/tcod_sys/libtcod/src/namegen.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/* -* Mingos' NameGen -* This file was written by Dominik "Mingos" Marczuk. -*/ -#include - -void TCODNamegen::parse (const char * filename, TCODRandom * random) { - TCOD_namegen_parse (filename, random ? random->data : NULL); -} - -char * TCODNamegen::generate (char * name, bool allocate) { - return TCOD_namegen_generate (name, allocate); -} - -char * TCODNamegen::generateCustom (char * name, char * rule, bool allocate) { - return TCOD_namegen_generate_custom (name, rule, allocate); -} - -TCOD_list_t TCODNamegen::getSets (void) { - return TCOD_namegen_get_sets (); -} - -void TCODNamegen::destroy (void) { - TCOD_namegen_destroy (); -} diff --git a/tcod_sys/libtcod/src/path.cpp b/tcod_sys/libtcod/src/path.cpp deleted file mode 100644 index d1edd69c7..000000000 --- a/tcod_sys/libtcod/src/path.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - - -TCODPath::TCODPath(const TCODMap *map, float diagonalCost) { - data=(void *)TCOD_path_new_using_map(map->data,diagonalCost); -} - -TCODPath::~TCODPath() { - TCOD_path_delete(data); -} - -float TCOD_path_func(int xFrom, int yFrom, int xTo,int yTo, void *data) { - TCODPath::WrapperData *cppData=(TCODPath::WrapperData *)data; - return cppData->listener->getWalkCost(xFrom,yFrom,xTo,yTo,cppData->userData); -} - -TCODPath::TCODPath(int width, int height, const ITCODPathCallback *listener, void *userData, float diagonalCost) { - cppData.listener=listener; - cppData.userData=userData; - data=(void *)TCOD_path_new_using_function(width, height, TCOD_path_func, (void *)&cppData,diagonalCost); -} - - -bool TCODPath::compute(int ox, int oy, int dx, int dy) { - return TCOD_path_compute(data,ox,oy,dx,dy) != 0; -} - -bool TCODPath::walk(int *x, int *y, bool recalculateWhenNeeded) { - return TCOD_path_walk(data,x,y,recalculateWhenNeeded) != 0; -} - -bool TCODPath::isEmpty() const { - return TCOD_path_is_empty(data) != 0; -} - -void TCODPath::reverse() { - TCOD_path_reverse(data); -} - -int TCODPath::size() const { - return TCOD_path_size(data); -} - -void TCODPath::get(int index, int *x, int *y) const { - return TCOD_path_get(data,index,x,y); -} - -void TCODPath::getOrigin(int *x,int *y) const { - TCOD_path_get_origin(data,x,y); -} - -void TCODPath::getDestination(int *x,int *y) const { - TCOD_path_get_destination(data,x,y); -} - -// ----------------- // -// Dijkstra // -// written by Mingos // -// ----------------- // - -//ctor -TCODDijkstra::TCODDijkstra (TCODMap *map, float diagonalCost) { - data = TCOD_dijkstra_new(map->data,diagonalCost); -} - -//another ctor -TCODDijkstra::TCODDijkstra (int width, int height, const ITCODPathCallback *listener, void *userData, float diagonalCost) { - cppData.listener=listener; - cppData.userData=userData; - data=(void *)TCOD_dijkstra_new_using_function(width, height, TCOD_path_func, (void *)&cppData,diagonalCost); -} - -//dtor -TCODDijkstra::~TCODDijkstra (void) { - TCOD_dijkstra_delete(data); -} - -//compute distances grid -void TCODDijkstra::compute (int rootX, int rootY) { - TCOD_dijkstra_compute(data,rootX,rootY); -} - -//retrieve distance to a given cell -float TCODDijkstra::getDistance (int x, int y) { - return TCOD_dijkstra_get_distance(data,x,y); -} - -//create a path -bool TCODDijkstra::setPath (int toX, int toY) { - return (TCOD_dijkstra_path_set(data,toX,toY) != 0); -} - -void TCODDijkstra::reverse() { - TCOD_dijkstra_reverse(data); -} - -//walk a path -bool TCODDijkstra::walk (int *x, int *y) { - return TCOD_dijkstra_path_walk(data,x,y) != 0; -} - -bool TCODDijkstra::isEmpty() const { - return TCOD_dijkstra_is_empty(data) != 0; -} - -int TCODDijkstra::size() const { - return TCOD_dijkstra_size(data); -} - -void TCODDijkstra::get(int index, int *x, int *y) const { - return TCOD_dijkstra_get(data,index,x,y); -} diff --git a/tcod_sys/libtcod/src/sys_opengl_c.c b/tcod_sys/libtcod/src/sys_opengl_c.c deleted file mode 100644 index eecfd948d..000000000 --- a/tcod_sys/libtcod/src/sys_opengl_c.c +++ /dev/null @@ -1,688 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/* - * This renderer is mostly copied and pasted from Antagonist's SkyFire GLSL roguelike engine - */ -#ifndef TCOD_BARE -#include - -#include "libtcod_int.h" -#include "console.h" - -#ifndef NO_OPENGL -#include -#include -#include - -#define CHECKGL( GLcall ) \ - GLcall; \ - if(!_CheckGL_Error( #GLcall, __FILE__, __LINE__)) \ - return false; - -#ifdef NDEBUG -#define DBGCHECKGL(GLcall) GLcall -#else -#define DBGCHECKGL CHECKGL -#endif - -typedef enum -{ - Character, - ForeCol, - BackCol, - ConsoleDataEnumSize -} ConsoleDataEnum; -/* JBR04152012 - Made Character a 4 byte value here to support extended characters like other renderers. - Seems like it should be possible to make it a two byte value using GL_UNSIGNED_SHORT_5_6_5_REV in updateTex, - but I can't seem to get the math right in the shader code, it always loses precision somewhere, - resulting in incorrect characters. */ -const int ConsoleDataAlignment[3] = {4, 3, 3 }; - -static const char *TCOD_con_vertex_shader = -#ifndef NDEBUG -"#version 110\n" -#endif -"uniform vec2 termsize; " - -"void main(void) " -"{ " - -" gl_Position = gl_Vertex; " - -" gl_TexCoord[0] = gl_MultiTexCoord0; " -" gl_TexCoord[0].x = gl_TexCoord[0].x*termsize.x; " -" gl_TexCoord[0].y = gl_TexCoord[0].y*termsize.y; " -"} " -; - -static const char *TCOD_con_pixel_shader = -#ifndef NDEBUG -"#version 110\n" -#endif -"uniform sampler2D font; " -"uniform sampler2D term; " -"uniform sampler2D termfcol; " -"uniform sampler2D termbcol; " - -"uniform float fontw; " -"uniform vec2 fontcoef; " -"uniform vec2 termsize; " -"uniform vec2 termcoef; " - -"void main(void) " -"{ " -" vec2 rawCoord = gl_TexCoord[0].xy; " /* varying from [0, termsize) in x and y */ -" vec2 conPos = floor(rawCoord); " /* console integer position */ -" vec2 pixPos = fract(rawCoord); " /* pixel offset within console position */ -" pixPos = vec2(pixPos.x*fontcoef.x,pixPos.y*fontcoef.y); " /* Correct pixel offset for font tex location */ - -" vec2 address = vec2(conPos.x*termcoef.x,conPos.y*termcoef.y); " -" address=address+vec2(0.001, 0.001); " -" vec4 charvec = texture2D(term,address);" -" float inchar = (charvec.r * 256.0) + (charvec.g * 256.0 * 256.0);" /* character */ -" vec4 tcharfcol = texture2D(termfcol, address); " /* front color */ -" vec4 tcharbcol = texture2D(termbcol, address); " /* back color */ - -" vec4 tchar = vec4(mod(floor(inchar),floor(fontw)),floor(inchar/fontw), 0.0, 0.0); " /* 1D index to 2D index map for character */ - -" gl_FragColor = texture2D(font, vec2((tchar.x*fontcoef.x),(tchar.y*fontcoef.y))+pixPos.xy); " /* magic func: finds pixel value in font file */ -" gl_FragColor=gl_FragColor.a*tcharfcol+(1.0-gl_FragColor.a)*tcharbcol; " /* Coloring stage */ -"} " -; - -bool _CheckGL_Error(const char* GLcall, const char* file, const int line) -{ - GLenum errCode; - if((errCode = glGetError())!=GL_NO_ERROR) - { - printf("OPENGL ERROR #%i: in file %s on line %i\n",errCode,file, line); - printf("OPENGL Call: %s\n",GLcall); - return false; - } - return true; -} - -/* called before creating window */ -void TCOD_opengl_init_attributes(void) { - static bool first=true; - if ( first ) { - SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); - SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); - SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,8); - SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, 32 ); - /* ATI driver bug : enabling this might result in red screen */ - /* SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1); */ - first=false; - } -} - -/* console size (power of 2 and cells) */ -static int POTconwidth, POTconheight, conwidth, conheight; -/* programs and shaders handles */ -static GLhandleARB conProgram, conVertShader, conFragShader; -/* font texture handle */ -static GLuint font_tex; -/* font power of 2 size and pixels */ -static int POTfontwidth,POTfontheight, fontwidth,fontheight; -/* console data */ -static GLuint Tex[ConsoleDataEnumSize]; -static unsigned char *data[ConsoleDataEnumSize]; -static bool dirty[ConsoleDataEnumSize]; - -/* extension function pointers */ -static PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB=0; -static PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB=0; -static PFNGLSHADERSOURCEARBPROC glShaderSourceARB=0; -static PFNGLCOMPILESHADERARBPROC glCompileShaderARB=0; -static PFNGLGETINFOLOGARBPROC glGetInfoLogARB=0; -static PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB=0; -static PFNGLATTACHOBJECTARBPROC glAttachObjectARB=0; -static PFNGLLINKPROGRAMARBPROC glLinkProgramARB=0; -static PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB=0; -static PFNGLUNIFORM2FARBPROC glUniform2fARB=0; -static PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB=0; -static PFNGLUNIFORM1FARBPROC glUniform1fARB=0; -static PFNGLUNIFORM1IARBPROC glUniform1iARB=0; -static PFNGLACTIVETEXTUREPROC glActiveTextureF=0; - -static SDL_GLContext glcontext; - -void TCOD_opengl_uninit_state() { - SDL_GL_DeleteContext(glcontext); -} - -/* call after creating window */ -bool TCOD_opengl_init_state(int conw, int conh, void *font) { - SDL_Surface *font_surf=(SDL_Surface *)font; - SDL_PixelFormat *my_format=SDL_AllocFormat(SDL_GetWindowPixelFormat(window)); - - /* convert font for opengl */ - uint32_t rmask, gmask, bmask, amask; - SDL_Surface *temp; - SDL_Surface *temp_alpha; - - glcontext = SDL_GL_CreateContext(window); - - /* check opengl extensions */ - if ( TCOD_ctx.renderer == TCOD_RENDERER_GLSL ) { - bool hasShader = false; - const char *glexts=(const char *)glGetString(GL_EXTENSIONS); - if (glexts ) { - hasShader = (strstr(glexts,"GL_ARB_shader_objects") != NULL); - } - if (! hasShader ) { - TCOD_LOG(("Missing GL_ARB_shader_objects extension. Falling back to fixed pipeline...\n")); - TCOD_ctx.renderer = TCOD_RENDERER_OPENGL; - } - } - - /* set extensions functions pointers */ - glCreateShaderObjectARB=(PFNGLCREATESHADEROBJECTARBPROC)SDL_GL_GetProcAddress("glCreateShaderObjectARB"); - glGetObjectParameterivARB=(PFNGLGETOBJECTPARAMETERIVARBPROC)SDL_GL_GetProcAddress("glGetObjectParameterivARB"); - glShaderSourceARB=(PFNGLSHADERSOURCEARBPROC)SDL_GL_GetProcAddress("glShaderSourceARB"); - glCompileShaderARB=(PFNGLCOMPILESHADERARBPROC)SDL_GL_GetProcAddress("glCompileShaderARB"); - glGetInfoLogARB=(PFNGLGETINFOLOGARBPROC)SDL_GL_GetProcAddress("glGetInfoLogARB"); - glCreateProgramObjectARB=(PFNGLCREATEPROGRAMOBJECTARBPROC)SDL_GL_GetProcAddress("glCreateProgramObjectARB"); - glAttachObjectARB=(PFNGLATTACHOBJECTARBPROC)SDL_GL_GetProcAddress("glAttachObjectARB"); - glLinkProgramARB=(PFNGLLINKPROGRAMARBPROC)SDL_GL_GetProcAddress("glLinkProgramARB"); - glUseProgramObjectARB=(PFNGLUSEPROGRAMOBJECTARBPROC)SDL_GL_GetProcAddress("glUseProgramObjectARB"); - glUniform2fARB=(PFNGLUNIFORM2FARBPROC)SDL_GL_GetProcAddress("glUniform2fARB"); - glGetUniformLocationARB=(PFNGLGETUNIFORMLOCATIONARBPROC)SDL_GL_GetProcAddress("glGetUniformLocationARB"); - glUniform1fARB=(PFNGLUNIFORM1FARBPROC)SDL_GL_GetProcAddress("glUniform1fARB"); - glUniform1iARB=(PFNGLUNIFORM1IARBPROC)SDL_GL_GetProcAddress("glUniform1iARB"); - glActiveTextureF=(PFNGLACTIVETEXTUREPROC)SDL_GL_GetProcAddress("glActiveTexture"); - - /* set opengl state */ - glEnable(GL_TEXTURE_2D); - glClearColor(1.0f, 1.0f, 0.0f, 0.0f); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glClear( GL_COLOR_BUFFER_BIT ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - if ( TCOD_ctx.renderer == TCOD_RENDERER_GLSL ) { - glOrtho(0, conw, 0, conh, -1.0f, 1.0f); - glDisable (GL_BLEND); - } else { - glOrtho(0, conw, conh, 0.0f, -1.0f, 1.0f); - glEnable (GL_BLEND); - glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - } - - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); -/*#ifdef TCOD_WINDOWS */ - if ( ! TCOD_ctx.fullscreen ) { - /* turn vsync off in windowed mode */ - typedef bool (APIENTRY *PFNWGLSWAPINTERVALFARPROC)(int); - PFNWGLSWAPINTERVALFARPROC wglSwapIntervalEXT = 0; - - wglSwapIntervalEXT = (PFNWGLSWAPINTERVALFARPROC)SDL_GL_GetProcAddress("wglSwapIntervalEXT"); - - if (wglSwapIntervalEXT) wglSwapIntervalEXT(0); - } -/*#endif */ - - /* compute pot size */ - conwidth=conw; - conheight=conh; - POTconwidth=POTconheight=1; - while ( POTconwidth < conw ) POTconwidth *= 2; - while ( POTconheight < conh ) POTconheight *= 2; - - - #if SDL_BYTEORDER == SDL_BIG_ENDIAN - rmask = 0xff000000; - gmask = 0x00ff0000; - bmask = 0x0000ff00; - amask = 0x000000ff; - #else - rmask = 0x000000ff; - gmask = 0x0000ff00; - bmask = 0x00ff0000; - amask = 0xff000000; - #endif - - fontwidth=font_surf->w; - fontheight=font_surf->h; - POTfontwidth=POTfontheight=1; - while ( POTfontwidth < fontwidth ) POTfontwidth *= 2; - while ( POTfontheight < fontheight ) POTfontheight *= 2; - - SDL_SetColorKey(font_surf, 1, SDL_MapRGB(font_surf->format, 0, 0, 0)); - my_format->Amask = amask; - temp_alpha = SDL_ConvertSurface(font_surf, my_format, 0); - SDL_FreeFormat(my_format); - - temp = SDL_CreateRGBSurface(SDL_SWSURFACE, POTfontwidth, POTfontheight, 32, bmask, gmask, rmask, amask); /*BGRA */ - - SDL_BlitSurface(temp_alpha, NULL, temp, NULL); - SDL_FreeSurface(temp_alpha); - - CHECKGL(glGenTextures(1, &font_tex)); - CHECKGL(glBindTexture(GL_TEXTURE_2D, font_tex)); - SDL_LockSurface(temp); - - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - - CHECKGL(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, temp->w, temp->h, 0, GL_BGRA, GL_UNSIGNED_BYTE, temp->pixels)); - SDL_UnlockSurface(temp); - SDL_FreeSurface(temp); - return true; -} - -static GLhandleARB loadShader(const char *txt, GLuint type) { - int success; - int infologLength = 0; - int charsWritten = 0; - char *infoLog; - GLhandleARB v = glCreateShaderObjectARB(type); - glShaderSourceARB(v, 1, &txt, 0); - glCompileShaderARB(v); - - glGetObjectParameterivARB(v, GL_COMPILE_STATUS, &success); - if(success!=GL_TRUE) - { - /* something went wrong */ - glGetObjectParameterivARB(v, GL_INFO_LOG_LENGTH,&infologLength); - if(infologLength>0) - { - infoLog = (char *)malloc(infologLength); - glGetInfoLogARB(v, infologLength, &charsWritten, infoLog); - printf("GLSL ERROR : %s\n",infoLog); - free(infoLog); - } - return 0; - } - - return v; -} - -static bool loadProgram(const char *vertShaderCode, const char *fragShaderCode, - GLhandleARB *vertShader, GLhandleARB *fragShader, GLhandleARB *prog) { - /* Create and load Program and Shaders */ - int success; - *prog = DBGCHECKGL(glCreateProgramObjectARB()); - - *vertShader = loadShader(vertShaderCode, GL_VERTEX_SHADER); - if ( *vertShader == 0 ) return false; - glAttachObjectARB(*prog, *vertShader); - - *fragShader = loadShader(fragShaderCode, GL_FRAGMENT_SHADER); - if ( *fragShader == 0 ) return false; - glAttachObjectARB(*prog, *fragShader); - - glLinkProgramARB(*prog); - - glGetObjectParameterivARB(*prog, GL_LINK_STATUS, &success); - if(success!=GL_TRUE) - { - /* something went wrong */ - int infologLength = 0; - int charsWritten = 0; - char *infoLog; - glGetObjectParameterivARB(*prog, GL_INFO_LOG_LENGTH,&infologLength); - if (infologLength > 0) - { - infoLog = (char *)malloc(infologLength); - glGetInfoLogARB(*prog, infologLength, &charsWritten, infoLog); - printf("OPENGL ERROR: Program link Error"); - printf("%s\n",infoLog); - free(infoLog); - } - return false; - } - return true; -} - -bool TCOD_opengl_init_shaders(void) { - int i; - TCOD_color_t *fCol; - if ( TCOD_ctx.renderer == TCOD_RENDERER_GLSL ) { - if (! loadProgram(TCOD_con_vertex_shader, TCOD_con_pixel_shader, &conVertShader, &conFragShader, &conProgram ) ) return false; - } - /* Host side data init */ - for(i = 0; i< ConsoleDataEnumSize; i++) - { - data[i] = (unsigned char *)calloc(conwidth*conheight,ConsoleDataAlignment[i]); - dirty[i]=true; - } - /* Initialize ForeCol to 255, 255, 255, 255 */ - fCol = (TCOD_color_t *)data[ForeCol]; - for( i = 0; i < conwidth*conheight; i++) - { - fCol[i].r=255; - fCol[i].g=255; - fCol[i].b=255; - } - - /* Generate Textures */ - glGenTextures(3, Tex); - - /* Character Texture */ - CHECKGL(glBindTexture(GL_TEXTURE_2D, Tex[Character])); - - CHECKGL(glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST )); - CHECKGL(glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST )); - - CHECKGL(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, POTconwidth, POTconheight, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, 0)); - - - /* ForeCol Texture */ - CHECKGL(glBindTexture(GL_TEXTURE_2D, Tex[ForeCol])); - - CHECKGL(glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST )); - CHECKGL(glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST )); - - CHECKGL(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, POTconwidth, POTconheight, 0, GL_RGB, GL_UNSIGNED_BYTE, 0)); - - /* BackCol Texture */ - CHECKGL(glBindTexture(GL_TEXTURE_2D, Tex[BackCol])); - - CHECKGL(glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST )); - CHECKGL(glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST )); - - CHECKGL(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, POTconwidth, POTconheight, 0, GL_RGB, GL_UNSIGNED_BYTE, 0)); - - CHECKGL(glBindTexture(GL_TEXTURE_2D, 0)); - - return true; -} - -static bool updateTex(ConsoleDataEnum dataType) { - GLenum Type=0; - DBGCHECKGL(glBindTexture(GL_TEXTURE_2D, Tex[dataType])); - - switch(ConsoleDataAlignment[dataType]) - { - case 1: - Type = GL_RED; - break; - /*case 2: - Type = GL_RG; - break; */ - case 3: - Type = GL_RGB; - break; - case 4: - Type = GL_RGBA; - break; - } - /*glPixelStorei(GL_UNPACK_ALIGNMENT, 1); */ - DBGCHECKGL(glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, conwidth, conheight, Type, GL_UNSIGNED_BYTE, data[dataType])); - - DBGCHECKGL(glBindTexture(GL_TEXTURE_2D,0)); - return true; -} - -static void updateChar(ConsoleDataEnum dataType, int BufferPos, unsigned char *c, int length, int offset) { - int i; - dirty[dataType] = true; /* Set dirty so Texture gets updated next frame */ - - for(i = 0; ich_array; - int *oc; - nfg = TCOD_image_get_colors(console->fg_colors); - nbg = TCOD_image_get_colors(console->bg_colors); - if (track_changes) { - oc = cache->ch_array; - ofg = TCOD_image_get_colors(cache->fg_colors); - obg = TCOD_image_get_colors(cache->bg_colors); - } - /* update opengl data */ - /* TODO use function pointers so that libtcod's putchar directly updates opengl data */ - for (y=0;yr != obg->r || nbg->g != obg->g || nbg->b != obg->b || - nfg->r != ofg->r || nfg->g != ofg->g || nfg->b != ofg->b || - *c != *oc) { - changed=true; - } - } - if ( changed ) { - TCOD_opengl_putchar_ex(x, y, TCOD_get_tileid_for_charcode_(*c), *nfg, *nbg); - } - c++; - nfg++; - nbg++; - if (track_changes) { - oc++; - ofg++; - obg++; - } - } - } - - /* check if any of the textures have changed since they were last uploaded */ - for( i = 0; i< ConsoleDataEnumSize; i++) - { - if(dirty[i]) - { - updateTex((ConsoleDataEnum)i); - dirty[i] = false; - } - } - if ( TCOD_ctx.renderer == TCOD_RENDERER_OPENGL ) { - /* fixed pipeline for video cards without pixel shader support */ - /* draw the background as a single quad */ - float texw=(float)conwidth/POTconwidth; - float texh=(float)conheight/POTconheight; - float fonw=(float)fontwidth/(TCOD_ctx.fontNbCharHoriz*POTfontwidth); - float fonh=(float)fontheight/(TCOD_ctx.fontNbCharVertic*POTfontheight); - DBGCHECKGL(glBindTexture(GL_TEXTURE_2D, Tex[BackCol])); - DBGCHECKGL(glBegin(GL_QUADS); - glColor3f(1.0,1.0,1.0); - glTexCoord2f( 0.0, 0.0 ); - glVertex2i( 0, 0); - glTexCoord2f( 0.0, texh); - glVertex2i( 0, conheight ); - glTexCoord2f( texw, texh ); - glVertex2i( conwidth, conheight); - glTexCoord2f( texw, 0.0 ); - glVertex2i( conwidth, 0 ); - glEnd()); - /* draw the characters (one quad per cell) */ - DBGCHECKGL(glBindTexture(GL_TEXTURE_2D, font_tex)); - - c = console->ch_array; - nfg = TCOD_image_get_colors(console->fg_colors); - nbg = TCOD_image_get_colors(console->bg_colors); - for (y=0;yValidate()); */ - - DBGCHECKGL(glBegin(GL_QUADS); - glTexCoord2f(0.0f, 1.0f); - glVertex3f(-1.0f,-1.0f,0.0f); - glTexCoord2f(1.0f, 1.0f); - glVertex3f(1.0f,-1.0f,0.0f); - glTexCoord2f(1.0f, 0.0f); - glVertex3f(1.0f,1.0f, 0.0f); - glTexCoord2f(0.0f, 0.0f); - glVertex3f(-1.0f,1.0f,0.0f); - glEnd()); - - DBGCHECKGL(glBindTexture(GL_TEXTURE_2D, 0)); - - DBGCHECKGL(glUseProgramObjectARB(0)); - } - /* fading overlay */ - if ( fade != 255 ) { - int x=0,y=0; - if ( TCOD_ctx.fullscreen ) { - x=TCOD_ctx.fullscreen_offsetx/TCOD_ctx.font_width; - y=TCOD_ctx.fullscreen_offsety/TCOD_ctx.font_height; - } - glBegin( GL_QUADS ); - glColor4f(TCOD_ctx.fading_color.r/255.0f,TCOD_ctx.fading_color.g/255.0f,TCOD_ctx.fading_color.b/255.0f,1.0f-fade/255.0f); - glVertex2i( x, y); - glVertex2i( x, y+conheight ); - glVertex2i( x+conwidth, y+conheight ); - glVertex2i( x+conwidth, y); - glEnd(); - } - return true; -} - -void TCOD_opengl_swap(void) { - SDL_GL_SwapWindow(window); -} - -void * TCOD_opengl_get_screen(void) { - SDL_Surface *surf; - int pixw,pixh,offx=0,offy=0,x,y; - uint32_t mask,nmask; - - /* allocate a pixel buffer */ - pixw=TCOD_ctx.root->w * TCOD_ctx.font_width; - pixh=TCOD_ctx.root->h * TCOD_ctx.font_height; - surf=TCOD_sys_get_surface(pixw,pixh,false); - if ( TCOD_ctx.fullscreen ) { - offx=TCOD_ctx.fullscreen_offsetx; - offy=TCOD_ctx.fullscreen_offsety; - } - - /* get pixel data from opengl */ - glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT ); - glPixelStorei(GL_PACK_ROW_LENGTH, 0); - glPixelStorei(GL_PACK_ALIGNMENT, 1); - glReadPixels(offx,offy,pixw,pixh, GL_RGB, GL_UNSIGNED_BYTE, surf->pixels); - glPopClientAttrib(); - - /* vertical flip (opengl has lower-left origin, SDL upper left) */ - mask=surf->format->Rmask|surf->format->Gmask|surf->format->Bmask; - nmask=~mask; - for (x=0; x < surf->w; x++) { - for (y=0; y < surf->h/2; y++) { - int offsrc=x*3+y*surf->pitch; - int offdst=x*3+(surf->h-1-y)*surf->pitch; - uint32_t *pixsrc = (uint32_t *)(((uint8_t*)surf->pixels)+offsrc); - uint32_t *pixdst = (uint32_t *)(((uint8_t*)surf->pixels)+offdst); - uint32_t tmp = *pixsrc; - *pixsrc = ((*pixsrc) & nmask) | ((*pixdst) & mask); - *pixdst = ((*pixdst) & nmask) | (tmp & mask); - } - } - - return (void *)surf; -} - -#endif /* NO_OPENGL */ - -#endif /* TCOD_BARE */ diff --git a/tcod_sys/libtcod/src/sys_sdl2_c.c b/tcod_sys/libtcod/src/sys_sdl2_c.c deleted file mode 100644 index 77e5a39f3..000000000 --- a/tcod_sys/libtcod/src/sys_sdl2_c.c +++ /dev/null @@ -1,527 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef TCOD_BARE - -#include - -#include -#include - -#include - -#include -#include -#include - -static SDL_Surface* scale_screen=NULL; -static bool clear_screen=false; -static TCOD_console_data_t *root_console_cache; /* cache for previous values */ - -/* This just forces a complete redraw, bypassing the usual rendering of changes. */ -void TCOD_sys_set_clear_screen(void) { - clear_screen=true; -} - -static void get_closest_mode(int *w, int *h) { - SDL_DisplayMode wantedmode, closestmode; - wantedmode.w = *w; - wantedmode.h = *h; - wantedmode.format = 0; /* don't care for rest. */ - wantedmode.refresh_rate = 0; - wantedmode.driverdata = 0; - if (SDL_GetClosestDisplayMode(window?SDL_GetWindowDisplayIndex(window):0, &wantedmode, &closestmode) == &closestmode) { - *w=closestmode.w; - *h=closestmode.h; - } -} - -/* - * Separate out the actual rendering, so that render to texture can be done. - */ -static void actual_rendering(void) { - SDL_Rect srcRect, dstRect; - SDL_Texture *texture; - - if (scale_data.min_scale_factor - 1e-3f > scale_factor) { - /* Prepare for the unscaled and centered copy of the entire console. */ - srcRect.x=0; srcRect.y=0; srcRect.w=scale_screen->w; srcRect.h=scale_screen->h; - if (TCOD_ctx.fullscreen) { - dstRect.x=TCOD_ctx.fullscreen_offsetx; dstRect.y=TCOD_ctx.fullscreen_offsety; - } else { - dstRect.x=0; dstRect.y=0; - } - dstRect.w=scale_screen->w; dstRect.h=scale_screen->h; - } else { - /* Prepare for the scaled copy of the displayed console area. */ - srcRect.x=scale_data.src_x0; srcRect.y=scale_data.src_y0; srcRect.w=scale_data.src_copy_width; srcRect.h=scale_data.src_copy_height; - dstRect.x=scale_data.dst_offset_x; dstRect.y=scale_data.dst_offset_y; - dstRect.w=scale_data.dst_display_width; dstRect.h=scale_data.dst_display_height; - } - if ( TCOD_ctx.sdl_cbk ) { - TCOD_ctx.sdl_cbk((void *)scale_screen); - } - texture = SDL_CreateTextureFromSurface(renderer, scale_screen); - SDL_RenderCopy(renderer, texture, &srcRect, &dstRect); - SDL_DestroyTexture(texture); -} - -/* Return an up-to-date cache for the root console, create or resize the cache - if needed */ -static TCOD_console_data_t *ensure_cache(TCOD_console_data_t* root) { - if (!root_console_cache || - root_console_cache->w != root->w || - root_console_cache->h != root->h) { - if (root_console_cache) { TCOD_console_delete(root_console_cache); } - root_console_cache = TCOD_console_new(root->w, root->h); - } - return root_console_cache; -} - -/* In order to avoid rendering race conditions and the ensuing segmentation - * faults, this should only be called when it would normally be and not - * specifically to force screen refreshes. To this end, and to avoid - * threading complications it takes care of special cases internally. */ -static void render(TCOD_SDL_driver_t *sdl, void *vbitmap, TCOD_console_data_t *console) { - if ( TCOD_ctx.renderer == TCOD_RENDERER_SDL ) { - int console_width_p = console->w * TCOD_ctx.font_width; - int console_height_p = console->h * TCOD_ctx.font_height; - - /* Make a bitmap of exact rendering size and correct format. */ - if (scale_screen == NULL) { - int bpp; - uint32_t rmask, gmask, bmask, amask; - if (SDL_PixelFormatEnumToMasks(SDL_GetWindowPixelFormat(window), &bpp, &rmask, &gmask, &bmask, &amask) == SDL_FALSE) { - TCOD_fatal("SDL : failed to create scaling surface : indeterminate window pixel format"); - return; - } - scale_screen=SDL_CreateRGBSurface(SDL_SWSURFACE,console_width_p,console_height_p,bpp,rmask,gmask,bmask,amask); - if (scale_screen == NULL) { - TCOD_fatal("SDL : failed to create scaling surface"); - return; - } - } else if (clear_screen) { - clear_screen=false; - SDL_FillRect(scale_screen,0,0); - /* Implicitly do complete console redraw, not just tracked changes. */ - TCOD_console_set_dirty(0, 0, console->w, console->h); - } - - TCOD_sys_console_to_bitmap(scale_screen, console, ensure_cache(console)); - - /* Scale the rendered bitmap to the screen, preserving aspect ratio, and blit it. - * This data is also used for console coordinate resolution.. */ - if (scale_data.last_scale_factor != scale_factor || scale_data.last_scale_xc != sdl->scale_xc || scale_data.last_scale_yc != sdl->scale_yc || - scale_data.last_fullscreen != TCOD_ctx.fullscreen || scale_data.force_recalc) { - /* Preserve old value of input variables, to enable recalculation if they change. */ - scale_data.last_scale_factor = scale_factor; - scale_data.last_scale_xc = sdl->scale_xc; - scale_data.last_scale_yc = sdl->scale_yc; - scale_data.last_fullscreen = TCOD_ctx.fullscreen; - scale_data.force_recalc = 0; - - if (scale_data.last_fullscreen) { - scale_data.surface_width = TCOD_ctx.actual_fullscreen_width; - scale_data.surface_height = TCOD_ctx.actual_fullscreen_height; - } else { - scale_data.surface_width = console_width_p; - scale_data.surface_height = console_height_p; - } - scale_data.min_scale_factor = MAX((float)console_width_p/scale_data.surface_width, (float)console_height_p/scale_data.surface_height); - if (scale_data.min_scale_factor > 1.0f) - scale_data.min_scale_factor = 1.0f; - /*printf("min_scale_factor %0.3f = MAX(%d/%d, %d/%d)", scale_data.min_scale_factor, console_width_p, scale_data.surface_width, console_height_p, scale_data.surface_height);*/ - - scale_data.dst_height_width_ratio = (float)scale_data.surface_height/scale_data.surface_width; - scale_data.src_proportionate_width = (int)(console_width_p / scale_factor); - scale_data.src_proportionate_height = (int)((console_width_p * scale_data.dst_height_width_ratio) / scale_factor); - - /* Work out how much of the console to copy. */ - scale_data.src_x0 = (int)((sdl->scale_xc * console_width_p) - (0.5f * scale_data.src_proportionate_width)); - if (scale_data.src_x0 + scale_data.src_proportionate_width > console_width_p) - scale_data.src_x0 = console_width_p - scale_data.src_proportionate_width; - if (scale_data.src_x0 < 0) - scale_data.src_x0 = 0; - scale_data.src_copy_width = scale_data.src_proportionate_width; - if (scale_data.src_x0 + scale_data.src_copy_width > console_width_p) - scale_data.src_copy_width = console_width_p - scale_data.src_x0; - - scale_data.src_y0 = (int)((sdl->scale_yc * console_height_p) - (0.5f * scale_data.src_proportionate_height)); - if (scale_data.src_y0 + scale_data.src_proportionate_height > console_height_p) - scale_data.src_y0 = console_height_p - scale_data.src_proportionate_height; - if (scale_data.src_y0 < 0) - scale_data.src_y0 = 0; - scale_data.src_copy_height = scale_data.src_proportionate_height; - if (scale_data.src_y0 + scale_data.src_copy_height > console_height_p) - scale_data.src_copy_height = console_height_p - scale_data.src_y0; - - scale_data.dst_display_width = (scale_data.src_copy_width * scale_data.surface_width) / scale_data.src_proportionate_width; - scale_data.dst_display_height = (scale_data.src_copy_height * scale_data.surface_height) / scale_data.src_proportionate_height; - scale_data.dst_offset_x = (scale_data.surface_width - scale_data.dst_display_width)/2; - scale_data.dst_offset_y = (scale_data.surface_height - scale_data.dst_display_height)/2; - } - - SDL_RenderClear(renderer); - actual_rendering(); - SDL_RenderPresent(renderer); - } -#ifndef NO_OPENGL - else { - TCOD_opengl_render(oldFade, NULL, console, ensure_cache(console)); - TCOD_opengl_swap(); - } -#endif - oldFade=(int)TCOD_console_get_fade(); -} - -/* Return the current root console cache if it exists, or NULL. */ -static TCOD_console_data_t *get_root_console_cache(void){ - return root_console_cache; -} - -static SDL_Surface *create_surface(int width, int height, bool with_alpha) { - uint32_t rmask,gmask,bmask,amask; - SDL_Surface *bitmap; - int flags=SDL_SWSURFACE; - - if ( with_alpha ) { - if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) { - rmask=0x000000FF; - gmask=0x0000FF00; - bmask=0x00FF0000; - amask=0xFF000000; - } else { - rmask=0xFF000000; - gmask=0x00FF0000; - bmask=0x0000FF00; - amask=0x000000FF; - } - } else { - if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) { - rmask=0x0000FF; - gmask=0x00FF00; - bmask=0xFF0000; - } else { - rmask=0xFF0000; - gmask=0x00FF00; - bmask=0x0000FF; - } - amask=0; - } - bitmap=SDL_CreateRGBSurface(flags,width,height, - with_alpha ? 32:24, - rmask,gmask,bmask,amask); - if ( with_alpha ) { - SDL_SetSurfaceAlphaMod(bitmap, 255); - } - return (void *)bitmap; -} - -static void create_window(int w, int h, bool fullscreen) { - uint32_t winflags = SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL; -#if defined(TCOD_ANDROID) - /* Android should always be fullscreen. */ - TCOD_ctx.fullscreen = fullscreen = true; -#endif - if ( fullscreen ) { - find_resolution(); -#ifndef NO_OPENGL - if (TCOD_ctx.renderer != TCOD_RENDERER_SDL ) { - TCOD_opengl_init_attributes(); - winflags |= SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS | SDL_WINDOW_OPENGL; -# if defined(TCOD_ANDROID) && defined(FUTURE_SUPPORT) - winflags |= SDL_WINDOW_RESIZABLE; -# endif - window = SDL_CreateWindow(TCOD_ctx.window_title,SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,TCOD_ctx.actual_fullscreen_width,TCOD_ctx.actual_fullscreen_height,winflags); - if ( window && TCOD_opengl_init_state(w, h, charmap) && TCOD_opengl_init_shaders() ) { - TCOD_LOG(("Using %s renderer...\n",TCOD_ctx.renderer == TCOD_RENDERER_GLSL ? "GLSL" : "OPENGL")); - } else { - TCOD_LOG(("Fallback to SDL renderer...\n")); - TCOD_ctx.renderer = TCOD_RENDERER_SDL; - } - } -#endif - if (TCOD_ctx.renderer == TCOD_RENDERER_SDL ) { - winflags |= SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS; -# if defined(TCOD_ANDROID) && defined(FUTURE_SUPPORT) - winflags |= SDL_WINDOW_RESIZABLE; -# endif - window = SDL_CreateWindow(TCOD_ctx.window_title,SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, TCOD_ctx.actual_fullscreen_width,TCOD_ctx.actual_fullscreen_height,winflags); - if ( window == NULL ) TCOD_fatal("SDL : cannot set fullscreen video mode: %s", SDL_GetError()); - } - SDL_ShowCursor(0); - SDL_GetWindowSize(window,&TCOD_ctx.actual_fullscreen_width,&TCOD_ctx.actual_fullscreen_height); - TCOD_sys_init_screen_offset(); - } else { -#ifndef NO_OPENGL - if (TCOD_ctx.renderer != TCOD_RENDERER_SDL ) { - TCOD_opengl_init_attributes(); - winflags |= SDL_WINDOW_OPENGL; - window = SDL_CreateWindow(TCOD_ctx.window_title,SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,w*TCOD_ctx.font_width,h*TCOD_ctx.font_height,winflags); - if ( window && TCOD_opengl_init_state(w, h, charmap) && TCOD_opengl_init_shaders() ) { - TCOD_LOG(("Using %s renderer...\n",TCOD_ctx.renderer == TCOD_RENDERER_GLSL ? "GLSL" : "OPENGL")); - } else { - TCOD_LOG(("Fallback to SDL renderer...\n")); - TCOD_ctx.renderer = TCOD_RENDERER_SDL; - } - } -#endif - if (TCOD_ctx.renderer == TCOD_RENDERER_SDL ) { - window = SDL_CreateWindow(TCOD_ctx.window_title,SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,w*TCOD_ctx.font_width,h*TCOD_ctx.font_height,winflags); - TCOD_LOG(("Using SDL renderer...\n")); - } - if ( window == NULL ) TCOD_fatal("Cannot create SDL window: %s", SDL_GetError()); - } - if (TCOD_ctx.renderer == TCOD_RENDERER_SDL ) { - renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); - if ( renderer == NULL ) TCOD_fatal("Cannot create SDL renderer: %s", SDL_GetError()); - SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); - } -} - -static void destroy_window(void) { -#ifndef NO_OPENGL - if (TCOD_ctx.renderer == TCOD_RENDERER_OPENGL || TCOD_ctx.renderer == TCOD_RENDERER_GLSL) { - TCOD_opengl_uninit_state(); - } -#endif - if (scale_screen) { - SDL_FreeSurface(scale_screen); - scale_screen = NULL; - } - if (renderer) { - SDL_DestroyRenderer(renderer); - renderer = NULL; - } - if (window) { - SDL_DestroyWindow(window); - window = NULL; - } -} - -static void set_fullscreen(bool fullscreen) { - bool mouseOn=SDL_ShowCursor(-1); - if ( fullscreen ) { - find_resolution(); - SDL_SetWindowFullscreen(window, fullscreen); - SDL_ShowCursor(mouseOn ? 1:0); - SDL_GetWindowSize(window,&TCOD_ctx.actual_fullscreen_width,&TCOD_ctx.actual_fullscreen_height); - TCOD_sys_init_screen_offset(); - } else { - SDL_SetWindowFullscreen(window, fullscreen); - SDL_ShowCursor(mouseOn ? 1:0); - TCOD_ctx.fullscreen_offsetx=0; - TCOD_ctx.fullscreen_offsety=0; - } - TCOD_ctx.fullscreen=fullscreen; - oldFade=-1; /* to redraw the whole screen */ -} - -static void set_window_title(const char *title) { - SDL_SetWindowTitle(window, title); -} - -static void save_screenshot(const char *filename) { - if ( TCOD_ctx.renderer == TCOD_RENDERER_SDL ) { - /* This would be a lot easier if image saving could do textures. */ - SDL_Rect rect; - uint32_t format; - SDL_Texture *texture; - SDL_RenderGetViewport(renderer, &rect); - format = SDL_GetWindowPixelFormat(window); - texture = SDL_CreateTexture(renderer, format, SDL_TEXTUREACCESS_TARGET, rect.w, rect.h); - if (0 != texture) { - if (SDL_SetRenderTarget(renderer, texture)) { - void *pixels; - int pitch, access; - - actual_rendering(); - SDL_SetRenderTarget(renderer, NULL); - - rect.x = rect.y = rect.w = rect.h = 0; - if (-1 != SDL_QueryTexture(texture, &format, &access, &rect.w, &rect.h) && - -1 != SDL_LockTexture(texture, NULL, &pixels, &pitch)) { - int depth; - uint32_t rmask, gmask, bmask, amask; - if (SDL_TRUE == SDL_PixelFormatEnumToMasks(format, &depth, &rmask, &gmask, &bmask, &amask)) { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(pixels, rect.w, rect.h, depth, pitch, rmask, gmask, bmask, amask); - TCOD_sys_save_bitmap((void *)surface,filename); - SDL_FreeSurface(surface); - } else - TCOD_LOG(("TCOD_sys_save_screenshot - failed call to SDL_PixelFormatEnumToMasks")); - - SDL_UnlockTexture(texture); - } else - TCOD_LOG(("TCOD_sys_save_screenshot - failed call to SDL_QueryTexture or SDL_LockTexture")); - } else - TCOD_LOG(("TCOD_sys_save_screenshot - failed call to SDL_SetRenderTarget")); - SDL_DestroyTexture(texture); - } else - TCOD_LOG(("TCOD_sys_save_screenshot - failed call to SDL_CreateTexture")); -#ifndef NO_OPENGL - } else { - SDL_Surface *screenshot=(SDL_Surface *)TCOD_opengl_get_screen(); - TCOD_sys_save_bitmap((void *)screenshot,filename); - SDL_FreeSurface(screenshot); -#endif - } -} -/* get desktop resolution */ -static void get_current_resolution(int *w, int *h) { - int displayidx; - SDL_Rect rect = { 0, 0, 0, 0 }; - if (window) { - TCOD_IFNOT(window) return; - displayidx = SDL_GetWindowDisplayIndex(window); - TCOD_IFNOT(displayidx >= 0) return; - } else { - /* No window if no console, but user can want to know res before opening one. */ - TCOD_IFNOT(SDL_GetNumVideoDisplays() > 0) return; - displayidx = 0; - } - TCOD_IFNOT(SDL_GetDisplayBounds(displayidx, &rect) == 0) return; - *w=rect.w; - *h=rect.h; -} - -static void set_mouse_position(int x, int y) { - SDL_WarpMouseInWindow(window, (uint16_t)x,(uint16_t)y); -} - -static char *get_clipboard_text(void) { -#ifdef TCOD_LINUX - /* - X11 clipboard is inaccessible without an open window. - https://bugzilla.libsdl.org/show_bug.cgi?id=3222 - */ - if (!window) - return ""; -#endif - - /* - We hold onto the last clipboard text pointer SDL gave us. - For C API callers it can be considered a borrowed reference. - For Python ctypes API callers, the contents are copied into the Python string that is constructed from it. - */ - if (last_clipboard_text) { - SDL_free(last_clipboard_text); - last_clipboard_text = NULL; - } - last_clipboard_text = SDL_GetClipboardText(); - return last_clipboard_text; -} - -static bool set_clipboard_text(const char *text) { -#ifdef TCOD_LINUX - /* - X11 clipboard is inaccessible without an open window. - https://bugzilla.libsdl.org/show_bug.cgi?id=3222 - */ - if (!window) - return false; -#endif - - return SDL_SetClipboardText(text) == 0; -} - -/* android compatible file access functions */ -static bool file_read(const char *filename, unsigned char **buf, size_t *size) { - int64_t filesize; - /* get file size */ - SDL_RWops *rwops= SDL_RWFromFile(filename,"rb"); - if (!rwops) return false; - SDL_RWseek(rwops,0,RW_SEEK_END); - filesize=SDL_RWtell(rwops); - SDL_RWseek(rwops,0,RW_SEEK_SET); - /* allocate buffer */ - *buf = (unsigned char *)malloc(sizeof(unsigned char)*filesize); - /* read from file */ - if (SDL_RWread(rwops,*buf,sizeof(unsigned char),filesize) != filesize) { - SDL_RWclose(rwops); - free(*buf); - return false; - } - SDL_RWclose(rwops); - *size=filesize; - return true; -} - -static bool file_exists(const char * filename) { - SDL_RWops *rwops; - rwops = SDL_RWFromFile(filename,"rb"); - if (rwops) { - SDL_RWclose(rwops); - return true; - } - return false; -} - -static bool file_write(const char *filename, unsigned char *buf, uint32_t size) { - SDL_RWops *rwops= SDL_RWFromFile(filename,"wb"); - if (!rwops) return false; - SDL_RWwrite(rwops,buf,sizeof(unsigned char),size); - SDL_RWclose(rwops); - return true; -} - -static void shutdown_(void) { - if (last_clipboard_text) { - SDL_free(last_clipboard_text); - last_clipboard_text = NULL; - } - if (root_console_cache) { - TCOD_console_delete(root_console_cache); - root_console_cache = NULL; - } -} - -TCOD_SDL_driver_t *SDL_implementation_factory(void) { - TCOD_SDL_driver_t *ret=(TCOD_SDL_driver_t *)calloc(1,sizeof(TCOD_SDL_driver_t)); - ret->scale_xc = 0.5f; - ret->scale_yc = 0.5f; - - ret->get_closest_mode = get_closest_mode; - ret->render = render; - ret->create_surface = create_surface; - ret->create_window = create_window; - ret->destroy_window = destroy_window; - ret->set_fullscreen = set_fullscreen; - ret->set_window_title = set_window_title; - ret->save_screenshot = save_screenshot; - ret->get_current_resolution = get_current_resolution; - ret->set_mouse_position = set_mouse_position; - ret->get_clipboard_text = get_clipboard_text; - ret->set_clipboard_text = set_clipboard_text; - ret->file_read = file_read; - ret->file_exists = file_exists; - ret->file_write = file_write; - ret->shutdown = shutdown_; - ret->get_root_console_cache = get_root_console_cache; - return ret; -} - -#endif /* TCOD_BARE */ diff --git a/tcod_sys/libtcod/src/sys_sdl_c.c b/tcod_sys/libtcod/src/sys_sdl_c.c deleted file mode 100644 index b39d7665e..000000000 --- a/tcod_sys/libtcod/src/sys_sdl_c.c +++ /dev/null @@ -1,1768 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef TCOD_BARE -#include -#include - -#include -#include -#include -#include - -#include - -#include -#include -#include - -static TCOD_SDL_driver_t *sdl=NULL; - - -/* library initialization function */ -#ifdef TCOD_WINDOWS -#include -BOOL APIENTRY DllMain( HINSTANCE hModule, DWORD reason, LPVOID reserved) { - switch (reason ) { - case DLL_PROCESS_ATTACH : sdl = SDL_implementation_factory(); break; - default : break; - } - return TRUE; -} -#else - void __attribute__ ((constructor)) DllMain(void) { - sdl = SDL_implementation_factory(); - } -#endif - -#if defined(__ANDROID__) -#define TCOD_TOUCH_INPUT -#define MAX_TOUCH_FINGERS 5 - -typedef struct { - int nupdates; /* how many updates have happened since the first finger was pressed. */ - uint32_t ticks0; /* current number of ticks at start of touch event sequence. */ - SDL_FingerID finger_id; /* the last finger which was pressed. */ - int coords[MAX_TOUCH_FINGERS][2]; /* absolute position of each finger. */ - int coords_delta[MAX_TOUCH_FINGERS][2]; /* absolute position of each finger. */ - int consolecoords[MAX_TOUCH_FINGERS][2]; /* cell coordinates in the root console for each finger. */ - int consolecoords_delta[MAX_TOUCH_FINGERS][2]; /* cell coordinates in the root console for each finger. */ - int nfingers; /* number of unique fingers employed at any time during this. */ - int nfingerspressed; /* number of those fingers currently still pressed. */ - SDL_FingerID finger_ids[MAX_TOUCH_FINGERS]; - char fingerspressed[MAX_TOUCH_FINGERS]; -} TCOD_touch_t; -#endif - -/* to enable bitmap locking. Is there any use ?? makes the OSX port renderer to fail */ -/*#define USE_SDL_LOCKS */ - -/* image support stuff */ -bool TCOD_sys_check_bmp(const char *filename); -SDL_Surface *TCOD_sys_read_bmp(const char *filename); -void TCOD_sys_write_bmp(const SDL_Surface *surf, const char *filename); -bool TCOD_sys_check_png(const char *filename); -SDL_Surface *TCOD_sys_read_png(const char *filename); -void TCOD_sys_write_png(const SDL_Surface *surf, const char *filename); - -typedef struct { - char *extension; - bool (*check_type)(const char *filename); - SDL_Surface *(*read)(const char *filename); - void (*write)(const SDL_Surface *surf, const char *filename); -} image_support_t; - -static image_support_t image_type[] = { - { "BMP", TCOD_sys_check_bmp, TCOD_sys_read_bmp, TCOD_sys_write_bmp }, - { "PNG", TCOD_sys_check_png, TCOD_sys_read_png, TCOD_sys_write_png }, - { NULL, NULL, NULL, NULL }, -}; - -scale_data_t scale_data={0}; -SDL_Window* window=NULL; -SDL_Renderer* renderer=NULL; -float scale_factor=1.0f; -SDL_Surface* charmap=NULL; -char *last_clipboard_text = NULL; -static bool has_startup=false; -#define MAX_SCALE_FACTOR 5.0f - -/* font transparent color */ -static TCOD_color_t fontKeyCol={0,0,0}; - -static uint32_t sdl_key=0, rgb_mask=0, nrgb_mask=0; - -/* mouse stuff */ -static bool mousebl=false; -static bool mousebm=false; -static bool mousebr=false; -static bool mouse_force_bl=false; -static bool mouse_force_bm=false; -static bool mouse_force_br=false; -#ifdef TCOD_TOUCH_INPUT -static bool mouse_touch=true; -#endif - -/* minimum length for a frame (when fps are limited) */ -static int min_frame_length=0; -static int min_frame_length_backup=0; -/* number of frames in the last second */ -static int fps=0; -/* current number of frames */ -static int cur_fps=0; -/* length of the last rendering loop */ -static float last_frame_length=0.0f; - -static TCOD_color_t *charcols=NULL; -static bool *first_draw=NULL; -static bool key_status[TCODK_CHAR+1]; -int oldFade=-1; - -/* convert SDL vk to a char (depends on the keyboard layout) */ -typedef struct { - SDL_Keycode sdl_key; - int tcod_key; -} vk_to_c_entry; -#define NUM_VK_TO_C_ENTRIES 10 -static vk_to_c_entry vk_to_c[NUM_VK_TO_C_ENTRIES]; - -/* convert ASCII code to TCOD layout position */ -static int init_ascii_to_tcod[256] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 77, 0, 0, 0, 0, 0, /* ASCII 0 to 15 */ - 71, 70, 72, 0, 0, 0, 0, 0, 64, 65, 67, 66, 0, 73, 68, 69, /* ASCII 16 to 31 */ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* ASCII 32 to 47 */ - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, /* ASCII 48 to 63 */ - 32, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110, /* ASCII 64 to 79 */ -111,112,113,114,115,116,117,118,119,120,121, 33, 34, 35, 36, 37, /* ASCII 80 to 95 */ - 38,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142, /* ASCII 96 to 111 */ -143,144,145,146,147,148,149,150,151,152,153, 39, 40, 41, 42, 0, /* ASCII 112 to 127 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ASCII 128 to 143 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ASCII 144 to 159 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ASCII 160 to 175 */ - 43, 44, 45, 46, 49, 0, 0, 0, 0, 81, 78, 87, 88, 0, 0, 55, /* ASCII 176 to 191 */ - 53, 50, 52, 51, 47, 48, 0, 0, 85, 86, 82, 84, 83, 79, 80, 0, /* ASCII 192 to 207 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 54, 0, 0, 0, 0, 0, /* ASCII 208 to 223 */ - 74, 75, 57, 58, 59, 60, 61, 62, 63, 0, 0, 0, 0, 0, 0, 0, /* ASCII 224 to 239 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ASCII 240 to 255 */ -}; - -static void alloc_ascii_tables(void) { - if ( TCOD_ctx.ascii_to_tcod ) free(TCOD_ctx.ascii_to_tcod); - if ( charcols ) { - free(charcols); - free(first_draw); - } - - TCOD_ctx.ascii_to_tcod = (int *)calloc(sizeof(int),TCOD_ctx.max_font_chars); - charcols = (TCOD_color_t *)calloc(sizeof(TCOD_color_t),TCOD_ctx.max_font_chars); - first_draw =(bool *)calloc(sizeof(bool),TCOD_ctx.max_font_chars); - memcpy(TCOD_ctx.ascii_to_tcod,init_ascii_to_tcod,sizeof(int)*256); -} -/** Reallocate the TCOD_ctx.ascii_to_tcod array, usually to make it bigger. - */ -static int realloc_ascii_tables(int new_size) { - int *new_table = realloc(TCOD_ctx.ascii_to_tcod, sizeof(int) * new_size); - int i; - if (!new_table) { - return -1; /* failed to realloc table (old table pointer is still good) */ - } - /* any new array indexes are undefined and need to be filled with zeros */ - for (i = TCOD_ctx.max_font_chars; i < new_size; ++i) { - new_table[i] = 0; - } - TCOD_ctx.ascii_to_tcod = new_table; - TCOD_ctx.max_font_chars = new_size; - return 0; -} - -static void check_ascii_to_tcod(void) { - if ( TCOD_ctx.fontNbCharHoriz * TCOD_ctx.fontNbCharVertic != TCOD_ctx.max_font_chars ) { - TCOD_ctx.max_font_chars=TCOD_ctx.fontNbCharHoriz * TCOD_ctx.fontNbCharVertic; - alloc_ascii_tables(); - } -} - -void TCOD_sys_register_SDL_renderer(SDL_renderer_t renderer) { - TCOD_ctx.sdl_cbk=renderer; -} -/** See TCOD_console_map_ascii_code_to_font */ -void TCOD_sys_map_ascii_to_font(int asciiCode, int fontCharX, int fontCharY) { - if (asciiCode <= 0) { return; } /* can't reassign 0 or negatives */ - if (asciiCode >= TCOD_ctx.max_font_chars) { - /* reduce total allocations by resizing in increments of 256 */ - if (realloc_ascii_tables((asciiCode & 0xff) + 1)) { - return; /* Failed to realloc table (old table pointer is still good) */ - } - } - TCOD_ctx.ascii_to_tcod[asciiCode] = - fontCharX + fontCharY * TCOD_ctx.fontNbCharHoriz; -} - -void TCOD_sys_load_font(void) { - int i; - bool hasTransparent=false; - int x,y; - - if ( charmap ) SDL_FreeSurface(charmap); - charmap=TCOD_sys_load_image(TCOD_ctx.font_file); - if (charmap == NULL ) TCOD_fatal("SDL : cannot load %s",TCOD_ctx.font_file); - if ( (float)(charmap->w / TCOD_ctx.fontNbCharHoriz) != charmap->w / TCOD_ctx.fontNbCharHoriz - || (float)(charmap->h / TCOD_ctx.fontNbCharVertic) != charmap->h / TCOD_ctx.fontNbCharVertic ) TCOD_fatal(" %s size is not a multiple of font layout (%dx%d)\n", - TCOD_ctx.font_file,TCOD_ctx.fontNbCharHoriz,TCOD_ctx.fontNbCharVertic); - TCOD_ctx.font_width=charmap->w/TCOD_ctx.fontNbCharHoriz; - TCOD_ctx.font_height=charmap->h/TCOD_ctx.fontNbCharVertic; - /* allocated bool array for colored flags */ - if ( TCOD_ctx.colored ) free(TCOD_ctx.colored); - TCOD_ctx.colored=(bool *)calloc(sizeof(bool), TCOD_ctx.fontNbCharHoriz*TCOD_ctx.fontNbCharVertic); - check_ascii_to_tcod(); - /* figure out what kind of font we have */ - /* check if the alpha layer is actually used */ - if ( charmap->format->BytesPerPixel == 4 ) { - TCOD_LOG(("32bits font... checking for alpha layer... ")); - for (x=0; !hasTransparent && x < charmap->w; x ++ ) { - for (y=0;!hasTransparent && y < charmap->h; y++ ) { - uint8_t*pixel=(uint8_t*)(charmap->pixels) + y * charmap->pitch + x * charmap->format->BytesPerPixel; - uint8_t alpha=*((pixel)+charmap->format->Ashift/8); - if ( alpha < 255 ) { - hasTransparent=true; - } - } - } - TCOD_LOG((hasTransparent ? "present\n" : "not present\n")); - } else if ( charmap->format->BytesPerPixel != 3 ) { - /* convert to 24 bits */ - SDL_Surface *temp; - TCOD_LOG(("font bpp < 24. converting to 24bits\n")); - temp=(SDL_Surface *)TCOD_sys_get_surface(charmap->w,charmap->h,false); - SDL_BlitSurface(charmap,NULL,temp,NULL); - SDL_FreeSurface(charmap); - charmap=temp; - } else { - TCOD_LOG(("24 bits font.\n")); - } - if (! hasTransparent ) { - /* alpha layer not used */ - int keyx,keyy; - uint8_t*pixel; - /* the key color is found on the character corresponding to space ' ' */ - if ( TCOD_ctx.font_tcod_layout ) { - keyx = TCOD_ctx.font_width/2; - keyy = TCOD_ctx.font_height/2; - } else if (TCOD_ctx.font_in_row) { - keyx = ((int)(' ') % TCOD_ctx.fontNbCharHoriz ) * TCOD_ctx.font_width + TCOD_ctx.font_width/2; - keyy = ((int)(' ') / TCOD_ctx.fontNbCharHoriz ) * TCOD_ctx.font_height + TCOD_ctx.font_height/2; - } else { - keyx = ((int)(' ') / TCOD_ctx.fontNbCharVertic ) * TCOD_ctx.font_width + TCOD_ctx.font_width/2; - keyy = ((int)(' ') % TCOD_ctx.fontNbCharVertic ) * TCOD_ctx.font_height + TCOD_ctx.font_height/2; - } - pixel=(uint8_t*)(charmap->pixels) + keyy * charmap->pitch + keyx * charmap->format->BytesPerPixel; - fontKeyCol.r=*((pixel)+charmap->format->Rshift/8); - fontKeyCol.g=*((pixel)+charmap->format->Gshift/8); - fontKeyCol.b=*((pixel)+charmap->format->Bshift/8); - TCOD_LOG(("key color : %d %d %d\n",fontKeyCol.r,fontKeyCol.g,fontKeyCol.b)); - if ( ! TCOD_ctx.font_greyscale && charmap->format->BytesPerPixel == 4 ) { - /* 32 bits font but alpha layer not used. convert to 24 bits (faster) */ - SDL_Surface *temp; - TCOD_LOG(("32bits font with no alpha => converting to faster 24 bits\n")); - temp=(SDL_Surface *)TCOD_sys_get_surface(charmap->w,charmap->h,false); - SDL_BlitSurface(charmap,NULL,temp,NULL); - SDL_FreeSurface(charmap); - charmap=temp; - } - } - /* detect colored tiles */ - for (i=0; i < TCOD_ctx.fontNbCharHoriz*TCOD_ctx.fontNbCharVertic; i++ ) { - int px,py,cx,cy; - bool end=false; - cx=(i%TCOD_ctx.fontNbCharHoriz); - cy=(i/TCOD_ctx.fontNbCharHoriz); - for( px=0; !end && px < TCOD_ctx.font_width; px++ ) { - for (py=0; !end && py < TCOD_ctx.font_height; py++ ) { - uint8_t*pixel=(uint8_t*)(charmap->pixels) + (cy*TCOD_ctx.font_height+py) * charmap->pitch - + (cx*TCOD_ctx.font_width+px) * charmap->format->BytesPerPixel; - uint8_t r=*((pixel)+charmap->format->Rshift/8); - uint8_t g=*((pixel)+charmap->format->Gshift/8); - uint8_t b=*((pixel)+charmap->format->Bshift/8); - if ( charmap->format->BytesPerPixel == 3 ) { - /* ignore key color */ - if ( r == fontKeyCol.r && g == fontKeyCol.g && b == fontKeyCol.b ) continue; - } - /* colored tile if a pixel is not desaturated */ - if ( r != g || g !=b || b != r ) { - TCOD_ctx.colored[i]=true; - TCOD_LOG(("character for ascii code %d is colored\n",i)); - end=true; - } - } - } - } - /* convert 24/32 bits greyscale to 32bits font with alpha layer */ - if ( ! hasTransparent && TCOD_ctx.font_greyscale ) { - bool invert=( fontKeyCol.r > 128 ); /* black on white font ? */ - /* convert the surface to 32 bits if needed */ - if ( charmap->format->BytesPerPixel != 4 ) { - SDL_Surface *temp; - TCOD_LOG(("24bits greyscale font. converting to 32bits\n")); - temp=(SDL_Surface *)TCOD_sys_get_surface(charmap->w,charmap->h,true); - SDL_BlitSurface(charmap,NULL,temp,NULL); - SDL_FreeSurface(charmap); - charmap=temp; - } - for (i=0; i < TCOD_ctx.fontNbCharHoriz*TCOD_ctx.fontNbCharVertic; i++ ) { - int cx,cy; - cx=(i%TCOD_ctx.fontNbCharHoriz); - cy=(i/TCOD_ctx.fontNbCharHoriz); - /* fill the surface with white (except colored tiles), use alpha layer for characters */ - for (x=cx*TCOD_ctx.font_width; x < (cx+1)*TCOD_ctx.font_width; x ++ ) { - for (y=cy*TCOD_ctx.font_height;y < (cy+1)*TCOD_ctx.font_height; y++ ) { - if ( ! TCOD_ctx.colored[i]) { - uint8_t*pixel=(uint8_t*)(charmap->pixels) + y * charmap->pitch + x * charmap->format->BytesPerPixel; - uint8_t r=*((pixel)+charmap->format->Rshift/8); - *((pixel)+charmap->format->Ashift/8) = (invert ? 255-r : r); - *((pixel)+charmap->format->Rshift/8)=255; - *((pixel)+charmap->format->Gshift/8)=255; - *((pixel)+charmap->format->Bshift/8)=255; - } else { - uint8_t*pixel=(uint8_t*)(charmap->pixels) + y * charmap->pitch + x * charmap->format->BytesPerPixel; - uint8_t r=*((pixel)+charmap->format->Rshift/8); - uint8_t g=*((pixel)+charmap->format->Gshift/8); - uint8_t b=*((pixel)+charmap->format->Bshift/8); - if ( r == fontKeyCol.r && g == fontKeyCol.g && b == fontKeyCol.b ) { - *((pixel)+charmap->format->Ashift/8) = 0; - } else { - *((pixel)+charmap->format->Ashift/8) = 255; - } - } - } - } - } - } - sdl_key=SDL_MapRGB(charmap->format,fontKeyCol.r,fontKeyCol.g,fontKeyCol.b); - rgb_mask=charmap->format->Rmask|charmap->format->Gmask|charmap->format->Bmask; - nrgb_mask = ~ rgb_mask; - sdl_key &= rgb_mask; /* remove the alpha part */ - if ( charmap->format->BytesPerPixel == 3 ) SDL_SetColorKey(charmap,SDL_TRUE|SDL_RLEACCEL,sdl_key); - for (i=0; i < TCOD_ctx.fontNbCharHoriz*TCOD_ctx.fontNbCharVertic; i++ ) { - charcols[i]=fontKeyCol; - first_draw[i]=true; - } - check_ascii_to_tcod(); - if (!TCOD_ctx.font_tcod_layout) { - /* apply standard ascii mapping */ - if ( TCOD_ctx.font_in_row ) { - /* for font in row */ - for (i=0; i < TCOD_ctx.max_font_chars; i++ ) TCOD_ctx.ascii_to_tcod[i]=i; - } else { - /* for font in column */ - for (i=0; i < TCOD_ctx.max_font_chars; i++ ) { - int fy = i % TCOD_ctx.fontNbCharVertic; - int fx = i / TCOD_ctx.fontNbCharVertic; - TCOD_ctx.ascii_to_tcod[i]=fx + fy * TCOD_ctx.fontNbCharHoriz; - } - } - } -} - -void TCOD_sys_set_custom_font(const char *fontFile,int nb_ch, int nb_cv, int flags) { - strcpy(TCOD_ctx.font_file,fontFile); - /* if layout not defined, assume ASCII_INCOL */ - if (flags == 0 || flags == TCOD_FONT_TYPE_GREYSCALE) flags |= TCOD_FONT_LAYOUT_ASCII_INCOL; - TCOD_ctx.font_in_row=((flags & TCOD_FONT_LAYOUT_ASCII_INROW) != 0); - TCOD_ctx.font_greyscale = ((flags & TCOD_FONT_TYPE_GREYSCALE) != 0 ); - TCOD_ctx.font_tcod_layout = ((flags & TCOD_FONT_LAYOUT_TCOD) != 0 ); - if ( nb_ch> 0 ) { - TCOD_ctx.fontNbCharHoriz=nb_ch; - TCOD_ctx.fontNbCharVertic=nb_cv; - } else { - if ( ( flags & TCOD_FONT_LAYOUT_ASCII_INROW ) || ( flags & TCOD_FONT_LAYOUT_ASCII_INCOL ) ) { - TCOD_ctx.fontNbCharHoriz=16; - TCOD_ctx.fontNbCharVertic=16; - } else { - TCOD_ctx.fontNbCharHoriz=32; - TCOD_ctx.fontNbCharVertic=8; - } - } - if ( TCOD_ctx.font_tcod_layout ) TCOD_ctx.font_in_row=true; - check_ascii_to_tcod(); - /* - screw up things on linux64. apparently, useless - TCOD_sys_load_font(); - */ -} - -void find_resolution(void) { - TCOD_ctx.actual_fullscreen_width=TCOD_ctx.fullscreen_width>TCOD_ctx.root->w*TCOD_ctx.font_width?TCOD_ctx.fullscreen_width:TCOD_ctx.root->w*TCOD_ctx.font_width; - TCOD_ctx.actual_fullscreen_height=TCOD_ctx.fullscreen_height>TCOD_ctx.root->h*TCOD_ctx.font_height?TCOD_ctx.fullscreen_height:TCOD_ctx.root->h*TCOD_ctx.font_height; - sdl->get_closest_mode(&TCOD_ctx.actual_fullscreen_width,&TCOD_ctx.actual_fullscreen_height); -} - -void *TCOD_sys_create_bitmap_for_console(TCOD_console_t console) { - int w,h; - w = TCOD_console_get_width(console) * TCOD_ctx.font_width; - h = TCOD_console_get_height(console) * TCOD_ctx.font_height; - return TCOD_sys_get_surface(w,h,false); -} - -static void TCOD_sys_render(void *vbitmap, TCOD_console_data_t* console) { - sdl->render(sdl, vbitmap, console); -} - -void TCOD_sys_console_to_bitmap(void *vbitmap, - TCOD_console_data_t* console, TCOD_console_data_t* cache) { - static SDL_Surface *charmap_backup=NULL; - SDL_Surface *bitmap = (SDL_Surface *)vbitmap; - int x,y; - uint32_t sdl_back=0, sdl_fore=0; - TCOD_color_t fading_color = TCOD_console_get_fading_color(); - int fade = (int)TCOD_console_get_fade(); - /* can only track changes on the root console */ - bool track_changes = (cache && oldFade == fade); - uint8_t bpp = charmap->format->BytesPerPixel; - int *c = console->ch_array; - int *oc; - TCOD_color_t *ofg, *obg, *nfg, *nbg; - int hdelta; - if ( bpp == 4 ) { - hdelta=(charmap->pitch - TCOD_ctx.font_width*bpp)/4; - } else { - hdelta=(charmap->pitch - TCOD_ctx.font_width*bpp); - } - nfg = TCOD_image_get_colors(console->fg_colors); - nbg = TCOD_image_get_colors(console->bg_colors); - if (track_changes) { - oc = cache->ch_array; - ofg = TCOD_image_get_colors(cache->fg_colors); - obg = TCOD_image_get_colors(cache->bg_colors); - } - if ( charmap_backup == NULL ) { - charmap_backup=(SDL_Surface *)TCOD_sys_get_surface(charmap->w,charmap->h,true); - SDL_BlitSurface(charmap,NULL,charmap_backup,NULL); - } -#ifdef USE_SDL_LOCKS - if ( SDL_MUSTLOCK( bitmap ) && SDL_LockSurface( bitmap ) < 0 ) return; -#endif - for (y = 0; y < console->h; y++) { - for (x = 0; x < console->w; x++) { - SDL_Rect srcRect,dstRect; - bool changed=true; - if ( track_changes ) { - changed=false; - if ( - nbg->r != obg->r || nbg->g != obg->g || nbg->b != obg->b || - nfg->r != ofg->r || nfg->g != ofg->g || nfg->b != ofg->b || - *c != *oc) { - changed=true; - } - } - if ( changed ) { - TCOD_color_t b=*nbg; - dstRect.x=x*TCOD_ctx.font_width; - dstRect.y=y*TCOD_ctx.font_height; - dstRect.w=TCOD_ctx.font_width; - dstRect.h=TCOD_ctx.font_height; - /* draw background */ - if ( fade != 255 ) { - b.r = ((int)b.r) * fade / 255 + ((int)fading_color.r) * (255-fade)/255; - b.g = ((int)b.g) * fade / 255 + ((int)fading_color.g) * (255-fade)/255; - b.b = ((int)b.b) * fade / 255 + ((int)fading_color.b) * (255-fade)/255; - } - sdl_back=SDL_MapRGB(bitmap->format,b.r,b.g,b.b); - SDL_FillRect(bitmap,&dstRect,sdl_back); - if ( *c != ' ' ) { - /* draw foreground */ - int ascii = TCOD_get_tileid_for_charcode_(*c); - TCOD_color_t *curtext = &charcols[ascii]; - bool first = first_draw[ascii]; - TCOD_color_t f=*nfg; - - if ( fade != 255 ) { - f.r = ((int)f.r) * fade / 255 + ((int)fading_color.r) * (255-fade)/255; - f.g = ((int)f.g) * fade / 255 + ((int)fading_color.g) * (255-fade)/255; - f.b = ((int)f.b) * fade / 255 + ((int)fading_color.b) * (255-fade)/255; - } - /* only draw character if foreground color != background color */ - if ( f.r != b.r || f.g != b.g || f.b != b.b ) { - if ( charmap->format->Amask == 0 - && f.r == fontKeyCol.r && f.g == fontKeyCol.g && f.b == fontKeyCol.b ) { - /* cannot draw with the key color... */ - if ( f.r < 255 ) f.r++; else f.r--; - } - srcRect.x = (ascii%TCOD_ctx.fontNbCharHoriz)*TCOD_ctx.font_width; - srcRect.y = (ascii/TCOD_ctx.fontNbCharHoriz)*TCOD_ctx.font_height; - srcRect.w=TCOD_ctx.font_width; - srcRect.h=TCOD_ctx.font_height; - - if ( charmap && (first || curtext->r != f.r || curtext->g != f.g || curtext->b!=f.b) ) { - /* change the character color in the font */ - first_draw[ascii]=false; - sdl_fore=SDL_MapRGB(charmap->format,f.r,f.g,f.b) & rgb_mask; - *curtext=f; -#ifdef USE_SDL_LOCKS - if ( SDL_MUSTLOCK(charmap) ) { - if ( SDL_LockSurface(charmap) < 0 ) return; - } -#endif - if ( bpp == 4 ) { - /* 32 bits font : fill the whole character with foreground color */ - uint32_t *pix = (uint32_t *)(((uint8_t*)charmap->pixels)+srcRect.x*bpp + srcRect.y*charmap->pitch); - int h=TCOD_ctx.font_height; - if ( ! TCOD_ctx.colored[ascii] ) { - while ( h-- ) { - int w=TCOD_ctx.font_width; - while ( w-- ) { - (*pix) &= nrgb_mask; - (*pix) |= sdl_fore; - pix++; - } - pix += hdelta; - } - } else { - /* colored character : multiply color with foreground color */ - uint32_t *pixorig = (uint32_t *)(((uint8_t*)charmap_backup->pixels)+srcRect.x*bpp + srcRect.y*charmap_backup->pitch); - int hdelta_backup=(charmap_backup->pitch - TCOD_ctx.font_width*4)/4; - while (h> 0) { - int w=TCOD_ctx.font_width; - while ( w > 0 ) { - int r=(int)(*((uint8_t*)(pixorig)+charmap_backup->format->Rshift/8)); - int g=(int)(*((uint8_t*)(pixorig)+charmap_backup->format->Gshift/8)); - int b=(int)(*((uint8_t*)(pixorig)+charmap_backup->format->Bshift/8)); - (*pix) &= nrgb_mask; /* erase the color */ - r = r * f.r / 255; - g = g * f.g / 255; - b = b * f.b / 255; - /* set the new color */ - (*pix) |= (r<format->Rshift)|(g<format->Gshift)|(b<format->Bshift); - w--; - pix++; - pixorig++; - } - h--; - pix += hdelta; - pixorig += hdelta_backup; - } - } - } else { - /* 24 bits font : fill only non key color pixels */ - uint32_t *pix = (uint32_t *)(((uint8_t*)charmap->pixels)+srcRect.x*bpp + srcRect.y*charmap->pitch); - int h=TCOD_ctx.font_height; - if ( ! TCOD_ctx.colored[ascii] ) { - while ( h-- ) { - int w=TCOD_ctx.font_width; - while ( w-- ) { - if (((*pix) & rgb_mask) != sdl_key ) { - (*pix) &= nrgb_mask; - (*pix) |= sdl_fore; - } - pix = (uint32_t *) (((uint8_t*)pix)+3); - } - pix = (uint32_t *) (((uint8_t*)pix)+hdelta); - } - } else { - /* colored character : multiply color with foreground color */ - uint32_t *pixorig = (uint32_t *)(((uint8_t*)charmap_backup->pixels)+srcRect.x*4 + srcRect.y*charmap_backup->pitch); - /* charmap_backup is always 32 bits */ - int hdelta_backup=(charmap_backup->pitch - TCOD_ctx.font_width*4)/4; - while (h> 0) { - int w=TCOD_ctx.font_width; - while ( w > 0 ) { - if (((*pixorig) & rgb_mask) != sdl_key ) { - int r=(int)(*((uint8_t*)(pixorig)+charmap_backup->format->Rshift/8)); - int g=(int)(*((uint8_t*)(pixorig)+charmap_backup->format->Gshift/8)); - int b=(int)(*((uint8_t*)(pixorig)+charmap_backup->format->Bshift/8)); - (*pix) &= nrgb_mask; /* erase the color */ - r = r * f.r / 255; - g = g * f.g / 255; - b = b * f.b / 255; - /* set the new color */ - (*pix) |= (r<format->Rshift)|(g<format->Gshift)|(b<format->Bshift); - } - w--; - pix = (uint32_t *) (((uint8_t*)pix)+3); - pixorig ++; - } - h--; - pix = (uint32_t *) (((uint8_t*)pix)+hdelta); - pixorig += hdelta_backup; - } - } - } -#ifdef USE_SDL_LOCKS - if ( SDL_MUSTLOCK(charmap) ) { - SDL_UnlockSurface(charmap); - } -#endif - } - SDL_BlitSurface(charmap,&srcRect,bitmap,&dstRect); - } - } - } - c++; - nfg++; - nbg++; - if (track_changes) { - oc++; - ofg++; - obg++; - } - } - } -#ifdef USE_SDL_LOCKS - if ( SDL_MUSTLOCK( bitmap ) ) SDL_UnlockSurface( bitmap ); -#endif - if (cache) { - /* update previous values cache */ - memcpy(cache->ch_array, console->ch_array, - sizeof(console->ch_array[0]) * console->w * console->h); - TCOD_image_mipmap_copy_internal(console->fg_colors, cache->fg_colors); - TCOD_image_mipmap_copy_internal(console->bg_colors, cache->bg_colors); - } -} - -void *TCOD_sys_get_surface(int width, int height, bool alpha) { - return sdl->create_surface(width,height,alpha); -} - -void TCOD_sys_update_char(int asciiCode, int fontx, int fonty, TCOD_image_t img, int x, int y) { - int px,py; - int iw,ih; - static TCOD_color_t pink={255,0,255}; - TCOD_sys_map_ascii_to_font(asciiCode,fontx,fonty); - TCOD_image_get_size(img,&iw,&ih); - for (px=0; px < TCOD_ctx.font_width; px ++ ) { - for (py=0;py < TCOD_ctx.font_height; py++ ) { - TCOD_color_t col=TCOD_white; - uint8_t*pixel; - uint8_t bpp; - if ( (unsigned)(x+px) < (unsigned)iw && (unsigned)(y+py) < (unsigned)ih ) { - col=TCOD_image_get_pixel(img,x+px,y+py); - } - pixel=(uint8_t*)(charmap->pixels) + (fonty*TCOD_ctx.font_height+py) * charmap->pitch + (fontx*TCOD_ctx.font_width+px) * charmap->format->BytesPerPixel; - bpp = charmap->format->BytesPerPixel; - if (bpp == 4 ) { - *((pixel)+charmap->format->Ashift/8) = col.r; - *((pixel)+charmap->format->Rshift/8)=255; - *((pixel)+charmap->format->Gshift/8)=255; - *((pixel)+charmap->format->Bshift/8)=255; - } else { - *((pixel)+charmap->format->Rshift/8)=col.r; - *((pixel)+charmap->format->Gshift/8)=col.g; - *((pixel)+charmap->format->Bshift/8)=col.b; - } - } - } - charcols[asciiCode]=pink; - TCOD_sys_set_dirty_character_code(asciiCode); -} - -void TCOD_sys_startup(void) { - if (has_startup) return; -#ifndef NDEBUG - SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE); -#endif - TCOD_IFNOT(SDL_Init(SDL_INIT_VIDEO) >= 0 ) return; - memset(&TCOD_ctx.key_state,0,sizeof(TCOD_key_t)); - TCOD_ctx.max_font_chars=256; - alloc_ascii_tables(); -#ifndef NO_OPENGL - TCOD_opengl_init_attributes(); -#endif - - has_startup=true; -} - -void TCOD_sys_shutdown(void) { - if (!has_startup) return; - TCOD_sys_uninit(); - sdl->shutdown(); - SDL_Quit(); - memset(&scale_data, 0, sizeof(scale_data_t)); - has_startup = false; -} - -static void TCOD_sys_load_player_config(void) { - const char *renderer; - const char *font; - int fullscreenWidth,fullscreenHeight; - - /* define file structure */ - TCOD_parser_t parser=TCOD_parser_new(); - TCOD_parser_struct_t libtcod = TCOD_parser_new_struct(parser, "libtcod"); - TCOD_struct_add_property(libtcod, "renderer", TCOD_TYPE_STRING, false); - TCOD_struct_add_property(libtcod, "font", TCOD_TYPE_STRING, false); - TCOD_struct_add_property(libtcod, "fontInRow", TCOD_TYPE_BOOL, false); - TCOD_struct_add_property(libtcod, "fontGreyscale", TCOD_TYPE_BOOL, false); - TCOD_struct_add_property(libtcod, "fontTcodLayout", TCOD_TYPE_BOOL, false); - TCOD_struct_add_property(libtcod, "fontNbCharHoriz", TCOD_TYPE_INT, false); - TCOD_struct_add_property(libtcod, "fontNbCharVertic", TCOD_TYPE_INT, false); - TCOD_struct_add_property(libtcod, "fullscreen", TCOD_TYPE_BOOL, false); - TCOD_struct_add_property(libtcod, "fullscreenWidth", TCOD_TYPE_INT, false); - TCOD_struct_add_property(libtcod, "fullscreenHeight", TCOD_TYPE_INT, false); - TCOD_struct_add_property(libtcod, "fullscreenScaling", TCOD_TYPE_BOOL, false); - - /* parse file */ - TCOD_parser_run(parser,"./libtcod.cfg",NULL); - - /* set user preferences */ - renderer=TCOD_parser_get_string_property(parser, "libtcod.renderer"); - if ( renderer != NULL ) { - /* custom renderer */ - if ( TCOD_strcasecmp(renderer,"GLSL") == 0 ) TCOD_ctx.renderer=TCOD_RENDERER_GLSL; - else if ( TCOD_strcasecmp(renderer,"OPENGL") == 0 ) TCOD_ctx.renderer=TCOD_RENDERER_OPENGL; - else if ( TCOD_strcasecmp(renderer,"SDL") == 0 ) TCOD_ctx.renderer=TCOD_RENDERER_SDL; - else printf ("Warning : unknown renderer '%s' in libtcod.cfg\n", renderer); - } - font=TCOD_parser_get_string_property(parser, "libtcod.font"); - if ( font != NULL ) { - /* custom font */ - if ( TCOD_sys_file_exists(font)) { - int fontNbCharHoriz,fontNbCharVertic; - strcpy(TCOD_ctx.font_file,font); - TCOD_ctx.font_in_row=TCOD_parser_get_bool_property(parser,"libtcod.fontInRow"); - TCOD_ctx.font_greyscale=TCOD_parser_get_bool_property(parser,"libtcod.fontGreyscale"); - TCOD_ctx.font_tcod_layout=TCOD_parser_get_bool_property(parser,"libtcod.fontTcodLayout"); - fontNbCharHoriz=TCOD_parser_get_int_property(parser,"libtcod.fontNbCharHoriz"); - fontNbCharVertic=TCOD_parser_get_int_property(parser,"libtcod.fontNbCharVertic"); - if ( fontNbCharHoriz > 0 ) TCOD_ctx.fontNbCharHoriz=fontNbCharHoriz; - if ( fontNbCharVertic > 0 ) TCOD_ctx.fontNbCharVertic=fontNbCharVertic; - if ( charmap ) { - SDL_FreeSurface(charmap); - charmap=NULL; - } - } else { - printf ("Warning : font file '%s' does not exist\n",font); - } - } - /* custom fullscreen resolution */ - TCOD_ctx.fullscreen=TCOD_parser_get_bool_property(parser,"libtcod.fullscreen"); - fullscreenWidth=TCOD_parser_get_int_property(parser,"libtcod.fullscreenWidth"); - fullscreenHeight=TCOD_parser_get_int_property(parser,"libtcod.fullscreenHeight"); - if ( fullscreenWidth > 0 ) TCOD_ctx.fullscreen_width=fullscreenWidth; - if ( fullscreenHeight > 0 ) TCOD_ctx.fullscreen_height=fullscreenHeight; -} - - -TCOD_renderer_t TCOD_sys_get_renderer(void) { - return TCOD_ctx.renderer; -} - -void TCOD_sys_set_renderer(TCOD_renderer_t renderer) { - if ( renderer == TCOD_ctx.renderer ) return; - TCOD_ctx.renderer=renderer; - TCOD_sys_uninit(); - TCOD_sys_init(TCOD_ctx.root, TCOD_ctx.fullscreen); - TCOD_console_set_window_title(TCOD_ctx.window_title); - TCOD_console_set_dirty(0,0,TCOD_ctx.root->w,TCOD_ctx.root->h); -} - -void TCOD_sys_init_screen_offset(void) { - TCOD_ctx.fullscreen_offsetx=(TCOD_ctx.actual_fullscreen_width-TCOD_ctx.root->w*TCOD_ctx.font_width)/2; - TCOD_ctx.fullscreen_offsety=(TCOD_ctx.actual_fullscreen_height-TCOD_ctx.root->h*TCOD_ctx.font_height)/2; -} - -bool TCOD_sys_init(TCOD_console_data_t *console, bool fullscreen) { - static TCOD_renderer_t last_renderer=TCOD_RENDERER_SDL; - static char last_font[512]=""; - TCOD_sys_startup(); - /* check if there is a user (player) config file */ - if ( TCOD_sys_file_exists("./libtcod.cfg")) { - /* yes, read it */ - TCOD_sys_load_player_config(); - if (TCOD_ctx.fullscreen) fullscreen=true; - } - if (last_renderer != TCOD_ctx.renderer || ! charmap || strcmp(last_font,TCOD_ctx.font_file) != 0) { - /* reload the font when switching renderer to restore original character colors */ - TCOD_sys_load_font(); - } - sdl->create_window(console->w, console->h, fullscreen); - memset(key_status,0,sizeof(bool)*(TCODK_CHAR+1)); - - return true; -} - -void TCOD_sys_uninit(void) { - if (!has_startup) return; - sdl->destroy_window(); -} - -static char *TCOD_strcasestr (const char *haystack, const char *needle) { - const char *p, *startn = 0, *np = 0; - - for (p = haystack; *p; p++) { - if (np) { - if (toupper(*p) == toupper(*np)) { - if (!*++np) - return (char *)startn; - } else - np = 0; - } else if (toupper(*p) == toupper(*needle)) { - np = needle + 1; - startn = p; - } - } - - return 0; -} - -void TCOD_sys_save_bitmap(void *bitmap, const char *filename) { - image_support_t *img=image_type; - while ( img->extension != NULL && TCOD_strcasestr(filename,img->extension) == NULL ) img++; - if ( img->extension == NULL || img->write == NULL ) img=image_type; /* default to bmp */ - img->write((SDL_Surface *)bitmap,filename); -} - -void TCOD_sys_save_screenshot(const char *filename) { - char buf[128]; - int idx = 0; - while (!filename) { - /* generate filename */ - FILE *access_file = NULL; - sprintf(buf, "./screenshot%03d.png", idx); - access_file = fopen(buf, "rb"); - if (!access_file) { - filename = buf; - } else { - idx++; - fclose(access_file); - } - } - sdl->save_screenshot(filename); -} - -void TCOD_sys_set_fullscreen(bool fullscreen) { - TCOD_ctx.fullscreen=fullscreen; - sdl->set_fullscreen(fullscreen); -} - -void TCOD_sys_set_scale_factor(float value) { - float old_scale_factor = scale_factor; - scale_factor = value; - if (scale_factor + 1e-3 < scale_data.min_scale_factor) - scale_factor = scale_data.min_scale_factor; - else if (scale_factor - 1e-3 > MAX_SCALE_FACTOR) - scale_factor = MAX_SCALE_FACTOR; - /*printf("scale_factor: %0.3f -> %0.3f (wanted: %0.3f)", old_scale_factor, scale_factor, value);*/ -} - -void TCOD_sys_set_window_title(const char *title) { - strcpy(TCOD_ctx.window_title,title); - sdl->set_window_title(title); -} - -void TCOD_sys_flush(bool render) { - static uint32_t old_time,new_time=0, elapsed=0; - int32_t frame_time,time_to_wait; - if ( render ) { - TCOD_sys_render(NULL, TCOD_ctx.root); - } - old_time=new_time; - new_time=TCOD_sys_elapsed_milli(); - /* If TCOD has been terminated and restarted. */ - if (old_time > new_time) - old_time = elapsed = 0; - if ( new_time / 1000 != elapsed ) { - /* update fps every second */ - fps=cur_fps; - cur_fps=0; - elapsed=new_time/1000; - } - /* if too fast, wait */ - frame_time=(new_time - old_time); - last_frame_length = frame_time * 0.001f; - cur_fps++; - time_to_wait=min_frame_length-frame_time; - if (old_time > 0 && time_to_wait > 0) { - TCOD_sys_sleep_milli(time_to_wait); - new_time = TCOD_sys_elapsed_milli(); - frame_time=(new_time - old_time); - } - last_frame_length = frame_time * 0.001f; -} - -static char TCOD_sys_get_vk(SDL_Keycode sdl_key) { - int i; - for (i = 0; i < NUM_VK_TO_C_ENTRIES; i++) { - if (vk_to_c[i].sdl_key == sdl_key) { - vk_to_c[i].sdl_key = 0; - return vk_to_c[i].tcod_key; - } - } - return 0; -} - -static void TCOD_sys_set_vk(SDL_Keycode sdl_key, char tcod_key) { - int i; - for (i = 0; i < NUM_VK_TO_C_ENTRIES; i++) { - if (vk_to_c[i].sdl_key == 0) { - vk_to_c[i].sdl_key = sdl_key; - vk_to_c[i].tcod_key = tcod_key; - break; - } - } -} - -static void TCOD_sys_convert_event(SDL_Event *ev, TCOD_key_t *ret) { - SDL_KeyboardEvent *kev=&ev->key; - /* SDL2 does not map keycodes and modifiers to characters, this is on the developer. - Presumably in order to avoid problems with different keyboard layouts, they - are expected to write their own key mapping editing code for the user. */ - if (SDLK_SCANCODE_MASK == (kev->keysym.sym & SDLK_SCANCODE_MASK)) - ret->c = 0; - else - ret->c = kev->keysym.sym; - if ( ( kev->keysym.mod & (KMOD_LCTRL|KMOD_RCTRL) ) != 0 ) { - /* when pressing CTRL-A, we don't get unicode for 'a', but unicode for CTRL-A = 1. Fix it */ - if ( kev->keysym.sym >= SDLK_a && kev->keysym.sym <= SDLK_z ) { - ret->c = 'a'+(kev->keysym.sym - SDLK_a); - } - } - if ( ev->type == SDL_KEYDOWN ) TCOD_sys_set_vk(kev->keysym.sym, ret->c); - else if (ev->type == SDL_KEYUP ) ret->c = TCOD_sys_get_vk(kev->keysym.sym); - switch(kev->keysym.sym) { - case SDLK_ESCAPE : ret->vk=TCODK_ESCAPE;break; - case SDLK_SPACE : ret->vk=TCODK_SPACE; break; - case SDLK_BACKSPACE : ret->vk=TCODK_BACKSPACE;break; - case SDLK_TAB : ret->vk=TCODK_TAB;break; - case SDLK_RETURN : ret->vk=TCODK_ENTER;break; - case SDLK_PAUSE : ret->vk=TCODK_PAUSE;break; - case SDLK_PAGEUP : ret->vk=TCODK_PAGEUP;break; - case SDLK_PAGEDOWN : ret->vk=TCODK_PAGEDOWN;break; - case SDLK_HOME : ret->vk=TCODK_HOME;break; - case SDLK_END : ret->vk=TCODK_END;break; - case SDLK_DELETE : ret->vk=TCODK_DELETE;break; - case SDLK_INSERT : ret->vk=TCODK_INSERT; break; - case SDLK_LALT : case SDLK_RALT : ret->vk=TCODK_ALT;break; - case SDLK_LCTRL : case SDLK_RCTRL : ret->vk=TCODK_CONTROL;break; - case SDLK_LSHIFT : case SDLK_RSHIFT : ret->vk=TCODK_SHIFT;break; - case SDLK_PRINTSCREEN : ret->vk=TCODK_PRINTSCREEN;break; - case SDLK_LEFT : ret->vk=TCODK_LEFT;break; - case SDLK_UP : ret->vk=TCODK_UP;break; - case SDLK_RIGHT : ret->vk=TCODK_RIGHT;break; - case SDLK_DOWN : ret->vk=TCODK_DOWN;break; - case SDLK_F1 : ret->vk=TCODK_F1;break; - case SDLK_F2 : ret->vk=TCODK_F2;break; - case SDLK_F3 : ret->vk=TCODK_F3;break; - case SDLK_F4 : ret->vk=TCODK_F4;break; - case SDLK_F5 : ret->vk=TCODK_F5;break; - case SDLK_F6 : ret->vk=TCODK_F6;break; - case SDLK_F7 : ret->vk=TCODK_F7;break; - case SDLK_F8 : ret->vk=TCODK_F8;break; - case SDLK_F9 : ret->vk=TCODK_F9;break; - case SDLK_F10 : ret->vk=TCODK_F10;break; - case SDLK_F11 : ret->vk=TCODK_F11;break; - case SDLK_F12 : ret->vk=TCODK_F12;break; - case SDLK_0 : ret->vk=TCODK_0;break; - case SDLK_1 : ret->vk=TCODK_1;break; - case SDLK_2 : ret->vk=TCODK_2;break; - case SDLK_3 : ret->vk=TCODK_3;break; - case SDLK_4 : ret->vk=TCODK_4;break; - case SDLK_5 : ret->vk=TCODK_5;break; - case SDLK_6 : ret->vk=TCODK_6;break; - case SDLK_7 : ret->vk=TCODK_7;break; - case SDLK_8 : ret->vk=TCODK_8;break; - case SDLK_9 : ret->vk=TCODK_9;break; - case SDLK_RGUI : ret->vk=TCODK_RWIN;break; - case SDLK_LGUI : ret->vk=TCODK_LWIN;break; - case SDLK_NUMLOCKCLEAR : ret->vk=TCODK_NUMLOCK;break; - case SDLK_KP_0 : ret->vk=TCODK_KP0;break; - case SDLK_KP_1 : ret->vk=TCODK_KP1;break; - case SDLK_KP_2 : ret->vk=TCODK_KP2;break; - case SDLK_KP_3 : ret->vk=TCODK_KP3;break; - case SDLK_KP_4 : ret->vk=TCODK_KP4;break; - case SDLK_KP_5 : ret->vk=TCODK_KP5;break; - case SDLK_KP_6 : ret->vk=TCODK_KP6;break; - case SDLK_KP_7 : ret->vk=TCODK_KP7;break; - case SDLK_KP_8 : ret->vk=TCODK_KP8;break; - case SDLK_KP_9 : ret->vk=TCODK_KP9;break; - case SDLK_KP_DIVIDE : ret->vk=TCODK_KPDIV;break; - case SDLK_KP_MULTIPLY : ret->vk=TCODK_KPMUL;break; - case SDLK_KP_PLUS : ret->vk=TCODK_KPADD;break; - case SDLK_KP_MINUS : ret->vk=TCODK_KPSUB;break; - case SDLK_KP_ENTER : ret->vk=TCODK_KPENTER;break; - case SDLK_KP_PERIOD : ret->vk=TCODK_KPDEC;break; - default : ret->vk=TCODK_CHAR; break; - } - -} - -static TCOD_key_t TCOD_sys_SDLtoTCOD(SDL_Event *ev, int flags) { - TCOD_key_t *ret = &TCOD_ctx.key_state; - ret->vk=TCODK_NONE; - ret->c=0; - ret->pressed=0; - switch (ev->type) { - /* handled in TCOD_sys_handle_event */ - /* - case SDL_QUIT : - case SDL_VIDEOEXPOSE : - case SDL_MOUSEBUTTONDOWN : { - case SDL_MOUSEBUTTONUP : { - break; - */ - case SDL_KEYUP : { - SDL_KeyboardEvent *kev=&ev->key; - TCOD_key_t tmpkey; - switch(kev->keysym.sym) { - case SDLK_LALT : ret->lalt=0; break; - case SDLK_RALT : ret->ralt=0; break; - case SDLK_LCTRL : ret->lctrl=0; break; - case SDLK_RCTRL : ret->rctrl=0; break; - case SDLK_LSHIFT : ret->shift=0; break; - case SDLK_RSHIFT : ret->shift=0; break; - case SDLK_LGUI : ret->lmeta=0; break; - case SDLK_RGUI : ret->rmeta=0; break; - default:break; - } - TCOD_sys_convert_event(ev,&tmpkey); - key_status[tmpkey.vk]=false; - if ( flags & TCOD_KEY_RELEASED ) { - ret->vk=tmpkey.vk; - ret->c=tmpkey.c; - ret->pressed=0; - } - } - break; - case SDL_KEYDOWN : { - SDL_KeyboardEvent *kev=&ev->key; - TCOD_key_t tmpkey; - switch(kev->keysym.sym) { - case SDLK_LALT : ret->lalt=1; break; - case SDLK_RALT : ret->ralt=1; break; - case SDLK_LCTRL : ret->lctrl=1; break; - case SDLK_RCTRL : ret->rctrl=1; break; - case SDLK_LSHIFT : ret->shift=1; break; - case SDLK_RSHIFT : ret->shift=1; break; - case SDLK_LGUI : ret->lmeta=1; break; - case SDLK_RGUI : ret->rmeta=1; break; - default : break; - } - TCOD_sys_convert_event(ev,&tmpkey); - key_status[tmpkey.vk]=true; - if ( flags & TCOD_KEY_PRESSED ) { - ret->vk=tmpkey.vk; - ret->c=tmpkey.c; - ret->pressed=1; - } - } - break; - } - return *ret; -} - -bool TCOD_sys_is_key_pressed(TCOD_keycode_t key) { - return key_status[key]; -} - -#ifdef TCOD_TOUCH_INPUT -static TCOD_touch_t tcod_touch={0}; - -static int TCOD_sys_get_touch_finger_index(SDL_FingerID fingerId) { - int i; - for (i = 0; i < tcod_touch.nfingers; i++) - if (tcod_touch.finger_ids[i] == fingerId) - return i; - if (i == tcod_touch.nfingers && i+1 <= MAX_TOUCH_FINGERS) { - tcod_touch.nfingers += 1; - tcod_touch.finger_ids[i] = fingerId; - return i; - } - return -1; -} -#endif - -void TCOD_sys_unproject_screen_coords(int sx, int sy, int *ssx, int *ssy) { - if (scale_data.dst_display_width != 0 ) { - *ssx = (scale_data.src_x0 + ((sx - scale_data.dst_offset_x) * scale_data.src_copy_width) / scale_data.dst_display_width); - *ssy = (scale_data.src_y0 + ((sy - scale_data.dst_offset_y) * scale_data.src_copy_width) / scale_data.dst_display_width); - } else { - *ssx=sx - TCOD_ctx.fullscreen_offsetx; - *ssy=sy - TCOD_ctx.fullscreen_offsety; - } -} - -void TCOD_sys_convert_console_to_screen_coords(int cx, int cy, int *sx, int *sy) { - *sx = scale_data.dst_offset_x + ((cx * TCOD_ctx.font_width - scale_data.src_x0) * scale_data.dst_display_width) / scale_data.src_copy_width; - *sy = scale_data.dst_offset_y + ((cy * TCOD_ctx.font_height - scale_data.src_y0) * scale_data.dst_display_height) / scale_data.src_copy_height; -} - -void TCOD_sys_convert_screen_to_console_coords(int sx, int sy, int *cx, int *cy) { - int ssx, ssy; - TCOD_sys_unproject_screen_coords(sx, sy, &ssx, &ssy); - *cx = ssx / TCOD_ctx.font_width; - *cy = ssy / TCOD_ctx.font_height; -} - -static TCOD_mouse_t tcod_mouse={0,0,0,0,0,0,0,0,false,false,false,false,false,false,false,false}; -static TCOD_event_t TCOD_sys_handle_event(SDL_Event *ev,TCOD_event_t eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse) { - TCOD_event_t retMask=0; - key->text[0] = '\0'; - /* printf("TCOD_sys_handle_event type=%04x\n", ev->type); */ - switch(ev->type) { - case SDL_KEYDOWN : { - TCOD_key_t tmpKey=TCOD_sys_SDLtoTCOD(ev,TCOD_KEY_PRESSED); - if ( (TCOD_EVENT_KEY_PRESS & eventMask) != 0) { - retMask|=TCOD_EVENT_KEY_PRESS; - if ( key ) *key = tmpKey; - return retMask; - } - } - break; - case SDL_KEYUP : { - TCOD_key_t tmpKey=TCOD_sys_SDLtoTCOD(ev,TCOD_KEY_RELEASED); - if ( (TCOD_EVENT_KEY_RELEASE & eventMask) != 0) { - retMask|=TCOD_EVENT_KEY_RELEASE; - if ( key ) *key = tmpKey; - return retMask; - } - } - break; - case SDL_TEXTINPUT: { - SDL_TextInputEvent *iev=&ev->text; - *key = TCOD_ctx.key_state; - key->vk = TCODK_TEXT; - key->c = 0; - key->pressed = 1; - strncpy(key->text, iev->text, TCOD_KEY_TEXT_SIZE); - return retMask | TCOD_EVENT_KEY_PRESS; - } - break; -#ifdef TCOD_TOUCH_INPUT - /* - * Need to distinguish between: - * - Tap: Can be optionally delegated to a mouse press. - * - Touch and drag: Should affect scaling screen position. - * - */ - case SDL_FINGERDOWN : - case SDL_FINGERUP : - case SDL_FINGERMOTION : - { - int idx, mouse_touch_valid; - float xf, yf, screen_x, screen_y; - uint32_t ticks_taken = 0; - - /* Reset the global variable. */ - if (tcod_touch.nfingerspressed == 0) { - tcod_touch.nupdates = 0; - tcod_touch.nfingers = 0; - tcod_touch.ticks0 = SDL_GetTicks(); - } else - ticks_taken = SDL_GetTicks() - tcod_touch.ticks0; - - idx = TCOD_sys_get_touch_finger_index(ev->tfinger.fingerId); - if (idx == -1) { - TCOD_LOG(("ERROR: failed to allocate extra finger")); - break; - } - - /* Count the number of events contributing to an ongoing tracked touch (zeroed above in finger press). */ - tcod_touch.finger_id = ev->tfinger.fingerId; - tcod_touch.nupdates += 1; - - /* We only emulate mouse events when the first finger is the only one pressed. */ - if (SDL_FINGERDOWN == ev->type) { - tcod_touch.nfingerspressed += 1; - tcod_touch.fingerspressed[idx] = 1; - mouse_touch_valid = mouse_touch && tcod_touch.nfingerspressed == 1 && tcod_touch.fingerspressed[0]; - } else if (SDL_FINGERUP == ev->type) { - mouse_touch_valid = mouse_touch && tcod_touch.nfingerspressed == 1 && tcod_touch.fingerspressed[0]; - tcod_touch.nfingerspressed -= 1; - tcod_touch.fingerspressed[idx] = 0; - } else - mouse_touch_valid = mouse_touch && tcod_touch.nfingerspressed == 1 && tcod_touch.fingerspressed[0]; - - /* Coordinates are raw full screen positions. */ - screen_x = ev->tfinger.x * scale_data.surface_width; - screen_y = ev->tfinger.y * scale_data.surface_height; - xf = (float)(screen_x - scale_data.dst_offset_x) / scale_data.dst_display_width; - yf = (float)(screen_y - scale_data.dst_offset_y) / scale_data.dst_display_height; - tcod_touch.coords[idx][0] = scale_data.src_x0 + scale_data.src_copy_width * xf; - tcod_touch.coords[idx][1] = scale_data.src_y0 + scale_data.src_copy_height * yf; - tcod_touch.coords_delta[idx][0] = ev->tfinger.dx * scale_data.src_proportionate_width; - tcod_touch.coords_delta[idx][1] = ev->tfinger.dy * scale_data.src_proportionate_height; - - /* Console coordinates need to be mapped back from screen coordinates through scaling. */ - tcod_touch.consolecoords[idx][0] = tcod_touch.coords[idx][0] / TCOD_ctx.font_width; - tcod_touch.consolecoords[idx][1] = tcod_touch.coords[idx][1] / TCOD_ctx.font_height; - tcod_touch.consolecoords_delta[idx][0] = tcod_touch.coords_delta[idx][0] / TCOD_ctx.font_width; - tcod_touch.consolecoords_delta[idx][1] = tcod_touch.coords_delta[idx][1] / TCOD_ctx.font_height; - - if (SDL_FINGERDOWN == ev->type) { - // printf("SDL_FINGERDOWN [%d] ticks=%d", tcod_touch.nupdates, ticks_taken); - if ((TCOD_EVENT_FINGER_PRESS & eventMask) != 0) - retMask |= TCOD_EVENT_FINGER_PRESS; - - if (mouse_touch_valid && (TCOD_EVENT_MOUSE_PRESS & eventMask) != 0) { - mouse->lbutton=mousebl=true; - retMask |= TCOD_EVENT_MOUSE_PRESS; - } - } else if (SDL_FINGERUP == ev->type) { - // printf("SDL_FINGERUP [%d] ticks=%d", tcod_touch.nupdates, ticks_taken); - if ((TCOD_EVENT_FINGER_RELEASE & eventMask) != 0) - retMask |= TCOD_EVENT_FINGER_RELEASE; - - if (mouse_touch_valid && (TCOD_EVENT_MOUSE_RELEASE & eventMask) != 0) { - if (mousebl) - mouse->lbutton_pressed = mouse_force_bl=true; - mouse->lbutton = mousebl=false; - retMask |= TCOD_EVENT_MOUSE_RELEASE; - } - } else if (SDL_FINGERMOTION == ev->type) { - float scale_adjust = 1.0f, xc_shift = 0.0f, yc_shift = 0.0f; - - // printf("SDL_FINGERMOTION [%d] ticks=%d", tcod_touch.nupdates, ticks_taken); - if ((TCOD_EVENT_FINGER_MOVE & eventMask) != 0) - retMask |= TCOD_EVENT_FINGER_MOVE; - - if (mouse_touch_valid && (TCOD_EVENT_MOUSE_MOVE & eventMask) != 0) - retMask |= TCOD_EVENT_MOUSE_MOVE; - - if (tcod_touch.nfingerspressed == 1) { - /* One finger drag AKA drag to move. - * Ignore the first few move events that happen unhelpfully immediately after finger down. */ - if (tcod_touch.fingerspressed[0] && (tcod_touch.coords_delta[0][0] || tcod_touch.coords_delta[0][1]) && ticks_taken > 10) { - xc_shift = (float)tcod_touch.coords_delta[idx][0] / scale_data.surface_width; - yc_shift = (float)tcod_touch.coords_delta[idx][1] / scale_data.surface_height; - } - } else if (tcod_touch.nfingerspressed == 2) { - /* Two finger pinch AKA pinch to zoom - * Both fingers should stay exactly where they are on the full surface - * in order to manipulate the drag and zoom effect. */ - if (tcod_touch.fingerspressed[0] && tcod_touch.fingerspressed[1]) { - /* - * New algorithm - */ - int f0x0 = tcod_touch.coords[0][0]-tcod_touch.coords_delta[0][0], f0y0 = tcod_touch.coords[0][1]-tcod_touch.coords_delta[0][1]; - int f1x0 = tcod_touch.coords[1][0]-tcod_touch.coords_delta[1][0], f1y0 = tcod_touch.coords[1][1]-tcod_touch.coords_delta[1][1]; - int f0x1 = tcod_touch.coords[0][0], f0y1 = tcod_touch.coords[0][1]; - int f1x1 = tcod_touch.coords[1][0], f1y1 = tcod_touch.coords[1][1]; - float p0x = (f1x0 + f0x0)/2.0f, p0y = (f1y0 + f0y0)/2.0f; - float p1x = (f1x1 + f0x1)/2.0f, p1y = (f1y1 + f0y1)/2.0f; - float len_previous = sqrtf((float)(pow(f0x0-f1x0,2) + pow(f0y0-f1y0,2))); - float len_current = sqrt((float)(pow(f0x1-f1x1, 2) + pow(f0y1-f1y1,2))); - scale_adjust = len_current/len_previous; - xc_shift = ((p1x - p0x) / scale_data.surface_width); - yc_shift = ((p1y - p0y) / scale_data.surface_height); - } - } - - /* Bound the translations within the console area. */ - if (fabs(xc_shift) > 1e-3f) { - sdl->scale_xc -= xc_shift; /* Actual display shift is the inverted finger movement. */ - if (sdl->scale_xc + 1e-3f < 0.0f) - sdl->scale_xc = 0.0f; - if (sdl->scale_xc - 1e-3f > 1.0f) - sdl->scale_xc = 1.0f; - } - if (fabs(yc_shift) > 1e-3f) { - sdl->scale_yc -= yc_shift; /* Actual display shift is the inverted finger movement. */ - if (sdl->scale_yc + 1e-3f < 0.0f) - sdl->scale_yc = 0.0f; - if (sdl->scale_yc - 1e-3f > 1.0f) - sdl->scale_yc = 1.0f; - } - if (fabs(scale_adjust - 1.0f) > 1e-3f) - TCOD_sys_set_scale_factor(scale_factor * scale_adjust); - } - - /* We need to distinguish between handleable touch events, and short distinct mouse events. */ - if (ticks_taken > 400 || tcod_touch.nfingers > 1) { - // printf("DEF NOT MOUSE CODE[%d]", tcod_touch.nupdates); - mouse->cx = 0; - mouse->cy = 0; - mouse->dcx = 0; - mouse->dcy = 0; - } else if (mouse_touch_valid && (retMask & (TCOD_EVENT_MOUSE_PRESS|TCOD_EVENT_MOUSE_RELEASE|TCOD_EVENT_MOUSE_MOVE)) != 0) { - mouse->x = tcod_touch.coords[idx][0]; - mouse->y = tcod_touch.coords[idx][1]; - mouse->dx += tcod_touch.coords_delta[idx][0]; - mouse->dy += tcod_touch.coords_delta[idx][1]; - mouse->cx = tcod_touch.consolecoords[idx][0]; - mouse->cy = tcod_touch.consolecoords[idx][1]; - mouse->dcx = tcod_touch.consolecoords_delta[idx][0]; - mouse->dcy = tcod_touch.consolecoords_delta[idx][1]; - /* printf("CX,CY: %d,%d", mouse->cx,mouse->cy); */ - } - - break; - } -#endif - case SDL_MOUSEMOTION : - if ( (TCOD_EVENT_MOUSE_MOVE & eventMask) != 0) { - SDL_MouseMotionEvent *mev=&ev->motion; - TCOD_sys_unproject_screen_coords(mev->x, mev->y, &mouse->x, &mouse->y); - if (scale_data.surface_width != 0) { - mouse->dx += (mev->xrel * scale_data.src_proportionate_width) / scale_data.surface_width; - mouse->dy += (mev->yrel * scale_data.src_proportionate_height) / scale_data.surface_height; - } - mouse->cx = mouse->x / TCOD_ctx.font_width; - mouse->cy = mouse->y / TCOD_ctx.font_height; - mouse->dcx = mouse->dx / TCOD_ctx.font_width; - mouse->dcy = mouse->dy / TCOD_ctx.font_height; - - return retMask | TCOD_EVENT_MOUSE_MOVE; - } - break; - case SDL_MOUSEWHEEL : - if (ev->wheel.y < 0) - mouse->wheel_down=true; - else - mouse->wheel_up=true; - return retMask | TCOD_EVENT_MOUSE_PRESS; - break; - case SDL_MOUSEBUTTONDOWN : - if ( (TCOD_EVENT_MOUSE_PRESS & eventMask) != 0) { - SDL_MouseButtonEvent *mev=&ev->button; - retMask|=TCOD_EVENT_MOUSE_PRESS; - switch (mev->button) { - case SDL_BUTTON_LEFT : mouse->lbutton=mousebl=true; break; - case SDL_BUTTON_MIDDLE : mouse->mbutton=mousebm=true; break; - case SDL_BUTTON_RIGHT : mouse->rbutton=mousebr=true; break; - } - /* update mouse position */ - if ( (TCOD_EVENT_MOUSE_MOVE & eventMask) == 0) { - mouse->x=mev->x; - mouse->y=mev->y; - mouse->cx = (mouse->x - TCOD_ctx.fullscreen_offsetx) / TCOD_ctx.font_width; - mouse->cy = (mouse->y - TCOD_ctx.fullscreen_offsety) / TCOD_ctx.font_height; - } - return retMask; - } - break; - case SDL_MOUSEBUTTONUP : - if ( (TCOD_EVENT_MOUSE_RELEASE & eventMask) != 0) { - SDL_MouseButtonEvent *mev=&ev->button; - retMask|=TCOD_EVENT_MOUSE_RELEASE; - switch (mev->button) { - case SDL_BUTTON_LEFT : if (mousebl) mouse->lbutton_pressed = mouse_force_bl=true; mouse->lbutton = mousebl=false; break; - case SDL_BUTTON_MIDDLE : if (mousebm) mouse->mbutton_pressed = mouse_force_bm=true; mouse->mbutton = mousebm=false; break; - case SDL_BUTTON_RIGHT : if (mousebr) mouse->rbutton_pressed = mouse_force_br=true; mouse->rbutton = mousebr=false; break; - } - /* update mouse position */ - if ( (TCOD_EVENT_MOUSE_MOVE & eventMask) == 0) { - mouse->x=mev->x; - mouse->y=mev->y; - mouse->cx = (mouse->x - TCOD_ctx.fullscreen_offsetx) / TCOD_ctx.font_width; - mouse->cy = (mouse->y - TCOD_ctx.fullscreen_offsety) / TCOD_ctx.font_height; - } - return retMask; - } - break; - case SDL_QUIT : - TCOD_ctx.is_window_closed=true; - break; - case SDL_WINDOWEVENT : - /* At this point, there are some corner cases that need dealing with. So log this. */ - /* printf("SDL2 WINDOWEVENT: 0x%04x\n", ev->window.event); */ - switch (ev->window.event) { -#ifdef TCOD_ANDROID - case SDL_WINDOWEVENT_SIZE_CHANGED: - { - /* printf("SDL2 WINDOWEVENT (SDL_WINDOWEVENT_SIZE_CHANGED): 0x%04x w=%d h=%d\n", ev->window.event, ev->window.data1, ev->window.data2); */ - /* If the app is started while the device is locked, the screen will be in portrait mode. We need to rescale when it changes. */ - if (scale_data.surface_width != ev->window.data1 || scale_data.surface_height != ev->window.data1) - scale_data.force_recalc = 1; - break; - } -#endif - case SDL_WINDOWEVENT_ENTER: /**< Window has gained mouse focus */ - TCOD_ctx.app_has_mouse_focus=true; break; - case SDL_WINDOWEVENT_LEAVE: /**< Window has lost mouse focus */ - TCOD_ctx.app_has_mouse_focus=false; break; - case SDL_WINDOWEVENT_FOCUS_GAINED: - TCOD_ctx.app_is_active=true; break; - case SDL_WINDOWEVENT_FOCUS_LOST: - TCOD_ctx.app_is_active=false; break; - case SDL_WINDOWEVENT_EXPOSED: /**< Window has been returned to and needs a refresh. */ - TCOD_sys_render(NULL, TCOD_ctx.root); - break; -#ifdef NDEBUG_HMM - default: - TCOD_LOG(("SDL2 WINDOWEVENT (unknown): 0x%04x\n", ev->window.event)); - break; -#endif - } - break; - default : break; - } - return retMask; -} - -TCOD_event_t TCOD_sys_wait_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush) { - SDL_Event ev; - TCOD_event_t retMask=0; - if ( eventMask == 0 ) return 0; - if ( flush ) { - while ( SDL_PollEvent(&ev) ) { - TCOD_sys_SDLtoTCOD(&ev,0); - } - } - tcod_mouse.lbutton_pressed =false; - tcod_mouse.rbutton_pressed =false; - tcod_mouse.mbutton_pressed =false; - tcod_mouse.wheel_up=false; - tcod_mouse.wheel_down=false; - tcod_mouse.dx=0; - tcod_mouse.dy=0; - if ( key ) { - key->vk=TCODK_NONE; - key->c=0; - } - do { - SDL_WaitEvent(&ev); - retMask=TCOD_sys_handle_event(&ev,eventMask,key,&tcod_mouse); - } while ( ev.type != SDL_QUIT && (retMask & eventMask) == 0 ); - if (mouse) { *mouse=tcod_mouse; } - return retMask; -} - -TCOD_event_t TCOD_sys_check_for_event(int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse) { - SDL_Event ev; - TCOD_event_t retMask=0; - if ( eventMask == 0 ) return 0; - tcod_mouse.lbutton_pressed =false; - tcod_mouse.rbutton_pressed =false; - tcod_mouse.mbutton_pressed =false; - tcod_mouse.wheel_up=false; - tcod_mouse.wheel_down=false; - tcod_mouse.dx=0; - tcod_mouse.dy=0; - if ( key ) { - key->vk=TCODK_NONE; - key->c=0; - } - while ( SDL_PollEvent(&ev) ) { - retMask=TCOD_sys_handle_event(&ev,eventMask,key,&tcod_mouse); - if ((retMask & TCOD_EVENT_KEY) != 0) - /* only one key event per frame */ - break; - } - if (mouse) { *mouse=tcod_mouse; } - return retMask; -} - -TCOD_mouse_t TCOD_mouse_get_status(void) { - return tcod_mouse; -} - - -/* classic keyboard functions (based on generic events) */ -/** - * Return immediately with a recently pressed key. - * - * \param flags A TCOD_event_t bit-field, for example: `TCOD_EVENT_KEY_PRESS` - * \return A TCOD_key_t struct with a recently pressed key. - * If no event exists then the `vk` attribute will be `TCODK_NONE` - */ -TCOD_key_t TCOD_sys_check_for_keypress(int flags) { - static TCOD_key_t noret={TCODK_NONE,0}; - - TCOD_key_t key; - TCOD_event_t ev = TCOD_sys_check_for_event(flags & TCOD_EVENT_KEY, &key, NULL); - - if ((ev & TCOD_EVENT_KEY) == 0) return noret; - - return key; -} -/** - * Wait for a key press event, then return it. - * - * \param flush If 1 then the event queue will be cleared before waiting for - * the next event. This should always be 0. - * \return A TCOD_key_t struct with the most recent key data. - */ -TCOD_key_t TCOD_sys_wait_for_keypress(bool flush) { - static TCOD_key_t noret={TCODK_NONE,0}; - - TCOD_key_t key; - TCOD_event_t ev = TCOD_sys_wait_for_event(TCOD_EVENT_KEY_PRESS, &key, NULL, flush); - - if ((ev & TCOD_EVENT_KEY_PRESS) == 0) return noret; - - return key; -} - - -void TCOD_sys_sleep_milli(uint32_t milliseconds) { - SDL_Delay(milliseconds); -} - -void *TCOD_sys_load_image(const char *filename) { - image_support_t *img=image_type; - while ( img->extension != NULL && !img->check_type(filename) ) img++; - if ( img->extension == NULL || img->read == NULL ) return NULL; /* unknown format */ - return img->read(filename); -} - -void TCOD_sys_get_image_size(const void *image, int *w, int *h) { - SDL_Surface *surf=(SDL_Surface *)image; - *w = surf->w; - *h = surf->h; -} - -TCOD_color_t TCOD_sys_get_image_pixel(const void *image,int x, int y) { - TCOD_color_t ret; - SDL_Surface *surf=(SDL_Surface *)image; - uint8_t bpp; - uint8_t*bits; - if ( x < 0 || y < 0 || x >= surf->w || y >= surf->h ) return TCOD_black; - bpp = surf->format->BytesPerPixel; - bits = ((uint8_t*)surf->pixels)+y*surf->pitch+x*bpp; - switch (bpp) { - case 1 : - { - if (surf->format->palette) { - SDL_Color col = surf->format->palette->colors[(*bits)]; - ret.r=col.r; - ret.g=col.g; - ret.b=col.b; - } else return TCOD_black; - } - break; - default : - ret.r = *((bits)+surf->format->Rshift/8); - ret.g = *((bits)+surf->format->Gshift/8); - ret.b = *((bits)+surf->format->Bshift/8); - break; - } - - return ret; -} - -int TCOD_sys_get_image_alpha(const void *image,int x, int y) { - SDL_Surface *surf=(SDL_Surface *)image; - uint8_t bpp; - uint8_t*bits; - if ( x < 0 || y < 0 || x >= surf->w || y >= surf->h ) return 255; - bpp = surf->format->BytesPerPixel; - if ( bpp != 4 ) return 255; - bits = ((uint8_t*)surf->pixels)+y*surf->pitch+x*bpp; - return *((bits)+surf->format->Ashift/8); -} - -uint32_t TCOD_sys_elapsed_milli(void) { - return (uint32_t)SDL_GetTicks(); -} - -float TCOD_sys_elapsed_seconds(void) { - static float div=1.0f/1000.0f; - return SDL_GetTicks()*div; -} - -void TCOD_sys_force_fullscreen_resolution(int width, int height) { - TCOD_ctx.fullscreen_width=width; - TCOD_ctx.fullscreen_height=height; -} - -void * TCOD_sys_create_bitmap(int width, int height, TCOD_color_t *buf) { - int x,y; - SDL_PixelFormat fmt; - SDL_Surface *bitmap; - memset(&fmt,0,sizeof(SDL_PixelFormat)); - if ( charmap != NULL ) { - fmt = *charmap->format; - } else { - fmt.BitsPerPixel=24; - fmt.Amask=0; - if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) { - fmt.Rmask=0x0000FF; - fmt.Gmask=0x00FF00; - fmt.Bmask=0xFF0000; - } else { - fmt.Rmask=0xFF0000; - fmt.Gmask=0x00FF00; - fmt.Bmask=0x0000FF; - } - } - bitmap=SDL_CreateRGBSurface(SDL_SWSURFACE,width,height,fmt.BitsPerPixel,fmt.Rmask,fmt.Gmask,fmt.Bmask,fmt.Amask); - for (x=0; x < width; x++) { - for (y=0; y < height; y++) { - SDL_Rect rect; - uint32_t col=SDL_MapRGB(&fmt,buf[x+y*width].r,buf[x+y*width].g,buf[x+y*width].b); - rect.x=x; - rect.y=y; - rect.w=1; - rect.h=1; - SDL_FillRect(bitmap,&rect,col); - } - } - return (void *)bitmap; -} - -void TCOD_sys_delete_bitmap(void *bitmap) { - SDL_FreeSurface((SDL_Surface *)bitmap); -} - -void TCOD_sys_set_fps(int val) { - if( val == 0 ) min_frame_length=0; - else min_frame_length=1000/val; -} - -void TCOD_sys_save_fps(void) { - min_frame_length_backup=min_frame_length; -} - -void TCOD_sys_restore_fps(void) { - min_frame_length=min_frame_length_backup; -} - -int TCOD_sys_get_fps(void) { - return fps; -} - -float TCOD_sys_get_last_frame_length(void) { - return last_frame_length; -} - -void TCOD_sys_get_char_size(int *w, int *h) { - *w = TCOD_ctx.font_width; - *h = TCOD_ctx.font_height; -} - -void TCOD_sys_get_current_resolution(int *w, int *h) { - /* be sure that SDL is initialized */ - TCOD_sys_startup(); - sdl->get_current_resolution(w,h); -} - -/* image stuff */ -bool TCOD_sys_check_magic_number(const char *filename, size_t size, uint8_t*data) { - uint8_t tmp[128]; - size_t i; - SDL_RWops *rwops = SDL_RWFromFile(filename, "rb"); - if (! rwops) return false; - if ( (i = rwops->read(rwops,tmp,size,1)) != 1 ) { - rwops->close(rwops); - return false; - } - rwops->close(rwops); - for (i=0; i< size; i++) if (tmp[i]!=data[i]) return false; - return true; -} - -void *TCOD_sys_get_SDL_window(void) { - return (void *)window; -} - -void *TCOD_sys_get_SDL_renderer(void) { - return (void *)renderer; -} - -/* mouse stuff */ -void TCOD_mouse_show_cursor(bool visible) { - SDL_ShowCursor(visible ? 1 : 0); -} - -bool TCOD_mouse_is_cursor_visible(void) { - return SDL_ShowCursor(-1) ? true : false; -} - -void TCOD_mouse_move(int x, int y) { - sdl->set_mouse_position(x,y); -} - -void TCOD_mouse_includes_touch(bool enable) { -#ifdef TCOD_TOUCH_INPUT - mouse_touch = enable; -#endif -} - -/*clipboard stuff */ -bool TCOD_sys_clipboard_set(const char *value) { - if (!has_startup) { return false; } - return sdl->set_clipboard_text(value); -} - -char *TCOD_sys_clipboard_get() { - if (!has_startup) { return ""; } - return sdl->get_clipboard_text(); -} - -bool TCOD_sys_read_file(const char *filename, unsigned char **buf, size_t *size) { - return sdl->file_read(filename,buf,size); -} - -bool TCOD_sys_file_exists(const char * filename, ...) { - char f[1024]; - va_list ap; - va_start(ap,filename); - vsprintf(f,filename,ap); - va_end(ap); - return sdl->file_exists(f); -} - -bool TCOD_sys_write_file(const char *filename, unsigned char *buf, uint32_t size) { - return sdl->file_write(filename,buf,size); -} - -/* Mark a rectangle of tiles dirty. */ -void TCOD_sys_set_dirty(int dx, int dy, int dw, int dh) { - int x, y; - TCOD_console_data_t *dat = sdl->get_root_console_cache(); - if (!dat) return; - TCOD_IFNOT(dx < dat->w && dy < dat->h && dx + dw >= 0 && dy + dh >= 0) return; - TCOD_IFNOT(dx >= 0) { - dw += dx; - dx = 0; - } - TCOD_IFNOT(dy >= 0) { - dh += dy; - dy = 0; - } - TCOD_IFNOT(dx + dw <= dat->w) dw = dat->w - dx; - TCOD_IFNOT(dy + dh <= dat->h) dh = dat->h - dy; - - for (x = dx; x < dx + dw; ++x) { - for (y = dy; y < dy + dh; ++y) { - dat->ch_array[dat->w * y + x] = -1; - } - } -} - -/* Mark a character dirty by invalidating all occurrences of it in the software - renderer cache. Each character tile will be refreshed when the old buffer - is compared to the current buffer next render. - It's recommended that this method stays non-public. */ -void TCOD_sys_set_dirty_character_code(int ch) { - int i; - TCOD_console_data_t *dat = sdl->get_root_console_cache(); - if (!dat) return; - for (i = 0; i < dat->w * dat->h; ++i) { - if (dat->ch_array[i] == ch) { - dat->ch_array[i] = -1; - } - } -} -/** - * Return the current tile index for a given character code. - */ -int TCOD_get_tileid_for_charcode_(int charcode) { - if (charcode >= 0 && charcode < TCOD_ctx.max_font_chars) { - return TCOD_ctx.ascii_to_tcod[charcode]; - } - return 0; -} -#endif /* TCOD_BARE */ diff --git a/tcod_sys/libtcod/src/sys_sdl_img_bmp.c b/tcod_sys/libtcod/src/sys_sdl_img_bmp.c deleted file mode 100644 index 8256d1bb3..000000000 --- a/tcod_sys/libtcod/src/sys_sdl_img_bmp.c +++ /dev/null @@ -1,70 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef TCOD_BARE - -#include - -#include - -#include - -bool TCOD_sys_check_bmp(const char *filename) { - static uint8_t magic_number[]={0x42, 0x4d}; - return TCOD_sys_check_magic_number(filename,sizeof(magic_number),magic_number); -} - -SDL_Surface *TCOD_sys_read_bmp(const char *filename) { - SDL_Surface *ret=SDL_LoadBMP(filename); - if( !ret ) TCOD_fatal("SDL : %s",SDL_GetError()); - /* convert low color images to 24 bits */ - if ( ret->format->BytesPerPixel != 3 ) { - uint32_t rmask,gmask,bmask; - SDL_Surface * tmp; - if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) { - rmask=0xFF0000; - gmask=0x00FF00; - bmask=0x0000FF; - } else { - rmask=0x0000FF; - gmask=0x00FF00; - bmask=0xFF0000; - } - tmp=SDL_CreateRGBSurface(SDL_SWSURFACE,ret->w,ret->h,24, rmask, gmask, bmask, 0); - SDL_BlitSurface(ret,NULL,tmp,NULL); - SDL_FreeSurface(ret); - ret=tmp; - } - - return ret; -} - -void TCOD_sys_write_bmp(const SDL_Surface *surf, const char *filename) { - SDL_SaveBMP((SDL_Surface *)surf,filename); -} - -#endif /* TCOD_BARE */ diff --git a/tcod_sys/libtcod/src/sys_sdl_img_png.c b/tcod_sys/libtcod/src/sys_sdl_img_png.c deleted file mode 100644 index 51a4a6886..000000000 --- a/tcod_sys/libtcod/src/sys_sdl_img_png.c +++ /dev/null @@ -1,123 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef TCOD_BARE - -#include - -#if !defined (__HAIKU__) && !defined (__ANDROID__) -#include -#include -#endif -#include - -#include "png/lodepng.h" - -#include - -bool TCOD_sys_check_png(const char *filename) { - static uint8_t magic_number[]={137, 80, 78, 71, 13, 10, 26, 10}; - return TCOD_sys_check_magic_number(filename,sizeof(magic_number),magic_number); -} - -SDL_Surface *TCOD_sys_read_png(const char *filename) { - unsigned error; - unsigned char* image; - unsigned width, height, y, bpp; - unsigned char* png; - size_t pngsize; - LodePNGState state; - SDL_Surface *bitmap; - unsigned char *source; - unsigned int rowsize; - - lodepng_state_init(&state); - /*optionally customize the state*/ - if (!TCOD_sys_read_file(filename,&png,&pngsize)) return NULL; - - lodepng_inspect(&width,&height,&state, png, pngsize); - bpp=lodepng_get_bpp(&state.info_png.color); - - if ( bpp == 24 ) { - /* don't convert to 32 bits because libtcod's 24bits renderer is faster */ - state.info_raw.colortype=LCT_RGB; - } else if ( bpp != 24 && bpp != 32 ) { - /* paletted png. convert to 24 bits */ - state.info_raw.colortype=LCT_RGB; - state.info_raw.bitdepth=8; - bpp=24; - } - error = lodepng_decode(&image, &width, &height, &state, png, pngsize); - free(png); - if(error) { - printf("error %u: %s\n", error, lodepng_error_text(error)); - lodepng_state_cleanup(&state); - return NULL; - } - - /* create the SDL surface */ - bitmap=TCOD_sys_get_surface(width,height,bpp==32); - source=image; - rowsize=width*bpp/8; - for (y=0; y< height; y++ ) { - uint8_t*row_pointer=(uint8_t*)(bitmap->pixels) + y * bitmap->pitch; - memcpy(row_pointer,source,rowsize); - source+=rowsize; - } - - lodepng_state_cleanup(&state); - free(image); - return bitmap; -} - -void TCOD_sys_write_png(const SDL_Surface *surf, const char *filename) { - unsigned char *image, *dest=(unsigned char *)malloc(surf->h*surf->w*3*sizeof(char)); - int x,y; - unsigned char *buf; - size_t size; - int error; - /* SDL uses 32bits format without alpha layer for screen. convert it to 24 bits */ - image=dest; - for (y=0; y< surf->h; y++ ) { - for (x=0; x < surf->w; x++ ) { - uint8_t*pixel=(uint8_t*)(surf->pixels) + y * surf->pitch + x * surf->format->BytesPerPixel; - *dest++=*((pixel)+surf->format->Rshift/8); - *dest++=*((pixel)+surf->format->Gshift/8); - *dest++=*((pixel)+surf->format->Bshift/8); - } - } - error=lodepng_encode_memory(&buf,&size,image,surf->w,surf->h,LCT_RGB,8); - free(image); - if ( ! error ) { - TCOD_sys_write_file(filename,buf,(uint32_t)size); - free(buf); - } else { - printf("error %u: %s\n", error, lodepng_error_text(error)); - } -} - -#endif /* TCOD_BARE */ diff --git a/tcod_sys/libtcod/src/tree_c.c b/tcod_sys/libtcod/src/tree_c.c deleted file mode 100644 index c8bf96e59..000000000 --- a/tcod_sys/libtcod/src/tree_c.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#include - -TCOD_tree_t *TCOD_tree_new(void) { - return (TCOD_tree_t *)calloc(1,sizeof(TCOD_tree_t)); -} - -void TCOD_tree_add_son(TCOD_tree_t *node, TCOD_tree_t *son) { - TCOD_tree_t *lastson = node->sons; - son->father=node; - while ( lastson && lastson->next ) lastson=lastson->next; - if ( lastson ) { - lastson->next=son; - } else { - node->sons=son; - } -} diff --git a/tcod_sys/libtcod/src/txtfield.cpp b/tcod_sys/libtcod/src/txtfield.cpp deleted file mode 100644 index a2966b86e..000000000 --- a/tcod_sys/libtcod/src/txtfield.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -#ifdef TCOD_CONSOLE_SUPPORT - -TCODText::TCODText(int x, int y, int w, int h, int max_chars){ - data=TCOD_text_init(x,y,w,h,max_chars); -} - -TCODText::TCODText(int w, int h, int max_chars){ - data=TCOD_text_init2(w,h,max_chars); -} - -TCODText::~TCODText(){ - TCOD_text_delete(data); -} - -void TCODText::setPos(int x, int y) { - TCOD_text_set_pos(data,x,y); -} - -void TCODText::setProperties(int cursor_char, int blink_interval, const char * prompt, int tab_size){ - TCOD_text_set_properties(data,cursor_char,blink_interval,prompt,tab_size); -} - -void TCODText::setColors(TCODColor fore, TCODColor back, float back_transparency){ - TCOD_color_t foreground = {fore.r,fore.g,fore.b}; - TCOD_color_t background = {back.r,back.g,back.b}; - TCOD_text_set_colors(data,foreground,background,back_transparency); -} - -bool TCODText::update(TCOD_key_t key){ - return TCOD_text_update(data,key) != 0; -} - -void TCODText::render(TCODConsole * con){ - TCOD_text_render(data,con->data); -} - -const char *TCODText::getText(){ - return TCOD_text_get(data); -} - -void TCODText::reset(){ - TCOD_text_reset(data); -} - -#endif /* TCOD_CONSOLE_SUPPORT */ diff --git a/tcod_sys/libtcod/src/vendor/glad.c b/tcod_sys/libtcod/src/vendor/glad.c new file mode 100644 index 000000000..f3c603d1d --- /dev/null +++ b/tcod_sys/libtcod/src/vendor/glad.c @@ -0,0 +1,1321 @@ +/* + + OpenGL loader generated by glad 0.1.28 on Mon Nov 19 11:18:35 2018. + + Language/Generator: C/C++ + Specification: gl + APIs: gl=2.0 + Profile: compatibility + Extensions: + + Loader: False + Local files: True + Omit khrplatform: False + Reproducible: False + + Commandline: + --profile="compatibility" --api="gl=2.0" --generator="c" --spec="gl" --no-loader --local-files --extensions="" + Online: + https://glad.dav1d.de/#profile=compatibility&language=c&specification=gl&api=gl%3D2.0 +*/ + +#include +#include +#include +#include "glad.h" + +struct gladGLversionStruct GLVersion = { 0, 0 }; + +#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) +#define _GLAD_IS_SOME_NEW_VERSION 1 +#endif + +static int max_loaded_major; +static int max_loaded_minor; + +static const char *exts = NULL; +static int num_exts_i = 0; +static char **exts_i = NULL; + +static int get_exts(void) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + exts = (const char *)glGetString(GL_EXTENSIONS); +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + unsigned int index; + + num_exts_i = 0; + glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); + if (num_exts_i > 0) { + char **tmp_exts_i = (char **)realloc((void *)exts_i, (size_t)num_exts_i * (sizeof *exts_i)); + if (tmp_exts_i == NULL) { + return 0; + } + exts_i = tmp_exts_i; + } + + if (exts_i == NULL) { + return 0; + } + + for(index = 0; index < (unsigned)num_exts_i; index++) { + const char *gl_str_tmp = (const char*)glGetStringi(GL_EXTENSIONS, index); + size_t len = strlen(gl_str_tmp); + + char *local_str = (char*)malloc((len+1) * sizeof(char)); + if(local_str != NULL) { + memcpy(local_str, gl_str_tmp, (len+1) * sizeof(char)); + } + exts_i[index] = local_str; + } + } +#endif + return 1; +} + +static void free_exts(void) { + if (exts_i != NULL) { + int index; + for(index = 0; index < num_exts_i; index++) { + free((char *)exts_i[index]); + } + free((void *)exts_i); + exts_i = NULL; + } +} + +static int has_ext(const char *ext) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + const char *extensions; + const char *loc; + const char *terminator; + extensions = exts; + if(extensions == NULL || ext == NULL) { + return 0; + } + + while(1) { + loc = strstr(extensions, ext); + if(loc == NULL) { + return 0; + } + + terminator = loc + strlen(ext); + if((loc == extensions || *(loc - 1) == ' ') && + (*terminator == ' ' || *terminator == '\0')) { + return 1; + } + extensions = terminator; + } +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + int index; + if(exts_i == NULL) return 0; + for(index = 0; index < num_exts_i; index++) { + const char *e = exts_i[index]; + + if(exts_i[index] != NULL && strcmp(e, ext) == 0) { + return 1; + } + } + } +#endif + + return 0; +} +int GLAD_GL_VERSION_1_0 = 0; +int GLAD_GL_VERSION_1_1 = 0; +int GLAD_GL_VERSION_1_2 = 0; +int GLAD_GL_VERSION_1_3 = 0; +int GLAD_GL_VERSION_1_4 = 0; +int GLAD_GL_VERSION_1_5 = 0; +int GLAD_GL_VERSION_2_0 = 0; +PFNGLACCUMPROC glad_glAccum = NULL; +PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL; +PFNGLALPHAFUNCPROC glad_glAlphaFunc = NULL; +PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident = NULL; +PFNGLARRAYELEMENTPROC glad_glArrayElement = NULL; +PFNGLATTACHSHADERPROC glad_glAttachShader = NULL; +PFNGLBEGINPROC glad_glBegin = NULL; +PFNGLBEGINQUERYPROC glad_glBeginQuery = NULL; +PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL; +PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL; +PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL; +PFNGLBITMAPPROC glad_glBitmap = NULL; +PFNGLBLENDCOLORPROC glad_glBlendColor = NULL; +PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL; +PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL; +PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL; +PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL; +PFNGLBUFFERDATAPROC glad_glBufferData = NULL; +PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL; +PFNGLCALLLISTPROC glad_glCallList = NULL; +PFNGLCALLLISTSPROC glad_glCallLists = NULL; +PFNGLCLEARPROC glad_glClear = NULL; +PFNGLCLEARACCUMPROC glad_glClearAccum = NULL; +PFNGLCLEARCOLORPROC glad_glClearColor = NULL; +PFNGLCLEARDEPTHPROC glad_glClearDepth = NULL; +PFNGLCLEARINDEXPROC glad_glClearIndex = NULL; +PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL; +PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture = NULL; +PFNGLCLIPPLANEPROC glad_glClipPlane = NULL; +PFNGLCOLOR3BPROC glad_glColor3b = NULL; +PFNGLCOLOR3BVPROC glad_glColor3bv = NULL; +PFNGLCOLOR3DPROC glad_glColor3d = NULL; +PFNGLCOLOR3DVPROC glad_glColor3dv = NULL; +PFNGLCOLOR3FPROC glad_glColor3f = NULL; +PFNGLCOLOR3FVPROC glad_glColor3fv = NULL; +PFNGLCOLOR3IPROC glad_glColor3i = NULL; +PFNGLCOLOR3IVPROC glad_glColor3iv = NULL; +PFNGLCOLOR3SPROC glad_glColor3s = NULL; +PFNGLCOLOR3SVPROC glad_glColor3sv = NULL; +PFNGLCOLOR3UBPROC glad_glColor3ub = NULL; +PFNGLCOLOR3UBVPROC glad_glColor3ubv = NULL; +PFNGLCOLOR3UIPROC glad_glColor3ui = NULL; +PFNGLCOLOR3UIVPROC glad_glColor3uiv = NULL; +PFNGLCOLOR3USPROC glad_glColor3us = NULL; +PFNGLCOLOR3USVPROC glad_glColor3usv = NULL; +PFNGLCOLOR4BPROC glad_glColor4b = NULL; +PFNGLCOLOR4BVPROC glad_glColor4bv = NULL; +PFNGLCOLOR4DPROC glad_glColor4d = NULL; +PFNGLCOLOR4DVPROC glad_glColor4dv = NULL; +PFNGLCOLOR4FPROC glad_glColor4f = NULL; +PFNGLCOLOR4FVPROC glad_glColor4fv = NULL; +PFNGLCOLOR4IPROC glad_glColor4i = NULL; +PFNGLCOLOR4IVPROC glad_glColor4iv = NULL; +PFNGLCOLOR4SPROC glad_glColor4s = NULL; +PFNGLCOLOR4SVPROC glad_glColor4sv = NULL; +PFNGLCOLOR4UBPROC glad_glColor4ub = NULL; +PFNGLCOLOR4UBVPROC glad_glColor4ubv = NULL; +PFNGLCOLOR4UIPROC glad_glColor4ui = NULL; +PFNGLCOLOR4UIVPROC glad_glColor4uiv = NULL; +PFNGLCOLOR4USPROC glad_glColor4us = NULL; +PFNGLCOLOR4USVPROC glad_glColor4usv = NULL; +PFNGLCOLORMASKPROC glad_glColorMask = NULL; +PFNGLCOLORMATERIALPROC glad_glColorMaterial = NULL; +PFNGLCOLORPOINTERPROC glad_glColorPointer = NULL; +PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL; +PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL; +PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D = NULL; +PFNGLCOPYPIXELSPROC glad_glCopyPixels = NULL; +PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D = NULL; +PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL; +PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D = NULL; +PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL; +PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D = NULL; +PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL; +PFNGLCREATESHADERPROC glad_glCreateShader = NULL; +PFNGLCULLFACEPROC glad_glCullFace = NULL; +PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL; +PFNGLDELETELISTSPROC glad_glDeleteLists = NULL; +PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL; +PFNGLDELETEQUERIESPROC glad_glDeleteQueries = NULL; +PFNGLDELETESHADERPROC glad_glDeleteShader = NULL; +PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL; +PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL; +PFNGLDEPTHMASKPROC glad_glDepthMask = NULL; +PFNGLDEPTHRANGEPROC glad_glDepthRange = NULL; +PFNGLDETACHSHADERPROC glad_glDetachShader = NULL; +PFNGLDISABLEPROC glad_glDisable = NULL; +PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState = NULL; +PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL; +PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL; +PFNGLDRAWBUFFERPROC glad_glDrawBuffer = NULL; +PFNGLDRAWBUFFERSPROC glad_glDrawBuffers = NULL; +PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL; +PFNGLDRAWPIXELSPROC glad_glDrawPixels = NULL; +PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements = NULL; +PFNGLEDGEFLAGPROC glad_glEdgeFlag = NULL; +PFNGLEDGEFLAGPOINTERPROC glad_glEdgeFlagPointer = NULL; +PFNGLEDGEFLAGVPROC glad_glEdgeFlagv = NULL; +PFNGLENABLEPROC glad_glEnable = NULL; +PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState = NULL; +PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL; +PFNGLENDPROC glad_glEnd = NULL; +PFNGLENDLISTPROC glad_glEndList = NULL; +PFNGLENDQUERYPROC glad_glEndQuery = NULL; +PFNGLEVALCOORD1DPROC glad_glEvalCoord1d = NULL; +PFNGLEVALCOORD1DVPROC glad_glEvalCoord1dv = NULL; +PFNGLEVALCOORD1FPROC glad_glEvalCoord1f = NULL; +PFNGLEVALCOORD1FVPROC glad_glEvalCoord1fv = NULL; +PFNGLEVALCOORD2DPROC glad_glEvalCoord2d = NULL; +PFNGLEVALCOORD2DVPROC glad_glEvalCoord2dv = NULL; +PFNGLEVALCOORD2FPROC glad_glEvalCoord2f = NULL; +PFNGLEVALCOORD2FVPROC glad_glEvalCoord2fv = NULL; +PFNGLEVALMESH1PROC glad_glEvalMesh1 = NULL; +PFNGLEVALMESH2PROC glad_glEvalMesh2 = NULL; +PFNGLEVALPOINT1PROC glad_glEvalPoint1 = NULL; +PFNGLEVALPOINT2PROC glad_glEvalPoint2 = NULL; +PFNGLFEEDBACKBUFFERPROC glad_glFeedbackBuffer = NULL; +PFNGLFINISHPROC glad_glFinish = NULL; +PFNGLFLUSHPROC glad_glFlush = NULL; +PFNGLFOGCOORDPOINTERPROC glad_glFogCoordPointer = NULL; +PFNGLFOGCOORDDPROC glad_glFogCoordd = NULL; +PFNGLFOGCOORDDVPROC glad_glFogCoorddv = NULL; +PFNGLFOGCOORDFPROC glad_glFogCoordf = NULL; +PFNGLFOGCOORDFVPROC glad_glFogCoordfv = NULL; +PFNGLFOGFPROC glad_glFogf = NULL; +PFNGLFOGFVPROC glad_glFogfv = NULL; +PFNGLFOGIPROC glad_glFogi = NULL; +PFNGLFOGIVPROC glad_glFogiv = NULL; +PFNGLFRONTFACEPROC glad_glFrontFace = NULL; +PFNGLFRUSTUMPROC glad_glFrustum = NULL; +PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL; +PFNGLGENLISTSPROC glad_glGenLists = NULL; +PFNGLGENQUERIESPROC glad_glGenQueries = NULL; +PFNGLGENTEXTURESPROC glad_glGenTextures = NULL; +PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL; +PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL; +PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL; +PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL; +PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL; +PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL; +PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv = NULL; +PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData = NULL; +PFNGLGETCLIPPLANEPROC glad_glGetClipPlane = NULL; +PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage = NULL; +PFNGLGETDOUBLEVPROC glad_glGetDoublev = NULL; +PFNGLGETERRORPROC glad_glGetError = NULL; +PFNGLGETFLOATVPROC glad_glGetFloatv = NULL; +PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL; +PFNGLGETLIGHTFVPROC glad_glGetLightfv = NULL; +PFNGLGETLIGHTIVPROC glad_glGetLightiv = NULL; +PFNGLGETMAPDVPROC glad_glGetMapdv = NULL; +PFNGLGETMAPFVPROC glad_glGetMapfv = NULL; +PFNGLGETMAPIVPROC glad_glGetMapiv = NULL; +PFNGLGETMATERIALFVPROC glad_glGetMaterialfv = NULL; +PFNGLGETMATERIALIVPROC glad_glGetMaterialiv = NULL; +PFNGLGETPIXELMAPFVPROC glad_glGetPixelMapfv = NULL; +PFNGLGETPIXELMAPUIVPROC glad_glGetPixelMapuiv = NULL; +PFNGLGETPIXELMAPUSVPROC glad_glGetPixelMapusv = NULL; +PFNGLGETPOINTERVPROC glad_glGetPointerv = NULL; +PFNGLGETPOLYGONSTIPPLEPROC glad_glGetPolygonStipple = NULL; +PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL; +PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL; +PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv = NULL; +PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv = NULL; +PFNGLGETQUERYIVPROC glad_glGetQueryiv = NULL; +PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL; +PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL; +PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL; +PFNGLGETSTRINGPROC glad_glGetString = NULL; +PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv = NULL; +PFNGLGETTEXENVIVPROC glad_glGetTexEnviv = NULL; +PFNGLGETTEXGENDVPROC glad_glGetTexGendv = NULL; +PFNGLGETTEXGENFVPROC glad_glGetTexGenfv = NULL; +PFNGLGETTEXGENIVPROC glad_glGetTexGeniv = NULL; +PFNGLGETTEXIMAGEPROC glad_glGetTexImage = NULL; +PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv = NULL; +PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv = NULL; +PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL; +PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL; +PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL; +PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL; +PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL; +PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL; +PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv = NULL; +PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL; +PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL; +PFNGLHINTPROC glad_glHint = NULL; +PFNGLINDEXMASKPROC glad_glIndexMask = NULL; +PFNGLINDEXPOINTERPROC glad_glIndexPointer = NULL; +PFNGLINDEXDPROC glad_glIndexd = NULL; +PFNGLINDEXDVPROC glad_glIndexdv = NULL; +PFNGLINDEXFPROC glad_glIndexf = NULL; +PFNGLINDEXFVPROC glad_glIndexfv = NULL; +PFNGLINDEXIPROC glad_glIndexi = NULL; +PFNGLINDEXIVPROC glad_glIndexiv = NULL; +PFNGLINDEXSPROC glad_glIndexs = NULL; +PFNGLINDEXSVPROC glad_glIndexsv = NULL; +PFNGLINDEXUBPROC glad_glIndexub = NULL; +PFNGLINDEXUBVPROC glad_glIndexubv = NULL; +PFNGLINITNAMESPROC glad_glInitNames = NULL; +PFNGLINTERLEAVEDARRAYSPROC glad_glInterleavedArrays = NULL; +PFNGLISBUFFERPROC glad_glIsBuffer = NULL; +PFNGLISENABLEDPROC glad_glIsEnabled = NULL; +PFNGLISLISTPROC glad_glIsList = NULL; +PFNGLISPROGRAMPROC glad_glIsProgram = NULL; +PFNGLISQUERYPROC glad_glIsQuery = NULL; +PFNGLISSHADERPROC glad_glIsShader = NULL; +PFNGLISTEXTUREPROC glad_glIsTexture = NULL; +PFNGLLIGHTMODELFPROC glad_glLightModelf = NULL; +PFNGLLIGHTMODELFVPROC glad_glLightModelfv = NULL; +PFNGLLIGHTMODELIPROC glad_glLightModeli = NULL; +PFNGLLIGHTMODELIVPROC glad_glLightModeliv = NULL; +PFNGLLIGHTFPROC glad_glLightf = NULL; +PFNGLLIGHTFVPROC glad_glLightfv = NULL; +PFNGLLIGHTIPROC glad_glLighti = NULL; +PFNGLLIGHTIVPROC glad_glLightiv = NULL; +PFNGLLINESTIPPLEPROC glad_glLineStipple = NULL; +PFNGLLINEWIDTHPROC glad_glLineWidth = NULL; +PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL; +PFNGLLISTBASEPROC glad_glListBase = NULL; +PFNGLLOADIDENTITYPROC glad_glLoadIdentity = NULL; +PFNGLLOADMATRIXDPROC glad_glLoadMatrixd = NULL; +PFNGLLOADMATRIXFPROC glad_glLoadMatrixf = NULL; +PFNGLLOADNAMEPROC glad_glLoadName = NULL; +PFNGLLOADTRANSPOSEMATRIXDPROC glad_glLoadTransposeMatrixd = NULL; +PFNGLLOADTRANSPOSEMATRIXFPROC glad_glLoadTransposeMatrixf = NULL; +PFNGLLOGICOPPROC glad_glLogicOp = NULL; +PFNGLMAP1DPROC glad_glMap1d = NULL; +PFNGLMAP1FPROC glad_glMap1f = NULL; +PFNGLMAP2DPROC glad_glMap2d = NULL; +PFNGLMAP2FPROC glad_glMap2f = NULL; +PFNGLMAPBUFFERPROC glad_glMapBuffer = NULL; +PFNGLMAPGRID1DPROC glad_glMapGrid1d = NULL; +PFNGLMAPGRID1FPROC glad_glMapGrid1f = NULL; +PFNGLMAPGRID2DPROC glad_glMapGrid2d = NULL; +PFNGLMAPGRID2FPROC glad_glMapGrid2f = NULL; +PFNGLMATERIALFPROC glad_glMaterialf = NULL; +PFNGLMATERIALFVPROC glad_glMaterialfv = NULL; +PFNGLMATERIALIPROC glad_glMateriali = NULL; +PFNGLMATERIALIVPROC glad_glMaterialiv = NULL; +PFNGLMATRIXMODEPROC glad_glMatrixMode = NULL; +PFNGLMULTMATRIXDPROC glad_glMultMatrixd = NULL; +PFNGLMULTMATRIXFPROC glad_glMultMatrixf = NULL; +PFNGLMULTTRANSPOSEMATRIXDPROC glad_glMultTransposeMatrixd = NULL; +PFNGLMULTTRANSPOSEMATRIXFPROC glad_glMultTransposeMatrixf = NULL; +PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays = NULL; +PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements = NULL; +PFNGLMULTITEXCOORD1DPROC glad_glMultiTexCoord1d = NULL; +PFNGLMULTITEXCOORD1DVPROC glad_glMultiTexCoord1dv = NULL; +PFNGLMULTITEXCOORD1FPROC glad_glMultiTexCoord1f = NULL; +PFNGLMULTITEXCOORD1FVPROC glad_glMultiTexCoord1fv = NULL; +PFNGLMULTITEXCOORD1IPROC glad_glMultiTexCoord1i = NULL; +PFNGLMULTITEXCOORD1IVPROC glad_glMultiTexCoord1iv = NULL; +PFNGLMULTITEXCOORD1SPROC glad_glMultiTexCoord1s = NULL; +PFNGLMULTITEXCOORD1SVPROC glad_glMultiTexCoord1sv = NULL; +PFNGLMULTITEXCOORD2DPROC glad_glMultiTexCoord2d = NULL; +PFNGLMULTITEXCOORD2DVPROC glad_glMultiTexCoord2dv = NULL; +PFNGLMULTITEXCOORD2FPROC glad_glMultiTexCoord2f = NULL; +PFNGLMULTITEXCOORD2FVPROC glad_glMultiTexCoord2fv = NULL; +PFNGLMULTITEXCOORD2IPROC glad_glMultiTexCoord2i = NULL; +PFNGLMULTITEXCOORD2IVPROC glad_glMultiTexCoord2iv = NULL; +PFNGLMULTITEXCOORD2SPROC glad_glMultiTexCoord2s = NULL; +PFNGLMULTITEXCOORD2SVPROC glad_glMultiTexCoord2sv = NULL; +PFNGLMULTITEXCOORD3DPROC glad_glMultiTexCoord3d = NULL; +PFNGLMULTITEXCOORD3DVPROC glad_glMultiTexCoord3dv = NULL; +PFNGLMULTITEXCOORD3FPROC glad_glMultiTexCoord3f = NULL; +PFNGLMULTITEXCOORD3FVPROC glad_glMultiTexCoord3fv = NULL; +PFNGLMULTITEXCOORD3IPROC glad_glMultiTexCoord3i = NULL; +PFNGLMULTITEXCOORD3IVPROC glad_glMultiTexCoord3iv = NULL; +PFNGLMULTITEXCOORD3SPROC glad_glMultiTexCoord3s = NULL; +PFNGLMULTITEXCOORD3SVPROC glad_glMultiTexCoord3sv = NULL; +PFNGLMULTITEXCOORD4DPROC glad_glMultiTexCoord4d = NULL; +PFNGLMULTITEXCOORD4DVPROC glad_glMultiTexCoord4dv = NULL; +PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f = NULL; +PFNGLMULTITEXCOORD4FVPROC glad_glMultiTexCoord4fv = NULL; +PFNGLMULTITEXCOORD4IPROC glad_glMultiTexCoord4i = NULL; +PFNGLMULTITEXCOORD4IVPROC glad_glMultiTexCoord4iv = NULL; +PFNGLMULTITEXCOORD4SPROC glad_glMultiTexCoord4s = NULL; +PFNGLMULTITEXCOORD4SVPROC glad_glMultiTexCoord4sv = NULL; +PFNGLNEWLISTPROC glad_glNewList = NULL; +PFNGLNORMAL3BPROC glad_glNormal3b = NULL; +PFNGLNORMAL3BVPROC glad_glNormal3bv = NULL; +PFNGLNORMAL3DPROC glad_glNormal3d = NULL; +PFNGLNORMAL3DVPROC glad_glNormal3dv = NULL; +PFNGLNORMAL3FPROC glad_glNormal3f = NULL; +PFNGLNORMAL3FVPROC glad_glNormal3fv = NULL; +PFNGLNORMAL3IPROC glad_glNormal3i = NULL; +PFNGLNORMAL3IVPROC glad_glNormal3iv = NULL; +PFNGLNORMAL3SPROC glad_glNormal3s = NULL; +PFNGLNORMAL3SVPROC glad_glNormal3sv = NULL; +PFNGLNORMALPOINTERPROC glad_glNormalPointer = NULL; +PFNGLORTHOPROC glad_glOrtho = NULL; +PFNGLPASSTHROUGHPROC glad_glPassThrough = NULL; +PFNGLPIXELMAPFVPROC glad_glPixelMapfv = NULL; +PFNGLPIXELMAPUIVPROC glad_glPixelMapuiv = NULL; +PFNGLPIXELMAPUSVPROC glad_glPixelMapusv = NULL; +PFNGLPIXELSTOREFPROC glad_glPixelStoref = NULL; +PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL; +PFNGLPIXELTRANSFERFPROC glad_glPixelTransferf = NULL; +PFNGLPIXELTRANSFERIPROC glad_glPixelTransferi = NULL; +PFNGLPIXELZOOMPROC glad_glPixelZoom = NULL; +PFNGLPOINTPARAMETERFPROC glad_glPointParameterf = NULL; +PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv = NULL; +PFNGLPOINTPARAMETERIPROC glad_glPointParameteri = NULL; +PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv = NULL; +PFNGLPOINTSIZEPROC glad_glPointSize = NULL; +PFNGLPOLYGONMODEPROC glad_glPolygonMode = NULL; +PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL; +PFNGLPOLYGONSTIPPLEPROC glad_glPolygonStipple = NULL; +PFNGLPOPATTRIBPROC glad_glPopAttrib = NULL; +PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib = NULL; +PFNGLPOPMATRIXPROC glad_glPopMatrix = NULL; +PFNGLPOPNAMEPROC glad_glPopName = NULL; +PFNGLPRIORITIZETEXTURESPROC glad_glPrioritizeTextures = NULL; +PFNGLPUSHATTRIBPROC glad_glPushAttrib = NULL; +PFNGLPUSHCLIENTATTRIBPROC glad_glPushClientAttrib = NULL; +PFNGLPUSHMATRIXPROC glad_glPushMatrix = NULL; +PFNGLPUSHNAMEPROC glad_glPushName = NULL; +PFNGLRASTERPOS2DPROC glad_glRasterPos2d = NULL; +PFNGLRASTERPOS2DVPROC glad_glRasterPos2dv = NULL; +PFNGLRASTERPOS2FPROC glad_glRasterPos2f = NULL; +PFNGLRASTERPOS2FVPROC glad_glRasterPos2fv = NULL; +PFNGLRASTERPOS2IPROC glad_glRasterPos2i = NULL; +PFNGLRASTERPOS2IVPROC glad_glRasterPos2iv = NULL; +PFNGLRASTERPOS2SPROC glad_glRasterPos2s = NULL; +PFNGLRASTERPOS2SVPROC glad_glRasterPos2sv = NULL; +PFNGLRASTERPOS3DPROC glad_glRasterPos3d = NULL; +PFNGLRASTERPOS3DVPROC glad_glRasterPos3dv = NULL; +PFNGLRASTERPOS3FPROC glad_glRasterPos3f = NULL; +PFNGLRASTERPOS3FVPROC glad_glRasterPos3fv = NULL; +PFNGLRASTERPOS3IPROC glad_glRasterPos3i = NULL; +PFNGLRASTERPOS3IVPROC glad_glRasterPos3iv = NULL; +PFNGLRASTERPOS3SPROC glad_glRasterPos3s = NULL; +PFNGLRASTERPOS3SVPROC glad_glRasterPos3sv = NULL; +PFNGLRASTERPOS4DPROC glad_glRasterPos4d = NULL; +PFNGLRASTERPOS4DVPROC glad_glRasterPos4dv = NULL; +PFNGLRASTERPOS4FPROC glad_glRasterPos4f = NULL; +PFNGLRASTERPOS4FVPROC glad_glRasterPos4fv = NULL; +PFNGLRASTERPOS4IPROC glad_glRasterPos4i = NULL; +PFNGLRASTERPOS4IVPROC glad_glRasterPos4iv = NULL; +PFNGLRASTERPOS4SPROC glad_glRasterPos4s = NULL; +PFNGLRASTERPOS4SVPROC glad_glRasterPos4sv = NULL; +PFNGLREADBUFFERPROC glad_glReadBuffer = NULL; +PFNGLREADPIXELSPROC glad_glReadPixels = NULL; +PFNGLRECTDPROC glad_glRectd = NULL; +PFNGLRECTDVPROC glad_glRectdv = NULL; +PFNGLRECTFPROC glad_glRectf = NULL; +PFNGLRECTFVPROC glad_glRectfv = NULL; +PFNGLRECTIPROC glad_glRecti = NULL; +PFNGLRECTIVPROC glad_glRectiv = NULL; +PFNGLRECTSPROC glad_glRects = NULL; +PFNGLRECTSVPROC glad_glRectsv = NULL; +PFNGLRENDERMODEPROC glad_glRenderMode = NULL; +PFNGLROTATEDPROC glad_glRotated = NULL; +PFNGLROTATEFPROC glad_glRotatef = NULL; +PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL; +PFNGLSCALEDPROC glad_glScaled = NULL; +PFNGLSCALEFPROC glad_glScalef = NULL; +PFNGLSCISSORPROC glad_glScissor = NULL; +PFNGLSECONDARYCOLOR3BPROC glad_glSecondaryColor3b = NULL; +PFNGLSECONDARYCOLOR3BVPROC glad_glSecondaryColor3bv = NULL; +PFNGLSECONDARYCOLOR3DPROC glad_glSecondaryColor3d = NULL; +PFNGLSECONDARYCOLOR3DVPROC glad_glSecondaryColor3dv = NULL; +PFNGLSECONDARYCOLOR3FPROC glad_glSecondaryColor3f = NULL; +PFNGLSECONDARYCOLOR3FVPROC glad_glSecondaryColor3fv = NULL; +PFNGLSECONDARYCOLOR3IPROC glad_glSecondaryColor3i = NULL; +PFNGLSECONDARYCOLOR3IVPROC glad_glSecondaryColor3iv = NULL; +PFNGLSECONDARYCOLOR3SPROC glad_glSecondaryColor3s = NULL; +PFNGLSECONDARYCOLOR3SVPROC glad_glSecondaryColor3sv = NULL; +PFNGLSECONDARYCOLOR3UBPROC glad_glSecondaryColor3ub = NULL; +PFNGLSECONDARYCOLOR3UBVPROC glad_glSecondaryColor3ubv = NULL; +PFNGLSECONDARYCOLOR3UIPROC glad_glSecondaryColor3ui = NULL; +PFNGLSECONDARYCOLOR3UIVPROC glad_glSecondaryColor3uiv = NULL; +PFNGLSECONDARYCOLOR3USPROC glad_glSecondaryColor3us = NULL; +PFNGLSECONDARYCOLOR3USVPROC glad_glSecondaryColor3usv = NULL; +PFNGLSECONDARYCOLORPOINTERPROC glad_glSecondaryColorPointer = NULL; +PFNGLSELECTBUFFERPROC glad_glSelectBuffer = NULL; +PFNGLSHADEMODELPROC glad_glShadeModel = NULL; +PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL; +PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL; +PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL; +PFNGLSTENCILMASKPROC glad_glStencilMask = NULL; +PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL; +PFNGLSTENCILOPPROC glad_glStencilOp = NULL; +PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL; +PFNGLTEXCOORD1DPROC glad_glTexCoord1d = NULL; +PFNGLTEXCOORD1DVPROC glad_glTexCoord1dv = NULL; +PFNGLTEXCOORD1FPROC glad_glTexCoord1f = NULL; +PFNGLTEXCOORD1FVPROC glad_glTexCoord1fv = NULL; +PFNGLTEXCOORD1IPROC glad_glTexCoord1i = NULL; +PFNGLTEXCOORD1IVPROC glad_glTexCoord1iv = NULL; +PFNGLTEXCOORD1SPROC glad_glTexCoord1s = NULL; +PFNGLTEXCOORD1SVPROC glad_glTexCoord1sv = NULL; +PFNGLTEXCOORD2DPROC glad_glTexCoord2d = NULL; +PFNGLTEXCOORD2DVPROC glad_glTexCoord2dv = NULL; +PFNGLTEXCOORD2FPROC glad_glTexCoord2f = NULL; +PFNGLTEXCOORD2FVPROC glad_glTexCoord2fv = NULL; +PFNGLTEXCOORD2IPROC glad_glTexCoord2i = NULL; +PFNGLTEXCOORD2IVPROC glad_glTexCoord2iv = NULL; +PFNGLTEXCOORD2SPROC glad_glTexCoord2s = NULL; +PFNGLTEXCOORD2SVPROC glad_glTexCoord2sv = NULL; +PFNGLTEXCOORD3DPROC glad_glTexCoord3d = NULL; +PFNGLTEXCOORD3DVPROC glad_glTexCoord3dv = NULL; +PFNGLTEXCOORD3FPROC glad_glTexCoord3f = NULL; +PFNGLTEXCOORD3FVPROC glad_glTexCoord3fv = NULL; +PFNGLTEXCOORD3IPROC glad_glTexCoord3i = NULL; +PFNGLTEXCOORD3IVPROC glad_glTexCoord3iv = NULL; +PFNGLTEXCOORD3SPROC glad_glTexCoord3s = NULL; +PFNGLTEXCOORD3SVPROC glad_glTexCoord3sv = NULL; +PFNGLTEXCOORD4DPROC glad_glTexCoord4d = NULL; +PFNGLTEXCOORD4DVPROC glad_glTexCoord4dv = NULL; +PFNGLTEXCOORD4FPROC glad_glTexCoord4f = NULL; +PFNGLTEXCOORD4FVPROC glad_glTexCoord4fv = NULL; +PFNGLTEXCOORD4IPROC glad_glTexCoord4i = NULL; +PFNGLTEXCOORD4IVPROC glad_glTexCoord4iv = NULL; +PFNGLTEXCOORD4SPROC glad_glTexCoord4s = NULL; +PFNGLTEXCOORD4SVPROC glad_glTexCoord4sv = NULL; +PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer = NULL; +PFNGLTEXENVFPROC glad_glTexEnvf = NULL; +PFNGLTEXENVFVPROC glad_glTexEnvfv = NULL; +PFNGLTEXENVIPROC glad_glTexEnvi = NULL; +PFNGLTEXENVIVPROC glad_glTexEnviv = NULL; +PFNGLTEXGENDPROC glad_glTexGend = NULL; +PFNGLTEXGENDVPROC glad_glTexGendv = NULL; +PFNGLTEXGENFPROC glad_glTexGenf = NULL; +PFNGLTEXGENFVPROC glad_glTexGenfv = NULL; +PFNGLTEXGENIPROC glad_glTexGeni = NULL; +PFNGLTEXGENIVPROC glad_glTexGeniv = NULL; +PFNGLTEXIMAGE1DPROC glad_glTexImage1D = NULL; +PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL; +PFNGLTEXIMAGE3DPROC glad_glTexImage3D = NULL; +PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL; +PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL; +PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL; +PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL; +PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D = NULL; +PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL; +PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D = NULL; +PFNGLTRANSLATEDPROC glad_glTranslated = NULL; +PFNGLTRANSLATEFPROC glad_glTranslatef = NULL; +PFNGLUNIFORM1FPROC glad_glUniform1f = NULL; +PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL; +PFNGLUNIFORM1IPROC glad_glUniform1i = NULL; +PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL; +PFNGLUNIFORM2FPROC glad_glUniform2f = NULL; +PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL; +PFNGLUNIFORM2IPROC glad_glUniform2i = NULL; +PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL; +PFNGLUNIFORM3FPROC glad_glUniform3f = NULL; +PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL; +PFNGLUNIFORM3IPROC glad_glUniform3i = NULL; +PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL; +PFNGLUNIFORM4FPROC glad_glUniform4f = NULL; +PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL; +PFNGLUNIFORM4IPROC glad_glUniform4i = NULL; +PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL; +PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL; +PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL; +PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL; +PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer = NULL; +PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL; +PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL; +PFNGLVERTEX2DPROC glad_glVertex2d = NULL; +PFNGLVERTEX2DVPROC glad_glVertex2dv = NULL; +PFNGLVERTEX2FPROC glad_glVertex2f = NULL; +PFNGLVERTEX2FVPROC glad_glVertex2fv = NULL; +PFNGLVERTEX2IPROC glad_glVertex2i = NULL; +PFNGLVERTEX2IVPROC glad_glVertex2iv = NULL; +PFNGLVERTEX2SPROC glad_glVertex2s = NULL; +PFNGLVERTEX2SVPROC glad_glVertex2sv = NULL; +PFNGLVERTEX3DPROC glad_glVertex3d = NULL; +PFNGLVERTEX3DVPROC glad_glVertex3dv = NULL; +PFNGLVERTEX3FPROC glad_glVertex3f = NULL; +PFNGLVERTEX3FVPROC glad_glVertex3fv = NULL; +PFNGLVERTEX3IPROC glad_glVertex3i = NULL; +PFNGLVERTEX3IVPROC glad_glVertex3iv = NULL; +PFNGLVERTEX3SPROC glad_glVertex3s = NULL; +PFNGLVERTEX3SVPROC glad_glVertex3sv = NULL; +PFNGLVERTEX4DPROC glad_glVertex4d = NULL; +PFNGLVERTEX4DVPROC glad_glVertex4dv = NULL; +PFNGLVERTEX4FPROC glad_glVertex4f = NULL; +PFNGLVERTEX4FVPROC glad_glVertex4fv = NULL; +PFNGLVERTEX4IPROC glad_glVertex4i = NULL; +PFNGLVERTEX4IVPROC glad_glVertex4iv = NULL; +PFNGLVERTEX4SPROC glad_glVertex4s = NULL; +PFNGLVERTEX4SVPROC glad_glVertex4sv = NULL; +PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d = NULL; +PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv = NULL; +PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL; +PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL; +PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s = NULL; +PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv = NULL; +PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d = NULL; +PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv = NULL; +PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL; +PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL; +PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s = NULL; +PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv = NULL; +PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d = NULL; +PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv = NULL; +PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL; +PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL; +PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s = NULL; +PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv = NULL; +PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv = NULL; +PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv = NULL; +PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv = NULL; +PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub = NULL; +PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv = NULL; +PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv = NULL; +PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv = NULL; +PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv = NULL; +PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d = NULL; +PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv = NULL; +PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL; +PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL; +PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv = NULL; +PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s = NULL; +PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv = NULL; +PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv = NULL; +PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv = NULL; +PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv = NULL; +PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL; +PFNGLVERTEXPOINTERPROC glad_glVertexPointer = NULL; +PFNGLVIEWPORTPROC glad_glViewport = NULL; +PFNGLWINDOWPOS2DPROC glad_glWindowPos2d = NULL; +PFNGLWINDOWPOS2DVPROC glad_glWindowPos2dv = NULL; +PFNGLWINDOWPOS2FPROC glad_glWindowPos2f = NULL; +PFNGLWINDOWPOS2FVPROC glad_glWindowPos2fv = NULL; +PFNGLWINDOWPOS2IPROC glad_glWindowPos2i = NULL; +PFNGLWINDOWPOS2IVPROC glad_glWindowPos2iv = NULL; +PFNGLWINDOWPOS2SPROC glad_glWindowPos2s = NULL; +PFNGLWINDOWPOS2SVPROC glad_glWindowPos2sv = NULL; +PFNGLWINDOWPOS3DPROC glad_glWindowPos3d = NULL; +PFNGLWINDOWPOS3DVPROC glad_glWindowPos3dv = NULL; +PFNGLWINDOWPOS3FPROC glad_glWindowPos3f = NULL; +PFNGLWINDOWPOS3FVPROC glad_glWindowPos3fv = NULL; +PFNGLWINDOWPOS3IPROC glad_glWindowPos3i = NULL; +PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv = NULL; +PFNGLWINDOWPOS3SPROC glad_glWindowPos3s = NULL; +PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv = NULL; +static void load_GL_VERSION_1_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_0) return; + glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); + glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); + glad_glHint = (PFNGLHINTPROC)load("glHint"); + glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); + glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); + glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode"); + glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); + glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); + glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); + glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); + glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); + glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D"); + glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); + glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer"); + glad_glClear = (PFNGLCLEARPROC)load("glClear"); + glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); + glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); + glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth"); + glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); + glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); + glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); + glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); + glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); + glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); + glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); + glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); + glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); + glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); + glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); + glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); + glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref"); + glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); + glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer"); + glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); + glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); + glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev"); + glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); + glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); + glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); + glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage"); + glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); + glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); + glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv"); + glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv"); + glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); + glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange"); + glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); + glad_glNewList = (PFNGLNEWLISTPROC)load("glNewList"); + glad_glEndList = (PFNGLENDLISTPROC)load("glEndList"); + glad_glCallList = (PFNGLCALLLISTPROC)load("glCallList"); + glad_glCallLists = (PFNGLCALLLISTSPROC)load("glCallLists"); + glad_glDeleteLists = (PFNGLDELETELISTSPROC)load("glDeleteLists"); + glad_glGenLists = (PFNGLGENLISTSPROC)load("glGenLists"); + glad_glListBase = (PFNGLLISTBASEPROC)load("glListBase"); + glad_glBegin = (PFNGLBEGINPROC)load("glBegin"); + glad_glBitmap = (PFNGLBITMAPPROC)load("glBitmap"); + glad_glColor3b = (PFNGLCOLOR3BPROC)load("glColor3b"); + glad_glColor3bv = (PFNGLCOLOR3BVPROC)load("glColor3bv"); + glad_glColor3d = (PFNGLCOLOR3DPROC)load("glColor3d"); + glad_glColor3dv = (PFNGLCOLOR3DVPROC)load("glColor3dv"); + glad_glColor3f = (PFNGLCOLOR3FPROC)load("glColor3f"); + glad_glColor3fv = (PFNGLCOLOR3FVPROC)load("glColor3fv"); + glad_glColor3i = (PFNGLCOLOR3IPROC)load("glColor3i"); + glad_glColor3iv = (PFNGLCOLOR3IVPROC)load("glColor3iv"); + glad_glColor3s = (PFNGLCOLOR3SPROC)load("glColor3s"); + glad_glColor3sv = (PFNGLCOLOR3SVPROC)load("glColor3sv"); + glad_glColor3ub = (PFNGLCOLOR3UBPROC)load("glColor3ub"); + glad_glColor3ubv = (PFNGLCOLOR3UBVPROC)load("glColor3ubv"); + glad_glColor3ui = (PFNGLCOLOR3UIPROC)load("glColor3ui"); + glad_glColor3uiv = (PFNGLCOLOR3UIVPROC)load("glColor3uiv"); + glad_glColor3us = (PFNGLCOLOR3USPROC)load("glColor3us"); + glad_glColor3usv = (PFNGLCOLOR3USVPROC)load("glColor3usv"); + glad_glColor4b = (PFNGLCOLOR4BPROC)load("glColor4b"); + glad_glColor4bv = (PFNGLCOLOR4BVPROC)load("glColor4bv"); + glad_glColor4d = (PFNGLCOLOR4DPROC)load("glColor4d"); + glad_glColor4dv = (PFNGLCOLOR4DVPROC)load("glColor4dv"); + glad_glColor4f = (PFNGLCOLOR4FPROC)load("glColor4f"); + glad_glColor4fv = (PFNGLCOLOR4FVPROC)load("glColor4fv"); + glad_glColor4i = (PFNGLCOLOR4IPROC)load("glColor4i"); + glad_glColor4iv = (PFNGLCOLOR4IVPROC)load("glColor4iv"); + glad_glColor4s = (PFNGLCOLOR4SPROC)load("glColor4s"); + glad_glColor4sv = (PFNGLCOLOR4SVPROC)load("glColor4sv"); + glad_glColor4ub = (PFNGLCOLOR4UBPROC)load("glColor4ub"); + glad_glColor4ubv = (PFNGLCOLOR4UBVPROC)load("glColor4ubv"); + glad_glColor4ui = (PFNGLCOLOR4UIPROC)load("glColor4ui"); + glad_glColor4uiv = (PFNGLCOLOR4UIVPROC)load("glColor4uiv"); + glad_glColor4us = (PFNGLCOLOR4USPROC)load("glColor4us"); + glad_glColor4usv = (PFNGLCOLOR4USVPROC)load("glColor4usv"); + glad_glEdgeFlag = (PFNGLEDGEFLAGPROC)load("glEdgeFlag"); + glad_glEdgeFlagv = (PFNGLEDGEFLAGVPROC)load("glEdgeFlagv"); + glad_glEnd = (PFNGLENDPROC)load("glEnd"); + glad_glIndexd = (PFNGLINDEXDPROC)load("glIndexd"); + glad_glIndexdv = (PFNGLINDEXDVPROC)load("glIndexdv"); + glad_glIndexf = (PFNGLINDEXFPROC)load("glIndexf"); + glad_glIndexfv = (PFNGLINDEXFVPROC)load("glIndexfv"); + glad_glIndexi = (PFNGLINDEXIPROC)load("glIndexi"); + glad_glIndexiv = (PFNGLINDEXIVPROC)load("glIndexiv"); + glad_glIndexs = (PFNGLINDEXSPROC)load("glIndexs"); + glad_glIndexsv = (PFNGLINDEXSVPROC)load("glIndexsv"); + glad_glNormal3b = (PFNGLNORMAL3BPROC)load("glNormal3b"); + glad_glNormal3bv = (PFNGLNORMAL3BVPROC)load("glNormal3bv"); + glad_glNormal3d = (PFNGLNORMAL3DPROC)load("glNormal3d"); + glad_glNormal3dv = (PFNGLNORMAL3DVPROC)load("glNormal3dv"); + glad_glNormal3f = (PFNGLNORMAL3FPROC)load("glNormal3f"); + glad_glNormal3fv = (PFNGLNORMAL3FVPROC)load("glNormal3fv"); + glad_glNormal3i = (PFNGLNORMAL3IPROC)load("glNormal3i"); + glad_glNormal3iv = (PFNGLNORMAL3IVPROC)load("glNormal3iv"); + glad_glNormal3s = (PFNGLNORMAL3SPROC)load("glNormal3s"); + glad_glNormal3sv = (PFNGLNORMAL3SVPROC)load("glNormal3sv"); + glad_glRasterPos2d = (PFNGLRASTERPOS2DPROC)load("glRasterPos2d"); + glad_glRasterPos2dv = (PFNGLRASTERPOS2DVPROC)load("glRasterPos2dv"); + glad_glRasterPos2f = (PFNGLRASTERPOS2FPROC)load("glRasterPos2f"); + glad_glRasterPos2fv = (PFNGLRASTERPOS2FVPROC)load("glRasterPos2fv"); + glad_glRasterPos2i = (PFNGLRASTERPOS2IPROC)load("glRasterPos2i"); + glad_glRasterPos2iv = (PFNGLRASTERPOS2IVPROC)load("glRasterPos2iv"); + glad_glRasterPos2s = (PFNGLRASTERPOS2SPROC)load("glRasterPos2s"); + glad_glRasterPos2sv = (PFNGLRASTERPOS2SVPROC)load("glRasterPos2sv"); + glad_glRasterPos3d = (PFNGLRASTERPOS3DPROC)load("glRasterPos3d"); + glad_glRasterPos3dv = (PFNGLRASTERPOS3DVPROC)load("glRasterPos3dv"); + glad_glRasterPos3f = (PFNGLRASTERPOS3FPROC)load("glRasterPos3f"); + glad_glRasterPos3fv = (PFNGLRASTERPOS3FVPROC)load("glRasterPos3fv"); + glad_glRasterPos3i = (PFNGLRASTERPOS3IPROC)load("glRasterPos3i"); + glad_glRasterPos3iv = (PFNGLRASTERPOS3IVPROC)load("glRasterPos3iv"); + glad_glRasterPos3s = (PFNGLRASTERPOS3SPROC)load("glRasterPos3s"); + glad_glRasterPos3sv = (PFNGLRASTERPOS3SVPROC)load("glRasterPos3sv"); + glad_glRasterPos4d = (PFNGLRASTERPOS4DPROC)load("glRasterPos4d"); + glad_glRasterPos4dv = (PFNGLRASTERPOS4DVPROC)load("glRasterPos4dv"); + glad_glRasterPos4f = (PFNGLRASTERPOS4FPROC)load("glRasterPos4f"); + glad_glRasterPos4fv = (PFNGLRASTERPOS4FVPROC)load("glRasterPos4fv"); + glad_glRasterPos4i = (PFNGLRASTERPOS4IPROC)load("glRasterPos4i"); + glad_glRasterPos4iv = (PFNGLRASTERPOS4IVPROC)load("glRasterPos4iv"); + glad_glRasterPos4s = (PFNGLRASTERPOS4SPROC)load("glRasterPos4s"); + glad_glRasterPos4sv = (PFNGLRASTERPOS4SVPROC)load("glRasterPos4sv"); + glad_glRectd = (PFNGLRECTDPROC)load("glRectd"); + glad_glRectdv = (PFNGLRECTDVPROC)load("glRectdv"); + glad_glRectf = (PFNGLRECTFPROC)load("glRectf"); + glad_glRectfv = (PFNGLRECTFVPROC)load("glRectfv"); + glad_glRecti = (PFNGLRECTIPROC)load("glRecti"); + glad_glRectiv = (PFNGLRECTIVPROC)load("glRectiv"); + glad_glRects = (PFNGLRECTSPROC)load("glRects"); + glad_glRectsv = (PFNGLRECTSVPROC)load("glRectsv"); + glad_glTexCoord1d = (PFNGLTEXCOORD1DPROC)load("glTexCoord1d"); + glad_glTexCoord1dv = (PFNGLTEXCOORD1DVPROC)load("glTexCoord1dv"); + glad_glTexCoord1f = (PFNGLTEXCOORD1FPROC)load("glTexCoord1f"); + glad_glTexCoord1fv = (PFNGLTEXCOORD1FVPROC)load("glTexCoord1fv"); + glad_glTexCoord1i = (PFNGLTEXCOORD1IPROC)load("glTexCoord1i"); + glad_glTexCoord1iv = (PFNGLTEXCOORD1IVPROC)load("glTexCoord1iv"); + glad_glTexCoord1s = (PFNGLTEXCOORD1SPROC)load("glTexCoord1s"); + glad_glTexCoord1sv = (PFNGLTEXCOORD1SVPROC)load("glTexCoord1sv"); + glad_glTexCoord2d = (PFNGLTEXCOORD2DPROC)load("glTexCoord2d"); + glad_glTexCoord2dv = (PFNGLTEXCOORD2DVPROC)load("glTexCoord2dv"); + glad_glTexCoord2f = (PFNGLTEXCOORD2FPROC)load("glTexCoord2f"); + glad_glTexCoord2fv = (PFNGLTEXCOORD2FVPROC)load("glTexCoord2fv"); + glad_glTexCoord2i = (PFNGLTEXCOORD2IPROC)load("glTexCoord2i"); + glad_glTexCoord2iv = (PFNGLTEXCOORD2IVPROC)load("glTexCoord2iv"); + glad_glTexCoord2s = (PFNGLTEXCOORD2SPROC)load("glTexCoord2s"); + glad_glTexCoord2sv = (PFNGLTEXCOORD2SVPROC)load("glTexCoord2sv"); + glad_glTexCoord3d = (PFNGLTEXCOORD3DPROC)load("glTexCoord3d"); + glad_glTexCoord3dv = (PFNGLTEXCOORD3DVPROC)load("glTexCoord3dv"); + glad_glTexCoord3f = (PFNGLTEXCOORD3FPROC)load("glTexCoord3f"); + glad_glTexCoord3fv = (PFNGLTEXCOORD3FVPROC)load("glTexCoord3fv"); + glad_glTexCoord3i = (PFNGLTEXCOORD3IPROC)load("glTexCoord3i"); + glad_glTexCoord3iv = (PFNGLTEXCOORD3IVPROC)load("glTexCoord3iv"); + glad_glTexCoord3s = (PFNGLTEXCOORD3SPROC)load("glTexCoord3s"); + glad_glTexCoord3sv = (PFNGLTEXCOORD3SVPROC)load("glTexCoord3sv"); + glad_glTexCoord4d = (PFNGLTEXCOORD4DPROC)load("glTexCoord4d"); + glad_glTexCoord4dv = (PFNGLTEXCOORD4DVPROC)load("glTexCoord4dv"); + glad_glTexCoord4f = (PFNGLTEXCOORD4FPROC)load("glTexCoord4f"); + glad_glTexCoord4fv = (PFNGLTEXCOORD4FVPROC)load("glTexCoord4fv"); + glad_glTexCoord4i = (PFNGLTEXCOORD4IPROC)load("glTexCoord4i"); + glad_glTexCoord4iv = (PFNGLTEXCOORD4IVPROC)load("glTexCoord4iv"); + glad_glTexCoord4s = (PFNGLTEXCOORD4SPROC)load("glTexCoord4s"); + glad_glTexCoord4sv = (PFNGLTEXCOORD4SVPROC)load("glTexCoord4sv"); + glad_glVertex2d = (PFNGLVERTEX2DPROC)load("glVertex2d"); + glad_glVertex2dv = (PFNGLVERTEX2DVPROC)load("glVertex2dv"); + glad_glVertex2f = (PFNGLVERTEX2FPROC)load("glVertex2f"); + glad_glVertex2fv = (PFNGLVERTEX2FVPROC)load("glVertex2fv"); + glad_glVertex2i = (PFNGLVERTEX2IPROC)load("glVertex2i"); + glad_glVertex2iv = (PFNGLVERTEX2IVPROC)load("glVertex2iv"); + glad_glVertex2s = (PFNGLVERTEX2SPROC)load("glVertex2s"); + glad_glVertex2sv = (PFNGLVERTEX2SVPROC)load("glVertex2sv"); + glad_glVertex3d = (PFNGLVERTEX3DPROC)load("glVertex3d"); + glad_glVertex3dv = (PFNGLVERTEX3DVPROC)load("glVertex3dv"); + glad_glVertex3f = (PFNGLVERTEX3FPROC)load("glVertex3f"); + glad_glVertex3fv = (PFNGLVERTEX3FVPROC)load("glVertex3fv"); + glad_glVertex3i = (PFNGLVERTEX3IPROC)load("glVertex3i"); + glad_glVertex3iv = (PFNGLVERTEX3IVPROC)load("glVertex3iv"); + glad_glVertex3s = (PFNGLVERTEX3SPROC)load("glVertex3s"); + glad_glVertex3sv = (PFNGLVERTEX3SVPROC)load("glVertex3sv"); + glad_glVertex4d = (PFNGLVERTEX4DPROC)load("glVertex4d"); + glad_glVertex4dv = (PFNGLVERTEX4DVPROC)load("glVertex4dv"); + glad_glVertex4f = (PFNGLVERTEX4FPROC)load("glVertex4f"); + glad_glVertex4fv = (PFNGLVERTEX4FVPROC)load("glVertex4fv"); + glad_glVertex4i = (PFNGLVERTEX4IPROC)load("glVertex4i"); + glad_glVertex4iv = (PFNGLVERTEX4IVPROC)load("glVertex4iv"); + glad_glVertex4s = (PFNGLVERTEX4SPROC)load("glVertex4s"); + glad_glVertex4sv = (PFNGLVERTEX4SVPROC)load("glVertex4sv"); + glad_glClipPlane = (PFNGLCLIPPLANEPROC)load("glClipPlane"); + glad_glColorMaterial = (PFNGLCOLORMATERIALPROC)load("glColorMaterial"); + glad_glFogf = (PFNGLFOGFPROC)load("glFogf"); + glad_glFogfv = (PFNGLFOGFVPROC)load("glFogfv"); + glad_glFogi = (PFNGLFOGIPROC)load("glFogi"); + glad_glFogiv = (PFNGLFOGIVPROC)load("glFogiv"); + glad_glLightf = (PFNGLLIGHTFPROC)load("glLightf"); + glad_glLightfv = (PFNGLLIGHTFVPROC)load("glLightfv"); + glad_glLighti = (PFNGLLIGHTIPROC)load("glLighti"); + glad_glLightiv = (PFNGLLIGHTIVPROC)load("glLightiv"); + glad_glLightModelf = (PFNGLLIGHTMODELFPROC)load("glLightModelf"); + glad_glLightModelfv = (PFNGLLIGHTMODELFVPROC)load("glLightModelfv"); + glad_glLightModeli = (PFNGLLIGHTMODELIPROC)load("glLightModeli"); + glad_glLightModeliv = (PFNGLLIGHTMODELIVPROC)load("glLightModeliv"); + glad_glLineStipple = (PFNGLLINESTIPPLEPROC)load("glLineStipple"); + glad_glMaterialf = (PFNGLMATERIALFPROC)load("glMaterialf"); + glad_glMaterialfv = (PFNGLMATERIALFVPROC)load("glMaterialfv"); + glad_glMateriali = (PFNGLMATERIALIPROC)load("glMateriali"); + glad_glMaterialiv = (PFNGLMATERIALIVPROC)load("glMaterialiv"); + glad_glPolygonStipple = (PFNGLPOLYGONSTIPPLEPROC)load("glPolygonStipple"); + glad_glShadeModel = (PFNGLSHADEMODELPROC)load("glShadeModel"); + glad_glTexEnvf = (PFNGLTEXENVFPROC)load("glTexEnvf"); + glad_glTexEnvfv = (PFNGLTEXENVFVPROC)load("glTexEnvfv"); + glad_glTexEnvi = (PFNGLTEXENVIPROC)load("glTexEnvi"); + glad_glTexEnviv = (PFNGLTEXENVIVPROC)load("glTexEnviv"); + glad_glTexGend = (PFNGLTEXGENDPROC)load("glTexGend"); + glad_glTexGendv = (PFNGLTEXGENDVPROC)load("glTexGendv"); + glad_glTexGenf = (PFNGLTEXGENFPROC)load("glTexGenf"); + glad_glTexGenfv = (PFNGLTEXGENFVPROC)load("glTexGenfv"); + glad_glTexGeni = (PFNGLTEXGENIPROC)load("glTexGeni"); + glad_glTexGeniv = (PFNGLTEXGENIVPROC)load("glTexGeniv"); + glad_glFeedbackBuffer = (PFNGLFEEDBACKBUFFERPROC)load("glFeedbackBuffer"); + glad_glSelectBuffer = (PFNGLSELECTBUFFERPROC)load("glSelectBuffer"); + glad_glRenderMode = (PFNGLRENDERMODEPROC)load("glRenderMode"); + glad_glInitNames = (PFNGLINITNAMESPROC)load("glInitNames"); + glad_glLoadName = (PFNGLLOADNAMEPROC)load("glLoadName"); + glad_glPassThrough = (PFNGLPASSTHROUGHPROC)load("glPassThrough"); + glad_glPopName = (PFNGLPOPNAMEPROC)load("glPopName"); + glad_glPushName = (PFNGLPUSHNAMEPROC)load("glPushName"); + glad_glClearAccum = (PFNGLCLEARACCUMPROC)load("glClearAccum"); + glad_glClearIndex = (PFNGLCLEARINDEXPROC)load("glClearIndex"); + glad_glIndexMask = (PFNGLINDEXMASKPROC)load("glIndexMask"); + glad_glAccum = (PFNGLACCUMPROC)load("glAccum"); + glad_glPopAttrib = (PFNGLPOPATTRIBPROC)load("glPopAttrib"); + glad_glPushAttrib = (PFNGLPUSHATTRIBPROC)load("glPushAttrib"); + glad_glMap1d = (PFNGLMAP1DPROC)load("glMap1d"); + glad_glMap1f = (PFNGLMAP1FPROC)load("glMap1f"); + glad_glMap2d = (PFNGLMAP2DPROC)load("glMap2d"); + glad_glMap2f = (PFNGLMAP2FPROC)load("glMap2f"); + glad_glMapGrid1d = (PFNGLMAPGRID1DPROC)load("glMapGrid1d"); + glad_glMapGrid1f = (PFNGLMAPGRID1FPROC)load("glMapGrid1f"); + glad_glMapGrid2d = (PFNGLMAPGRID2DPROC)load("glMapGrid2d"); + glad_glMapGrid2f = (PFNGLMAPGRID2FPROC)load("glMapGrid2f"); + glad_glEvalCoord1d = (PFNGLEVALCOORD1DPROC)load("glEvalCoord1d"); + glad_glEvalCoord1dv = (PFNGLEVALCOORD1DVPROC)load("glEvalCoord1dv"); + glad_glEvalCoord1f = (PFNGLEVALCOORD1FPROC)load("glEvalCoord1f"); + glad_glEvalCoord1fv = (PFNGLEVALCOORD1FVPROC)load("glEvalCoord1fv"); + glad_glEvalCoord2d = (PFNGLEVALCOORD2DPROC)load("glEvalCoord2d"); + glad_glEvalCoord2dv = (PFNGLEVALCOORD2DVPROC)load("glEvalCoord2dv"); + glad_glEvalCoord2f = (PFNGLEVALCOORD2FPROC)load("glEvalCoord2f"); + glad_glEvalCoord2fv = (PFNGLEVALCOORD2FVPROC)load("glEvalCoord2fv"); + glad_glEvalMesh1 = (PFNGLEVALMESH1PROC)load("glEvalMesh1"); + glad_glEvalPoint1 = (PFNGLEVALPOINT1PROC)load("glEvalPoint1"); + glad_glEvalMesh2 = (PFNGLEVALMESH2PROC)load("glEvalMesh2"); + glad_glEvalPoint2 = (PFNGLEVALPOINT2PROC)load("glEvalPoint2"); + glad_glAlphaFunc = (PFNGLALPHAFUNCPROC)load("glAlphaFunc"); + glad_glPixelZoom = (PFNGLPIXELZOOMPROC)load("glPixelZoom"); + glad_glPixelTransferf = (PFNGLPIXELTRANSFERFPROC)load("glPixelTransferf"); + glad_glPixelTransferi = (PFNGLPIXELTRANSFERIPROC)load("glPixelTransferi"); + glad_glPixelMapfv = (PFNGLPIXELMAPFVPROC)load("glPixelMapfv"); + glad_glPixelMapuiv = (PFNGLPIXELMAPUIVPROC)load("glPixelMapuiv"); + glad_glPixelMapusv = (PFNGLPIXELMAPUSVPROC)load("glPixelMapusv"); + glad_glCopyPixels = (PFNGLCOPYPIXELSPROC)load("glCopyPixels"); + glad_glDrawPixels = (PFNGLDRAWPIXELSPROC)load("glDrawPixels"); + glad_glGetClipPlane = (PFNGLGETCLIPPLANEPROC)load("glGetClipPlane"); + glad_glGetLightfv = (PFNGLGETLIGHTFVPROC)load("glGetLightfv"); + glad_glGetLightiv = (PFNGLGETLIGHTIVPROC)load("glGetLightiv"); + glad_glGetMapdv = (PFNGLGETMAPDVPROC)load("glGetMapdv"); + glad_glGetMapfv = (PFNGLGETMAPFVPROC)load("glGetMapfv"); + glad_glGetMapiv = (PFNGLGETMAPIVPROC)load("glGetMapiv"); + glad_glGetMaterialfv = (PFNGLGETMATERIALFVPROC)load("glGetMaterialfv"); + glad_glGetMaterialiv = (PFNGLGETMATERIALIVPROC)load("glGetMaterialiv"); + glad_glGetPixelMapfv = (PFNGLGETPIXELMAPFVPROC)load("glGetPixelMapfv"); + glad_glGetPixelMapuiv = (PFNGLGETPIXELMAPUIVPROC)load("glGetPixelMapuiv"); + glad_glGetPixelMapusv = (PFNGLGETPIXELMAPUSVPROC)load("glGetPixelMapusv"); + glad_glGetPolygonStipple = (PFNGLGETPOLYGONSTIPPLEPROC)load("glGetPolygonStipple"); + glad_glGetTexEnvfv = (PFNGLGETTEXENVFVPROC)load("glGetTexEnvfv"); + glad_glGetTexEnviv = (PFNGLGETTEXENVIVPROC)load("glGetTexEnviv"); + glad_glGetTexGendv = (PFNGLGETTEXGENDVPROC)load("glGetTexGendv"); + glad_glGetTexGenfv = (PFNGLGETTEXGENFVPROC)load("glGetTexGenfv"); + glad_glGetTexGeniv = (PFNGLGETTEXGENIVPROC)load("glGetTexGeniv"); + glad_glIsList = (PFNGLISLISTPROC)load("glIsList"); + glad_glFrustum = (PFNGLFRUSTUMPROC)load("glFrustum"); + glad_glLoadIdentity = (PFNGLLOADIDENTITYPROC)load("glLoadIdentity"); + glad_glLoadMatrixf = (PFNGLLOADMATRIXFPROC)load("glLoadMatrixf"); + glad_glLoadMatrixd = (PFNGLLOADMATRIXDPROC)load("glLoadMatrixd"); + glad_glMatrixMode = (PFNGLMATRIXMODEPROC)load("glMatrixMode"); + glad_glMultMatrixf = (PFNGLMULTMATRIXFPROC)load("glMultMatrixf"); + glad_glMultMatrixd = (PFNGLMULTMATRIXDPROC)load("glMultMatrixd"); + glad_glOrtho = (PFNGLORTHOPROC)load("glOrtho"); + glad_glPopMatrix = (PFNGLPOPMATRIXPROC)load("glPopMatrix"); + glad_glPushMatrix = (PFNGLPUSHMATRIXPROC)load("glPushMatrix"); + glad_glRotated = (PFNGLROTATEDPROC)load("glRotated"); + glad_glRotatef = (PFNGLROTATEFPROC)load("glRotatef"); + glad_glScaled = (PFNGLSCALEDPROC)load("glScaled"); + glad_glScalef = (PFNGLSCALEFPROC)load("glScalef"); + glad_glTranslated = (PFNGLTRANSLATEDPROC)load("glTranslated"); + glad_glTranslatef = (PFNGLTRANSLATEFPROC)load("glTranslatef"); +} +static void load_GL_VERSION_1_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_1) return; + glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); + glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); + glad_glGetPointerv = (PFNGLGETPOINTERVPROC)load("glGetPointerv"); + glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); + glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D"); + glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); + glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D"); + glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); + glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D"); + glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); + glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); + glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); + glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); + glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); + glad_glArrayElement = (PFNGLARRAYELEMENTPROC)load("glArrayElement"); + glad_glColorPointer = (PFNGLCOLORPOINTERPROC)load("glColorPointer"); + glad_glDisableClientState = (PFNGLDISABLECLIENTSTATEPROC)load("glDisableClientState"); + glad_glEdgeFlagPointer = (PFNGLEDGEFLAGPOINTERPROC)load("glEdgeFlagPointer"); + glad_glEnableClientState = (PFNGLENABLECLIENTSTATEPROC)load("glEnableClientState"); + glad_glIndexPointer = (PFNGLINDEXPOINTERPROC)load("glIndexPointer"); + glad_glInterleavedArrays = (PFNGLINTERLEAVEDARRAYSPROC)load("glInterleavedArrays"); + glad_glNormalPointer = (PFNGLNORMALPOINTERPROC)load("glNormalPointer"); + glad_glTexCoordPointer = (PFNGLTEXCOORDPOINTERPROC)load("glTexCoordPointer"); + glad_glVertexPointer = (PFNGLVERTEXPOINTERPROC)load("glVertexPointer"); + glad_glAreTexturesResident = (PFNGLARETEXTURESRESIDENTPROC)load("glAreTexturesResident"); + glad_glPrioritizeTextures = (PFNGLPRIORITIZETEXTURESPROC)load("glPrioritizeTextures"); + glad_glIndexub = (PFNGLINDEXUBPROC)load("glIndexub"); + glad_glIndexubv = (PFNGLINDEXUBVPROC)load("glIndexubv"); + glad_glPopClientAttrib = (PFNGLPOPCLIENTATTRIBPROC)load("glPopClientAttrib"); + glad_glPushClientAttrib = (PFNGLPUSHCLIENTATTRIBPROC)load("glPushClientAttrib"); +} +static void load_GL_VERSION_1_2(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_2) return; + glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements"); + glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D"); + glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D"); + glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D"); +} +static void load_GL_VERSION_1_3(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_3) return; + glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); + glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); + glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D"); + glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); + glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D"); + glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D"); + glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); + glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D"); + glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage"); + glad_glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)load("glClientActiveTexture"); + glad_glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)load("glMultiTexCoord1d"); + glad_glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)load("glMultiTexCoord1dv"); + glad_glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)load("glMultiTexCoord1f"); + glad_glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)load("glMultiTexCoord1fv"); + glad_glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)load("glMultiTexCoord1i"); + glad_glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)load("glMultiTexCoord1iv"); + glad_glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)load("glMultiTexCoord1s"); + glad_glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)load("glMultiTexCoord1sv"); + glad_glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)load("glMultiTexCoord2d"); + glad_glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)load("glMultiTexCoord2dv"); + glad_glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)load("glMultiTexCoord2f"); + glad_glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)load("glMultiTexCoord2fv"); + glad_glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)load("glMultiTexCoord2i"); + glad_glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)load("glMultiTexCoord2iv"); + glad_glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)load("glMultiTexCoord2s"); + glad_glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)load("glMultiTexCoord2sv"); + glad_glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)load("glMultiTexCoord3d"); + glad_glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)load("glMultiTexCoord3dv"); + glad_glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)load("glMultiTexCoord3f"); + glad_glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)load("glMultiTexCoord3fv"); + glad_glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)load("glMultiTexCoord3i"); + glad_glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)load("glMultiTexCoord3iv"); + glad_glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)load("glMultiTexCoord3s"); + glad_glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)load("glMultiTexCoord3sv"); + glad_glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)load("glMultiTexCoord4d"); + glad_glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)load("glMultiTexCoord4dv"); + glad_glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)load("glMultiTexCoord4f"); + glad_glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)load("glMultiTexCoord4fv"); + glad_glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)load("glMultiTexCoord4i"); + glad_glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)load("glMultiTexCoord4iv"); + glad_glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)load("glMultiTexCoord4s"); + glad_glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)load("glMultiTexCoord4sv"); + glad_glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)load("glLoadTransposeMatrixf"); + glad_glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)load("glLoadTransposeMatrixd"); + glad_glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)load("glMultTransposeMatrixf"); + glad_glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)load("glMultTransposeMatrixd"); +} +static void load_GL_VERSION_1_4(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_4) return; + glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); + glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays"); + glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements"); + glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); + glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); + glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri"); + glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv"); + glad_glFogCoordf = (PFNGLFOGCOORDFPROC)load("glFogCoordf"); + glad_glFogCoordfv = (PFNGLFOGCOORDFVPROC)load("glFogCoordfv"); + glad_glFogCoordd = (PFNGLFOGCOORDDPROC)load("glFogCoordd"); + glad_glFogCoorddv = (PFNGLFOGCOORDDVPROC)load("glFogCoorddv"); + glad_glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)load("glFogCoordPointer"); + glad_glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)load("glSecondaryColor3b"); + glad_glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)load("glSecondaryColor3bv"); + glad_glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)load("glSecondaryColor3d"); + glad_glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)load("glSecondaryColor3dv"); + glad_glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)load("glSecondaryColor3f"); + glad_glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)load("glSecondaryColor3fv"); + glad_glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)load("glSecondaryColor3i"); + glad_glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)load("glSecondaryColor3iv"); + glad_glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)load("glSecondaryColor3s"); + glad_glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)load("glSecondaryColor3sv"); + glad_glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)load("glSecondaryColor3ub"); + glad_glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)load("glSecondaryColor3ubv"); + glad_glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)load("glSecondaryColor3ui"); + glad_glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)load("glSecondaryColor3uiv"); + glad_glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)load("glSecondaryColor3us"); + glad_glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)load("glSecondaryColor3usv"); + glad_glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)load("glSecondaryColorPointer"); + glad_glWindowPos2d = (PFNGLWINDOWPOS2DPROC)load("glWindowPos2d"); + glad_glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)load("glWindowPos2dv"); + glad_glWindowPos2f = (PFNGLWINDOWPOS2FPROC)load("glWindowPos2f"); + glad_glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)load("glWindowPos2fv"); + glad_glWindowPos2i = (PFNGLWINDOWPOS2IPROC)load("glWindowPos2i"); + glad_glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)load("glWindowPos2iv"); + glad_glWindowPos2s = (PFNGLWINDOWPOS2SPROC)load("glWindowPos2s"); + glad_glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)load("glWindowPos2sv"); + glad_glWindowPos3d = (PFNGLWINDOWPOS3DPROC)load("glWindowPos3d"); + glad_glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)load("glWindowPos3dv"); + glad_glWindowPos3f = (PFNGLWINDOWPOS3FPROC)load("glWindowPos3f"); + glad_glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)load("glWindowPos3fv"); + glad_glWindowPos3i = (PFNGLWINDOWPOS3IPROC)load("glWindowPos3i"); + glad_glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)load("glWindowPos3iv"); + glad_glWindowPos3s = (PFNGLWINDOWPOS3SPROC)load("glWindowPos3s"); + glad_glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)load("glWindowPos3sv"); + glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); + glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); +} +static void load_GL_VERSION_1_5(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_5) return; + glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries"); + glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries"); + glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery"); + glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery"); + glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery"); + glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv"); + glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv"); + glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv"); + glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); + glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); + glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); + glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); + glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); + glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); + glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData"); + glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer"); + glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer"); + glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); + glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv"); +} +static void load_GL_VERSION_2_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_2_0) return; + glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); + glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers"); + glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); + glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); + glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); + glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); + glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); + glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); + glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); + glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); + glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); + glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); + glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); + glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); + glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); + glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); + glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); + glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); + glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); + glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); + glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); + glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); + glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); + glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); + glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); + glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); + glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); + glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv"); + glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); + glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); + glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); + glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); + glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); + glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); + glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); + glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); + glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); + glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); + glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); + glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); + glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); + glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); + glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); + glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); + glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); + glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); + glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); + glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); + glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); + glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); + glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); + glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); + glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); + glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); + glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); + glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); + glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d"); + glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv"); + glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); + glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); + glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s"); + glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv"); + glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d"); + glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv"); + glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); + glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); + glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s"); + glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv"); + glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d"); + glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv"); + glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); + glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); + glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s"); + glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv"); + glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv"); + glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv"); + glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv"); + glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub"); + glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv"); + glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv"); + glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv"); + glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv"); + glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d"); + glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv"); + glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); + glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); + glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv"); + glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s"); + glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv"); + glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv"); + glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv"); + glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv"); + glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); +} +static int find_extensionsGL(void) { + if (!get_exts()) return 0; + (void)&has_ext; + free_exts(); + return 1; +} + +static void find_coreGL(void) { + + /* Thank you @elmindreda + * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176 + * https://github.com/glfw/glfw/blob/master/src/context.c#L36 + */ + int i, major, minor; + + const char* version; + const char* prefixes[] = { + "OpenGL ES-CM ", + "OpenGL ES-CL ", + "OpenGL ES ", + NULL + }; + + version = (const char*) glGetString(GL_VERSION); + if (!version) return; + + for (i = 0; prefixes[i]; i++) { + const size_t length = strlen(prefixes[i]); + if (strncmp(version, prefixes[i], length) == 0) { + version += length; + break; + } + } + +/* PR #18 */ +#ifdef _MSC_VER + sscanf_s(version, "%d.%d", &major, &minor); +#else + sscanf(version, "%d.%d", &major, &minor); +#endif + + GLVersion.major = major; GLVersion.minor = minor; + max_loaded_major = major; max_loaded_minor = minor; + GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; + GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1; + GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1; + GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1; + GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1; + GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1; + GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; + if (GLVersion.major > 2 || (GLVersion.major >= 2 && GLVersion.minor >= 0)) { + max_loaded_major = 2; + max_loaded_minor = 0; + } +} + +int gladLoadGLLoader(GLADloadproc load) { + GLVersion.major = 0; GLVersion.minor = 0; + glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + if(glGetString == NULL) return 0; + if(glGetString(GL_VERSION) == NULL) return 0; + find_coreGL(); + load_GL_VERSION_1_0(load); + load_GL_VERSION_1_1(load); + load_GL_VERSION_1_2(load); + load_GL_VERSION_1_3(load); + load_GL_VERSION_1_4(load); + load_GL_VERSION_1_5(load); + load_GL_VERSION_2_0(load); + + if (!find_extensionsGL()) return 0; + return GLVersion.major != 0 || GLVersion.minor != 0; +} + diff --git a/tcod_sys/libtcod/src/vendor/glad.h b/tcod_sys/libtcod/src/vendor/glad.h new file mode 100644 index 000000000..19f7a4306 --- /dev/null +++ b/tcod_sys/libtcod/src/vendor/glad.h @@ -0,0 +1,2656 @@ +/* + + OpenGL loader generated by glad 0.1.28 on Mon Nov 19 11:18:35 2018. + + Language/Generator: C/C++ + Specification: gl + APIs: gl=2.0 + Profile: compatibility + Extensions: + + Loader: False + Local files: True + Omit khrplatform: False + Reproducible: False + + Commandline: + --profile="compatibility" --api="gl=2.0" --generator="c" --spec="gl" --no-loader --local-files --extensions="" + Online: + https://glad.dav1d.de/#profile=compatibility&language=c&specification=gl&api=gl%3D2.0 +*/ + + +#ifndef __glad_h_ +#define __glad_h_ + +#ifdef __gl_h_ +#error OpenGL header already included, remove this include, glad already provides it +#endif +#define __gl_h_ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#ifndef NOMINMAX +#define NOMINMAX 1 +#endif +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY APIENTRY +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +struct gladGLversionStruct { + int major; + int minor; +}; + +typedef void* (* GLADloadproc)(const char *name); + +#ifndef GLAPI +# if defined(GLAD_GLAPI_EXPORT) +# if defined(_WIN32) || defined(__CYGWIN__) +# if defined(GLAD_GLAPI_EXPORT_BUILD) +# if defined(__GNUC__) +# define GLAPI __attribute__ ((dllexport)) extern +# else +# define GLAPI __declspec(dllexport) extern +# endif +# else +# if defined(__GNUC__) +# define GLAPI __attribute__ ((dllimport)) extern +# else +# define GLAPI __declspec(dllimport) extern +# endif +# endif +# elif defined(__GNUC__) && defined(GLAD_GLAPI_EXPORT_BUILD) +# define GLAPI __attribute__ ((visibility ("default"))) extern +# else +# define GLAPI extern +# endif +# else +# define GLAPI extern +# endif +#endif + +GLAPI struct gladGLversionStruct GLVersion; +GLAPI int gladLoadGLLoader(GLADloadproc); + +#include "khrplatform.h" +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef void GLvoid; +typedef khronos_int8_t GLbyte; +typedef khronos_uint8_t GLubyte; +typedef khronos_int16_t GLshort; +typedef khronos_uint16_t GLushort; +typedef int GLint; +typedef unsigned int GLuint; +typedef khronos_int32_t GLclampx; +typedef int GLsizei; +typedef khronos_float_t GLfloat; +typedef khronos_float_t GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void *GLeglClientBufferEXT; +typedef void *GLeglImageOES; +typedef char GLchar; +typedef char GLcharARB; +#ifdef __APPLE__ +typedef void *GLhandleARB; +#else +typedef unsigned int GLhandleARB; +#endif +typedef khronos_uint16_t GLhalf; +typedef khronos_uint16_t GLhalfARB; +typedef khronos_int32_t GLfixed; +typedef khronos_intptr_t GLintptr; +typedef khronos_intptr_t GLintptrARB; +typedef khronos_ssize_t GLsizeiptr; +typedef khronos_ssize_t GLsizeiptrARB; +typedef khronos_int64_t GLint64; +typedef khronos_int64_t GLint64EXT; +typedef khronos_uint64_t GLuint64; +typedef khronos_uint64_t GLuint64EXT; +typedef struct __GLsync *GLsync; +struct _cl_context; +struct _cl_event; +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); +typedef unsigned short GLhalfNV; +typedef GLintptr GLvdpauSurfaceNV; +typedef void (APIENTRY *GLVULKANPROCNV)(void); +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_FALSE 0 +#define GL_TRUE 1 +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_NONE 0 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_VIEWPORT 0x0BA2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_REPEAT 0x2901 +#define GL_CURRENT_BIT 0x00000001 +#define GL_POINT_BIT 0x00000002 +#define GL_LINE_BIT 0x00000004 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_HINT_BIT 0x00008000 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON 0x0009 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_LOGIC_OP 0x0BF1 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_COLOR_INDEX 0x1900 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_S 0x2000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_CLAMP 0x2900 +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_DOUBLE 0x140A +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_R3_G3_B2 0x2A10 +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_RESCALE_NORMAL 0x803A +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#define GL_BLEND_COLOR 0x8005 +#define GL_BLEND_EQUATION 0x8009 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_FUNC_SUBTRACT 0x800A +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_SRC1_ALPHA 0x8589 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_FOG_COORD_SRC 0x8450 +#define GL_FOG_COORD 0x8451 +#define GL_CURRENT_FOG_COORD 0x8453 +#define GL_FOG_COORD_ARRAY_TYPE 0x8454 +#define GL_FOG_COORD_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORD_ARRAY_POINTER 0x8456 +#define GL_FOG_COORD_ARRAY 0x8457 +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC2_ALPHA 0x858A +#define GL_BLEND_EQUATION_RGB 0x8009 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_TEXTURE_COORDS 0x8871 +#ifndef GL_VERSION_1_0 +#define GL_VERSION_1_0 1 +GLAPI int GLAD_GL_VERSION_1_0; +typedef void (APIENTRYP PFNGLCULLFACEPROC)(GLenum mode); +GLAPI PFNGLCULLFACEPROC glad_glCullFace; +#define glCullFace glad_glCullFace +typedef void (APIENTRYP PFNGLFRONTFACEPROC)(GLenum mode); +GLAPI PFNGLFRONTFACEPROC glad_glFrontFace; +#define glFrontFace glad_glFrontFace +typedef void (APIENTRYP PFNGLHINTPROC)(GLenum target, GLenum mode); +GLAPI PFNGLHINTPROC glad_glHint; +#define glHint glad_glHint +typedef void (APIENTRYP PFNGLLINEWIDTHPROC)(GLfloat width); +GLAPI PFNGLLINEWIDTHPROC glad_glLineWidth; +#define glLineWidth glad_glLineWidth +typedef void (APIENTRYP PFNGLPOINTSIZEPROC)(GLfloat size); +GLAPI PFNGLPOINTSIZEPROC glad_glPointSize; +#define glPointSize glad_glPointSize +typedef void (APIENTRYP PFNGLPOLYGONMODEPROC)(GLenum face, GLenum mode); +GLAPI PFNGLPOLYGONMODEPROC glad_glPolygonMode; +#define glPolygonMode glad_glPolygonMode +typedef void (APIENTRYP PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLSCISSORPROC glad_glScissor; +#define glScissor glad_glScissor +typedef void (APIENTRYP PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLTEXPARAMETERFPROC glad_glTexParameterf; +#define glTexParameterf glad_glTexParameterf +typedef void (APIENTRYP PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat *params); +GLAPI PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; +#define glTexParameterfv glad_glTexParameterfv +typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param); +GLAPI PFNGLTEXPARAMETERIPROC glad_glTexParameteri; +#define glTexParameteri glad_glTexParameteri +typedef void (APIENTRYP PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint *params); +GLAPI PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; +#define glTexParameteriv glad_glTexParameteriv +typedef void (APIENTRYP PFNGLTEXIMAGE1DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXIMAGE1DPROC glad_glTexImage1D; +#define glTexImage1D glad_glTexImage1D +typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXIMAGE2DPROC glad_glTexImage2D; +#define glTexImage2D glad_glTexImage2D +typedef void (APIENTRYP PFNGLDRAWBUFFERPROC)(GLenum buf); +GLAPI PFNGLDRAWBUFFERPROC glad_glDrawBuffer; +#define glDrawBuffer glad_glDrawBuffer +typedef void (APIENTRYP PFNGLCLEARPROC)(GLbitfield mask); +GLAPI PFNGLCLEARPROC glad_glClear; +#define glClear glad_glClear +typedef void (APIENTRYP PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLCLEARCOLORPROC glad_glClearColor; +#define glClearColor glad_glClearColor +typedef void (APIENTRYP PFNGLCLEARSTENCILPROC)(GLint s); +GLAPI PFNGLCLEARSTENCILPROC glad_glClearStencil; +#define glClearStencil glad_glClearStencil +typedef void (APIENTRYP PFNGLCLEARDEPTHPROC)(GLdouble depth); +GLAPI PFNGLCLEARDEPTHPROC glad_glClearDepth; +#define glClearDepth glad_glClearDepth +typedef void (APIENTRYP PFNGLSTENCILMASKPROC)(GLuint mask); +GLAPI PFNGLSTENCILMASKPROC glad_glStencilMask; +#define glStencilMask glad_glStencilMask +typedef void (APIENTRYP PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI PFNGLCOLORMASKPROC glad_glColorMask; +#define glColorMask glad_glColorMask +typedef void (APIENTRYP PFNGLDEPTHMASKPROC)(GLboolean flag); +GLAPI PFNGLDEPTHMASKPROC glad_glDepthMask; +#define glDepthMask glad_glDepthMask +typedef void (APIENTRYP PFNGLDISABLEPROC)(GLenum cap); +GLAPI PFNGLDISABLEPROC glad_glDisable; +#define glDisable glad_glDisable +typedef void (APIENTRYP PFNGLENABLEPROC)(GLenum cap); +GLAPI PFNGLENABLEPROC glad_glEnable; +#define glEnable glad_glEnable +typedef void (APIENTRYP PFNGLFINISHPROC)(void); +GLAPI PFNGLFINISHPROC glad_glFinish; +#define glFinish glad_glFinish +typedef void (APIENTRYP PFNGLFLUSHPROC)(void); +GLAPI PFNGLFLUSHPROC glad_glFlush; +#define glFlush glad_glFlush +typedef void (APIENTRYP PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor); +GLAPI PFNGLBLENDFUNCPROC glad_glBlendFunc; +#define glBlendFunc glad_glBlendFunc +typedef void (APIENTRYP PFNGLLOGICOPPROC)(GLenum opcode); +GLAPI PFNGLLOGICOPPROC glad_glLogicOp; +#define glLogicOp glad_glLogicOp +typedef void (APIENTRYP PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask); +GLAPI PFNGLSTENCILFUNCPROC glad_glStencilFunc; +#define glStencilFunc glad_glStencilFunc +typedef void (APIENTRYP PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass); +GLAPI PFNGLSTENCILOPPROC glad_glStencilOp; +#define glStencilOp glad_glStencilOp +typedef void (APIENTRYP PFNGLDEPTHFUNCPROC)(GLenum func); +GLAPI PFNGLDEPTHFUNCPROC glad_glDepthFunc; +#define glDepthFunc glad_glDepthFunc +typedef void (APIENTRYP PFNGLPIXELSTOREFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPIXELSTOREFPROC glad_glPixelStoref; +#define glPixelStoref glad_glPixelStoref +typedef void (APIENTRYP PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param); +GLAPI PFNGLPIXELSTOREIPROC glad_glPixelStorei; +#define glPixelStorei glad_glPixelStorei +typedef void (APIENTRYP PFNGLREADBUFFERPROC)(GLenum src); +GLAPI PFNGLREADBUFFERPROC glad_glReadBuffer; +#define glReadBuffer glad_glReadBuffer +typedef void (APIENTRYP PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); +GLAPI PFNGLREADPIXELSPROC glad_glReadPixels; +#define glReadPixels glad_glReadPixels +typedef void (APIENTRYP PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean *data); +GLAPI PFNGLGETBOOLEANVPROC glad_glGetBooleanv; +#define glGetBooleanv glad_glGetBooleanv +typedef void (APIENTRYP PFNGLGETDOUBLEVPROC)(GLenum pname, GLdouble *data); +GLAPI PFNGLGETDOUBLEVPROC glad_glGetDoublev; +#define glGetDoublev glad_glGetDoublev +typedef GLenum (APIENTRYP PFNGLGETERRORPROC)(void); +GLAPI PFNGLGETERRORPROC glad_glGetError; +#define glGetError glad_glGetError +typedef void (APIENTRYP PFNGLGETFLOATVPROC)(GLenum pname, GLfloat *data); +GLAPI PFNGLGETFLOATVPROC glad_glGetFloatv; +#define glGetFloatv glad_glGetFloatv +typedef void (APIENTRYP PFNGLGETINTEGERVPROC)(GLenum pname, GLint *data); +GLAPI PFNGLGETINTEGERVPROC glad_glGetIntegerv; +#define glGetIntegerv glad_glGetIntegerv +typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGPROC)(GLenum name); +GLAPI PFNGLGETSTRINGPROC glad_glGetString; +#define glGetString glad_glGetString +typedef void (APIENTRYP PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI PFNGLGETTEXIMAGEPROC glad_glGetTexImage; +#define glGetTexImage glad_glGetTexImage +typedef void (APIENTRYP PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; +#define glGetTexParameterfv glad_glGetTexParameterfv +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; +#define glGetTexParameteriv glad_glGetTexParameteriv +typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERFVPROC)(GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; +#define glGetTexLevelParameterfv glad_glGetTexLevelParameterfv +typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERIVPROC)(GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; +#define glGetTexLevelParameteriv glad_glGetTexLevelParameteriv +typedef GLboolean (APIENTRYP PFNGLISENABLEDPROC)(GLenum cap); +GLAPI PFNGLISENABLEDPROC glad_glIsEnabled; +#define glIsEnabled glad_glIsEnabled +typedef void (APIENTRYP PFNGLDEPTHRANGEPROC)(GLdouble n, GLdouble f); +GLAPI PFNGLDEPTHRANGEPROC glad_glDepthRange; +#define glDepthRange glad_glDepthRange +typedef void (APIENTRYP PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLVIEWPORTPROC glad_glViewport; +#define glViewport glad_glViewport +typedef void (APIENTRYP PFNGLNEWLISTPROC)(GLuint list, GLenum mode); +GLAPI PFNGLNEWLISTPROC glad_glNewList; +#define glNewList glad_glNewList +typedef void (APIENTRYP PFNGLENDLISTPROC)(void); +GLAPI PFNGLENDLISTPROC glad_glEndList; +#define glEndList glad_glEndList +typedef void (APIENTRYP PFNGLCALLLISTPROC)(GLuint list); +GLAPI PFNGLCALLLISTPROC glad_glCallList; +#define glCallList glad_glCallList +typedef void (APIENTRYP PFNGLCALLLISTSPROC)(GLsizei n, GLenum type, const void *lists); +GLAPI PFNGLCALLLISTSPROC glad_glCallLists; +#define glCallLists glad_glCallLists +typedef void (APIENTRYP PFNGLDELETELISTSPROC)(GLuint list, GLsizei range); +GLAPI PFNGLDELETELISTSPROC glad_glDeleteLists; +#define glDeleteLists glad_glDeleteLists +typedef GLuint (APIENTRYP PFNGLGENLISTSPROC)(GLsizei range); +GLAPI PFNGLGENLISTSPROC glad_glGenLists; +#define glGenLists glad_glGenLists +typedef void (APIENTRYP PFNGLLISTBASEPROC)(GLuint base); +GLAPI PFNGLLISTBASEPROC glad_glListBase; +#define glListBase glad_glListBase +typedef void (APIENTRYP PFNGLBEGINPROC)(GLenum mode); +GLAPI PFNGLBEGINPROC glad_glBegin; +#define glBegin glad_glBegin +typedef void (APIENTRYP PFNGLBITMAPPROC)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI PFNGLBITMAPPROC glad_glBitmap; +#define glBitmap glad_glBitmap +typedef void (APIENTRYP PFNGLCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue); +GLAPI PFNGLCOLOR3BPROC glad_glColor3b; +#define glColor3b glad_glColor3b +typedef void (APIENTRYP PFNGLCOLOR3BVPROC)(const GLbyte *v); +GLAPI PFNGLCOLOR3BVPROC glad_glColor3bv; +#define glColor3bv glad_glColor3bv +typedef void (APIENTRYP PFNGLCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue); +GLAPI PFNGLCOLOR3DPROC glad_glColor3d; +#define glColor3d glad_glColor3d +typedef void (APIENTRYP PFNGLCOLOR3DVPROC)(const GLdouble *v); +GLAPI PFNGLCOLOR3DVPROC glad_glColor3dv; +#define glColor3dv glad_glColor3dv +typedef void (APIENTRYP PFNGLCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue); +GLAPI PFNGLCOLOR3FPROC glad_glColor3f; +#define glColor3f glad_glColor3f +typedef void (APIENTRYP PFNGLCOLOR3FVPROC)(const GLfloat *v); +GLAPI PFNGLCOLOR3FVPROC glad_glColor3fv; +#define glColor3fv glad_glColor3fv +typedef void (APIENTRYP PFNGLCOLOR3IPROC)(GLint red, GLint green, GLint blue); +GLAPI PFNGLCOLOR3IPROC glad_glColor3i; +#define glColor3i glad_glColor3i +typedef void (APIENTRYP PFNGLCOLOR3IVPROC)(const GLint *v); +GLAPI PFNGLCOLOR3IVPROC glad_glColor3iv; +#define glColor3iv glad_glColor3iv +typedef void (APIENTRYP PFNGLCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue); +GLAPI PFNGLCOLOR3SPROC glad_glColor3s; +#define glColor3s glad_glColor3s +typedef void (APIENTRYP PFNGLCOLOR3SVPROC)(const GLshort *v); +GLAPI PFNGLCOLOR3SVPROC glad_glColor3sv; +#define glColor3sv glad_glColor3sv +typedef void (APIENTRYP PFNGLCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue); +GLAPI PFNGLCOLOR3UBPROC glad_glColor3ub; +#define glColor3ub glad_glColor3ub +typedef void (APIENTRYP PFNGLCOLOR3UBVPROC)(const GLubyte *v); +GLAPI PFNGLCOLOR3UBVPROC glad_glColor3ubv; +#define glColor3ubv glad_glColor3ubv +typedef void (APIENTRYP PFNGLCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue); +GLAPI PFNGLCOLOR3UIPROC glad_glColor3ui; +#define glColor3ui glad_glColor3ui +typedef void (APIENTRYP PFNGLCOLOR3UIVPROC)(const GLuint *v); +GLAPI PFNGLCOLOR3UIVPROC glad_glColor3uiv; +#define glColor3uiv glad_glColor3uiv +typedef void (APIENTRYP PFNGLCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue); +GLAPI PFNGLCOLOR3USPROC glad_glColor3us; +#define glColor3us glad_glColor3us +typedef void (APIENTRYP PFNGLCOLOR3USVPROC)(const GLushort *v); +GLAPI PFNGLCOLOR3USVPROC glad_glColor3usv; +#define glColor3usv glad_glColor3usv +typedef void (APIENTRYP PFNGLCOLOR4BPROC)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI PFNGLCOLOR4BPROC glad_glColor4b; +#define glColor4b glad_glColor4b +typedef void (APIENTRYP PFNGLCOLOR4BVPROC)(const GLbyte *v); +GLAPI PFNGLCOLOR4BVPROC glad_glColor4bv; +#define glColor4bv glad_glColor4bv +typedef void (APIENTRYP PFNGLCOLOR4DPROC)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI PFNGLCOLOR4DPROC glad_glColor4d; +#define glColor4d glad_glColor4d +typedef void (APIENTRYP PFNGLCOLOR4DVPROC)(const GLdouble *v); +GLAPI PFNGLCOLOR4DVPROC glad_glColor4dv; +#define glColor4dv glad_glColor4dv +typedef void (APIENTRYP PFNGLCOLOR4FPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLCOLOR4FPROC glad_glColor4f; +#define glColor4f glad_glColor4f +typedef void (APIENTRYP PFNGLCOLOR4FVPROC)(const GLfloat *v); +GLAPI PFNGLCOLOR4FVPROC glad_glColor4fv; +#define glColor4fv glad_glColor4fv +typedef void (APIENTRYP PFNGLCOLOR4IPROC)(GLint red, GLint green, GLint blue, GLint alpha); +GLAPI PFNGLCOLOR4IPROC glad_glColor4i; +#define glColor4i glad_glColor4i +typedef void (APIENTRYP PFNGLCOLOR4IVPROC)(const GLint *v); +GLAPI PFNGLCOLOR4IVPROC glad_glColor4iv; +#define glColor4iv glad_glColor4iv +typedef void (APIENTRYP PFNGLCOLOR4SPROC)(GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI PFNGLCOLOR4SPROC glad_glColor4s; +#define glColor4s glad_glColor4s +typedef void (APIENTRYP PFNGLCOLOR4SVPROC)(const GLshort *v); +GLAPI PFNGLCOLOR4SVPROC glad_glColor4sv; +#define glColor4sv glad_glColor4sv +typedef void (APIENTRYP PFNGLCOLOR4UBPROC)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI PFNGLCOLOR4UBPROC glad_glColor4ub; +#define glColor4ub glad_glColor4ub +typedef void (APIENTRYP PFNGLCOLOR4UBVPROC)(const GLubyte *v); +GLAPI PFNGLCOLOR4UBVPROC glad_glColor4ubv; +#define glColor4ubv glad_glColor4ubv +typedef void (APIENTRYP PFNGLCOLOR4UIPROC)(GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI PFNGLCOLOR4UIPROC glad_glColor4ui; +#define glColor4ui glad_glColor4ui +typedef void (APIENTRYP PFNGLCOLOR4UIVPROC)(const GLuint *v); +GLAPI PFNGLCOLOR4UIVPROC glad_glColor4uiv; +#define glColor4uiv glad_glColor4uiv +typedef void (APIENTRYP PFNGLCOLOR4USPROC)(GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI PFNGLCOLOR4USPROC glad_glColor4us; +#define glColor4us glad_glColor4us +typedef void (APIENTRYP PFNGLCOLOR4USVPROC)(const GLushort *v); +GLAPI PFNGLCOLOR4USVPROC glad_glColor4usv; +#define glColor4usv glad_glColor4usv +typedef void (APIENTRYP PFNGLEDGEFLAGPROC)(GLboolean flag); +GLAPI PFNGLEDGEFLAGPROC glad_glEdgeFlag; +#define glEdgeFlag glad_glEdgeFlag +typedef void (APIENTRYP PFNGLEDGEFLAGVPROC)(const GLboolean *flag); +GLAPI PFNGLEDGEFLAGVPROC glad_glEdgeFlagv; +#define glEdgeFlagv glad_glEdgeFlagv +typedef void (APIENTRYP PFNGLENDPROC)(void); +GLAPI PFNGLENDPROC glad_glEnd; +#define glEnd glad_glEnd +typedef void (APIENTRYP PFNGLINDEXDPROC)(GLdouble c); +GLAPI PFNGLINDEXDPROC glad_glIndexd; +#define glIndexd glad_glIndexd +typedef void (APIENTRYP PFNGLINDEXDVPROC)(const GLdouble *c); +GLAPI PFNGLINDEXDVPROC glad_glIndexdv; +#define glIndexdv glad_glIndexdv +typedef void (APIENTRYP PFNGLINDEXFPROC)(GLfloat c); +GLAPI PFNGLINDEXFPROC glad_glIndexf; +#define glIndexf glad_glIndexf +typedef void (APIENTRYP PFNGLINDEXFVPROC)(const GLfloat *c); +GLAPI PFNGLINDEXFVPROC glad_glIndexfv; +#define glIndexfv glad_glIndexfv +typedef void (APIENTRYP PFNGLINDEXIPROC)(GLint c); +GLAPI PFNGLINDEXIPROC glad_glIndexi; +#define glIndexi glad_glIndexi +typedef void (APIENTRYP PFNGLINDEXIVPROC)(const GLint *c); +GLAPI PFNGLINDEXIVPROC glad_glIndexiv; +#define glIndexiv glad_glIndexiv +typedef void (APIENTRYP PFNGLINDEXSPROC)(GLshort c); +GLAPI PFNGLINDEXSPROC glad_glIndexs; +#define glIndexs glad_glIndexs +typedef void (APIENTRYP PFNGLINDEXSVPROC)(const GLshort *c); +GLAPI PFNGLINDEXSVPROC glad_glIndexsv; +#define glIndexsv glad_glIndexsv +typedef void (APIENTRYP PFNGLNORMAL3BPROC)(GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI PFNGLNORMAL3BPROC glad_glNormal3b; +#define glNormal3b glad_glNormal3b +typedef void (APIENTRYP PFNGLNORMAL3BVPROC)(const GLbyte *v); +GLAPI PFNGLNORMAL3BVPROC glad_glNormal3bv; +#define glNormal3bv glad_glNormal3bv +typedef void (APIENTRYP PFNGLNORMAL3DPROC)(GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI PFNGLNORMAL3DPROC glad_glNormal3d; +#define glNormal3d glad_glNormal3d +typedef void (APIENTRYP PFNGLNORMAL3DVPROC)(const GLdouble *v); +GLAPI PFNGLNORMAL3DVPROC glad_glNormal3dv; +#define glNormal3dv glad_glNormal3dv +typedef void (APIENTRYP PFNGLNORMAL3FPROC)(GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI PFNGLNORMAL3FPROC glad_glNormal3f; +#define glNormal3f glad_glNormal3f +typedef void (APIENTRYP PFNGLNORMAL3FVPROC)(const GLfloat *v); +GLAPI PFNGLNORMAL3FVPROC glad_glNormal3fv; +#define glNormal3fv glad_glNormal3fv +typedef void (APIENTRYP PFNGLNORMAL3IPROC)(GLint nx, GLint ny, GLint nz); +GLAPI PFNGLNORMAL3IPROC glad_glNormal3i; +#define glNormal3i glad_glNormal3i +typedef void (APIENTRYP PFNGLNORMAL3IVPROC)(const GLint *v); +GLAPI PFNGLNORMAL3IVPROC glad_glNormal3iv; +#define glNormal3iv glad_glNormal3iv +typedef void (APIENTRYP PFNGLNORMAL3SPROC)(GLshort nx, GLshort ny, GLshort nz); +GLAPI PFNGLNORMAL3SPROC glad_glNormal3s; +#define glNormal3s glad_glNormal3s +typedef void (APIENTRYP PFNGLNORMAL3SVPROC)(const GLshort *v); +GLAPI PFNGLNORMAL3SVPROC glad_glNormal3sv; +#define glNormal3sv glad_glNormal3sv +typedef void (APIENTRYP PFNGLRASTERPOS2DPROC)(GLdouble x, GLdouble y); +GLAPI PFNGLRASTERPOS2DPROC glad_glRasterPos2d; +#define glRasterPos2d glad_glRasterPos2d +typedef void (APIENTRYP PFNGLRASTERPOS2DVPROC)(const GLdouble *v); +GLAPI PFNGLRASTERPOS2DVPROC glad_glRasterPos2dv; +#define glRasterPos2dv glad_glRasterPos2dv +typedef void (APIENTRYP PFNGLRASTERPOS2FPROC)(GLfloat x, GLfloat y); +GLAPI PFNGLRASTERPOS2FPROC glad_glRasterPos2f; +#define glRasterPos2f glad_glRasterPos2f +typedef void (APIENTRYP PFNGLRASTERPOS2FVPROC)(const GLfloat *v); +GLAPI PFNGLRASTERPOS2FVPROC glad_glRasterPos2fv; +#define glRasterPos2fv glad_glRasterPos2fv +typedef void (APIENTRYP PFNGLRASTERPOS2IPROC)(GLint x, GLint y); +GLAPI PFNGLRASTERPOS2IPROC glad_glRasterPos2i; +#define glRasterPos2i glad_glRasterPos2i +typedef void (APIENTRYP PFNGLRASTERPOS2IVPROC)(const GLint *v); +GLAPI PFNGLRASTERPOS2IVPROC glad_glRasterPos2iv; +#define glRasterPos2iv glad_glRasterPos2iv +typedef void (APIENTRYP PFNGLRASTERPOS2SPROC)(GLshort x, GLshort y); +GLAPI PFNGLRASTERPOS2SPROC glad_glRasterPos2s; +#define glRasterPos2s glad_glRasterPos2s +typedef void (APIENTRYP PFNGLRASTERPOS2SVPROC)(const GLshort *v); +GLAPI PFNGLRASTERPOS2SVPROC glad_glRasterPos2sv; +#define glRasterPos2sv glad_glRasterPos2sv +typedef void (APIENTRYP PFNGLRASTERPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLRASTERPOS3DPROC glad_glRasterPos3d; +#define glRasterPos3d glad_glRasterPos3d +typedef void (APIENTRYP PFNGLRASTERPOS3DVPROC)(const GLdouble *v); +GLAPI PFNGLRASTERPOS3DVPROC glad_glRasterPos3dv; +#define glRasterPos3dv glad_glRasterPos3dv +typedef void (APIENTRYP PFNGLRASTERPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLRASTERPOS3FPROC glad_glRasterPos3f; +#define glRasterPos3f glad_glRasterPos3f +typedef void (APIENTRYP PFNGLRASTERPOS3FVPROC)(const GLfloat *v); +GLAPI PFNGLRASTERPOS3FVPROC glad_glRasterPos3fv; +#define glRasterPos3fv glad_glRasterPos3fv +typedef void (APIENTRYP PFNGLRASTERPOS3IPROC)(GLint x, GLint y, GLint z); +GLAPI PFNGLRASTERPOS3IPROC glad_glRasterPos3i; +#define glRasterPos3i glad_glRasterPos3i +typedef void (APIENTRYP PFNGLRASTERPOS3IVPROC)(const GLint *v); +GLAPI PFNGLRASTERPOS3IVPROC glad_glRasterPos3iv; +#define glRasterPos3iv glad_glRasterPos3iv +typedef void (APIENTRYP PFNGLRASTERPOS3SPROC)(GLshort x, GLshort y, GLshort z); +GLAPI PFNGLRASTERPOS3SPROC glad_glRasterPos3s; +#define glRasterPos3s glad_glRasterPos3s +typedef void (APIENTRYP PFNGLRASTERPOS3SVPROC)(const GLshort *v); +GLAPI PFNGLRASTERPOS3SVPROC glad_glRasterPos3sv; +#define glRasterPos3sv glad_glRasterPos3sv +typedef void (APIENTRYP PFNGLRASTERPOS4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLRASTERPOS4DPROC glad_glRasterPos4d; +#define glRasterPos4d glad_glRasterPos4d +typedef void (APIENTRYP PFNGLRASTERPOS4DVPROC)(const GLdouble *v); +GLAPI PFNGLRASTERPOS4DVPROC glad_glRasterPos4dv; +#define glRasterPos4dv glad_glRasterPos4dv +typedef void (APIENTRYP PFNGLRASTERPOS4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLRASTERPOS4FPROC glad_glRasterPos4f; +#define glRasterPos4f glad_glRasterPos4f +typedef void (APIENTRYP PFNGLRASTERPOS4FVPROC)(const GLfloat *v); +GLAPI PFNGLRASTERPOS4FVPROC glad_glRasterPos4fv; +#define glRasterPos4fv glad_glRasterPos4fv +typedef void (APIENTRYP PFNGLRASTERPOS4IPROC)(GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLRASTERPOS4IPROC glad_glRasterPos4i; +#define glRasterPos4i glad_glRasterPos4i +typedef void (APIENTRYP PFNGLRASTERPOS4IVPROC)(const GLint *v); +GLAPI PFNGLRASTERPOS4IVPROC glad_glRasterPos4iv; +#define glRasterPos4iv glad_glRasterPos4iv +typedef void (APIENTRYP PFNGLRASTERPOS4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLRASTERPOS4SPROC glad_glRasterPos4s; +#define glRasterPos4s glad_glRasterPos4s +typedef void (APIENTRYP PFNGLRASTERPOS4SVPROC)(const GLshort *v); +GLAPI PFNGLRASTERPOS4SVPROC glad_glRasterPos4sv; +#define glRasterPos4sv glad_glRasterPos4sv +typedef void (APIENTRYP PFNGLRECTDPROC)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI PFNGLRECTDPROC glad_glRectd; +#define glRectd glad_glRectd +typedef void (APIENTRYP PFNGLRECTDVPROC)(const GLdouble *v1, const GLdouble *v2); +GLAPI PFNGLRECTDVPROC glad_glRectdv; +#define glRectdv glad_glRectdv +typedef void (APIENTRYP PFNGLRECTFPROC)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI PFNGLRECTFPROC glad_glRectf; +#define glRectf glad_glRectf +typedef void (APIENTRYP PFNGLRECTFVPROC)(const GLfloat *v1, const GLfloat *v2); +GLAPI PFNGLRECTFVPROC glad_glRectfv; +#define glRectfv glad_glRectfv +typedef void (APIENTRYP PFNGLRECTIPROC)(GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI PFNGLRECTIPROC glad_glRecti; +#define glRecti glad_glRecti +typedef void (APIENTRYP PFNGLRECTIVPROC)(const GLint *v1, const GLint *v2); +GLAPI PFNGLRECTIVPROC glad_glRectiv; +#define glRectiv glad_glRectiv +typedef void (APIENTRYP PFNGLRECTSPROC)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI PFNGLRECTSPROC glad_glRects; +#define glRects glad_glRects +typedef void (APIENTRYP PFNGLRECTSVPROC)(const GLshort *v1, const GLshort *v2); +GLAPI PFNGLRECTSVPROC glad_glRectsv; +#define glRectsv glad_glRectsv +typedef void (APIENTRYP PFNGLTEXCOORD1DPROC)(GLdouble s); +GLAPI PFNGLTEXCOORD1DPROC glad_glTexCoord1d; +#define glTexCoord1d glad_glTexCoord1d +typedef void (APIENTRYP PFNGLTEXCOORD1DVPROC)(const GLdouble *v); +GLAPI PFNGLTEXCOORD1DVPROC glad_glTexCoord1dv; +#define glTexCoord1dv glad_glTexCoord1dv +typedef void (APIENTRYP PFNGLTEXCOORD1FPROC)(GLfloat s); +GLAPI PFNGLTEXCOORD1FPROC glad_glTexCoord1f; +#define glTexCoord1f glad_glTexCoord1f +typedef void (APIENTRYP PFNGLTEXCOORD1FVPROC)(const GLfloat *v); +GLAPI PFNGLTEXCOORD1FVPROC glad_glTexCoord1fv; +#define glTexCoord1fv glad_glTexCoord1fv +typedef void (APIENTRYP PFNGLTEXCOORD1IPROC)(GLint s); +GLAPI PFNGLTEXCOORD1IPROC glad_glTexCoord1i; +#define glTexCoord1i glad_glTexCoord1i +typedef void (APIENTRYP PFNGLTEXCOORD1IVPROC)(const GLint *v); +GLAPI PFNGLTEXCOORD1IVPROC glad_glTexCoord1iv; +#define glTexCoord1iv glad_glTexCoord1iv +typedef void (APIENTRYP PFNGLTEXCOORD1SPROC)(GLshort s); +GLAPI PFNGLTEXCOORD1SPROC glad_glTexCoord1s; +#define glTexCoord1s glad_glTexCoord1s +typedef void (APIENTRYP PFNGLTEXCOORD1SVPROC)(const GLshort *v); +GLAPI PFNGLTEXCOORD1SVPROC glad_glTexCoord1sv; +#define glTexCoord1sv glad_glTexCoord1sv +typedef void (APIENTRYP PFNGLTEXCOORD2DPROC)(GLdouble s, GLdouble t); +GLAPI PFNGLTEXCOORD2DPROC glad_glTexCoord2d; +#define glTexCoord2d glad_glTexCoord2d +typedef void (APIENTRYP PFNGLTEXCOORD2DVPROC)(const GLdouble *v); +GLAPI PFNGLTEXCOORD2DVPROC glad_glTexCoord2dv; +#define glTexCoord2dv glad_glTexCoord2dv +typedef void (APIENTRYP PFNGLTEXCOORD2FPROC)(GLfloat s, GLfloat t); +GLAPI PFNGLTEXCOORD2FPROC glad_glTexCoord2f; +#define glTexCoord2f glad_glTexCoord2f +typedef void (APIENTRYP PFNGLTEXCOORD2FVPROC)(const GLfloat *v); +GLAPI PFNGLTEXCOORD2FVPROC glad_glTexCoord2fv; +#define glTexCoord2fv glad_glTexCoord2fv +typedef void (APIENTRYP PFNGLTEXCOORD2IPROC)(GLint s, GLint t); +GLAPI PFNGLTEXCOORD2IPROC glad_glTexCoord2i; +#define glTexCoord2i glad_glTexCoord2i +typedef void (APIENTRYP PFNGLTEXCOORD2IVPROC)(const GLint *v); +GLAPI PFNGLTEXCOORD2IVPROC glad_glTexCoord2iv; +#define glTexCoord2iv glad_glTexCoord2iv +typedef void (APIENTRYP PFNGLTEXCOORD2SPROC)(GLshort s, GLshort t); +GLAPI PFNGLTEXCOORD2SPROC glad_glTexCoord2s; +#define glTexCoord2s glad_glTexCoord2s +typedef void (APIENTRYP PFNGLTEXCOORD2SVPROC)(const GLshort *v); +GLAPI PFNGLTEXCOORD2SVPROC glad_glTexCoord2sv; +#define glTexCoord2sv glad_glTexCoord2sv +typedef void (APIENTRYP PFNGLTEXCOORD3DPROC)(GLdouble s, GLdouble t, GLdouble r); +GLAPI PFNGLTEXCOORD3DPROC glad_glTexCoord3d; +#define glTexCoord3d glad_glTexCoord3d +typedef void (APIENTRYP PFNGLTEXCOORD3DVPROC)(const GLdouble *v); +GLAPI PFNGLTEXCOORD3DVPROC glad_glTexCoord3dv; +#define glTexCoord3dv glad_glTexCoord3dv +typedef void (APIENTRYP PFNGLTEXCOORD3FPROC)(GLfloat s, GLfloat t, GLfloat r); +GLAPI PFNGLTEXCOORD3FPROC glad_glTexCoord3f; +#define glTexCoord3f glad_glTexCoord3f +typedef void (APIENTRYP PFNGLTEXCOORD3FVPROC)(const GLfloat *v); +GLAPI PFNGLTEXCOORD3FVPROC glad_glTexCoord3fv; +#define glTexCoord3fv glad_glTexCoord3fv +typedef void (APIENTRYP PFNGLTEXCOORD3IPROC)(GLint s, GLint t, GLint r); +GLAPI PFNGLTEXCOORD3IPROC glad_glTexCoord3i; +#define glTexCoord3i glad_glTexCoord3i +typedef void (APIENTRYP PFNGLTEXCOORD3IVPROC)(const GLint *v); +GLAPI PFNGLTEXCOORD3IVPROC glad_glTexCoord3iv; +#define glTexCoord3iv glad_glTexCoord3iv +typedef void (APIENTRYP PFNGLTEXCOORD3SPROC)(GLshort s, GLshort t, GLshort r); +GLAPI PFNGLTEXCOORD3SPROC glad_glTexCoord3s; +#define glTexCoord3s glad_glTexCoord3s +typedef void (APIENTRYP PFNGLTEXCOORD3SVPROC)(const GLshort *v); +GLAPI PFNGLTEXCOORD3SVPROC glad_glTexCoord3sv; +#define glTexCoord3sv glad_glTexCoord3sv +typedef void (APIENTRYP PFNGLTEXCOORD4DPROC)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI PFNGLTEXCOORD4DPROC glad_glTexCoord4d; +#define glTexCoord4d glad_glTexCoord4d +typedef void (APIENTRYP PFNGLTEXCOORD4DVPROC)(const GLdouble *v); +GLAPI PFNGLTEXCOORD4DVPROC glad_glTexCoord4dv; +#define glTexCoord4dv glad_glTexCoord4dv +typedef void (APIENTRYP PFNGLTEXCOORD4FPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI PFNGLTEXCOORD4FPROC glad_glTexCoord4f; +#define glTexCoord4f glad_glTexCoord4f +typedef void (APIENTRYP PFNGLTEXCOORD4FVPROC)(const GLfloat *v); +GLAPI PFNGLTEXCOORD4FVPROC glad_glTexCoord4fv; +#define glTexCoord4fv glad_glTexCoord4fv +typedef void (APIENTRYP PFNGLTEXCOORD4IPROC)(GLint s, GLint t, GLint r, GLint q); +GLAPI PFNGLTEXCOORD4IPROC glad_glTexCoord4i; +#define glTexCoord4i glad_glTexCoord4i +typedef void (APIENTRYP PFNGLTEXCOORD4IVPROC)(const GLint *v); +GLAPI PFNGLTEXCOORD4IVPROC glad_glTexCoord4iv; +#define glTexCoord4iv glad_glTexCoord4iv +typedef void (APIENTRYP PFNGLTEXCOORD4SPROC)(GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI PFNGLTEXCOORD4SPROC glad_glTexCoord4s; +#define glTexCoord4s glad_glTexCoord4s +typedef void (APIENTRYP PFNGLTEXCOORD4SVPROC)(const GLshort *v); +GLAPI PFNGLTEXCOORD4SVPROC glad_glTexCoord4sv; +#define glTexCoord4sv glad_glTexCoord4sv +typedef void (APIENTRYP PFNGLVERTEX2DPROC)(GLdouble x, GLdouble y); +GLAPI PFNGLVERTEX2DPROC glad_glVertex2d; +#define glVertex2d glad_glVertex2d +typedef void (APIENTRYP PFNGLVERTEX2DVPROC)(const GLdouble *v); +GLAPI PFNGLVERTEX2DVPROC glad_glVertex2dv; +#define glVertex2dv glad_glVertex2dv +typedef void (APIENTRYP PFNGLVERTEX2FPROC)(GLfloat x, GLfloat y); +GLAPI PFNGLVERTEX2FPROC glad_glVertex2f; +#define glVertex2f glad_glVertex2f +typedef void (APIENTRYP PFNGLVERTEX2FVPROC)(const GLfloat *v); +GLAPI PFNGLVERTEX2FVPROC glad_glVertex2fv; +#define glVertex2fv glad_glVertex2fv +typedef void (APIENTRYP PFNGLVERTEX2IPROC)(GLint x, GLint y); +GLAPI PFNGLVERTEX2IPROC glad_glVertex2i; +#define glVertex2i glad_glVertex2i +typedef void (APIENTRYP PFNGLVERTEX2IVPROC)(const GLint *v); +GLAPI PFNGLVERTEX2IVPROC glad_glVertex2iv; +#define glVertex2iv glad_glVertex2iv +typedef void (APIENTRYP PFNGLVERTEX2SPROC)(GLshort x, GLshort y); +GLAPI PFNGLVERTEX2SPROC glad_glVertex2s; +#define glVertex2s glad_glVertex2s +typedef void (APIENTRYP PFNGLVERTEX2SVPROC)(const GLshort *v); +GLAPI PFNGLVERTEX2SVPROC glad_glVertex2sv; +#define glVertex2sv glad_glVertex2sv +typedef void (APIENTRYP PFNGLVERTEX3DPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLVERTEX3DPROC glad_glVertex3d; +#define glVertex3d glad_glVertex3d +typedef void (APIENTRYP PFNGLVERTEX3DVPROC)(const GLdouble *v); +GLAPI PFNGLVERTEX3DVPROC glad_glVertex3dv; +#define glVertex3dv glad_glVertex3dv +typedef void (APIENTRYP PFNGLVERTEX3FPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLVERTEX3FPROC glad_glVertex3f; +#define glVertex3f glad_glVertex3f +typedef void (APIENTRYP PFNGLVERTEX3FVPROC)(const GLfloat *v); +GLAPI PFNGLVERTEX3FVPROC glad_glVertex3fv; +#define glVertex3fv glad_glVertex3fv +typedef void (APIENTRYP PFNGLVERTEX3IPROC)(GLint x, GLint y, GLint z); +GLAPI PFNGLVERTEX3IPROC glad_glVertex3i; +#define glVertex3i glad_glVertex3i +typedef void (APIENTRYP PFNGLVERTEX3IVPROC)(const GLint *v); +GLAPI PFNGLVERTEX3IVPROC glad_glVertex3iv; +#define glVertex3iv glad_glVertex3iv +typedef void (APIENTRYP PFNGLVERTEX3SPROC)(GLshort x, GLshort y, GLshort z); +GLAPI PFNGLVERTEX3SPROC glad_glVertex3s; +#define glVertex3s glad_glVertex3s +typedef void (APIENTRYP PFNGLVERTEX3SVPROC)(const GLshort *v); +GLAPI PFNGLVERTEX3SVPROC glad_glVertex3sv; +#define glVertex3sv glad_glVertex3sv +typedef void (APIENTRYP PFNGLVERTEX4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLVERTEX4DPROC glad_glVertex4d; +#define glVertex4d glad_glVertex4d +typedef void (APIENTRYP PFNGLVERTEX4DVPROC)(const GLdouble *v); +GLAPI PFNGLVERTEX4DVPROC glad_glVertex4dv; +#define glVertex4dv glad_glVertex4dv +typedef void (APIENTRYP PFNGLVERTEX4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLVERTEX4FPROC glad_glVertex4f; +#define glVertex4f glad_glVertex4f +typedef void (APIENTRYP PFNGLVERTEX4FVPROC)(const GLfloat *v); +GLAPI PFNGLVERTEX4FVPROC glad_glVertex4fv; +#define glVertex4fv glad_glVertex4fv +typedef void (APIENTRYP PFNGLVERTEX4IPROC)(GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLVERTEX4IPROC glad_glVertex4i; +#define glVertex4i glad_glVertex4i +typedef void (APIENTRYP PFNGLVERTEX4IVPROC)(const GLint *v); +GLAPI PFNGLVERTEX4IVPROC glad_glVertex4iv; +#define glVertex4iv glad_glVertex4iv +typedef void (APIENTRYP PFNGLVERTEX4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLVERTEX4SPROC glad_glVertex4s; +#define glVertex4s glad_glVertex4s +typedef void (APIENTRYP PFNGLVERTEX4SVPROC)(const GLshort *v); +GLAPI PFNGLVERTEX4SVPROC glad_glVertex4sv; +#define glVertex4sv glad_glVertex4sv +typedef void (APIENTRYP PFNGLCLIPPLANEPROC)(GLenum plane, const GLdouble *equation); +GLAPI PFNGLCLIPPLANEPROC glad_glClipPlane; +#define glClipPlane glad_glClipPlane +typedef void (APIENTRYP PFNGLCOLORMATERIALPROC)(GLenum face, GLenum mode); +GLAPI PFNGLCOLORMATERIALPROC glad_glColorMaterial; +#define glColorMaterial glad_glColorMaterial +typedef void (APIENTRYP PFNGLFOGFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLFOGFPROC glad_glFogf; +#define glFogf glad_glFogf +typedef void (APIENTRYP PFNGLFOGFVPROC)(GLenum pname, const GLfloat *params); +GLAPI PFNGLFOGFVPROC glad_glFogfv; +#define glFogfv glad_glFogfv +typedef void (APIENTRYP PFNGLFOGIPROC)(GLenum pname, GLint param); +GLAPI PFNGLFOGIPROC glad_glFogi; +#define glFogi glad_glFogi +typedef void (APIENTRYP PFNGLFOGIVPROC)(GLenum pname, const GLint *params); +GLAPI PFNGLFOGIVPROC glad_glFogiv; +#define glFogiv glad_glFogiv +typedef void (APIENTRYP PFNGLLIGHTFPROC)(GLenum light, GLenum pname, GLfloat param); +GLAPI PFNGLLIGHTFPROC glad_glLightf; +#define glLightf glad_glLightf +typedef void (APIENTRYP PFNGLLIGHTFVPROC)(GLenum light, GLenum pname, const GLfloat *params); +GLAPI PFNGLLIGHTFVPROC glad_glLightfv; +#define glLightfv glad_glLightfv +typedef void (APIENTRYP PFNGLLIGHTIPROC)(GLenum light, GLenum pname, GLint param); +GLAPI PFNGLLIGHTIPROC glad_glLighti; +#define glLighti glad_glLighti +typedef void (APIENTRYP PFNGLLIGHTIVPROC)(GLenum light, GLenum pname, const GLint *params); +GLAPI PFNGLLIGHTIVPROC glad_glLightiv; +#define glLightiv glad_glLightiv +typedef void (APIENTRYP PFNGLLIGHTMODELFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLLIGHTMODELFPROC glad_glLightModelf; +#define glLightModelf glad_glLightModelf +typedef void (APIENTRYP PFNGLLIGHTMODELFVPROC)(GLenum pname, const GLfloat *params); +GLAPI PFNGLLIGHTMODELFVPROC glad_glLightModelfv; +#define glLightModelfv glad_glLightModelfv +typedef void (APIENTRYP PFNGLLIGHTMODELIPROC)(GLenum pname, GLint param); +GLAPI PFNGLLIGHTMODELIPROC glad_glLightModeli; +#define glLightModeli glad_glLightModeli +typedef void (APIENTRYP PFNGLLIGHTMODELIVPROC)(GLenum pname, const GLint *params); +GLAPI PFNGLLIGHTMODELIVPROC glad_glLightModeliv; +#define glLightModeliv glad_glLightModeliv +typedef void (APIENTRYP PFNGLLINESTIPPLEPROC)(GLint factor, GLushort pattern); +GLAPI PFNGLLINESTIPPLEPROC glad_glLineStipple; +#define glLineStipple glad_glLineStipple +typedef void (APIENTRYP PFNGLMATERIALFPROC)(GLenum face, GLenum pname, GLfloat param); +GLAPI PFNGLMATERIALFPROC glad_glMaterialf; +#define glMaterialf glad_glMaterialf +typedef void (APIENTRYP PFNGLMATERIALFVPROC)(GLenum face, GLenum pname, const GLfloat *params); +GLAPI PFNGLMATERIALFVPROC glad_glMaterialfv; +#define glMaterialfv glad_glMaterialfv +typedef void (APIENTRYP PFNGLMATERIALIPROC)(GLenum face, GLenum pname, GLint param); +GLAPI PFNGLMATERIALIPROC glad_glMateriali; +#define glMateriali glad_glMateriali +typedef void (APIENTRYP PFNGLMATERIALIVPROC)(GLenum face, GLenum pname, const GLint *params); +GLAPI PFNGLMATERIALIVPROC glad_glMaterialiv; +#define glMaterialiv glad_glMaterialiv +typedef void (APIENTRYP PFNGLPOLYGONSTIPPLEPROC)(const GLubyte *mask); +GLAPI PFNGLPOLYGONSTIPPLEPROC glad_glPolygonStipple; +#define glPolygonStipple glad_glPolygonStipple +typedef void (APIENTRYP PFNGLSHADEMODELPROC)(GLenum mode); +GLAPI PFNGLSHADEMODELPROC glad_glShadeModel; +#define glShadeModel glad_glShadeModel +typedef void (APIENTRYP PFNGLTEXENVFPROC)(GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLTEXENVFPROC glad_glTexEnvf; +#define glTexEnvf glad_glTexEnvf +typedef void (APIENTRYP PFNGLTEXENVFVPROC)(GLenum target, GLenum pname, const GLfloat *params); +GLAPI PFNGLTEXENVFVPROC glad_glTexEnvfv; +#define glTexEnvfv glad_glTexEnvfv +typedef void (APIENTRYP PFNGLTEXENVIPROC)(GLenum target, GLenum pname, GLint param); +GLAPI PFNGLTEXENVIPROC glad_glTexEnvi; +#define glTexEnvi glad_glTexEnvi +typedef void (APIENTRYP PFNGLTEXENVIVPROC)(GLenum target, GLenum pname, const GLint *params); +GLAPI PFNGLTEXENVIVPROC glad_glTexEnviv; +#define glTexEnviv glad_glTexEnviv +typedef void (APIENTRYP PFNGLTEXGENDPROC)(GLenum coord, GLenum pname, GLdouble param); +GLAPI PFNGLTEXGENDPROC glad_glTexGend; +#define glTexGend glad_glTexGend +typedef void (APIENTRYP PFNGLTEXGENDVPROC)(GLenum coord, GLenum pname, const GLdouble *params); +GLAPI PFNGLTEXGENDVPROC glad_glTexGendv; +#define glTexGendv glad_glTexGendv +typedef void (APIENTRYP PFNGLTEXGENFPROC)(GLenum coord, GLenum pname, GLfloat param); +GLAPI PFNGLTEXGENFPROC glad_glTexGenf; +#define glTexGenf glad_glTexGenf +typedef void (APIENTRYP PFNGLTEXGENFVPROC)(GLenum coord, GLenum pname, const GLfloat *params); +GLAPI PFNGLTEXGENFVPROC glad_glTexGenfv; +#define glTexGenfv glad_glTexGenfv +typedef void (APIENTRYP PFNGLTEXGENIPROC)(GLenum coord, GLenum pname, GLint param); +GLAPI PFNGLTEXGENIPROC glad_glTexGeni; +#define glTexGeni glad_glTexGeni +typedef void (APIENTRYP PFNGLTEXGENIVPROC)(GLenum coord, GLenum pname, const GLint *params); +GLAPI PFNGLTEXGENIVPROC glad_glTexGeniv; +#define glTexGeniv glad_glTexGeniv +typedef void (APIENTRYP PFNGLFEEDBACKBUFFERPROC)(GLsizei size, GLenum type, GLfloat *buffer); +GLAPI PFNGLFEEDBACKBUFFERPROC glad_glFeedbackBuffer; +#define glFeedbackBuffer glad_glFeedbackBuffer +typedef void (APIENTRYP PFNGLSELECTBUFFERPROC)(GLsizei size, GLuint *buffer); +GLAPI PFNGLSELECTBUFFERPROC glad_glSelectBuffer; +#define glSelectBuffer glad_glSelectBuffer +typedef GLint (APIENTRYP PFNGLRENDERMODEPROC)(GLenum mode); +GLAPI PFNGLRENDERMODEPROC glad_glRenderMode; +#define glRenderMode glad_glRenderMode +typedef void (APIENTRYP PFNGLINITNAMESPROC)(void); +GLAPI PFNGLINITNAMESPROC glad_glInitNames; +#define glInitNames glad_glInitNames +typedef void (APIENTRYP PFNGLLOADNAMEPROC)(GLuint name); +GLAPI PFNGLLOADNAMEPROC glad_glLoadName; +#define glLoadName glad_glLoadName +typedef void (APIENTRYP PFNGLPASSTHROUGHPROC)(GLfloat token); +GLAPI PFNGLPASSTHROUGHPROC glad_glPassThrough; +#define glPassThrough glad_glPassThrough +typedef void (APIENTRYP PFNGLPOPNAMEPROC)(void); +GLAPI PFNGLPOPNAMEPROC glad_glPopName; +#define glPopName glad_glPopName +typedef void (APIENTRYP PFNGLPUSHNAMEPROC)(GLuint name); +GLAPI PFNGLPUSHNAMEPROC glad_glPushName; +#define glPushName glad_glPushName +typedef void (APIENTRYP PFNGLCLEARACCUMPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLCLEARACCUMPROC glad_glClearAccum; +#define glClearAccum glad_glClearAccum +typedef void (APIENTRYP PFNGLCLEARINDEXPROC)(GLfloat c); +GLAPI PFNGLCLEARINDEXPROC glad_glClearIndex; +#define glClearIndex glad_glClearIndex +typedef void (APIENTRYP PFNGLINDEXMASKPROC)(GLuint mask); +GLAPI PFNGLINDEXMASKPROC glad_glIndexMask; +#define glIndexMask glad_glIndexMask +typedef void (APIENTRYP PFNGLACCUMPROC)(GLenum op, GLfloat value); +GLAPI PFNGLACCUMPROC glad_glAccum; +#define glAccum glad_glAccum +typedef void (APIENTRYP PFNGLPOPATTRIBPROC)(void); +GLAPI PFNGLPOPATTRIBPROC glad_glPopAttrib; +#define glPopAttrib glad_glPopAttrib +typedef void (APIENTRYP PFNGLPUSHATTRIBPROC)(GLbitfield mask); +GLAPI PFNGLPUSHATTRIBPROC glad_glPushAttrib; +#define glPushAttrib glad_glPushAttrib +typedef void (APIENTRYP PFNGLMAP1DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI PFNGLMAP1DPROC glad_glMap1d; +#define glMap1d glad_glMap1d +typedef void (APIENTRYP PFNGLMAP1FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI PFNGLMAP1FPROC glad_glMap1f; +#define glMap1f glad_glMap1f +typedef void (APIENTRYP PFNGLMAP2DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI PFNGLMAP2DPROC glad_glMap2d; +#define glMap2d glad_glMap2d +typedef void (APIENTRYP PFNGLMAP2FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI PFNGLMAP2FPROC glad_glMap2f; +#define glMap2f glad_glMap2f +typedef void (APIENTRYP PFNGLMAPGRID1DPROC)(GLint un, GLdouble u1, GLdouble u2); +GLAPI PFNGLMAPGRID1DPROC glad_glMapGrid1d; +#define glMapGrid1d glad_glMapGrid1d +typedef void (APIENTRYP PFNGLMAPGRID1FPROC)(GLint un, GLfloat u1, GLfloat u2); +GLAPI PFNGLMAPGRID1FPROC glad_glMapGrid1f; +#define glMapGrid1f glad_glMapGrid1f +typedef void (APIENTRYP PFNGLMAPGRID2DPROC)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI PFNGLMAPGRID2DPROC glad_glMapGrid2d; +#define glMapGrid2d glad_glMapGrid2d +typedef void (APIENTRYP PFNGLMAPGRID2FPROC)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI PFNGLMAPGRID2FPROC glad_glMapGrid2f; +#define glMapGrid2f glad_glMapGrid2f +typedef void (APIENTRYP PFNGLEVALCOORD1DPROC)(GLdouble u); +GLAPI PFNGLEVALCOORD1DPROC glad_glEvalCoord1d; +#define glEvalCoord1d glad_glEvalCoord1d +typedef void (APIENTRYP PFNGLEVALCOORD1DVPROC)(const GLdouble *u); +GLAPI PFNGLEVALCOORD1DVPROC glad_glEvalCoord1dv; +#define glEvalCoord1dv glad_glEvalCoord1dv +typedef void (APIENTRYP PFNGLEVALCOORD1FPROC)(GLfloat u); +GLAPI PFNGLEVALCOORD1FPROC glad_glEvalCoord1f; +#define glEvalCoord1f glad_glEvalCoord1f +typedef void (APIENTRYP PFNGLEVALCOORD1FVPROC)(const GLfloat *u); +GLAPI PFNGLEVALCOORD1FVPROC glad_glEvalCoord1fv; +#define glEvalCoord1fv glad_glEvalCoord1fv +typedef void (APIENTRYP PFNGLEVALCOORD2DPROC)(GLdouble u, GLdouble v); +GLAPI PFNGLEVALCOORD2DPROC glad_glEvalCoord2d; +#define glEvalCoord2d glad_glEvalCoord2d +typedef void (APIENTRYP PFNGLEVALCOORD2DVPROC)(const GLdouble *u); +GLAPI PFNGLEVALCOORD2DVPROC glad_glEvalCoord2dv; +#define glEvalCoord2dv glad_glEvalCoord2dv +typedef void (APIENTRYP PFNGLEVALCOORD2FPROC)(GLfloat u, GLfloat v); +GLAPI PFNGLEVALCOORD2FPROC glad_glEvalCoord2f; +#define glEvalCoord2f glad_glEvalCoord2f +typedef void (APIENTRYP PFNGLEVALCOORD2FVPROC)(const GLfloat *u); +GLAPI PFNGLEVALCOORD2FVPROC glad_glEvalCoord2fv; +#define glEvalCoord2fv glad_glEvalCoord2fv +typedef void (APIENTRYP PFNGLEVALMESH1PROC)(GLenum mode, GLint i1, GLint i2); +GLAPI PFNGLEVALMESH1PROC glad_glEvalMesh1; +#define glEvalMesh1 glad_glEvalMesh1 +typedef void (APIENTRYP PFNGLEVALPOINT1PROC)(GLint i); +GLAPI PFNGLEVALPOINT1PROC glad_glEvalPoint1; +#define glEvalPoint1 glad_glEvalPoint1 +typedef void (APIENTRYP PFNGLEVALMESH2PROC)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI PFNGLEVALMESH2PROC glad_glEvalMesh2; +#define glEvalMesh2 glad_glEvalMesh2 +typedef void (APIENTRYP PFNGLEVALPOINT2PROC)(GLint i, GLint j); +GLAPI PFNGLEVALPOINT2PROC glad_glEvalPoint2; +#define glEvalPoint2 glad_glEvalPoint2 +typedef void (APIENTRYP PFNGLALPHAFUNCPROC)(GLenum func, GLfloat ref); +GLAPI PFNGLALPHAFUNCPROC glad_glAlphaFunc; +#define glAlphaFunc glad_glAlphaFunc +typedef void (APIENTRYP PFNGLPIXELZOOMPROC)(GLfloat xfactor, GLfloat yfactor); +GLAPI PFNGLPIXELZOOMPROC glad_glPixelZoom; +#define glPixelZoom glad_glPixelZoom +typedef void (APIENTRYP PFNGLPIXELTRANSFERFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPIXELTRANSFERFPROC glad_glPixelTransferf; +#define glPixelTransferf glad_glPixelTransferf +typedef void (APIENTRYP PFNGLPIXELTRANSFERIPROC)(GLenum pname, GLint param); +GLAPI PFNGLPIXELTRANSFERIPROC glad_glPixelTransferi; +#define glPixelTransferi glad_glPixelTransferi +typedef void (APIENTRYP PFNGLPIXELMAPFVPROC)(GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI PFNGLPIXELMAPFVPROC glad_glPixelMapfv; +#define glPixelMapfv glad_glPixelMapfv +typedef void (APIENTRYP PFNGLPIXELMAPUIVPROC)(GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI PFNGLPIXELMAPUIVPROC glad_glPixelMapuiv; +#define glPixelMapuiv glad_glPixelMapuiv +typedef void (APIENTRYP PFNGLPIXELMAPUSVPROC)(GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI PFNGLPIXELMAPUSVPROC glad_glPixelMapusv; +#define glPixelMapusv glad_glPixelMapusv +typedef void (APIENTRYP PFNGLCOPYPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI PFNGLCOPYPIXELSPROC glad_glCopyPixels; +#define glCopyPixels glad_glCopyPixels +typedef void (APIENTRYP PFNGLDRAWPIXELSPROC)(GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLDRAWPIXELSPROC glad_glDrawPixels; +#define glDrawPixels glad_glDrawPixels +typedef void (APIENTRYP PFNGLGETCLIPPLANEPROC)(GLenum plane, GLdouble *equation); +GLAPI PFNGLGETCLIPPLANEPROC glad_glGetClipPlane; +#define glGetClipPlane glad_glGetClipPlane +typedef void (APIENTRYP PFNGLGETLIGHTFVPROC)(GLenum light, GLenum pname, GLfloat *params); +GLAPI PFNGLGETLIGHTFVPROC glad_glGetLightfv; +#define glGetLightfv glad_glGetLightfv +typedef void (APIENTRYP PFNGLGETLIGHTIVPROC)(GLenum light, GLenum pname, GLint *params); +GLAPI PFNGLGETLIGHTIVPROC glad_glGetLightiv; +#define glGetLightiv glad_glGetLightiv +typedef void (APIENTRYP PFNGLGETMAPDVPROC)(GLenum target, GLenum query, GLdouble *v); +GLAPI PFNGLGETMAPDVPROC glad_glGetMapdv; +#define glGetMapdv glad_glGetMapdv +typedef void (APIENTRYP PFNGLGETMAPFVPROC)(GLenum target, GLenum query, GLfloat *v); +GLAPI PFNGLGETMAPFVPROC glad_glGetMapfv; +#define glGetMapfv glad_glGetMapfv +typedef void (APIENTRYP PFNGLGETMAPIVPROC)(GLenum target, GLenum query, GLint *v); +GLAPI PFNGLGETMAPIVPROC glad_glGetMapiv; +#define glGetMapiv glad_glGetMapiv +typedef void (APIENTRYP PFNGLGETMATERIALFVPROC)(GLenum face, GLenum pname, GLfloat *params); +GLAPI PFNGLGETMATERIALFVPROC glad_glGetMaterialfv; +#define glGetMaterialfv glad_glGetMaterialfv +typedef void (APIENTRYP PFNGLGETMATERIALIVPROC)(GLenum face, GLenum pname, GLint *params); +GLAPI PFNGLGETMATERIALIVPROC glad_glGetMaterialiv; +#define glGetMaterialiv glad_glGetMaterialiv +typedef void (APIENTRYP PFNGLGETPIXELMAPFVPROC)(GLenum map, GLfloat *values); +GLAPI PFNGLGETPIXELMAPFVPROC glad_glGetPixelMapfv; +#define glGetPixelMapfv glad_glGetPixelMapfv +typedef void (APIENTRYP PFNGLGETPIXELMAPUIVPROC)(GLenum map, GLuint *values); +GLAPI PFNGLGETPIXELMAPUIVPROC glad_glGetPixelMapuiv; +#define glGetPixelMapuiv glad_glGetPixelMapuiv +typedef void (APIENTRYP PFNGLGETPIXELMAPUSVPROC)(GLenum map, GLushort *values); +GLAPI PFNGLGETPIXELMAPUSVPROC glad_glGetPixelMapusv; +#define glGetPixelMapusv glad_glGetPixelMapusv +typedef void (APIENTRYP PFNGLGETPOLYGONSTIPPLEPROC)(GLubyte *mask); +GLAPI PFNGLGETPOLYGONSTIPPLEPROC glad_glGetPolygonStipple; +#define glGetPolygonStipple glad_glGetPolygonStipple +typedef void (APIENTRYP PFNGLGETTEXENVFVPROC)(GLenum target, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv; +#define glGetTexEnvfv glad_glGetTexEnvfv +typedef void (APIENTRYP PFNGLGETTEXENVIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXENVIVPROC glad_glGetTexEnviv; +#define glGetTexEnviv glad_glGetTexEnviv +typedef void (APIENTRYP PFNGLGETTEXGENDVPROC)(GLenum coord, GLenum pname, GLdouble *params); +GLAPI PFNGLGETTEXGENDVPROC glad_glGetTexGendv; +#define glGetTexGendv glad_glGetTexGendv +typedef void (APIENTRYP PFNGLGETTEXGENFVPROC)(GLenum coord, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXGENFVPROC glad_glGetTexGenfv; +#define glGetTexGenfv glad_glGetTexGenfv +typedef void (APIENTRYP PFNGLGETTEXGENIVPROC)(GLenum coord, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXGENIVPROC glad_glGetTexGeniv; +#define glGetTexGeniv glad_glGetTexGeniv +typedef GLboolean (APIENTRYP PFNGLISLISTPROC)(GLuint list); +GLAPI PFNGLISLISTPROC glad_glIsList; +#define glIsList glad_glIsList +typedef void (APIENTRYP PFNGLFRUSTUMPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI PFNGLFRUSTUMPROC glad_glFrustum; +#define glFrustum glad_glFrustum +typedef void (APIENTRYP PFNGLLOADIDENTITYPROC)(void); +GLAPI PFNGLLOADIDENTITYPROC glad_glLoadIdentity; +#define glLoadIdentity glad_glLoadIdentity +typedef void (APIENTRYP PFNGLLOADMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLLOADMATRIXFPROC glad_glLoadMatrixf; +#define glLoadMatrixf glad_glLoadMatrixf +typedef void (APIENTRYP PFNGLLOADMATRIXDPROC)(const GLdouble *m); +GLAPI PFNGLLOADMATRIXDPROC glad_glLoadMatrixd; +#define glLoadMatrixd glad_glLoadMatrixd +typedef void (APIENTRYP PFNGLMATRIXMODEPROC)(GLenum mode); +GLAPI PFNGLMATRIXMODEPROC glad_glMatrixMode; +#define glMatrixMode glad_glMatrixMode +typedef void (APIENTRYP PFNGLMULTMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLMULTMATRIXFPROC glad_glMultMatrixf; +#define glMultMatrixf glad_glMultMatrixf +typedef void (APIENTRYP PFNGLMULTMATRIXDPROC)(const GLdouble *m); +GLAPI PFNGLMULTMATRIXDPROC glad_glMultMatrixd; +#define glMultMatrixd glad_glMultMatrixd +typedef void (APIENTRYP PFNGLORTHOPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI PFNGLORTHOPROC glad_glOrtho; +#define glOrtho glad_glOrtho +typedef void (APIENTRYP PFNGLPOPMATRIXPROC)(void); +GLAPI PFNGLPOPMATRIXPROC glad_glPopMatrix; +#define glPopMatrix glad_glPopMatrix +typedef void (APIENTRYP PFNGLPUSHMATRIXPROC)(void); +GLAPI PFNGLPUSHMATRIXPROC glad_glPushMatrix; +#define glPushMatrix glad_glPushMatrix +typedef void (APIENTRYP PFNGLROTATEDPROC)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLROTATEDPROC glad_glRotated; +#define glRotated glad_glRotated +typedef void (APIENTRYP PFNGLROTATEFPROC)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLROTATEFPROC glad_glRotatef; +#define glRotatef glad_glRotatef +typedef void (APIENTRYP PFNGLSCALEDPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLSCALEDPROC glad_glScaled; +#define glScaled glad_glScaled +typedef void (APIENTRYP PFNGLSCALEFPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLSCALEFPROC glad_glScalef; +#define glScalef glad_glScalef +typedef void (APIENTRYP PFNGLTRANSLATEDPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLTRANSLATEDPROC glad_glTranslated; +#define glTranslated glad_glTranslated +typedef void (APIENTRYP PFNGLTRANSLATEFPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLTRANSLATEFPROC glad_glTranslatef; +#define glTranslatef glad_glTranslatef +#endif +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 +GLAPI int GLAD_GL_VERSION_1_1; +typedef void (APIENTRYP PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count); +GLAPI PFNGLDRAWARRAYSPROC glad_glDrawArrays; +#define glDrawArrays glad_glDrawArrays +typedef void (APIENTRYP PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void *indices); +GLAPI PFNGLDRAWELEMENTSPROC glad_glDrawElements; +#define glDrawElements glad_glDrawElements +typedef void (APIENTRYP PFNGLGETPOINTERVPROC)(GLenum pname, void **params); +GLAPI PFNGLGETPOINTERVPROC glad_glGetPointerv; +#define glGetPointerv glad_glGetPointerv +typedef void (APIENTRYP PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units); +GLAPI PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; +#define glPolygonOffset glad_glPolygonOffset +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; +#define glCopyTexImage1D glad_glCopyTexImage1D +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; +#define glCopyTexImage2D glad_glCopyTexImage2D +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; +#define glCopyTexSubImage1D glad_glCopyTexSubImage1D +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; +#define glCopyTexSubImage2D glad_glCopyTexSubImage2D +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; +#define glTexSubImage1D glad_glTexSubImage1D +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; +#define glTexSubImage2D glad_glTexSubImage2D +typedef void (APIENTRYP PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture); +GLAPI PFNGLBINDTEXTUREPROC glad_glBindTexture; +#define glBindTexture glad_glBindTexture +typedef void (APIENTRYP PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint *textures); +GLAPI PFNGLDELETETEXTURESPROC glad_glDeleteTextures; +#define glDeleteTextures glad_glDeleteTextures +typedef void (APIENTRYP PFNGLGENTEXTURESPROC)(GLsizei n, GLuint *textures); +GLAPI PFNGLGENTEXTURESPROC glad_glGenTextures; +#define glGenTextures glad_glGenTextures +typedef GLboolean (APIENTRYP PFNGLISTEXTUREPROC)(GLuint texture); +GLAPI PFNGLISTEXTUREPROC glad_glIsTexture; +#define glIsTexture glad_glIsTexture +typedef void (APIENTRYP PFNGLARRAYELEMENTPROC)(GLint i); +GLAPI PFNGLARRAYELEMENTPROC glad_glArrayElement; +#define glArrayElement glad_glArrayElement +typedef void (APIENTRYP PFNGLCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLCOLORPOINTERPROC glad_glColorPointer; +#define glColorPointer glad_glColorPointer +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEPROC)(GLenum array); +GLAPI PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState; +#define glDisableClientState glad_glDisableClientState +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERPROC)(GLsizei stride, const void *pointer); +GLAPI PFNGLEDGEFLAGPOINTERPROC glad_glEdgeFlagPointer; +#define glEdgeFlagPointer glad_glEdgeFlagPointer +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEPROC)(GLenum array); +GLAPI PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState; +#define glEnableClientState glad_glEnableClientState +typedef void (APIENTRYP PFNGLINDEXPOINTERPROC)(GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLINDEXPOINTERPROC glad_glIndexPointer; +#define glIndexPointer glad_glIndexPointer +typedef void (APIENTRYP PFNGLINTERLEAVEDARRAYSPROC)(GLenum format, GLsizei stride, const void *pointer); +GLAPI PFNGLINTERLEAVEDARRAYSPROC glad_glInterleavedArrays; +#define glInterleavedArrays glad_glInterleavedArrays +typedef void (APIENTRYP PFNGLNORMALPOINTERPROC)(GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLNORMALPOINTERPROC glad_glNormalPointer; +#define glNormalPointer glad_glNormalPointer +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer; +#define glTexCoordPointer glad_glTexCoordPointer +typedef void (APIENTRYP PFNGLVERTEXPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLVERTEXPOINTERPROC glad_glVertexPointer; +#define glVertexPointer glad_glVertexPointer +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTPROC)(GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident; +#define glAreTexturesResident glad_glAreTexturesResident +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESPROC)(GLsizei n, const GLuint *textures, const GLfloat *priorities); +GLAPI PFNGLPRIORITIZETEXTURESPROC glad_glPrioritizeTextures; +#define glPrioritizeTextures glad_glPrioritizeTextures +typedef void (APIENTRYP PFNGLINDEXUBPROC)(GLubyte c); +GLAPI PFNGLINDEXUBPROC glad_glIndexub; +#define glIndexub glad_glIndexub +typedef void (APIENTRYP PFNGLINDEXUBVPROC)(const GLubyte *c); +GLAPI PFNGLINDEXUBVPROC glad_glIndexubv; +#define glIndexubv glad_glIndexubv +typedef void (APIENTRYP PFNGLPOPCLIENTATTRIBPROC)(void); +GLAPI PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib; +#define glPopClientAttrib glad_glPopClientAttrib +typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBPROC)(GLbitfield mask); +GLAPI PFNGLPUSHCLIENTATTRIBPROC glad_glPushClientAttrib; +#define glPushClientAttrib glad_glPushClientAttrib +#endif +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +GLAPI int GLAD_GL_VERSION_1_2; +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +GLAPI PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; +#define glDrawRangeElements glad_glDrawRangeElements +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXIMAGE3DPROC glad_glTexImage3D; +#define glTexImage3D glad_glTexImage3D +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; +#define glTexSubImage3D glad_glTexSubImage3D +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; +#define glCopyTexSubImage3D glad_glCopyTexSubImage3D +#endif +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +GLAPI int GLAD_GL_VERSION_1_3; +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture); +GLAPI PFNGLACTIVETEXTUREPROC glad_glActiveTexture; +#define glActiveTexture glad_glActiveTexture +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert); +GLAPI PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; +#define glSampleCoverage glad_glSampleCoverage +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; +#define glCompressedTexImage3D glad_glCompressedTexImage3D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; +#define glCompressedTexImage2D glad_glCompressedTexImage2D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; +#define glCompressedTexImage1D glad_glCompressedTexImage1D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; +#define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; +#define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; +#define glCompressedTexSubImage1D glad_glCompressedTexSubImage1D +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, void *img); +GLAPI PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; +#define glGetCompressedTexImage glad_glGetCompressedTexImage +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC)(GLenum texture); +GLAPI PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture; +#define glClientActiveTexture glad_glClientActiveTexture +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC)(GLenum target, GLdouble s); +GLAPI PFNGLMULTITEXCOORD1DPROC glad_glMultiTexCoord1d; +#define glMultiTexCoord1d glad_glMultiTexCoord1d +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC)(GLenum target, const GLdouble *v); +GLAPI PFNGLMULTITEXCOORD1DVPROC glad_glMultiTexCoord1dv; +#define glMultiTexCoord1dv glad_glMultiTexCoord1dv +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC)(GLenum target, GLfloat s); +GLAPI PFNGLMULTITEXCOORD1FPROC glad_glMultiTexCoord1f; +#define glMultiTexCoord1f glad_glMultiTexCoord1f +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC)(GLenum target, const GLfloat *v); +GLAPI PFNGLMULTITEXCOORD1FVPROC glad_glMultiTexCoord1fv; +#define glMultiTexCoord1fv glad_glMultiTexCoord1fv +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC)(GLenum target, GLint s); +GLAPI PFNGLMULTITEXCOORD1IPROC glad_glMultiTexCoord1i; +#define glMultiTexCoord1i glad_glMultiTexCoord1i +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC)(GLenum target, const GLint *v); +GLAPI PFNGLMULTITEXCOORD1IVPROC glad_glMultiTexCoord1iv; +#define glMultiTexCoord1iv glad_glMultiTexCoord1iv +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC)(GLenum target, GLshort s); +GLAPI PFNGLMULTITEXCOORD1SPROC glad_glMultiTexCoord1s; +#define glMultiTexCoord1s glad_glMultiTexCoord1s +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC)(GLenum target, const GLshort *v); +GLAPI PFNGLMULTITEXCOORD1SVPROC glad_glMultiTexCoord1sv; +#define glMultiTexCoord1sv glad_glMultiTexCoord1sv +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC)(GLenum target, GLdouble s, GLdouble t); +GLAPI PFNGLMULTITEXCOORD2DPROC glad_glMultiTexCoord2d; +#define glMultiTexCoord2d glad_glMultiTexCoord2d +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC)(GLenum target, const GLdouble *v); +GLAPI PFNGLMULTITEXCOORD2DVPROC glad_glMultiTexCoord2dv; +#define glMultiTexCoord2dv glad_glMultiTexCoord2dv +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC)(GLenum target, GLfloat s, GLfloat t); +GLAPI PFNGLMULTITEXCOORD2FPROC glad_glMultiTexCoord2f; +#define glMultiTexCoord2f glad_glMultiTexCoord2f +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC)(GLenum target, const GLfloat *v); +GLAPI PFNGLMULTITEXCOORD2FVPROC glad_glMultiTexCoord2fv; +#define glMultiTexCoord2fv glad_glMultiTexCoord2fv +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC)(GLenum target, GLint s, GLint t); +GLAPI PFNGLMULTITEXCOORD2IPROC glad_glMultiTexCoord2i; +#define glMultiTexCoord2i glad_glMultiTexCoord2i +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC)(GLenum target, const GLint *v); +GLAPI PFNGLMULTITEXCOORD2IVPROC glad_glMultiTexCoord2iv; +#define glMultiTexCoord2iv glad_glMultiTexCoord2iv +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC)(GLenum target, GLshort s, GLshort t); +GLAPI PFNGLMULTITEXCOORD2SPROC glad_glMultiTexCoord2s; +#define glMultiTexCoord2s glad_glMultiTexCoord2s +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC)(GLenum target, const GLshort *v); +GLAPI PFNGLMULTITEXCOORD2SVPROC glad_glMultiTexCoord2sv; +#define glMultiTexCoord2sv glad_glMultiTexCoord2sv +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI PFNGLMULTITEXCOORD3DPROC glad_glMultiTexCoord3d; +#define glMultiTexCoord3d glad_glMultiTexCoord3d +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC)(GLenum target, const GLdouble *v); +GLAPI PFNGLMULTITEXCOORD3DVPROC glad_glMultiTexCoord3dv; +#define glMultiTexCoord3dv glad_glMultiTexCoord3dv +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI PFNGLMULTITEXCOORD3FPROC glad_glMultiTexCoord3f; +#define glMultiTexCoord3f glad_glMultiTexCoord3f +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC)(GLenum target, const GLfloat *v); +GLAPI PFNGLMULTITEXCOORD3FVPROC glad_glMultiTexCoord3fv; +#define glMultiTexCoord3fv glad_glMultiTexCoord3fv +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC)(GLenum target, GLint s, GLint t, GLint r); +GLAPI PFNGLMULTITEXCOORD3IPROC glad_glMultiTexCoord3i; +#define glMultiTexCoord3i glad_glMultiTexCoord3i +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC)(GLenum target, const GLint *v); +GLAPI PFNGLMULTITEXCOORD3IVPROC glad_glMultiTexCoord3iv; +#define glMultiTexCoord3iv glad_glMultiTexCoord3iv +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC)(GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI PFNGLMULTITEXCOORD3SPROC glad_glMultiTexCoord3s; +#define glMultiTexCoord3s glad_glMultiTexCoord3s +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC)(GLenum target, const GLshort *v); +GLAPI PFNGLMULTITEXCOORD3SVPROC glad_glMultiTexCoord3sv; +#define glMultiTexCoord3sv glad_glMultiTexCoord3sv +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI PFNGLMULTITEXCOORD4DPROC glad_glMultiTexCoord4d; +#define glMultiTexCoord4d glad_glMultiTexCoord4d +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC)(GLenum target, const GLdouble *v); +GLAPI PFNGLMULTITEXCOORD4DVPROC glad_glMultiTexCoord4dv; +#define glMultiTexCoord4dv glad_glMultiTexCoord4dv +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f; +#define glMultiTexCoord4f glad_glMultiTexCoord4f +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC)(GLenum target, const GLfloat *v); +GLAPI PFNGLMULTITEXCOORD4FVPROC glad_glMultiTexCoord4fv; +#define glMultiTexCoord4fv glad_glMultiTexCoord4fv +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC)(GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI PFNGLMULTITEXCOORD4IPROC glad_glMultiTexCoord4i; +#define glMultiTexCoord4i glad_glMultiTexCoord4i +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC)(GLenum target, const GLint *v); +GLAPI PFNGLMULTITEXCOORD4IVPROC glad_glMultiTexCoord4iv; +#define glMultiTexCoord4iv glad_glMultiTexCoord4iv +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI PFNGLMULTITEXCOORD4SPROC glad_glMultiTexCoord4s; +#define glMultiTexCoord4s glad_glMultiTexCoord4s +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC)(GLenum target, const GLshort *v); +GLAPI PFNGLMULTITEXCOORD4SVPROC glad_glMultiTexCoord4sv; +#define glMultiTexCoord4sv glad_glMultiTexCoord4sv +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLLOADTRANSPOSEMATRIXFPROC glad_glLoadTransposeMatrixf; +#define glLoadTransposeMatrixf glad_glLoadTransposeMatrixf +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC)(const GLdouble *m); +GLAPI PFNGLLOADTRANSPOSEMATRIXDPROC glad_glLoadTransposeMatrixd; +#define glLoadTransposeMatrixd glad_glLoadTransposeMatrixd +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLMULTTRANSPOSEMATRIXFPROC glad_glMultTransposeMatrixf; +#define glMultTransposeMatrixf glad_glMultTransposeMatrixf +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC)(const GLdouble *m); +GLAPI PFNGLMULTTRANSPOSEMATRIXDPROC glad_glMultTransposeMatrixd; +#define glMultTransposeMatrixd glad_glMultTransposeMatrixd +#endif +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +GLAPI int GLAD_GL_VERSION_1_4; +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; +#define glBlendFuncSeparate glad_glBlendFuncSeparate +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +GLAPI PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; +#define glMultiDrawArrays glad_glMultiDrawArrays +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); +GLAPI PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; +#define glMultiDrawElements glad_glMultiDrawElements +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; +#define glPointParameterf glad_glPointParameterf +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat *params); +GLAPI PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; +#define glPointParameterfv glad_glPointParameterfv +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC)(GLenum pname, GLint param); +GLAPI PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; +#define glPointParameteri glad_glPointParameteri +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC)(GLenum pname, const GLint *params); +GLAPI PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; +#define glPointParameteriv glad_glPointParameteriv +typedef void (APIENTRYP PFNGLFOGCOORDFPROC)(GLfloat coord); +GLAPI PFNGLFOGCOORDFPROC glad_glFogCoordf; +#define glFogCoordf glad_glFogCoordf +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC)(const GLfloat *coord); +GLAPI PFNGLFOGCOORDFVPROC glad_glFogCoordfv; +#define glFogCoordfv glad_glFogCoordfv +typedef void (APIENTRYP PFNGLFOGCOORDDPROC)(GLdouble coord); +GLAPI PFNGLFOGCOORDDPROC glad_glFogCoordd; +#define glFogCoordd glad_glFogCoordd +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC)(const GLdouble *coord); +GLAPI PFNGLFOGCOORDDVPROC glad_glFogCoorddv; +#define glFogCoorddv glad_glFogCoorddv +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC)(GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLFOGCOORDPOINTERPROC glad_glFogCoordPointer; +#define glFogCoordPointer glad_glFogCoordPointer +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue); +GLAPI PFNGLSECONDARYCOLOR3BPROC glad_glSecondaryColor3b; +#define glSecondaryColor3b glad_glSecondaryColor3b +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC)(const GLbyte *v); +GLAPI PFNGLSECONDARYCOLOR3BVPROC glad_glSecondaryColor3bv; +#define glSecondaryColor3bv glad_glSecondaryColor3bv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue); +GLAPI PFNGLSECONDARYCOLOR3DPROC glad_glSecondaryColor3d; +#define glSecondaryColor3d glad_glSecondaryColor3d +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC)(const GLdouble *v); +GLAPI PFNGLSECONDARYCOLOR3DVPROC glad_glSecondaryColor3dv; +#define glSecondaryColor3dv glad_glSecondaryColor3dv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue); +GLAPI PFNGLSECONDARYCOLOR3FPROC glad_glSecondaryColor3f; +#define glSecondaryColor3f glad_glSecondaryColor3f +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC)(const GLfloat *v); +GLAPI PFNGLSECONDARYCOLOR3FVPROC glad_glSecondaryColor3fv; +#define glSecondaryColor3fv glad_glSecondaryColor3fv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC)(GLint red, GLint green, GLint blue); +GLAPI PFNGLSECONDARYCOLOR3IPROC glad_glSecondaryColor3i; +#define glSecondaryColor3i glad_glSecondaryColor3i +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC)(const GLint *v); +GLAPI PFNGLSECONDARYCOLOR3IVPROC glad_glSecondaryColor3iv; +#define glSecondaryColor3iv glad_glSecondaryColor3iv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue); +GLAPI PFNGLSECONDARYCOLOR3SPROC glad_glSecondaryColor3s; +#define glSecondaryColor3s glad_glSecondaryColor3s +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC)(const GLshort *v); +GLAPI PFNGLSECONDARYCOLOR3SVPROC glad_glSecondaryColor3sv; +#define glSecondaryColor3sv glad_glSecondaryColor3sv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue); +GLAPI PFNGLSECONDARYCOLOR3UBPROC glad_glSecondaryColor3ub; +#define glSecondaryColor3ub glad_glSecondaryColor3ub +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC)(const GLubyte *v); +GLAPI PFNGLSECONDARYCOLOR3UBVPROC glad_glSecondaryColor3ubv; +#define glSecondaryColor3ubv glad_glSecondaryColor3ubv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue); +GLAPI PFNGLSECONDARYCOLOR3UIPROC glad_glSecondaryColor3ui; +#define glSecondaryColor3ui glad_glSecondaryColor3ui +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC)(const GLuint *v); +GLAPI PFNGLSECONDARYCOLOR3UIVPROC glad_glSecondaryColor3uiv; +#define glSecondaryColor3uiv glad_glSecondaryColor3uiv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue); +GLAPI PFNGLSECONDARYCOLOR3USPROC glad_glSecondaryColor3us; +#define glSecondaryColor3us glad_glSecondaryColor3us +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC)(const GLushort *v); +GLAPI PFNGLSECONDARYCOLOR3USVPROC glad_glSecondaryColor3usv; +#define glSecondaryColor3usv glad_glSecondaryColor3usv +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLSECONDARYCOLORPOINTERPROC glad_glSecondaryColorPointer; +#define glSecondaryColorPointer glad_glSecondaryColorPointer +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC)(GLdouble x, GLdouble y); +GLAPI PFNGLWINDOWPOS2DPROC glad_glWindowPos2d; +#define glWindowPos2d glad_glWindowPos2d +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC)(const GLdouble *v); +GLAPI PFNGLWINDOWPOS2DVPROC glad_glWindowPos2dv; +#define glWindowPos2dv glad_glWindowPos2dv +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC)(GLfloat x, GLfloat y); +GLAPI PFNGLWINDOWPOS2FPROC glad_glWindowPos2f; +#define glWindowPos2f glad_glWindowPos2f +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC)(const GLfloat *v); +GLAPI PFNGLWINDOWPOS2FVPROC glad_glWindowPos2fv; +#define glWindowPos2fv glad_glWindowPos2fv +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC)(GLint x, GLint y); +GLAPI PFNGLWINDOWPOS2IPROC glad_glWindowPos2i; +#define glWindowPos2i glad_glWindowPos2i +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC)(const GLint *v); +GLAPI PFNGLWINDOWPOS2IVPROC glad_glWindowPos2iv; +#define glWindowPos2iv glad_glWindowPos2iv +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC)(GLshort x, GLshort y); +GLAPI PFNGLWINDOWPOS2SPROC glad_glWindowPos2s; +#define glWindowPos2s glad_glWindowPos2s +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC)(const GLshort *v); +GLAPI PFNGLWINDOWPOS2SVPROC glad_glWindowPos2sv; +#define glWindowPos2sv glad_glWindowPos2sv +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLWINDOWPOS3DPROC glad_glWindowPos3d; +#define glWindowPos3d glad_glWindowPos3d +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC)(const GLdouble *v); +GLAPI PFNGLWINDOWPOS3DVPROC glad_glWindowPos3dv; +#define glWindowPos3dv glad_glWindowPos3dv +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLWINDOWPOS3FPROC glad_glWindowPos3f; +#define glWindowPos3f glad_glWindowPos3f +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC)(const GLfloat *v); +GLAPI PFNGLWINDOWPOS3FVPROC glad_glWindowPos3fv; +#define glWindowPos3fv glad_glWindowPos3fv +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC)(GLint x, GLint y, GLint z); +GLAPI PFNGLWINDOWPOS3IPROC glad_glWindowPos3i; +#define glWindowPos3i glad_glWindowPos3i +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC)(const GLint *v); +GLAPI PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv; +#define glWindowPos3iv glad_glWindowPos3iv +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC)(GLshort x, GLshort y, GLshort z); +GLAPI PFNGLWINDOWPOS3SPROC glad_glWindowPos3s; +#define glWindowPos3s glad_glWindowPos3s +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC)(const GLshort *v); +GLAPI PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv; +#define glWindowPos3sv glad_glWindowPos3sv +typedef void (APIENTRYP PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLBLENDCOLORPROC glad_glBlendColor; +#define glBlendColor glad_glBlendColor +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC)(GLenum mode); +GLAPI PFNGLBLENDEQUATIONPROC glad_glBlendEquation; +#define glBlendEquation glad_glBlendEquation +#endif +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +GLAPI int GLAD_GL_VERSION_1_5; +typedef void (APIENTRYP PFNGLGENQUERIESPROC)(GLsizei n, GLuint *ids); +GLAPI PFNGLGENQUERIESPROC glad_glGenQueries; +#define glGenQueries glad_glGenQueries +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint *ids); +GLAPI PFNGLDELETEQUERIESPROC glad_glDeleteQueries; +#define glDeleteQueries glad_glDeleteQueries +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC)(GLuint id); +GLAPI PFNGLISQUERYPROC glad_glIsQuery; +#define glIsQuery glad_glIsQuery +typedef void (APIENTRYP PFNGLBEGINQUERYPROC)(GLenum target, GLuint id); +GLAPI PFNGLBEGINQUERYPROC glad_glBeginQuery; +#define glBeginQuery glad_glBeginQuery +typedef void (APIENTRYP PFNGLENDQUERYPROC)(GLenum target); +GLAPI PFNGLENDQUERYPROC glad_glEndQuery; +#define glEndQuery glad_glEndQuery +typedef void (APIENTRYP PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETQUERYIVPROC glad_glGetQueryiv; +#define glGetQueryiv glad_glGetQueryiv +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint *params); +GLAPI PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; +#define glGetQueryObjectiv glad_glGetQueryObjectiv +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint *params); +GLAPI PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; +#define glGetQueryObjectuiv glad_glGetQueryObjectuiv +typedef void (APIENTRYP PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer); +GLAPI PFNGLBINDBUFFERPROC glad_glBindBuffer; +#define glBindBuffer glad_glBindBuffer +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint *buffers); +GLAPI PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; +#define glDeleteBuffers glad_glDeleteBuffers +typedef void (APIENTRYP PFNGLGENBUFFERSPROC)(GLsizei n, GLuint *buffers); +GLAPI PFNGLGENBUFFERSPROC glad_glGenBuffers; +#define glGenBuffers glad_glGenBuffers +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC)(GLuint buffer); +GLAPI PFNGLISBUFFERPROC glad_glIsBuffer; +#define glIsBuffer glad_glIsBuffer +typedef void (APIENTRYP PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void *data, GLenum usage); +GLAPI PFNGLBUFFERDATAPROC glad_glBufferData; +#define glBufferData glad_glBufferData +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; +#define glBufferSubData glad_glBufferSubData +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, void *data); +GLAPI PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; +#define glGetBufferSubData glad_glGetBufferSubData +typedef void * (APIENTRYP PFNGLMAPBUFFERPROC)(GLenum target, GLenum access); +GLAPI PFNGLMAPBUFFERPROC glad_glMapBuffer; +#define glMapBuffer glad_glMapBuffer +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC)(GLenum target); +GLAPI PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; +#define glUnmapBuffer glad_glUnmapBuffer +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; +#define glGetBufferParameteriv glad_glGetBufferParameteriv +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void **params); +GLAPI PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; +#define glGetBufferPointerv glad_glGetBufferPointerv +#endif +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +GLAPI int GLAD_GL_VERSION_2_0; +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha); +GLAPI PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; +#define glBlendEquationSeparate glad_glBlendEquationSeparate +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum *bufs); +GLAPI PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; +#define glDrawBuffers glad_glDrawBuffers +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; +#define glStencilOpSeparate glad_glStencilOpSeparate +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask); +GLAPI PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; +#define glStencilFuncSeparate glad_glStencilFuncSeparate +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask); +GLAPI PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; +#define glStencilMaskSeparate glad_glStencilMaskSeparate +typedef void (APIENTRYP PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader); +GLAPI PFNGLATTACHSHADERPROC glad_glAttachShader; +#define glAttachShader glad_glAttachShader +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar *name); +GLAPI PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; +#define glBindAttribLocation glad_glBindAttribLocation +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC)(GLuint shader); +GLAPI PFNGLCOMPILESHADERPROC glad_glCompileShader; +#define glCompileShader glad_glCompileShader +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC)(void); +GLAPI PFNGLCREATEPROGRAMPROC glad_glCreateProgram; +#define glCreateProgram glad_glCreateProgram +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC)(GLenum type); +GLAPI PFNGLCREATESHADERPROC glad_glCreateShader; +#define glCreateShader glad_glCreateShader +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC)(GLuint program); +GLAPI PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; +#define glDeleteProgram glad_glDeleteProgram +typedef void (APIENTRYP PFNGLDELETESHADERPROC)(GLuint shader); +GLAPI PFNGLDELETESHADERPROC glad_glDeleteShader; +#define glDeleteShader glad_glDeleteShader +typedef void (APIENTRYP PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader); +GLAPI PFNGLDETACHSHADERPROC glad_glDetachShader; +#define glDetachShader glad_glDetachShader +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index); +GLAPI PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; +#define glDisableVertexAttribArray glad_glDisableVertexAttribArray +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index); +GLAPI PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; +#define glEnableVertexAttribArray glad_glEnableVertexAttribArray +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; +#define glGetActiveAttrib glad_glGetActiveAttrib +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; +#define glGetActiveUniform glad_glGetActiveUniform +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); +GLAPI PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; +#define glGetAttachedShaders glad_glGetAttachedShaders +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar *name); +GLAPI PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; +#define glGetAttribLocation glad_glGetAttribLocation +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint *params); +GLAPI PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; +#define glGetProgramiv glad_glGetProgramiv +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; +#define glGetProgramInfoLog glad_glGetProgramInfoLog +typedef void (APIENTRYP PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint *params); +GLAPI PFNGLGETSHADERIVPROC glad_glGetShaderiv; +#define glGetShaderiv glad_glGetShaderiv +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; +#define glGetShaderInfoLog glad_glGetShaderInfoLog +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +GLAPI PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; +#define glGetShaderSource glad_glGetShaderSource +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar *name); +GLAPI PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; +#define glGetUniformLocation glad_glGetUniformLocation +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat *params); +GLAPI PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; +#define glGetUniformfv glad_glGetUniformfv +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint *params); +GLAPI PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; +#define glGetUniformiv glad_glGetUniformiv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC)(GLuint index, GLenum pname, GLdouble *params); +GLAPI PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; +#define glGetVertexAttribdv glad_glGetVertexAttribdv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat *params); +GLAPI PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; +#define glGetVertexAttribfv glad_glGetVertexAttribfv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint *params); +GLAPI PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; +#define glGetVertexAttribiv glad_glGetVertexAttribiv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void **pointer); +GLAPI PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; +#define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC)(GLuint program); +GLAPI PFNGLISPROGRAMPROC glad_glIsProgram; +#define glIsProgram glad_glIsProgram +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC)(GLuint shader); +GLAPI PFNGLISSHADERPROC glad_glIsShader; +#define glIsShader glad_glIsShader +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC)(GLuint program); +GLAPI PFNGLLINKPROGRAMPROC glad_glLinkProgram; +#define glLinkProgram glad_glLinkProgram +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); +GLAPI PFNGLSHADERSOURCEPROC glad_glShaderSource; +#define glShaderSource glad_glShaderSource +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC)(GLuint program); +GLAPI PFNGLUSEPROGRAMPROC glad_glUseProgram; +#define glUseProgram glad_glUseProgram +typedef void (APIENTRYP PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0); +GLAPI PFNGLUNIFORM1FPROC glad_glUniform1f; +#define glUniform1f glad_glUniform1f +typedef void (APIENTRYP PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1); +GLAPI PFNGLUNIFORM2FPROC glad_glUniform2f; +#define glUniform2f glad_glUniform2f +typedef void (APIENTRYP PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI PFNGLUNIFORM3FPROC glad_glUniform3f; +#define glUniform3f glad_glUniform3f +typedef void (APIENTRYP PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI PFNGLUNIFORM4FPROC glad_glUniform4f; +#define glUniform4f glad_glUniform4f +typedef void (APIENTRYP PFNGLUNIFORM1IPROC)(GLint location, GLint v0); +GLAPI PFNGLUNIFORM1IPROC glad_glUniform1i; +#define glUniform1i glad_glUniform1i +typedef void (APIENTRYP PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1); +GLAPI PFNGLUNIFORM2IPROC glad_glUniform2i; +#define glUniform2i glad_glUniform2i +typedef void (APIENTRYP PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2); +GLAPI PFNGLUNIFORM3IPROC glad_glUniform3i; +#define glUniform3i glad_glUniform3i +typedef void (APIENTRYP PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI PFNGLUNIFORM4IPROC glad_glUniform4i; +#define glUniform4i glad_glUniform4i +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat *value); +GLAPI PFNGLUNIFORM1FVPROC glad_glUniform1fv; +#define glUniform1fv glad_glUniform1fv +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat *value); +GLAPI PFNGLUNIFORM2FVPROC glad_glUniform2fv; +#define glUniform2fv glad_glUniform2fv +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat *value); +GLAPI PFNGLUNIFORM3FVPROC glad_glUniform3fv; +#define glUniform3fv glad_glUniform3fv +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat *value); +GLAPI PFNGLUNIFORM4FVPROC glad_glUniform4fv; +#define glUniform4fv glad_glUniform4fv +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint *value); +GLAPI PFNGLUNIFORM1IVPROC glad_glUniform1iv; +#define glUniform1iv glad_glUniform1iv +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint *value); +GLAPI PFNGLUNIFORM2IVPROC glad_glUniform2iv; +#define glUniform2iv glad_glUniform2iv +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint *value); +GLAPI PFNGLUNIFORM3IVPROC glad_glUniform3iv; +#define glUniform3iv glad_glUniform3iv +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint *value); +GLAPI PFNGLUNIFORM4IVPROC glad_glUniform4iv; +#define glUniform4iv glad_glUniform4iv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; +#define glUniformMatrix2fv glad_glUniformMatrix2fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; +#define glUniformMatrix3fv glad_glUniformMatrix3fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; +#define glUniformMatrix4fv glad_glUniformMatrix4fv +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC)(GLuint program); +GLAPI PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; +#define glValidateProgram glad_glValidateProgram +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC)(GLuint index, GLdouble x); +GLAPI PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; +#define glVertexAttrib1d glad_glVertexAttrib1d +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC)(GLuint index, const GLdouble *v); +GLAPI PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; +#define glVertexAttrib1dv glad_glVertexAttrib1dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x); +GLAPI PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; +#define glVertexAttrib1f glad_glVertexAttrib1f +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat *v); +GLAPI PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; +#define glVertexAttrib1fv glad_glVertexAttrib1fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC)(GLuint index, GLshort x); +GLAPI PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; +#define glVertexAttrib1s glad_glVertexAttrib1s +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; +#define glVertexAttrib1sv glad_glVertexAttrib1sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC)(GLuint index, GLdouble x, GLdouble y); +GLAPI PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; +#define glVertexAttrib2d glad_glVertexAttrib2d +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC)(GLuint index, const GLdouble *v); +GLAPI PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; +#define glVertexAttrib2dv glad_glVertexAttrib2dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y); +GLAPI PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; +#define glVertexAttrib2f glad_glVertexAttrib2f +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat *v); +GLAPI PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; +#define glVertexAttrib2fv glad_glVertexAttrib2fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC)(GLuint index, GLshort x, GLshort y); +GLAPI PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; +#define glVertexAttrib2s glad_glVertexAttrib2s +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; +#define glVertexAttrib2sv glad_glVertexAttrib2sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; +#define glVertexAttrib3d glad_glVertexAttrib3d +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC)(GLuint index, const GLdouble *v); +GLAPI PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; +#define glVertexAttrib3dv glad_glVertexAttrib3dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; +#define glVertexAttrib3f glad_glVertexAttrib3f +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat *v); +GLAPI PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; +#define glVertexAttrib3fv glad_glVertexAttrib3fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC)(GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; +#define glVertexAttrib3s glad_glVertexAttrib3s +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; +#define glVertexAttrib3sv glad_glVertexAttrib3sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC)(GLuint index, const GLbyte *v); +GLAPI PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; +#define glVertexAttrib4Nbv glad_glVertexAttrib4Nbv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC)(GLuint index, const GLint *v); +GLAPI PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; +#define glVertexAttrib4Niv glad_glVertexAttrib4Niv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; +#define glVertexAttrib4Nsv glad_glVertexAttrib4Nsv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; +#define glVertexAttrib4Nub glad_glVertexAttrib4Nub +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC)(GLuint index, const GLubyte *v); +GLAPI PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; +#define glVertexAttrib4Nubv glad_glVertexAttrib4Nubv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC)(GLuint index, const GLuint *v); +GLAPI PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; +#define glVertexAttrib4Nuiv glad_glVertexAttrib4Nuiv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC)(GLuint index, const GLushort *v); +GLAPI PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; +#define glVertexAttrib4Nusv glad_glVertexAttrib4Nusv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC)(GLuint index, const GLbyte *v); +GLAPI PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; +#define glVertexAttrib4bv glad_glVertexAttrib4bv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; +#define glVertexAttrib4d glad_glVertexAttrib4d +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC)(GLuint index, const GLdouble *v); +GLAPI PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; +#define glVertexAttrib4dv glad_glVertexAttrib4dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; +#define glVertexAttrib4f glad_glVertexAttrib4f +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat *v); +GLAPI PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; +#define glVertexAttrib4fv glad_glVertexAttrib4fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC)(GLuint index, const GLint *v); +GLAPI PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; +#define glVertexAttrib4iv glad_glVertexAttrib4iv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; +#define glVertexAttrib4s glad_glVertexAttrib4s +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; +#define glVertexAttrib4sv glad_glVertexAttrib4sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC)(GLuint index, const GLubyte *v); +GLAPI PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; +#define glVertexAttrib4ubv glad_glVertexAttrib4ubv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC)(GLuint index, const GLuint *v); +GLAPI PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; +#define glVertexAttrib4uiv glad_glVertexAttrib4uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC)(GLuint index, const GLushort *v); +GLAPI PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; +#define glVertexAttrib4usv glad_glVertexAttrib4usv +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +GLAPI PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; +#define glVertexAttribPointer glad_glVertexAttribPointer +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_opengles2_khrplatform.h b/tcod_sys/libtcod/src/vendor/khrplatform.h similarity index 94% rename from tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_opengles2_khrplatform.h rename to tcod_sys/libtcod/src/vendor/khrplatform.h index c9e6f17d3..975bbffed 100644 --- a/tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_opengles2_khrplatform.h +++ b/tcod_sys/libtcod/src/vendor/khrplatform.h @@ -2,7 +2,7 @@ #define __khrplatform_h_ /* -** Copyright (c) 2008-2009 The Khronos Group Inc. +** Copyright (c) 2008-2018 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the @@ -26,18 +26,16 @@ /* Khronos platform-specific types and definitions. * - * $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $ + * The master copy of khrplatform.h is maintained in the Khronos EGL + * Registry repository at https://github.com/KhronosGroup/EGL-Registry + * The last semantic modification to khrplatform.h was at commit ID: + * 67a3e0864c2d75ea5287b9f3d2eb74a745936692 * * Adopters may modify this file to suit their platform. Adopters are * encouraged to submit platform specific modifications to the Khronos * group so that they can be included in future versions of this file. - * Please submit changes by sending them to the public Khronos Bugzilla - * (http://khronos.org/bugzilla) by filing a bug against product - * "Khronos (general)" component "Registry". - * - * A predefined template which fills in some of the bug fields can be - * reached using http://tinyurl.com/khrplatform-h-bugreport, but you - * must create a Bugzilla login first. + * Please submit changes by filing pull requests or issues on + * the EGL Registry repository linked above. * * * See the Implementer's Guidelines for information about where this file @@ -101,6 +99,8 @@ # define KHRONOS_APICALL __declspec(dllimport) #elif defined (__SYMBIAN32__) # define KHRONOS_APICALL IMPORT_C +#elif defined(__ANDROID__) +# define KHRONOS_APICALL __attribute__((visibility("default"))) #else # define KHRONOS_APICALL #endif @@ -223,7 +223,7 @@ typedef signed short int khronos_int16_t; typedef unsigned short int khronos_uint16_t; /* - * Types that differ between LLP64 and LP64 architectures - in LLP64, + * Types that differ between LLP64 and LP64 architectures - in LLP64, * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears * to be the only LLP64 architecture in current use. */ diff --git a/tcod_sys/libtcod/src/png/lodepng.c b/tcod_sys/libtcod/src/vendor/lodepng.c similarity index 96% rename from tcod_sys/libtcod/src/png/lodepng.c rename to tcod_sys/libtcod/src/vendor/lodepng.c index 8c78758ff..6568bba8c 100644 --- a/tcod_sys/libtcod/src/png/lodepng.c +++ b/tcod_sys/libtcod/src/vendor/lodepng.c @@ -1,7 +1,7 @@ /* -LodePNG version 20160501 +LodePNG version 20180611 -Copyright (c) 2005-2016 Lode Vandevenne +Copyright (c) 2005-2018 Lode Vandevenne This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -39,7 +39,7 @@ Rename this file to lodepng.cpp to use it for C++, or to lodepng.c to use it for #pragma warning( disable : 4996 ) /*VS does not like fopen, but fopen_s is not standard C so unusable here*/ #endif /*_MSC_VER */ -const char* LODEPNG_VERSION_STRING = "20160501"; +const char* LODEPNG_VERSION_STRING = "20180611"; /* This source file is built up in the following large parts. The code sections @@ -62,11 +62,17 @@ from here.*/ #ifdef LODEPNG_COMPILE_ALLOCATORS static void* lodepng_malloc(size_t size) { +#ifdef LODEPNG_MAX_ALLOC + if(size > LODEPNG_MAX_ALLOC) return 0; +#endif return malloc(size); } static void* lodepng_realloc(void* ptr, size_t new_size) { +#ifdef LODEPNG_MAX_ALLOC + if(new_size > LODEPNG_MAX_ALLOC) return 0; +#endif return realloc(ptr, new_size); } @@ -86,6 +92,8 @@ void lodepng_free(void* ptr); /* ////////////////////////////////////////////////////////////////////////// */ /* ////////////////////////////////////////////////////////////////////////// */ +#define LODEPNG_MAX(a, b) (((a) > (b)) ? (a) : (b)) + /* Often in case of an error a value is assigned to a variable and then it breaks out of a loop (to go to the cleanup phase of a function). This macro does that. @@ -795,7 +803,7 @@ unsigned lodepng_huffman_code_lengths(unsigned* lengths, const unsigned* frequen BPMNode* leaves; /*the symbols, only those with > 0 frequency*/ if(numcodes == 0) return 80; /*error: a tree of 0 symbols is not supposed to be made*/ - if((1u << maxbitlen) < numcodes) return 80; /*error: represent all symbols*/ + if((1u << maxbitlen) < (unsigned)numcodes) return 80; /*error: represent all symbols*/ leaves = (BPMNode*)lodepng_malloc(numcodes * sizeof(*leaves)); if(!leaves) return 83; /*alloc fail*/ @@ -1171,7 +1179,7 @@ static unsigned inflateHuffmanBlock(ucvector* out, const unsigned char* in, size code_d = huffmanDecodeSymbol(in, bp, &tree_d, inbitlength); if(code_d > 29) { - if(code_ll == (unsigned)(-1)) /*huffmanDecodeSymbol returns (unsigned)(-1) in case of error*/ + if(code_d == (unsigned)(-1)) /*huffmanDecodeSymbol returns (unsigned)(-1) in case of error*/ { /*return error code 10 or 11 depending on the situation that happened in huffmanDecodeSymbol (10=no endcode, 11=wrong jump outside of tree)*/ @@ -1455,11 +1463,11 @@ static void updateHashChain(Hash* hash, size_t wpos, unsigned hashval, unsigned { hash->val[wpos] = (int)hashval; if(hash->head[hashval] != -1) hash->chain[wpos] = hash->head[hashval]; - hash->head[hashval] = wpos; + hash->head[hashval] = (int)wpos; hash->zeros[wpos] = numzeros; if(hash->headz[numzeros] != -1) hash->chainz[wpos] = hash->headz[numzeros]; - hash->headz[numzeros] = wpos; + hash->headz[numzeros] = (int)wpos; } /* @@ -1531,7 +1539,7 @@ static unsigned encodeLZ77(uivector* out, Hash* hash, for(;;) { if(chainlength++ >= maxchainlength) break; - current_offset = hashpos <= wpos ? wpos - hashpos : wpos - hashpos + windowsize; + current_offset = (unsigned)(hashpos <= wpos ? wpos - hashpos : wpos - hashpos + windowsize); if(current_offset < prev_offset) break; /*stop when went completely around the circular buffer*/ prev_offset = current_offset; @@ -2090,13 +2098,13 @@ static unsigned deflate(unsigned char** out, size_t* outsize, static unsigned update_adler32(unsigned adler, const unsigned char* data, unsigned len) { - unsigned s1 = adler & 0xffff; - unsigned s2 = (adler >> 16) & 0xffff; + unsigned s1 = adler & 0xffff; + unsigned s2 = (adler >> 16) & 0xffff; while(len > 0) { - /*at least 5550 sums can be done before the sums overflow, saving a lot of module divisions*/ - unsigned amount = len > 5550 ? 5550 : len; + /*at least 5552 sums can be done before the sums overflow, saving a lot of module divisions*/ + unsigned amount = len > 5552 ? 5552 : len; len -= amount; while(amount > 0) { @@ -2621,15 +2629,10 @@ static int lodepng_color_mode_equal(const LodePNGColorMode* a, const LodePNGColo if(a->key_g != b->key_g) return 0; if(a->key_b != b->key_b) return 0; } - /*if one of the palette sizes is 0, then we consider it to be the same as the - other: it means that e.g. the palette was not given by the user and should be - considered the same as the palette inside the PNG.*/ - if(1/*a->palettesize != 0 && b->palettesize != 0*/) { - if(a->palettesize != b->palettesize) return 0; - for(i = 0; i != a->palettesize * 4; ++i) - { - if(a->palette[i] != b->palette[i]) return 0; - } + if(a->palettesize != b->palettesize) return 0; + for(i = 0; i != a->palettesize * 4; ++i) + { + if(a->palette[i] != b->palette[i]) return 0; } return 1; } @@ -2705,32 +2708,75 @@ unsigned lodepng_can_have_alpha(const LodePNGColorMode* info) || lodepng_has_palette_alpha(info); } -size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode* color) +size_t lodepng_get_raw_size_lct(unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) { - /*will not overflow for any color type if roughly w * h < 268435455*/ - size_t bpp = lodepng_get_bpp(color); - size_t n = w * h; + size_t bpp = lodepng_get_bpp_lct(colortype, bitdepth); + size_t n = (size_t)w * (size_t)h; return ((n / 8) * bpp) + ((n & 7) * bpp + 7) / 8; } -size_t lodepng_get_raw_size_lct(unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) +size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode* color) { - /*will not overflow for any color type if roughly w * h < 268435455*/ - size_t bpp = lodepng_get_bpp_lct(colortype, bitdepth); - size_t n = w * h; - return ((n / 8) * bpp) + ((n & 7) * bpp + 7) / 8; + return lodepng_get_raw_size_lct(w, h, color->colortype, color->bitdepth); } #ifdef LODEPNG_COMPILE_PNG #ifdef LODEPNG_COMPILE_DECODER -/*in an idat chunk, each scanline is a multiple of 8 bits, unlike the lodepng output buffer*/ + +/*in an idat chunk, each scanline is a multiple of 8 bits, unlike the lodepng output buffer, +and in addition has one extra byte per line: the filter byte. So this gives a larger +result than lodepng_get_raw_size. */ static size_t lodepng_get_raw_size_idat(unsigned w, unsigned h, const LodePNGColorMode* color) { - /*will not overflow for any color type if roughly w * h < 268435455*/ size_t bpp = lodepng_get_bpp(color); - size_t line = ((w / 8) * bpp) + ((w & 7) * bpp + 7) / 8; - return h * line; + /* + 1 for the filter byte, and possibly plus padding bits per line */ + size_t line = ((size_t)(w / 8) * bpp) + 1 + ((w & 7) * bpp + 7) / 8; + return (size_t)h * line; +} + +/* Safely check if multiplying two integers will overflow (no undefined +behavior, compiler removing the code, etc...) and output result. */ +static int lodepng_mulofl(size_t a, size_t b, size_t* result) +{ + *result = a * b; /* Unsigned multiplication is well defined and safe in C90 */ + return (a != 0 && *result / a != b); +} + +/* Safely check if adding two integers will overflow (no undefined +behavior, compiler removing the code, etc...) and output result. */ +static int lodepng_addofl(size_t a, size_t b, size_t* result) +{ + *result = a + b; /* Unsigned addition is well defined and safe in C90 */ + return *result < a; +} + +/*Safely checks whether size_t overflow can be caused due to amount of pixels. +This check is overcautious rather than precise. If this check indicates no overflow, +you can safely compute in a size_t (but not an unsigned): +-(size_t)w * (size_t)h * 8 +-amount of bytes in IDAT (including filter, padding and Adam7 bytes) +-amount of bytes in raw color model +Returns 1 if overflow possible, 0 if not. +*/ +static int lodepng_pixel_overflow(unsigned w, unsigned h, + const LodePNGColorMode* pngcolor, const LodePNGColorMode* rawcolor) +{ + size_t bpp = LODEPNG_MAX(lodepng_get_bpp(pngcolor), lodepng_get_bpp(rawcolor)); + size_t numpixels, total; + size_t line; /* bytes per line in worst case */ + + if(lodepng_mulofl((size_t)w, (size_t)h, &numpixels)) return 1; + if(lodepng_mulofl(numpixels, 8, &total)) return 1; /* bit pointer with 8-bit color, or 8 bytes per channel color */ + + /* Bytes per scanline with the expression "(w / 8) * bpp) + ((w & 7) * bpp + 7) / 8" */ + if(lodepng_mulofl((size_t)(w / 8), bpp, &line)) return 1; + if(lodepng_addofl(line, ((w & 7) * bpp + 7) / 8, &line)) return 1; + + if(lodepng_addofl(line, 5, &line)) return 1; /* 5 bytes overhead per line: 1 filterbyte, 4 for Adam7 worst case */ + if(lodepng_mulofl(line, h, &total)) return 1; /* Total bytes in worst case */ + + return 0; /* no overflow */ } #endif /*LODEPNG_COMPILE_DECODER*/ #endif /*LODEPNG_COMPILE_PNG*/ @@ -3462,7 +3508,8 @@ unsigned lodepng_convert(unsigned char* out, const unsigned char* in, { size_t i; ColorTree tree; - size_t numpixels = w * h; + size_t numpixels = (size_t)w * (size_t)h; + unsigned error = 0; if(lodepng_color_mode_equal(mode_out, mode_in)) { @@ -3475,7 +3522,7 @@ unsigned lodepng_convert(unsigned char* out, const unsigned char* in, { size_t palettesize = mode_out->palettesize; const unsigned char* palette = mode_out->palette; - size_t palsize = 1u << mode_out->bitdepth; + size_t palsize = (size_t)1u << mode_out->bitdepth; /*if the user specified output palette but did not give the values, assume they want the values of the input color type (assuming that one is palette). Note that we never create a new palette ourselves.*/ @@ -3483,13 +3530,22 @@ unsigned lodepng_convert(unsigned char* out, const unsigned char* in, { palettesize = mode_in->palettesize; palette = mode_in->palette; + /*if the input was also palette with same bitdepth, then the color types are also + equal, so copy literally. This to preserve the exact indices that were in the PNG + even in case there are duplicate colors in the palette.*/ + if (mode_in->colortype == LCT_PALETTE && mode_in->bitdepth == mode_out->bitdepth) + { + size_t numbytes = lodepng_get_raw_size(w, h, mode_in); + for(i = 0; i != numbytes; ++i) out[i] = in[i]; + return 0; + } } if(palettesize < palsize) palsize = palettesize; color_tree_init(&tree); for(i = 0; i != palsize; ++i) { const unsigned char* p = &palette[i * 4]; - color_tree_add(&tree, p[0], p[1], p[2], p[3], i); + color_tree_add(&tree, p[0], p[1], p[2], p[3], (unsigned)i); } } @@ -3516,7 +3572,8 @@ unsigned lodepng_convert(unsigned char* out, const unsigned char* in, for(i = 0; i != numpixels; ++i) { getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in); - CERROR_TRY_RETURN(rgba8ToPixel(out, i, mode_out, &tree, r, g, b, a)); + error = rgba8ToPixel(out, i, mode_out, &tree, r, g, b, a); + if (error) break; } } @@ -3525,7 +3582,7 @@ unsigned lodepng_convert(unsigned char* out, const unsigned char* in, color_tree_cleanup(&tree); } - return 0; /*no error*/ + return error; } #ifdef LODEPNG_COMPILE_ENCODER @@ -3534,8 +3591,8 @@ void lodepng_color_profile_init(LodePNGColorProfile* profile) { profile->colored = 0; profile->key = 0; - profile->alpha = 0; profile->key_r = profile->key_g = profile->key_b = 0; + profile->alpha = 0; profile->numcolors = 0; profile->bits = 1; } @@ -3571,7 +3628,7 @@ unsigned lodepng_get_color_profile(LodePNGColorProfile* profile, unsigned error = 0; size_t i; ColorTree tree; - size_t numpixels = w * h; + size_t numpixels = (size_t)w * (size_t)h; unsigned colored_done = lodepng_is_greyscale_type(mode) ? 1 : 0; unsigned alpha_done = lodepng_can_have_alpha(mode) ? 0 : 1; @@ -3622,8 +3679,8 @@ unsigned lodepng_get_color_profile(LodePNGColorProfile* profile, if(a != 65535 && (a != 0 || (profile->key && !matchkey))) { profile->alpha = 1; + profile->key = 0; alpha_done = 1; - if(profile->bits < 8) profile->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ } else if(a == 0 && !profile->alpha && !profile->key) { @@ -3636,6 +3693,7 @@ unsigned lodepng_get_color_profile(LodePNGColorProfile* profile, { /* Color key cannot be used if an opaque pixel also has that RGB color. */ profile->alpha = 1; + profile->key = 0; alpha_done = 1; } } @@ -3651,6 +3709,7 @@ unsigned lodepng_get_color_profile(LodePNGColorProfile* profile, { /* Color key cannot be used if an opaque pixel also has that RGB color. */ profile->alpha = 1; + profile->key = 0; alpha_done = 1; } } @@ -3684,6 +3743,7 @@ unsigned lodepng_get_color_profile(LodePNGColorProfile* profile, if(a != 255 && (a != 0 || (profile->key && !matchkey))) { profile->alpha = 1; + profile->key = 0; alpha_done = 1; if(profile->bits < 8) profile->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ } @@ -3698,6 +3758,7 @@ unsigned lodepng_get_color_profile(LodePNGColorProfile* profile, { /* Color key cannot be used if an opaque pixel also has that RGB color. */ profile->alpha = 1; + profile->key = 0; alpha_done = 1; if(profile->bits < 8) profile->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ } @@ -3734,7 +3795,9 @@ unsigned lodepng_get_color_profile(LodePNGColorProfile* profile, { /* Color key cannot be used if an opaque pixel also has that RGB color. */ profile->alpha = 1; + profile->key = 0; alpha_done = 1; + if(profile->bits < 8) profile->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ } } } @@ -3760,24 +3823,26 @@ unsigned lodepng_auto_choose_color(LodePNGColorMode* mode_out, { LodePNGColorProfile prof; unsigned error = 0; - unsigned i, n, palettebits, grey_ok, palette_ok; + unsigned palettebits, palette_ok; + size_t i, n; + size_t numpixels = (size_t)w * (size_t)h; lodepng_color_profile_init(&prof); error = lodepng_get_color_profile(&prof, image, w, h, mode_in); if(error) return error; mode_out->key_defined = 0; - if(prof.key && w * h <= 16) + if(prof.key && numpixels <= 16) { prof.alpha = 1; /*too few pixels to justify tRNS chunk overhead*/ + prof.key = 0; if(prof.bits < 8) prof.bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ } - grey_ok = !prof.colored && !prof.alpha; /*grey without alpha, with potentially low bits*/ n = prof.numcolors; palettebits = n <= 2 ? 1 : (n <= 4 ? 2 : (n <= 16 ? 4 : 8)); - palette_ok = n <= 256 && (n * 2 < w * h) && prof.bits <= 8; - if(w * h < n * 2) palette_ok = 0; /*don't add palette overhead if image has only a few pixels*/ - if(grey_ok && prof.bits <= palettebits) palette_ok = 0; /*grey is less overhead*/ + palette_ok = n <= 256 && prof.bits <= 8; + if(numpixels < n * 2) palette_ok = 0; /*don't add palette overhead if image has only a few pixels*/ + if(!prof.colored && prof.bits <= palettebits) palette_ok = 0; /*grey is less overhead*/ if(palette_ok) { @@ -3806,7 +3871,7 @@ unsigned lodepng_auto_choose_color(LodePNGColorMode* mode_out, mode_out->colortype = prof.alpha ? (prof.colored ? LCT_RGBA : LCT_GREY_ALPHA) : (prof.colored ? LCT_RGB : LCT_GREY); - if(prof.key && !prof.alpha) + if(prof.key) { unsigned mask = (1u << mode_out->bitdepth) - 1u; /*profile always uses 16-bit, mask converts it*/ mode_out->key_r = prof.key_r & mask; @@ -4323,7 +4388,7 @@ static unsigned readChunk_tEXt(LodePNGInfo* info, const unsigned char* data, siz string2_begin = length + 1; /*skip keyword null terminator*/ - length = chunkLength < string2_begin ? 0 : chunkLength - string2_begin; + length = (unsigned)(chunkLength < string2_begin ? 0 : chunkLength - string2_begin); str = (char*)lodepng_malloc(length + 1); if(!str) CERROR_BREAK(error, 83); /*alloc fail*/ @@ -4371,7 +4436,7 @@ static unsigned readChunk_zTXt(LodePNGInfo* info, const LodePNGDecompressSetting string2_begin = length + 2; if(string2_begin > chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/ - length = chunkLength - string2_begin; + length = (unsigned)chunkLength - string2_begin; /*will fail if zlib error, e.g. if length is too small*/ error = zlib_decompress(&decoded.data, &decoded.size, (unsigned char*)(&data[string2_begin]), @@ -4451,7 +4516,7 @@ static unsigned readChunk_iTXt(LodePNGInfo* info, const LodePNGDecompressSetting /*read the actual text*/ begin += length + 1; - length = chunkLength < begin ? 0 : chunkLength - begin; + length = (unsigned)chunkLength < begin ? 0 : (unsigned)chunkLength - begin; if(compressed) { @@ -4523,7 +4588,6 @@ static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h, ucvector idat; /*the data from idat chunks*/ ucvector scanlines; size_t predict; - size_t numpixels; size_t outsize = 0; /*for unknown chunk order*/ @@ -4538,13 +4602,10 @@ static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h, state->error = lodepng_inspect(w, h, state, in, insize); /*reads header and resets other parameters in state->info_png*/ if(state->error) return; - numpixels = *w * *h; - - /*multiplication overflow*/ - if(*h != 0 && numpixels / *h != *w) CERROR_RETURN(state->error, 92); - /*multiplication overflow possible further below. Allows up to 2^31-1 pixel - bytes with 16-bit RGBA, the rest is room for filter bytes.*/ - if(numpixels > 268435455) CERROR_RETURN(state->error, 92); + if(lodepng_pixel_overflow(*w, *h, &state->info_png.color, &state->info_raw)) + { + CERROR_RETURN(state->error, 92); /*overflow possible due to amount of pixels*/ + } ucvector_init(&idat); chunk = &in[33]; /*first byte of the first chunk after the header*/ @@ -4557,12 +4618,20 @@ static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* data; /*the data in the chunk*/ /*error: size of the in buffer too small to contain next chunk*/ - if((size_t)((chunk - in) + 12) > insize || chunk < in) CERROR_BREAK(state->error, 30); + if((size_t)((chunk - in) + 12) > insize || chunk < in) + { + if(state->decoder.ignore_end) break; /*other errors may still happen though*/ + CERROR_BREAK(state->error, 30); + } /*length of the data of the chunk, excluding the length bytes, chunk type and CRC bytes*/ chunkLength = lodepng_chunk_length(chunk); /*error: chunk length larger than the max PNG chunk size*/ - if(chunkLength > 2147483647) CERROR_BREAK(state->error, 63); + if(chunkLength > 2147483647) + { + if(state->decoder.ignore_end) break; /*other errors may still happen though*/ + CERROR_BREAK(state->error, 63); + } if((size_t)((chunk - in) + chunkLength + 12) > insize || (chunk + chunkLength + 12) < in) { @@ -4575,7 +4644,9 @@ static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h, if(lodepng_chunk_type_equals(chunk, "IDAT")) { size_t oldsize = idat.size; - if(!ucvector_resize(&idat, oldsize + chunkLength)) CERROR_BREAK(state->error, 83 /*alloc fail*/); + size_t newsize; + if(lodepng_addofl(oldsize, chunkLength, &newsize)) CERROR_BREAK(state->error, 95); + if(!ucvector_resize(&idat, newsize)) CERROR_BREAK(state->error, 83 /*alloc fail*/); for(i = 0; i != chunkLength; ++i) idat.data[oldsize + i] = data[i]; #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS critical_pos = 3; @@ -4649,7 +4720,10 @@ static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h, else /*it's not an implemented chunk type, so ignore it: skip over the data*/ { /*error: unknown critical chunk (5th bit of first byte of chunk type is 0)*/ - if(!lodepng_chunk_ancillary(chunk)) CERROR_BREAK(state->error, 69); + if(!state->decoder.ignore_critical && !lodepng_chunk_ancillary(chunk)) + { + CERROR_BREAK(state->error, 69); + } unknown = 1; #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS @@ -4675,21 +4749,20 @@ static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h, If the decompressed size does not match the prediction, the image must be corrupt.*/ if(state->info_png.interlace_method == 0) { - /*The extra *h is added because this are the filter bytes every scanline starts with*/ - predict = lodepng_get_raw_size_idat(*w, *h, &state->info_png.color) + *h; + predict = lodepng_get_raw_size_idat(*w, *h, &state->info_png.color); } else { /*Adam-7 interlaced: predicted size is the sum of the 7 sub-images sizes*/ const LodePNGColorMode* color = &state->info_png.color; predict = 0; - predict += lodepng_get_raw_size_idat((*w + 7) >> 3, (*h + 7) >> 3, color) + ((*h + 7) >> 3); - if(*w > 4) predict += lodepng_get_raw_size_idat((*w + 3) >> 3, (*h + 7) >> 3, color) + ((*h + 7) >> 3); - predict += lodepng_get_raw_size_idat((*w + 3) >> 2, (*h + 3) >> 3, color) + ((*h + 3) >> 3); - if(*w > 2) predict += lodepng_get_raw_size_idat((*w + 1) >> 2, (*h + 3) >> 2, color) + ((*h + 3) >> 2); - predict += lodepng_get_raw_size_idat((*w + 1) >> 1, (*h + 1) >> 2, color) + ((*h + 1) >> 2); - if(*w > 1) predict += lodepng_get_raw_size_idat((*w + 0) >> 1, (*h + 1) >> 1, color) + ((*h + 1) >> 1); - predict += lodepng_get_raw_size_idat((*w + 0), (*h + 0) >> 1, color) + ((*h + 0) >> 1); + predict += lodepng_get_raw_size_idat((*w + 7) >> 3, (*h + 7) >> 3, color); + if(*w > 4) predict += lodepng_get_raw_size_idat((*w + 3) >> 3, (*h + 7) >> 3, color); + predict += lodepng_get_raw_size_idat((*w + 3) >> 2, (*h + 3) >> 3, color); + if(*w > 2) predict += lodepng_get_raw_size_idat((*w + 1) >> 2, (*h + 3) >> 2, color); + predict += lodepng_get_raw_size_idat((*w + 1) >> 1, (*h + 1) >> 2, color); + if(*w > 1) predict += lodepng_get_raw_size_idat((*w + 0) >> 1, (*h + 1) >> 1, color); + predict += lodepng_get_raw_size_idat((*w + 0), (*h + 0) >> 1, color); } if(!state->error && !ucvector_reserve(&scanlines, predict)) state->error = 83; /*alloc fail*/ if(!state->error) @@ -4814,6 +4887,8 @@ void lodepng_decoder_settings_init(LodePNGDecoderSettings* settings) settings->remember_unknown_chunks = 0; #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ settings->ignore_crc = 0; + settings->ignore_critical = 0; + settings->ignore_end = 0; lodepng_decompress_settings_init(&settings->zlibsettings); } @@ -5394,7 +5469,7 @@ static unsigned filter(unsigned char* out, const unsigned char* in, unsigned w, { for(type = 0; type != 5; ++type) { - unsigned testsize = linebytes; + unsigned testsize = (unsigned)linebytes; /*if(testsize > 8) testsize /= 8;*/ /*it already works good enough by testing a part of the row*/ filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type); @@ -5645,22 +5720,12 @@ unsigned lodepng_encode(unsigned char** out, size_t* outsize, *outsize = 0; state->error = 0; - lodepng_info_init(&info); - lodepng_info_copy(&info, &state->info_png); - - if((info.color.colortype == LCT_PALETTE || state->encoder.force_palette) - && (info.color.palettesize == 0 || info.color.palettesize > 256)) + /*check input values validity*/ + if((state->info_png.color.colortype == LCT_PALETTE || state->encoder.force_palette) + && (state->info_png.color.palettesize == 0 || state->info_png.color.palettesize > 256)) { - state->error = 68; /*invalid palette size, it is only allowed to be 1-256*/ - return state->error; + CERROR_RETURN_ERROR(state->error, 68); /*invalid palette size, it is only allowed to be 1-256*/ } - - if(state->encoder.auto_convert) - { - state->error = lodepng_auto_choose_color(&info.color, image, w, h, &state->info_raw); - } - if(state->error) return state->error; - if(state->encoder.zlibsettings.btype > 2) { CERROR_RETURN_ERROR(state->error, 61); /*error: unexisting btype*/ @@ -5669,28 +5734,38 @@ unsigned lodepng_encode(unsigned char** out, size_t* outsize, { CERROR_RETURN_ERROR(state->error, 71); /*error: unexisting interlace mode*/ } - - state->error = checkColorValidity(info.color.colortype, info.color.bitdepth); + state->error = checkColorValidity(state->info_png.color.colortype, state->info_png.color.bitdepth); if(state->error) return state->error; /*error: unexisting color type given*/ state->error = checkColorValidity(state->info_raw.colortype, state->info_raw.bitdepth); if(state->error) return state->error; /*error: unexisting color type given*/ - if(!lodepng_color_mode_equal(&state->info_raw, &info.color)) + /* color convert and compute scanline filter types */ + lodepng_info_init(&info); + lodepng_info_copy(&info, &state->info_png); + if(state->encoder.auto_convert) { - unsigned char* converted; - size_t size = (w * h * (size_t)lodepng_get_bpp(&info.color) + 7) / 8; - - converted = (unsigned char*)lodepng_malloc(size); - if(!converted && size) state->error = 83; /*alloc fail*/ - if(!state->error) + state->error = lodepng_auto_choose_color(&info.color, image, w, h, &state->info_raw); + } + if (!state->error) + { + if(!lodepng_color_mode_equal(&state->info_raw, &info.color)) { - state->error = lodepng_convert(converted, image, &info.color, &state->info_raw, w, h); + unsigned char* converted; + size_t size = ((size_t)w * (size_t)h * (size_t)lodepng_get_bpp(&info.color) + 7) / 8; + + converted = (unsigned char*)lodepng_malloc(size); + if(!converted && size) state->error = 83; /*alloc fail*/ + if(!state->error) + { + state->error = lodepng_convert(converted, image, &info.color, &state->info_raw, w, h); + } + if(!state->error) preProcessScanlines(&data, &datasize, converted, w, h, &info, &state->encoder); + lodepng_free(converted); } - if(!state->error) preProcessScanlines(&data, &datasize, converted, w, h, &info, &state->encoder); - lodepng_free(converted); + else preProcessScanlines(&data, &datasize, image, w, h, &info, &state->encoder); } - else preProcessScanlines(&data, &datasize, image, w, h, &info, &state->encoder); + /* output all PNG chunks */ ucvector_init(&outv); while(!state->error) /*while only executed once, to break on error*/ { @@ -5989,9 +6064,10 @@ const char* lodepng_error_text(unsigned code) /*the windowsize in the LodePNGCompressSettings. Requiring POT(==> & instead of %) makes encoding 12% faster.*/ case 90: return "windowsize must be a power of two"; case 91: return "invalid decompressed idat size"; - case 92: return "too many pixels, not supported"; + case 92: return "integer overflow due to too many pixels"; case 93: return "zero width or height is invalid"; case 94: return "header chunk must have a size of 13 bytes"; + case 95: return "integer overflow with combined idat chunk size"; } return "unknown error code"; } diff --git a/tcod_sys/libtcod/src/png/lodepng.h b/tcod_sys/libtcod/src/vendor/lodepng.h similarity index 98% rename from tcod_sys/libtcod/src/png/lodepng.h rename to tcod_sys/libtcod/src/vendor/lodepng.h index fcf9f714b..6c56c1dfd 100644 --- a/tcod_sys/libtcod/src/png/lodepng.h +++ b/tcod_sys/libtcod/src/vendor/lodepng.h @@ -1,7 +1,7 @@ /* -LodePNG version 20160501 +LodePNG version 20180611 -Copyright (c) 2005-2016 Lode Vandevenne +Copyright (c) 2005-2018 Lode Vandevenne This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -255,6 +255,7 @@ const char* lodepng_error_text(unsigned code); typedef struct LodePNGDecompressSettings LodePNGDecompressSettings; struct LodePNGDecompressSettings { + /* Check LodePNGDecoderSettings for more ignorable errors */ unsigned ignore_adler32; /*if 1, continue and don't give an error message if the Adler32 checksum is corrupted*/ /*use custom zlib decoder instead of built in one (default: null)*/ @@ -409,7 +410,7 @@ typedef struct LodePNGInfo /*header (IHDR), palette (PLTE) and transparency (tRNS) chunks*/ unsigned compression_method;/*compression method of the original file. Always 0.*/ unsigned filter_method; /*filter method of the original file*/ - unsigned interlace_method; /*interlace method of the original file*/ + unsigned interlace_method; /*interlace method of the original file: 0=none, 1=Adam7*/ LodePNGColorMode color; /*color type and bits, palette and transparency of the PNG file*/ #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS @@ -520,7 +521,10 @@ typedef struct LodePNGDecoderSettings { LodePNGDecompressSettings zlibsettings; /*in here is the setting to ignore Adler32 checksums*/ + /* Check LodePNGDecompressSettings for more ignorable errors */ unsigned ignore_crc; /*ignore CRC checksums*/ + unsigned ignore_critical; /*ignore unknown critical chunks*/ + unsigned ignore_end; /*ignore issues at end of file if possible (missing IEND chunk, too large chunk, ...)*/ unsigned color_convert; /*whether to convert the PNG to the color type you want. Default: yes*/ @@ -559,11 +563,11 @@ Used internally by default if "auto_convert" is enabled. Public because it's use typedef struct LodePNGColorProfile { unsigned colored; /*not greyscale*/ - unsigned key; /*if true, image is not opaque. Only if true and alpha is false, color key is possible.*/ - unsigned short key_r; /*these values are always in 16-bit bitdepth in the profile*/ + unsigned key; /*image is not opaque and color key is possible instead of full alpha*/ + unsigned short key_r; /*key values, always as 16-bit, in 8-bit case the byte is duplicated, e.g. 65535 means 255*/ unsigned short key_g; unsigned short key_b; - unsigned alpha; /*alpha channel or alpha palette required*/ + unsigned alpha; /*image is not opaque and alpha channel or alpha palette required*/ unsigned numcolors; /*amount of colors, up to 257. Not valid if bits == 16.*/ unsigned char palette[1024]; /*Remembers up to the first 256 RGBA colors, in no particular order*/ unsigned bits; /*bits per channel (not for palette). 1,2 or 4 for greyscale only. 16 if 16-bit per channel required.*/ @@ -1567,6 +1571,8 @@ For decoding: state.decoder.zlibsettings.ignore_adler32: ignore ADLER32 checksums state.decoder.zlibsettings.custom_...: use custom inflate function state.decoder.ignore_crc: ignore CRC checksums +state.decoder.ignore_critical: ignore unknown critical chunks +state.decoder.ignore_end: ignore missing IEND chunk. May fail if this corruption causes other errors state.decoder.color_convert: convert internal PNG color to chosen one state.decoder.read_text_chunks: whether to read in text metadata chunks state.decoder.remember_unknown_chunks: whether to read in unknown chunks @@ -1608,6 +1614,10 @@ yyyymmdd. Some changes aren't backwards compatible. Those are indicated with a (!) symbol. +*) 11 jun 2018: less restrictive check for pixel size integer overflow +*) 14 jan 2018: allow optionally ignoring a few more recoverable errors +*) 17 sep 2017: fix memory leak for some encoder input error cases +*) 27 nov 2016: grey+alpha auto color model detection bugfix *) 18 apr 2016: Changed qsort to custom stable sort (for platforms w/o qsort). *) 09 apr 2016: Fixed colorkey usage detection, and better file loading (within the limits of pure C90). @@ -1756,5 +1766,5 @@ Domain: gmail dot com. Account: lode dot vandevenne. -Copyright (c) 2005-2016 Lode Vandevenne +Copyright (c) 2005-2018 Lode Vandevenne */ diff --git a/tcod_sys/libtcod/src/vendor/stb.c b/tcod_sys/libtcod/src/vendor/stb.c index 2d869d998..a99a88d52 100644 --- a/tcod_sys/libtcod/src/vendor/stb.c +++ b/tcod_sys/libtcod/src/vendor/stb.c @@ -2,3 +2,7 @@ #define STB_SPRINTF_IMPLEMENTATION #include "stb_sprintf.h" #undef STB_SPRINTF_IMPLEMENTATION + +#define STB_TRUETYPE_IMPLEMENTATION +#include "stb_truetype.h" +#undef STB_TRUETYPE_IMPLEMENTATION diff --git a/tcod_sys/libtcod/src/vendor/stb_truetype.h b/tcod_sys/libtcod/src/vendor/stb_truetype.h new file mode 100644 index 000000000..0af88ac86 --- /dev/null +++ b/tcod_sys/libtcod/src/vendor/stb_truetype.h @@ -0,0 +1,4894 @@ +// stb_truetype.h - v1.20 - public domain +// authored from 2009-2016 by Sean Barrett / RAD Game Tools +// +// This library processes TrueType files: +// parse files +// extract glyph metrics +// extract glyph shapes +// render glyphs to one-channel bitmaps with antialiasing (box filter) +// render glyphs to one-channel SDF bitmaps (signed-distance field/function) +// +// Todo: +// non-MS cmaps +// crashproof on bad data +// hinting? (no longer patented) +// cleartype-style AA? +// optimize: use simple memory allocator for intermediates +// optimize: build edge-list directly from curves +// optimize: rasterize directly from curves? +// +// ADDITIONAL CONTRIBUTORS +// +// Mikko Mononen: compound shape support, more cmap formats +// Tor Andersson: kerning, subpixel rendering +// Dougall Johnson: OpenType / Type 2 font handling +// Daniel Ribeiro Maciel: basic GPOS-based kerning +// +// Misc other: +// Ryan Gordon +// Simon Glass +// github:IntellectualKitty +// Imanol Celaya +// Daniel Ribeiro Maciel +// +// Bug/warning reports/fixes: +// "Zer" on mollyrocket Fabian "ryg" Giesen +// Cass Everitt Martins Mozeiko +// stoiko (Haemimont Games) Cap Petschulat +// Brian Hook Omar Cornut +// Walter van Niftrik github:aloucks +// David Gow Peter LaValle +// David Given Sergey Popov +// Ivan-Assen Ivanov Giumo X. Clanjor +// Anthony Pesch Higor Euripedes +// Johan Duparc Thomas Fields +// Hou Qiming Derek Vinyard +// Rob Loach Cort Stratton +// Kenney Phillis Jr. github:oyvindjam +// Brian Costabile github:vassvik +// +// VERSION HISTORY +// +// 1.20 (2019-02-07) PackFontRange skips missing codepoints; GetScaleFontVMetrics() +// 1.19 (2018-02-11) GPOS kerning, STBTT_fmod +// 1.18 (2018-01-29) add missing function +// 1.17 (2017-07-23) make more arguments const; doc fix +// 1.16 (2017-07-12) SDF support +// 1.15 (2017-03-03) make more arguments const +// 1.14 (2017-01-16) num-fonts-in-TTC function +// 1.13 (2017-01-02) support OpenType fonts, certain Apple fonts +// 1.12 (2016-10-25) suppress warnings about casting away const with -Wcast-qual +// 1.11 (2016-04-02) fix unused-variable warning +// 1.10 (2016-04-02) user-defined fabs(); rare memory leak; remove duplicate typedef +// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use allocation userdata properly +// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges +// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; +// variant PackFontRanges to pack and render in separate phases; +// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?); +// fixed an assert() bug in the new rasterizer +// replace assert() with STBTT_assert() in new rasterizer +// +// Full history can be found at the end of this file. +// +// LICENSE +// +// See end of file for license information. +// +// USAGE +// +// Include this file in whatever places need to refer to it. In ONE C/C++ +// file, write: +// #define STB_TRUETYPE_IMPLEMENTATION +// before the #include of this file. This expands out the actual +// implementation into that C/C++ file. +// +// To make the implementation private to the file that generates the implementation, +// #define STBTT_STATIC +// +// Simple 3D API (don't ship this, but it's fine for tools and quick start) +// stbtt_BakeFontBitmap() -- bake a font to a bitmap for use as texture +// stbtt_GetBakedQuad() -- compute quad to draw for a given char +// +// Improved 3D API (more shippable): +// #include "stb_rect_pack.h" -- optional, but you really want it +// stbtt_PackBegin() +// stbtt_PackSetOversampling() -- for improved quality on small fonts +// stbtt_PackFontRanges() -- pack and renders +// stbtt_PackEnd() +// stbtt_GetPackedQuad() +// +// "Load" a font file from a memory buffer (you have to keep the buffer loaded) +// stbtt_InitFont() +// stbtt_GetFontOffsetForIndex() -- indexing for TTC font collections +// stbtt_GetNumberOfFonts() -- number of fonts for TTC font collections +// +// Render a unicode codepoint to a bitmap +// stbtt_GetCodepointBitmap() -- allocates and returns a bitmap +// stbtt_MakeCodepointBitmap() -- renders into bitmap you provide +// stbtt_GetCodepointBitmapBox() -- how big the bitmap must be +// +// Character advance/positioning +// stbtt_GetCodepointHMetrics() +// stbtt_GetFontVMetrics() +// stbtt_GetFontVMetricsOS2() +// stbtt_GetCodepointKernAdvance() +// +// Starting with version 1.06, the rasterizer was replaced with a new, +// faster and generally-more-precise rasterizer. The new rasterizer more +// accurately measures pixel coverage for anti-aliasing, except in the case +// where multiple shapes overlap, in which case it overestimates the AA pixel +// coverage. Thus, anti-aliasing of intersecting shapes may look wrong. If +// this turns out to be a problem, you can re-enable the old rasterizer with +// #define STBTT_RASTERIZER_VERSION 1 +// which will incur about a 15% speed hit. +// +// ADDITIONAL DOCUMENTATION +// +// Immediately after this block comment are a series of sample programs. +// +// After the sample programs is the "header file" section. This section +// includes documentation for each API function. +// +// Some important concepts to understand to use this library: +// +// Codepoint +// Characters are defined by unicode codepoints, e.g. 65 is +// uppercase A, 231 is lowercase c with a cedilla, 0x7e30 is +// the hiragana for "ma". +// +// Glyph +// A visual character shape (every codepoint is rendered as +// some glyph) +// +// Glyph index +// A font-specific integer ID representing a glyph +// +// Baseline +// Glyph shapes are defined relative to a baseline, which is the +// bottom of uppercase characters. Characters extend both above +// and below the baseline. +// +// Current Point +// As you draw text to the screen, you keep track of a "current point" +// which is the origin of each character. The current point's vertical +// position is the baseline. Even "baked fonts" use this model. +// +// Vertical Font Metrics +// The vertical qualities of the font, used to vertically position +// and space the characters. See docs for stbtt_GetFontVMetrics. +// +// Font Size in Pixels or Points +// The preferred interface for specifying font sizes in stb_truetype +// is to specify how tall the font's vertical extent should be in pixels. +// If that sounds good enough, skip the next paragraph. +// +// Most font APIs instead use "points", which are a common typographic +// measurement for describing font size, defined as 72 points per inch. +// stb_truetype provides a point API for compatibility. However, true +// "per inch" conventions don't make much sense on computer displays +// since different monitors have different number of pixels per +// inch. For example, Windows traditionally uses a convention that +// there are 96 pixels per inch, thus making 'inch' measurements have +// nothing to do with inches, and thus effectively defining a point to +// be 1.333 pixels. Additionally, the TrueType font data provides +// an explicit scale factor to scale a given font's glyphs to points, +// but the author has observed that this scale factor is often wrong +// for non-commercial fonts, thus making fonts scaled in points +// according to the TrueType spec incoherently sized in practice. +// +// DETAILED USAGE: +// +// Scale: +// Select how high you want the font to be, in points or pixels. +// Call ScaleForPixelHeight or ScaleForMappingEmToPixels to compute +// a scale factor SF that will be used by all other functions. +// +// Baseline: +// You need to select a y-coordinate that is the baseline of where +// your text will appear. Call GetFontBoundingBox to get the baseline-relative +// bounding box for all characters. SF*-y0 will be the distance in pixels +// that the worst-case character could extend above the baseline, so if +// you want the top edge of characters to appear at the top of the +// screen where y=0, then you would set the baseline to SF*-y0. +// +// Current point: +// Set the current point where the first character will appear. The +// first character could extend left of the current point; this is font +// dependent. You can either choose a current point that is the leftmost +// point and hope, or add some padding, or check the bounding box or +// left-side-bearing of the first character to be displayed and set +// the current point based on that. +// +// Displaying a character: +// Compute the bounding box of the character. It will contain signed values +// relative to . I.e. if it returns x0,y0,x1,y1, +// then the character should be displayed in the rectangle from +// to = 32 && *text < 128) { + stbtt_aligned_quad q; + stbtt_GetBakedQuad(cdata, 512,512, *text-32, &x,&y,&q,1);//1=opengl & d3d10+,0=d3d9 + glTexCoord2f(q.s0,q.t1); glVertex2f(q.x0,q.y0); + glTexCoord2f(q.s1,q.t1); glVertex2f(q.x1,q.y0); + glTexCoord2f(q.s1,q.t0); glVertex2f(q.x1,q.y1); + glTexCoord2f(q.s0,q.t0); glVertex2f(q.x0,q.y1); + } + ++text; + } + glEnd(); +} +#endif +// +// +////////////////////////////////////////////////////////////////////////////// +// +// Complete program (this compiles): get a single bitmap, print as ASCII art +// +#if 0 +#include +#define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation +#include "stb_truetype.h" + +char ttf_buffer[1<<25]; + +int main(int argc, char **argv) +{ + stbtt_fontinfo font; + unsigned char *bitmap; + int w,h,i,j,c = (argc > 1 ? atoi(argv[1]) : 'a'), s = (argc > 2 ? atoi(argv[2]) : 20); + + fread(ttf_buffer, 1, 1<<25, fopen(argc > 3 ? argv[3] : "c:/windows/fonts/arialbd.ttf", "rb")); + + stbtt_InitFont(&font, ttf_buffer, stbtt_GetFontOffsetForIndex(ttf_buffer,0)); + bitmap = stbtt_GetCodepointBitmap(&font, 0,stbtt_ScaleForPixelHeight(&font, s), c, &w, &h, 0,0); + + for (j=0; j < h; ++j) { + for (i=0; i < w; ++i) + putchar(" .:ioVM@"[bitmap[j*w+i]>>5]); + putchar('\n'); + } + return 0; +} +#endif +// +// Output: +// +// .ii. +// @@@@@@. +// V@Mio@@o +// :i. V@V +// :oM@@M +// :@@@MM@M +// @@o o@M +// :@@. M@M +// @@@o@@@@ +// :M@@V:@@. +// +////////////////////////////////////////////////////////////////////////////// +// +// Complete program: print "Hello World!" banner, with bugs +// +#if 0 +char buffer[24<<20]; +unsigned char screen[20][79]; + +int main(int arg, char **argv) +{ + stbtt_fontinfo font; + int i,j,ascent,baseline,ch=0; + float scale, xpos=2; // leave a little padding in case the character extends left + char *text = "Heljo World!"; // intentionally misspelled to show 'lj' brokenness + + fread(buffer, 1, 1000000, fopen("c:/windows/fonts/arialbd.ttf", "rb")); + stbtt_InitFont(&font, buffer, 0); + + scale = stbtt_ScaleForPixelHeight(&font, 15); + stbtt_GetFontVMetrics(&font, &ascent,0,0); + baseline = (int) (ascent*scale); + + while (text[ch]) { + int advance,lsb,x0,y0,x1,y1; + float x_shift = xpos - (float) floor(xpos); + stbtt_GetCodepointHMetrics(&font, text[ch], &advance, &lsb); + stbtt_GetCodepointBitmapBoxSubpixel(&font, text[ch], scale,scale,x_shift,0, &x0,&y0,&x1,&y1); + stbtt_MakeCodepointBitmapSubpixel(&font, &screen[baseline + y0][(int) xpos + x0], x1-x0,y1-y0, 79, scale,scale,x_shift,0, text[ch]); + // note that this stomps the old data, so where character boxes overlap (e.g. 'lj') it's wrong + // because this API is really for baking character bitmaps into textures. if you want to render + // a sequence of characters, you really need to render each bitmap to a temp buffer, then + // "alpha blend" that into the working buffer + xpos += (advance * scale); + if (text[ch+1]) + xpos += scale*stbtt_GetCodepointKernAdvance(&font, text[ch],text[ch+1]); + ++ch; + } + + for (j=0; j < 20; ++j) { + for (i=0; i < 78; ++i) + putchar(" .:ioVM@"[screen[j][i]>>5]); + putchar('\n'); + } + + return 0; +} +#endif + + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +//// +//// INTEGRATION WITH YOUR CODEBASE +//// +//// The following sections allow you to supply alternate definitions +//// of C library functions used by stb_truetype, e.g. if you don't +//// link with the C runtime library. + +#ifdef STB_TRUETYPE_IMPLEMENTATION + // #define your own (u)stbtt_int8/16/32 before including to override this + #ifndef stbtt_uint8 + typedef unsigned char stbtt_uint8; + typedef signed char stbtt_int8; + typedef unsigned short stbtt_uint16; + typedef signed short stbtt_int16; + typedef unsigned int stbtt_uint32; + typedef signed int stbtt_int32; + #endif + + typedef char stbtt__check_size32[sizeof(stbtt_int32)==4 ? 1 : -1]; + typedef char stbtt__check_size16[sizeof(stbtt_int16)==2 ? 1 : -1]; + + // e.g. #define your own STBTT_ifloor/STBTT_iceil() to avoid math.h + #ifndef STBTT_ifloor + #include + #define STBTT_ifloor(x) ((int) floor(x)) + #define STBTT_iceil(x) ((int) ceil(x)) + #endif + + #ifndef STBTT_sqrt + #include + #define STBTT_sqrt(x) sqrt(x) + #define STBTT_pow(x,y) pow(x,y) + #endif + + #ifndef STBTT_fmod + #include + #define STBTT_fmod(x,y) fmod(x,y) + #endif + + #ifndef STBTT_cos + #include + #define STBTT_cos(x) cos(x) + #define STBTT_acos(x) acos(x) + #endif + + #ifndef STBTT_fabs + #include + #define STBTT_fabs(x) fabs(x) + #endif + + // #define your own functions "STBTT_malloc" / "STBTT_free" to avoid malloc.h + #ifndef STBTT_malloc + #include + #define STBTT_malloc(x,u) ((void)(u),malloc(x)) + #define STBTT_free(x,u) ((void)(u),free(x)) + #endif + + #ifndef STBTT_assert + #include + #define STBTT_assert(x) assert(x) + #endif + + #ifndef STBTT_strlen + #include + #define STBTT_strlen(x) strlen(x) + #endif + + #ifndef STBTT_memcpy + #include + #define STBTT_memcpy memcpy + #define STBTT_memset memset + #endif +#endif + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +//// +//// INTERFACE +//// +//// + +#ifndef __STB_INCLUDE_STB_TRUETYPE_H__ +#define __STB_INCLUDE_STB_TRUETYPE_H__ + +#ifdef STBTT_STATIC +#define STBTT_DEF static +#else +#define STBTT_DEF extern +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// private structure +typedef struct +{ + unsigned char *data; + int cursor; + int size; +} stbtt__buf; + +////////////////////////////////////////////////////////////////////////////// +// +// TEXTURE BAKING API +// +// If you use this API, you only have to call two functions ever. +// + +typedef struct +{ + unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap + float xoff,yoff,xadvance; +} stbtt_bakedchar; + +STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) + float pixel_height, // height of font in pixels + unsigned char *pixels, int pw, int ph, // bitmap to be filled in + int first_char, int num_chars, // characters to bake + stbtt_bakedchar *chardata); // you allocate this, it's num_chars long +// if return is positive, the first unused row of the bitmap +// if return is negative, returns the negative of the number of characters that fit +// if return is 0, no characters fit and no rows were used +// This uses a very crappy packing. + +typedef struct +{ + float x0,y0,s0,t0; // top-left + float x1,y1,s1,t1; // bottom-right +} stbtt_aligned_quad; + +STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int ph, // same data as above + int char_index, // character to display + float *xpos, float *ypos, // pointers to current position in screen pixel space + stbtt_aligned_quad *q, // output: quad to draw + int opengl_fillrule); // true if opengl fill rule; false if DX9 or earlier +// Call GetBakedQuad with char_index = 'character - first_char', and it +// creates the quad you need to draw and advances the current position. +// +// The coordinate system used assumes y increases downwards. +// +// Characters will extend both above and below the current position; +// see discussion of "BASELINE" above. +// +// It's inefficient; you might want to c&p it and optimize it. + +STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char *fontdata, int index, float size, float *ascent, float *descent, float *lineGap); +// Query the font vertical metrics without having to create a font first. + + +////////////////////////////////////////////////////////////////////////////// +// +// NEW TEXTURE BAKING API +// +// This provides options for packing multiple fonts into one atlas, not +// perfectly but better than nothing. + +typedef struct +{ + unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap + float xoff,yoff,xadvance; + float xoff2,yoff2; +} stbtt_packedchar; + +typedef struct stbtt_pack_context stbtt_pack_context; +typedef struct stbtt_fontinfo stbtt_fontinfo; +#ifndef STB_RECT_PACK_VERSION +typedef struct stbrp_rect stbrp_rect; +#endif + +STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int width, int height, int stride_in_bytes, int padding, void *alloc_context); +// Initializes a packing context stored in the passed-in stbtt_pack_context. +// Future calls using this context will pack characters into the bitmap passed +// in here: a 1-channel bitmap that is width * height. stride_in_bytes is +// the distance from one row to the next (or 0 to mean they are packed tightly +// together). "padding" is the amount of padding to leave between each +// character (normally you want '1' for bitmaps you'll use as textures with +// bilinear filtering). +// +// Returns 0 on failure, 1 on success. + +STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc); +// Cleans up the packing context and frees all memory. + +#define STBTT_POINT_SIZE(x) (-(x)) + +STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, float font_size, + int first_unicode_char_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range); +// Creates character bitmaps from the font_index'th font found in fontdata (use +// font_index=0 if you don't know what that is). It creates num_chars_in_range +// bitmaps for characters with unicode values starting at first_unicode_char_in_range +// and increasing. Data for how to render them is stored in chardata_for_range; +// pass these to stbtt_GetPackedQuad to get back renderable quads. +// +// font_size is the full height of the character from ascender to descender, +// as computed by stbtt_ScaleForPixelHeight. To use a point size as computed +// by stbtt_ScaleForMappingEmToPixels, wrap the point size in STBTT_POINT_SIZE() +// and pass that result as 'font_size': +// ..., 20 , ... // font max minus min y is 20 pixels tall +// ..., STBTT_POINT_SIZE(20), ... // 'M' is 20 pixels tall + +typedef struct +{ + float font_size; + int first_unicode_codepoint_in_range; // if non-zero, then the chars are continuous, and this is the first codepoint + int *array_of_unicode_codepoints; // if non-zero, then this is an array of unicode codepoints + int num_chars; + stbtt_packedchar *chardata_for_range; // output + unsigned char h_oversample, v_oversample; // don't set these, they're used internally +} stbtt_pack_range; + +STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges); +// Creates character bitmaps from multiple ranges of characters stored in +// ranges. This will usually create a better-packed bitmap than multiple +// calls to stbtt_PackFontRange. Note that you can call this multiple +// times within a single PackBegin/PackEnd. + +STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample); +// Oversampling a font increases the quality by allowing higher-quality subpixel +// positioning, and is especially valuable at smaller text sizes. +// +// This function sets the amount of oversampling for all following calls to +// stbtt_PackFontRange(s) or stbtt_PackFontRangesGatherRects for a given +// pack context. The default (no oversampling) is achieved by h_oversample=1 +// and v_oversample=1. The total number of pixels required is +// h_oversample*v_oversample larger than the default; for example, 2x2 +// oversampling requires 4x the storage of 1x1. For best results, render +// oversampled textures with bilinear filtering. Look at the readme in +// stb/tests/oversample for information about oversampled fonts +// +// To use with PackFontRangesGather etc., you must set it before calls +// call to PackFontRangesGatherRects. + +STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip); +// If skip != 0, this tells stb_truetype to skip any codepoints for which +// there is no corresponding glyph. If skip=0, which is the default, then +// codepoints without a glyph recived the font's "missing character" glyph, +// typically an empty box by convention. + +STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, // same data as above + int char_index, // character to display + float *xpos, float *ypos, // pointers to current position in screen pixel space + stbtt_aligned_quad *q, // output: quad to draw + int align_to_integer); + +STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); +STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects); +STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); +// Calling these functions in sequence is roughly equivalent to calling +// stbtt_PackFontRanges(). If you more control over the packing of multiple +// fonts, or if you want to pack custom data into a font texture, take a look +// at the source to of stbtt_PackFontRanges() and create a custom version +// using these functions, e.g. call GatherRects multiple times, +// building up a single array of rects, then call PackRects once, +// then call RenderIntoRects repeatedly. This may result in a +// better packing than calling PackFontRanges multiple times +// (or it may not). + +// this is an opaque structure that you shouldn't mess with which holds +// all the context needed from PackBegin to PackEnd. +struct stbtt_pack_context { + void *user_allocator_context; + void *pack_info; + int width; + int height; + int stride_in_bytes; + int padding; + int skip_missing; + unsigned int h_oversample, v_oversample; + unsigned char *pixels; + void *nodes; +}; + +////////////////////////////////////////////////////////////////////////////// +// +// FONT LOADING +// +// + +STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data); +// This function will determine the number of fonts in a font file. TrueType +// collection (.ttc) files may contain multiple fonts, while TrueType font +// (.ttf) files only contain one font. The number of fonts can be used for +// indexing with the previous function where the index is between zero and one +// less than the total fonts. If an error occurs, -1 is returned. + +STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index); +// Each .ttf/.ttc file may have more than one font. Each font has a sequential +// index number starting from 0. Call this function to get the font offset for +// a given index; it returns -1 if the index is out of range. A regular .ttf +// file will only define one font and it always be at offset 0, so it will +// return '0' for index 0, and -1 for all other indices. + +// The following structure is defined publicly so you can declare one on +// the stack or as a global or etc, but you should treat it as opaque. +struct stbtt_fontinfo +{ + void * userdata; + unsigned char * data; // pointer to .ttf file + int fontstart; // offset of start of font + + int numGlyphs; // number of glyphs, needed for range checking + + int loca,head,glyf,hhea,hmtx,kern,gpos; // table locations as offset from start of .ttf + int index_map; // a cmap mapping for our chosen character encoding + int indexToLocFormat; // format needed to map from glyph index to glyph + + stbtt__buf cff; // cff font data + stbtt__buf charstrings; // the charstring index + stbtt__buf gsubrs; // global charstring subroutines index + stbtt__buf subrs; // private charstring subroutines index + stbtt__buf fontdicts; // array of font dicts + stbtt__buf fdselect; // map from glyph to fontdict +}; + +STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset); +// Given an offset into the file that defines a font, this function builds +// the necessary cached info for the rest of the system. You must allocate +// the stbtt_fontinfo yourself, and stbtt_InitFont will fill it out. You don't +// need to do anything special to free it, because the contents are pure +// value data with no additional data structures. Returns 0 on failure. + + +////////////////////////////////////////////////////////////////////////////// +// +// CHARACTER TO GLYPH-INDEX CONVERSIOn + +STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint); +// If you're going to perform multiple operations on the same character +// and you want a speed-up, call this function with the character you're +// going to process, then use glyph-based functions instead of the +// codepoint-based functions. +// Returns 0 if the character codepoint is not defined in the font. + + +////////////////////////////////////////////////////////////////////////////// +// +// CHARACTER PROPERTIES +// + +STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float pixels); +// computes a scale factor to produce a font whose "height" is 'pixels' tall. +// Height is measured as the distance from the highest ascender to the lowest +// descender; in other words, it's equivalent to calling stbtt_GetFontVMetrics +// and computing: +// scale = pixels / (ascent - descent) +// so if you prefer to measure height by the ascent only, use a similar calculation. + +STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels); +// computes a scale factor to produce a font whose EM size is mapped to +// 'pixels' tall. This is probably what traditional APIs compute, but +// I'm not positive. + +STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap); +// ascent is the coordinate above the baseline the font extends; descent +// is the coordinate below the baseline the font extends (i.e. it is typically negative) +// lineGap is the spacing between one row's descent and the next row's ascent... +// so you should advance the vertical position by "*ascent - *descent + *lineGap" +// these are expressed in unscaled coordinates, so you must multiply by +// the scale factor for a given size + +STBTT_DEF int stbtt_GetFontVMetricsOS2(const stbtt_fontinfo *info, int *typoAscent, int *typoDescent, int *typoLineGap); +// analogous to GetFontVMetrics, but returns the "typographic" values from the OS/2 +// table (specific to MS/Windows TTF files). +// +// Returns 1 on success (table present), 0 on failure. + +STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1); +// the bounding box around all possible characters + +STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing); +// leftSideBearing is the offset from the current horizontal position to the left edge of the character +// advanceWidth is the offset from the current horizontal position to the next horizontal position +// these are expressed in unscaled coordinates + +STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2); +// an additional amount to add to the 'advance' value between ch1 and ch2 + +STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1); +// Gets the bounding box of the visible part of the glyph, in unscaled coordinates + +STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing); +STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2); +STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1); +// as above, but takes one or more glyph indices for greater efficiency + + +////////////////////////////////////////////////////////////////////////////// +// +// GLYPH SHAPES (you probably don't need these, but they have to go before +// the bitmaps for C declaration-order reasons) +// + +#ifndef STBTT_vmove // you can predefine these to use different values (but why?) + enum { + STBTT_vmove=1, + STBTT_vline, + STBTT_vcurve, + STBTT_vcubic + }; +#endif + +#ifndef stbtt_vertex // you can predefine this to use different values + // (we share this with other code at RAD) + #define stbtt_vertex_type short // can't use stbtt_int16 because that's not visible in the header file + typedef struct + { + stbtt_vertex_type x,y,cx,cy,cx1,cy1; + unsigned char type,padding; + } stbtt_vertex; +#endif + +STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index); +// returns non-zero if nothing is drawn for this glyph + +STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices); +STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **vertices); +// returns # of vertices and fills *vertices with the pointer to them +// these are expressed in "unscaled" coordinates +// +// The shape is a series of contours. Each one starts with +// a STBTT_moveto, then consists of a series of mixed +// STBTT_lineto and STBTT_curveto segments. A lineto +// draws a line from previous endpoint to its x,y; a curveto +// draws a quadratic bezier from previous endpoint to +// its x,y, using cx,cy as the bezier control point. + +STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *vertices); +// frees the data allocated above + +////////////////////////////////////////////////////////////////////////////// +// +// BITMAP RENDERING +// + +STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata); +// frees the bitmap allocated below + +STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff); +// allocates a large-enough single-channel 8bpp bitmap and renders the +// specified character/glyph at the specified scale into it, with +// antialiasing. 0 is no coverage (transparent), 255 is fully covered (opaque). +// *width & *height are filled out with the width & height of the bitmap, +// which is stored left-to-right, top-to-bottom. +// +// xoff/yoff are the offset it pixel space from the glyph origin to the top-left of the bitmap + +STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff); +// the same as stbtt_GetCodepoitnBitmap, but you can specify a subpixel +// shift for the character + +STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint); +// the same as stbtt_GetCodepointBitmap, but you pass in storage for the bitmap +// in the form of 'output', with row spacing of 'out_stride' bytes. the bitmap +// is clipped to out_w/out_h bytes. Call stbtt_GetCodepointBitmapBox to get the +// width and height and positioning info for it first. + +STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint); +// same as stbtt_MakeCodepointBitmap, but you can specify a subpixel +// shift for the character + +STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int codepoint); +// same as stbtt_MakeCodepointBitmapSubpixel, but prefiltering +// is performed (see stbtt_PackSetOversampling) + +STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); +// get the bbox of the bitmap centered around the glyph origin; so the +// bitmap width is ix1-ix0, height is iy1-iy0, and location to place +// the bitmap top left is (leftSideBearing*scale,iy0). +// (Note that the bitmap uses y-increases-down, but the shape uses +// y-increases-up, so CodepointBitmapBox and CodepointBox are inverted.) + +STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1); +// same as stbtt_GetCodepointBitmapBox, but you can specify a subpixel +// shift for the character + +// the following functions are equivalent to the above functions, but operate +// on glyph indices instead of Unicode codepoints (for efficiency) +STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff); +STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff); +STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph); +STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph); +STBTT_DEF void stbtt_MakeGlyphBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int glyph); +STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); +STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1); + + +// @TODO: don't expose this structure +typedef struct +{ + int w,h,stride; + unsigned char *pixels; +} stbtt__bitmap; + +// rasterize a shape with quadratic beziers into a bitmap +STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, // 1-channel bitmap to draw into + float flatness_in_pixels, // allowable error of curve in pixels + stbtt_vertex *vertices, // array of vertices defining shape + int num_verts, // number of vertices in above array + float scale_x, float scale_y, // scale applied to input vertices + float shift_x, float shift_y, // translation applied to input vertices + int x_off, int y_off, // another translation applied to input + int invert, // if non-zero, vertically flip shape + void *userdata); // context for to STBTT_MALLOC + +////////////////////////////////////////////////////////////////////////////// +// +// Signed Distance Function (or Field) rendering + +STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata); +// frees the SDF bitmap allocated below + +STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float scale, int glyph, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff); +STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff); +// These functions compute a discretized SDF field for a single character, suitable for storing +// in a single-channel texture, sampling with bilinear filtering, and testing against +// larger than some threshold to produce scalable fonts. +// info -- the font +// scale -- controls the size of the resulting SDF bitmap, same as it would be creating a regular bitmap +// glyph/codepoint -- the character to generate the SDF for +// padding -- extra "pixels" around the character which are filled with the distance to the character (not 0), +// which allows effects like bit outlines +// onedge_value -- value 0-255 to test the SDF against to reconstruct the character (i.e. the isocontour of the character) +// pixel_dist_scale -- what value the SDF should increase by when moving one SDF "pixel" away from the edge (on the 0..255 scale) +// if positive, > onedge_value is inside; if negative, < onedge_value is inside +// width,height -- output height & width of the SDF bitmap (including padding) +// xoff,yoff -- output origin of the character +// return value -- a 2D array of bytes 0..255, width*height in size +// +// pixel_dist_scale & onedge_value are a scale & bias that allows you to make +// optimal use of the limited 0..255 for your application, trading off precision +// and special effects. SDF values outside the range 0..255 are clamped to 0..255. +// +// Example: +// scale = stbtt_ScaleForPixelHeight(22) +// padding = 5 +// onedge_value = 180 +// pixel_dist_scale = 180/5.0 = 36.0 +// +// This will create an SDF bitmap in which the character is about 22 pixels +// high but the whole bitmap is about 22+5+5=32 pixels high. To produce a filled +// shape, sample the SDF at each pixel and fill the pixel if the SDF value +// is greater than or equal to 180/255. (You'll actually want to antialias, +// which is beyond the scope of this example.) Additionally, you can compute +// offset outlines (e.g. to stroke the character border inside & outside, +// or only outside). For example, to fill outside the character up to 3 SDF +// pixels, you would compare against (180-36.0*3)/255 = 72/255. The above +// choice of variables maps a range from 5 pixels outside the shape to +// 2 pixels inside the shape to 0..255; this is intended primarily for apply +// outside effects only (the interior range is needed to allow proper +// antialiasing of the font at *smaller* sizes) +// +// The function computes the SDF analytically at each SDF pixel, not by e.g. +// building a higher-res bitmap and approximating it. In theory the quality +// should be as high as possible for an SDF of this size & representation, but +// unclear if this is true in practice (perhaps building a higher-res bitmap +// and computing from that can allow drop-out prevention). +// +// The algorithm has not been optimized at all, so expect it to be slow +// if computing lots of characters or very large sizes. + + + +////////////////////////////////////////////////////////////////////////////// +// +// Finding the right font... +// +// You should really just solve this offline, keep your own tables +// of what font is what, and don't try to get it out of the .ttf file. +// That's because getting it out of the .ttf file is really hard, because +// the names in the file can appear in many possible encodings, in many +// possible languages, and e.g. if you need a case-insensitive comparison, +// the details of that depend on the encoding & language in a complex way +// (actually underspecified in truetype, but also gigantic). +// +// But you can use the provided functions in two possible ways: +// stbtt_FindMatchingFont() will use *case-sensitive* comparisons on +// unicode-encoded names to try to find the font you want; +// you can run this before calling stbtt_InitFont() +// +// stbtt_GetFontNameString() lets you get any of the various strings +// from the file yourself and do your own comparisons on them. +// You have to have called stbtt_InitFont() first. + + +STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *name, int flags); +// returns the offset (not index) of the font that matches, or -1 if none +// if you use STBTT_MACSTYLE_DONTCARE, use a font name like "Arial Bold". +// if you use any other flag, use a font name like "Arial"; this checks +// the 'macStyle' header field; i don't know if fonts set this consistently +#define STBTT_MACSTYLE_DONTCARE 0 +#define STBTT_MACSTYLE_BOLD 1 +#define STBTT_MACSTYLE_ITALIC 2 +#define STBTT_MACSTYLE_UNDERSCORE 4 +#define STBTT_MACSTYLE_NONE 8 // <= not same as 0, this makes us check the bitfield is 0 + +STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2); +// returns 1/0 whether the first string interpreted as utf8 is identical to +// the second string interpreted as big-endian utf16... useful for strings from next func + +STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID); +// returns the string (which may be big-endian double byte, e.g. for unicode) +// and puts the length in bytes in *length. +// +// some of the values for the IDs are below; for more see the truetype spec: +// http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6name.html +// http://www.microsoft.com/typography/otspec/name.htm + +enum { // platformID + STBTT_PLATFORM_ID_UNICODE =0, + STBTT_PLATFORM_ID_MAC =1, + STBTT_PLATFORM_ID_ISO =2, + STBTT_PLATFORM_ID_MICROSOFT =3 +}; + +enum { // encodingID for STBTT_PLATFORM_ID_UNICODE + STBTT_UNICODE_EID_UNICODE_1_0 =0, + STBTT_UNICODE_EID_UNICODE_1_1 =1, + STBTT_UNICODE_EID_ISO_10646 =2, + STBTT_UNICODE_EID_UNICODE_2_0_BMP=3, + STBTT_UNICODE_EID_UNICODE_2_0_FULL=4 +}; + +enum { // encodingID for STBTT_PLATFORM_ID_MICROSOFT + STBTT_MS_EID_SYMBOL =0, + STBTT_MS_EID_UNICODE_BMP =1, + STBTT_MS_EID_SHIFTJIS =2, + STBTT_MS_EID_UNICODE_FULL =10 +}; + +enum { // encodingID for STBTT_PLATFORM_ID_MAC; same as Script Manager codes + STBTT_MAC_EID_ROMAN =0, STBTT_MAC_EID_ARABIC =4, + STBTT_MAC_EID_JAPANESE =1, STBTT_MAC_EID_HEBREW =5, + STBTT_MAC_EID_CHINESE_TRAD =2, STBTT_MAC_EID_GREEK =6, + STBTT_MAC_EID_KOREAN =3, STBTT_MAC_EID_RUSSIAN =7 +}; + +enum { // languageID for STBTT_PLATFORM_ID_MICROSOFT; same as LCID... + // problematic because there are e.g. 16 english LCIDs and 16 arabic LCIDs + STBTT_MS_LANG_ENGLISH =0x0409, STBTT_MS_LANG_ITALIAN =0x0410, + STBTT_MS_LANG_CHINESE =0x0804, STBTT_MS_LANG_JAPANESE =0x0411, + STBTT_MS_LANG_DUTCH =0x0413, STBTT_MS_LANG_KOREAN =0x0412, + STBTT_MS_LANG_FRENCH =0x040c, STBTT_MS_LANG_RUSSIAN =0x0419, + STBTT_MS_LANG_GERMAN =0x0407, STBTT_MS_LANG_SPANISH =0x0409, + STBTT_MS_LANG_HEBREW =0x040d, STBTT_MS_LANG_SWEDISH =0x041D +}; + +enum { // languageID for STBTT_PLATFORM_ID_MAC + STBTT_MAC_LANG_ENGLISH =0 , STBTT_MAC_LANG_JAPANESE =11, + STBTT_MAC_LANG_ARABIC =12, STBTT_MAC_LANG_KOREAN =23, + STBTT_MAC_LANG_DUTCH =4 , STBTT_MAC_LANG_RUSSIAN =32, + STBTT_MAC_LANG_FRENCH =1 , STBTT_MAC_LANG_SPANISH =6 , + STBTT_MAC_LANG_GERMAN =2 , STBTT_MAC_LANG_SWEDISH =5 , + STBTT_MAC_LANG_HEBREW =10, STBTT_MAC_LANG_CHINESE_SIMPLIFIED =33, + STBTT_MAC_LANG_ITALIAN =3 , STBTT_MAC_LANG_CHINESE_TRAD =19 +}; + +#ifdef __cplusplus +} +#endif + +#endif // __STB_INCLUDE_STB_TRUETYPE_H__ + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +//// +//// IMPLEMENTATION +//// +//// + +#ifdef STB_TRUETYPE_IMPLEMENTATION + +#ifndef STBTT_MAX_OVERSAMPLE +#define STBTT_MAX_OVERSAMPLE 8 +#endif + +#if STBTT_MAX_OVERSAMPLE > 255 +#error "STBTT_MAX_OVERSAMPLE cannot be > 255" +#endif + +typedef int stbtt__test_oversample_pow2[(STBTT_MAX_OVERSAMPLE & (STBTT_MAX_OVERSAMPLE-1)) == 0 ? 1 : -1]; + +#ifndef STBTT_RASTERIZER_VERSION +#define STBTT_RASTERIZER_VERSION 2 +#endif + +#ifdef _MSC_VER +#define STBTT__NOTUSED(v) (void)(v) +#else +#define STBTT__NOTUSED(v) (void)sizeof(v) +#endif + +////////////////////////////////////////////////////////////////////////// +// +// stbtt__buf helpers to parse data from file +// + +static stbtt_uint8 stbtt__buf_get8(stbtt__buf *b) +{ + if (b->cursor >= b->size) + return 0; + return b->data[b->cursor++]; +} + +static stbtt_uint8 stbtt__buf_peek8(stbtt__buf *b) +{ + if (b->cursor >= b->size) + return 0; + return b->data[b->cursor]; +} + +static void stbtt__buf_seek(stbtt__buf *b, int o) +{ + STBTT_assert(!(o > b->size || o < 0)); + b->cursor = (o > b->size || o < 0) ? b->size : o; +} + +static void stbtt__buf_skip(stbtt__buf *b, int o) +{ + stbtt__buf_seek(b, b->cursor + o); +} + +static stbtt_uint32 stbtt__buf_get(stbtt__buf *b, int n) +{ + stbtt_uint32 v = 0; + int i; + STBTT_assert(n >= 1 && n <= 4); + for (i = 0; i < n; i++) + v = (v << 8) | stbtt__buf_get8(b); + return v; +} + +static stbtt__buf stbtt__new_buf(const void *p, size_t size) +{ + stbtt__buf r; + STBTT_assert(size < 0x40000000); + r.data = (stbtt_uint8*) p; + r.size = (int) size; + r.cursor = 0; + return r; +} + +#define stbtt__buf_get16(b) stbtt__buf_get((b), 2) +#define stbtt__buf_get32(b) stbtt__buf_get((b), 4) + +static stbtt__buf stbtt__buf_range(const stbtt__buf *b, int o, int s) +{ + stbtt__buf r = stbtt__new_buf(NULL, 0); + if (o < 0 || s < 0 || o > b->size || s > b->size - o) return r; + r.data = b->data + o; + r.size = s; + return r; +} + +static stbtt__buf stbtt__cff_get_index(stbtt__buf *b) +{ + int count, start, offsize; + start = b->cursor; + count = stbtt__buf_get16(b); + if (count) { + offsize = stbtt__buf_get8(b); + STBTT_assert(offsize >= 1 && offsize <= 4); + stbtt__buf_skip(b, offsize * count); + stbtt__buf_skip(b, stbtt__buf_get(b, offsize) - 1); + } + return stbtt__buf_range(b, start, b->cursor - start); +} + +static stbtt_uint32 stbtt__cff_int(stbtt__buf *b) +{ + int b0 = stbtt__buf_get8(b); + if (b0 >= 32 && b0 <= 246) return b0 - 139; + else if (b0 >= 247 && b0 <= 250) return (b0 - 247)*256 + stbtt__buf_get8(b) + 108; + else if (b0 >= 251 && b0 <= 254) return -(b0 - 251)*256 - stbtt__buf_get8(b) - 108; + else if (b0 == 28) return stbtt__buf_get16(b); + else if (b0 == 29) return stbtt__buf_get32(b); + STBTT_assert(0); + return 0; +} + +static void stbtt__cff_skip_operand(stbtt__buf *b) { + int v, b0 = stbtt__buf_peek8(b); + STBTT_assert(b0 >= 28); + if (b0 == 30) { + stbtt__buf_skip(b, 1); + while (b->cursor < b->size) { + v = stbtt__buf_get8(b); + if ((v & 0xF) == 0xF || (v >> 4) == 0xF) + break; + } + } else { + stbtt__cff_int(b); + } +} + +static stbtt__buf stbtt__dict_get(stbtt__buf *b, int key) +{ + stbtt__buf_seek(b, 0); + while (b->cursor < b->size) { + int start = b->cursor, end, op; + while (stbtt__buf_peek8(b) >= 28) + stbtt__cff_skip_operand(b); + end = b->cursor; + op = stbtt__buf_get8(b); + if (op == 12) op = stbtt__buf_get8(b) | 0x100; + if (op == key) return stbtt__buf_range(b, start, end-start); + } + return stbtt__buf_range(b, 0, 0); +} + +static void stbtt__dict_get_ints(stbtt__buf *b, int key, int outcount, stbtt_uint32 *out) +{ + int i; + stbtt__buf operands = stbtt__dict_get(b, key); + for (i = 0; i < outcount && operands.cursor < operands.size; i++) + out[i] = stbtt__cff_int(&operands); +} + +static int stbtt__cff_index_count(stbtt__buf *b) +{ + stbtt__buf_seek(b, 0); + return stbtt__buf_get16(b); +} + +static stbtt__buf stbtt__cff_index_get(stbtt__buf b, int i) +{ + int count, offsize, start, end; + stbtt__buf_seek(&b, 0); + count = stbtt__buf_get16(&b); + offsize = stbtt__buf_get8(&b); + STBTT_assert(i >= 0 && i < count); + STBTT_assert(offsize >= 1 && offsize <= 4); + stbtt__buf_skip(&b, i*offsize); + start = stbtt__buf_get(&b, offsize); + end = stbtt__buf_get(&b, offsize); + return stbtt__buf_range(&b, 2+(count+1)*offsize+start, end - start); +} + +////////////////////////////////////////////////////////////////////////// +// +// accessors to parse data from file +// + +// on platforms that don't allow misaligned reads, if we want to allow +// truetype fonts that aren't padded to alignment, define ALLOW_UNALIGNED_TRUETYPE + +#define ttBYTE(p) (* (stbtt_uint8 *) (p)) +#define ttCHAR(p) (* (stbtt_int8 *) (p)) +#define ttFixed(p) ttLONG(p) + +static stbtt_uint16 ttUSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; } +static stbtt_int16 ttSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; } +static stbtt_uint32 ttULONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } +static stbtt_int32 ttLONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } + +#define stbtt_tag4(p,c0,c1,c2,c3) ((p)[0] == (c0) && (p)[1] == (c1) && (p)[2] == (c2) && (p)[3] == (c3)) +#define stbtt_tag(p,str) stbtt_tag4(p,str[0],str[1],str[2],str[3]) + +static int stbtt__isfont(stbtt_uint8 *font) +{ + // check the version number + if (stbtt_tag4(font, '1',0,0,0)) return 1; // TrueType 1 + if (stbtt_tag(font, "typ1")) return 1; // TrueType with type 1 font -- we don't support this! + if (stbtt_tag(font, "OTTO")) return 1; // OpenType with CFF + if (stbtt_tag4(font, 0,1,0,0)) return 1; // OpenType 1.0 + if (stbtt_tag(font, "true")) return 1; // Apple specification for TrueType fonts + return 0; +} + +// @OPTIMIZE: binary search +static stbtt_uint32 stbtt__find_table(stbtt_uint8 *data, stbtt_uint32 fontstart, const char *tag) +{ + stbtt_int32 num_tables = ttUSHORT(data+fontstart+4); + stbtt_uint32 tabledir = fontstart + 12; + stbtt_int32 i; + for (i=0; i < num_tables; ++i) { + stbtt_uint32 loc = tabledir + 16*i; + if (stbtt_tag(data+loc+0, tag)) + return ttULONG(data+loc+8); + } + return 0; +} + +static int stbtt_GetFontOffsetForIndex_internal(unsigned char *font_collection, int index) +{ + // if it's just a font, there's only one valid index + if (stbtt__isfont(font_collection)) + return index == 0 ? 0 : -1; + + // check if it's a TTC + if (stbtt_tag(font_collection, "ttcf")) { + // version 1? + if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) { + stbtt_int32 n = ttLONG(font_collection+8); + if (index >= n) + return -1; + return ttULONG(font_collection+12+index*4); + } + } + return -1; +} + +static int stbtt_GetNumberOfFonts_internal(unsigned char *font_collection) +{ + // if it's just a font, there's only one valid font + if (stbtt__isfont(font_collection)) + return 1; + + // check if it's a TTC + if (stbtt_tag(font_collection, "ttcf")) { + // version 1? + if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) { + return ttLONG(font_collection+8); + } + } + return 0; +} + +static stbtt__buf stbtt__get_subrs(stbtt__buf cff, stbtt__buf fontdict) +{ + stbtt_uint32 subrsoff = 0, private_loc[2] = { 0, 0 }; + stbtt__buf pdict; + stbtt__dict_get_ints(&fontdict, 18, 2, private_loc); + if (!private_loc[1] || !private_loc[0]) return stbtt__new_buf(NULL, 0); + pdict = stbtt__buf_range(&cff, private_loc[1], private_loc[0]); + stbtt__dict_get_ints(&pdict, 19, 1, &subrsoff); + if (!subrsoff) return stbtt__new_buf(NULL, 0); + stbtt__buf_seek(&cff, private_loc[1]+subrsoff); + return stbtt__cff_get_index(&cff); +} + +static int stbtt_InitFont_internal(stbtt_fontinfo *info, unsigned char *data, int fontstart) +{ + stbtt_uint32 cmap, t; + stbtt_int32 i,numTables; + + info->data = data; + info->fontstart = fontstart; + info->cff = stbtt__new_buf(NULL, 0); + + cmap = stbtt__find_table(data, fontstart, "cmap"); // required + info->loca = stbtt__find_table(data, fontstart, "loca"); // required + info->head = stbtt__find_table(data, fontstart, "head"); // required + info->glyf = stbtt__find_table(data, fontstart, "glyf"); // required + info->hhea = stbtt__find_table(data, fontstart, "hhea"); // required + info->hmtx = stbtt__find_table(data, fontstart, "hmtx"); // required + info->kern = stbtt__find_table(data, fontstart, "kern"); // not required + info->gpos = stbtt__find_table(data, fontstart, "GPOS"); // not required + + if (!cmap || !info->head || !info->hhea || !info->hmtx) + return 0; + if (info->glyf) { + // required for truetype + if (!info->loca) return 0; + } else { + // initialization for CFF / Type2 fonts (OTF) + stbtt__buf b, topdict, topdictidx; + stbtt_uint32 cstype = 2, charstrings = 0, fdarrayoff = 0, fdselectoff = 0; + stbtt_uint32 cff; + + cff = stbtt__find_table(data, fontstart, "CFF "); + if (!cff) return 0; + + info->fontdicts = stbtt__new_buf(NULL, 0); + info->fdselect = stbtt__new_buf(NULL, 0); + + // @TODO this should use size from table (not 512MB) + info->cff = stbtt__new_buf(data+cff, 512*1024*1024); + b = info->cff; + + // read the header + stbtt__buf_skip(&b, 2); + stbtt__buf_seek(&b, stbtt__buf_get8(&b)); // hdrsize + + // @TODO the name INDEX could list multiple fonts, + // but we just use the first one. + stbtt__cff_get_index(&b); // name INDEX + topdictidx = stbtt__cff_get_index(&b); + topdict = stbtt__cff_index_get(topdictidx, 0); + stbtt__cff_get_index(&b); // string INDEX + info->gsubrs = stbtt__cff_get_index(&b); + + stbtt__dict_get_ints(&topdict, 17, 1, &charstrings); + stbtt__dict_get_ints(&topdict, 0x100 | 6, 1, &cstype); + stbtt__dict_get_ints(&topdict, 0x100 | 36, 1, &fdarrayoff); + stbtt__dict_get_ints(&topdict, 0x100 | 37, 1, &fdselectoff); + info->subrs = stbtt__get_subrs(b, topdict); + + // we only support Type 2 charstrings + if (cstype != 2) return 0; + if (charstrings == 0) return 0; + + if (fdarrayoff) { + // looks like a CID font + if (!fdselectoff) return 0; + stbtt__buf_seek(&b, fdarrayoff); + info->fontdicts = stbtt__cff_get_index(&b); + info->fdselect = stbtt__buf_range(&b, fdselectoff, b.size-fdselectoff); + } + + stbtt__buf_seek(&b, charstrings); + info->charstrings = stbtt__cff_get_index(&b); + } + + t = stbtt__find_table(data, fontstart, "maxp"); + if (t) + info->numGlyphs = ttUSHORT(data+t+4); + else + info->numGlyphs = 0xffff; + + // find a cmap encoding table we understand *now* to avoid searching + // later. (todo: could make this installable) + // the same regardless of glyph. + numTables = ttUSHORT(data + cmap + 2); + info->index_map = 0; + for (i=0; i < numTables; ++i) { + stbtt_uint32 encoding_record = cmap + 4 + 8 * i; + // find an encoding we understand: + switch(ttUSHORT(data+encoding_record)) { + case STBTT_PLATFORM_ID_MICROSOFT: + switch (ttUSHORT(data+encoding_record+2)) { + case STBTT_MS_EID_UNICODE_BMP: + case STBTT_MS_EID_UNICODE_FULL: + // MS/Unicode + info->index_map = cmap + ttULONG(data+encoding_record+4); + break; + } + break; + case STBTT_PLATFORM_ID_UNICODE: + // Mac/iOS has these + // all the encodingIDs are unicode, so we don't bother to check it + info->index_map = cmap + ttULONG(data+encoding_record+4); + break; + } + } + if (info->index_map == 0) + return 0; + + info->indexToLocFormat = ttUSHORT(data+info->head + 50); + return 1; +} + +STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint) +{ + stbtt_uint8 *data = info->data; + stbtt_uint32 index_map = info->index_map; + + stbtt_uint16 format = ttUSHORT(data + index_map + 0); + if (format == 0) { // apple byte encoding + stbtt_int32 bytes = ttUSHORT(data + index_map + 2); + if (unicode_codepoint < bytes-6) + return ttBYTE(data + index_map + 6 + unicode_codepoint); + return 0; + } else if (format == 6) { + stbtt_uint32 first = ttUSHORT(data + index_map + 6); + stbtt_uint32 count = ttUSHORT(data + index_map + 8); + if ((stbtt_uint32) unicode_codepoint >= first && (stbtt_uint32) unicode_codepoint < first+count) + return ttUSHORT(data + index_map + 10 + (unicode_codepoint - first)*2); + return 0; + } else if (format == 2) { + STBTT_assert(0); // @TODO: high-byte mapping for japanese/chinese/korean + return 0; + } else if (format == 4) { // standard mapping for windows fonts: binary search collection of ranges + stbtt_uint16 segcount = ttUSHORT(data+index_map+6) >> 1; + stbtt_uint16 searchRange = ttUSHORT(data+index_map+8) >> 1; + stbtt_uint16 entrySelector = ttUSHORT(data+index_map+10); + stbtt_uint16 rangeShift = ttUSHORT(data+index_map+12) >> 1; + + // do a binary search of the segments + stbtt_uint32 endCount = index_map + 14; + stbtt_uint32 search = endCount; + + if (unicode_codepoint > 0xffff) + return 0; + + // they lie from endCount .. endCount + segCount + // but searchRange is the nearest power of two, so... + if (unicode_codepoint >= ttUSHORT(data + search + rangeShift*2)) + search += rangeShift*2; + + // now decrement to bias correctly to find smallest + search -= 2; + while (entrySelector) { + stbtt_uint16 end; + searchRange >>= 1; + end = ttUSHORT(data + search + searchRange*2); + if (unicode_codepoint > end) + search += searchRange*2; + --entrySelector; + } + search += 2; + + { + stbtt_uint16 offset, start; + stbtt_uint16 item = (stbtt_uint16) ((search - endCount) >> 1); + + STBTT_assert(unicode_codepoint <= ttUSHORT(data + endCount + 2*item)); + start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item); + if (unicode_codepoint < start) + return 0; + + offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item); + if (offset == 0) + return (stbtt_uint16) (unicode_codepoint + ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*item)); + + return ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*item); + } + } else if (format == 12 || format == 13) { + stbtt_uint32 ngroups = ttULONG(data+index_map+12); + stbtt_int32 low,high; + low = 0; high = (stbtt_int32)ngroups; + // Binary search the right group. + while (low < high) { + stbtt_int32 mid = low + ((high-low) >> 1); // rounds down, so low <= mid < high + stbtt_uint32 start_char = ttULONG(data+index_map+16+mid*12); + stbtt_uint32 end_char = ttULONG(data+index_map+16+mid*12+4); + if ((stbtt_uint32) unicode_codepoint < start_char) + high = mid; + else if ((stbtt_uint32) unicode_codepoint > end_char) + low = mid+1; + else { + stbtt_uint32 start_glyph = ttULONG(data+index_map+16+mid*12+8); + if (format == 12) + return start_glyph + unicode_codepoint-start_char; + else // format == 13 + return start_glyph; + } + } + return 0; // not found + } + // @TODO + STBTT_assert(0); + return 0; +} + +STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices) +{ + return stbtt_GetGlyphShape(info, stbtt_FindGlyphIndex(info, unicode_codepoint), vertices); +} + +static void stbtt_setvertex(stbtt_vertex *v, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy) +{ + v->type = type; + v->x = (stbtt_int16) x; + v->y = (stbtt_int16) y; + v->cx = (stbtt_int16) cx; + v->cy = (stbtt_int16) cy; +} + +static int stbtt__GetGlyfOffset(const stbtt_fontinfo *info, int glyph_index) +{ + int g1,g2; + + STBTT_assert(!info->cff.size); + + if (glyph_index >= info->numGlyphs) return -1; // glyph index out of range + if (info->indexToLocFormat >= 2) return -1; // unknown index->glyph map format + + if (info->indexToLocFormat == 0) { + g1 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2) * 2; + g2 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2 + 2) * 2; + } else { + g1 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4); + g2 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4 + 4); + } + + return g1==g2 ? -1 : g1; // if length is 0, return -1 +} + +static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1); + +STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1) +{ + if (info->cff.size) { + stbtt__GetGlyphInfoT2(info, glyph_index, x0, y0, x1, y1); + } else { + int g = stbtt__GetGlyfOffset(info, glyph_index); + if (g < 0) return 0; + + if (x0) *x0 = ttSHORT(info->data + g + 2); + if (y0) *y0 = ttSHORT(info->data + g + 4); + if (x1) *x1 = ttSHORT(info->data + g + 6); + if (y1) *y1 = ttSHORT(info->data + g + 8); + } + return 1; +} + +STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1) +{ + return stbtt_GetGlyphBox(info, stbtt_FindGlyphIndex(info,codepoint), x0,y0,x1,y1); +} + +STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index) +{ + stbtt_int16 numberOfContours; + int g; + if (info->cff.size) + return stbtt__GetGlyphInfoT2(info, glyph_index, NULL, NULL, NULL, NULL) == 0; + g = stbtt__GetGlyfOffset(info, glyph_index); + if (g < 0) return 1; + numberOfContours = ttSHORT(info->data + g); + return numberOfContours == 0; +} + +static int stbtt__close_shape(stbtt_vertex *vertices, int num_vertices, int was_off, int start_off, + stbtt_int32 sx, stbtt_int32 sy, stbtt_int32 scx, stbtt_int32 scy, stbtt_int32 cx, stbtt_int32 cy) +{ + if (start_off) { + if (was_off) + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+scx)>>1, (cy+scy)>>1, cx,cy); + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, sx,sy,scx,scy); + } else { + if (was_off) + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve,sx,sy,cx,cy); + else + stbtt_setvertex(&vertices[num_vertices++], STBTT_vline,sx,sy,0,0); + } + return num_vertices; +} + +static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) +{ + stbtt_int16 numberOfContours; + stbtt_uint8 *endPtsOfContours; + stbtt_uint8 *data = info->data; + stbtt_vertex *vertices=0; + int num_vertices=0; + int g = stbtt__GetGlyfOffset(info, glyph_index); + + *pvertices = NULL; + + if (g < 0) return 0; + + numberOfContours = ttSHORT(data + g); + + if (numberOfContours > 0) { + stbtt_uint8 flags=0,flagcount; + stbtt_int32 ins, i,j=0,m,n, next_move, was_off=0, off, start_off=0; + stbtt_int32 x,y,cx,cy,sx,sy, scx,scy; + stbtt_uint8 *points; + endPtsOfContours = (data + g + 10); + ins = ttUSHORT(data + g + 10 + numberOfContours * 2); + points = data + g + 10 + numberOfContours * 2 + 2 + ins; + + n = 1+ttUSHORT(endPtsOfContours + numberOfContours*2-2); + + m = n + 2*numberOfContours; // a loose bound on how many vertices we might need + vertices = (stbtt_vertex *) STBTT_malloc(m * sizeof(vertices[0]), info->userdata); + if (vertices == 0) + return 0; + + next_move = 0; + flagcount=0; + + // in first pass, we load uninterpreted data into the allocated array + // above, shifted to the end of the array so we won't overwrite it when + // we create our final data starting from the front + + off = m - n; // starting offset for uninterpreted data, regardless of how m ends up being calculated + + // first load flags + + for (i=0; i < n; ++i) { + if (flagcount == 0) { + flags = *points++; + if (flags & 8) + flagcount = *points++; + } else + --flagcount; + vertices[off+i].type = flags; + } + + // now load x coordinates + x=0; + for (i=0; i < n; ++i) { + flags = vertices[off+i].type; + if (flags & 2) { + stbtt_int16 dx = *points++; + x += (flags & 16) ? dx : -dx; // ??? + } else { + if (!(flags & 16)) { + x = x + (stbtt_int16) (points[0]*256 + points[1]); + points += 2; + } + } + vertices[off+i].x = (stbtt_int16) x; + } + + // now load y coordinates + y=0; + for (i=0; i < n; ++i) { + flags = vertices[off+i].type; + if (flags & 4) { + stbtt_int16 dy = *points++; + y += (flags & 32) ? dy : -dy; // ??? + } else { + if (!(flags & 32)) { + y = y + (stbtt_int16) (points[0]*256 + points[1]); + points += 2; + } + } + vertices[off+i].y = (stbtt_int16) y; + } + + // now convert them to our format + num_vertices=0; + sx = sy = cx = cy = scx = scy = 0; + for (i=0; i < n; ++i) { + flags = vertices[off+i].type; + x = (stbtt_int16) vertices[off+i].x; + y = (stbtt_int16) vertices[off+i].y; + + if (next_move == i) { + if (i != 0) + num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); + + // now start the new one + start_off = !(flags & 1); + if (start_off) { + // if we start off with an off-curve point, then when we need to find a point on the curve + // where we can start, and we need to save some state for when we wraparound. + scx = x; + scy = y; + if (!(vertices[off+i+1].type & 1)) { + // next point is also a curve point, so interpolate an on-point curve + sx = (x + (stbtt_int32) vertices[off+i+1].x) >> 1; + sy = (y + (stbtt_int32) vertices[off+i+1].y) >> 1; + } else { + // otherwise just use the next point as our start point + sx = (stbtt_int32) vertices[off+i+1].x; + sy = (stbtt_int32) vertices[off+i+1].y; + ++i; // we're using point i+1 as the starting point, so skip it + } + } else { + sx = x; + sy = y; + } + stbtt_setvertex(&vertices[num_vertices++], STBTT_vmove,sx,sy,0,0); + was_off = 0; + next_move = 1 + ttUSHORT(endPtsOfContours+j*2); + ++j; + } else { + if (!(flags & 1)) { // if it's a curve + if (was_off) // two off-curve control points in a row means interpolate an on-curve midpoint + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+x)>>1, (cy+y)>>1, cx, cy); + cx = x; + cy = y; + was_off = 1; + } else { + if (was_off) + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, x,y, cx, cy); + else + stbtt_setvertex(&vertices[num_vertices++], STBTT_vline, x,y,0,0); + was_off = 0; + } + } + } + num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); + } else if (numberOfContours == -1) { + // Compound shapes. + int more = 1; + stbtt_uint8 *comp = data + g + 10; + num_vertices = 0; + vertices = 0; + while (more) { + stbtt_uint16 flags, gidx; + int comp_num_verts = 0, i; + stbtt_vertex *comp_verts = 0, *tmp = 0; + float mtx[6] = {1,0,0,1,0,0}, m, n; + + flags = ttSHORT(comp); comp+=2; + gidx = ttSHORT(comp); comp+=2; + + if (flags & 2) { // XY values + if (flags & 1) { // shorts + mtx[4] = ttSHORT(comp); comp+=2; + mtx[5] = ttSHORT(comp); comp+=2; + } else { + mtx[4] = ttCHAR(comp); comp+=1; + mtx[5] = ttCHAR(comp); comp+=1; + } + } + else { + // @TODO handle matching point + STBTT_assert(0); + } + if (flags & (1<<3)) { // WE_HAVE_A_SCALE + mtx[0] = mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[1] = mtx[2] = 0; + } else if (flags & (1<<6)) { // WE_HAVE_AN_X_AND_YSCALE + mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[1] = mtx[2] = 0; + mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; + } else if (flags & (1<<7)) { // WE_HAVE_A_TWO_BY_TWO + mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[1] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[2] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; + } + + // Find transformation scales. + m = (float) STBTT_sqrt(mtx[0]*mtx[0] + mtx[1]*mtx[1]); + n = (float) STBTT_sqrt(mtx[2]*mtx[2] + mtx[3]*mtx[3]); + + // Get indexed glyph. + comp_num_verts = stbtt_GetGlyphShape(info, gidx, &comp_verts); + if (comp_num_verts > 0) { + // Transform vertices. + for (i = 0; i < comp_num_verts; ++i) { + stbtt_vertex* v = &comp_verts[i]; + stbtt_vertex_type x,y; + x=v->x; y=v->y; + v->x = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); + v->y = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); + x=v->cx; y=v->cy; + v->cx = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); + v->cy = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); + } + // Append vertices. + tmp = (stbtt_vertex*)STBTT_malloc((num_vertices+comp_num_verts)*sizeof(stbtt_vertex), info->userdata); + if (!tmp) { + if (vertices) STBTT_free(vertices, info->userdata); + if (comp_verts) STBTT_free(comp_verts, info->userdata); + return 0; + } + if (num_vertices > 0) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex)); + STBTT_memcpy(tmp+num_vertices, comp_verts, comp_num_verts*sizeof(stbtt_vertex)); + if (vertices) STBTT_free(vertices, info->userdata); + vertices = tmp; + STBTT_free(comp_verts, info->userdata); + num_vertices += comp_num_verts; + } + // More components ? + more = flags & (1<<5); + } + } else if (numberOfContours < 0) { + // @TODO other compound variations? + STBTT_assert(0); + } else { + // numberOfCounters == 0, do nothing + } + + *pvertices = vertices; + return num_vertices; +} + +typedef struct +{ + int bounds; + int started; + float first_x, first_y; + float x, y; + stbtt_int32 min_x, max_x, min_y, max_y; + + stbtt_vertex *pvertices; + int num_vertices; +} stbtt__csctx; + +#define STBTT__CSCTX_INIT(bounds) {bounds,0, 0,0, 0,0, 0,0,0,0, NULL, 0} + +static void stbtt__track_vertex(stbtt__csctx *c, stbtt_int32 x, stbtt_int32 y) +{ + if (x > c->max_x || !c->started) c->max_x = x; + if (y > c->max_y || !c->started) c->max_y = y; + if (x < c->min_x || !c->started) c->min_x = x; + if (y < c->min_y || !c->started) c->min_y = y; + c->started = 1; +} + +static void stbtt__csctx_v(stbtt__csctx *c, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy, stbtt_int32 cx1, stbtt_int32 cy1) +{ + if (c->bounds) { + stbtt__track_vertex(c, x, y); + if (type == STBTT_vcubic) { + stbtt__track_vertex(c, cx, cy); + stbtt__track_vertex(c, cx1, cy1); + } + } else { + stbtt_setvertex(&c->pvertices[c->num_vertices], type, x, y, cx, cy); + c->pvertices[c->num_vertices].cx1 = (stbtt_int16) cx1; + c->pvertices[c->num_vertices].cy1 = (stbtt_int16) cy1; + } + c->num_vertices++; +} + +static void stbtt__csctx_close_shape(stbtt__csctx *ctx) +{ + if (ctx->first_x != ctx->x || ctx->first_y != ctx->y) + stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->first_x, (int)ctx->first_y, 0, 0, 0, 0); +} + +static void stbtt__csctx_rmove_to(stbtt__csctx *ctx, float dx, float dy) +{ + stbtt__csctx_close_shape(ctx); + ctx->first_x = ctx->x = ctx->x + dx; + ctx->first_y = ctx->y = ctx->y + dy; + stbtt__csctx_v(ctx, STBTT_vmove, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0); +} + +static void stbtt__csctx_rline_to(stbtt__csctx *ctx, float dx, float dy) +{ + ctx->x += dx; + ctx->y += dy; + stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0); +} + +static void stbtt__csctx_rccurve_to(stbtt__csctx *ctx, float dx1, float dy1, float dx2, float dy2, float dx3, float dy3) +{ + float cx1 = ctx->x + dx1; + float cy1 = ctx->y + dy1; + float cx2 = cx1 + dx2; + float cy2 = cy1 + dy2; + ctx->x = cx2 + dx3; + ctx->y = cy2 + dy3; + stbtt__csctx_v(ctx, STBTT_vcubic, (int)ctx->x, (int)ctx->y, (int)cx1, (int)cy1, (int)cx2, (int)cy2); +} + +static stbtt__buf stbtt__get_subr(stbtt__buf idx, int n) +{ + int count = stbtt__cff_index_count(&idx); + int bias = 107; + if (count >= 33900) + bias = 32768; + else if (count >= 1240) + bias = 1131; + n += bias; + if (n < 0 || n >= count) + return stbtt__new_buf(NULL, 0); + return stbtt__cff_index_get(idx, n); +} + +static stbtt__buf stbtt__cid_get_glyph_subrs(const stbtt_fontinfo *info, int glyph_index) +{ + stbtt__buf fdselect = info->fdselect; + int nranges, start, end, v, fmt, fdselector = -1, i; + + stbtt__buf_seek(&fdselect, 0); + fmt = stbtt__buf_get8(&fdselect); + if (fmt == 0) { + // untested + stbtt__buf_skip(&fdselect, glyph_index); + fdselector = stbtt__buf_get8(&fdselect); + } else if (fmt == 3) { + nranges = stbtt__buf_get16(&fdselect); + start = stbtt__buf_get16(&fdselect); + for (i = 0; i < nranges; i++) { + v = stbtt__buf_get8(&fdselect); + end = stbtt__buf_get16(&fdselect); + if (glyph_index >= start && glyph_index < end) { + fdselector = v; + break; + } + start = end; + } + } + if (fdselector == -1) stbtt__new_buf(NULL, 0); + return stbtt__get_subrs(info->cff, stbtt__cff_index_get(info->fontdicts, fdselector)); +} + +static int stbtt__run_charstring(const stbtt_fontinfo *info, int glyph_index, stbtt__csctx *c) +{ + int in_header = 1, maskbits = 0, subr_stack_height = 0, sp = 0, v, i, b0; + int has_subrs = 0, clear_stack; + float s[48]; + stbtt__buf subr_stack[10], subrs = info->subrs, b; + float f; + +#define STBTT__CSERR(s) (0) + + // this currently ignores the initial width value, which isn't needed if we have hmtx + b = stbtt__cff_index_get(info->charstrings, glyph_index); + while (b.cursor < b.size) { + i = 0; + clear_stack = 1; + b0 = stbtt__buf_get8(&b); + switch (b0) { + // @TODO implement hinting + case 0x13: // hintmask + case 0x14: // cntrmask + if (in_header) + maskbits += (sp / 2); // implicit "vstem" + in_header = 0; + stbtt__buf_skip(&b, (maskbits + 7) / 8); + break; + + case 0x01: // hstem + case 0x03: // vstem + case 0x12: // hstemhm + case 0x17: // vstemhm + maskbits += (sp / 2); + break; + + case 0x15: // rmoveto + in_header = 0; + if (sp < 2) return STBTT__CSERR("rmoveto stack"); + stbtt__csctx_rmove_to(c, s[sp-2], s[sp-1]); + break; + case 0x04: // vmoveto + in_header = 0; + if (sp < 1) return STBTT__CSERR("vmoveto stack"); + stbtt__csctx_rmove_to(c, 0, s[sp-1]); + break; + case 0x16: // hmoveto + in_header = 0; + if (sp < 1) return STBTT__CSERR("hmoveto stack"); + stbtt__csctx_rmove_to(c, s[sp-1], 0); + break; + + case 0x05: // rlineto + if (sp < 2) return STBTT__CSERR("rlineto stack"); + for (; i + 1 < sp; i += 2) + stbtt__csctx_rline_to(c, s[i], s[i+1]); + break; + + // hlineto/vlineto and vhcurveto/hvcurveto alternate horizontal and vertical + // starting from a different place. + + case 0x07: // vlineto + if (sp < 1) return STBTT__CSERR("vlineto stack"); + goto vlineto; + case 0x06: // hlineto + if (sp < 1) return STBTT__CSERR("hlineto stack"); + for (;;) { + if (i >= sp) break; + stbtt__csctx_rline_to(c, s[i], 0); + i++; + vlineto: + if (i >= sp) break; + stbtt__csctx_rline_to(c, 0, s[i]); + i++; + } + break; + + case 0x1F: // hvcurveto + if (sp < 4) return STBTT__CSERR("hvcurveto stack"); + goto hvcurveto; + case 0x1E: // vhcurveto + if (sp < 4) return STBTT__CSERR("vhcurveto stack"); + for (;;) { + if (i + 3 >= sp) break; + stbtt__csctx_rccurve_to(c, 0, s[i], s[i+1], s[i+2], s[i+3], (sp - i == 5) ? s[i + 4] : 0.0f); + i += 4; + hvcurveto: + if (i + 3 >= sp) break; + stbtt__csctx_rccurve_to(c, s[i], 0, s[i+1], s[i+2], (sp - i == 5) ? s[i+4] : 0.0f, s[i+3]); + i += 4; + } + break; + + case 0x08: // rrcurveto + if (sp < 6) return STBTT__CSERR("rcurveline stack"); + for (; i + 5 < sp; i += 6) + stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); + break; + + case 0x18: // rcurveline + if (sp < 8) return STBTT__CSERR("rcurveline stack"); + for (; i + 5 < sp - 2; i += 6) + stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); + if (i + 1 >= sp) return STBTT__CSERR("rcurveline stack"); + stbtt__csctx_rline_to(c, s[i], s[i+1]); + break; + + case 0x19: // rlinecurve + if (sp < 8) return STBTT__CSERR("rlinecurve stack"); + for (; i + 1 < sp - 6; i += 2) + stbtt__csctx_rline_to(c, s[i], s[i+1]); + if (i + 5 >= sp) return STBTT__CSERR("rlinecurve stack"); + stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); + break; + + case 0x1A: // vvcurveto + case 0x1B: // hhcurveto + if (sp < 4) return STBTT__CSERR("(vv|hh)curveto stack"); + f = 0.0; + if (sp & 1) { f = s[i]; i++; } + for (; i + 3 < sp; i += 4) { + if (b0 == 0x1B) + stbtt__csctx_rccurve_to(c, s[i], f, s[i+1], s[i+2], s[i+3], 0.0); + else + stbtt__csctx_rccurve_to(c, f, s[i], s[i+1], s[i+2], 0.0, s[i+3]); + f = 0.0; + } + break; + + case 0x0A: // callsubr + if (!has_subrs) { + if (info->fdselect.size) + subrs = stbtt__cid_get_glyph_subrs(info, glyph_index); + has_subrs = 1; + } + // fallthrough + case 0x1D: // callgsubr + if (sp < 1) return STBTT__CSERR("call(g|)subr stack"); + v = (int) s[--sp]; + if (subr_stack_height >= 10) return STBTT__CSERR("recursion limit"); + subr_stack[subr_stack_height++] = b; + b = stbtt__get_subr(b0 == 0x0A ? subrs : info->gsubrs, v); + if (b.size == 0) return STBTT__CSERR("subr not found"); + b.cursor = 0; + clear_stack = 0; + break; + + case 0x0B: // return + if (subr_stack_height <= 0) return STBTT__CSERR("return outside subr"); + b = subr_stack[--subr_stack_height]; + clear_stack = 0; + break; + + case 0x0E: // endchar + stbtt__csctx_close_shape(c); + return 1; + + case 0x0C: { // two-byte escape + float dx1, dx2, dx3, dx4, dx5, dx6, dy1, dy2, dy3, dy4, dy5, dy6; + float dx, dy; + int b1 = stbtt__buf_get8(&b); + switch (b1) { + // @TODO These "flex" implementations ignore the flex-depth and resolution, + // and always draw beziers. + case 0x22: // hflex + if (sp < 7) return STBTT__CSERR("hflex stack"); + dx1 = s[0]; + dx2 = s[1]; + dy2 = s[2]; + dx3 = s[3]; + dx4 = s[4]; + dx5 = s[5]; + dx6 = s[6]; + stbtt__csctx_rccurve_to(c, dx1, 0, dx2, dy2, dx3, 0); + stbtt__csctx_rccurve_to(c, dx4, 0, dx5, -dy2, dx6, 0); + break; + + case 0x23: // flex + if (sp < 13) return STBTT__CSERR("flex stack"); + dx1 = s[0]; + dy1 = s[1]; + dx2 = s[2]; + dy2 = s[3]; + dx3 = s[4]; + dy3 = s[5]; + dx4 = s[6]; + dy4 = s[7]; + dx5 = s[8]; + dy5 = s[9]; + dx6 = s[10]; + dy6 = s[11]; + //fd is s[12] + stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, dy3); + stbtt__csctx_rccurve_to(c, dx4, dy4, dx5, dy5, dx6, dy6); + break; + + case 0x24: // hflex1 + if (sp < 9) return STBTT__CSERR("hflex1 stack"); + dx1 = s[0]; + dy1 = s[1]; + dx2 = s[2]; + dy2 = s[3]; + dx3 = s[4]; + dx4 = s[5]; + dx5 = s[6]; + dy5 = s[7]; + dx6 = s[8]; + stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, 0); + stbtt__csctx_rccurve_to(c, dx4, 0, dx5, dy5, dx6, -(dy1+dy2+dy5)); + break; + + case 0x25: // flex1 + if (sp < 11) return STBTT__CSERR("flex1 stack"); + dx1 = s[0]; + dy1 = s[1]; + dx2 = s[2]; + dy2 = s[3]; + dx3 = s[4]; + dy3 = s[5]; + dx4 = s[6]; + dy4 = s[7]; + dx5 = s[8]; + dy5 = s[9]; + dx6 = dy6 = s[10]; + dx = dx1+dx2+dx3+dx4+dx5; + dy = dy1+dy2+dy3+dy4+dy5; + if (STBTT_fabs(dx) > STBTT_fabs(dy)) + dy6 = -dy; + else + dx6 = -dx; + stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, dy3); + stbtt__csctx_rccurve_to(c, dx4, dy4, dx5, dy5, dx6, dy6); + break; + + default: + return STBTT__CSERR("unimplemented"); + } + } break; + + default: + if (b0 != 255 && b0 != 28 && (b0 < 32 || b0 > 254)) + return STBTT__CSERR("reserved operator"); + + // push immediate + if (b0 == 255) { + f = (float)(stbtt_int32)stbtt__buf_get32(&b) / 0x10000; + } else { + stbtt__buf_skip(&b, -1); + f = (float)(stbtt_int16)stbtt__cff_int(&b); + } + if (sp >= 48) return STBTT__CSERR("push stack overflow"); + s[sp++] = f; + clear_stack = 0; + break; + } + if (clear_stack) sp = 0; + } + return STBTT__CSERR("no endchar"); + +#undef STBTT__CSERR +} + +static int stbtt__GetGlyphShapeT2(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) +{ + // runs the charstring twice, once to count and once to output (to avoid realloc) + stbtt__csctx count_ctx = STBTT__CSCTX_INIT(1); + stbtt__csctx output_ctx = STBTT__CSCTX_INIT(0); + if (stbtt__run_charstring(info, glyph_index, &count_ctx)) { + *pvertices = (stbtt_vertex*)STBTT_malloc(count_ctx.num_vertices*sizeof(stbtt_vertex), info->userdata); + output_ctx.pvertices = *pvertices; + if (stbtt__run_charstring(info, glyph_index, &output_ctx)) { + STBTT_assert(output_ctx.num_vertices == count_ctx.num_vertices); + return output_ctx.num_vertices; + } + } + *pvertices = NULL; + return 0; +} + +static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1) +{ + stbtt__csctx c = STBTT__CSCTX_INIT(1); + int r = stbtt__run_charstring(info, glyph_index, &c); + if (x0) *x0 = r ? c.min_x : 0; + if (y0) *y0 = r ? c.min_y : 0; + if (x1) *x1 = r ? c.max_x : 0; + if (y1) *y1 = r ? c.max_y : 0; + return r ? c.num_vertices : 0; +} + +STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) +{ + if (!info->cff.size) + return stbtt__GetGlyphShapeTT(info, glyph_index, pvertices); + else + return stbtt__GetGlyphShapeT2(info, glyph_index, pvertices); +} + +STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing) +{ + stbtt_uint16 numOfLongHorMetrics = ttUSHORT(info->data+info->hhea + 34); + if (glyph_index < numOfLongHorMetrics) { + if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*glyph_index); + if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*glyph_index + 2); + } else { + if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*(numOfLongHorMetrics-1)); + if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*numOfLongHorMetrics + 2*(glyph_index - numOfLongHorMetrics)); + } +} + +static int stbtt__GetGlyphKernInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) +{ + stbtt_uint8 *data = info->data + info->kern; + stbtt_uint32 needle, straw; + int l, r, m; + + // we only look at the first table. it must be 'horizontal' and format 0. + if (!info->kern) + return 0; + if (ttUSHORT(data+2) < 1) // number of tables, need at least 1 + return 0; + if (ttUSHORT(data+8) != 1) // horizontal flag must be set in format + return 0; + + l = 0; + r = ttUSHORT(data+10) - 1; + needle = glyph1 << 16 | glyph2; + while (l <= r) { + m = (l + r) >> 1; + straw = ttULONG(data+18+(m*6)); // note: unaligned read + if (needle < straw) + r = m - 1; + else if (needle > straw) + l = m + 1; + else + return ttSHORT(data+22+(m*6)); + } + return 0; +} + +static stbtt_int32 stbtt__GetCoverageIndex(stbtt_uint8 *coverageTable, int glyph) +{ + stbtt_uint16 coverageFormat = ttUSHORT(coverageTable); + switch(coverageFormat) { + case 1: { + stbtt_uint16 glyphCount = ttUSHORT(coverageTable + 2); + + // Binary search. + stbtt_int32 l=0, r=glyphCount-1, m; + int straw, needle=glyph; + while (l <= r) { + stbtt_uint8 *glyphArray = coverageTable + 4; + stbtt_uint16 glyphID; + m = (l + r) >> 1; + glyphID = ttUSHORT(glyphArray + 2 * m); + straw = glyphID; + if (needle < straw) + r = m - 1; + else if (needle > straw) + l = m + 1; + else { + return m; + } + } + } break; + + case 2: { + stbtt_uint16 rangeCount = ttUSHORT(coverageTable + 2); + stbtt_uint8 *rangeArray = coverageTable + 4; + + // Binary search. + stbtt_int32 l=0, r=rangeCount-1, m; + int strawStart, strawEnd, needle=glyph; + while (l <= r) { + stbtt_uint8 *rangeRecord; + m = (l + r) >> 1; + rangeRecord = rangeArray + 6 * m; + strawStart = ttUSHORT(rangeRecord); + strawEnd = ttUSHORT(rangeRecord + 2); + if (needle < strawStart) + r = m - 1; + else if (needle > strawEnd) + l = m + 1; + else { + stbtt_uint16 startCoverageIndex = ttUSHORT(rangeRecord + 4); + return startCoverageIndex + glyph - strawStart; + } + } + } break; + + default: { + // There are no other cases. + STBTT_assert(0); + } break; + } + + return -1; +} + +static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph) +{ + stbtt_uint16 classDefFormat = ttUSHORT(classDefTable); + switch(classDefFormat) + { + case 1: { + stbtt_uint16 startGlyphID = ttUSHORT(classDefTable + 2); + stbtt_uint16 glyphCount = ttUSHORT(classDefTable + 4); + stbtt_uint8 *classDef1ValueArray = classDefTable + 6; + + if (glyph >= startGlyphID && glyph < startGlyphID + glyphCount) + return (stbtt_int32)ttUSHORT(classDef1ValueArray + 2 * (glyph - startGlyphID)); + + classDefTable = classDef1ValueArray + 2 * glyphCount; + } break; + + case 2: { + stbtt_uint16 classRangeCount = ttUSHORT(classDefTable + 2); + stbtt_uint8 *classRangeRecords = classDefTable + 4; + + // Binary search. + stbtt_int32 l=0, r=classRangeCount-1, m; + int strawStart, strawEnd, needle=glyph; + while (l <= r) { + stbtt_uint8 *classRangeRecord; + m = (l + r) >> 1; + classRangeRecord = classRangeRecords + 6 * m; + strawStart = ttUSHORT(classRangeRecord); + strawEnd = ttUSHORT(classRangeRecord + 2); + if (needle < strawStart) + r = m - 1; + else if (needle > strawEnd) + l = m + 1; + else + return (stbtt_int32)ttUSHORT(classRangeRecord + 4); + } + + classDefTable = classRangeRecords + 6 * classRangeCount; + } break; + + default: { + // There are no other cases. + STBTT_assert(0); + } break; + } + + return -1; +} + +// Define to STBTT_assert(x) if you want to break on unimplemented formats. +#define STBTT_GPOS_TODO_assert(x) + +static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) +{ + stbtt_uint16 lookupListOffset; + stbtt_uint8 *lookupList; + stbtt_uint16 lookupCount; + stbtt_uint8 *data; + stbtt_int32 i; + + if (!info->gpos) return 0; + + data = info->data + info->gpos; + + if (ttUSHORT(data+0) != 1) return 0; // Major version 1 + if (ttUSHORT(data+2) != 0) return 0; // Minor version 0 + + lookupListOffset = ttUSHORT(data+8); + lookupList = data + lookupListOffset; + lookupCount = ttUSHORT(lookupList); + + for (i=0; i> 1; + pairValue = pairValueArray + (2 + valueRecordPairSizeInBytes) * m; + secondGlyph = ttUSHORT(pairValue); + straw = secondGlyph; + if (needle < straw) + r = m - 1; + else if (needle > straw) + l = m + 1; + else { + stbtt_int16 xAdvance = ttSHORT(pairValue + 2); + return xAdvance; + } + } + } break; + + case 2: { + stbtt_uint16 valueFormat1 = ttUSHORT(table + 4); + stbtt_uint16 valueFormat2 = ttUSHORT(table + 6); + + stbtt_uint16 classDef1Offset = ttUSHORT(table + 8); + stbtt_uint16 classDef2Offset = ttUSHORT(table + 10); + int glyph1class = stbtt__GetGlyphClass(table + classDef1Offset, glyph1); + int glyph2class = stbtt__GetGlyphClass(table + classDef2Offset, glyph2); + + stbtt_uint16 class1Count = ttUSHORT(table + 12); + stbtt_uint16 class2Count = ttUSHORT(table + 14); + STBTT_assert(glyph1class < class1Count); + STBTT_assert(glyph2class < class2Count); + + // TODO: Support more formats. + STBTT_GPOS_TODO_assert(valueFormat1 == 4); + if (valueFormat1 != 4) return 0; + STBTT_GPOS_TODO_assert(valueFormat2 == 0); + if (valueFormat2 != 0) return 0; + + if (glyph1class >= 0 && glyph1class < class1Count && glyph2class >= 0 && glyph2class < class2Count) { + stbtt_uint8 *class1Records = table + 16; + stbtt_uint8 *class2Records = class1Records + 2 * (glyph1class * class2Count); + stbtt_int16 xAdvance = ttSHORT(class2Records + 2 * glyph2class); + return xAdvance; + } + } break; + + default: { + // There are no other cases. + STBTT_assert(0); + break; + }; + } + } + break; + }; + + default: + // TODO: Implement other stuff. + break; + } + } + + return 0; +} + +STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int g1, int g2) +{ + int xAdvance = 0; + + if (info->gpos) + xAdvance += stbtt__GetGlyphGPOSInfoAdvance(info, g1, g2); + + if (info->kern) + xAdvance += stbtt__GetGlyphKernInfoAdvance(info, g1, g2); + + return xAdvance; +} + +STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2) +{ + if (!info->kern && !info->gpos) // if no kerning table, don't waste time looking up both codepoint->glyphs + return 0; + return stbtt_GetGlyphKernAdvance(info, stbtt_FindGlyphIndex(info,ch1), stbtt_FindGlyphIndex(info,ch2)); +} + +STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing) +{ + stbtt_GetGlyphHMetrics(info, stbtt_FindGlyphIndex(info,codepoint), advanceWidth, leftSideBearing); +} + +STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap) +{ + if (ascent ) *ascent = ttSHORT(info->data+info->hhea + 4); + if (descent) *descent = ttSHORT(info->data+info->hhea + 6); + if (lineGap) *lineGap = ttSHORT(info->data+info->hhea + 8); +} + +STBTT_DEF int stbtt_GetFontVMetricsOS2(const stbtt_fontinfo *info, int *typoAscent, int *typoDescent, int *typoLineGap) +{ + int tab = stbtt__find_table(info->data, info->fontstart, "OS/2"); + if (!tab) + return 0; + if (typoAscent ) *typoAscent = ttSHORT(info->data+tab + 68); + if (typoDescent) *typoDescent = ttSHORT(info->data+tab + 70); + if (typoLineGap) *typoLineGap = ttSHORT(info->data+tab + 72); + return 1; +} + +STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1) +{ + *x0 = ttSHORT(info->data + info->head + 36); + *y0 = ttSHORT(info->data + info->head + 38); + *x1 = ttSHORT(info->data + info->head + 40); + *y1 = ttSHORT(info->data + info->head + 42); +} + +STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float height) +{ + int fheight = ttSHORT(info->data + info->hhea + 4) - ttSHORT(info->data + info->hhea + 6); + return (float) height / fheight; +} + +STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels) +{ + int unitsPerEm = ttUSHORT(info->data + info->head + 18); + return pixels / unitsPerEm; +} + +STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *v) +{ + STBTT_free(v, info->userdata); +} + +////////////////////////////////////////////////////////////////////////////// +// +// antialiasing software rasterizer +// + +STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1) +{ + int x0=0,y0=0,x1,y1; // =0 suppresses compiler warning + if (!stbtt_GetGlyphBox(font, glyph, &x0,&y0,&x1,&y1)) { + // e.g. space character + if (ix0) *ix0 = 0; + if (iy0) *iy0 = 0; + if (ix1) *ix1 = 0; + if (iy1) *iy1 = 0; + } else { + // move to integral bboxes (treating pixels as little squares, what pixels get touched)? + if (ix0) *ix0 = STBTT_ifloor( x0 * scale_x + shift_x); + if (iy0) *iy0 = STBTT_ifloor(-y1 * scale_y + shift_y); + if (ix1) *ix1 = STBTT_iceil ( x1 * scale_x + shift_x); + if (iy1) *iy1 = STBTT_iceil (-y0 * scale_y + shift_y); + } +} + +STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) +{ + stbtt_GetGlyphBitmapBoxSubpixel(font, glyph, scale_x, scale_y,0.0f,0.0f, ix0, iy0, ix1, iy1); +} + +STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1) +{ + stbtt_GetGlyphBitmapBoxSubpixel(font, stbtt_FindGlyphIndex(font,codepoint), scale_x, scale_y,shift_x,shift_y, ix0,iy0,ix1,iy1); +} + +STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) +{ + stbtt_GetCodepointBitmapBoxSubpixel(font, codepoint, scale_x, scale_y,0.0f,0.0f, ix0,iy0,ix1,iy1); +} + +////////////////////////////////////////////////////////////////////////////// +// +// Rasterizer + +typedef struct stbtt__hheap_chunk +{ + struct stbtt__hheap_chunk *next; +} stbtt__hheap_chunk; + +typedef struct stbtt__hheap +{ + struct stbtt__hheap_chunk *head; + void *first_free; + int num_remaining_in_head_chunk; +} stbtt__hheap; + +static void *stbtt__hheap_alloc(stbtt__hheap *hh, size_t size, void *userdata) +{ + if (hh->first_free) { + void *p = hh->first_free; + hh->first_free = * (void **) p; + return p; + } else { + if (hh->num_remaining_in_head_chunk == 0) { + int count = (size < 32 ? 2000 : size < 128 ? 800 : 100); + stbtt__hheap_chunk *c = (stbtt__hheap_chunk *) STBTT_malloc(sizeof(stbtt__hheap_chunk) + size * count, userdata); + if (c == NULL) + return NULL; + c->next = hh->head; + hh->head = c; + hh->num_remaining_in_head_chunk = count; + } + --hh->num_remaining_in_head_chunk; + return (char *) (hh->head) + sizeof(stbtt__hheap_chunk) + size * hh->num_remaining_in_head_chunk; + } +} + +static void stbtt__hheap_free(stbtt__hheap *hh, void *p) +{ + *(void **) p = hh->first_free; + hh->first_free = p; +} + +static void stbtt__hheap_cleanup(stbtt__hheap *hh, void *userdata) +{ + stbtt__hheap_chunk *c = hh->head; + while (c) { + stbtt__hheap_chunk *n = c->next; + STBTT_free(c, userdata); + c = n; + } +} + +typedef struct stbtt__edge { + float x0,y0, x1,y1; + int invert; +} stbtt__edge; + + +typedef struct stbtt__active_edge +{ + struct stbtt__active_edge *next; + #if STBTT_RASTERIZER_VERSION==1 + int x,dx; + float ey; + int direction; + #elif STBTT_RASTERIZER_VERSION==2 + float fx,fdx,fdy; + float direction; + float sy; + float ey; + #else + #error "Unrecognized value of STBTT_RASTERIZER_VERSION" + #endif +} stbtt__active_edge; + +#if STBTT_RASTERIZER_VERSION == 1 +#define STBTT_FIXSHIFT 10 +#define STBTT_FIX (1 << STBTT_FIXSHIFT) +#define STBTT_FIXMASK (STBTT_FIX-1) + +static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata) +{ + stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata); + float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); + STBTT_assert(z != NULL); + if (!z) return z; + + // round dx down to avoid overshooting + if (dxdy < 0) + z->dx = -STBTT_ifloor(STBTT_FIX * -dxdy); + else + z->dx = STBTT_ifloor(STBTT_FIX * dxdy); + + z->x = STBTT_ifloor(STBTT_FIX * e->x0 + z->dx * (start_point - e->y0)); // use z->dx so when we offset later it's by the same amount + z->x -= off_x * STBTT_FIX; + + z->ey = e->y1; + z->next = 0; + z->direction = e->invert ? 1 : -1; + return z; +} +#elif STBTT_RASTERIZER_VERSION == 2 +static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata) +{ + stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata); + float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); + STBTT_assert(z != NULL); + //STBTT_assert(e->y0 <= start_point); + if (!z) return z; + z->fdx = dxdy; + z->fdy = dxdy != 0.0f ? (1.0f/dxdy) : 0.0f; + z->fx = e->x0 + dxdy * (start_point - e->y0); + z->fx -= off_x; + z->direction = e->invert ? 1.0f : -1.0f; + z->sy = e->y0; + z->ey = e->y1; + z->next = 0; + return z; +} +#else +#error "Unrecognized value of STBTT_RASTERIZER_VERSION" +#endif + +#if STBTT_RASTERIZER_VERSION == 1 +// note: this routine clips fills that extend off the edges... ideally this +// wouldn't happen, but it could happen if the truetype glyph bounding boxes +// are wrong, or if the user supplies a too-small bitmap +static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__active_edge *e, int max_weight) +{ + // non-zero winding fill + int x0=0, w=0; + + while (e) { + if (w == 0) { + // if we're currently at zero, we need to record the edge start point + x0 = e->x; w += e->direction; + } else { + int x1 = e->x; w += e->direction; + // if we went to zero, we need to draw + if (w == 0) { + int i = x0 >> STBTT_FIXSHIFT; + int j = x1 >> STBTT_FIXSHIFT; + + if (i < len && j >= 0) { + if (i == j) { + // x0,x1 are the same pixel, so compute combined coverage + scanline[i] = scanline[i] + (stbtt_uint8) ((x1 - x0) * max_weight >> STBTT_FIXSHIFT); + } else { + if (i >= 0) // add antialiasing for x0 + scanline[i] = scanline[i] + (stbtt_uint8) (((STBTT_FIX - (x0 & STBTT_FIXMASK)) * max_weight) >> STBTT_FIXSHIFT); + else + i = -1; // clip + + if (j < len) // add antialiasing for x1 + scanline[j] = scanline[j] + (stbtt_uint8) (((x1 & STBTT_FIXMASK) * max_weight) >> STBTT_FIXSHIFT); + else + j = len; // clip + + for (++i; i < j; ++i) // fill pixels between x0 and x1 + scanline[i] = scanline[i] + (stbtt_uint8) max_weight; + } + } + } + } + + e = e->next; + } +} + +static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) +{ + stbtt__hheap hh = { 0, 0, 0 }; + stbtt__active_edge *active = NULL; + int y,j=0; + int max_weight = (255 / vsubsample); // weight per vertical scanline + int s; // vertical subsample index + unsigned char scanline_data[512], *scanline; + + if (result->w > 512) + scanline = (unsigned char *) STBTT_malloc(result->w, userdata); + else + scanline = scanline_data; + + y = off_y * vsubsample; + e[n].y0 = (off_y + result->h) * (float) vsubsample + 1; + + while (j < result->h) { + STBTT_memset(scanline, 0, result->w); + for (s=0; s < vsubsample; ++s) { + // find center of pixel for this scanline + float scan_y = y + 0.5f; + stbtt__active_edge **step = &active; + + // update all active edges; + // remove all active edges that terminate before the center of this scanline + while (*step) { + stbtt__active_edge * z = *step; + if (z->ey <= scan_y) { + *step = z->next; // delete from list + STBTT_assert(z->direction); + z->direction = 0; + stbtt__hheap_free(&hh, z); + } else { + z->x += z->dx; // advance to position for current scanline + step = &((*step)->next); // advance through list + } + } + + // resort the list if needed + for(;;) { + int changed=0; + step = &active; + while (*step && (*step)->next) { + if ((*step)->x > (*step)->next->x) { + stbtt__active_edge *t = *step; + stbtt__active_edge *q = t->next; + + t->next = q->next; + q->next = t; + *step = q; + changed = 1; + } + step = &(*step)->next; + } + if (!changed) break; + } + + // insert all edges that start before the center of this scanline -- omit ones that also end on this scanline + while (e->y0 <= scan_y) { + if (e->y1 > scan_y) { + stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y, userdata); + if (z != NULL) { + // find insertion point + if (active == NULL) + active = z; + else if (z->x < active->x) { + // insert at front + z->next = active; + active = z; + } else { + // find thing to insert AFTER + stbtt__active_edge *p = active; + while (p->next && p->next->x < z->x) + p = p->next; + // at this point, p->next->x is NOT < z->x + z->next = p->next; + p->next = z; + } + } + } + ++e; + } + + // now process all active edges in XOR fashion + if (active) + stbtt__fill_active_edges(scanline, result->w, active, max_weight); + + ++y; + } + STBTT_memcpy(result->pixels + j * result->stride, scanline, result->w); + ++j; + } + + stbtt__hheap_cleanup(&hh, userdata); + + if (scanline != scanline_data) + STBTT_free(scanline, userdata); +} + +#elif STBTT_RASTERIZER_VERSION == 2 + +// the edge passed in here does not cross the vertical line at x or the vertical line at x+1 +// (i.e. it has already been clipped to those) +static void stbtt__handle_clipped_edge(float *scanline, int x, stbtt__active_edge *e, float x0, float y0, float x1, float y1) +{ + if (y0 == y1) return; + STBTT_assert(y0 < y1); + STBTT_assert(e->sy <= e->ey); + if (y0 > e->ey) return; + if (y1 < e->sy) return; + if (y0 < e->sy) { + x0 += (x1-x0) * (e->sy - y0) / (y1-y0); + y0 = e->sy; + } + if (y1 > e->ey) { + x1 += (x1-x0) * (e->ey - y1) / (y1-y0); + y1 = e->ey; + } + + if (x0 == x) + STBTT_assert(x1 <= x+1); + else if (x0 == x+1) + STBTT_assert(x1 >= x); + else if (x0 <= x) + STBTT_assert(x1 <= x); + else if (x0 >= x+1) + STBTT_assert(x1 >= x+1); + else + STBTT_assert(x1 >= x && x1 <= x+1); + + if (x0 <= x && x1 <= x) + scanline[x] += e->direction * (y1-y0); + else if (x0 >= x+1 && x1 >= x+1) + ; + else { + STBTT_assert(x0 >= x && x0 <= x+1 && x1 >= x && x1 <= x+1); + scanline[x] += e->direction * (y1-y0) * (1-((x0-x)+(x1-x))/2); // coverage = 1 - average x position + } +} + +static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, int len, stbtt__active_edge *e, float y_top) +{ + float y_bottom = y_top+1; + + while (e) { + // brute force every pixel + + // compute intersection points with top & bottom + STBTT_assert(e->ey >= y_top); + + if (e->fdx == 0) { + float x0 = e->fx; + if (x0 < len) { + if (x0 >= 0) { + stbtt__handle_clipped_edge(scanline,(int) x0,e, x0,y_top, x0,y_bottom); + stbtt__handle_clipped_edge(scanline_fill-1,(int) x0+1,e, x0,y_top, x0,y_bottom); + } else { + stbtt__handle_clipped_edge(scanline_fill-1,0,e, x0,y_top, x0,y_bottom); + } + } + } else { + float x0 = e->fx; + float dx = e->fdx; + float xb = x0 + dx; + float x_top, x_bottom; + float sy0,sy1; + float dy = e->fdy; + STBTT_assert(e->sy <= y_bottom && e->ey >= y_top); + + // compute endpoints of line segment clipped to this scanline (if the + // line segment starts on this scanline. x0 is the intersection of the + // line with y_top, but that may be off the line segment. + if (e->sy > y_top) { + x_top = x0 + dx * (e->sy - y_top); + sy0 = e->sy; + } else { + x_top = x0; + sy0 = y_top; + } + if (e->ey < y_bottom) { + x_bottom = x0 + dx * (e->ey - y_top); + sy1 = e->ey; + } else { + x_bottom = xb; + sy1 = y_bottom; + } + + if (x_top >= 0 && x_bottom >= 0 && x_top < len && x_bottom < len) { + // from here on, we don't have to range check x values + + if ((int) x_top == (int) x_bottom) { + float height; + // simple case, only spans one pixel + int x = (int) x_top; + height = sy1 - sy0; + STBTT_assert(x >= 0 && x < len); + scanline[x] += e->direction * (1-((x_top - x) + (x_bottom-x))/2) * height; + scanline_fill[x] += e->direction * height; // everything right of this pixel is filled + } else { + int x,x1,x2; + float y_crossing, step, sign, area; + // covers 2+ pixels + if (x_top > x_bottom) { + // flip scanline vertically; signed area is the same + float t; + sy0 = y_bottom - (sy0 - y_top); + sy1 = y_bottom - (sy1 - y_top); + t = sy0, sy0 = sy1, sy1 = t; + t = x_bottom, x_bottom = x_top, x_top = t; + dx = -dx; + dy = -dy; + t = x0, x0 = xb, xb = t; + } + + x1 = (int) x_top; + x2 = (int) x_bottom; + // compute intersection with y axis at x1+1 + y_crossing = (x1+1 - x0) * dy + y_top; + + sign = e->direction; + // area of the rectangle covered from y0..y_crossing + area = sign * (y_crossing-sy0); + // area of the triangle (x_top,y0), (x+1,y0), (x+1,y_crossing) + scanline[x1] += area * (1-((x_top - x1)+(x1+1-x1))/2); + + step = sign * dy; + for (x = x1+1; x < x2; ++x) { + scanline[x] += area + step/2; + area += step; + } + y_crossing += dy * (x2 - (x1+1)); + + STBTT_assert(STBTT_fabs(area) <= 1.01f); + + scanline[x2] += area + sign * (1-((x2-x2)+(x_bottom-x2))/2) * (sy1-y_crossing); + + scanline_fill[x2] += sign * (sy1-sy0); + } + } else { + // if edge goes outside of box we're drawing, we require + // clipping logic. since this does not match the intended use + // of this library, we use a different, very slow brute + // force implementation + int x; + for (x=0; x < len; ++x) { + // cases: + // + // there can be up to two intersections with the pixel. any intersection + // with left or right edges can be handled by splitting into two (or three) + // regions. intersections with top & bottom do not necessitate case-wise logic. + // + // the old way of doing this found the intersections with the left & right edges, + // then used some simple logic to produce up to three segments in sorted order + // from top-to-bottom. however, this had a problem: if an x edge was epsilon + // across the x border, then the corresponding y position might not be distinct + // from the other y segment, and it might ignored as an empty segment. to avoid + // that, we need to explicitly produce segments based on x positions. + + // rename variables to clearly-defined pairs + float y0 = y_top; + float x1 = (float) (x); + float x2 = (float) (x+1); + float x3 = xb; + float y3 = y_bottom; + + // x = e->x + e->dx * (y-y_top) + // (y-y_top) = (x - e->x) / e->dx + // y = (x - e->x) / e->dx + y_top + float y1 = (x - x0) / dx + y_top; + float y2 = (x+1 - x0) / dx + y_top; + + if (x0 < x1 && x3 > x2) { // three segments descending down-right + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); + stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x2,y2); + stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); + } else if (x3 < x1 && x0 > x2) { // three segments descending down-left + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); + stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x1,y1); + stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); + } else if (x0 < x1 && x3 > x1) { // two segments across x, down-right + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); + stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); + } else if (x3 < x1 && x0 > x1) { // two segments across x, down-left + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); + stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); + } else if (x0 < x2 && x3 > x2) { // two segments across x+1, down-right + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); + stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); + } else if (x3 < x2 && x0 > x2) { // two segments across x+1, down-left + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); + stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); + } else { // one segment + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x3,y3); + } + } + } + } + e = e->next; + } +} + +// directly AA rasterize edges w/o supersampling +static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) +{ + stbtt__hheap hh = { 0, 0, 0 }; + stbtt__active_edge *active = NULL; + int y,j=0, i; + float scanline_data[129], *scanline, *scanline2; + + STBTT__NOTUSED(vsubsample); + + if (result->w > 64) + scanline = (float *) STBTT_malloc((result->w*2+1) * sizeof(float), userdata); + else + scanline = scanline_data; + + scanline2 = scanline + result->w; + + y = off_y; + e[n].y0 = (float) (off_y + result->h) + 1; + + while (j < result->h) { + // find center of pixel for this scanline + float scan_y_top = y + 0.0f; + float scan_y_bottom = y + 1.0f; + stbtt__active_edge **step = &active; + + STBTT_memset(scanline , 0, result->w*sizeof(scanline[0])); + STBTT_memset(scanline2, 0, (result->w+1)*sizeof(scanline[0])); + + // update all active edges; + // remove all active edges that terminate before the top of this scanline + while (*step) { + stbtt__active_edge * z = *step; + if (z->ey <= scan_y_top) { + *step = z->next; // delete from list + STBTT_assert(z->direction); + z->direction = 0; + stbtt__hheap_free(&hh, z); + } else { + step = &((*step)->next); // advance through list + } + } + + // insert all edges that start before the bottom of this scanline + while (e->y0 <= scan_y_bottom) { + if (e->y0 != e->y1) { + stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y_top, userdata); + if (z != NULL) { + if (j == 0 && off_y != 0) { + if (z->ey < scan_y_top) { + // this can happen due to subpixel positioning and some kind of fp rounding error i think + z->ey = scan_y_top; + } + } + STBTT_assert(z->ey >= scan_y_top); // if we get really unlucky a tiny bit of an edge can be out of bounds + // insert at front + z->next = active; + active = z; + } + } + ++e; + } + + // now process all active edges + if (active) + stbtt__fill_active_edges_new(scanline, scanline2+1, result->w, active, scan_y_top); + + { + float sum = 0; + for (i=0; i < result->w; ++i) { + float k; + int m; + sum += scanline2[i]; + k = scanline[i] + sum; + k = (float) STBTT_fabs(k)*255 + 0.5f; + m = (int) k; + if (m > 255) m = 255; + result->pixels[j*result->stride + i] = (unsigned char) m; + } + } + // advance all the edges + step = &active; + while (*step) { + stbtt__active_edge *z = *step; + z->fx += z->fdx; // advance to position for current scanline + step = &((*step)->next); // advance through list + } + + ++y; + ++j; + } + + stbtt__hheap_cleanup(&hh, userdata); + + if (scanline != scanline_data) + STBTT_free(scanline, userdata); +} +#else +#error "Unrecognized value of STBTT_RASTERIZER_VERSION" +#endif + +#define STBTT__COMPARE(a,b) ((a)->y0 < (b)->y0) + +static void stbtt__sort_edges_ins_sort(stbtt__edge *p, int n) +{ + int i,j; + for (i=1; i < n; ++i) { + stbtt__edge t = p[i], *a = &t; + j = i; + while (j > 0) { + stbtt__edge *b = &p[j-1]; + int c = STBTT__COMPARE(a,b); + if (!c) break; + p[j] = p[j-1]; + --j; + } + if (i != j) + p[j] = t; + } +} + +static void stbtt__sort_edges_quicksort(stbtt__edge *p, int n) +{ + /* threshold for transitioning to insertion sort */ + while (n > 12) { + stbtt__edge t; + int c01,c12,c,m,i,j; + + /* compute median of three */ + m = n >> 1; + c01 = STBTT__COMPARE(&p[0],&p[m]); + c12 = STBTT__COMPARE(&p[m],&p[n-1]); + /* if 0 >= mid >= end, or 0 < mid < end, then use mid */ + if (c01 != c12) { + /* otherwise, we'll need to swap something else to middle */ + int z; + c = STBTT__COMPARE(&p[0],&p[n-1]); + /* 0>mid && midn => n; 0 0 */ + /* 0n: 0>n => 0; 0 n */ + z = (c == c12) ? 0 : n-1; + t = p[z]; + p[z] = p[m]; + p[m] = t; + } + /* now p[m] is the median-of-three */ + /* swap it to the beginning so it won't move around */ + t = p[0]; + p[0] = p[m]; + p[m] = t; + + /* partition loop */ + i=1; + j=n-1; + for(;;) { + /* handling of equality is crucial here */ + /* for sentinels & efficiency with duplicates */ + for (;;++i) { + if (!STBTT__COMPARE(&p[i], &p[0])) break; + } + for (;;--j) { + if (!STBTT__COMPARE(&p[0], &p[j])) break; + } + /* make sure we haven't crossed */ + if (i >= j) break; + t = p[i]; + p[i] = p[j]; + p[j] = t; + + ++i; + --j; + } + /* recurse on smaller side, iterate on larger */ + if (j < (n-i)) { + stbtt__sort_edges_quicksort(p,j); + p = p+i; + n = n-i; + } else { + stbtt__sort_edges_quicksort(p+i, n-i); + n = j; + } + } +} + +static void stbtt__sort_edges(stbtt__edge *p, int n) +{ + stbtt__sort_edges_quicksort(p, n); + stbtt__sort_edges_ins_sort(p, n); +} + +typedef struct +{ + float x,y; +} stbtt__point; + +static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, int *wcount, int windings, float scale_x, float scale_y, float shift_x, float shift_y, int off_x, int off_y, int invert, void *userdata) +{ + float y_scale_inv = invert ? -scale_y : scale_y; + stbtt__edge *e; + int n,i,j,k,m; +#if STBTT_RASTERIZER_VERSION == 1 + int vsubsample = result->h < 8 ? 15 : 5; +#elif STBTT_RASTERIZER_VERSION == 2 + int vsubsample = 1; +#else + #error "Unrecognized value of STBTT_RASTERIZER_VERSION" +#endif + // vsubsample should divide 255 evenly; otherwise we won't reach full opacity + + // now we have to blow out the windings into explicit edge lists + n = 0; + for (i=0; i < windings; ++i) + n += wcount[i]; + + e = (stbtt__edge *) STBTT_malloc(sizeof(*e) * (n+1), userdata); // add an extra one as a sentinel + if (e == 0) return; + n = 0; + + m=0; + for (i=0; i < windings; ++i) { + stbtt__point *p = pts + m; + m += wcount[i]; + j = wcount[i]-1; + for (k=0; k < wcount[i]; j=k++) { + int a=k,b=j; + // skip the edge if horizontal + if (p[j].y == p[k].y) + continue; + // add edge from j to k to the list + e[n].invert = 0; + if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) { + e[n].invert = 1; + a=j,b=k; + } + e[n].x0 = p[a].x * scale_x + shift_x; + e[n].y0 = (p[a].y * y_scale_inv + shift_y) * vsubsample; + e[n].x1 = p[b].x * scale_x + shift_x; + e[n].y1 = (p[b].y * y_scale_inv + shift_y) * vsubsample; + ++n; + } + } + + // now sort the edges by their highest point (should snap to integer, and then by x) + //STBTT_sort(e, n, sizeof(e[0]), stbtt__edge_compare); + stbtt__sort_edges(e, n); + + // now, traverse the scanlines and find the intersections on each scanline, use xor winding rule + stbtt__rasterize_sorted_edges(result, e, n, vsubsample, off_x, off_y, userdata); + + STBTT_free(e, userdata); +} + +static void stbtt__add_point(stbtt__point *points, int n, float x, float y) +{ + if (!points) return; // during first pass, it's unallocated + points[n].x = x; + points[n].y = y; +} + +// tessellate until threshold p is happy... @TODO warped to compensate for non-linear stretching +static int stbtt__tesselate_curve(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float objspace_flatness_squared, int n) +{ + // midpoint + float mx = (x0 + 2*x1 + x2)/4; + float my = (y0 + 2*y1 + y2)/4; + // versus directly drawn line + float dx = (x0+x2)/2 - mx; + float dy = (y0+y2)/2 - my; + if (n > 16) // 65536 segments on one curve better be enough! + return 1; + if (dx*dx+dy*dy > objspace_flatness_squared) { // half-pixel error allowed... need to be smaller if AA + stbtt__tesselate_curve(points, num_points, x0,y0, (x0+x1)/2.0f,(y0+y1)/2.0f, mx,my, objspace_flatness_squared,n+1); + stbtt__tesselate_curve(points, num_points, mx,my, (x1+x2)/2.0f,(y1+y2)/2.0f, x2,y2, objspace_flatness_squared,n+1); + } else { + stbtt__add_point(points, *num_points,x2,y2); + *num_points = *num_points+1; + } + return 1; +} + +static void stbtt__tesselate_cubic(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, float objspace_flatness_squared, int n) +{ + // @TODO this "flatness" calculation is just made-up nonsense that seems to work well enough + float dx0 = x1-x0; + float dy0 = y1-y0; + float dx1 = x2-x1; + float dy1 = y2-y1; + float dx2 = x3-x2; + float dy2 = y3-y2; + float dx = x3-x0; + float dy = y3-y0; + float longlen = (float) (STBTT_sqrt(dx0*dx0+dy0*dy0)+STBTT_sqrt(dx1*dx1+dy1*dy1)+STBTT_sqrt(dx2*dx2+dy2*dy2)); + float shortlen = (float) STBTT_sqrt(dx*dx+dy*dy); + float flatness_squared = longlen*longlen-shortlen*shortlen; + + if (n > 16) // 65536 segments on one curve better be enough! + return; + + if (flatness_squared > objspace_flatness_squared) { + float x01 = (x0+x1)/2; + float y01 = (y0+y1)/2; + float x12 = (x1+x2)/2; + float y12 = (y1+y2)/2; + float x23 = (x2+x3)/2; + float y23 = (y2+y3)/2; + + float xa = (x01+x12)/2; + float ya = (y01+y12)/2; + float xb = (x12+x23)/2; + float yb = (y12+y23)/2; + + float mx = (xa+xb)/2; + float my = (ya+yb)/2; + + stbtt__tesselate_cubic(points, num_points, x0,y0, x01,y01, xa,ya, mx,my, objspace_flatness_squared,n+1); + stbtt__tesselate_cubic(points, num_points, mx,my, xb,yb, x23,y23, x3,y3, objspace_flatness_squared,n+1); + } else { + stbtt__add_point(points, *num_points,x3,y3); + *num_points = *num_points+1; + } +} + +// returns number of contours +static stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, float objspace_flatness, int **contour_lengths, int *num_contours, void *userdata) +{ + stbtt__point *points=0; + int num_points=0; + + float objspace_flatness_squared = objspace_flatness * objspace_flatness; + int i,n=0,start=0, pass; + + // count how many "moves" there are to get the contour count + for (i=0; i < num_verts; ++i) + if (vertices[i].type == STBTT_vmove) + ++n; + + *num_contours = n; + if (n == 0) return 0; + + *contour_lengths = (int *) STBTT_malloc(sizeof(**contour_lengths) * n, userdata); + + if (*contour_lengths == 0) { + *num_contours = 0; + return 0; + } + + // make two passes through the points so we don't need to realloc + for (pass=0; pass < 2; ++pass) { + float x=0,y=0; + if (pass == 1) { + points = (stbtt__point *) STBTT_malloc(num_points * sizeof(points[0]), userdata); + if (points == NULL) goto error; + } + num_points = 0; + n= -1; + for (i=0; i < num_verts; ++i) { + switch (vertices[i].type) { + case STBTT_vmove: + // start the next contour + if (n >= 0) + (*contour_lengths)[n] = num_points - start; + ++n; + start = num_points; + + x = vertices[i].x, y = vertices[i].y; + stbtt__add_point(points, num_points++, x,y); + break; + case STBTT_vline: + x = vertices[i].x, y = vertices[i].y; + stbtt__add_point(points, num_points++, x, y); + break; + case STBTT_vcurve: + stbtt__tesselate_curve(points, &num_points, x,y, + vertices[i].cx, vertices[i].cy, + vertices[i].x, vertices[i].y, + objspace_flatness_squared, 0); + x = vertices[i].x, y = vertices[i].y; + break; + case STBTT_vcubic: + stbtt__tesselate_cubic(points, &num_points, x,y, + vertices[i].cx, vertices[i].cy, + vertices[i].cx1, vertices[i].cy1, + vertices[i].x, vertices[i].y, + objspace_flatness_squared, 0); + x = vertices[i].x, y = vertices[i].y; + break; + } + } + (*contour_lengths)[n] = num_points - start; + } + + return points; +error: + STBTT_free(points, userdata); + STBTT_free(*contour_lengths, userdata); + *contour_lengths = 0; + *num_contours = 0; + return NULL; +} + +STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, float flatness_in_pixels, stbtt_vertex *vertices, int num_verts, float scale_x, float scale_y, float shift_x, float shift_y, int x_off, int y_off, int invert, void *userdata) +{ + float scale = scale_x > scale_y ? scale_y : scale_x; + int winding_count = 0; + int *winding_lengths = NULL; + stbtt__point *windings = stbtt_FlattenCurves(vertices, num_verts, flatness_in_pixels / scale, &winding_lengths, &winding_count, userdata); + if (windings) { + stbtt__rasterize(result, windings, winding_lengths, winding_count, scale_x, scale_y, shift_x, shift_y, x_off, y_off, invert, userdata); + STBTT_free(winding_lengths, userdata); + STBTT_free(windings, userdata); + } +} + +STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata) +{ + STBTT_free(bitmap, userdata); +} + +STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff) +{ + int ix0,iy0,ix1,iy1; + stbtt__bitmap gbm; + stbtt_vertex *vertices; + int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); + + if (scale_x == 0) scale_x = scale_y; + if (scale_y == 0) { + if (scale_x == 0) { + STBTT_free(vertices, info->userdata); + return NULL; + } + scale_y = scale_x; + } + + stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,&ix1,&iy1); + + // now we get the size + gbm.w = (ix1 - ix0); + gbm.h = (iy1 - iy0); + gbm.pixels = NULL; // in case we error + + if (width ) *width = gbm.w; + if (height) *height = gbm.h; + if (xoff ) *xoff = ix0; + if (yoff ) *yoff = iy0; + + if (gbm.w && gbm.h) { + gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata); + if (gbm.pixels) { + gbm.stride = gbm.w; + + stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0, iy0, 1, info->userdata); + } + } + STBTT_free(vertices, info->userdata); + return gbm.pixels; +} + +STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff) +{ + return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y, 0.0f, 0.0f, glyph, width, height, xoff, yoff); +} + +STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph) +{ + int ix0,iy0; + stbtt_vertex *vertices; + int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); + stbtt__bitmap gbm; + + stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,0,0); + gbm.pixels = output; + gbm.w = out_w; + gbm.h = out_h; + gbm.stride = out_stride; + + if (gbm.w && gbm.h) + stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0,iy0, 1, info->userdata); + + STBTT_free(vertices, info->userdata); +} + +STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph) +{ + stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, glyph); +} + +STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff) +{ + return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y,shift_x,shift_y, stbtt_FindGlyphIndex(info,codepoint), width,height,xoff,yoff); +} + +STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int codepoint) +{ + stbtt_MakeGlyphBitmapSubpixelPrefilter(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, oversample_x, oversample_y, sub_x, sub_y, stbtt_FindGlyphIndex(info,codepoint)); +} + +STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint) +{ + stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, stbtt_FindGlyphIndex(info,codepoint)); +} + +STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff) +{ + return stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, 0.0f,0.0f, codepoint, width,height,xoff,yoff); +} + +STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint) +{ + stbtt_MakeCodepointBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, codepoint); +} + +////////////////////////////////////////////////////////////////////////////// +// +// bitmap baking +// +// This is SUPER-CRAPPY packing to keep source code small + +static int stbtt_BakeFontBitmap_internal(unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) + float pixel_height, // height of font in pixels + unsigned char *pixels, int pw, int ph, // bitmap to be filled in + int first_char, int num_chars, // characters to bake + stbtt_bakedchar *chardata) +{ + float scale; + int x,y,bottom_y, i; + stbtt_fontinfo f; + f.userdata = NULL; + if (!stbtt_InitFont(&f, data, offset)) + return -1; + STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels + x=y=1; + bottom_y = 1; + + scale = stbtt_ScaleForPixelHeight(&f, pixel_height); + + for (i=0; i < num_chars; ++i) { + int advance, lsb, x0,y0,x1,y1,gw,gh; + int g = stbtt_FindGlyphIndex(&f, first_char + i); + stbtt_GetGlyphHMetrics(&f, g, &advance, &lsb); + stbtt_GetGlyphBitmapBox(&f, g, scale,scale, &x0,&y0,&x1,&y1); + gw = x1-x0; + gh = y1-y0; + if (x + gw + 1 >= pw) + y = bottom_y, x = 1; // advance to next row + if (y + gh + 1 >= ph) // check if it fits vertically AFTER potentially moving to next row + return -i; + STBTT_assert(x+gw < pw); + STBTT_assert(y+gh < ph); + stbtt_MakeGlyphBitmap(&f, pixels+x+y*pw, gw,gh,pw, scale,scale, g); + chardata[i].x0 = (stbtt_int16) x; + chardata[i].y0 = (stbtt_int16) y; + chardata[i].x1 = (stbtt_int16) (x + gw); + chardata[i].y1 = (stbtt_int16) (y + gh); + chardata[i].xadvance = scale * advance; + chardata[i].xoff = (float) x0; + chardata[i].yoff = (float) y0; + x = x + gw + 1; + if (y+gh+1 > bottom_y) + bottom_y = y+gh+1; + } + return bottom_y; +} + +STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int opengl_fillrule) +{ + float d3d_bias = opengl_fillrule ? 0 : -0.5f; + float ipw = 1.0f / pw, iph = 1.0f / ph; + const stbtt_bakedchar *b = chardata + char_index; + int round_x = STBTT_ifloor((*xpos + b->xoff) + 0.5f); + int round_y = STBTT_ifloor((*ypos + b->yoff) + 0.5f); + + q->x0 = round_x + d3d_bias; + q->y0 = round_y + d3d_bias; + q->x1 = round_x + b->x1 - b->x0 + d3d_bias; + q->y1 = round_y + b->y1 - b->y0 + d3d_bias; + + q->s0 = b->x0 * ipw; + q->t0 = b->y0 * iph; + q->s1 = b->x1 * ipw; + q->t1 = b->y1 * iph; + + *xpos += b->xadvance; +} + +////////////////////////////////////////////////////////////////////////////// +// +// rectangle packing replacement routines if you don't have stb_rect_pack.h +// + +#ifndef STB_RECT_PACK_VERSION + +typedef int stbrp_coord; + +//////////////////////////////////////////////////////////////////////////////////// +// // +// // +// COMPILER WARNING ?!?!? // +// // +// // +// if you get a compile warning due to these symbols being defined more than // +// once, move #include "stb_rect_pack.h" before #include "stb_truetype.h" // +// // +//////////////////////////////////////////////////////////////////////////////////// + +typedef struct +{ + int width,height; + int x,y,bottom_y; +} stbrp_context; + +typedef struct +{ + unsigned char x; +} stbrp_node; + +struct stbrp_rect +{ + stbrp_coord x,y; + int id,w,h,was_packed; +}; + +static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_node *nodes, int num_nodes) +{ + con->width = pw; + con->height = ph; + con->x = 0; + con->y = 0; + con->bottom_y = 0; + STBTT__NOTUSED(nodes); + STBTT__NOTUSED(num_nodes); +} + +static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int num_rects) +{ + int i; + for (i=0; i < num_rects; ++i) { + if (con->x + rects[i].w > con->width) { + con->x = 0; + con->y = con->bottom_y; + } + if (con->y + rects[i].h > con->height) + break; + rects[i].x = con->x; + rects[i].y = con->y; + rects[i].was_packed = 1; + con->x += rects[i].w; + if (con->y + rects[i].h > con->bottom_y) + con->bottom_y = con->y + rects[i].h; + } + for ( ; i < num_rects; ++i) + rects[i].was_packed = 0; +} +#endif + +////////////////////////////////////////////////////////////////////////////// +// +// bitmap baking +// +// This is SUPER-AWESOME (tm Ryan Gordon) packing using stb_rect_pack.h. If +// stb_rect_pack.h isn't available, it uses the BakeFontBitmap strategy. + +STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int pw, int ph, int stride_in_bytes, int padding, void *alloc_context) +{ + stbrp_context *context = (stbrp_context *) STBTT_malloc(sizeof(*context) ,alloc_context); + int num_nodes = pw - padding; + stbrp_node *nodes = (stbrp_node *) STBTT_malloc(sizeof(*nodes ) * num_nodes,alloc_context); + + if (context == NULL || nodes == NULL) { + if (context != NULL) STBTT_free(context, alloc_context); + if (nodes != NULL) STBTT_free(nodes , alloc_context); + return 0; + } + + spc->user_allocator_context = alloc_context; + spc->width = pw; + spc->height = ph; + spc->pixels = pixels; + spc->pack_info = context; + spc->nodes = nodes; + spc->padding = padding; + spc->stride_in_bytes = stride_in_bytes != 0 ? stride_in_bytes : pw; + spc->h_oversample = 1; + spc->v_oversample = 1; + spc->skip_missing = 0; + + stbrp_init_target(context, pw-padding, ph-padding, nodes, num_nodes); + + if (pixels) + STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels + + return 1; +} + +STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc) +{ + STBTT_free(spc->nodes , spc->user_allocator_context); + STBTT_free(spc->pack_info, spc->user_allocator_context); +} + +STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample) +{ + STBTT_assert(h_oversample <= STBTT_MAX_OVERSAMPLE); + STBTT_assert(v_oversample <= STBTT_MAX_OVERSAMPLE); + if (h_oversample <= STBTT_MAX_OVERSAMPLE) + spc->h_oversample = h_oversample; + if (v_oversample <= STBTT_MAX_OVERSAMPLE) + spc->v_oversample = v_oversample; +} + +STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip) +{ + spc->skip_missing = skip; +} + +#define STBTT__OVER_MASK (STBTT_MAX_OVERSAMPLE-1) + +static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) +{ + unsigned char buffer[STBTT_MAX_OVERSAMPLE]; + int safe_w = w - kernel_width; + int j; + STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze + for (j=0; j < h; ++j) { + int i; + unsigned int total; + STBTT_memset(buffer, 0, kernel_width); + + total = 0; + + // make kernel_width a constant in common cases so compiler can optimize out the divide + switch (kernel_width) { + case 2: + for (i=0; i <= safe_w; ++i) { + total += pixels[i] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; + pixels[i] = (unsigned char) (total / 2); + } + break; + case 3: + for (i=0; i <= safe_w; ++i) { + total += pixels[i] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; + pixels[i] = (unsigned char) (total / 3); + } + break; + case 4: + for (i=0; i <= safe_w; ++i) { + total += pixels[i] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; + pixels[i] = (unsigned char) (total / 4); + } + break; + case 5: + for (i=0; i <= safe_w; ++i) { + total += pixels[i] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; + pixels[i] = (unsigned char) (total / 5); + } + break; + default: + for (i=0; i <= safe_w; ++i) { + total += pixels[i] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; + pixels[i] = (unsigned char) (total / kernel_width); + } + break; + } + + for (; i < w; ++i) { + STBTT_assert(pixels[i] == 0); + total -= buffer[i & STBTT__OVER_MASK]; + pixels[i] = (unsigned char) (total / kernel_width); + } + + pixels += stride_in_bytes; + } +} + +static void stbtt__v_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) +{ + unsigned char buffer[STBTT_MAX_OVERSAMPLE]; + int safe_h = h - kernel_width; + int j; + STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze + for (j=0; j < w; ++j) { + int i; + unsigned int total; + STBTT_memset(buffer, 0, kernel_width); + + total = 0; + + // make kernel_width a constant in common cases so compiler can optimize out the divide + switch (kernel_width) { + case 2: + for (i=0; i <= safe_h; ++i) { + total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; + pixels[i*stride_in_bytes] = (unsigned char) (total / 2); + } + break; + case 3: + for (i=0; i <= safe_h; ++i) { + total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; + pixels[i*stride_in_bytes] = (unsigned char) (total / 3); + } + break; + case 4: + for (i=0; i <= safe_h; ++i) { + total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; + pixels[i*stride_in_bytes] = (unsigned char) (total / 4); + } + break; + case 5: + for (i=0; i <= safe_h; ++i) { + total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; + pixels[i*stride_in_bytes] = (unsigned char) (total / 5); + } + break; + default: + for (i=0; i <= safe_h; ++i) { + total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; + pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width); + } + break; + } + + for (; i < h; ++i) { + STBTT_assert(pixels[i*stride_in_bytes] == 0); + total -= buffer[i & STBTT__OVER_MASK]; + pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width); + } + + pixels += 1; + } +} + +static float stbtt__oversample_shift(int oversample) +{ + if (!oversample) + return 0.0f; + + // The prefilter is a box filter of width "oversample", + // which shifts phase by (oversample - 1)/2 pixels in + // oversampled space. We want to shift in the opposite + // direction to counter this. + return (float)-(oversample - 1) / (2.0f * (float)oversample); +} + +// rects array must be big enough to accommodate all characters in the given ranges +STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) +{ + int i,j,k; + + k=0; + for (i=0; i < num_ranges; ++i) { + float fh = ranges[i].font_size; + float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh); + ranges[i].h_oversample = (unsigned char) spc->h_oversample; + ranges[i].v_oversample = (unsigned char) spc->v_oversample; + for (j=0; j < ranges[i].num_chars; ++j) { + int x0,y0,x1,y1; + int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; + int glyph = stbtt_FindGlyphIndex(info, codepoint); + if (glyph == 0 && spc->skip_missing) { + rects[k].w = rects[k].h = 0; + } else { + stbtt_GetGlyphBitmapBoxSubpixel(info,glyph, + scale * spc->h_oversample, + scale * spc->v_oversample, + 0,0, + &x0,&y0,&x1,&y1); + rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1); + rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1); + } + ++k; + } + } + + return k; +} + +STBTT_DEF void stbtt_MakeGlyphBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int prefilter_x, int prefilter_y, float *sub_x, float *sub_y, int glyph) +{ + stbtt_MakeGlyphBitmapSubpixel(info, + output, + out_w - (prefilter_x - 1), + out_h - (prefilter_y - 1), + out_stride, + scale_x, + scale_y, + shift_x, + shift_y, + glyph); + + if (prefilter_x > 1) + stbtt__h_prefilter(output, out_w, out_h, out_stride, prefilter_x); + + if (prefilter_y > 1) + stbtt__v_prefilter(output, out_w, out_h, out_stride, prefilter_y); + + *sub_x = stbtt__oversample_shift(prefilter_x); + *sub_y = stbtt__oversample_shift(prefilter_y); +} + +// rects array must be big enough to accommodate all characters in the given ranges +STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) +{ + int i,j,k, return_value = 1; + + // save current values + int old_h_over = spc->h_oversample; + int old_v_over = spc->v_oversample; + + k = 0; + for (i=0; i < num_ranges; ++i) { + float fh = ranges[i].font_size; + float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh); + float recip_h,recip_v,sub_x,sub_y; + spc->h_oversample = ranges[i].h_oversample; + spc->v_oversample = ranges[i].v_oversample; + recip_h = 1.0f / spc->h_oversample; + recip_v = 1.0f / spc->v_oversample; + sub_x = stbtt__oversample_shift(spc->h_oversample); + sub_y = stbtt__oversample_shift(spc->v_oversample); + for (j=0; j < ranges[i].num_chars; ++j) { + stbrp_rect *r = &rects[k]; + if (r->was_packed && r->w != 0 && r->h != 0) { + stbtt_packedchar *bc = &ranges[i].chardata_for_range[j]; + int advance, lsb, x0,y0,x1,y1; + int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; + int glyph = stbtt_FindGlyphIndex(info, codepoint); + stbrp_coord pad = (stbrp_coord) spc->padding; + + // pad on left and top + r->x += pad; + r->y += pad; + r->w -= pad; + r->h -= pad; + stbtt_GetGlyphHMetrics(info, glyph, &advance, &lsb); + stbtt_GetGlyphBitmapBox(info, glyph, + scale * spc->h_oversample, + scale * spc->v_oversample, + &x0,&y0,&x1,&y1); + stbtt_MakeGlyphBitmapSubpixel(info, + spc->pixels + r->x + r->y*spc->stride_in_bytes, + r->w - spc->h_oversample+1, + r->h - spc->v_oversample+1, + spc->stride_in_bytes, + scale * spc->h_oversample, + scale * spc->v_oversample, + 0,0, + glyph); + + if (spc->h_oversample > 1) + stbtt__h_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, + r->w, r->h, spc->stride_in_bytes, + spc->h_oversample); + + if (spc->v_oversample > 1) + stbtt__v_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, + r->w, r->h, spc->stride_in_bytes, + spc->v_oversample); + + bc->x0 = (stbtt_int16) r->x; + bc->y0 = (stbtt_int16) r->y; + bc->x1 = (stbtt_int16) (r->x + r->w); + bc->y1 = (stbtt_int16) (r->y + r->h); + bc->xadvance = scale * advance; + bc->xoff = (float) x0 * recip_h + sub_x; + bc->yoff = (float) y0 * recip_v + sub_y; + bc->xoff2 = (x0 + r->w) * recip_h + sub_x; + bc->yoff2 = (y0 + r->h) * recip_v + sub_y; + } else { + return_value = 0; // if any fail, report failure + } + + ++k; + } + } + + // restore original values + spc->h_oversample = old_h_over; + spc->v_oversample = old_v_over; + + return return_value; +} + +STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects) +{ + stbrp_pack_rects((stbrp_context *) spc->pack_info, rects, num_rects); +} + +STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges) +{ + stbtt_fontinfo info; + int i,j,n, return_value = 1; + //stbrp_context *context = (stbrp_context *) spc->pack_info; + stbrp_rect *rects; + + // flag all characters as NOT packed + for (i=0; i < num_ranges; ++i) + for (j=0; j < ranges[i].num_chars; ++j) + ranges[i].chardata_for_range[j].x0 = + ranges[i].chardata_for_range[j].y0 = + ranges[i].chardata_for_range[j].x1 = + ranges[i].chardata_for_range[j].y1 = 0; + + n = 0; + for (i=0; i < num_ranges; ++i) + n += ranges[i].num_chars; + + rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context); + if (rects == NULL) + return 0; + + info.userdata = spc->user_allocator_context; + stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata,font_index)); + + n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects); + + stbtt_PackFontRangesPackRects(spc, rects, n); + + return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects); + + STBTT_free(rects, spc->user_allocator_context); + return return_value; +} + +STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, float font_size, + int first_unicode_codepoint_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range) +{ + stbtt_pack_range range; + range.first_unicode_codepoint_in_range = first_unicode_codepoint_in_range; + range.array_of_unicode_codepoints = NULL; + range.num_chars = num_chars_in_range; + range.chardata_for_range = chardata_for_range; + range.font_size = font_size; + return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1); +} + +STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char *fontdata, int index, float size, float *ascent, float *descent, float *lineGap) +{ + int i_ascent, i_descent, i_lineGap; + float scale; + stbtt_fontinfo info; + stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata, index)); + scale = size > 0 ? stbtt_ScaleForPixelHeight(&info, size) : stbtt_ScaleForMappingEmToPixels(&info, -size); + stbtt_GetFontVMetrics(&info, &i_ascent, &i_descent, &i_lineGap); + *ascent = (float) i_ascent * scale; + *descent = (float) i_descent * scale; + *lineGap = (float) i_lineGap * scale; +} + +STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int align_to_integer) +{ + float ipw = 1.0f / pw, iph = 1.0f / ph; + const stbtt_packedchar *b = chardata + char_index; + + if (align_to_integer) { + float x = (float) STBTT_ifloor((*xpos + b->xoff) + 0.5f); + float y = (float) STBTT_ifloor((*ypos + b->yoff) + 0.5f); + q->x0 = x; + q->y0 = y; + q->x1 = x + b->xoff2 - b->xoff; + q->y1 = y + b->yoff2 - b->yoff; + } else { + q->x0 = *xpos + b->xoff; + q->y0 = *ypos + b->yoff; + q->x1 = *xpos + b->xoff2; + q->y1 = *ypos + b->yoff2; + } + + q->s0 = b->x0 * ipw; + q->t0 = b->y0 * iph; + q->s1 = b->x1 * ipw; + q->t1 = b->y1 * iph; + + *xpos += b->xadvance; +} + +////////////////////////////////////////////////////////////////////////////// +// +// sdf computation +// + +#define STBTT_min(a,b) ((a) < (b) ? (a) : (b)) +#define STBTT_max(a,b) ((a) < (b) ? (b) : (a)) + +static int stbtt__ray_intersect_bezier(float orig[2], float ray[2], float q0[2], float q1[2], float q2[2], float hits[2][2]) +{ + float q0perp = q0[1]*ray[0] - q0[0]*ray[1]; + float q1perp = q1[1]*ray[0] - q1[0]*ray[1]; + float q2perp = q2[1]*ray[0] - q2[0]*ray[1]; + float roperp = orig[1]*ray[0] - orig[0]*ray[1]; + + float a = q0perp - 2*q1perp + q2perp; + float b = q1perp - q0perp; + float c = q0perp - roperp; + + float s0 = 0., s1 = 0.; + int num_s = 0; + + if (a != 0.0) { + float discr = b*b - a*c; + if (discr > 0.0) { + float rcpna = -1 / a; + float d = (float) STBTT_sqrt(discr); + s0 = (b+d) * rcpna; + s1 = (b-d) * rcpna; + if (s0 >= 0.0 && s0 <= 1.0) + num_s = 1; + if (d > 0.0 && s1 >= 0.0 && s1 <= 1.0) { + if (num_s == 0) s0 = s1; + ++num_s; + } + } + } else { + // 2*b*s + c = 0 + // s = -c / (2*b) + s0 = c / (-2 * b); + if (s0 >= 0.0 && s0 <= 1.0) + num_s = 1; + } + + if (num_s == 0) + return 0; + else { + float rcp_len2 = 1 / (ray[0]*ray[0] + ray[1]*ray[1]); + float rayn_x = ray[0] * rcp_len2, rayn_y = ray[1] * rcp_len2; + + float q0d = q0[0]*rayn_x + q0[1]*rayn_y; + float q1d = q1[0]*rayn_x + q1[1]*rayn_y; + float q2d = q2[0]*rayn_x + q2[1]*rayn_y; + float rod = orig[0]*rayn_x + orig[1]*rayn_y; + + float q10d = q1d - q0d; + float q20d = q2d - q0d; + float q0rd = q0d - rod; + + hits[0][0] = q0rd + s0*(2.0f - 2.0f*s0)*q10d + s0*s0*q20d; + hits[0][1] = a*s0+b; + + if (num_s > 1) { + hits[1][0] = q0rd + s1*(2.0f - 2.0f*s1)*q10d + s1*s1*q20d; + hits[1][1] = a*s1+b; + return 2; + } else { + return 1; + } + } +} + +static int equal(float *a, float *b) +{ + return (a[0] == b[0] && a[1] == b[1]); +} + +static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex *verts) +{ + int i; + float orig[2], ray[2] = { 1, 0 }; + float y_frac; + int winding = 0; + + orig[0] = x; + orig[1] = y; + + // make sure y never passes through a vertex of the shape + y_frac = (float) STBTT_fmod(y, 1.0f); + if (y_frac < 0.01f) + y += 0.01f; + else if (y_frac > 0.99f) + y -= 0.01f; + orig[1] = y; + + // test a ray from (-infinity,y) to (x,y) + for (i=0; i < nverts; ++i) { + if (verts[i].type == STBTT_vline) { + int x0 = (int) verts[i-1].x, y0 = (int) verts[i-1].y; + int x1 = (int) verts[i ].x, y1 = (int) verts[i ].y; + if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) { + float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0; + if (x_inter < x) + winding += (y0 < y1) ? 1 : -1; + } + } + if (verts[i].type == STBTT_vcurve) { + int x0 = (int) verts[i-1].x , y0 = (int) verts[i-1].y ; + int x1 = (int) verts[i ].cx, y1 = (int) verts[i ].cy; + int x2 = (int) verts[i ].x , y2 = (int) verts[i ].y ; + int ax = STBTT_min(x0,STBTT_min(x1,x2)), ay = STBTT_min(y0,STBTT_min(y1,y2)); + int by = STBTT_max(y0,STBTT_max(y1,y2)); + if (y > ay && y < by && x > ax) { + float q0[2],q1[2],q2[2]; + float hits[2][2]; + q0[0] = (float)x0; + q0[1] = (float)y0; + q1[0] = (float)x1; + q1[1] = (float)y1; + q2[0] = (float)x2; + q2[1] = (float)y2; + if (equal(q0,q1) || equal(q1,q2)) { + x0 = (int)verts[i-1].x; + y0 = (int)verts[i-1].y; + x1 = (int)verts[i ].x; + y1 = (int)verts[i ].y; + if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) { + float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0; + if (x_inter < x) + winding += (y0 < y1) ? 1 : -1; + } + } else { + int num_hits = stbtt__ray_intersect_bezier(orig, ray, q0, q1, q2, hits); + if (num_hits >= 1) + if (hits[0][0] < 0) + winding += (hits[0][1] < 0 ? -1 : 1); + if (num_hits >= 2) + if (hits[1][0] < 0) + winding += (hits[1][1] < 0 ? -1 : 1); + } + } + } + } + return winding; +} + +static float stbtt__cuberoot( float x ) +{ + if (x<0) + return -(float) STBTT_pow(-x,1.0f/3.0f); + else + return (float) STBTT_pow( x,1.0f/3.0f); +} + +// x^3 + c*x^2 + b*x + a = 0 +static int stbtt__solve_cubic(float a, float b, float c, float* r) +{ + float s = -a / 3; + float p = b - a*a / 3; + float q = a * (2*a*a - 9*b) / 27 + c; + float p3 = p*p*p; + float d = q*q + 4*p3 / 27; + if (d >= 0) { + float z = (float) STBTT_sqrt(d); + float u = (-q + z) / 2; + float v = (-q - z) / 2; + u = stbtt__cuberoot(u); + v = stbtt__cuberoot(v); + r[0] = s + u + v; + return 1; + } else { + float u = (float) STBTT_sqrt(-p/3); + float v = (float) STBTT_acos(-STBTT_sqrt(-27/p3) * q / 2) / 3; // p3 must be negative, since d is negative + float m = (float) STBTT_cos(v); + float n = (float) STBTT_cos(v-3.141592/2)*1.732050808f; + r[0] = s + u * 2 * m; + r[1] = s - u * (m + n); + r[2] = s - u * (m - n); + + //STBTT_assert( STBTT_fabs(((r[0]+a)*r[0]+b)*r[0]+c) < 0.05f); // these asserts may not be safe at all scales, though they're in bezier t parameter units so maybe? + //STBTT_assert( STBTT_fabs(((r[1]+a)*r[1]+b)*r[1]+c) < 0.05f); + //STBTT_assert( STBTT_fabs(((r[2]+a)*r[2]+b)*r[2]+c) < 0.05f); + return 3; + } +} + +STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float scale, int glyph, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff) +{ + float scale_x = scale, scale_y = scale; + int ix0,iy0,ix1,iy1; + int w,h; + unsigned char *data; + + // if one scale is 0, use same scale for both + if (scale_x == 0) scale_x = scale_y; + if (scale_y == 0) { + if (scale_x == 0) return NULL; // if both scales are 0, return NULL + scale_y = scale_x; + } + + stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale, scale, 0.0f,0.0f, &ix0,&iy0,&ix1,&iy1); + + // if empty, return NULL + if (ix0 == ix1 || iy0 == iy1) + return NULL; + + ix0 -= padding; + iy0 -= padding; + ix1 += padding; + iy1 += padding; + + w = (ix1 - ix0); + h = (iy1 - iy0); + + if (width ) *width = w; + if (height) *height = h; + if (xoff ) *xoff = ix0; + if (yoff ) *yoff = iy0; + + // invert for y-downwards bitmaps + scale_y = -scale_y; + + { + int x,y,i,j; + float *precompute; + stbtt_vertex *verts; + int num_verts = stbtt_GetGlyphShape(info, glyph, &verts); + data = (unsigned char *) STBTT_malloc(w * h, info->userdata); + precompute = (float *) STBTT_malloc(num_verts * sizeof(float), info->userdata); + + for (i=0,j=num_verts-1; i < num_verts; j=i++) { + if (verts[i].type == STBTT_vline) { + float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y; + float x1 = verts[j].x*scale_x, y1 = verts[j].y*scale_y; + float dist = (float) STBTT_sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0)); + precompute[i] = (dist == 0) ? 0.0f : 1.0f / dist; + } else if (verts[i].type == STBTT_vcurve) { + float x2 = verts[j].x *scale_x, y2 = verts[j].y *scale_y; + float x1 = verts[i].cx*scale_x, y1 = verts[i].cy*scale_y; + float x0 = verts[i].x *scale_x, y0 = verts[i].y *scale_y; + float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2; + float len2 = bx*bx + by*by; + if (len2 != 0.0f) + precompute[i] = 1.0f / (bx*bx + by*by); + else + precompute[i] = 0.0f; + } else + precompute[i] = 0.0f; + } + + for (y=iy0; y < iy1; ++y) { + for (x=ix0; x < ix1; ++x) { + float val; + float min_dist = 999999.0f; + float sx = (float) x + 0.5f; + float sy = (float) y + 0.5f; + float x_gspace = (sx / scale_x); + float y_gspace = (sy / scale_y); + + int winding = stbtt__compute_crossings_x(x_gspace, y_gspace, num_verts, verts); // @OPTIMIZE: this could just be a rasterization, but needs to be line vs. non-tesselated curves so a new path + + for (i=0; i < num_verts; ++i) { + float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y; + + // check against every point here rather than inside line/curve primitives -- @TODO: wrong if multiple 'moves' in a row produce a garbage point, and given culling, probably more efficient to do within line/curve + float dist2 = (x0-sx)*(x0-sx) + (y0-sy)*(y0-sy); + if (dist2 < min_dist*min_dist) + min_dist = (float) STBTT_sqrt(dist2); + + if (verts[i].type == STBTT_vline) { + float x1 = verts[i-1].x*scale_x, y1 = verts[i-1].y*scale_y; + + // coarse culling against bbox + //if (sx > STBTT_min(x0,x1)-min_dist && sx < STBTT_max(x0,x1)+min_dist && + // sy > STBTT_min(y0,y1)-min_dist && sy < STBTT_max(y0,y1)+min_dist) + float dist = (float) STBTT_fabs((x1-x0)*(y0-sy) - (y1-y0)*(x0-sx)) * precompute[i]; + STBTT_assert(i != 0); + if (dist < min_dist) { + // check position along line + // x' = x0 + t*(x1-x0), y' = y0 + t*(y1-y0) + // minimize (x'-sx)*(x'-sx)+(y'-sy)*(y'-sy) + float dx = x1-x0, dy = y1-y0; + float px = x0-sx, py = y0-sy; + // minimize (px+t*dx)^2 + (py+t*dy)^2 = px*px + 2*px*dx*t + t^2*dx*dx + py*py + 2*py*dy*t + t^2*dy*dy + // derivative: 2*px*dx + 2*py*dy + (2*dx*dx+2*dy*dy)*t, set to 0 and solve + float t = -(px*dx + py*dy) / (dx*dx + dy*dy); + if (t >= 0.0f && t <= 1.0f) + min_dist = dist; + } + } else if (verts[i].type == STBTT_vcurve) { + float x2 = verts[i-1].x *scale_x, y2 = verts[i-1].y *scale_y; + float x1 = verts[i ].cx*scale_x, y1 = verts[i ].cy*scale_y; + float box_x0 = STBTT_min(STBTT_min(x0,x1),x2); + float box_y0 = STBTT_min(STBTT_min(y0,y1),y2); + float box_x1 = STBTT_max(STBTT_max(x0,x1),x2); + float box_y1 = STBTT_max(STBTT_max(y0,y1),y2); + // coarse culling against bbox to avoid computing cubic unnecessarily + if (sx > box_x0-min_dist && sx < box_x1+min_dist && sy > box_y0-min_dist && sy < box_y1+min_dist) { + int num=0; + float ax = x1-x0, ay = y1-y0; + float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2; + float mx = x0 - sx, my = y0 - sy; + float res[3],px,py,t,it; + float a_inv = precompute[i]; + if (a_inv == 0.0) { // if a_inv is 0, it's 2nd degree so use quadratic formula + float a = 3*(ax*bx + ay*by); + float b = 2*(ax*ax + ay*ay) + (mx*bx+my*by); + float c = mx*ax+my*ay; + if (a == 0.0) { // if a is 0, it's linear + if (b != 0.0) { + res[num++] = -c/b; + } + } else { + float discriminant = b*b - 4*a*c; + if (discriminant < 0) + num = 0; + else { + float root = (float) STBTT_sqrt(discriminant); + res[0] = (-b - root)/(2*a); + res[1] = (-b + root)/(2*a); + num = 2; // don't bother distinguishing 1-solution case, as code below will still work + } + } + } else { + float b = 3*(ax*bx + ay*by) * a_inv; // could precompute this as it doesn't depend on sample point + float c = (2*(ax*ax + ay*ay) + (mx*bx+my*by)) * a_inv; + float d = (mx*ax+my*ay) * a_inv; + num = stbtt__solve_cubic(b, c, d, res); + } + if (num >= 1 && res[0] >= 0.0f && res[0] <= 1.0f) { + t = res[0], it = 1.0f - t; + px = it*it*x0 + 2*t*it*x1 + t*t*x2; + py = it*it*y0 + 2*t*it*y1 + t*t*y2; + dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy); + if (dist2 < min_dist * min_dist) + min_dist = (float) STBTT_sqrt(dist2); + } + if (num >= 2 && res[1] >= 0.0f && res[1] <= 1.0f) { + t = res[1], it = 1.0f - t; + px = it*it*x0 + 2*t*it*x1 + t*t*x2; + py = it*it*y0 + 2*t*it*y1 + t*t*y2; + dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy); + if (dist2 < min_dist * min_dist) + min_dist = (float) STBTT_sqrt(dist2); + } + if (num >= 3 && res[2] >= 0.0f && res[2] <= 1.0f) { + t = res[2], it = 1.0f - t; + px = it*it*x0 + 2*t*it*x1 + t*t*x2; + py = it*it*y0 + 2*t*it*y1 + t*t*y2; + dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy); + if (dist2 < min_dist * min_dist) + min_dist = (float) STBTT_sqrt(dist2); + } + } + } + } + if (winding == 0) + min_dist = -min_dist; // if outside the shape, value is negative + val = onedge_value + pixel_dist_scale * min_dist; + if (val < 0) + val = 0; + else if (val > 255) + val = 255; + data[(y-iy0)*w+(x-ix0)] = (unsigned char) val; + } + } + STBTT_free(precompute, info->userdata); + STBTT_free(verts, info->userdata); + } + return data; +} + +STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff) +{ + return stbtt_GetGlyphSDF(info, scale, stbtt_FindGlyphIndex(info, codepoint), padding, onedge_value, pixel_dist_scale, width, height, xoff, yoff); +} + +STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata) +{ + STBTT_free(bitmap, userdata); +} + +////////////////////////////////////////////////////////////////////////////// +// +// font name matching -- recommended not to use this +// + +// check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string +static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2) +{ + stbtt_int32 i=0; + + // convert utf16 to utf8 and compare the results while converting + while (len2) { + stbtt_uint16 ch = s2[0]*256 + s2[1]; + if (ch < 0x80) { + if (i >= len1) return -1; + if (s1[i++] != ch) return -1; + } else if (ch < 0x800) { + if (i+1 >= len1) return -1; + if (s1[i++] != 0xc0 + (ch >> 6)) return -1; + if (s1[i++] != 0x80 + (ch & 0x3f)) return -1; + } else if (ch >= 0xd800 && ch < 0xdc00) { + stbtt_uint32 c; + stbtt_uint16 ch2 = s2[2]*256 + s2[3]; + if (i+3 >= len1) return -1; + c = ((ch - 0xd800) << 10) + (ch2 - 0xdc00) + 0x10000; + if (s1[i++] != 0xf0 + (c >> 18)) return -1; + if (s1[i++] != 0x80 + ((c >> 12) & 0x3f)) return -1; + if (s1[i++] != 0x80 + ((c >> 6) & 0x3f)) return -1; + if (s1[i++] != 0x80 + ((c ) & 0x3f)) return -1; + s2 += 2; // plus another 2 below + len2 -= 2; + } else if (ch >= 0xdc00 && ch < 0xe000) { + return -1; + } else { + if (i+2 >= len1) return -1; + if (s1[i++] != 0xe0 + (ch >> 12)) return -1; + if (s1[i++] != 0x80 + ((ch >> 6) & 0x3f)) return -1; + if (s1[i++] != 0x80 + ((ch ) & 0x3f)) return -1; + } + s2 += 2; + len2 -= 2; + } + return i; +} + +static int stbtt_CompareUTF8toUTF16_bigendian_internal(char *s1, int len1, char *s2, int len2) +{ + return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((stbtt_uint8*) s1, len1, (stbtt_uint8*) s2, len2); +} + +// returns results in whatever encoding you request... but note that 2-byte encodings +// will be BIG-ENDIAN... use stbtt_CompareUTF8toUTF16_bigendian() to compare +STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID) +{ + stbtt_int32 i,count,stringOffset; + stbtt_uint8 *fc = font->data; + stbtt_uint32 offset = font->fontstart; + stbtt_uint32 nm = stbtt__find_table(fc, offset, "name"); + if (!nm) return NULL; + + count = ttUSHORT(fc+nm+2); + stringOffset = nm + ttUSHORT(fc+nm+4); + for (i=0; i < count; ++i) { + stbtt_uint32 loc = nm + 6 + 12 * i; + if (platformID == ttUSHORT(fc+loc+0) && encodingID == ttUSHORT(fc+loc+2) + && languageID == ttUSHORT(fc+loc+4) && nameID == ttUSHORT(fc+loc+6)) { + *length = ttUSHORT(fc+loc+8); + return (const char *) (fc+stringOffset+ttUSHORT(fc+loc+10)); + } + } + return NULL; +} + +static int stbtt__matchpair(stbtt_uint8 *fc, stbtt_uint32 nm, stbtt_uint8 *name, stbtt_int32 nlen, stbtt_int32 target_id, stbtt_int32 next_id) +{ + stbtt_int32 i; + stbtt_int32 count = ttUSHORT(fc+nm+2); + stbtt_int32 stringOffset = nm + ttUSHORT(fc+nm+4); + + for (i=0; i < count; ++i) { + stbtt_uint32 loc = nm + 6 + 12 * i; + stbtt_int32 id = ttUSHORT(fc+loc+6); + if (id == target_id) { + // find the encoding + stbtt_int32 platform = ttUSHORT(fc+loc+0), encoding = ttUSHORT(fc+loc+2), language = ttUSHORT(fc+loc+4); + + // is this a Unicode encoding? + if (platform == 0 || (platform == 3 && encoding == 1) || (platform == 3 && encoding == 10)) { + stbtt_int32 slen = ttUSHORT(fc+loc+8); + stbtt_int32 off = ttUSHORT(fc+loc+10); + + // check if there's a prefix match + stbtt_int32 matchlen = stbtt__CompareUTF8toUTF16_bigendian_prefix(name, nlen, fc+stringOffset+off,slen); + if (matchlen >= 0) { + // check for target_id+1 immediately following, with same encoding & language + if (i+1 < count && ttUSHORT(fc+loc+12+6) == next_id && ttUSHORT(fc+loc+12) == platform && ttUSHORT(fc+loc+12+2) == encoding && ttUSHORT(fc+loc+12+4) == language) { + slen = ttUSHORT(fc+loc+12+8); + off = ttUSHORT(fc+loc+12+10); + if (slen == 0) { + if (matchlen == nlen) + return 1; + } else if (matchlen < nlen && name[matchlen] == ' ') { + ++matchlen; + if (stbtt_CompareUTF8toUTF16_bigendian_internal((char*) (name+matchlen), nlen-matchlen, (char*)(fc+stringOffset+off),slen)) + return 1; + } + } else { + // if nothing immediately following + if (matchlen == nlen) + return 1; + } + } + } + + // @TODO handle other encodings + } + } + return 0; +} + +static int stbtt__matches(stbtt_uint8 *fc, stbtt_uint32 offset, stbtt_uint8 *name, stbtt_int32 flags) +{ + stbtt_int32 nlen = (stbtt_int32) STBTT_strlen((char *) name); + stbtt_uint32 nm,hd; + if (!stbtt__isfont(fc+offset)) return 0; + + // check italics/bold/underline flags in macStyle... + if (flags) { + hd = stbtt__find_table(fc, offset, "head"); + if ((ttUSHORT(fc+hd+44) & 7) != (flags & 7)) return 0; + } + + nm = stbtt__find_table(fc, offset, "name"); + if (!nm) return 0; + + if (flags) { + // if we checked the macStyle flags, then just check the family and ignore the subfamily + if (stbtt__matchpair(fc, nm, name, nlen, 16, -1)) return 1; + if (stbtt__matchpair(fc, nm, name, nlen, 1, -1)) return 1; + if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; + } else { + if (stbtt__matchpair(fc, nm, name, nlen, 16, 17)) return 1; + if (stbtt__matchpair(fc, nm, name, nlen, 1, 2)) return 1; + if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; + } + + return 0; +} + +static int stbtt_FindMatchingFont_internal(unsigned char *font_collection, char *name_utf8, stbtt_int32 flags) +{ + stbtt_int32 i; + for (i=0;;++i) { + stbtt_int32 off = stbtt_GetFontOffsetForIndex(font_collection, i); + if (off < 0) return off; + if (stbtt__matches((stbtt_uint8 *) font_collection, off, (stbtt_uint8*) name_utf8, flags)) + return off; + } +} + +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" +#endif + +STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, + float pixel_height, unsigned char *pixels, int pw, int ph, + int first_char, int num_chars, stbtt_bakedchar *chardata) +{ + return stbtt_BakeFontBitmap_internal((unsigned char *) data, offset, pixel_height, pixels, pw, ph, first_char, num_chars, chardata); +} + +STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index) +{ + return stbtt_GetFontOffsetForIndex_internal((unsigned char *) data, index); +} + +STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data) +{ + return stbtt_GetNumberOfFonts_internal((unsigned char *) data); +} + +STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset) +{ + return stbtt_InitFont_internal(info, (unsigned char *) data, offset); +} + +STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *name, int flags) +{ + return stbtt_FindMatchingFont_internal((unsigned char *) fontdata, (char *) name, flags); +} + +STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2) +{ + return stbtt_CompareUTF8toUTF16_bigendian_internal((char *) s1, len1, (char *) s2, len2); +} + +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + +#endif // STB_TRUETYPE_IMPLEMENTATION + + +// FULL VERSION HISTORY +// +// 1.19 (2018-02-11) OpenType GPOS kerning (horizontal only), STBTT_fmod +// 1.18 (2018-01-29) add missing function +// 1.17 (2017-07-23) make more arguments const; doc fix +// 1.16 (2017-07-12) SDF support +// 1.15 (2017-03-03) make more arguments const +// 1.14 (2017-01-16) num-fonts-in-TTC function +// 1.13 (2017-01-02) support OpenType fonts, certain Apple fonts +// 1.12 (2016-10-25) suppress warnings about casting away const with -Wcast-qual +// 1.11 (2016-04-02) fix unused-variable warning +// 1.10 (2016-04-02) allow user-defined fabs() replacement +// fix memory leak if fontsize=0.0 +// fix warning from duplicate typedef +// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use alloc userdata for PackFontRanges +// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges +// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; +// allow PackFontRanges to pack and render in separate phases; +// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?); +// fixed an assert() bug in the new rasterizer +// replace assert() with STBTT_assert() in new rasterizer +// 1.06 (2015-07-14) performance improvements (~35% faster on x86 and x64 on test machine) +// also more precise AA rasterizer, except if shapes overlap +// remove need for STBTT_sort +// 1.05 (2015-04-15) fix misplaced definitions for STBTT_STATIC +// 1.04 (2015-04-15) typo in example +// 1.03 (2015-04-12) STBTT_STATIC, fix memory leak in new packing, various fixes +// 1.02 (2014-12-10) fix various warnings & compile issues w/ stb_rect_pack, C++ +// 1.01 (2014-12-08) fix subpixel position when oversampling to exactly match +// non-oversampled; STBTT_POINT_SIZE for packed case only +// 1.00 (2014-12-06) add new PackBegin etc. API, w/ support for oversampling +// 0.99 (2014-09-18) fix multiple bugs with subpixel rendering (ryg) +// 0.9 (2014-08-07) support certain mac/iOS fonts without an MS platformID +// 0.8b (2014-07-07) fix a warning +// 0.8 (2014-05-25) fix a few more warnings +// 0.7 (2013-09-25) bugfix: subpixel glyph bug fixed in 0.5 had come back +// 0.6c (2012-07-24) improve documentation +// 0.6b (2012-07-20) fix a few more warnings +// 0.6 (2012-07-17) fix warnings; added stbtt_ScaleForMappingEmToPixels, +// stbtt_GetFontBoundingBox, stbtt_IsGlyphEmpty +// 0.5 (2011-12-09) bugfixes: +// subpixel glyph renderer computed wrong bounding box +// first vertex of shape can be off-curve (FreeSans) +// 0.4b (2011-12-03) fixed an error in the font baking example +// 0.4 (2011-12-01) kerning, subpixel rendering (tor) +// bugfixes for: +// codepoint-to-glyph conversion using table fmt=12 +// codepoint-to-glyph conversion using table fmt=4 +// stbtt_GetBakedQuad with non-square texture (Zer) +// updated Hello World! sample to use kerning and subpixel +// fixed some warnings +// 0.3 (2009-06-24) cmap fmt=12, compound shapes (MM) +// userdata, malloc-from-userdata, non-zero fill (stb) +// 0.2 (2009-03-11) Fix unsigned/signed char warnings +// 0.1 (2009-03-09) First public release +// + +/* +------------------------------------------------------------------------------ +This software is available under 2 licenses -- choose whichever you prefer. +------------------------------------------------------------------------------ +ALTERNATIVE A - MIT License +Copyright (c) 2017 Sean Barrett +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +------------------------------------------------------------------------------ +ALTERNATIVE B - Public Domain (www.unlicense.org) +This is free and unencumbered software released into the public domain. +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this +software, either in source code form or as a compiled binary, for any purpose, +commercial or non-commercial, and by any means. +In jurisdictions that recognize copyright laws, the author or authors of this +software dedicate any and all copyright interest in the software to the public +domain. We make this dedication for the benefit of the public at large and to +the detriment of our heirs and successors. We intend this dedication to be an +overt act of relinquishment in perpetuity of all present and future rights to +this software under copyright law. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------------------------------------------------------------------------------ +*/ diff --git a/tcod_sys/libtcod/src/vendor/utf8proc/utf8proc.c b/tcod_sys/libtcod/src/vendor/utf8proc/utf8proc.c new file mode 100644 index 000000000..4c25bac32 --- /dev/null +++ b/tcod_sys/libtcod/src/vendor/utf8proc/utf8proc.c @@ -0,0 +1,754 @@ +/* -*- mode: c; c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil -*- */ +/* + * Copyright (c) 2015 Steven G. Johnson, Jiahao Chen, Peter Colberg, Tony Kelman, Scott P. Jones, and other contributors. + * Copyright (c) 2009 Public Software Group e. V., Berlin, Germany + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/* + * This library contains derived data from a modified version of the + * Unicode data files. + * + * The original data files are available at + * http://www.unicode.org/Public/UNIDATA/ + * + * Please notice the copyright statement in the file "utf8proc_data.c". + */ + + +/* + * File name: utf8proc.c + * + * Description: + * Implementation of libutf8proc. + */ + + +#include "utf8proc.h" +#include "utf8proc_data.c" + + +UTF8PROC_DLLEXPORT const utf8proc_int8_t utf8proc_utf8class[256] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0 }; + +#define UTF8PROC_HANGUL_SBASE 0xAC00 +#define UTF8PROC_HANGUL_LBASE 0x1100 +#define UTF8PROC_HANGUL_VBASE 0x1161 +#define UTF8PROC_HANGUL_TBASE 0x11A7 +#define UTF8PROC_HANGUL_LCOUNT 19 +#define UTF8PROC_HANGUL_VCOUNT 21 +#define UTF8PROC_HANGUL_TCOUNT 28 +#define UTF8PROC_HANGUL_NCOUNT 588 +#define UTF8PROC_HANGUL_SCOUNT 11172 +/* END is exclusive */ +#define UTF8PROC_HANGUL_L_START 0x1100 +#define UTF8PROC_HANGUL_L_END 0x115A +#define UTF8PROC_HANGUL_L_FILLER 0x115F +#define UTF8PROC_HANGUL_V_START 0x1160 +#define UTF8PROC_HANGUL_V_END 0x11A3 +#define UTF8PROC_HANGUL_T_START 0x11A8 +#define UTF8PROC_HANGUL_T_END 0x11FA +#define UTF8PROC_HANGUL_S_START 0xAC00 +#define UTF8PROC_HANGUL_S_END 0xD7A4 + +/* Should follow semantic-versioning rules (semver.org) based on API + compatibility. (Note that the shared-library version number will + be different, being based on ABI compatibility.): */ +#define STRINGIZEx(x) #x +#define STRINGIZE(x) STRINGIZEx(x) +UTF8PROC_DLLEXPORT const char *utf8proc_version(void) { + return STRINGIZE(UTF8PROC_VERSION_MAJOR) "." STRINGIZE(UTF8PROC_VERSION_MINOR) "." STRINGIZE(UTF8PROC_VERSION_PATCH) ""; +} + +UTF8PROC_DLLEXPORT const char *utf8proc_errmsg(utf8proc_ssize_t errcode) { + switch (errcode) { + case UTF8PROC_ERROR_NOMEM: + return "Memory for processing UTF-8 data could not be allocated."; + case UTF8PROC_ERROR_OVERFLOW: + return "UTF-8 string is too long to be processed."; + case UTF8PROC_ERROR_INVALIDUTF8: + return "Invalid UTF-8 string"; + case UTF8PROC_ERROR_NOTASSIGNED: + return "Unassigned Unicode code point found in UTF-8 string."; + case UTF8PROC_ERROR_INVALIDOPTS: + return "Invalid options for UTF-8 processing chosen."; + default: + return "An unknown error occurred while processing UTF-8 data."; + } +} + +#define utf_cont(ch) (((ch) & 0xc0) == 0x80) +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_iterate( + const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_int32_t *dst +) { + utf8proc_uint32_t uc; + const utf8proc_uint8_t *end; + + *dst = -1; + if (!strlen) return 0; + end = str + ((strlen < 0) ? 4 : strlen); + uc = *str++; + if (uc < 0x80) { + *dst = uc; + return 1; + } + /* Must be between 0xc2 and 0xf4 inclusive to be valid */ + if ((uc - 0xc2) > (0xf4-0xc2)) return UTF8PROC_ERROR_INVALIDUTF8; + if (uc < 0xe0) { /* 2-byte sequence */ + /* Must have valid continuation character */ + if (str >= end || !utf_cont(*str)) return UTF8PROC_ERROR_INVALIDUTF8; + *dst = ((uc & 0x1f)<<6) | (*str & 0x3f); + return 2; + } + if (uc < 0xf0) { /* 3-byte sequence */ + if ((str + 1 >= end) || !utf_cont(*str) || !utf_cont(str[1])) + return UTF8PROC_ERROR_INVALIDUTF8; + /* Check for surrogate chars */ + if (uc == 0xed && *str > 0x9f) + return UTF8PROC_ERROR_INVALIDUTF8; + uc = ((uc & 0xf)<<12) | ((*str & 0x3f)<<6) | (str[1] & 0x3f); + if (uc < 0x800) + return UTF8PROC_ERROR_INVALIDUTF8; + *dst = uc; + return 3; + } + /* 4-byte sequence */ + /* Must have 3 valid continuation characters */ + if ((str + 2 >= end) || !utf_cont(*str) || !utf_cont(str[1]) || !utf_cont(str[2])) + return UTF8PROC_ERROR_INVALIDUTF8; + /* Make sure in correct range (0x10000 - 0x10ffff) */ + if (uc == 0xf0) { + if (*str < 0x90) return UTF8PROC_ERROR_INVALIDUTF8; + } else if (uc == 0xf4) { + if (*str > 0x8f) return UTF8PROC_ERROR_INVALIDUTF8; + } + *dst = ((uc & 7)<<18) | ((*str & 0x3f)<<12) | ((str[1] & 0x3f)<<6) | (str[2] & 0x3f); + return 4; +} + +UTF8PROC_DLLEXPORT utf8proc_bool utf8proc_codepoint_valid(utf8proc_int32_t uc) { + return (((utf8proc_uint32_t)uc)-0xd800 > 0x07ff) && ((utf8proc_uint32_t)uc < 0x110000); +} + +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_encode_char(utf8proc_int32_t uc, utf8proc_uint8_t *dst) { + if (uc < 0x00) { + return 0; + } else if (uc < 0x80) { + dst[0] = (utf8proc_uint8_t) uc; + return 1; + } else if (uc < 0x800) { + dst[0] = (utf8proc_uint8_t)(0xC0 + (uc >> 6)); + dst[1] = (utf8proc_uint8_t)(0x80 + (uc & 0x3F)); + return 2; + /* Note: we allow encoding 0xd800-0xdfff here, so as not to change */ + /* the API, however, these are actually invalid in UTF-8 */ + } else if (uc < 0x10000) { + dst[0] = (utf8proc_uint8_t)(0xE0 + (uc >> 12)); + dst[1] = (utf8proc_uint8_t)(0x80 + ((uc >> 6) & 0x3F)); + dst[2] = (utf8proc_uint8_t)(0x80 + (uc & 0x3F)); + return 3; + } else if (uc < 0x110000) { + dst[0] = (utf8proc_uint8_t)(0xF0 + (uc >> 18)); + dst[1] = (utf8proc_uint8_t)(0x80 + ((uc >> 12) & 0x3F)); + dst[2] = (utf8proc_uint8_t)(0x80 + ((uc >> 6) & 0x3F)); + dst[3] = (utf8proc_uint8_t)(0x80 + (uc & 0x3F)); + return 4; + } else return 0; +} + +/* internal "unsafe" version that does not check whether uc is in range */ +static utf8proc_ssize_t unsafe_encode_char(utf8proc_int32_t uc, utf8proc_uint8_t *dst) { + if (uc < 0x00) { + return 0; + } else if (uc < 0x80) { + dst[0] = (utf8proc_uint8_t)uc; + return 1; + } else if (uc < 0x800) { + dst[0] = (utf8proc_uint8_t)(0xC0 + (uc >> 6)); + dst[1] = (utf8proc_uint8_t)(0x80 + (uc & 0x3F)); + return 2; + } else if (uc == 0xFFFF) { + dst[0] = (utf8proc_uint8_t)0xFF; + return 1; + } else if (uc == 0xFFFE) { + dst[0] = (utf8proc_uint8_t)0xFE; + return 1; + } else if (uc < 0x10000) { + dst[0] = (utf8proc_uint8_t)(0xE0 + (uc >> 12)); + dst[1] = (utf8proc_uint8_t)(0x80 + ((uc >> 6) & 0x3F)); + dst[2] = (utf8proc_uint8_t)(0x80 + (uc & 0x3F)); + return 3; + } else if (uc < 0x110000) { + dst[0] = (utf8proc_uint8_t)(0xF0 + (uc >> 18)); + dst[1] = (utf8proc_uint8_t)(0x80 + ((uc >> 12) & 0x3F)); + dst[2] = (utf8proc_uint8_t)(0x80 + ((uc >> 6) & 0x3F)); + dst[3] = (utf8proc_uint8_t)(0x80 + (uc & 0x3F)); + return 4; + } else return 0; +} + +/* internal "unsafe" version that does not check whether uc is in range */ +static const utf8proc_property_t *unsafe_get_property(utf8proc_int32_t uc) { + /* ASSERT: uc >= 0 && uc < 0x110000 */ + return utf8proc_properties + ( + utf8proc_stage2table[ + utf8proc_stage1table[uc >> 8] + (uc & 0xFF) + ] + ); +} + +UTF8PROC_DLLEXPORT const utf8proc_property_t *utf8proc_get_property(utf8proc_int32_t uc) { + return uc < 0 || uc >= 0x110000 ? utf8proc_properties : unsafe_get_property(uc); +} + +/* return whether there is a grapheme break between boundclasses lbc and tbc + (according to the definition of extended grapheme clusters) + + Rule numbering refers to TR29 Version 29 (Unicode 9.0.0): + http://www.unicode.org/reports/tr29/tr29-29.html + + CAVEATS: + Please note that evaluation of GB10 (grapheme breaks between emoji zwj sequences) + and GB 12/13 (regional indicator code points) require knowledge of previous characters + and are thus not handled by this function. This may result in an incorrect break before + an E_Modifier class codepoint and an incorrectly missing break between two + REGIONAL_INDICATOR class code points if such support does not exist in the caller. + + See the special support in grapheme_break_extended, for required bookkeeping by the caller. +*/ +static utf8proc_bool grapheme_break_simple(int lbc, int tbc) { + return + (lbc == UTF8PROC_BOUNDCLASS_START) ? true : /* GB1 */ + (lbc == UTF8PROC_BOUNDCLASS_CR && /* GB3 */ + tbc == UTF8PROC_BOUNDCLASS_LF) ? false : /* --- */ + (lbc >= UTF8PROC_BOUNDCLASS_CR && lbc <= UTF8PROC_BOUNDCLASS_CONTROL) ? true : /* GB4 */ + (tbc >= UTF8PROC_BOUNDCLASS_CR && tbc <= UTF8PROC_BOUNDCLASS_CONTROL) ? true : /* GB5 */ + (lbc == UTF8PROC_BOUNDCLASS_L && /* GB6 */ + (tbc == UTF8PROC_BOUNDCLASS_L || /* --- */ + tbc == UTF8PROC_BOUNDCLASS_V || /* --- */ + tbc == UTF8PROC_BOUNDCLASS_LV || /* --- */ + tbc == UTF8PROC_BOUNDCLASS_LVT)) ? false : /* --- */ + ((lbc == UTF8PROC_BOUNDCLASS_LV || /* GB7 */ + lbc == UTF8PROC_BOUNDCLASS_V) && /* --- */ + (tbc == UTF8PROC_BOUNDCLASS_V || /* --- */ + tbc == UTF8PROC_BOUNDCLASS_T)) ? false : /* --- */ + ((lbc == UTF8PROC_BOUNDCLASS_LVT || /* GB8 */ + lbc == UTF8PROC_BOUNDCLASS_T) && /* --- */ + tbc == UTF8PROC_BOUNDCLASS_T) ? false : /* --- */ + (tbc == UTF8PROC_BOUNDCLASS_EXTEND || /* GB9 */ + tbc == UTF8PROC_BOUNDCLASS_ZWJ || /* --- */ + tbc == UTF8PROC_BOUNDCLASS_SPACINGMARK || /* GB9a */ + lbc == UTF8PROC_BOUNDCLASS_PREPEND) ? false : /* GB9b */ + ((lbc == UTF8PROC_BOUNDCLASS_E_BASE || /* GB10 (requires additional handling below) */ + lbc == UTF8PROC_BOUNDCLASS_E_BASE_GAZ) && /* ---- */ + tbc == UTF8PROC_BOUNDCLASS_E_MODIFIER) ? false : /* ---- */ + (lbc == UTF8PROC_BOUNDCLASS_ZWJ && /* GB11 */ + (tbc == UTF8PROC_BOUNDCLASS_GLUE_AFTER_ZWJ || /* ---- */ + tbc == UTF8PROC_BOUNDCLASS_E_BASE_GAZ)) ? false : /* ---- */ + (lbc == UTF8PROC_BOUNDCLASS_REGIONAL_INDICATOR && /* GB12/13 (requires additional handling below) */ + tbc == UTF8PROC_BOUNDCLASS_REGIONAL_INDICATOR) ? false : /* ---- */ + true; /* GB999 */ +} + +static utf8proc_bool grapheme_break_extended(int lbc, int tbc, utf8proc_int32_t *state) +{ + int lbc_override = ((state && *state != UTF8PROC_BOUNDCLASS_START) + ? *state : lbc); + utf8proc_bool break_permitted = grapheme_break_simple(lbc_override, tbc); + if (state) { + /* Special support for GB 12/13 made possible by GB999. After two RI */ + /* class codepoints we want to force a break. Do this by resetting the */ + /* second RI's bound class to UTF8PROC_BOUNDCLASS_OTHER, to force a break */ + /* after that character according to GB999 (unless of course such a break is */ + /* forbidden by a different rule such as GB9). */ + if (*state == tbc && tbc == UTF8PROC_BOUNDCLASS_REGIONAL_INDICATOR) + *state = UTF8PROC_BOUNDCLASS_OTHER; + /* Special support for GB10. Fold any EXTEND codepoints into the previous */ + /* boundclass if we're dealing with an emoji base boundclass. */ + else if ((*state == UTF8PROC_BOUNDCLASS_E_BASE || + *state == UTF8PROC_BOUNDCLASS_E_BASE_GAZ) && + tbc == UTF8PROC_BOUNDCLASS_EXTEND) + *state = UTF8PROC_BOUNDCLASS_E_BASE; + else + *state = tbc; + } + return break_permitted; +} + +UTF8PROC_DLLEXPORT utf8proc_bool utf8proc_grapheme_break_stateful( + utf8proc_int32_t c1, utf8proc_int32_t c2, utf8proc_int32_t *state) { + + return grapheme_break_extended(utf8proc_get_property(c1)->boundclass, + utf8proc_get_property(c2)->boundclass, + state); +} + + +UTF8PROC_DLLEXPORT utf8proc_bool utf8proc_grapheme_break( + utf8proc_int32_t c1, utf8proc_int32_t c2) { + return utf8proc_grapheme_break_stateful(c1, c2, NULL); +} + +static utf8proc_int32_t seqindex_decode_entry(const utf8proc_uint16_t **entry) +{ + utf8proc_int32_t entry_cp = **entry; + if ((entry_cp & 0xF800) == 0xD800) { + *entry = *entry + 1; + entry_cp = ((entry_cp & 0x03FF) << 10) | (**entry & 0x03FF); + entry_cp += 0x10000; + } + return entry_cp; +} + +static utf8proc_int32_t seqindex_decode_index(const utf8proc_uint32_t seqindex) +{ + const utf8proc_uint16_t *entry = &utf8proc_sequences[seqindex]; + return seqindex_decode_entry(&entry); +} + +static utf8proc_ssize_t seqindex_write_char_decomposed(utf8proc_uint16_t seqindex, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) { + utf8proc_ssize_t written = 0; + const utf8proc_uint16_t *entry = &utf8proc_sequences[seqindex & 0x1FFF]; + int len = seqindex >> 13; + if (len >= 7) { + len = *entry; + entry++; + } + for (; len >= 0; entry++, len--) { + utf8proc_int32_t entry_cp = seqindex_decode_entry(&entry); + + written += utf8proc_decompose_char(entry_cp, dst+written, + (bufsize > written) ? (bufsize - written) : 0, options, + last_boundclass); + if (written < 0) return UTF8PROC_ERROR_OVERFLOW; + } + return written; +} + +UTF8PROC_DLLEXPORT utf8proc_int32_t utf8proc_tolower(utf8proc_int32_t c) +{ + utf8proc_int32_t cl = utf8proc_get_property(c)->lowercase_seqindex; + return cl != UINT16_MAX ? seqindex_decode_index(cl) : c; +} + +UTF8PROC_DLLEXPORT utf8proc_int32_t utf8proc_toupper(utf8proc_int32_t c) +{ + utf8proc_int32_t cu = utf8proc_get_property(c)->uppercase_seqindex; + return cu != UINT16_MAX ? seqindex_decode_index(cu) : c; +} + +UTF8PROC_DLLEXPORT utf8proc_int32_t utf8proc_totitle(utf8proc_int32_t c) +{ + utf8proc_int32_t cu = utf8proc_get_property(c)->titlecase_seqindex; + return cu != UINT16_MAX ? seqindex_decode_index(cu) : c; +} + +/* return a character width analogous to wcwidth (except portable and + hopefully less buggy than most system wcwidth functions). */ +UTF8PROC_DLLEXPORT int utf8proc_charwidth(utf8proc_int32_t c) { + return utf8proc_get_property(c)->charwidth; +} + +UTF8PROC_DLLEXPORT utf8proc_category_t utf8proc_category(utf8proc_int32_t c) { + return utf8proc_get_property(c)->category; +} + +UTF8PROC_DLLEXPORT const char *utf8proc_category_string(utf8proc_int32_t c) { + static const char s[][3] = {"Cn","Lu","Ll","Lt","Lm","Lo","Mn","Mc","Me","Nd","Nl","No","Pc","Pd","Ps","Pe","Pi","Pf","Po","Sm","Sc","Sk","So","Zs","Zl","Zp","Cc","Cf","Cs","Co"}; + return s[utf8proc_category(c)]; +} + +#define utf8proc_decompose_lump(replacement_uc) \ + return utf8proc_decompose_char((replacement_uc), dst, bufsize, \ + options & ~UTF8PROC_LUMP, last_boundclass) + +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) { + const utf8proc_property_t *property; + utf8proc_propval_t category; + utf8proc_int32_t hangul_sindex; + if (uc < 0 || uc >= 0x110000) return UTF8PROC_ERROR_NOTASSIGNED; + property = unsafe_get_property(uc); + category = property->category; + hangul_sindex = uc - UTF8PROC_HANGUL_SBASE; + if (options & (UTF8PROC_COMPOSE|UTF8PROC_DECOMPOSE)) { + if (hangul_sindex >= 0 && hangul_sindex < UTF8PROC_HANGUL_SCOUNT) { + utf8proc_int32_t hangul_tindex; + if (bufsize >= 1) { + dst[0] = UTF8PROC_HANGUL_LBASE + + hangul_sindex / UTF8PROC_HANGUL_NCOUNT; + if (bufsize >= 2) dst[1] = UTF8PROC_HANGUL_VBASE + + (hangul_sindex % UTF8PROC_HANGUL_NCOUNT) / UTF8PROC_HANGUL_TCOUNT; + } + hangul_tindex = hangul_sindex % UTF8PROC_HANGUL_TCOUNT; + if (!hangul_tindex) return 2; + if (bufsize >= 3) dst[2] = UTF8PROC_HANGUL_TBASE + hangul_tindex; + return 3; + } + } + if (options & UTF8PROC_REJECTNA) { + if (!category) return UTF8PROC_ERROR_NOTASSIGNED; + } + if (options & UTF8PROC_IGNORE) { + if (property->ignorable) return 0; + } + if (options & UTF8PROC_LUMP) { + if (category == UTF8PROC_CATEGORY_ZS) utf8proc_decompose_lump(0x0020); + if (uc == 0x2018 || uc == 0x2019 || uc == 0x02BC || uc == 0x02C8) + utf8proc_decompose_lump(0x0027); + if (category == UTF8PROC_CATEGORY_PD || uc == 0x2212) + utf8proc_decompose_lump(0x002D); + if (uc == 0x2044 || uc == 0x2215) utf8proc_decompose_lump(0x002F); + if (uc == 0x2236) utf8proc_decompose_lump(0x003A); + if (uc == 0x2039 || uc == 0x2329 || uc == 0x3008) + utf8proc_decompose_lump(0x003C); + if (uc == 0x203A || uc == 0x232A || uc == 0x3009) + utf8proc_decompose_lump(0x003E); + if (uc == 0x2216) utf8proc_decompose_lump(0x005C); + if (uc == 0x02C4 || uc == 0x02C6 || uc == 0x2038 || uc == 0x2303) + utf8proc_decompose_lump(0x005E); + if (category == UTF8PROC_CATEGORY_PC || uc == 0x02CD) + utf8proc_decompose_lump(0x005F); + if (uc == 0x02CB) utf8proc_decompose_lump(0x0060); + if (uc == 0x2223) utf8proc_decompose_lump(0x007C); + if (uc == 0x223C) utf8proc_decompose_lump(0x007E); + if ((options & UTF8PROC_NLF2LS) && (options & UTF8PROC_NLF2PS)) { + if (category == UTF8PROC_CATEGORY_ZL || + category == UTF8PROC_CATEGORY_ZP) + utf8proc_decompose_lump(0x000A); + } + } + if (options & UTF8PROC_STRIPMARK) { + if (category == UTF8PROC_CATEGORY_MN || + category == UTF8PROC_CATEGORY_MC || + category == UTF8PROC_CATEGORY_ME) return 0; + } + if (options & UTF8PROC_CASEFOLD) { + if (property->casefold_seqindex != UINT16_MAX) { + return seqindex_write_char_decomposed(property->casefold_seqindex, dst, bufsize, options, last_boundclass); + } + } + if (options & (UTF8PROC_COMPOSE|UTF8PROC_DECOMPOSE)) { + if (property->decomp_seqindex != UINT16_MAX && + (!property->decomp_type || (options & UTF8PROC_COMPAT))) { + return seqindex_write_char_decomposed(property->decomp_seqindex, dst, bufsize, options, last_boundclass); + } + } + if (options & UTF8PROC_CHARBOUND) { + utf8proc_bool boundary; + int tbc = property->boundclass; + boundary = grapheme_break_extended(*last_boundclass, tbc, last_boundclass); + if (boundary) { + if (bufsize >= 1) dst[0] = 0xFFFF; + if (bufsize >= 2) dst[1] = uc; + return 2; + } + } + if (bufsize >= 1) *dst = uc; + return 1; +} + +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose( + const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, + utf8proc_int32_t *buffer, utf8proc_ssize_t bufsize, utf8proc_option_t options +) { + return utf8proc_decompose_custom(str, strlen, buffer, bufsize, options, NULL, NULL); +} + +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_custom( + const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, + utf8proc_int32_t *buffer, utf8proc_ssize_t bufsize, utf8proc_option_t options, + utf8proc_custom_func custom_func, void *custom_data +) { + /* strlen will be ignored, if UTF8PROC_NULLTERM is set in options */ + utf8proc_ssize_t wpos = 0; + if ((options & UTF8PROC_COMPOSE) && (options & UTF8PROC_DECOMPOSE)) + return UTF8PROC_ERROR_INVALIDOPTS; + if ((options & UTF8PROC_STRIPMARK) && + !(options & UTF8PROC_COMPOSE) && !(options & UTF8PROC_DECOMPOSE)) + return UTF8PROC_ERROR_INVALIDOPTS; + { + utf8proc_int32_t uc; + utf8proc_ssize_t rpos = 0; + utf8proc_ssize_t decomp_result; + int boundclass = UTF8PROC_BOUNDCLASS_START; + while (1) { + if (options & UTF8PROC_NULLTERM) { + rpos += utf8proc_iterate(str + rpos, -1, &uc); + /* checking of return value is not necessary, + as 'uc' is < 0 in case of error */ + if (uc < 0) return UTF8PROC_ERROR_INVALIDUTF8; + if (rpos < 0) return UTF8PROC_ERROR_OVERFLOW; + if (uc == 0) break; + } else { + if (rpos >= strlen) break; + rpos += utf8proc_iterate(str + rpos, strlen - rpos, &uc); + if (uc < 0) return UTF8PROC_ERROR_INVALIDUTF8; + } + if (custom_func != NULL) { + uc = custom_func(uc, custom_data); /* user-specified custom mapping */ + } + decomp_result = utf8proc_decompose_char( + uc, buffer + wpos, (bufsize > wpos) ? (bufsize - wpos) : 0, options, + &boundclass + ); + if (decomp_result < 0) return decomp_result; + wpos += decomp_result; + /* prohibiting integer overflows due to too long strings: */ + if (wpos < 0 || + wpos > (utf8proc_ssize_t)(SSIZE_MAX/sizeof(utf8proc_int32_t)/2)) + return UTF8PROC_ERROR_OVERFLOW; + } + } + if ((options & (UTF8PROC_COMPOSE|UTF8PROC_DECOMPOSE)) && bufsize >= wpos) { + utf8proc_ssize_t pos = 0; + while (pos < wpos-1) { + utf8proc_int32_t uc1, uc2; + const utf8proc_property_t *property1, *property2; + uc1 = buffer[pos]; + uc2 = buffer[pos+1]; + property1 = unsafe_get_property(uc1); + property2 = unsafe_get_property(uc2); + if (property1->combining_class > property2->combining_class && + property2->combining_class > 0) { + buffer[pos] = uc2; + buffer[pos+1] = uc1; + if (pos > 0) pos--; else pos++; + } else { + pos++; + } + } + } + return wpos; +} + +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_normalize_utf32(utf8proc_int32_t *buffer, utf8proc_ssize_t length, utf8proc_option_t options) { + /* UTF8PROC_NULLTERM option will be ignored, 'length' is never ignored */ + if (options & (UTF8PROC_NLF2LS | UTF8PROC_NLF2PS | UTF8PROC_STRIPCC)) { + utf8proc_ssize_t rpos; + utf8proc_ssize_t wpos = 0; + utf8proc_int32_t uc; + for (rpos = 0; rpos < length; rpos++) { + uc = buffer[rpos]; + if (uc == 0x000D && rpos < length-1 && buffer[rpos+1] == 0x000A) rpos++; + if (uc == 0x000A || uc == 0x000D || uc == 0x0085 || + ((options & UTF8PROC_STRIPCC) && (uc == 0x000B || uc == 0x000C))) { + if (options & UTF8PROC_NLF2LS) { + if (options & UTF8PROC_NLF2PS) { + buffer[wpos++] = 0x000A; + } else { + buffer[wpos++] = 0x2028; + } + } else { + if (options & UTF8PROC_NLF2PS) { + buffer[wpos++] = 0x2029; + } else { + buffer[wpos++] = 0x0020; + } + } + } else if ((options & UTF8PROC_STRIPCC) && + (uc < 0x0020 || (uc >= 0x007F && uc < 0x00A0))) { + if (uc == 0x0009) buffer[wpos++] = 0x0020; + } else { + buffer[wpos++] = uc; + } + } + length = wpos; + } + if (options & UTF8PROC_COMPOSE) { + utf8proc_int32_t *starter = NULL; + utf8proc_int32_t current_char; + const utf8proc_property_t *starter_property = NULL, *current_property; + utf8proc_propval_t max_combining_class = -1; + utf8proc_ssize_t rpos; + utf8proc_ssize_t wpos = 0; + utf8proc_int32_t composition; + for (rpos = 0; rpos < length; rpos++) { + current_char = buffer[rpos]; + current_property = unsafe_get_property(current_char); + if (starter && current_property->combining_class > max_combining_class) { + /* combination perhaps possible */ + utf8proc_int32_t hangul_lindex; + utf8proc_int32_t hangul_sindex; + hangul_lindex = *starter - UTF8PROC_HANGUL_LBASE; + if (hangul_lindex >= 0 && hangul_lindex < UTF8PROC_HANGUL_LCOUNT) { + utf8proc_int32_t hangul_vindex; + hangul_vindex = current_char - UTF8PROC_HANGUL_VBASE; + if (hangul_vindex >= 0 && hangul_vindex < UTF8PROC_HANGUL_VCOUNT) { + *starter = UTF8PROC_HANGUL_SBASE + + (hangul_lindex * UTF8PROC_HANGUL_VCOUNT + hangul_vindex) * + UTF8PROC_HANGUL_TCOUNT; + starter_property = NULL; + continue; + } + } + hangul_sindex = *starter - UTF8PROC_HANGUL_SBASE; + if (hangul_sindex >= 0 && hangul_sindex < UTF8PROC_HANGUL_SCOUNT && + (hangul_sindex % UTF8PROC_HANGUL_TCOUNT) == 0) { + utf8proc_int32_t hangul_tindex; + hangul_tindex = current_char - UTF8PROC_HANGUL_TBASE; + if (hangul_tindex >= 0 && hangul_tindex < UTF8PROC_HANGUL_TCOUNT) { + *starter += hangul_tindex; + starter_property = NULL; + continue; + } + } + if (!starter_property) { + starter_property = unsafe_get_property(*starter); + } + if (starter_property->comb_index < 0x8000 && + current_property->comb_index != UINT16_MAX && + current_property->comb_index >= 0x8000) { + int sidx = starter_property->comb_index; + int idx = current_property->comb_index & 0x3FFF; + if (idx >= utf8proc_combinations[sidx] && idx <= utf8proc_combinations[sidx + 1] ) { + idx += sidx + 2 - utf8proc_combinations[sidx]; + if (current_property->comb_index & 0x4000) { + composition = (utf8proc_combinations[idx] << 16) | utf8proc_combinations[idx+1]; + } else + composition = utf8proc_combinations[idx]; + + if (composition > 0 && (!(options & UTF8PROC_STABLE) || + !(unsafe_get_property(composition)->comp_exclusion))) { + *starter = composition; + starter_property = NULL; + continue; + } + } + } + } + buffer[wpos] = current_char; + if (current_property->combining_class) { + if (current_property->combining_class > max_combining_class) { + max_combining_class = current_property->combining_class; + } + } else { + starter = buffer + wpos; + starter_property = NULL; + max_combining_class = -1; + } + wpos++; + } + length = wpos; + } + return length; +} + +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_reencode(utf8proc_int32_t *buffer, utf8proc_ssize_t length, utf8proc_option_t options) { + /* UTF8PROC_NULLTERM option will be ignored, 'length' is never ignored + ASSERT: 'buffer' has one spare byte of free space at the end! */ + length = utf8proc_normalize_utf32(buffer, length, options); + if (length < 0) return length; + { + utf8proc_ssize_t rpos, wpos = 0; + utf8proc_int32_t uc; + if (options & UTF8PROC_CHARBOUND) { + for (rpos = 0; rpos < length; rpos++) { + uc = buffer[rpos]; + wpos += unsafe_encode_char(uc, ((utf8proc_uint8_t *)buffer) + wpos); + } + } else { + for (rpos = 0; rpos < length; rpos++) { + uc = buffer[rpos]; + wpos += utf8proc_encode_char(uc, ((utf8proc_uint8_t *)buffer) + wpos); + } + } + ((utf8proc_uint8_t *)buffer)[wpos] = 0; + return wpos; + } +} + +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map( + const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_uint8_t **dstptr, utf8proc_option_t options +) { + return utf8proc_map_custom(str, strlen, dstptr, options, NULL, NULL); +} + +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map_custom( + const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_uint8_t **dstptr, utf8proc_option_t options, + utf8proc_custom_func custom_func, void *custom_data +) { + utf8proc_int32_t *buffer; + utf8proc_ssize_t result; + *dstptr = NULL; + result = utf8proc_decompose_custom(str, strlen, NULL, 0, options, custom_func, custom_data); + if (result < 0) return result; + buffer = (utf8proc_int32_t *) malloc(result * sizeof(utf8proc_int32_t) + 1); + if (!buffer) return UTF8PROC_ERROR_NOMEM; + result = utf8proc_decompose_custom(str, strlen, buffer, result, options, custom_func, custom_data); + if (result < 0) { + free(buffer); + return result; + } + result = utf8proc_reencode(buffer, result, options); + if (result < 0) { + free(buffer); + return result; + } + { + utf8proc_int32_t *newptr; + newptr = (utf8proc_int32_t *) realloc(buffer, (size_t)result+1); + if (newptr) buffer = newptr; + } + *dstptr = (utf8proc_uint8_t *)buffer; + return result; +} + +UTF8PROC_DLLEXPORT utf8proc_uint8_t *utf8proc_NFD(const utf8proc_uint8_t *str) { + utf8proc_uint8_t *retval; + utf8proc_map(str, 0, &retval, UTF8PROC_NULLTERM | UTF8PROC_STABLE | + UTF8PROC_DECOMPOSE); + return retval; +} + +UTF8PROC_DLLEXPORT utf8proc_uint8_t *utf8proc_NFC(const utf8proc_uint8_t *str) { + utf8proc_uint8_t *retval; + utf8proc_map(str, 0, &retval, UTF8PROC_NULLTERM | UTF8PROC_STABLE | + UTF8PROC_COMPOSE); + return retval; +} + +UTF8PROC_DLLEXPORT utf8proc_uint8_t *utf8proc_NFKD(const utf8proc_uint8_t *str) { + utf8proc_uint8_t *retval; + utf8proc_map(str, 0, &retval, UTF8PROC_NULLTERM | UTF8PROC_STABLE | + UTF8PROC_DECOMPOSE | UTF8PROC_COMPAT); + return retval; +} + +UTF8PROC_DLLEXPORT utf8proc_uint8_t *utf8proc_NFKC(const utf8proc_uint8_t *str) { + utf8proc_uint8_t *retval; + utf8proc_map(str, 0, &retval, UTF8PROC_NULLTERM | UTF8PROC_STABLE | + UTF8PROC_COMPOSE | UTF8PROC_COMPAT); + return retval; +} diff --git a/tcod_sys/libtcod/src/vendor/utf8proc/utf8proc.h b/tcod_sys/libtcod/src/vendor/utf8proc/utf8proc.h new file mode 100644 index 000000000..61da03ecb --- /dev/null +++ b/tcod_sys/libtcod/src/vendor/utf8proc/utf8proc.h @@ -0,0 +1,699 @@ +/* + * Copyright (c) 2015 Steven G. Johnson, Jiahao Chen, Peter Colberg, Tony Kelman, Scott P. Jones, and other contributors. + * Copyright (c) 2009 Public Software Group e. V., Berlin, Germany + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + + +/** + * @mainpage + * + * utf8proc is a free/open-source (MIT/expat licensed) C library + * providing Unicode normalization, case-folding, and other operations + * for strings in the UTF-8 encoding, supporting Unicode version + * 9.0.0. See the utf8proc home page (http://julialang.org/utf8proc/) + * for downloads and other information, or the source code on github + * (https://github.com/JuliaLang/utf8proc). + * + * For the utf8proc API documentation, see: @ref utf8proc.h + * + * The features of utf8proc include: + * + * - Transformation of strings (@ref utf8proc_map) to: + * - decompose (@ref UTF8PROC_DECOMPOSE) or compose (@ref UTF8PROC_COMPOSE) Unicode combining characters (http://en.wikipedia.org/wiki/Combining_character) + * - canonicalize Unicode compatibility characters (@ref UTF8PROC_COMPAT) + * - strip "ignorable" (@ref UTF8PROC_IGNORE) characters, control characters (@ref UTF8PROC_STRIPCC), or combining characters such as accents (@ref UTF8PROC_STRIPMARK) + * - case-folding (@ref UTF8PROC_CASEFOLD) + * - Unicode normalization: @ref utf8proc_NFD, @ref utf8proc_NFC, @ref utf8proc_NFKD, @ref utf8proc_NFKC + * - Detecting grapheme boundaries (@ref utf8proc_grapheme_break and @ref UTF8PROC_CHARBOUND) + * - Character-width computation: @ref utf8proc_charwidth + * - Classification of characters by Unicode category: @ref utf8proc_category and @ref utf8proc_category_string + * - Encode (@ref utf8proc_encode_char) and decode (@ref utf8proc_iterate) Unicode codepoints to/from UTF-8. + */ + +/** @file */ + +#ifndef UTF8PROC_H +#define UTF8PROC_H + +/** @name API version + * + * The utf8proc API version MAJOR.MINOR.PATCH, following + * semantic-versioning rules (http://semver.org) based on API + * compatibility. + * + * This is also returned at runtime by @ref utf8proc_version; however, the + * runtime version may append a string like "-dev" to the version number + * for prerelease versions. + * + * @note The shared-library version number in the Makefile + * (and CMakeLists.txt, and MANIFEST) may be different, + * being based on ABI compatibility rather than API compatibility. + */ +/** @{ */ +/** The MAJOR version number (increased when backwards API compatibility is broken). */ +#define UTF8PROC_VERSION_MAJOR 2 +/** The MINOR version number (increased when new functionality is added in a backwards-compatible manner). */ +#define UTF8PROC_VERSION_MINOR 1 +/** The PATCH version (increased for fixes that do not change the API). */ +#define UTF8PROC_VERSION_PATCH 1 +/** @} */ + +#include + +#if defined(_MSC_VER) && _MSC_VER < 1800 +/* MSVC prior to 2013 lacked stdbool.h and inttypes.h */ +typedef signed char utf8proc_int8_t; +typedef unsigned char utf8proc_uint8_t; +typedef short utf8proc_int16_t; +typedef unsigned short utf8proc_uint16_t; +typedef int utf8proc_int32_t; +typedef unsigned int utf8proc_uint32_t; +# ifdef _WIN64 +typedef __int64 utf8proc_ssize_t; +typedef unsigned __int64 utf8proc_size_t; +# else +typedef int utf8proc_ssize_t; +typedef unsigned int utf8proc_size_t; +# endif +# ifndef __cplusplus +/* emulate C99 bool */ +typedef unsigned char utf8proc_bool; +# ifndef __bool_true_false_are_defined +# define false 0 +# define true 1 +# define __bool_true_false_are_defined 1 +# endif +# else +typedef bool utf8proc_bool; +# endif +#else +# include +# include +# include +typedef int8_t utf8proc_int8_t; +typedef uint8_t utf8proc_uint8_t; +typedef int16_t utf8proc_int16_t; +typedef uint16_t utf8proc_uint16_t; +typedef int32_t utf8proc_int32_t; +typedef uint32_t utf8proc_uint32_t; +typedef size_t utf8proc_size_t; +typedef ptrdiff_t utf8proc_ssize_t; +typedef bool utf8proc_bool; +#endif +#include + +#ifdef _WIN32 +# ifdef UTF8PROC_EXPORTS +# define UTF8PROC_DLLEXPORT __declspec(dllexport) +# else +# define UTF8PROC_DLLEXPORT +# endif +#elif __GNUC__ >= 4 +# define UTF8PROC_DLLEXPORT __attribute__ ((visibility("default"))) +#else +# define UTF8PROC_DLLEXPORT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef SSIZE_MAX +#define SSIZE_MAX ((size_t)SIZE_MAX/2) +#endif + +#ifndef UINT16_MAX +# define UINT16_MAX 65535U +#endif + +/** + * Option flags used by several functions in the library. + */ +typedef enum { + /** The given UTF-8 input is NULL terminated. */ + UTF8PROC_NULLTERM = (1<<0), + /** Unicode Versioning Stability has to be respected. */ + UTF8PROC_STABLE = (1<<1), + /** Compatibility decomposition (i.e. formatting information is lost). */ + UTF8PROC_COMPAT = (1<<2), + /** Return a result with decomposed characters. */ + UTF8PROC_COMPOSE = (1<<3), + /** Return a result with decomposed characters. */ + UTF8PROC_DECOMPOSE = (1<<4), + /** Strip "default ignorable characters" such as SOFT-HYPHEN or ZERO-WIDTH-SPACE. */ + UTF8PROC_IGNORE = (1<<5), + /** Return an error, if the input contains unassigned codepoints. */ + UTF8PROC_REJECTNA = (1<<6), + /** + * Indicating that NLF-sequences (LF, CRLF, CR, NEL) are representing a + * line break, and should be converted to the codepoint for line + * separation (LS). + */ + UTF8PROC_NLF2LS = (1<<7), + /** + * Indicating that NLF-sequences are representing a paragraph break, and + * should be converted to the codepoint for paragraph separation + * (PS). + */ + UTF8PROC_NLF2PS = (1<<8), + /** Indicating that the meaning of NLF-sequences is unknown. */ + UTF8PROC_NLF2LF = (UTF8PROC_NLF2LS | UTF8PROC_NLF2PS), + /** Strips and/or convers control characters. + * + * NLF-sequences are transformed into space, except if one of the + * NLF2LS/PS/LF options is given. HorizontalTab (HT) and FormFeed (FF) + * are treated as a NLF-sequence in this case. All other control + * characters are simply removed. + */ + UTF8PROC_STRIPCC = (1<<9), + /** + * Performs unicode case folding, to be able to do a case-insensitive + * string comparison. + */ + UTF8PROC_CASEFOLD = (1<<10), + /** + * Inserts 0xFF bytes at the beginning of each sequence which is + * representing a single grapheme cluster (see UAX#29). + */ + UTF8PROC_CHARBOUND = (1<<11), + /** Lumps certain characters together. + * + * E.g. HYPHEN U+2010 and MINUS U+2212 to ASCII "-". See lump.md for details. + * + * If NLF2LF is set, this includes a transformation of paragraph and + * line separators to ASCII line-feed (LF). + */ + UTF8PROC_LUMP = (1<<12), + /** Strips all character markings. + * + * This includes non-spacing, spacing and enclosing (i.e. accents). + * @note This option works only with @ref UTF8PROC_COMPOSE or + * @ref UTF8PROC_DECOMPOSE + */ + UTF8PROC_STRIPMARK = (1<<13), +} utf8proc_option_t; + +/** @name Error codes + * Error codes being returned by almost all functions. + */ +/** @{ */ +/** Memory could not be allocated. */ +#define UTF8PROC_ERROR_NOMEM -1 +/** The given string is too long to be processed. */ +#define UTF8PROC_ERROR_OVERFLOW -2 +/** The given string is not a legal UTF-8 string. */ +#define UTF8PROC_ERROR_INVALIDUTF8 -3 +/** The @ref UTF8PROC_REJECTNA flag was set and an unassigned codepoint was found. */ +#define UTF8PROC_ERROR_NOTASSIGNED -4 +/** Invalid options have been used. */ +#define UTF8PROC_ERROR_INVALIDOPTS -5 +/** @} */ + +/* @name Types */ + +/** Holds the value of a property. */ +typedef utf8proc_int16_t utf8proc_propval_t; + +/** Struct containing information about a codepoint. */ +typedef struct utf8proc_property_struct { + /** + * Unicode category. + * @see utf8proc_category_t. + */ + utf8proc_propval_t category; + utf8proc_propval_t combining_class; + /** + * Bidirectional class. + * @see utf8proc_bidi_class_t. + */ + utf8proc_propval_t bidi_class; + /** + * @anchor Decomposition type. + * @see utf8proc_decomp_type_t. + */ + utf8proc_propval_t decomp_type; + utf8proc_uint16_t decomp_seqindex; + utf8proc_uint16_t casefold_seqindex; + utf8proc_uint16_t uppercase_seqindex; + utf8proc_uint16_t lowercase_seqindex; + utf8proc_uint16_t titlecase_seqindex; + utf8proc_uint16_t comb_index; + unsigned bidi_mirrored:1; + unsigned comp_exclusion:1; + /** + * Can this codepoint be ignored? + * + * Used by @ref utf8proc_decompose_char when @ref UTF8PROC_IGNORE is + * passed as an option. + */ + unsigned ignorable:1; + unsigned control_boundary:1; + /** The width of the codepoint. */ + unsigned charwidth:2; + unsigned pad:2; + /** + * Boundclass. + * @see utf8proc_boundclass_t. + */ + unsigned boundclass:8; +} utf8proc_property_t; + +/** Unicode categories. */ +typedef enum { + UTF8PROC_CATEGORY_CN = 0, /**< Other, not assigned */ + UTF8PROC_CATEGORY_LU = 1, /**< Letter, uppercase */ + UTF8PROC_CATEGORY_LL = 2, /**< Letter, lowercase */ + UTF8PROC_CATEGORY_LT = 3, /**< Letter, titlecase */ + UTF8PROC_CATEGORY_LM = 4, /**< Letter, modifier */ + UTF8PROC_CATEGORY_LO = 5, /**< Letter, other */ + UTF8PROC_CATEGORY_MN = 6, /**< Mark, nonspacing */ + UTF8PROC_CATEGORY_MC = 7, /**< Mark, spacing combining */ + UTF8PROC_CATEGORY_ME = 8, /**< Mark, enclosing */ + UTF8PROC_CATEGORY_ND = 9, /**< Number, decimal digit */ + UTF8PROC_CATEGORY_NL = 10, /**< Number, letter */ + UTF8PROC_CATEGORY_NO = 11, /**< Number, other */ + UTF8PROC_CATEGORY_PC = 12, /**< Punctuation, connector */ + UTF8PROC_CATEGORY_PD = 13, /**< Punctuation, dash */ + UTF8PROC_CATEGORY_PS = 14, /**< Punctuation, open */ + UTF8PROC_CATEGORY_PE = 15, /**< Punctuation, close */ + UTF8PROC_CATEGORY_PI = 16, /**< Punctuation, initial quote */ + UTF8PROC_CATEGORY_PF = 17, /**< Punctuation, final quote */ + UTF8PROC_CATEGORY_PO = 18, /**< Punctuation, other */ + UTF8PROC_CATEGORY_SM = 19, /**< Symbol, math */ + UTF8PROC_CATEGORY_SC = 20, /**< Symbol, currency */ + UTF8PROC_CATEGORY_SK = 21, /**< Symbol, modifier */ + UTF8PROC_CATEGORY_SO = 22, /**< Symbol, other */ + UTF8PROC_CATEGORY_ZS = 23, /**< Separator, space */ + UTF8PROC_CATEGORY_ZL = 24, /**< Separator, line */ + UTF8PROC_CATEGORY_ZP = 25, /**< Separator, paragraph */ + UTF8PROC_CATEGORY_CC = 26, /**< Other, control */ + UTF8PROC_CATEGORY_CF = 27, /**< Other, format */ + UTF8PROC_CATEGORY_CS = 28, /**< Other, surrogate */ + UTF8PROC_CATEGORY_CO = 29, /**< Other, private use */ +} utf8proc_category_t; + +/** Bidirectional character classes. */ +typedef enum { + UTF8PROC_BIDI_CLASS_L = 1, /**< Left-to-Right */ + UTF8PROC_BIDI_CLASS_LRE = 2, /**< Left-to-Right Embedding */ + UTF8PROC_BIDI_CLASS_LRO = 3, /**< Left-to-Right Override */ + UTF8PROC_BIDI_CLASS_R = 4, /**< Right-to-Left */ + UTF8PROC_BIDI_CLASS_AL = 5, /**< Right-to-Left Arabic */ + UTF8PROC_BIDI_CLASS_RLE = 6, /**< Right-to-Left Embedding */ + UTF8PROC_BIDI_CLASS_RLO = 7, /**< Right-to-Left Override */ + UTF8PROC_BIDI_CLASS_PDF = 8, /**< Pop Directional Format */ + UTF8PROC_BIDI_CLASS_EN = 9, /**< European Number */ + UTF8PROC_BIDI_CLASS_ES = 10, /**< European Separator */ + UTF8PROC_BIDI_CLASS_ET = 11, /**< European Number Terminator */ + UTF8PROC_BIDI_CLASS_AN = 12, /**< Arabic Number */ + UTF8PROC_BIDI_CLASS_CS = 13, /**< Common Number Separator */ + UTF8PROC_BIDI_CLASS_NSM = 14, /**< Nonspacing Mark */ + UTF8PROC_BIDI_CLASS_BN = 15, /**< Boundary Neutral */ + UTF8PROC_BIDI_CLASS_B = 16, /**< Paragraph Separator */ + UTF8PROC_BIDI_CLASS_S = 17, /**< Segment Separator */ + UTF8PROC_BIDI_CLASS_WS = 18, /**< Whitespace */ + UTF8PROC_BIDI_CLASS_ON = 19, /**< Other Neutrals */ + UTF8PROC_BIDI_CLASS_LRI = 20, /**< Left-to-Right Isolate */ + UTF8PROC_BIDI_CLASS_RLI = 21, /**< Right-to-Left Isolate */ + UTF8PROC_BIDI_CLASS_FSI = 22, /**< First Strong Isolate */ + UTF8PROC_BIDI_CLASS_PDI = 23, /**< Pop Directional Isolate */ +} utf8proc_bidi_class_t; + +/** Decomposition type. */ +typedef enum { + UTF8PROC_DECOMP_TYPE_FONT = 1, /**< Font */ + UTF8PROC_DECOMP_TYPE_NOBREAK = 2, /**< Nobreak */ + UTF8PROC_DECOMP_TYPE_INITIAL = 3, /**< Initial */ + UTF8PROC_DECOMP_TYPE_MEDIAL = 4, /**< Medial */ + UTF8PROC_DECOMP_TYPE_FINAL = 5, /**< Final */ + UTF8PROC_DECOMP_TYPE_ISOLATED = 6, /**< Isolated */ + UTF8PROC_DECOMP_TYPE_CIRCLE = 7, /**< Circle */ + UTF8PROC_DECOMP_TYPE_SUPER = 8, /**< Super */ + UTF8PROC_DECOMP_TYPE_SUB = 9, /**< Sub */ + UTF8PROC_DECOMP_TYPE_VERTICAL = 10, /**< Vertical */ + UTF8PROC_DECOMP_TYPE_WIDE = 11, /**< Wide */ + UTF8PROC_DECOMP_TYPE_NARROW = 12, /**< Narrow */ + UTF8PROC_DECOMP_TYPE_SMALL = 13, /**< Small */ + UTF8PROC_DECOMP_TYPE_SQUARE = 14, /**< Square */ + UTF8PROC_DECOMP_TYPE_FRACTION = 15, /**< Fraction */ + UTF8PROC_DECOMP_TYPE_COMPAT = 16, /**< Compat */ +} utf8proc_decomp_type_t; + +/** Boundclass property. (TR29) */ +typedef enum { + UTF8PROC_BOUNDCLASS_START = 0, /**< Start */ + UTF8PROC_BOUNDCLASS_OTHER = 1, /**< Other */ + UTF8PROC_BOUNDCLASS_CR = 2, /**< Cr */ + UTF8PROC_BOUNDCLASS_LF = 3, /**< Lf */ + UTF8PROC_BOUNDCLASS_CONTROL = 4, /**< Control */ + UTF8PROC_BOUNDCLASS_EXTEND = 5, /**< Extend */ + UTF8PROC_BOUNDCLASS_L = 6, /**< L */ + UTF8PROC_BOUNDCLASS_V = 7, /**< V */ + UTF8PROC_BOUNDCLASS_T = 8, /**< T */ + UTF8PROC_BOUNDCLASS_LV = 9, /**< Lv */ + UTF8PROC_BOUNDCLASS_LVT = 10, /**< Lvt */ + UTF8PROC_BOUNDCLASS_REGIONAL_INDICATOR = 11, /**< Regional indicator */ + UTF8PROC_BOUNDCLASS_SPACINGMARK = 12, /**< Spacingmark */ + UTF8PROC_BOUNDCLASS_PREPEND = 13, /**< Prepend */ + UTF8PROC_BOUNDCLASS_ZWJ = 14, /**< Zero Width Joiner */ + UTF8PROC_BOUNDCLASS_E_BASE = 15, /**< Emoji Base */ + UTF8PROC_BOUNDCLASS_E_MODIFIER = 16, /**< Emoji Modifier */ + UTF8PROC_BOUNDCLASS_GLUE_AFTER_ZWJ = 17, /**< Glue_After_ZWJ */ + UTF8PROC_BOUNDCLASS_E_BASE_GAZ = 18, /**< E_BASE + GLUE_AFTER_ZJW */ +} utf8proc_boundclass_t; + +/** + * Function pointer type passed to @ref utf8proc_map_custom and + * @ref utf8proc_decompose_custom, which is used to specify a user-defined + * mapping of codepoints to be applied in conjunction with other mappings. + */ +typedef utf8proc_int32_t (*utf8proc_custom_func)(utf8proc_int32_t codepoint, void *data); + +/** + * Array containing the byte lengths of a UTF-8 encoded codepoint based + * on the first byte. + */ +UTF8PROC_DLLEXPORT extern const utf8proc_int8_t utf8proc_utf8class[256]; + +/** + * Returns the utf8proc API version as a string MAJOR.MINOR.PATCH + * (http://semver.org format), possibly with a "-dev" suffix for + * development versions. + */ +UTF8PROC_DLLEXPORT const char *utf8proc_version(void); + +/** + * Returns an informative error string for the given utf8proc error code + * (e.g. the error codes returned by @ref utf8proc_map). + */ +UTF8PROC_DLLEXPORT const char *utf8proc_errmsg(utf8proc_ssize_t errcode); + +/** + * Reads a single codepoint from the UTF-8 sequence being pointed to by `str`. + * The maximum number of bytes read is `strlen`, unless `strlen` is + * negative (in which case up to 4 bytes are read). + * + * If a valid codepoint could be read, it is stored in the variable + * pointed to by `codepoint_ref`, otherwise that variable will be set to -1. + * In case of success, the number of bytes read is returned; otherwise, a + * negative error code is returned. + */ +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_iterate(const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_int32_t *codepoint_ref); + +/** + * Check if a codepoint is valid (regardless of whether it has been + * assigned a value by the current Unicode standard). + * + * @return 1 if the given `codepoint` is valid and otherwise return 0. + */ +UTF8PROC_DLLEXPORT utf8proc_bool utf8proc_codepoint_valid(utf8proc_int32_t codepoint); + +/** + * Encodes the codepoint as an UTF-8 string in the byte array pointed + * to by `dst`. This array must be at least 4 bytes long. + * + * In case of success the number of bytes written is returned, and + * otherwise 0 is returned. + * + * This function does not check whether `codepoint` is valid Unicode. + */ +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_encode_char(utf8proc_int32_t codepoint, utf8proc_uint8_t *dst); + +/** + * Look up the properties for a given codepoint. + * + * @param codepoint The Unicode codepoint. + * + * @returns + * A pointer to a (constant) struct containing information about + * the codepoint. + * @par + * If the codepoint is unassigned or invalid, a pointer to a special struct is + * returned in which `category` is 0 (@ref UTF8PROC_CATEGORY_CN). + */ +UTF8PROC_DLLEXPORT const utf8proc_property_t *utf8proc_get_property(utf8proc_int32_t codepoint); + +/** Decompose a codepoint into an array of codepoints. + * + * @param codepoint the codepoint. + * @param dst the destination buffer. + * @param bufsize the size of the destination buffer. + * @param options one or more of the following flags: + * - @ref UTF8PROC_REJECTNA - return an error `codepoint` is unassigned + * - @ref UTF8PROC_IGNORE - strip "default ignorable" codepoints + * - @ref UTF8PROC_CASEFOLD - apply Unicode casefolding + * - @ref UTF8PROC_COMPAT - replace certain codepoints with their + * compatibility decomposition + * - @ref UTF8PROC_CHARBOUND - insert 0xFF bytes before each grapheme cluster + * - @ref UTF8PROC_LUMP - lump certain different codepoints together + * - @ref UTF8PROC_STRIPMARK - remove all character marks + * @param last_boundclass + * Pointer to an integer variable containing + * the previous codepoint's boundary class if the @ref UTF8PROC_CHARBOUND + * option is used. Otherwise, this parameter is ignored. + * + * @return + * In case of success, the number of codepoints written is returned; in case + * of an error, a negative error code is returned (@ref utf8proc_errmsg). + * @par + * If the number of written codepoints would be bigger than `bufsize`, the + * required buffer size is returned, while the buffer will be overwritten with + * undefined data. + */ +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char( + utf8proc_int32_t codepoint, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, + utf8proc_option_t options, int *last_boundclass +); + +/** + * The same as @ref utf8proc_decompose_char, but acts on a whole UTF-8 + * string and orders the decomposed sequences correctly. + * + * If the @ref UTF8PROC_NULLTERM flag in `options` is set, processing + * will be stopped, when a NULL byte is encounted, otherwise `strlen` + * bytes are processed. The result (in the form of 32-bit unicode + * codepoints) is written into the buffer being pointed to by + * `buffer` (which must contain at least `bufsize` entries). In case of + * success, the number of codepoints written is returned; in case of an + * error, a negative error code is returned (@ref utf8proc_errmsg). + * See @ref utf8proc_decompose_custom to supply additional transformations. + * + * If the number of written codepoints would be bigger than `bufsize`, the + * required buffer size is returned, while the buffer will be overwritten with + * undefined data. + */ +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose( + const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, + utf8proc_int32_t *buffer, utf8proc_ssize_t bufsize, utf8proc_option_t options +); + +/** + * The same as @ref utf8proc_decompose, but also takes a `custom_func` mapping function + * that is called on each codepoint in `str` before any other transformations + * (along with a `custom_data` pointer that is passed through to `custom_func`). + * The `custom_func` argument is ignored if it is `NULL`. See also @ref utf8proc_map_custom. + */ +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_custom( + const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, + utf8proc_int32_t *buffer, utf8proc_ssize_t bufsize, utf8proc_option_t options, + utf8proc_custom_func custom_func, void *custom_data +); + +/** + * Normalizes the sequence of `length` codepoints pointed to by `buffer` + * in-place (i.e., the result is also stored in `buffer`). + * + * @param buffer the (native-endian UTF-32) unicode codepoints to re-encode. + * @param length the length (in codepoints) of the buffer. + * @param options a bitwise or (`|`) of one or more of the following flags: + * - @ref UTF8PROC_NLF2LS - convert LF, CRLF, CR and NEL into LS + * - @ref UTF8PROC_NLF2PS - convert LF, CRLF, CR and NEL into PS + * - @ref UTF8PROC_NLF2LF - convert LF, CRLF, CR and NEL into LF + * - @ref UTF8PROC_STRIPCC - strip or convert all non-affected control characters + * - @ref UTF8PROC_COMPOSE - try to combine decomposed codepoints into composite + * codepoints + * - @ref UTF8PROC_STABLE - prohibit combining characters that would violate + * the unicode versioning stability + * + * @return + * In case of success, the length (in codepoints) of the normalized UTF-32 string is + * returned; otherwise, a negative error code is returned (@ref utf8proc_errmsg). + * + * @warning The entries of the array pointed to by `str` have to be in the + * range `0x0000` to `0x10FFFF`. Otherwise, the program might crash! + */ +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_normalize_utf32(utf8proc_int32_t *buffer, utf8proc_ssize_t length, utf8proc_option_t options); + +/** + * Reencodes the sequence of `length` codepoints pointed to by `buffer` + * UTF-8 data in-place (i.e., the result is also stored in `buffer`). + * Can optionally normalize the UTF-32 sequence prior to UTF-8 conversion. + * + * @param buffer the (native-endian UTF-32) unicode codepoints to re-encode. + * @param length the length (in codepoints) of the buffer. + * @param options a bitwise or (`|`) of one or more of the following flags: + * - @ref UTF8PROC_NLF2LS - convert LF, CRLF, CR and NEL into LS + * - @ref UTF8PROC_NLF2PS - convert LF, CRLF, CR and NEL into PS + * - @ref UTF8PROC_NLF2LF - convert LF, CRLF, CR and NEL into LF + * - @ref UTF8PROC_STRIPCC - strip or convert all non-affected control characters + * - @ref UTF8PROC_COMPOSE - try to combine decomposed codepoints into composite + * codepoints + * - @ref UTF8PROC_STABLE - prohibit combining characters that would violate + * the unicode versioning stability + * - @ref UTF8PROC_CHARBOUND - insert 0xFF bytes before each grapheme cluster + * + * @return + * In case of success, the length (in bytes) of the resulting nul-terminated + * UTF-8 string is returned; otherwise, a negative error code is returned + * (@ref utf8proc_errmsg). + * + * @warning The amount of free space pointed to by `buffer` must + * exceed the amount of the input data by one byte, and the + * entries of the array pointed to by `str` have to be in the + * range `0x0000` to `0x10FFFF`. Otherwise, the program might crash! + */ +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_reencode(utf8proc_int32_t *buffer, utf8proc_ssize_t length, utf8proc_option_t options); + +/** + * Given a pair of consecutive codepoints, return whether a grapheme break is + * permitted between them (as defined by the extended grapheme clusters in UAX#29). + * + * @param state Beginning with Version 29 (Unicode 9.0.0), this algorithm requires + * state to break graphemes. This state can be passed in as a pointer + * in the `state` argument and should initially be set to 0. If the + * state is not passed in (i.e. a null pointer is passed), UAX#29 rules + * GB10/12/13 which require this state will not be applied, essentially + * matching the rules in Unicode 8.0.0. + * + * @warning If the state parameter is used, `utf8proc_grapheme_break_stateful` must + * be called IN ORDER on ALL potential breaks in a string. + */ +UTF8PROC_DLLEXPORT utf8proc_bool utf8proc_grapheme_break_stateful( + utf8proc_int32_t codepoint1, utf8proc_int32_t codepoint2, utf8proc_int32_t *state); + +/** + * Same as @ref utf8proc_grapheme_break_stateful, except without support for the + * Unicode 9 additions to the algorithm. Supported for legacy reasons. + */ +UTF8PROC_DLLEXPORT utf8proc_bool utf8proc_grapheme_break( + utf8proc_int32_t codepoint1, utf8proc_int32_t codepoint2); + + +/** + * Given a codepoint `c`, return the codepoint of the corresponding + * lower-case character, if any; otherwise (if there is no lower-case + * variant, or if `c` is not a valid codepoint) return `c`. + */ +UTF8PROC_DLLEXPORT utf8proc_int32_t utf8proc_tolower(utf8proc_int32_t c); + +/** + * Given a codepoint `c`, return the codepoint of the corresponding + * upper-case character, if any; otherwise (if there is no upper-case + * variant, or if `c` is not a valid codepoint) return `c`. + */ +UTF8PROC_DLLEXPORT utf8proc_int32_t utf8proc_toupper(utf8proc_int32_t c); + +/** + * Given a codepoint `c`, return the codepoint of the corresponding + * title-case character, if any; otherwise (if there is no title-case + * variant, or if `c` is not a valid codepoint) return `c`. + */ +UTF8PROC_DLLEXPORT utf8proc_int32_t utf8proc_totitle(utf8proc_int32_t c); + +/** + * Given a codepoint, return a character width analogous to `wcwidth(codepoint)`, + * except that a width of 0 is returned for non-printable codepoints + * instead of -1 as in `wcwidth`. + * + * @note + * If you want to check for particular types of non-printable characters, + * (analogous to `isprint` or `iscntrl`), use @ref utf8proc_category. */ +UTF8PROC_DLLEXPORT int utf8proc_charwidth(utf8proc_int32_t codepoint); + +/** + * Return the Unicode category for the codepoint (one of the + * @ref utf8proc_category_t constants.) + */ +UTF8PROC_DLLEXPORT utf8proc_category_t utf8proc_category(utf8proc_int32_t codepoint); + +/** + * Return the two-letter (nul-terminated) Unicode category string for + * the codepoint (e.g. `"Lu"` or `"Co"`). + */ +UTF8PROC_DLLEXPORT const char *utf8proc_category_string(utf8proc_int32_t codepoint); + +/** + * Maps the given UTF-8 string pointed to by `str` to a new UTF-8 + * string, allocated dynamically by `malloc` and returned via `dstptr`. + * + * If the @ref UTF8PROC_NULLTERM flag in the `options` field is set, + * the length is determined by a NULL terminator, otherwise the + * parameter `strlen` is evaluated to determine the string length, but + * in any case the result will be NULL terminated (though it might + * contain NULL characters with the string if `str` contained NULL + * characters). Other flags in the `options` field are passed to the + * functions defined above, and regarded as described. See also + * @ref utfproc_map_custom to supply a custom codepoint transformation. + * + * In case of success the length of the new string is returned, + * otherwise a negative error code is returned. + * + * @note The memory of the new UTF-8 string will have been allocated + * with `malloc`, and should therefore be deallocated with `free`. + */ +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map( + const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_uint8_t **dstptr, utf8proc_option_t options +); + +/** + * Like @ref utf8proc_map, but also takes a `custom_func` mapping function + * that is called on each codepoint in `str` before any other transformations + * (along with a `custom_data` pointer that is passed through to `custom_func`). + * The `custom_func` argument is ignored if it is `NULL`. + */ +UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map_custom( + const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_uint8_t **dstptr, utf8proc_option_t options, + utf8proc_custom_func custom_func, void *custom_data +); + +/** @name Unicode normalization + * + * Returns a pointer to newly allocated memory of a NFD, NFC, NFKD or NFKC + * normalized version of the null-terminated string `str`. These + * are shortcuts to calling @ref utf8proc_map with @ref UTF8PROC_NULLTERM + * combined with @ref UTF8PROC_STABLE and flags indicating the normalization. + */ +/** @{ */ +/** NFD normalization (@ref UTF8PROC_DECOMPOSE). */ +UTF8PROC_DLLEXPORT utf8proc_uint8_t *utf8proc_NFD(const utf8proc_uint8_t *str); +/** NFC normalization (@ref UTF8PROC_COMPOSE). */ +UTF8PROC_DLLEXPORT utf8proc_uint8_t *utf8proc_NFC(const utf8proc_uint8_t *str); +/** NFKD normalization (@ref UTF8PROC_DECOMPOSE and @ref UTF8PROC_COMPAT). */ +UTF8PROC_DLLEXPORT utf8proc_uint8_t *utf8proc_NFKD(const utf8proc_uint8_t *str); +/** NFKC normalization (@ref UTF8PROC_COMPOSE and @ref UTF8PROC_COMPAT). */ +UTF8PROC_DLLEXPORT utf8proc_uint8_t *utf8proc_NFKC(const utf8proc_uint8_t *str); +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/tcod_sys/libtcod/src/vendor/utf8proc/utf8proc_data.c b/tcod_sys/libtcod/src/vendor/utf8proc/utf8proc_data.c new file mode 100644 index 000000000..17b33d960 --- /dev/null +++ b/tcod_sys/libtcod/src/vendor/utf8proc/utf8proc_data.c @@ -0,0 +1,14386 @@ +static const utf8proc_uint16_t utf8proc_sequences[] = { + 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, 32, 32, 776, 32, 772, + 50, 51, 32, 769, 956, 32, 807, 49, + 49, 8260, 52, 49, 8260, 50, 51, 8260, + 52, 65, 768, 224, 65, 769, 225, 65, + 770, 226, 65, 771, 227, 65, 776, 228, + 65, 778, 229, 230, 67, 807, 231, 69, + 768, 232, 69, 769, 233, 69, 770, 234, + 69, 776, 235, 73, 768, 236, 73, 769, + 237, 73, 770, 238, 73, 776, 239, 240, + 78, 771, 241, 79, 768, 242, 79, 769, + 243, 79, 770, 244, 79, 771, 245, 79, + 776, 246, 248, 85, 768, 249, 85, 769, + 250, 85, 770, 251, 85, 776, 252, 89, + 769, 253, 254, 115, 115, 97, 768, 97, + 769, 97, 770, 97, 771, 97, 776, 97, + 778, 99, 807, 101, 768, 101, 769, 101, + 770, 101, 776, 105, 768, 105, 769, 105, + 770, 105, 776, 110, 771, 111, 768, 111, + 769, 111, 770, 111, 771, 111, 776, 117, + 768, 117, 769, 117, 770, 117, 776, 121, + 769, 121, 776, 65, 772, 257, 97, 772, + 65, 774, 259, 97, 774, 65, 808, 261, + 97, 808, 67, 769, 263, 99, 769, 67, + 770, 265, 99, 770, 67, 775, 267, 99, + 775, 67, 780, 269, 99, 780, 68, 780, + 271, 100, 780, 273, 69, 772, 275, 101, + 772, 69, 774, 277, 101, 774, 69, 775, + 279, 101, 775, 69, 808, 281, 101, 808, + 69, 780, 283, 101, 780, 71, 770, 285, + 103, 770, 71, 774, 287, 103, 774, 71, + 775, 289, 103, 775, 71, 807, 291, 103, + 807, 72, 770, 293, 104, 770, 295, 73, + 771, 297, 105, 771, 73, 772, 299, 105, + 772, 73, 774, 301, 105, 774, 73, 808, + 303, 105, 808, 73, 775, 105, 775, 73, + 74, 307, 105, 106, 74, 770, 309, 106, + 770, 75, 807, 311, 107, 807, 76, 769, + 314, 108, 769, 76, 807, 316, 108, 807, + 76, 780, 318, 108, 780, 76, 183, 320, + 108, 183, 322, 78, 769, 324, 110, 769, + 78, 807, 326, 110, 807, 78, 780, 328, + 110, 780, 700, 110, 331, 79, 772, 333, + 111, 772, 79, 774, 335, 111, 774, 79, + 779, 337, 111, 779, 339, 82, 769, 341, + 114, 769, 82, 807, 343, 114, 807, 82, + 780, 345, 114, 780, 83, 769, 347, 115, + 769, 83, 770, 349, 115, 770, 83, 807, + 351, 115, 807, 83, 780, 353, 115, 780, + 84, 807, 355, 116, 807, 84, 780, 357, + 116, 780, 359, 85, 771, 361, 117, 771, + 85, 772, 363, 117, 772, 85, 774, 365, + 117, 774, 85, 778, 367, 117, 778, 85, + 779, 369, 117, 779, 85, 808, 371, 117, + 808, 87, 770, 373, 119, 770, 89, 770, + 375, 121, 770, 89, 776, 255, 90, 769, + 378, 122, 769, 90, 775, 380, 122, 775, + 90, 780, 382, 122, 780, 595, 387, 389, + 596, 392, 598, 599, 396, 477, 601, 603, + 402, 608, 611, 617, 616, 409, 623, 626, + 629, 79, 795, 417, 111, 795, 419, 421, + 640, 424, 643, 429, 648, 85, 795, 432, + 117, 795, 650, 651, 436, 438, 658, 441, + 445, 68, 381, 454, 68, 382, 100, 382, + 76, 74, 457, 76, 106, 108, 106, 78, + 74, 460, 78, 106, 110, 106, 65, 780, + 462, 97, 780, 73, 780, 464, 105, 780, + 79, 780, 466, 111, 780, 85, 780, 468, + 117, 780, 220, 772, 470, 252, 772, 220, + 769, 472, 252, 769, 220, 780, 474, 252, + 780, 220, 768, 476, 252, 768, 196, 772, + 479, 228, 772, 550, 772, 481, 551, 772, + 198, 772, 483, 230, 772, 485, 71, 780, + 487, 103, 780, 75, 780, 489, 107, 780, + 79, 808, 491, 111, 808, 490, 772, 493, + 491, 772, 439, 780, 495, 658, 780, 106, + 780, 68, 90, 499, 68, 122, 100, 122, + 71, 769, 501, 103, 769, 405, 447, 78, + 768, 505, 110, 768, 197, 769, 507, 229, + 769, 198, 769, 509, 230, 769, 216, 769, + 511, 248, 769, 65, 783, 513, 97, 783, + 65, 785, 515, 97, 785, 69, 783, 517, + 101, 783, 69, 785, 519, 101, 785, 73, + 783, 521, 105, 783, 73, 785, 523, 105, + 785, 79, 783, 525, 111, 783, 79, 785, + 527, 111, 785, 82, 783, 529, 114, 783, + 82, 785, 531, 114, 785, 85, 783, 533, + 117, 783, 85, 785, 535, 117, 785, 83, + 806, 537, 115, 806, 84, 806, 539, 116, + 806, 541, 72, 780, 543, 104, 780, 414, + 547, 549, 65, 775, 551, 97, 775, 69, + 807, 553, 101, 807, 214, 772, 555, 246, + 772, 213, 772, 557, 245, 772, 79, 775, + 559, 111, 775, 558, 772, 561, 559, 772, + 89, 772, 563, 121, 772, 11365, 572, 410, + 11366, 578, 384, 649, 652, 583, 585, 587, + 589, 591, 614, 633, 635, 641, 32, 774, + 32, 775, 32, 778, 32, 808, 32, 771, + 32, 779, 661, 768, 769, 787, 776, 769, + 953, 881, 883, 697, 887, 32, 837, 59, + 1011, 168, 769, 913, 769, 940, 183, 917, + 769, 941, 919, 769, 942, 921, 769, 943, + 927, 769, 972, 933, 769, 973, 937, 769, + 974, 970, 769, 953, 776, 769, 945, 946, + 947, 948, 949, 950, 951, 952, 954, 955, + 957, 958, 959, 960, 961, 963, 964, 965, + 966, 967, 968, 969, 921, 776, 970, 933, + 776, 971, 945, 769, 949, 769, 951, 769, + 953, 769, 971, 769, 965, 776, 769, 953, + 776, 965, 776, 959, 769, 965, 769, 969, + 769, 983, 933, 978, 769, 978, 776, 985, + 987, 989, 991, 993, 995, 997, 999, 1001, + 1003, 1005, 1007, 962, 920, 1016, 931, 1010, + 1019, 891, 892, 893, 1045, 768, 1104, 1045, + 776, 1105, 1106, 1043, 769, 1107, 1108, 1109, + 1110, 1030, 776, 1111, 1112, 1113, 1114, 1115, + 1050, 769, 1116, 1048, 768, 1117, 1059, 774, + 1118, 1119, 1072, 1073, 1074, 1075, 1076, 1077, + 1078, 1079, 1080, 1048, 774, 1081, 1082, 1083, + 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, + 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1080, 774, 1077, 768, + 1077, 776, 1075, 769, 1110, 776, 1082, 769, + 1080, 768, 1091, 774, 1121, 1123, 1125, 1127, + 1129, 1131, 1133, 1135, 1137, 1139, 1141, 1140, + 783, 1143, 1141, 783, 1145, 1147, 1149, 1151, + 1153, 1163, 1165, 1167, 1169, 1171, 1173, 1175, + 1177, 1179, 1181, 1183, 1185, 1187, 1189, 1191, + 1193, 1195, 1197, 1199, 1201, 1203, 1205, 1207, + 1209, 1211, 1213, 1215, 1231, 1046, 774, 1218, + 1078, 774, 1220, 1222, 1224, 1226, 1228, 1230, + 1040, 774, 1233, 1072, 774, 1040, 776, 1235, + 1072, 776, 1237, 1045, 774, 1239, 1077, 774, + 1241, 1240, 776, 1243, 1241, 776, 1046, 776, + 1245, 1078, 776, 1047, 776, 1247, 1079, 776, + 1249, 1048, 772, 1251, 1080, 772, 1048, 776, + 1253, 1080, 776, 1054, 776, 1255, 1086, 776, + 1257, 1256, 776, 1259, 1257, 776, 1069, 776, + 1261, 1101, 776, 1059, 772, 1263, 1091, 772, + 1059, 776, 1265, 1091, 776, 1059, 779, 1267, + 1091, 779, 1063, 776, 1269, 1095, 776, 1271, + 1067, 776, 1273, 1099, 776, 1275, 1277, 1279, + 1281, 1283, 1285, 1287, 1289, 1291, 1293, 1295, + 1297, 1299, 1301, 1303, 1305, 1307, 1309, 1311, + 1313, 1315, 1317, 1319, 1321, 1323, 1325, 1327, + 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, + 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, + 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, + 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, + 1409, 1410, 1411, 1412, 1413, 1414, 1381, 1410, + 1575, 1619, 1575, 1620, 1608, 1620, 1575, 1621, + 1610, 1620, 1575, 1652, 1608, 1652, 1735, 1652, + 1610, 1652, 1749, 1620, 1729, 1620, 1746, 1620, + 2344, 2364, 2352, 2364, 2355, 2364, 2325, 2364, + 2326, 2364, 2327, 2364, 2332, 2364, 2337, 2364, + 2338, 2364, 2347, 2364, 2351, 2364, 2503, 2494, + 2503, 2519, 2465, 2492, 2466, 2492, 2479, 2492, + 2610, 2620, 2616, 2620, 2582, 2620, 2583, 2620, + 2588, 2620, 2603, 2620, 2887, 2902, 2887, 2878, + 2887, 2903, 2849, 2876, 2850, 2876, 2962, 3031, + 3014, 3006, 3015, 3006, 3014, 3031, 3142, 3158, + 3263, 3285, 3270, 3285, 3270, 3286, 3270, 3266, + 3274, 3285, 3398, 3390, 3399, 3390, 3398, 3415, + 3545, 3530, 3545, 3535, 3548, 3530, 3545, 3551, + 3661, 3634, 3789, 3762, 3755, 3737, 3755, 3745, + 3851, 3906, 4023, 3916, 4023, 3921, 4023, 3926, + 4023, 3931, 4023, 3904, 4021, 3953, 3954, 3953, + 3956, 4018, 3968, 4018, 3969, 4019, 3968, 4019, + 3969, 3953, 3968, 3986, 4023, 3996, 4023, 4001, + 4023, 4006, 4023, 4011, 4023, 3984, 4021, 4133, + 4142, 11520, 11521, 11522, 11523, 11524, 11525, 11526, + 11527, 11528, 11529, 11530, 11531, 11532, 11533, 11534, + 11535, 11536, 11537, 11538, 11539, 11540, 11541, 11542, + 11543, 11544, 11545, 11546, 11547, 11548, 11549, 11550, + 11551, 11552, 11553, 11554, 11555, 11556, 11557, 11559, + 11565, 4316, 5104, 5105, 5106, 5107, 5108, 5109, + 6917, 6965, 6919, 6965, 6921, 6965, 6923, 6965, + 6925, 6965, 6929, 6965, 6970, 6965, 6972, 6965, + 6974, 6965, 6975, 6965, 6978, 6965, 42571, 65, + 198, 66, 68, 69, 398, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 546, 80, + 82, 84, 85, 87, 592, 593, 7426, 604, + 7446, 7447, 7453, 7461, 594, 597, 607, 609, + 613, 618, 7547, 669, 621, 7557, 671, 625, + 624, 627, 628, 632, 642, 427, 7452, 656, + 657, 65, 805, 7681, 97, 805, 66, 775, + 7683, 98, 775, 66, 803, 7685, 98, 803, + 66, 817, 7687, 98, 817, 199, 769, 7689, + 231, 769, 68, 775, 7691, 100, 775, 68, + 803, 7693, 100, 803, 68, 817, 7695, 100, + 817, 68, 807, 7697, 100, 807, 68, 813, + 7699, 100, 813, 274, 768, 7701, 275, 768, + 274, 769, 7703, 275, 769, 69, 813, 7705, + 101, 813, 69, 816, 7707, 101, 816, 552, + 774, 7709, 553, 774, 70, 775, 7711, 102, + 775, 71, 772, 7713, 103, 772, 72, 775, + 7715, 104, 775, 72, 803, 7717, 104, 803, + 72, 776, 7719, 104, 776, 72, 807, 7721, + 104, 807, 72, 814, 7723, 104, 814, 73, + 816, 7725, 105, 816, 207, 769, 7727, 239, + 769, 75, 769, 7729, 107, 769, 75, 803, + 7731, 107, 803, 75, 817, 7733, 107, 817, + 76, 803, 7735, 108, 803, 7734, 772, 7737, + 7735, 772, 76, 817, 7739, 108, 817, 76, + 813, 7741, 108, 813, 77, 769, 7743, 109, + 769, 77, 775, 7745, 109, 775, 77, 803, + 7747, 109, 803, 78, 775, 7749, 110, 775, + 78, 803, 7751, 110, 803, 78, 817, 7753, + 110, 817, 78, 813, 7755, 110, 813, 213, + 769, 7757, 245, 769, 213, 776, 7759, 245, + 776, 332, 768, 7761, 333, 768, 332, 769, + 7763, 333, 769, 80, 769, 7765, 112, 769, + 80, 775, 7767, 112, 775, 82, 775, 7769, + 114, 775, 82, 803, 7771, 114, 803, 7770, + 772, 7773, 7771, 772, 82, 817, 7775, 114, + 817, 83, 775, 7777, 115, 775, 83, 803, + 7779, 115, 803, 346, 775, 7781, 347, 775, + 352, 775, 7783, 353, 775, 7778, 775, 7785, + 7779, 775, 84, 775, 7787, 116, 775, 84, + 803, 7789, 116, 803, 84, 817, 7791, 116, + 817, 84, 813, 7793, 116, 813, 85, 804, + 7795, 117, 804, 85, 816, 7797, 117, 816, + 85, 813, 7799, 117, 813, 360, 769, 7801, + 361, 769, 362, 776, 7803, 363, 776, 86, + 771, 7805, 118, 771, 86, 803, 7807, 118, + 803, 87, 768, 7809, 119, 768, 87, 769, + 7811, 119, 769, 87, 776, 7813, 119, 776, + 87, 775, 7815, 119, 775, 87, 803, 7817, + 119, 803, 88, 775, 7819, 120, 775, 88, + 776, 7821, 120, 776, 89, 775, 7823, 121, + 775, 90, 770, 7825, 122, 770, 90, 803, + 7827, 122, 803, 90, 817, 7829, 122, 817, + 104, 817, 116, 776, 119, 778, 121, 778, + 97, 702, 383, 775, 223, 65, 803, 7841, + 97, 803, 65, 777, 7843, 97, 777, 194, + 769, 7845, 226, 769, 194, 768, 7847, 226, + 768, 194, 777, 7849, 226, 777, 194, 771, + 7851, 226, 771, 7840, 770, 7853, 7841, 770, + 258, 769, 7855, 259, 769, 258, 768, 7857, + 259, 768, 258, 777, 7859, 259, 777, 258, + 771, 7861, 259, 771, 7840, 774, 7863, 7841, + 774, 69, 803, 7865, 101, 803, 69, 777, + 7867, 101, 777, 69, 771, 7869, 101, 771, + 202, 769, 7871, 234, 769, 202, 768, 7873, + 234, 768, 202, 777, 7875, 234, 777, 202, + 771, 7877, 234, 771, 7864, 770, 7879, 7865, + 770, 73, 777, 7881, 105, 777, 73, 803, + 7883, 105, 803, 79, 803, 7885, 111, 803, + 79, 777, 7887, 111, 777, 212, 769, 7889, + 244, 769, 212, 768, 7891, 244, 768, 212, + 777, 7893, 244, 777, 212, 771, 7895, 244, + 771, 7884, 770, 7897, 7885, 770, 416, 769, + 7899, 417, 769, 416, 768, 7901, 417, 768, + 416, 777, 7903, 417, 777, 416, 771, 7905, + 417, 771, 416, 803, 7907, 417, 803, 85, + 803, 7909, 117, 803, 85, 777, 7911, 117, + 777, 431, 769, 7913, 432, 769, 431, 768, + 7915, 432, 768, 431, 777, 7917, 432, 777, + 431, 771, 7919, 432, 771, 431, 803, 7921, + 432, 803, 89, 768, 7923, 121, 768, 89, + 803, 7925, 121, 803, 89, 777, 7927, 121, + 777, 89, 771, 7929, 121, 771, 7931, 7933, + 7935, 945, 787, 945, 788, 7936, 768, 7937, + 768, 7936, 769, 7937, 769, 7936, 834, 7937, + 834, 913, 787, 7936, 913, 788, 7937, 7944, + 768, 7938, 7945, 768, 7939, 7944, 769, 7940, + 7945, 769, 7941, 7944, 834, 7942, 7945, 834, + 7943, 949, 787, 949, 788, 7952, 768, 7953, + 768, 7952, 769, 7953, 769, 917, 787, 7952, + 917, 788, 7953, 7960, 768, 7954, 7961, 768, + 7955, 7960, 769, 7956, 7961, 769, 7957, 951, + 787, 951, 788, 7968, 768, 7969, 768, 7968, + 769, 7969, 769, 7968, 834, 7969, 834, 919, + 787, 7968, 919, 788, 7969, 7976, 768, 7970, + 7977, 768, 7971, 7976, 769, 7972, 7977, 769, + 7973, 7976, 834, 7974, 7977, 834, 7975, 953, + 787, 953, 788, 7984, 768, 7985, 768, 7984, + 769, 7985, 769, 7984, 834, 7985, 834, 921, + 787, 7984, 921, 788, 7985, 7992, 768, 7986, + 7993, 768, 7987, 7992, 769, 7988, 7993, 769, + 7989, 7992, 834, 7990, 7993, 834, 7991, 959, + 787, 959, 788, 8000, 768, 8001, 768, 8000, + 769, 8001, 769, 927, 787, 8000, 927, 788, + 8001, 8008, 768, 8002, 8009, 768, 8003, 8008, + 769, 8004, 8009, 769, 8005, 965, 787, 965, + 788, 8016, 768, 965, 787, 768, 8017, 768, + 8016, 769, 965, 787, 769, 8017, 769, 8016, + 834, 965, 787, 834, 8017, 834, 933, 788, + 8017, 8025, 768, 8019, 8025, 769, 8021, 8025, + 834, 8023, 969, 787, 969, 788, 8032, 768, + 8033, 768, 8032, 769, 8033, 769, 8032, 834, + 8033, 834, 937, 787, 8032, 937, 788, 8033, + 8040, 768, 8034, 8041, 768, 8035, 8040, 769, + 8036, 8041, 769, 8037, 8040, 834, 8038, 8041, + 834, 8039, 945, 768, 949, 768, 951, 768, + 953, 768, 959, 768, 965, 768, 969, 768, + 7936, 837, 7936, 953, 7937, 837, 7937, 953, + 7938, 837, 7938, 953, 7939, 837, 7939, 953, + 7940, 837, 7940, 953, 7941, 837, 7941, 953, + 7942, 837, 7942, 953, 7943, 837, 7943, 953, + 7944, 837, 8064, 7945, 837, 8065, 7946, 837, + 8066, 7947, 837, 8067, 7948, 837, 8068, 7949, + 837, 8069, 7950, 837, 8070, 7951, 837, 8071, + 7968, 837, 7968, 953, 7969, 837, 7969, 953, + 7970, 837, 7970, 953, 7971, 837, 7971, 953, + 7972, 837, 7972, 953, 7973, 837, 7973, 953, + 7974, 837, 7974, 953, 7975, 837, 7975, 953, + 7976, 837, 8080, 7977, 837, 8081, 7978, 837, + 8082, 7979, 837, 8083, 7980, 837, 8084, 7981, + 837, 8085, 7982, 837, 8086, 7983, 837, 8087, + 8032, 837, 8032, 953, 8033, 837, 8033, 953, + 8034, 837, 8034, 953, 8035, 837, 8035, 953, + 8036, 837, 8036, 953, 8037, 837, 8037, 953, + 8038, 837, 8038, 953, 8039, 837, 8039, 953, + 8040, 837, 8096, 8041, 837, 8097, 8042, 837, + 8098, 8043, 837, 8099, 8044, 837, 8100, 8045, + 837, 8101, 8046, 837, 8102, 8047, 837, 8103, + 945, 774, 945, 772, 8048, 837, 8048, 953, + 945, 837, 945, 953, 940, 837, 940, 953, + 945, 834, 8118, 837, 945, 834, 953, 913, + 774, 8112, 913, 772, 8113, 913, 768, 8048, + 902, 8049, 913, 837, 8115, 32, 787, 32, + 834, 168, 834, 8052, 837, 8052, 953, 951, + 837, 951, 953, 942, 837, 942, 953, 951, + 834, 8134, 837, 951, 834, 953, 917, 768, + 8050, 904, 8051, 919, 768, 8052, 905, 8053, + 919, 837, 8131, 8127, 768, 8127, 769, 8127, + 834, 953, 774, 953, 772, 970, 768, 953, + 776, 768, 912, 953, 834, 970, 834, 953, + 776, 834, 921, 774, 8144, 921, 772, 8145, + 921, 768, 8054, 906, 8055, 8190, 768, 8190, + 769, 8190, 834, 965, 774, 965, 772, 971, + 768, 965, 776, 768, 944, 961, 787, 961, + 788, 965, 834, 971, 834, 965, 776, 834, + 933, 774, 8160, 933, 772, 8161, 933, 768, + 8058, 910, 8059, 929, 788, 8165, 168, 768, + 901, 96, 8060, 837, 8060, 953, 969, 837, + 969, 953, 974, 837, 974, 953, 969, 834, + 8182, 837, 969, 834, 953, 927, 768, 8056, + 908, 8057, 937, 768, 8060, 911, 8061, 937, + 837, 8179, 180, 32, 788, 8194, 8195, 8208, + 32, 819, 46, 46, 46, 46, 46, 46, + 8242, 8242, 8242, 8242, 8242, 8245, 8245, 8245, + 8245, 8245, 33, 33, 32, 773, 63, 63, + 63, 33, 33, 63, 8242, 8242, 8242, 8242, + 48, 52, 53, 54, 55, 56, 57, 43, + 8722, 61, 40, 41, 82, 115, 97, 47, + 99, 97, 47, 115, 67, 176, 67, 99, + 47, 111, 99, 47, 117, 400, 176, 70, + 78, 111, 81, 83, 77, 84, 69, 76, + 84, 77, 90, 937, 197, 70, 8526, 1488, + 1489, 1490, 1491, 70, 65, 88, 915, 928, + 8721, 49, 8260, 55, 49, 8260, 57, 49, + 8260, 49, 48, 49, 8260, 51, 50, 8260, + 51, 49, 8260, 53, 50, 8260, 53, 51, + 8260, 53, 52, 8260, 53, 49, 8260, 54, + 53, 8260, 54, 49, 8260, 56, 51, 8260, + 56, 53, 8260, 56, 55, 8260, 56, 49, + 8260, 8560, 73, 73, 8561, 73, 73, 73, + 8562, 73, 86, 8563, 86, 8564, 86, 73, + 8565, 86, 73, 73, 8566, 86, 73, 73, + 73, 8567, 73, 88, 8568, 88, 8569, 88, + 73, 8570, 88, 73, 73, 8571, 8572, 8573, + 8574, 8575, 105, 105, 105, 105, 105, 105, + 118, 118, 105, 118, 105, 105, 118, 105, + 105, 105, 105, 120, 120, 105, 120, 105, + 105, 8580, 48, 8260, 51, 8592, 824, 8594, + 824, 8596, 824, 8656, 824, 8660, 824, 8658, + 824, 8707, 824, 8712, 824, 8715, 824, 8739, + 824, 8741, 824, 8747, 8747, 8747, 8747, 8747, + 8750, 8750, 8750, 8750, 8750, 8764, 824, 8771, + 824, 8773, 824, 8776, 824, 61, 824, 8801, + 824, 8781, 824, 60, 824, 62, 824, 8804, + 824, 8805, 824, 8818, 824, 8819, 824, 8822, + 824, 8823, 824, 8826, 824, 8827, 824, 8834, + 824, 8835, 824, 8838, 824, 8839, 824, 8866, + 824, 8872, 824, 8873, 824, 8875, 824, 8828, + 824, 8829, 824, 8849, 824, 8850, 824, 8882, + 824, 8883, 824, 8884, 824, 8885, 824, 12296, + 12297, 49, 48, 49, 49, 49, 50, 49, + 51, 49, 52, 49, 53, 49, 54, 49, + 55, 49, 56, 49, 57, 50, 48, 40, + 49, 41, 40, 50, 41, 40, 51, 41, + 40, 52, 41, 40, 53, 41, 40, 54, + 41, 40, 55, 41, 40, 56, 41, 40, + 57, 41, 40, 49, 48, 41, 40, 49, + 49, 41, 40, 49, 50, 41, 40, 49, + 51, 41, 40, 49, 52, 41, 40, 49, + 53, 41, 40, 49, 54, 41, 40, 49, + 55, 41, 40, 49, 56, 41, 40, 49, + 57, 41, 40, 50, 48, 41, 49, 46, + 50, 46, 51, 46, 52, 46, 53, 46, + 54, 46, 55, 46, 56, 46, 57, 46, + 49, 48, 46, 49, 49, 46, 49, 50, + 46, 49, 51, 46, 49, 52, 46, 49, + 53, 46, 49, 54, 46, 49, 55, 46, + 49, 56, 46, 49, 57, 46, 50, 48, + 46, 40, 97, 41, 40, 98, 41, 40, + 99, 41, 40, 100, 41, 40, 101, 41, + 40, 102, 41, 40, 103, 41, 40, 104, + 41, 40, 105, 41, 40, 106, 41, 40, + 107, 41, 40, 108, 41, 40, 109, 41, + 40, 110, 41, 40, 111, 41, 40, 112, + 41, 40, 113, 41, 40, 114, 41, 40, + 115, 41, 40, 116, 41, 40, 117, 41, + 40, 118, 41, 40, 119, 41, 40, 120, + 41, 40, 121, 41, 40, 122, 41, 9424, + 9425, 9426, 9427, 9428, 9429, 9430, 9431, 9432, + 9433, 9434, 9435, 9436, 9437, 9438, 9439, 9440, + 9441, 83, 9442, 9443, 9444, 9445, 9446, 9447, + 89, 9448, 9449, 8747, 8747, 8747, 8747, 58, + 58, 61, 61, 61, 61, 61, 61, 10973, + 824, 11312, 11313, 11314, 11315, 11316, 11317, 11318, + 11319, 11320, 11321, 11322, 11323, 11324, 11325, 11326, + 11327, 11328, 11329, 11330, 11331, 11332, 11333, 11334, + 11335, 11336, 11337, 11338, 11339, 11340, 11341, 11342, + 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350, + 11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, + 11361, 619, 7549, 637, 11368, 11370, 11372, 11379, + 11382, 575, 576, 11393, 11395, 11397, 11399, 11401, + 11403, 11405, 11407, 11409, 11411, 11413, 11415, 11417, + 11419, 11421, 11423, 11425, 11427, 11429, 11431, 11433, + 11435, 11437, 11439, 11441, 11443, 11445, 11447, 11449, + 11451, 11453, 11455, 11457, 11459, 11461, 11463, 11465, + 11467, 11469, 11471, 11473, 11475, 11477, 11479, 11481, + 11483, 11485, 11487, 11489, 11491, 11500, 11502, 11507, + 11617, 27597, 40863, 19968, 20008, 20022, 20031, 20057, + 20101, 20108, 20128, 20154, 20799, 20837, 20843, 20866, + 20886, 20907, 20960, 20981, 20992, 21147, 21241, 21269, + 21274, 21304, 21313, 21340, 21353, 21378, 21430, 21448, + 21475, 22231, 22303, 22763, 22786, 22794, 22805, 22823, + 22899, 23376, 23424, 23544, 23567, 23586, 23608, 23662, + 23665, 24027, 24037, 24049, 24062, 24178, 24186, 24191, + 24308, 24318, 24331, 24339, 24400, 24417, 24435, 24515, + 25096, 25142, 25163, 25903, 25908, 25991, 26007, 26020, + 26041, 26080, 26085, 26352, 26376, 26408, 27424, 27490, + 27513, 27571, 27595, 27604, 27611, 27663, 27668, 27700, + 28779, 29226, 29238, 29243, 29247, 29255, 29273, 29275, + 29356, 29572, 29577, 29916, 29926, 29976, 29983, 29992, + 30000, 30091, 30098, 30326, 30333, 30382, 30399, 30446, + 30683, 30690, 30707, 31034, 31160, 31166, 31348, 31435, + 31481, 31859, 31992, 32566, 32593, 32650, 32701, 32769, + 32780, 32786, 32819, 32895, 32905, 33251, 33258, 33267, + 33276, 33292, 33307, 33311, 33390, 33394, 33400, 34381, + 34411, 34880, 34892, 34915, 35198, 35211, 35282, 35328, + 35895, 35910, 35925, 35960, 35997, 36196, 36208, 36275, + 36523, 36554, 36763, 36784, 36789, 37009, 37193, 37318, + 37324, 37329, 38263, 38272, 38428, 38582, 38585, 38632, + 38737, 38750, 38754, 38761, 38859, 38893, 38899, 38913, + 39080, 39131, 39135, 39318, 39321, 39340, 39592, 39640, + 39647, 39717, 39727, 39730, 39740, 39770, 40165, 40565, + 40575, 40613, 40635, 40643, 40653, 40657, 40697, 40701, + 40718, 40723, 40736, 40763, 40778, 40786, 40845, 40860, + 40864, 12306, 21316, 21317, 12363, 12441, 12365, 12441, + 12367, 12441, 12369, 12441, 12371, 12441, 12373, 12441, + 12375, 12441, 12377, 12441, 12379, 12441, 12381, 12441, + 12383, 12441, 12385, 12441, 12388, 12441, 12390, 12441, + 12392, 12441, 12399, 12441, 12399, 12442, 12402, 12441, + 12402, 12442, 12405, 12441, 12405, 12442, 12408, 12441, + 12408, 12442, 12411, 12441, 12411, 12442, 12358, 12441, + 32, 12441, 32, 12442, 12445, 12441, 12424, 12426, + 12459, 12441, 12461, 12441, 12463, 12441, 12465, 12441, + 12467, 12441, 12469, 12441, 12471, 12441, 12473, 12441, + 12475, 12441, 12477, 12441, 12479, 12441, 12481, 12441, + 12484, 12441, 12486, 12441, 12488, 12441, 12495, 12441, + 12495, 12442, 12498, 12441, 12498, 12442, 12501, 12441, + 12501, 12442, 12504, 12441, 12504, 12442, 12507, 12441, + 12507, 12442, 12454, 12441, 12527, 12441, 12528, 12441, + 12529, 12441, 12530, 12441, 12541, 12441, 12467, 12488, + 4352, 4353, 4522, 4354, 4524, 4525, 4355, 4356, + 4357, 4528, 4529, 4530, 4531, 4532, 4533, 4378, + 4358, 4359, 4360, 4385, 4361, 4362, 4363, 4364, + 4365, 4366, 4367, 4368, 4369, 4370, 4449, 4450, + 4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, + 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, + 4467, 4468, 4469, 4448, 4372, 4373, 4551, 4552, + 4556, 4558, 4563, 4567, 4569, 4380, 4573, 4575, + 4381, 4382, 4384, 4386, 4387, 4391, 4393, 4395, + 4396, 4397, 4398, 4399, 4402, 4406, 4416, 4423, + 4428, 4593, 4594, 4439, 4440, 4441, 4484, 4485, + 4488, 4497, 4498, 4500, 4510, 4513, 19977, 22235, + 19978, 20013, 19979, 30002, 19993, 19969, 22825, 22320, + 40, 4352, 41, 40, 4354, 41, 40, 4355, + 41, 40, 4357, 41, 40, 4358, 41, 40, + 4359, 41, 40, 4361, 41, 40, 4363, 41, + 40, 4364, 41, 40, 4366, 41, 40, 4367, + 41, 40, 4368, 41, 40, 4369, 41, 40, + 4370, 41, 40, 4352, 4449, 41, 40, 4354, + 4449, 41, 40, 4355, 4449, 41, 40, 4357, + 4449, 41, 40, 4358, 4449, 41, 40, 4359, + 4449, 41, 40, 4361, 4449, 41, 40, 4363, + 4449, 41, 40, 4364, 4449, 41, 40, 4366, + 4449, 41, 40, 4367, 4449, 41, 40, 4368, + 4449, 41, 40, 4369, 4449, 41, 40, 4370, + 4449, 41, 40, 4364, 4462, 41, 40, 4363, + 4457, 4364, 4453, 4523, 41, 40, 4363, 4457, + 4370, 4462, 41, 40, 19968, 41, 40, 20108, + 41, 40, 19977, 41, 40, 22235, 41, 40, + 20116, 41, 40, 20845, 41, 40, 19971, 41, + 40, 20843, 41, 40, 20061, 41, 40, 21313, + 41, 40, 26376, 41, 40, 28779, 41, 40, + 27700, 41, 40, 26408, 41, 40, 37329, 41, + 40, 22303, 41, 40, 26085, 41, 40, 26666, + 41, 40, 26377, 41, 40, 31038, 41, 40, + 21517, 41, 40, 29305, 41, 40, 36001, 41, + 40, 31069, 41, 40, 21172, 41, 40, 20195, + 41, 40, 21628, 41, 40, 23398, 41, 40, + 30435, 41, 40, 20225, 41, 40, 36039, 41, + 40, 21332, 41, 40, 31085, 41, 40, 20241, + 41, 40, 33258, 41, 40, 33267, 41, 21839, + 24188, 31631, 80, 84, 69, 50, 49, 50, + 50, 50, 51, 50, 52, 50, 53, 50, + 54, 50, 55, 50, 56, 50, 57, 51, + 48, 51, 49, 51, 50, 51, 51, 51, + 52, 51, 53, 4352, 4449, 4354, 4449, 4355, + 4449, 4357, 4449, 4358, 4449, 4359, 4449, 4361, + 4449, 4363, 4449, 4364, 4449, 4366, 4449, 4367, + 4449, 4368, 4449, 4369, 4449, 4370, 4449, 4366, + 4449, 4535, 4352, 4457, 4364, 4462, 4363, 4468, + 4363, 4462, 20116, 20845, 19971, 20061, 26666, 26377, + 31038, 21517, 29305, 36001, 31069, 21172, 31192, 30007, + 36969, 20778, 21360, 27880, 38917, 20241, 20889, 27491, + 24038, 21491, 21307, 23447, 23398, 30435, 20225, 36039, + 21332, 22812, 51, 54, 51, 55, 51, 56, + 51, 57, 52, 48, 52, 49, 52, 50, + 52, 51, 52, 52, 52, 53, 52, 54, + 52, 55, 52, 56, 52, 57, 53, 48, + 49, 26376, 50, 26376, 51, 26376, 52, 26376, + 53, 26376, 54, 26376, 55, 26376, 56, 26376, + 57, 26376, 49, 48, 26376, 49, 49, 26376, + 49, 50, 26376, 72, 103, 101, 114, 103, + 101, 86, 76, 84, 68, 12450, 12452, 12454, + 12456, 12458, 12459, 12461, 12463, 12465, 12467, 12469, + 12471, 12473, 12475, 12477, 12479, 12481, 12484, 12486, + 12488, 12490, 12491, 12492, 12493, 12494, 12495, 12498, + 12501, 12504, 12507, 12510, 12511, 12512, 12513, 12514, + 12516, 12518, 12520, 12521, 12522, 12523, 12524, 12525, + 12527, 12528, 12529, 12530, 12450, 12497, 12540, 12488, + 12450, 12523, 12501, 12449, 12450, 12531, 12506, 12450, + 12450, 12540, 12523, 12452, 12491, 12531, 12464, 12452, + 12531, 12481, 12454, 12457, 12531, 12456, 12473, 12463, + 12540, 12489, 12456, 12540, 12459, 12540, 12458, 12531, + 12473, 12458, 12540, 12512, 12459, 12452, 12522, 12459, + 12521, 12483, 12488, 12459, 12525, 12522, 12540, 12460, + 12525, 12531, 12460, 12531, 12510, 12462, 12460, 12462, + 12491, 12540, 12461, 12517, 12522, 12540, 12462, 12523, + 12480, 12540, 12461, 12525, 12461, 12525, 12464, 12521, + 12512, 12461, 12525, 12513, 12540, 12488, 12523, 12461, + 12525, 12527, 12483, 12488, 12464, 12521, 12512, 12464, + 12521, 12512, 12488, 12531, 12463, 12523, 12476, 12452, + 12525, 12463, 12525, 12540, 12493, 12465, 12540, 12473, + 12467, 12523, 12490, 12467, 12540, 12509, 12469, 12452, + 12463, 12523, 12469, 12531, 12481, 12540, 12512, 12471, + 12522, 12531, 12464, 12475, 12531, 12481, 12475, 12531, + 12488, 12480, 12540, 12473, 12487, 12471, 12489, 12523, + 12488, 12531, 12490, 12494, 12494, 12483, 12488, 12495, + 12452, 12484, 12497, 12540, 12475, 12531, 12488, 12497, + 12540, 12484, 12496, 12540, 12524, 12523, 12500, 12450, + 12473, 12488, 12523, 12500, 12463, 12523, 12500, 12467, + 12499, 12523, 12501, 12449, 12521, 12483, 12489, 12501, + 12451, 12540, 12488, 12502, 12483, 12471, 12455, 12523, + 12501, 12521, 12531, 12504, 12463, 12479, 12540, 12523, + 12506, 12477, 12506, 12491, 12498, 12504, 12523, 12484, + 12506, 12531, 12473, 12506, 12540, 12472, 12505, 12540, + 12479, 12509, 12452, 12531, 12488, 12508, 12523, 12488, + 12507, 12531, 12509, 12531, 12489, 12507, 12540, 12523, + 12507, 12540, 12531, 12510, 12452, 12463, 12525, 12510, + 12452, 12523, 12510, 12483, 12495, 12510, 12523, 12463, + 12510, 12531, 12471, 12519, 12531, 12511, 12463, 12525, + 12531, 12511, 12522, 12511, 12522, 12496, 12540, 12523, + 12513, 12460, 12513, 12460, 12488, 12531, 12513, 12540, + 12488, 12523, 12516, 12540, 12489, 12516, 12540, 12523, + 12518, 12450, 12531, 12522, 12483, 12488, 12523, 12522, + 12521, 12523, 12500, 12540, 12523, 12540, 12502, 12523, + 12524, 12512, 12524, 12531, 12488, 12466, 12531, 12527, + 12483, 12488, 48, 28857, 49, 28857, 50, 28857, + 51, 28857, 52, 28857, 53, 28857, 54, 28857, + 55, 28857, 56, 28857, 57, 28857, 49, 48, + 28857, 49, 49, 28857, 49, 50, 28857, 49, + 51, 28857, 49, 52, 28857, 49, 53, 28857, + 49, 54, 28857, 49, 55, 28857, 49, 56, + 28857, 49, 57, 28857, 50, 48, 28857, 50, + 49, 28857, 50, 50, 28857, 50, 51, 28857, + 50, 52, 28857, 104, 80, 97, 100, 97, + 65, 85, 98, 97, 114, 111, 86, 112, + 99, 100, 109, 100, 109, 178, 100, 109, + 179, 73, 85, 24179, 25104, 26157, 21644, 22823, + 27491, 26126, 27835, 26666, 24335, 20250, 31038, 112, + 65, 110, 65, 956, 65, 109, 65, 107, + 65, 75, 66, 77, 66, 71, 66, 99, + 97, 108, 107, 99, 97, 108, 112, 70, + 110, 70, 956, 70, 956, 103, 109, 103, + 107, 103, 72, 122, 107, 72, 122, 77, + 72, 122, 71, 72, 122, 84, 72, 122, + 956, 8467, 109, 8467, 100, 8467, 107, 8467, + 102, 109, 110, 109, 956, 109, 109, 109, + 99, 109, 107, 109, 109, 109, 178, 99, + 109, 178, 109, 178, 107, 109, 178, 109, + 109, 179, 99, 109, 179, 109, 179, 107, + 109, 179, 109, 8725, 115, 109, 8725, 115, + 178, 80, 97, 107, 80, 97, 77, 80, + 97, 71, 80, 97, 114, 97, 100, 114, + 97, 100, 8725, 115, 114, 97, 100, 8725, + 115, 178, 112, 115, 110, 115, 956, 115, + 109, 115, 112, 86, 110, 86, 956, 86, + 109, 86, 107, 86, 77, 86, 112, 87, + 110, 87, 956, 87, 109, 87, 107, 87, + 77, 87, 107, 937, 77, 937, 97, 46, + 109, 46, 66, 113, 99, 99, 99, 100, + 67, 8725, 107, 103, 67, 111, 46, 100, + 66, 71, 121, 104, 97, 72, 80, 105, + 110, 75, 75, 75, 77, 107, 116, 108, + 109, 108, 110, 108, 111, 103, 108, 120, + 109, 98, 109, 105, 108, 109, 111, 108, + 80, 72, 112, 46, 109, 46, 80, 80, + 77, 80, 82, 115, 114, 83, 118, 87, + 98, 86, 8725, 109, 65, 8725, 109, 49, + 26085, 50, 26085, 51, 26085, 52, 26085, 53, + 26085, 54, 26085, 55, 26085, 56, 26085, 57, + 26085, 49, 48, 26085, 49, 49, 26085, 49, + 50, 26085, 49, 51, 26085, 49, 52, 26085, + 49, 53, 26085, 49, 54, 26085, 49, 55, + 26085, 49, 56, 26085, 49, 57, 26085, 50, + 48, 26085, 50, 49, 26085, 50, 50, 26085, + 50, 51, 26085, 50, 52, 26085, 50, 53, + 26085, 50, 54, 26085, 50, 55, 26085, 50, + 56, 26085, 50, 57, 26085, 51, 48, 26085, + 51, 49, 26085, 103, 97, 108, 42561, 42563, + 42565, 42567, 42569, 42573, 42575, 42577, 42579, 42581, + 42583, 42585, 42587, 42589, 42591, 42593, 42595, 42597, + 42599, 42601, 42603, 42605, 42625, 42627, 42629, 42631, + 42633, 42635, 42637, 42639, 42641, 42643, 42645, 42647, + 42649, 42651, 42787, 42789, 42791, 42793, 42795, 42797, + 42799, 42803, 42805, 42807, 42809, 42811, 42813, 42815, + 42817, 42819, 42821, 42823, 42825, 42827, 42829, 42831, + 42833, 42835, 42837, 42839, 42841, 42843, 42845, 42847, + 42849, 42851, 42853, 42855, 42857, 42859, 42861, 42863, + 42874, 42876, 7545, 42879, 42881, 42883, 42885, 42887, + 42892, 42897, 42899, 42903, 42905, 42907, 42909, 42911, + 42913, 42915, 42917, 42919, 42921, 620, 670, 647, + 43859, 42933, 42935, 294, 43831, 43858, 5024, 5025, + 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, + 5034, 5035, 5036, 5037, 5038, 5039, 5040, 5041, + 5042, 5043, 5044, 5045, 5046, 5047, 5048, 5049, + 5050, 5051, 5052, 5053, 5054, 5055, 5056, 5057, + 5058, 5059, 5060, 5061, 5062, 5063, 5064, 5065, + 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, + 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, + 5082, 5083, 5084, 5085, 5086, 5087, 5088, 5089, + 5090, 5091, 5092, 5093, 5094, 5095, 5096, 5097, + 5098, 5099, 5100, 5101, 5102, 5103, 35912, 26356, + 36040, 28369, 20018, 21477, 22865, 21895, 22856, 25078, + 30313, 32645, 34367, 34746, 35064, 37007, 27138, 27931, + 28889, 29662, 33853, 37226, 39409, 20098, 21365, 27396, + 29211, 34349, 40478, 23888, 28651, 34253, 35172, 25289, + 33240, 34847, 24266, 26391, 28010, 29436, 37070, 20358, + 20919, 21214, 25796, 27347, 29200, 30439, 34310, 34396, + 36335, 38706, 39791, 40442, 30860, 31103, 32160, 33737, + 37636, 35542, 22751, 24324, 31840, 32894, 29282, 30922, + 36034, 38647, 22744, 23650, 27155, 28122, 28431, 32047, + 32311, 38475, 21202, 32907, 20956, 20940, 31260, 32190, + 33777, 38517, 35712, 25295, 35582, 20025, 23527, 24594, + 29575, 30064, 21271, 30971, 20415, 24489, 19981, 27852, + 25976, 32034, 21443, 22622, 30465, 33865, 35498, 27578, + 27784, 25342, 33509, 25504, 30053, 20142, 20841, 20937, + 26753, 31975, 33391, 35538, 37327, 21237, 21570, 24300, + 26053, 28670, 31018, 38317, 39530, 40599, 40654, 26310, + 27511, 36706, 24180, 24976, 25088, 25754, 28451, 29001, + 29833, 31178, 32244, 32879, 36646, 34030, 36899, 37706, + 21015, 21155, 21693, 28872, 35010, 24265, 24565, 25467, + 27566, 31806, 29557, 20196, 22265, 23994, 24604, 29618, + 29801, 32666, 32838, 37428, 38646, 38728, 38936, 20363, + 31150, 37300, 38584, 24801, 20102, 20698, 23534, 23615, + 26009, 29134, 30274, 34044, 36988, 26248, 38446, 21129, + 26491, 26611, 27969, 28316, 29705, 30041, 30827, 32016, + 39006, 25134, 38520, 20523, 23833, 28138, 36650, 24459, + 24900, 26647, 38534, 21033, 21519, 23653, 26131, 26446, + 26792, 27877, 29702, 30178, 32633, 35023, 35041, 38626, + 21311, 28346, 21533, 29136, 29848, 34298, 38563, 40023, + 40607, 26519, 28107, 33256, 31520, 31890, 29376, 28825, + 35672, 20160, 33590, 21050, 20999, 24230, 25299, 31958, + 23429, 27934, 26292, 36667, 38477, 24275, 20800, 21952, + 22618, 26228, 20958, 29482, 30410, 31036, 31070, 31077, + 31119, 38742, 31934, 34322, 35576, 36920, 37117, 39151, + 39164, 39208, 40372, 37086, 38583, 20398, 20711, 20813, + 21193, 21220, 21329, 21917, 22022, 22120, 22592, 22696, + 23652, 24724, 24936, 24974, 25074, 25935, 26082, 26257, + 26757, 28023, 28186, 28450, 29038, 29227, 29730, 30865, + 31049, 31048, 31056, 31062, 31117, 31118, 31296, 31361, + 31680, 32265, 32321, 32626, 32773, 33261, 33401, 33879, + 35088, 35222, 35585, 35641, 36051, 36104, 36790, 38627, + 38911, 38971, 24693, 55376, 57070, 33304, 20006, 20917, + 20840, 20352, 20805, 20864, 21191, 21242, 21845, 21913, + 21986, 22707, 22852, 22868, 23138, 23336, 24274, 24281, + 24425, 24493, 24792, 24910, 24840, 24928, 25140, 25540, + 25628, 25682, 25942, 26395, 26454, 28379, 28363, 28702, + 30631, 29237, 29359, 29809, 29958, 30011, 30237, 30239, + 30427, 30452, 30538, 30528, 30924, 31409, 31867, 32091, + 32574, 33618, 33775, 34681, 35137, 35206, 35519, 35531, + 35565, 35722, 36664, 36978, 37273, 37494, 38524, 38875, + 38923, 39698, 55370, 56394, 55370, 56388, 55372, 57301, + 15261, 16408, 16441, 55380, 56905, 55383, 56528, 55391, + 57043, 40771, 40846, 102, 102, 102, 105, 102, + 108, 102, 102, 105, 102, 102, 108, 383, + 116, 115, 116, 1396, 1398, 1396, 1381, 1396, + 1387, 1406, 1398, 1396, 1389, 1497, 1460, 1522, + 1463, 1506, 1492, 1499, 1500, 1501, 1512, 1514, + 1513, 1473, 1513, 1474, 64329, 1473, 64329, 1474, + 1488, 1463, 1488, 1464, 1488, 1468, 1489, 1468, + 1490, 1468, 1491, 1468, 1492, 1468, 1493, 1468, + 1494, 1468, 1496, 1468, 1497, 1468, 1498, 1468, + 1499, 1468, 1500, 1468, 1502, 1468, 1504, 1468, + 1505, 1468, 1507, 1468, 1508, 1468, 1510, 1468, + 1511, 1468, 1512, 1468, 1513, 1468, 1514, 1468, + 1493, 1465, 1489, 1471, 1499, 1471, 1508, 1471, + 1488, 1500, 1649, 1659, 1662, 1664, 1658, 1663, + 1657, 1700, 1702, 1668, 1667, 1670, 1671, 1677, + 1676, 1678, 1672, 1688, 1681, 1705, 1711, 1715, + 1713, 1722, 1723, 1728, 1729, 1726, 1746, 1747, + 1709, 1735, 1734, 1736, 1655, 1739, 1733, 1737, + 1744, 1609, 1574, 1575, 1574, 1749, 1574, 1608, + 1574, 1735, 1574, 1734, 1574, 1736, 1574, 1744, + 1574, 1609, 1740, 1574, 1580, 1574, 1581, 1574, + 1605, 1574, 1610, 1576, 1580, 1576, 1581, 1576, + 1582, 1576, 1605, 1576, 1609, 1576, 1610, 1578, + 1580, 1578, 1581, 1578, 1582, 1578, 1605, 1578, + 1609, 1578, 1610, 1579, 1580, 1579, 1605, 1579, + 1609, 1579, 1610, 1580, 1581, 1580, 1605, 1581, + 1580, 1581, 1605, 1582, 1580, 1582, 1581, 1582, + 1605, 1587, 1580, 1587, 1581, 1587, 1582, 1587, + 1605, 1589, 1581, 1589, 1605, 1590, 1580, 1590, + 1581, 1590, 1582, 1590, 1605, 1591, 1581, 1591, + 1605, 1592, 1605, 1593, 1580, 1593, 1605, 1594, + 1580, 1594, 1605, 1601, 1580, 1601, 1581, 1601, + 1582, 1601, 1605, 1601, 1609, 1601, 1610, 1602, + 1581, 1602, 1605, 1602, 1609, 1602, 1610, 1603, + 1575, 1603, 1580, 1603, 1581, 1603, 1582, 1603, + 1604, 1603, 1605, 1603, 1609, 1603, 1610, 1604, + 1580, 1604, 1581, 1604, 1582, 1604, 1605, 1604, + 1609, 1604, 1610, 1605, 1580, 1605, 1581, 1605, + 1582, 1605, 1605, 1605, 1609, 1605, 1610, 1606, + 1580, 1606, 1581, 1606, 1582, 1606, 1605, 1606, + 1609, 1606, 1610, 1607, 1580, 1607, 1605, 1607, + 1609, 1607, 1610, 1610, 1580, 1610, 1581, 1610, + 1582, 1610, 1605, 1610, 1609, 1610, 1610, 1584, + 1648, 1585, 1648, 1609, 1648, 32, 1612, 1617, + 32, 1613, 1617, 32, 1614, 1617, 32, 1615, + 1617, 32, 1616, 1617, 32, 1617, 1648, 1574, + 1585, 1574, 1586, 1574, 1606, 1576, 1585, 1576, + 1586, 1576, 1606, 1578, 1585, 1578, 1586, 1578, + 1606, 1579, 1585, 1579, 1586, 1579, 1606, 1605, + 1575, 1606, 1585, 1606, 1586, 1606, 1606, 1610, + 1585, 1610, 1586, 1610, 1606, 1574, 1582, 1574, + 1607, 1576, 1607, 1578, 1607, 1589, 1582, 1604, + 1607, 1606, 1607, 1607, 1648, 1610, 1607, 1579, + 1607, 1587, 1607, 1588, 1605, 1588, 1607, 1600, + 1614, 1617, 1600, 1615, 1617, 1600, 1616, 1617, + 1591, 1609, 1591, 1610, 1593, 1609, 1593, 1610, + 1594, 1609, 1594, 1610, 1587, 1609, 1587, 1610, + 1588, 1609, 1588, 1610, 1581, 1609, 1581, 1610, + 1580, 1609, 1580, 1610, 1582, 1609, 1582, 1610, + 1589, 1609, 1589, 1610, 1590, 1609, 1590, 1610, + 1588, 1580, 1588, 1581, 1588, 1582, 1588, 1585, + 1587, 1585, 1589, 1585, 1590, 1585, 1575, 1611, + 1578, 1580, 1605, 1578, 1581, 1580, 1578, 1581, + 1605, 1578, 1582, 1605, 1578, 1605, 1580, 1578, + 1605, 1581, 1578, 1605, 1582, 1580, 1605, 1581, + 1581, 1605, 1610, 1581, 1605, 1609, 1587, 1581, + 1580, 1587, 1580, 1581, 1587, 1580, 1609, 1587, + 1605, 1581, 1587, 1605, 1580, 1587, 1605, 1605, + 1589, 1581, 1581, 1589, 1605, 1605, 1588, 1581, + 1605, 1588, 1580, 1610, 1588, 1605, 1582, 1588, + 1605, 1605, 1590, 1581, 1609, 1590, 1582, 1605, + 1591, 1605, 1581, 1591, 1605, 1605, 1591, 1605, + 1610, 1593, 1580, 1605, 1593, 1605, 1605, 1593, + 1605, 1609, 1594, 1605, 1605, 1594, 1605, 1610, + 1594, 1605, 1609, 1601, 1582, 1605, 1602, 1605, + 1581, 1602, 1605, 1605, 1604, 1581, 1605, 1604, + 1581, 1610, 1604, 1581, 1609, 1604, 1580, 1580, + 1604, 1582, 1605, 1604, 1605, 1581, 1605, 1581, + 1580, 1605, 1581, 1605, 1605, 1581, 1610, 1605, + 1580, 1581, 1605, 1580, 1605, 1605, 1582, 1580, + 1605, 1582, 1605, 1605, 1580, 1582, 1607, 1605, + 1580, 1607, 1605, 1605, 1606, 1581, 1605, 1606, + 1581, 1609, 1606, 1580, 1605, 1606, 1580, 1609, + 1606, 1605, 1610, 1606, 1605, 1609, 1610, 1605, + 1605, 1576, 1582, 1610, 1578, 1580, 1610, 1578, + 1580, 1609, 1578, 1582, 1610, 1578, 1582, 1609, + 1578, 1605, 1610, 1578, 1605, 1609, 1580, 1605, + 1610, 1580, 1581, 1609, 1580, 1605, 1609, 1587, + 1582, 1609, 1589, 1581, 1610, 1588, 1581, 1610, + 1590, 1581, 1610, 1604, 1580, 1610, 1604, 1605, + 1610, 1610, 1581, 1610, 1610, 1580, 1610, 1610, + 1605, 1610, 1605, 1605, 1610, 1602, 1605, 1610, + 1606, 1581, 1610, 1593, 1605, 1610, 1603, 1605, + 1610, 1606, 1580, 1581, 1605, 1582, 1610, 1604, + 1580, 1605, 1603, 1605, 1605, 1580, 1581, 1610, + 1581, 1580, 1610, 1605, 1580, 1610, 1601, 1605, + 1610, 1576, 1581, 1610, 1587, 1582, 1610, 1606, + 1580, 1610, 1589, 1604, 1746, 1602, 1604, 1746, + 1575, 1604, 1604, 1607, 1575, 1603, 1576, 1585, + 1605, 1581, 1605, 1583, 1589, 1604, 1593, 1605, + 1585, 1587, 1608, 1604, 1593, 1604, 1610, 1607, + 1608, 1587, 1604, 1605, 1589, 1604, 1609, 17, + 1589, 1604, 1609, 32, 1575, 1604, 1604, 1607, + 32, 1593, 1604, 1610, 1607, 32, 1608, 1587, + 1604, 1605, 7, 1580, 1604, 32, 1580, 1604, + 1575, 1604, 1607, 1585, 1740, 1575, 1604, 44, + 12289, 12290, 58, 33, 63, 12310, 12311, 8230, + 8229, 8212, 8211, 95, 123, 125, 12308, 12309, + 12304, 12305, 12298, 12299, 12300, 12301, 12302, 12303, + 91, 93, 8254, 35, 38, 42, 45, 60, + 62, 92, 36, 37, 64, 32, 1611, 1600, + 1611, 32, 1612, 32, 1613, 32, 1614, 1600, + 1614, 32, 1615, 1600, 1615, 32, 1616, 1600, + 1616, 32, 1617, 1600, 1617, 32, 1618, 1600, + 1618, 1569, 1570, 1571, 1572, 1573, 1574, 1575, + 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, + 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, + 1592, 1593, 1594, 1601, 1602, 1603, 1604, 1605, + 1606, 1607, 1608, 1610, 1604, 1570, 1604, 1571, + 1604, 1573, 1604, 1575, 34, 39, 47, 65345, + 65346, 65347, 65348, 65349, 65350, 65351, 65352, 65353, + 65354, 65355, 65356, 65357, 65358, 65359, 65360, 65361, + 65362, 65363, 65364, 65365, 65366, 65367, 65368, 65369, + 65370, 94, 124, 126, 10629, 10630, 12539, 12449, + 12451, 12453, 12455, 12457, 12515, 12517, 12519, 12483, + 12540, 12531, 12441, 12442, 12644, 12593, 12594, 12595, + 12596, 12597, 12598, 12599, 12600, 12601, 12602, 12603, + 12604, 12605, 12606, 12607, 12608, 12609, 12610, 12611, + 12612, 12613, 12614, 12615, 12616, 12617, 12618, 12619, + 12620, 12621, 12622, 12623, 12624, 12625, 12626, 12627, + 12628, 12629, 12630, 12631, 12632, 12633, 12634, 12635, + 12636, 12637, 12638, 12639, 12640, 12641, 12642, 12643, + 162, 163, 172, 175, 166, 165, 8361, 9474, + 8592, 8593, 8594, 8595, 9632, 9675, 55297, 56360, + 55297, 56361, 55297, 56362, 55297, 56363, 55297, 56364, + 55297, 56365, 55297, 56366, 55297, 56367, 55297, 56368, + 55297, 56369, 55297, 56370, 55297, 56371, 55297, 56372, + 55297, 56373, 55297, 56374, 55297, 56375, 55297, 56376, + 55297, 56377, 55297, 56378, 55297, 56379, 55297, 56380, + 55297, 56381, 55297, 56382, 55297, 56383, 55297, 56384, + 55297, 56385, 55297, 56386, 55297, 56387, 55297, 56388, + 55297, 56389, 55297, 56390, 55297, 56391, 55297, 56392, + 55297, 56393, 55297, 56394, 55297, 56395, 55297, 56396, + 55297, 56397, 55297, 56398, 55297, 56399, 55297, 56536, + 55297, 56537, 55297, 56538, 55297, 56539, 55297, 56540, + 55297, 56541, 55297, 56542, 55297, 56543, 55297, 56544, + 55297, 56545, 55297, 56546, 55297, 56547, 55297, 56548, + 55297, 56549, 55297, 56550, 55297, 56551, 55297, 56552, + 55297, 56553, 55297, 56554, 55297, 56555, 55297, 56556, + 55297, 56557, 55297, 56558, 55297, 56559, 55297, 56560, + 55297, 56561, 55297, 56562, 55297, 56563, 55297, 56564, + 55297, 56565, 55297, 56566, 55297, 56567, 55297, 56568, + 55297, 56569, 55297, 56570, 55297, 56571, 55299, 56512, + 55299, 56513, 55299, 56514, 55299, 56515, 55299, 56516, + 55299, 56517, 55299, 56518, 55299, 56519, 55299, 56520, + 55299, 56521, 55299, 56522, 55299, 56523, 55299, 56524, + 55299, 56525, 55299, 56526, 55299, 56527, 55299, 56528, + 55299, 56529, 55299, 56530, 55299, 56531, 55299, 56532, + 55299, 56533, 55299, 56534, 55299, 56535, 55299, 56536, + 55299, 56537, 55299, 56538, 55299, 56539, 55299, 56540, + 55299, 56541, 55299, 56542, 55299, 56543, 55299, 56544, + 55299, 56545, 55299, 56546, 55299, 56547, 55299, 56548, + 55299, 56549, 55299, 56550, 55299, 56551, 55299, 56552, + 55299, 56553, 55299, 56554, 55299, 56555, 55299, 56556, + 55299, 56557, 55299, 56558, 55299, 56559, 55299, 56560, + 55299, 56561, 55299, 56562, 55300, 56473, 55300, 56506, + 55300, 56475, 55300, 56506, 55300, 56485, 55300, 56506, + 55300, 56625, 55300, 56615, 55300, 56626, 55300, 56615, + 55300, 57159, 55300, 57150, 55300, 57159, 55300, 57175, + 55301, 56505, 55301, 56506, 55301, 56505, 55301, 56496, + 55301, 56505, 55301, 56509, 55301, 56760, 55301, 56751, + 55301, 56761, 55301, 56751, 55302, 56512, 55302, 56513, + 55302, 56514, 55302, 56515, 55302, 56516, 55302, 56517, + 55302, 56518, 55302, 56519, 55302, 56520, 55302, 56521, + 55302, 56522, 55302, 56523, 55302, 56524, 55302, 56525, + 55302, 56526, 55302, 56527, 55302, 56528, 55302, 56529, + 55302, 56530, 55302, 56531, 55302, 56532, 55302, 56533, + 55302, 56534, 55302, 56535, 55302, 56536, 55302, 56537, + 55302, 56538, 55302, 56539, 55302, 56540, 55302, 56541, + 55302, 56542, 55302, 56543, 55348, 56663, 55348, 56677, + 55348, 56664, 55348, 56677, 55348, 56671, 55348, 56686, + 55348, 56671, 55348, 56687, 55348, 56671, 55348, 56688, + 55348, 56671, 55348, 56689, 55348, 56671, 55348, 56690, + 55348, 56761, 55348, 56677, 55348, 56762, 55348, 56677, + 55348, 56763, 55348, 56686, 55348, 56764, 55348, 56686, + 55348, 56763, 55348, 56687, 55348, 56764, 55348, 56687, + 305, 567, 913, 914, 916, 917, 918, 919, + 921, 922, 923, 924, 925, 926, 927, 929, + 1012, 932, 934, 935, 936, 8711, 8706, 1013, + 977, 1008, 981, 1009, 982, 988, 55354, 56610, + 55354, 56611, 55354, 56612, 55354, 56613, 55354, 56614, + 55354, 56615, 55354, 56616, 55354, 56617, 55354, 56618, + 55354, 56619, 55354, 56620, 55354, 56621, 55354, 56622, + 55354, 56623, 55354, 56624, 55354, 56625, 55354, 56626, + 55354, 56627, 55354, 56628, 55354, 56629, 55354, 56630, + 55354, 56631, 55354, 56632, 55354, 56633, 55354, 56634, + 55354, 56635, 55354, 56636, 55354, 56637, 55354, 56638, + 55354, 56639, 55354, 56640, 55354, 56641, 55354, 56642, + 55354, 56643, 1646, 1697, 1647, 48, 46, 48, + 44, 49, 44, 50, 44, 51, 44, 52, + 44, 53, 44, 54, 44, 55, 44, 56, + 44, 57, 44, 40, 65, 41, 40, 66, + 41, 40, 67, 41, 40, 68, 41, 40, + 69, 41, 40, 70, 41, 40, 71, 41, + 40, 72, 41, 40, 73, 41, 40, 74, + 41, 40, 75, 41, 40, 76, 41, 40, + 77, 41, 40, 78, 41, 40, 79, 41, + 40, 80, 41, 40, 81, 41, 40, 82, + 41, 40, 83, 41, 40, 84, 41, 40, + 85, 41, 40, 86, 41, 40, 87, 41, + 40, 88, 41, 40, 89, 41, 40, 90, + 41, 12308, 83, 12309, 67, 68, 87, 90, + 72, 86, 83, 68, 83, 83, 80, 80, + 86, 87, 67, 77, 67, 77, 68, 68, + 74, 12411, 12363, 12467, 12467, 23383, 21452, 12487, + 22810, 35299, 20132, 26144, 28961, 21069, 24460, 20877, + 26032, 21021, 32066, 36009, 22768, 21561, 28436, 25237, + 25429, 36938, 25351, 25171, 31105, 31354, 21512, 28288, + 30003, 21106, 21942, 37197, 12308, 26412, 12309, 12308, + 19977, 12309, 12308, 20108, 12309, 12308, 23433, 12309, + 12308, 28857, 12309, 12308, 25171, 12309, 12308, 30423, + 12309, 12308, 21213, 12309, 12308, 25943, 12309, 24471, + 21487, 20029, 20024, 20033, 55360, 56610, 20320, 20411, + 20482, 20602, 20633, 20687, 13470, 55361, 56890, 20820, + 20836, 20855, 55361, 56604, 13497, 20839, 55361, 56651, + 20887, 20900, 20172, 20908, 55396, 56799, 20995, 13535, + 21051, 21062, 21111, 13589, 21253, 21254, 21321, 21338, + 21363, 21373, 21375, 55362, 56876, 28784, 21450, 21471, + 55362, 57187, 21483, 21489, 21510, 21662, 21560, 21576, + 21608, 21666, 21750, 21776, 21843, 21859, 21892, 21931, + 21939, 21954, 22294, 22295, 22097, 22132, 22766, 22478, + 22516, 22541, 22411, 22578, 22577, 22700, 55365, 56548, + 22770, 22775, 22790, 22818, 22882, 55365, 57000, 55365, + 57066, 23020, 23067, 23079, 23000, 23142, 14062, 14076, + 23304, 23358, 55366, 56776, 23491, 23512, 23539, 55366, + 57112, 23551, 23558, 24403, 14209, 23648, 23744, 23693, + 55367, 56804, 23875, 55367, 56806, 23918, 23915, 23932, + 24033, 24034, 14383, 24061, 24104, 24125, 24169, 14434, + 55368, 56707, 14460, 24240, 24243, 24246, 55400, 57234, + 55368, 57137, 33281, 24354, 14535, 55372, 57016, 55384, + 56794, 24418, 24427, 14563, 24474, 24525, 24535, 24569, + 24705, 14650, 14620, 55369, 57044, 24775, 24904, 24908, + 24954, 25010, 24996, 25007, 25054, 25104, 25115, 25181, + 25265, 25300, 25424, 55370, 57100, 25405, 25340, 25448, + 25475, 25572, 55370, 57329, 25634, 25541, 25513, 14894, + 25705, 25726, 25757, 25719, 14956, 25964, 55372, 56330, + 26083, 26360, 26185, 15129, 15112, 15076, 20882, 20885, + 26368, 26268, 32941, 17369, 26401, 26462, 26451, 55372, + 57283, 15177, 26618, 26501, 26706, 55373, 56429, 26766, + 26655, 26900, 26946, 27043, 27114, 27304, 55373, 56995, + 27355, 15384, 27425, 55374, 56487, 27476, 15438, 27506, + 27551, 27579, 55374, 56973, 55367, 56587, 55374, 57082, + 27726, 55375, 56508, 27839, 27853, 27751, 27926, 27966, + 28009, 28024, 28037, 55375, 56606, 27956, 28207, 28270, + 15667, 28359, 55375, 57041, 28153, 28526, 55375, 57182, + 55375, 57230, 28614, 28729, 28699, 15766, 28746, 28797, + 28791, 28845, 55361, 56613, 28997, 55376, 56931, 29084, + 55376, 57259, 29224, 29264, 55377, 56840, 29312, 29333, + 55377, 57141, 55378, 56340, 29562, 29579, 16044, 29605, + 16056, 29767, 29788, 29829, 29898, 16155, 29988, 55379, + 56374, 30014, 55379, 56466, 55368, 56735, 30224, 55379, + 57249, 55379, 57272, 55380, 56388, 16380, 16392, 55380, + 56563, 55380, 56562, 55380, 56601, 55380, 56627, 30494, + 30495, 30603, 16454, 16534, 55381, 56349, 30798, 16611, + 55381, 56870, 55381, 56986, 55381, 57029, 31211, 16687, + 31306, 31311, 55382, 56700, 55382, 56999, 31470, 16898, + 55382, 57259, 31686, 31689, 16935, 55383, 56448, 31954, + 17056, 31976, 31971, 32000, 55383, 57222, 32099, 17153, + 32199, 32258, 32325, 17204, 55384, 56872, 55384, 56903, + 17241, 55384, 57049, 32634, 55384, 57150, 32661, 32762, + 55385, 56538, 55385, 56611, 32864, 55385, 56744, 32880, + 55372, 57183, 17365, 32946, 33027, 17419, 33086, 23221, + 55385, 57255, 55385, 57269, 55372, 57235, 55372, 57244, + 33284, 36766, 17515, 33425, 33419, 33437, 21171, 33457, + 33459, 33469, 33510, 55386, 57148, 33565, 33635, 33709, + 33571, 33725, 33767, 33619, 33738, 33740, 33756, 55387, + 56374, 55387, 56683, 55387, 56533, 17707, 34033, 34035, + 34070, 55388, 57290, 34148, 55387, 57132, 17757, 17761, + 55387, 57265, 55388, 56530, 17771, 34384, 34407, 34409, + 34473, 34440, 34574, 34530, 34600, 34667, 34694, 17879, + 34785, 34817, 17913, 34912, 55389, 56935, 35031, 35038, + 17973, 35066, 13499, 55390, 56494, 55390, 56678, 18110, + 18119, 35488, 55391, 56488, 36011, 36033, 36123, 36215, + 55391, 57135, 55362, 56324, 36299, 36284, 36336, 55362, + 56542, 36564, 55393, 56786, 55393, 56813, 37012, 37105, + 37137, 55393, 57134, 37147, 37432, 37591, 37592, 37500, + 37881, 37909, 55394, 57338, 38283, 18837, 38327, 55395, + 56695, 18918, 38595, 23986, 38691, 55396, 56645, 55396, + 56858, 19054, 19062, 38880, 55397, 56330, 19122, 55397, + 56470, 38953, 55397, 56758, 39138, 19251, 39209, 39335, + 39362, 39422, 19406, 55398, 57136, 40000, 40189, 19662, + 19693, 40295, 55400, 56526, 19704, 55400, 56581, 55400, + 56846, 55400, 56977, 19798, 40702, 40709, 40719, 40726, + 55401, 56832, 192, 193, 194, 195, 196, 199, + 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 216, + 217, 218, 219, 220, 221, 222, 376, 256, + 258, 260, 262, 264, 266, 268, 270, 272, + 274, 276, 278, 280, 282, 284, 286, 288, + 290, 292, 296, 298, 300, 302, 306, 308, + 310, 313, 315, 317, 319, 321, 323, 325, + 327, 330, 332, 334, 336, 338, 340, 342, + 344, 346, 348, 350, 352, 354, 356, 358, + 360, 362, 364, 366, 368, 370, 372, 374, + 377, 379, 381, 579, 386, 388, 391, 395, + 401, 502, 408, 573, 544, 416, 418, 420, + 423, 428, 431, 435, 437, 440, 444, 503, + 453, 452, 456, 455, 459, 458, 461, 463, + 465, 467, 469, 471, 473, 475, 478, 480, + 482, 484, 486, 488, 490, 492, 494, 498, + 497, 500, 504, 506, 508, 510, 512, 514, + 516, 518, 520, 522, 524, 526, 528, 530, + 532, 534, 536, 538, 540, 542, 548, 550, + 552, 554, 556, 558, 560, 562, 571, 11390, + 11391, 577, 582, 584, 586, 588, 590, 11375, + 11373, 11376, 385, 390, 393, 394, 399, 42923, + 403, 42924, 404, 42893, 42922, 407, 406, 42926, + 11362, 42925, 412, 11374, 413, 415, 11364, 422, + 425, 42929, 430, 580, 433, 434, 581, 439, + 42930, 42928, 880, 882, 886, 1021, 1022, 1023, + 938, 939, 975, 984, 986, 990, 992, 994, + 996, 998, 1000, 1002, 1004, 1006, 1017, 895, + 1015, 1018, 1040, 1041, 1042, 1043, 1044, 1045, + 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, + 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, + 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, + 1038, 1039, 1120, 1122, 1124, 1126, 1128, 1130, + 1132, 1134, 1136, 1138, 1140, 1142, 1144, 1146, + 1148, 1150, 1152, 1162, 1164, 1166, 1168, 1170, + 1172, 1174, 1176, 1178, 1180, 1182, 1184, 1186, + 1188, 1190, 1192, 1194, 1196, 1198, 1200, 1202, + 1204, 1206, 1208, 1210, 1212, 1214, 1217, 1219, + 1221, 1223, 1225, 1227, 1229, 1216, 1232, 1234, + 1236, 1238, 1240, 1242, 1244, 1246, 1248, 1250, + 1252, 1254, 1256, 1258, 1260, 1262, 1264, 1266, + 1268, 1270, 1272, 1274, 1276, 1278, 1280, 1282, + 1284, 1286, 1288, 1290, 1292, 1294, 1296, 1298, + 1300, 1302, 1304, 1306, 1308, 1310, 1312, 1314, + 1316, 1318, 1320, 1322, 1324, 1326, 1329, 1330, + 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, + 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, + 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, + 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, + 1363, 1364, 1365, 1366, 43888, 43889, 43890, 43891, + 43892, 43893, 43894, 43895, 43896, 43897, 43898, 43899, + 43900, 43901, 43902, 43903, 43904, 43905, 43906, 43907, + 43908, 43909, 43910, 43911, 43912, 43913, 43914, 43915, + 43916, 43917, 43918, 43919, 43920, 43921, 43922, 43923, + 43924, 43925, 43926, 43927, 43928, 43929, 43930, 43931, + 43932, 43933, 43934, 43935, 43936, 43937, 43938, 43939, + 43940, 43941, 43942, 43943, 43944, 43945, 43946, 43947, + 43948, 43949, 43950, 43951, 43952, 43953, 43954, 43955, + 43956, 43957, 43958, 43959, 43960, 43961, 43962, 43963, + 43964, 43965, 43966, 43967, 5112, 5113, 5114, 5115, + 5116, 5117, 42570, 42877, 11363, 7680, 7682, 7684, + 7686, 7688, 7690, 7692, 7694, 7696, 7698, 7700, + 7702, 7704, 7706, 7708, 7710, 7712, 7714, 7716, + 7718, 7720, 7722, 7724, 7726, 7728, 7730, 7732, + 7734, 7736, 7738, 7740, 7742, 7744, 7746, 7748, + 7750, 7752, 7754, 7756, 7758, 7760, 7762, 7764, + 7766, 7768, 7770, 7772, 7774, 7776, 7778, 7780, + 7782, 7784, 7786, 7788, 7790, 7792, 7794, 7796, + 7798, 7800, 7802, 7804, 7806, 7808, 7810, 7812, + 7814, 7816, 7818, 7820, 7822, 7824, 7826, 7828, + 7840, 7842, 7844, 7846, 7848, 7850, 7852, 7854, + 7856, 7858, 7860, 7862, 7864, 7866, 7868, 7870, + 7872, 7874, 7876, 7878, 7880, 7882, 7884, 7886, + 7888, 7890, 7892, 7894, 7896, 7898, 7900, 7902, + 7904, 7906, 7908, 7910, 7912, 7914, 7916, 7918, + 7920, 7922, 7924, 7926, 7928, 7930, 7932, 7934, + 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, + 7960, 7961, 7962, 7963, 7964, 7965, 7976, 7977, + 7978, 7979, 7980, 7981, 7982, 7983, 7992, 7993, + 7994, 7995, 7996, 7997, 7998, 7999, 8008, 8009, + 8010, 8011, 8012, 8013, 8025, 8027, 8029, 8031, + 8040, 8041, 8042, 8043, 8044, 8045, 8046, 8047, + 8122, 8123, 8136, 8137, 8138, 8139, 8154, 8155, + 8184, 8185, 8170, 8171, 8186, 8187, 8072, 8073, + 8074, 8075, 8076, 8077, 8078, 8079, 8088, 8089, + 8090, 8091, 8092, 8093, 8094, 8095, 8104, 8105, + 8106, 8107, 8108, 8109, 8110, 8111, 8120, 8121, + 8124, 8140, 8152, 8153, 8168, 8169, 8172, 8188, + 8498, 8544, 8545, 8546, 8547, 8548, 8549, 8550, + 8551, 8552, 8553, 8554, 8555, 8556, 8557, 8558, + 8559, 8579, 9398, 9399, 9400, 9401, 9402, 9403, + 9404, 9405, 9406, 9407, 9408, 9409, 9410, 9411, + 9412, 9413, 9414, 9415, 9416, 9417, 9418, 9419, + 9420, 9421, 9422, 9423, 11264, 11265, 11266, 11267, + 11268, 11269, 11270, 11271, 11272, 11273, 11274, 11275, + 11276, 11277, 11278, 11279, 11280, 11281, 11282, 11283, + 11284, 11285, 11286, 11287, 11288, 11289, 11290, 11291, + 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, + 11300, 11301, 11302, 11303, 11304, 11305, 11306, 11307, + 11308, 11309, 11310, 11360, 570, 574, 11367, 11369, + 11371, 11378, 11381, 11392, 11394, 11396, 11398, 11400, + 11402, 11404, 11406, 11408, 11410, 11412, 11414, 11416, + 11418, 11420, 11422, 11424, 11426, 11428, 11430, 11432, + 11434, 11436, 11438, 11440, 11442, 11444, 11446, 11448, + 11450, 11452, 11454, 11456, 11458, 11460, 11462, 11464, + 11466, 11468, 11470, 11472, 11474, 11476, 11478, 11480, + 11482, 11484, 11486, 11488, 11490, 11499, 11501, 11506, + 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, + 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, + 4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, + 4280, 4281, 4282, 4283, 4284, 4285, 4286, 4287, + 4288, 4289, 4290, 4291, 4292, 4293, 4295, 4301, + 42560, 42562, 42564, 42566, 42568, 42572, 42574, 42576, + 42578, 42580, 42582, 42584, 42586, 42588, 42590, 42592, + 42594, 42596, 42598, 42600, 42602, 42604, 42624, 42626, + 42628, 42630, 42632, 42634, 42636, 42638, 42640, 42642, + 42644, 42646, 42648, 42650, 42786, 42788, 42790, 42792, + 42794, 42796, 42798, 42802, 42804, 42806, 42808, 42810, + 42812, 42814, 42816, 42818, 42820, 42822, 42824, 42826, + 42828, 42830, 42832, 42834, 42836, 42838, 42840, 42842, + 42844, 42846, 42848, 42850, 42852, 42854, 42856, 42858, + 42860, 42862, 42873, 42875, 42878, 42880, 42882, 42884, + 42886, 42891, 42896, 42898, 42902, 42904, 42906, 42908, + 42910, 42912, 42914, 42916, 42918, 42920, 42932, 42934, + 42931, 65313, 65314, 65315, 65316, 65317, 65318, 65319, + 65320, 65321, 65322, 65323, 65324, 65325, 65326, 65327, + 65328, 65329, 65330, 65331, 65332, 65333, 65334, 65335, + 65336, 65337, 65338, 55297, 56320, 55297, 56321, 55297, + 56322, 55297, 56323, 55297, 56324, 55297, 56325, 55297, + 56326, 55297, 56327, 55297, 56328, 55297, 56329, 55297, + 56330, 55297, 56331, 55297, 56332, 55297, 56333, 55297, + 56334, 55297, 56335, 55297, 56336, 55297, 56337, 55297, + 56338, 55297, 56339, 55297, 56340, 55297, 56341, 55297, + 56342, 55297, 56343, 55297, 56344, 55297, 56345, 55297, + 56346, 55297, 56347, 55297, 56348, 55297, 56349, 55297, + 56350, 55297, 56351, 55297, 56352, 55297, 56353, 55297, + 56354, 55297, 56355, 55297, 56356, 55297, 56357, 55297, + 56358, 55297, 56359, 55297, 56496, 55297, 56497, 55297, + 56498, 55297, 56499, 55297, 56500, 55297, 56501, 55297, + 56502, 55297, 56503, 55297, 56504, 55297, 56505, 55297, + 56506, 55297, 56507, 55297, 56508, 55297, 56509, 55297, + 56510, 55297, 56511, 55297, 56512, 55297, 56513, 55297, + 56514, 55297, 56515, 55297, 56516, 55297, 56517, 55297, + 56518, 55297, 56519, 55297, 56520, 55297, 56521, 55297, + 56522, 55297, 56523, 55297, 56524, 55297, 56525, 55297, + 56526, 55297, 56527, 55297, 56528, 55297, 56529, 55297, + 56530, 55297, 56531, 55299, 56448, 55299, 56449, 55299, + 56450, 55299, 56451, 55299, 56452, 55299, 56453, 55299, + 56454, 55299, 56455, 55299, 56456, 55299, 56457, 55299, + 56458, 55299, 56459, 55299, 56460, 55299, 56461, 55299, + 56462, 55299, 56463, 55299, 56464, 55299, 56465, 55299, + 56466, 55299, 56467, 55299, 56468, 55299, 56469, 55299, + 56470, 55299, 56471, 55299, 56472, 55299, 56473, 55299, + 56474, 55299, 56475, 55299, 56476, 55299, 56477, 55299, + 56478, 55299, 56479, 55299, 56480, 55299, 56481, 55299, + 56482, 55299, 56483, 55299, 56484, 55299, 56485, 55299, + 56486, 55299, 56487, 55299, 56488, 55299, 56489, 55299, + 56490, 55299, 56491, 55299, 56492, 55299, 56493, 55299, + 56494, 55299, 56495, 55299, 56496, 55299, 56497, 55299, + 56498, 55302, 56480, 55302, 56481, 55302, 56482, 55302, + 56483, 55302, 56484, 55302, 56485, 55302, 56486, 55302, + 56487, 55302, 56488, 55302, 56489, 55302, 56490, 55302, + 56491, 55302, 56492, 55302, 56493, 55302, 56494, 55302, + 56495, 55302, 56496, 55302, 56497, 55302, 56498, 55302, + 56499, 55302, 56500, 55302, 56501, 55302, 56502, 55302, + 56503, 55302, 56504, 55302, 56505, 55302, 56506, 55302, + 56507, 55302, 56508, 55302, 56509, 55302, 56510, 55302, + 56511, 55354, 56576, 55354, 56577, 55354, 56578, 55354, + 56579, 55354, 56580, 55354, 56581, 55354, 56582, 55354, + 56583, 55354, 56584, 55354, 56585, 55354, 56586, 55354, + 56587, 55354, 56588, 55354, 56589, 55354, 56590, 55354, + 56591, 55354, 56592, 55354, 56593, 55354, 56594, 55354, + 56595, 55354, 56596, 55354, 56597, 55354, 56598, 55354, + 56599, 55354, 56600, 55354, 56601, 55354, 56602, 55354, + 56603, 55354, 56604, 55354, 56605, 55354, 56606, 55354, + 56607, 55354, 56608, 55354, 56609, }; + +static const utf8proc_uint16_t utf8proc_stage1table[] = { + 0, 256, 512, 768, 1024, 1280, 1536, + 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, + 3840, 4096, 4352, 4608, 4864, 5120, 5376, 5632, + 5888, 6144, 6400, 6656, 6912, 7168, 7424, 7680, + 7936, 8192, 8448, 8704, 8960, 9216, 9472, 9728, + 9984, 10240, 10496, 10752, 11008, 11264, 11520, 11776, + 12032, 12288, 12544, 12800, 13056, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13568, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13824, 14080, 13312, 13312, 13312, 14336, 13312, 14592, + 14848, 15104, 15360, 15616, 15872, 16128, 16384, 16640, + 16896, 17152, 17408, 17664, 16128, 16384, 16640, 16896, + 17152, 17408, 17664, 16128, 16384, 16640, 16896, 17152, + 17408, 17664, 16128, 16384, 16640, 16896, 17152, 17408, + 17664, 16128, 16384, 16640, 16896, 17152, 17408, 17664, + 16128, 16384, 16640, 16896, 17152, 17408, 17664, 16128, + 17920, 18176, 18176, 18176, 18176, 18176, 18176, 18176, + 18176, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18688, 18944, 19200, 19456, 19712, 19968, + 20224, 20480, 20736, 20992, 21248, 21504, 21760, 22016, + 22272, 22528, 22784, 23040, 23296, 23552, 23808, 24064, + 23808, 24320, 24576, 24832, 25088, 25344, 25600, 25856, + 26112, 26368, 23808, 26624, 23808, 26880, 23808, 23808, + 23808, 27136, 27136, 27136, 27392, 27648, 27904, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 27136, 27136, 27136, 27136, 28160, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 27136, 27136, 28416, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 27136, 27136, 28672, 28928, 23808, 23808, 23808, + 29184, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 29440, 13312, 13312, 29696, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 29952, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 30208, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 30464, 30720, 30976, 31232, 31488, 31744, 32000, + 32256, 10240, 10240, 32512, 23808, 23808, 23808, 23808, + 23808, 32768, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 33024, 33280, 23808, 23808, 23808, 23808, 33536, + 23808, 33792, 34048, 34304, 34560, 34816, 35072, 35328, + 35584, 35840, 36096, 23808, 23808, 23808, 23808, 23808, + 23808, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 36352, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 36608, 36864, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 13312, + 13312, 13312, 13312, 13312, 13312, 13312, 13312, 37120, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 37376, 37632, 37888, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 38144, 38400, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 23808, 23808, 23808, 23808, 23808, 23808, 23808, + 23808, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 38656, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 18432, 18432, 18432, 18432, 18432, 18432, 18432, 18432, + 38656, }; + +static const utf8proc_uint16_t utf8proc_stage2table[] = { + 1, 2, 2, 2, 2, 2, 2, + 2, 2, 3, 4, 3, 5, 6, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 7, 7, 7, + 3, 8, 9, 9, 10, 11, 10, 9, + 9, 12, 13, 9, 14, 15, 16, 15, + 15, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 15, 9, 18, 19, 20, + 9, 9, 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, 12, 9, 13, 47, + 48, 47, 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, 12, 75, 13, 75, + 2, 2, 2, 2, 2, 2, 7, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 76, 9, 11, 11, 11, 11, 77, + 9, 78, 77, 79, 80, 75, 81, 77, + 82, 83, 84, 85, 86, 87, 88, 9, + 9, 89, 90, 91, 92, 93, 94, 95, + 9, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, + 75, 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, + 75, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 214, 299, + 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 214, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 214, 214, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 214, 340, 341, 342, 214, + 343, 340, 340, 340, 340, 344, 345, 346, + 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, + 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 214, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 214, 214, 214, + 214, 214, 214, 455, 456, 457, 458, 459, + 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, + 476, 477, 478, 479, 480, 481, 214, 482, + 483, 214, 484, 214, 485, 486, 214, 214, + 214, 487, 488, 214, 489, 214, 490, 491, + 214, 492, 493, 494, 495, 496, 214, 214, + 497, 214, 498, 499, 214, 214, 500, 214, + 214, 214, 214, 214, 214, 214, 501, 214, + 214, 502, 214, 214, 503, 214, 214, 214, + 504, 505, 506, 507, 508, 509, 214, 214, + 214, 214, 214, 510, 214, 340, 214, 214, + 214, 214, 214, 214, 214, 214, 511, 512, + 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, + 214, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 522, 523, 523, 523, 523, + 523, 523, 523, 47, 47, 47, 47, 522, + 522, 522, 522, 522, 522, 522, 522, 522, + 522, 523, 523, 47, 47, 47, 47, 47, + 47, 524, 525, 526, 527, 528, 529, 47, + 47, 530, 531, 532, 533, 534, 47, 47, + 47, 47, 47, 47, 47, 522, 47, 523, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 540, 540, + 548, 540, 549, 540, 550, 551, 552, 553, + 553, 553, 553, 552, 554, 553, 553, 553, + 553, 553, 555, 555, 556, 557, 558, 559, + 560, 561, 553, 553, 553, 553, 562, 563, + 553, 564, 565, 553, 553, 566, 566, 566, + 566, 567, 553, 553, 553, 553, 540, 540, + 540, 568, 569, 570, 571, 572, 573, 540, + 553, 553, 553, 540, 540, 540, 553, 553, + 574, 540, 540, 540, 553, 553, 553, 553, + 540, 552, 553, 553, 540, 575, 576, 576, + 575, 576, 576, 575, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, + 540, 577, 578, 579, 580, 581, 47, 582, + 583, 0, 0, 584, 585, 586, 587, 588, + 589, 0, 0, 0, 0, 87, 590, 591, + 592, 593, 594, 595, 0, 596, 0, 597, + 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 0, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, + 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, + 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 75, + 700, 701, 702, 703, 704, 214, 705, 706, + 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, + 723, 724, 725, 726, 727, 728, 729, 730, + 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, + 747, 748, 749, 750, 751, 752, 753, 754, + 755, 756, 757, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, + 779, 780, 781, 782, 783, 784, 785, 786, + 787, 788, 789, 790, 791, 792, 793, 794, + 795, 796, 797, 798, 799, 800, 801, 802, + 803, 804, 805, 806, 807, 808, 809, 810, + 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, + 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 540, 540, 540, 540, + 540, 839, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, + 853, 854, 855, 856, 857, 858, 859, 860, + 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, + 877, 878, 879, 880, 881, 882, 883, 884, + 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, + 901, 902, 903, 904, 905, 906, 907, 908, + 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, + 925, 926, 927, 928, 929, 930, 931, 932, + 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, + 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, + 973, 974, 975, 976, 977, 978, 979, 980, + 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, + 997, 998, 999, 1000, 1001, 1002, 1003, 1004, + 1005, 0, 1006, 1007, 1008, 1009, 1010, 1011, + 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, + 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, + 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, + 0, 0, 523, 1044, 1044, 1044, 1044, 1044, + 1044, 0, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, + 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, + 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, + 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, + 1083, 0, 1044, 1084, 0, 0, 1085, 1085, + 11, 0, 553, 540, 540, 540, 540, 553, + 540, 540, 540, 1086, 553, 540, 540, 540, + 540, 540, 540, 553, 553, 553, 553, 553, + 553, 540, 540, 553, 540, 540, 1086, 1087, + 540, 1088, 1089, 1090, 1091, 1092, 1093, 1094, + 1095, 1096, 1097, 1097, 1098, 1099, 1100, 1101, + 1102, 1103, 1104, 1105, 1103, 540, 553, 1103, + 1096, 0, 0, 0, 0, 0, 0, 0, + 0, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 0, 0, 0, 0, + 0, 1106, 1106, 1106, 1103, 1103, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1107, 1108, 1108, 1108, 1107, 1107, 1109, + 1109, 1110, 10, 10, 1111, 15, 1112, 1085, + 1085, 540, 540, 540, 540, 540, 540, 540, + 540, 1113, 1114, 1115, 1112, 1116, 0, 1117, + 1112, 1118, 1118, 1119, 1120, 1121, 1122, 1123, + 1124, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1125, 1118, 1118, 1118, 1118, 1118, 1118, + 1126, 1127, 1118, 1128, 1129, 1130, 1131, 1113, + 1114, 1115, 1132, 1133, 1134, 1135, 1136, 553, + 540, 540, 540, 540, 540, 553, 540, 540, + 553, 1137, 1137, 1137, 1137, 1137, 1137, 1137, + 1137, 1137, 1137, 10, 1138, 1138, 1112, 1118, + 1118, 1139, 1118, 1118, 1118, 1118, 1140, 1141, + 1142, 1143, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1126, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1144, 1145, 1146, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1147, 1148, 1112, 1149, 540, + 540, 540, 540, 540, 540, 540, 1108, 1085, + 540, 540, 540, 540, 553, 540, 1125, 1125, + 540, 540, 1085, 553, 540, 540, 553, 1118, + 1118, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 1118, 1118, 1118, 1150, 1150, + 1126, 1117, 1117, 1117, 1117, 1117, 1117, 1117, + 1117, 1117, 1117, 1117, 1117, 1117, 1117, 0, + 1151, 1126, 1152, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 540, 553, 540, 540, 553, 540, 540, + 553, 553, 553, 540, 553, 553, 540, 553, + 540, 540, 540, 553, 540, 553, 540, 553, + 540, 553, 540, 540, 0, 0, 1126, 1126, + 1126, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1126, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1126, 1126, + 1126, 1118, 1118, 1118, 1118, 1118, 1118, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1118, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1154, 1154, 1154, 1154, 1154, 1154, 1154, + 1154, 1154, 1154, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 540, 540, 540, 540, + 540, 540, 540, 553, 540, 1155, 1155, 77, + 9, 9, 9, 1155, 0, 0, 0, 0, + 0, 1156, 1156, 1156, 1156, 1156, 1156, 1156, + 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, + 1156, 1156, 1156, 1156, 1156, 1156, 1156, 540, + 540, 540, 540, 1157, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 1157, 540, 540, + 540, 1157, 540, 540, 540, 540, 540, 0, + 0, 1158, 1158, 1158, 1158, 1158, 1158, 1158, + 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, + 0, 1156, 1156, 1156, 1156, 1156, 1156, 1156, + 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, + 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, + 1156, 1156, 553, 553, 553, 0, 0, 1158, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 0, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 1107, 553, 540, 540, 553, + 540, 540, 553, 540, 540, 540, 553, 553, + 553, 1129, 1130, 1131, 540, 540, 540, 553, + 540, 540, 553, 553, 540, 540, 540, 540, + 540, 1153, 1153, 1153, 1159, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1161, 1162, 1160, 1160, 1160, 1160, 1160, + 1160, 1163, 1164, 1160, 1165, 1166, 1160, 1160, + 1160, 1160, 1160, 1153, 1159, 1167, 1160, 1159, + 1159, 1159, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1159, 1159, 1159, 1159, 1168, 1159, + 1159, 1160, 540, 553, 540, 540, 1153, 1153, + 1153, 1169, 1170, 1171, 1172, 1173, 1174, 1175, + 1176, 1160, 1160, 1153, 1153, 1177, 1177, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1177, 1179, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1153, 1159, 1159, 0, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 0, 0, + 1160, 1160, 0, 0, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 0, 0, 0, 1160, + 1160, 1160, 1160, 0, 0, 1180, 1160, 1181, + 1159, 1159, 1153, 1153, 1153, 1153, 0, 0, + 1182, 1159, 0, 0, 1183, 1184, 1168, 1160, + 0, 0, 0, 0, 0, 0, 0, 0, + 1185, 0, 0, 0, 0, 1186, 1187, 0, + 1188, 1160, 1160, 1153, 1153, 0, 0, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1160, 1160, 1189, 1189, 1190, 1190, 1190, + 1190, 1190, 1190, 1191, 1189, 0, 0, 0, + 0, 0, 1153, 1153, 1159, 0, 1160, 1160, + 1160, 1160, 1160, 1160, 0, 0, 0, 0, + 1160, 1160, 0, 0, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1192, 0, 1160, 1193, + 0, 1160, 1160, 0, 0, 1180, 0, 1159, + 1159, 1159, 1153, 1153, 0, 0, 0, 0, + 1153, 1153, 0, 0, 1153, 1153, 1168, 0, + 0, 0, 1153, 0, 0, 0, 0, 0, + 0, 0, 1194, 1195, 1196, 1160, 0, 1197, + 0, 0, 0, 0, 0, 0, 0, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1153, 1153, 1160, 1160, 1160, 1153, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1153, 1153, 1159, 0, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 0, + 1160, 1160, 1160, 0, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 0, 1160, 1160, + 1160, 1160, 1160, 0, 0, 1180, 1160, 1159, + 1159, 1159, 1153, 1153, 1153, 1153, 1153, 0, + 1153, 1153, 1159, 0, 1159, 1159, 1168, 0, + 0, 1160, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1153, 1153, 0, 0, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1177, 1189, 0, 0, 0, 0, 0, + 0, 0, 1160, 0, 0, 0, 0, 0, + 0, 0, 1153, 1159, 1159, 0, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 0, 0, + 1160, 1160, 0, 0, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 0, 1160, 1160, + 1160, 1160, 1160, 0, 0, 1180, 1160, 1198, + 1153, 1159, 1153, 1153, 1153, 1153, 0, 0, + 1199, 1200, 0, 0, 1201, 1202, 1168, 0, + 0, 0, 0, 0, 0, 0, 0, 1203, + 1204, 0, 0, 0, 0, 1205, 1206, 0, + 1160, 1160, 1160, 1153, 1153, 0, 0, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1191, 1160, 1190, 1190, 1190, 1190, 1190, + 1190, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1153, 1160, 0, 1160, 1160, + 1160, 1160, 1160, 1160, 0, 0, 0, 1160, + 1160, 1160, 0, 1207, 1160, 1208, 1160, 0, + 0, 0, 1160, 1160, 0, 1160, 0, 1160, + 1160, 0, 0, 0, 1160, 1160, 0, 0, + 0, 1160, 1160, 1160, 0, 0, 0, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 0, 0, 0, 0, 1209, + 1159, 1153, 1159, 1159, 0, 0, 0, 1210, + 1211, 1159, 0, 1212, 1213, 1214, 1168, 0, + 0, 1160, 0, 0, 0, 0, 0, 0, + 1215, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1190, 1190, 1190, 1085, 1085, 1085, 1085, + 1085, 1085, 1189, 1085, 0, 0, 0, 0, + 0, 1153, 1159, 1159, 1159, 0, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 0, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 0, 0, 0, 1160, 1153, + 1153, 1153, 1159, 1159, 1159, 1159, 0, 1216, + 1153, 1217, 0, 1153, 1153, 1153, 1168, 0, + 0, 0, 0, 0, 0, 0, 1218, 1219, + 0, 1160, 1160, 1160, 0, 0, 0, 0, + 0, 1160, 1160, 1153, 1153, 0, 0, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 0, 0, 0, 0, 0, 0, 0, + 0, 1220, 1220, 1220, 1220, 1220, 1220, 1220, + 1191, 1160, 1153, 1159, 1159, 0, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 0, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 0, 1160, 1160, + 1160, 1160, 1160, 0, 0, 1180, 1160, 1159, + 1221, 1222, 1159, 1223, 1159, 1159, 0, 1224, + 1225, 1226, 0, 1227, 1228, 1153, 1168, 0, + 0, 0, 0, 0, 0, 0, 1229, 1230, + 0, 0, 0, 0, 0, 0, 0, 1160, + 0, 1160, 1160, 1153, 1153, 0, 0, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 0, 1160, 1160, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1153, 1159, 1159, 0, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 0, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 0, 0, 1160, 1231, + 1159, 1159, 1153, 1153, 1153, 1153, 0, 1232, + 1233, 1159, 0, 1234, 1235, 1236, 1168, 1237, + 1191, 0, 0, 0, 0, 1160, 1160, 1160, + 1238, 1190, 1190, 1190, 1190, 1190, 1190, 1190, + 1160, 1160, 1160, 1153, 1153, 0, 0, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1190, 1190, 1190, 1190, 1190, 1190, 1190, + 1190, 1190, 1191, 1160, 1160, 1160, 1160, 1160, + 1160, 0, 0, 1159, 1159, 0, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 0, 0, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 0, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 0, 1160, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 0, 0, 1239, 0, 0, 0, 0, + 1240, 1159, 1159, 1153, 1153, 1153, 0, 1153, + 0, 1159, 1241, 1242, 1159, 1243, 1244, 1245, + 1246, 0, 0, 0, 0, 0, 0, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 0, 0, 1159, 1159, 1177, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 1153, 340, 1247, 1153, 1153, 1153, + 1153, 1248, 1248, 1168, 0, 0, 0, 0, + 11, 340, 340, 340, 340, 340, 340, 523, + 1153, 1249, 1249, 1249, 1249, 1153, 1153, 1153, + 1044, 1250, 1250, 1250, 1250, 1250, 1250, 1250, + 1250, 1250, 1250, 1044, 1044, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 340, 340, 0, 340, 0, 0, + 340, 340, 0, 340, 0, 0, 340, 0, + 0, 0, 0, 0, 0, 340, 340, 340, + 340, 0, 340, 340, 340, 340, 340, 340, + 340, 0, 340, 340, 340, 0, 340, 0, + 340, 0, 0, 340, 340, 0, 340, 340, + 340, 340, 1153, 340, 1251, 1153, 1153, 1153, + 1153, 1252, 1252, 0, 1153, 1153, 340, 0, + 0, 340, 340, 340, 340, 340, 0, 523, + 0, 1253, 1253, 1253, 1253, 1153, 1153, 0, + 0, 1250, 1250, 1250, 1250, 1250, 1250, 1250, + 1250, 1250, 1250, 0, 0, 1254, 1255, 340, + 340, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1191, 1191, 1191, 1177, 1177, 1177, + 1177, 1177, 1177, 1177, 1177, 1256, 1177, 1177, + 1177, 1177, 1177, 1177, 1191, 1177, 1191, 1191, + 1191, 553, 553, 1191, 1191, 1191, 1191, 1191, + 1191, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 1190, 1190, 1190, 1190, 1190, + 1190, 1190, 1190, 1190, 1190, 1191, 553, 1191, + 553, 1191, 1257, 1258, 1259, 1258, 1259, 1159, + 1159, 1160, 1160, 1160, 1260, 1160, 1160, 1160, + 1160, 0, 1160, 1160, 1160, 1160, 1261, 1160, + 1160, 1160, 1160, 1262, 1160, 1160, 1160, 1160, + 1263, 1160, 1160, 1160, 1160, 1264, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1265, 1160, 1160, 1160, 0, 0, + 0, 0, 1266, 1267, 1268, 1269, 1270, 1271, + 1272, 1273, 1274, 1267, 1267, 1267, 1267, 1153, + 1159, 1267, 1275, 540, 540, 1168, 1177, 540, + 540, 1160, 1160, 1160, 1160, 1160, 1153, 1153, + 1153, 1153, 1153, 1153, 1276, 1153, 1153, 1153, + 1153, 0, 1153, 1153, 1153, 1153, 1277, 1153, + 1153, 1153, 1153, 1278, 1153, 1153, 1153, 1153, + 1279, 1153, 1153, 1153, 1153, 1280, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1281, 1153, 1153, 1153, 0, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 553, + 1191, 1191, 1191, 1191, 1191, 1191, 0, 1191, + 1191, 1177, 1177, 1177, 1177, 1177, 1191, 1191, + 1191, 1191, 1177, 1177, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 340, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 340, 1160, 1160, 1160, 1160, 1282, 1283, + 1160, 1160, 1160, 1160, 1284, 1284, 1153, 1285, + 1153, 1153, 1159, 1153, 1153, 1153, 1153, 1153, + 1180, 1284, 1168, 1168, 1159, 1159, 1153, 1153, + 1160, 1178, 1178, 1250, 1250, 1178, 1178, 1178, + 1178, 1178, 1178, 1044, 1044, 1044, 1177, 1177, + 1177, 1160, 1160, 1160, 1160, 340, 1160, 1159, + 1159, 1153, 1153, 1160, 1160, 1160, 1160, 1153, + 1153, 1153, 1160, 1284, 1284, 1284, 1160, 1160, + 1284, 1284, 1284, 1284, 1284, 1284, 1284, 1160, + 1160, 1160, 1153, 1153, 1153, 1153, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1153, 1284, 1159, 1153, 1153, + 1284, 1284, 1284, 1284, 1284, 1284, 553, 1160, + 1284, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 1284, 1284, 1284, 1153, 1191, + 1191, 1286, 1287, 1288, 1289, 1290, 1291, 1292, + 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, + 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, + 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, + 1317, 1318, 1319, 1320, 1321, 1322, 1323, 0, + 1324, 0, 0, 0, 0, 0, 1325, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 1044, 1326, 340, 340, + 340, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1328, 1329, 1330, 1330, 1330, 1330, 1330, 1330, + 1330, 1330, 1330, 1330, 1330, 1330, 1330, 1330, + 1330, 1330, 1330, 1330, 1330, 1330, 1330, 1330, + 1330, 1330, 1330, 1330, 1330, 1330, 1330, 1330, + 1330, 1330, 1330, 1330, 1330, 1330, 1330, 1330, + 1330, 1330, 1330, 1330, 1330, 1330, 1330, 1330, + 1330, 1330, 1330, 1330, 1330, 1330, 1330, 1330, + 1330, 1330, 1330, 1330, 1330, 1330, 1330, 1330, + 1330, 1330, 1330, 1330, 1330, 1330, 1330, 1330, + 1330, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 1160, 0, 1160, 1160, 1160, 1160, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 1160, 0, 1160, 1160, 1160, 1160, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 340, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 0, 0, 540, 540, + 540, 1177, 1044, 1177, 1177, 1177, 1177, 1177, + 1177, 1177, 1190, 1190, 1190, 1190, 1190, 1190, + 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, + 1190, 1190, 1190, 1190, 1190, 1190, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 77, 77, 77, 77, 77, 1085, 77, + 1085, 1085, 77, 0, 0, 0, 0, 0, + 0, 1332, 1333, 1334, 1335, 1336, 1337, 1338, + 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, + 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, + 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, + 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, + 1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, + 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, + 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, + 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, + 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, + 1411, 1412, 1413, 1414, 1415, 1416, 1417, 0, + 0, 1418, 1419, 1420, 1421, 1422, 1423, 0, + 0, 1424, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 340, 340, 340, 340, + 340, 340, 340, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 340, 340, 340, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 340, + 1160, 1160, 1160, 1160, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 340, 340, 340, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 1160, 1160, 1160, 1160, 1160, + 1160, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 340, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 340, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 340, 340, 340, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 340, + 340, 340, 340, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 340, 340, 340, 340, 1160, 1160, 1160, 1160, + 340, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 340, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 340, 340, 340, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 340, + 340, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 340, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1177, 1044, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 1425, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1258, 1259, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 1160, 340, 1160, 340, 340, 340, 340, + 340, 340, 340, 340, 1044, 1044, 1044, 1426, + 1426, 1426, 340, 340, 340, 340, 340, 340, + 340, 340, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 0, 1160, + 1160, 1160, 1160, 1153, 1153, 1168, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1153, 1153, 1168, 1177, 1177, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1153, 1153, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 340, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 0, 1160, + 1160, 1160, 0, 1153, 1153, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 574, 574, 1159, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1159, + 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1153, + 1159, 1159, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1168, 1153, 1177, 1177, 1044, + 1179, 1177, 1177, 1177, 1189, 340, 540, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 0, 0, 0, 0, + 0, 1427, 1427, 1427, 1427, 1427, 1427, 1427, + 1427, 1427, 1427, 0, 0, 0, 0, 0, + 0, 1428, 1428, 1428, 1428, 1428, 1428, 1424, + 1428, 1428, 1428, 1428, 574, 574, 574, 81, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1179, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1153, 1153, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1087, 1160, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 340, 340, 340, + 1160, 340, 1160, 340, 1160, 1160, 1160, 340, + 340, 1160, 1160, 1160, 340, 340, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 340, 1160, 340, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 340, 340, 340, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 1153, 1153, 1153, 1159, 1159, 1159, 1159, + 1153, 1153, 1159, 1159, 1159, 0, 0, 0, + 0, 1159, 1159, 1153, 1159, 1159, 1159, 1159, + 1159, 1159, 1086, 540, 553, 0, 0, 0, + 0, 1085, 0, 0, 0, 1428, 1428, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 0, + 0, 340, 340, 340, 340, 340, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 0, 0, 0, 0, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 1190, 0, 0, 0, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 540, 553, 1159, 1159, 1153, 0, 0, 1177, + 1177, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1159, 1153, + 1159, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 0, 1168, 1284, 1153, 1284, 1284, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1159, 1159, + 1159, 1159, 1159, 1159, 1153, 1153, 540, 540, + 540, 540, 540, 540, 540, 540, 0, 0, + 553, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 0, 0, 0, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 0, 0, 0, 0, + 0, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + 1179, 1177, 1177, 1177, 1177, 1177, 1177, 0, + 0, 540, 540, 540, 540, 540, 553, 553, + 553, 553, 553, 553, 540, 540, 553, 839, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1153, 1153, 1153, 1153, 1159, 1429, 1430, + 1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, + 1160, 1160, 1439, 1440, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1180, 1441, 1153, + 1153, 1153, 1153, 1442, 1443, 1444, 1445, 1446, + 1447, 1448, 1449, 1450, 1451, 1452, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 0, 0, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 1177, 1177, 1177, 1177, 1177, + 1177, 1177, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 540, 553, 540, 540, + 540, 540, 540, 540, 540, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 0, 0, + 0, 1153, 1153, 1159, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1159, 1153, 1153, 1153, 1153, 1159, + 1159, 1153, 1153, 1452, 1168, 1153, 1153, 1160, + 1160, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1180, + 1159, 1153, 1153, 1159, 1159, 1159, 1153, 1159, + 1153, 1153, 1153, 1452, 1452, 0, 0, 0, + 0, 0, 0, 0, 0, 1177, 1177, 1177, + 1177, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1159, 1159, 1159, + 1159, 1159, 1159, 1159, 1159, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1159, 1159, 1153, + 1180, 0, 0, 0, 1177, 1177, 1177, 1177, + 1177, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 0, 0, 1160, 1160, + 1160, 1250, 1250, 1250, 1250, 1250, 1250, 1250, + 1250, 1250, 1250, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 523, 523, 523, 523, 523, 523, 1044, + 1044, 1453, 1454, 1455, 1456, 1457, 1457, 1458, + 1459, 1460, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + 1177, 0, 0, 0, 0, 0, 0, 0, + 0, 540, 540, 540, 1177, 566, 553, 553, + 553, 553, 553, 540, 540, 553, 553, 553, + 553, 540, 1159, 566, 566, 566, 566, 566, + 566, 566, 1160, 1160, 1160, 1160, 553, 1160, + 1160, 1160, 1160, 1159, 1159, 540, 1160, 1160, + 0, 540, 540, 0, 0, 0, 0, 0, + 0, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 1461, 1462, 1463, + 523, 1464, 1465, 1466, 1467, 1468, 1469, 1470, + 1471, 1472, 1473, 1474, 523, 1475, 1476, 1477, + 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, + 1486, 1487, 1488, 1489, 1490, 1491, 1492, 523, + 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, + 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, + 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, + 1517, 1518, 1519, 1520, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, + 214, 1521, 1522, 1523, 214, 214, 1524, 214, + 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 1523, 214, + 214, 214, 214, 214, 1525, 1526, 1527, 1528, + 1491, 1529, 1530, 1531, 1532, 1533, 1534, 1535, + 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, + 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, + 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, + 1560, 540, 540, 553, 540, 540, 540, 540, + 540, 540, 540, 553, 540, 540, 576, 1561, + 553, 555, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 0, + 0, 0, 0, 0, 540, 575, 553, 540, + 553, 1562, 1563, 1564, 1565, 1566, 1567, 1568, + 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, + 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, + 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, + 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, + 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, + 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, + 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, + 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, + 1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, + 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, + 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, + 1657, 1658, 1659, 1660, 1661, 1662, 1663, 1664, + 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, + 1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680, + 1681, 1682, 1683, 1684, 1685, 1686, 1687, 1688, + 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, + 1697, 1698, 1699, 1700, 1701, 1702, 1703, 1704, + 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, + 1713, 1714, 1715, 1716, 1717, 214, 214, 1718, + 214, 1719, 1720, 1721, 1722, 1723, 1724, 1725, + 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, + 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, + 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, + 1750, 1751, 1752, 1753, 1754, 1755, 1756, 1757, + 1758, 1759, 1760, 1761, 1762, 1763, 1764, 1765, + 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, + 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, + 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, + 1790, 1791, 1792, 1793, 1794, 1795, 1796, 1797, + 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, + 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, + 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, + 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, + 1830, 1831, 1832, 1833, 1834, 1835, 1836, 0, + 0, 1837, 1838, 1839, 1840, 1841, 1842, 0, + 0, 1843, 1844, 1845, 1846, 1847, 1848, 1849, + 1850, 1851, 1852, 1853, 1854, 1855, 1856, 1857, + 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, + 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, + 1874, 1875, 1876, 1877, 1878, 1879, 1880, 0, + 0, 1881, 1882, 1883, 1884, 1885, 1886, 0, + 0, 1887, 1888, 1889, 1890, 1891, 1892, 1893, + 1894, 0, 1895, 0, 1896, 0, 1897, 0, + 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, + 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, + 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, + 1922, 1923, 1924, 1925, 1926, 1927, 1928, 0, + 0, 1929, 1930, 1931, 1932, 1933, 1934, 1935, + 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, + 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, + 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, + 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, + 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, + 1976, 1977, 1978, 1979, 1980, 1981, 0, 1982, + 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, + 1991, 1992, 1993, 1994, 1995, 1996, 0, 1997, + 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006, 2007, 2008, 2009, 2010, 0, 0, 2011, + 2012, 2013, 2014, 2015, 2016, 0, 2017, 2018, + 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, + 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, + 2035, 0, 0, 2036, 2037, 2038, 0, 2039, + 2040, 2041, 2042, 2043, 2044, 2045, 2046, 2047, + 0, 2048, 2049, 2050, 2051, 2050, 2050, 2050, + 2052, 2050, 2050, 2050, 81, 2053, 2054, 2055, + 2056, 1084, 2057, 1084, 1084, 1084, 1084, 9, + 2058, 2059, 2060, 2061, 2059, 2059, 2060, 2061, + 2059, 9, 9, 9, 9, 2062, 2063, 2064, + 9, 2065, 2066, 2067, 2068, 2069, 2070, 2071, + 76, 10, 10, 10, 2072, 2073, 9, 2074, + 2075, 9, 80, 92, 9, 2076, 9, 2077, + 48, 48, 9, 9, 9, 2078, 12, 13, + 2079, 2080, 2081, 9, 9, 9, 9, 9, + 9, 9, 9, 75, 9, 48, 9, 9, + 2082, 9, 9, 9, 9, 9, 9, 9, + 2050, 81, 81, 81, 81, 81, 0, 2083, + 2084, 2085, 2086, 81, 81, 81, 81, 81, + 81, 2087, 2088, 0, 0, 2089, 2090, 2091, + 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, + 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107, + 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, + 0, 2116, 2117, 2118, 2119, 2120, 2121, 2122, + 2123, 2124, 2125, 2126, 2127, 2128, 0, 0, + 0, 11, 11, 11, 11, 11, 11, 11, + 11, 2129, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 1189, 11, 11, 11, 11, 11, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 540, 540, 566, 566, 540, 540, 540, + 540, 566, 566, 566, 540, 540, 839, 839, + 839, 839, 540, 839, 839, 839, 566, 566, + 540, 553, 540, 566, 566, 553, 553, 553, + 553, 540, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2130, 2131, 2132, 2133, 77, 2134, 2135, + 2136, 77, 2137, 2138, 2139, 2139, 2139, 2140, + 2141, 2142, 2142, 2143, 2144, 77, 2145, 2146, + 77, 75, 2147, 2148, 2149, 2149, 2149, 77, + 77, 2150, 2151, 2152, 77, 2153, 77, 2154, + 77, 2153, 77, 2155, 2156, 2157, 2132, 83, + 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, + 2166, 2167, 2168, 1085, 2169, 2170, 2171, 2172, + 2173, 2174, 75, 75, 75, 75, 2175, 2176, + 2158, 2168, 2177, 77, 75, 1085, 77, 2178, + 1191, 2179, 2180, 2181, 2182, 2183, 2184, 2185, + 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, + 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, + 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, + 2210, 2211, 2212, 2213, 2214, 2215, 2216, 2217, + 2218, 2219, 2220, 2221, 2222, 2223, 2224, 2225, + 2226, 1426, 1426, 2227, 2228, 2229, 1426, 1426, + 1426, 2227, 2230, 77, 77, 0, 0, 0, + 0, 2231, 75, 2232, 75, 2233, 77, 77, + 77, 77, 77, 2234, 2235, 77, 77, 77, + 77, 75, 77, 77, 75, 77, 77, 75, + 77, 77, 77, 77, 77, 77, 77, 2236, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 2237, 2238, + 2239, 2240, 77, 2241, 77, 2242, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 1109, 75, 75, + 75, 75, 1109, 1109, 1109, 1109, 75, 75, + 1109, 75, 2243, 2243, 2244, 2245, 75, 75, + 75, 2246, 2247, 2243, 2248, 2249, 2243, 75, + 75, 75, 2243, 14, 84, 75, 2243, 2243, + 75, 75, 75, 2243, 2243, 2243, 2243, 75, + 2243, 2243, 2243, 2243, 2250, 2251, 2252, 2253, + 75, 75, 75, 75, 2243, 2254, 2255, 2243, + 2256, 2257, 2243, 2243, 2243, 75, 75, 75, + 75, 75, 2243, 75, 2243, 2258, 2243, 2243, + 2243, 2243, 2259, 2243, 2260, 2261, 2262, 2243, + 2263, 2264, 2265, 2243, 2243, 2243, 2266, 75, + 75, 75, 75, 2243, 2243, 2243, 2243, 75, + 75, 75, 75, 75, 75, 75, 75, 75, + 2243, 2267, 2268, 2269, 75, 2270, 2271, 2243, + 2243, 2243, 2243, 2243, 2243, 75, 2272, 2273, + 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, + 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2243, + 2243, 2289, 2290, 2291, 2292, 2293, 2294, 2295, + 2296, 2297, 2298, 2243, 2243, 2243, 75, 75, + 2243, 2243, 2299, 2300, 75, 75, 75, 75, + 75, 2243, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 2301, 2243, 75, 75, 2243, + 2243, 2302, 2303, 2243, 2304, 2305, 2306, 2307, + 2308, 2243, 2243, 2309, 2310, 2311, 2312, 2243, + 2243, 2243, 75, 75, 75, 75, 75, 2243, + 2243, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 2243, 2243, 2243, 2243, 2243, 75, + 75, 2243, 2243, 75, 75, 75, 75, 2243, + 2243, 2243, 2243, 2243, 2243, 2243, 2243, 2243, + 2243, 2313, 2314, 2315, 2316, 2243, 2243, 2243, + 2243, 2243, 2243, 2317, 2318, 2319, 2320, 75, + 75, 2243, 2243, 2321, 2321, 2243, 2321, 2321, + 2243, 2243, 2321, 2321, 2321, 2243, 2321, 2243, + 2321, 77, 77, 77, 77, 77, 77, 77, + 77, 12, 13, 12, 13, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 1085, 1085, 77, 77, 77, + 77, 2243, 2243, 77, 77, 77, 77, 77, + 77, 77, 2322, 2323, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 1085, 1109, 1085, 1085, + 77, 77, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 838, 77, + 1085, 1085, 1085, 1085, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 1109, 1109, 1085, 1085, 1085, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 77, 77, 1085, 1085, + 77, 77, 77, 77, 77, 1085, 1085, 1085, + 1085, 1085, 1085, 77, 1085, 1109, 1109, 1109, + 1109, 1109, 1109, 1085, 1085, 1085, 1085, 1085, + 1085, 77, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 77, 77, 77, 77, 77, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2324, 2325, 2326, 2327, 2328, 2329, 2330, + 2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, + 2339, 2340, 2341, 2342, 2343, 2344, 2345, 2346, + 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, + 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, + 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, + 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, + 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, + 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, + 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, + 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, + 2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, + 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, + 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, + 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, + 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, + 2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458, + 2459, 2460, 2461, 2462, 1220, 1220, 1220, 1220, + 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, + 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, + 1220, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 75, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 75, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 75, 75, 75, 75, 75, 1109, 1109, + 75, 77, 77, 77, 1085, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 1085, 1085, 1085, + 1085, 1085, 1085, 77, 77, 77, 2463, 77, + 77, 77, 77, 1085, 1085, 1085, 77, 77, + 77, 77, 77, 77, 1085, 1085, 77, 77, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 75, 77, 77, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 77, 77, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 77, 1085, 1085, 1085, 838, 1085, 1085, + 1085, 1085, 1085, 77, 77, 77, 77, 1085, + 77, 77, 77, 77, 77, 77, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 77, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 2464, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 2464, 2464, 2464, 2464, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 2465, 1085, 1085, + 1085, 12, 13, 12, 13, 12, 13, 12, + 13, 12, 13, 12, 13, 12, 13, 1220, + 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, + 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, + 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, + 1220, 1220, 1220, 1220, 1220, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 2243, 1109, 75, 2321, 2321, 12, 13, + 75, 2321, 2321, 75, 2321, 2321, 2321, 1109, + 1109, 1109, 75, 1109, 2243, 2243, 2321, 2321, + 1109, 1109, 1109, 1109, 1109, 2321, 2321, 2321, + 1109, 75, 1109, 2321, 2321, 2321, 2321, 12, + 13, 12, 13, 12, 13, 12, 13, 12, + 13, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 75, 75, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1109, 75, 75, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 75, 75, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 75, 1109, 1109, 75, 75, 1109, + 75, 1109, 75, 1109, 1109, 75, 75, 1109, + 1109, 75, 75, 1109, 1109, 75, 75, 1109, + 1109, 75, 75, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 75, 75, 1109, + 1109, 75, 1109, 75, 12, 13, 12, 13, + 12, 13, 12, 13, 12, 13, 12, 13, + 12, 13, 12, 13, 1258, 1259, 1258, 1259, + 12, 13, 75, 1109, 2321, 2321, 2321, 2321, + 2321, 2321, 2321, 2321, 2321, 2321, 2321, 2243, + 2243, 2321, 2321, 2321, 2321, 2321, 2321, 2321, + 2321, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 2321, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 2321, 2321, 2321, 2321, 2321, 2321, 1109, + 1109, 1109, 2321, 1109, 1109, 1109, 1109, 2321, + 2321, 2321, 2243, 2243, 75, 2243, 2243, 75, + 75, 12, 13, 1258, 1259, 2321, 1109, 1109, + 1109, 1109, 2321, 1109, 2321, 2321, 2321, 1109, + 1109, 2321, 2321, 1109, 75, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 2321, 2243, 2243, + 2243, 2243, 2243, 75, 75, 12, 13, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1109, 2321, 2321, 2466, 2321, 2321, + 2321, 2321, 2321, 2321, 2321, 2321, 2321, 2321, + 2321, 2321, 2321, 2321, 2321, 2321, 1109, 2243, + 2243, 2321, 2243, 75, 75, 2243, 75, 2243, + 1109, 75, 2243, 75, 2243, 2243, 2321, 2321, + 75, 75, 75, 75, 1109, 2321, 2321, 1109, + 1109, 1109, 1109, 1109, 1109, 2243, 2243, 2243, + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 75, + 75, 75, 75, 75, 75, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 2321, 2321, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 2321, 2321, 75, + 75, 1109, 1109, 2243, 2243, 2243, 2243, 1109, + 2243, 2243, 75, 75, 2243, 2467, 2468, 2469, + 75, 1109, 2321, 2321, 2321, 2321, 2321, 2321, + 2321, 2321, 2321, 2321, 2321, 2321, 2321, 2321, + 2321, 2321, 2321, 2321, 2243, 2243, 2321, 2321, + 2243, 2243, 2243, 2243, 2243, 2243, 2321, 2321, + 2321, 2321, 2321, 2321, 2321, 2321, 2321, 2321, + 2321, 2321, 2321, 2321, 2321, 1109, 1109, 2321, + 2321, 2321, 2321, 2321, 2321, 2321, 2321, 1109, + 2321, 2321, 2321, 2321, 2321, 2321, 2321, 2321, + 2321, 2321, 2321, 2321, 2321, 2321, 2321, 2321, + 2243, 2243, 2243, 2243, 2243, 2243, 2243, 2243, + 2321, 2321, 2243, 2243, 2243, 2243, 2321, 2321, + 2321, 2321, 2321, 2321, 2243, 2243, 2243, 2243, + 1109, 1109, 1109, 1109, 1109, 2470, 2471, 2243, + 1109, 1109, 1109, 2321, 2321, 2321, 2321, 2321, + 1109, 1109, 1109, 1109, 1109, 2321, 2321, 2243, + 75, 75, 75, 75, 2321, 1109, 1109, 75, + 2321, 2321, 2321, 2321, 2321, 1109, 2321, 75, + 75, 1085, 1085, 1085, 1085, 1085, 1085, 77, + 77, 1085, 1085, 1085, 1085, 1085, 77, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 77, 77, + 1085, 1085, 1085, 1085, 1085, 1085, 77, 77, + 77, 77, 77, 77, 77, 1085, 1085, 77, + 77, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1085, 1085, + 1109, 1109, 1109, 1109, 1109, 1109, 1085, 77, + 77, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 0, 0, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 0, 0, 0, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 0, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1085, 1085, 1085, + 1085, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2472, 2473, 2474, 2475, 2476, 2477, 2478, + 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, + 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, + 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, + 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, + 2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, + 0, 2519, 2520, 2521, 2522, 2523, 2524, 2525, + 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, + 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, + 2542, 2543, 2544, 2545, 2546, 2547, 2548, 2549, + 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2557, + 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, + 0, 2566, 2567, 2568, 2569, 2570, 2571, 2572, + 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, + 2581, 2582, 214, 2583, 2584, 214, 2585, 2586, + 214, 214, 214, 214, 214, 2587, 2588, 2589, + 2590, 2591, 2592, 2593, 2594, 2595, 2596, 2597, + 2598, 2599, 2600, 2601, 2602, 2603, 2604, 2605, + 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, + 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, + 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2629, + 2630, 2631, 2632, 2633, 2634, 2635, 2636, 2637, + 2638, 2639, 2640, 2641, 2642, 2643, 2644, 2645, + 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, + 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, + 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, + 2670, 2671, 2672, 2673, 2674, 2675, 2676, 2677, + 2678, 2679, 2680, 2681, 2682, 2683, 2684, 2685, + 2686, 2687, 2688, 2689, 2690, 214, 77, 77, + 1085, 77, 77, 1085, 2691, 2692, 2693, 2694, + 540, 540, 540, 2695, 2696, 0, 0, 0, + 0, 0, 9, 9, 9, 9, 1427, 9, + 9, 2697, 2698, 2699, 2700, 2701, 2702, 2703, + 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, + 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, + 2720, 2721, 2722, 2723, 2724, 2725, 2726, 2727, + 2728, 2729, 2730, 2731, 2732, 2733, 2734, 0, + 2735, 0, 0, 0, 0, 0, 2736, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 1160, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 0, 0, 0, 0, 0, 0, 0, + 2737, 1044, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1168, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, + 540, 9, 9, 80, 92, 80, 92, 9, + 9, 9, 80, 92, 9, 80, 92, 1428, + 1428, 1428, 1428, 9, 1428, 1428, 1428, 9, + 1084, 9, 9, 1084, 9, 80, 92, 9, + 9, 80, 92, 12, 13, 12, 13, 12, + 13, 12, 13, 9, 9, 9, 9, 9, + 522, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 1084, 1084, 9, 9, 9, + 9, 1084, 9, 2061, 1428, 9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 0, 1085, 1085, 1085, 1085, + 2738, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 2739, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2740, 2741, 2742, 2743, 2744, 2745, 2746, + 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, + 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, + 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, + 2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, + 2779, 2780, 2781, 2782, 2783, 2784, 2785, 2786, + 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, + 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, + 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, + 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, + 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2826, + 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834, + 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, + 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, + 2851, 2852, 2853, 2854, 2855, 2856, 2857, 2858, + 2859, 2860, 2861, 2862, 2863, 2864, 2865, 2866, + 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, + 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, + 2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, + 2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, + 2899, 2900, 2901, 2902, 2903, 2904, 2905, 2906, + 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, + 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, + 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, + 2931, 2932, 2933, 2934, 2935, 2936, 2937, 2938, + 2939, 2940, 2941, 2942, 2943, 2944, 2945, 2946, + 2947, 2948, 2949, 2950, 2951, 2952, 2953, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 0, 0, 0, + 0, 2954, 1428, 1428, 1428, 1085, 1179, 1160, + 2227, 1258, 1259, 1258, 1259, 1258, 1259, 1258, + 1259, 1258, 1259, 1085, 1085, 1258, 1259, 1258, + 1259, 1258, 1259, 1258, 1259, 1424, 2955, 2956, + 2956, 1085, 2227, 2227, 2227, 2227, 2227, 2227, + 2227, 2227, 2227, 2957, 1087, 552, 1086, 2958, + 2958, 1424, 1179, 1179, 1179, 1179, 1179, 2959, + 1085, 2960, 2961, 2962, 1179, 1160, 1428, 1085, + 77, 0, 1160, 1160, 1160, 1160, 1160, 2963, + 1160, 1160, 1160, 1160, 2964, 2965, 2966, 2967, + 2968, 2969, 2970, 2971, 2972, 2973, 2974, 2975, + 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, + 2984, 2985, 2986, 2987, 1160, 2988, 2989, 2990, + 2991, 2992, 2993, 1160, 1160, 1160, 1160, 1160, + 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, + 3002, 3003, 3004, 3005, 3006, 3007, 3008, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 3009, 1160, 1160, + 0, 0, 3010, 3011, 3012, 3013, 3014, 3015, + 3016, 1424, 1160, 1160, 1160, 1160, 1160, 3017, + 1160, 1160, 1160, 1160, 3018, 3019, 3020, 3021, + 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, + 3030, 3031, 3032, 3033, 3034, 3035, 3036, 3037, + 3038, 3039, 3040, 3041, 1160, 3042, 3043, 3044, + 3045, 3046, 3047, 1160, 1160, 1160, 1160, 1160, + 3048, 3049, 3050, 3051, 3052, 3053, 3054, 3055, + 3056, 3057, 3058, 3059, 3060, 3061, 3062, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 3063, 3064, 3065, 3066, 1160, 3067, 1160, 1160, + 3068, 3069, 3070, 3071, 1428, 1179, 3072, 3073, + 3074, 0, 0, 0, 0, 0, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 0, + 0, 0, 3075, 3076, 3077, 3078, 3079, 3080, + 3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, + 3089, 3090, 3091, 3092, 3093, 3094, 3095, 3096, + 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, + 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, + 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, + 3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, + 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, + 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, + 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, + 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, + 3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, + 0, 1191, 1191, 3169, 3170, 3171, 3172, 3173, + 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, + 3182, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 3183, 3184, 3185, 3186, 3187, 3188, 3189, + 3190, 3191, 3192, 3193, 3194, 3195, 3196, 3197, + 3198, 3199, 3200, 3201, 3202, 3203, 3204, 3205, + 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, + 0, 3214, 3215, 3216, 3217, 3218, 3219, 3220, + 3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, + 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, + 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, + 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, + 3253, 1190, 1190, 1190, 1190, 1190, 1190, 1190, + 1190, 3254, 3255, 3256, 3257, 3258, 3259, 3260, + 3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, + 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, + 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, + 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, + 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, + 1191, 3301, 3302, 3303, 3304, 3305, 3306, 3307, + 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, + 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, + 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, + 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339, + 3340, 3341, 3342, 3343, 3344, 3345, 3346, 3347, + 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, + 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, + 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, + 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, + 3380, 3381, 3382, 3383, 3384, 3385, 3386, 3387, + 3388, 3389, 3390, 3391, 3392, 3393, 3394, 3395, + 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, + 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, + 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, + 3420, 3421, 3422, 3423, 3424, 3425, 3426, 3427, + 0, 3428, 3429, 3430, 3431, 3432, 3433, 3434, + 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, + 3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, + 3451, 3452, 3453, 3454, 3455, 3456, 3457, 3458, + 3459, 3460, 3461, 3462, 3463, 3464, 3465, 3466, + 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, + 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, + 3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, + 3491, 3492, 3493, 3494, 3495, 3496, 3497, 3498, + 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, + 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, + 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, + 3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, + 3531, 3532, 3533, 3534, 3535, 3536, 3537, 3538, + 3539, 3540, 3541, 3542, 3543, 3544, 3545, 3546, + 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, + 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, + 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, + 3571, 3572, 3573, 3574, 3575, 3576, 3577, 3578, + 3579, 3580, 3581, 3582, 3583, 3584, 3585, 3586, + 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, + 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, + 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, + 3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, + 3619, 3620, 3621, 3622, 3623, 3624, 3625, 3626, + 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, + 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, + 3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, + 3651, 3652, 3653, 3654, 3655, 3656, 3657, 3658, + 3659, 3660, 3661, 3662, 3663, 3664, 3665, 3666, + 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, + 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, + 3683, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1179, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 523, 523, 523, 523, 523, 523, 1044, + 1044, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1179, 1428, 1428, + 1428, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 1160, 1160, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3684, 3685, 3686, 3687, 3688, 3689, 3690, + 3691, 3692, 3693, 3694, 3695, 3696, 3697, 3698, + 3699, 3700, 3701, 3702, 3703, 3704, 3705, 3706, + 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, + 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, + 3723, 3724, 3725, 3726, 3727, 3728, 3729, 1160, + 540, 839, 839, 839, 9, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 9, + 522, 3730, 3731, 3732, 3733, 3734, 3735, 3736, + 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, + 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, + 3753, 3754, 3755, 3756, 3757, 3758, 3759, 540, + 540, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 540, 540, 1044, 1044, 1044, 1044, 1044, + 1044, 0, 0, 0, 0, 0, 0, 0, + 0, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 522, 522, 522, 522, 522, 522, 522, 522, + 522, 47, 47, 3760, 3761, 3762, 3763, 3764, + 3765, 3766, 3767, 3768, 3769, 3770, 3771, 3772, + 3773, 214, 214, 3774, 3775, 3776, 3777, 3778, + 3779, 3780, 3781, 3782, 3783, 3784, 3785, 3786, + 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, + 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, + 3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, + 3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, + 3819, 3820, 3821, 3822, 3823, 3824, 3825, 3826, + 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, + 3835, 3836, 1523, 1523, 1523, 1523, 1523, 1523, + 1523, 214, 3837, 3838, 3839, 3840, 3841, 3842, + 3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, + 3851, 522, 3852, 3852, 3853, 3854, 3855, 214, + 340, 3856, 3857, 3858, 3859, 214, 214, 3860, + 3861, 3862, 3863, 3864, 3865, 3866, 3867, 3868, + 3869, 3870, 3871, 3872, 3873, 3874, 3875, 3876, + 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, + 0, 3885, 3886, 3887, 3888, 3889, 3890, 3891, + 3892, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 340, 3893, 3894, 214, 340, 340, 340, 340, + 1160, 1160, 1160, 1153, 1160, 1160, 1160, 1168, + 1160, 1160, 1160, 1160, 1153, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1159, 1159, 1153, 1153, + 1159, 77, 77, 1085, 1085, 0, 0, 0, + 0, 1190, 1190, 1190, 1190, 1190, 1190, 1191, + 1191, 1189, 3895, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1428, 1428, 1428, + 1428, 0, 0, 0, 0, 0, 0, 0, + 0, 1159, 1159, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1159, 1159, 1159, + 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, + 1159, 1159, 1159, 1159, 1159, 1168, 1153, 0, + 0, 0, 0, 0, 0, 0, 0, 1177, + 1177, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 0, 0, 0, 0, + 0, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 1160, 1160, 1160, 1160, 1160, + 1160, 1177, 1177, 1177, 1160, 1177, 1160, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1153, + 1153, 1153, 1153, 1153, 553, 553, 553, 1177, + 1177, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1159, 1452, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1177, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 0, 0, + 0, 1153, 1153, 1153, 1159, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1180, 1159, 1159, 1153, + 1153, 1153, 1153, 1159, 1159, 1153, 1159, 1159, + 1159, 1452, 1177, 1177, 1177, 1177, 1177, 1177, + 1177, 1177, 1177, 1177, 1177, 1177, 1177, 0, + 1179, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 0, 0, 0, 1177, + 1177, 340, 1160, 1160, 1160, 1160, 1153, 523, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 340, 1250, 1250, 1250, 1250, 1250, 1250, 1250, + 1250, 1250, 1178, 1160, 1160, 1160, 340, 1160, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1153, 1153, 1153, 1153, 1153, 1153, + 1159, 1159, 1153, 1153, 1159, 1159, 1153, 1153, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1153, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1153, 1159, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 0, 1177, 1177, 1177, + 1177, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1179, 1160, 1160, 1160, 1160, 1160, 1160, + 1191, 1191, 1191, 1160, 1284, 1153, 1284, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 540, 1160, 540, 540, 553, 1160, 1160, + 540, 540, 1160, 1160, 1160, 1160, 1160, 540, + 540, 1160, 540, 1160, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1160, 1160, 1179, 1177, + 1177, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1159, 1153, 1153, 1159, + 1159, 1177, 1177, 1160, 1179, 1179, 1159, 1168, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 0, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 0, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 3896, 214, 214, 214, + 214, 214, 214, 214, 3852, 3897, 3898, 3899, + 3900, 214, 214, 214, 214, 214, 214, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3901, 3902, 3903, 3904, 3905, 3906, 3907, + 3908, 3909, 3910, 3911, 3912, 3913, 3914, 3915, + 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, + 3924, 3925, 3926, 3927, 3928, 3929, 3930, 3931, + 3932, 3933, 3934, 3935, 3936, 3937, 3938, 3939, + 3940, 3941, 3942, 3943, 3944, 3945, 3946, 3947, + 3948, 3949, 3950, 3951, 3952, 3953, 3954, 3955, + 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, + 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, + 3972, 3973, 3974, 3975, 3976, 3977, 3978, 3979, + 3980, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1159, 1159, 1153, 1159, + 1159, 1153, 1159, 1159, 1177, 1159, 1168, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 0, 0, 0, 0, + 0, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3981, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3981, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1330, 1330, 1330, 1330, 1330, 1330, 1330, + 1330, 1330, 1330, 1330, 1330, 1330, 1330, 1330, + 1330, 1330, 1330, 1330, 1330, 1330, 1330, 1330, + 0, 0, 0, 0, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 0, 0, 0, + 0, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, + 3983, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, + 3992, 3992, 3993, 3994, 3995, 3996, 3997, 3998, + 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, + 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, + 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, + 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, + 4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, + 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, + 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, + 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, + 4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, + 4071, 4072, 4073, 4074, 4075, 4004, 4076, 4077, + 4078, 4079, 4080, 4081, 4082, 4083, 4084, 4085, + 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, + 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, + 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, + 4110, 4111, 4112, 4113, 4114, 4115, 4116, 4117, + 4118, 4119, 4120, 4121, 4122, 4123, 4124, 4125, + 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, + 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, + 4142, 4143, 4094, 4144, 4145, 4146, 4147, 4148, + 4149, 4150, 4151, 4078, 4152, 4153, 4154, 4155, + 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, + 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, + 4004, 4172, 4173, 4174, 4175, 4176, 4177, 4178, + 4179, 4180, 4181, 4182, 4183, 4184, 4185, 4186, + 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, + 4195, 4196, 4197, 4198, 4080, 4199, 4200, 4201, + 4202, 4203, 4204, 4205, 4206, 4207, 4208, 4209, + 4210, 4211, 4212, 4213, 4214, 4215, 4216, 4217, + 4218, 4219, 4220, 4221, 4222, 4223, 4224, 4225, + 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, + 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, + 4242, 4243, 4244, 4245, 4246, 4247, 4248, 1160, + 1160, 4249, 1160, 4250, 1160, 1160, 4251, 4252, + 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, + 1160, 4261, 1160, 4262, 1160, 1160, 4263, 4264, + 1160, 1160, 1160, 4265, 4266, 4267, 4268, 4269, + 4270, 4271, 4272, 4273, 4274, 4275, 4276, 4277, + 4278, 4279, 4280, 4281, 4282, 4283, 4284, 4285, + 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, + 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, + 4302, 4303, 4304, 4305, 4306, 4307, 4308, 4309, + 4133, 4310, 4311, 4312, 4313, 4314, 4315, 4315, + 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, + 4263, 4324, 4325, 4326, 4327, 4328, 4329, 0, + 0, 4330, 4331, 4332, 4333, 4334, 4335, 4336, + 4337, 4277, 4338, 4339, 4340, 4249, 4341, 4342, + 4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, + 4351, 4352, 4286, 4353, 4287, 4354, 4355, 4356, + 4357, 4358, 4250, 4025, 4359, 4360, 4361, 4095, + 4182, 4362, 4363, 4294, 4364, 4295, 4365, 4366, + 4367, 4252, 4368, 4369, 4370, 4371, 4372, 4253, + 4373, 4374, 4375, 4376, 4377, 4378, 4309, 4379, + 4380, 4133, 4381, 4313, 4382, 4383, 4384, 4385, + 4386, 4318, 4387, 4262, 4388, 4319, 4076, 4389, + 4320, 4390, 4322, 4391, 4392, 4393, 4394, 4395, + 4324, 4258, 4396, 4325, 4397, 4326, 4398, 3992, + 4399, 4400, 4401, 4402, 4403, 4404, 4405, 4406, + 4407, 4408, 4409, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 4410, 4411, 4412, 4413, 4414, 4415, 4416, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 4417, 4418, 4419, 4420, + 4421, 0, 0, 0, 0, 0, 4422, 4423, + 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, + 4432, 4433, 4434, 4435, 4436, 4437, 4438, 4439, + 4440, 4441, 4442, 4443, 4444, 4445, 4446, 4447, + 0, 4448, 4449, 4450, 4451, 4452, 0, 4453, + 0, 4454, 4455, 0, 4456, 4457, 0, 4458, + 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, + 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, + 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, + 4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, + 4491, 4492, 4493, 4494, 4495, 4496, 4497, 4498, + 4499, 4500, 4501, 4502, 4503, 4504, 4505, 4506, + 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, + 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, + 4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, + 4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, + 4539, 4540, 4541, 4542, 4543, 4544, 4545, 4546, + 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, + 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, + 4563, 4564, 4565, 4566, 4566, 4566, 4566, 4566, + 4566, 4566, 4566, 4566, 4566, 4566, 4566, 4566, + 4566, 4566, 4566, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 4567, 4568, 4569, 4570, + 4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, + 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, + 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, + 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, + 4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, + 4611, 4612, 4613, 4614, 4605, 4615, 4616, 4617, + 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, + 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, + 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, + 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649, + 4650, 4651, 4652, 4653, 4654, 4655, 4656, 4657, + 4658, 4659, 4660, 4661, 4662, 4663, 4664, 4665, + 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, + 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, + 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, + 4690, 4691, 4692, 4693, 4694, 4695, 4696, 4697, + 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, + 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, + 4714, 4606, 4715, 4716, 4717, 4718, 4719, 4720, + 4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, + 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, + 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, + 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, + 4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, + 4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, + 4769, 4770, 4771, 4772, 4773, 4774, 4775, 4776, + 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, + 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, + 4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, + 4801, 4802, 4803, 4804, 4805, 4806, 4807, 4808, + 4809, 4810, 4811, 4812, 4813, 4814, 4815, 4816, + 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, + 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, + 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, + 4841, 4842, 4843, 4844, 4845, 4846, 4847, 4848, + 4849, 4850, 4851, 4852, 4853, 4854, 4855, 4856, + 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, + 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, + 4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, + 4881, 4882, 4883, 4884, 4885, 4886, 4887, 4888, + 4889, 4890, 4891, 4892, 4893, 4894, 4895, 4896, + 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, + 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, + 4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, + 4921, 4922, 4923, 4924, 4925, 4926, 4927, 2956, + 2955, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 4928, 4929, 4930, 4931, 4932, 4933, 4934, + 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, + 4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, + 4951, 4952, 4953, 4954, 4955, 4956, 4957, 4958, + 4959, 4960, 4961, 4962, 4963, 4964, 4965, 4966, + 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, + 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, + 4983, 4984, 4985, 4986, 4987, 4988, 4989, 4990, + 4991, 0, 0, 4992, 4993, 4994, 4995, 4996, + 4997, 4998, 4999, 5000, 5001, 5002, 5003, 5004, + 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, + 5013, 5014, 5015, 5016, 5017, 5018, 5019, 5020, + 5021, 5022, 5023, 5024, 5025, 5026, 5027, 5028, + 5029, 5030, 5031, 5032, 5033, 5034, 5035, 5036, + 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, + 5045, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 5046, 5047, 5048, 5049, 5050, 5051, 5052, + 5053, 5054, 5055, 5056, 5057, 5058, 1085, 0, + 0, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 5059, 5060, 5061, 5062, 5063, 5064, 5065, + 5066, 5067, 5068, 0, 0, 0, 0, 0, + 0, 540, 540, 540, 540, 540, 540, 540, + 553, 553, 553, 553, 553, 553, 553, 540, + 540, 5069, 5070, 5071, 5072, 5072, 5073, 5074, + 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, + 5083, 5084, 5085, 5086, 5087, 5088, 1428, 1428, + 5089, 5090, 5091, 5091, 5091, 5091, 5092, 5092, + 5092, 5093, 5094, 5095, 0, 5096, 5097, 5098, + 5099, 5100, 5101, 5102, 5103, 5104, 5105, 5106, + 5107, 5108, 5109, 5110, 5111, 5112, 5113, 5114, + 0, 5115, 5116, 5117, 5118, 0, 0, 0, + 0, 5119, 5120, 5121, 1118, 5122, 0, 5123, + 5124, 5125, 5126, 5127, 5128, 5129, 5130, 5131, + 5132, 5133, 5134, 5135, 5136, 5137, 5138, 5139, + 5140, 5141, 5142, 5143, 5144, 5145, 5146, 5147, + 5148, 5149, 5150, 5151, 5152, 5153, 5154, 5155, + 5156, 5157, 5158, 5159, 5160, 5161, 5162, 5163, + 5164, 5165, 5166, 5167, 5168, 5169, 5170, 5171, + 5172, 5173, 5174, 5175, 5176, 5177, 5178, 5179, + 5180, 5181, 5182, 5183, 5184, 5185, 5186, 5187, + 5188, 5189, 5190, 5191, 5192, 5193, 5194, 5195, + 5196, 5197, 5198, 5199, 5200, 5201, 5202, 5203, + 5204, 5205, 5206, 5207, 5208, 5209, 5210, 5211, + 5212, 5213, 5214, 5215, 5216, 5217, 5218, 5219, + 5220, 5221, 5222, 5223, 5224, 5225, 5226, 5227, + 5228, 5229, 5230, 5231, 5232, 5233, 5234, 5235, + 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, + 5244, 5245, 5246, 5247, 5248, 5249, 5250, 5251, + 5252, 5253, 5254, 5255, 5256, 5257, 0, 0, + 81, 0, 5258, 5259, 5260, 5261, 5262, 5263, + 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, + 5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, + 5280, 5281, 5282, 5283, 5284, 5285, 5286, 5287, + 5288, 5289, 5290, 5291, 5292, 5293, 5294, 5295, + 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, + 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, + 5312, 5313, 5314, 5315, 5316, 5317, 5318, 5319, + 5320, 5321, 5322, 5323, 5324, 5325, 5326, 5327, + 5328, 5329, 5330, 5331, 5332, 5333, 5334, 5335, + 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, + 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, + 5352, 5353, 5354, 5355, 5356, 5357, 5358, 5359, + 5360, 5361, 5362, 5363, 5364, 5365, 5366, 5367, + 5368, 5369, 5370, 5371, 5372, 5373, 5374, 5375, + 5376, 5377, 5378, 5379, 5380, 5381, 5382, 5383, + 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, + 5392, 5393, 5394, 5395, 5396, 5397, 5398, 5399, + 5400, 5401, 5402, 5403, 5404, 5405, 5406, 5407, + 5408, 5409, 5410, 5411, 5412, 5413, 5414, 5415, + 5416, 5417, 5418, 5419, 5420, 5421, 5422, 5423, + 5424, 5425, 5426, 5427, 5428, 5429, 5430, 5431, + 5432, 5433, 5434, 5435, 5436, 5437, 5438, 5439, + 5440, 5441, 5442, 5443, 5444, 5445, 5446, 5447, + 0, 0, 0, 5448, 5449, 5450, 5451, 5452, + 5453, 0, 0, 5454, 5455, 5456, 5457, 5458, + 5459, 0, 0, 5460, 5461, 5462, 5463, 5464, + 5465, 0, 0, 5466, 5467, 5468, 0, 0, + 0, 5469, 5470, 5471, 5472, 5473, 5474, 5475, + 0, 5476, 5477, 5478, 5479, 5480, 5481, 5482, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 5483, 5483, 5483, 1085, 77, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 0, 340, 1160, + 1160, 340, 340, 340, 1160, 340, 340, 340, + 340, 340, 340, 340, 340, 1160, 340, 340, + 340, 340, 340, 1160, 1160, 1160, 340, 340, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 1160, + 340, 340, 340, 340, 0, 340, 340, 0, + 340, 340, 1160, 340, 340, 1160, 1160, 1160, + 340, 340, 340, 1160, 1160, 340, 1160, 0, + 0, 340, 340, 1160, 340, 340, 1160, 340, + 1160, 1160, 1160, 340, 1160, 1160, 1160, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 1160, 1160, 1160, 1160, 340, + 340, 340, 340, 1160, 1160, 1160, 1160, 1160, + 340, 1160, 340, 340, 340, 340, 1160, 1160, + 1160, 1160, 1160, 340, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 340, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 340, 1160, 340, 1160, + 1160, 1160, 1160, 1160, 340, 340, 1160, 1160, + 1160, 1160, 1160, 1160, 340, 1160, 1160, 1160, + 1160, 1160, 340, 340, 340, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 340, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 0, 0, 0, 0, + 0, 1044, 9, 1044, 0, 0, 0, 0, + 5484, 5484, 5484, 5484, 5484, 5484, 5484, 5484, + 5484, 5484, 5484, 5484, 5484, 5484, 5484, 5484, + 5484, 5484, 5484, 5484, 5484, 5484, 5484, 5484, + 5484, 5484, 1190, 5484, 1190, 5484, 1190, 1190, + 1190, 1190, 1190, 1190, 5484, 1190, 5484, 1190, + 1190, 1190, 1190, 1190, 1190, 0, 0, 0, + 1191, 838, 1191, 838, 838, 838, 838, 838, + 1191, 5485, 5485, 5485, 5485, 5485, 5485, 5485, + 5485, 5485, 5485, 5485, 5485, 5485, 5485, 5485, + 5485, 5485, 5485, 5485, 5485, 5485, 5485, 5485, + 5485, 5485, 5485, 5485, 5485, 5485, 5485, 5485, + 5485, 5485, 5485, 5485, 5485, 5485, 5485, 5485, + 5485, 5485, 5486, 5486, 5486, 5486, 5486, 5486, + 5485, 5486, 5485, 5485, 5485, 5485, 1427, 1427, + 1220, 1427, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 1085, 77, 1427, 1427, 77, 838, 838, + 0, 77, 77, 77, 77, 77, 77, 77, + 1085, 1085, 1085, 77, 77, 0, 0, 0, + 0, 77, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 553, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 1160, + 1160, 340, 340, 340, 340, 340, 340, 340, + 340, 1160, 340, 1160, 340, 340, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 1160, 340, 340, 340, 340, 340, 340, + 1160, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 553, 5487, 5487, 5487, 5487, 5487, 5487, + 5487, 5487, 5487, 5487, 5487, 5487, 5487, 5487, + 5487, 5487, 5487, 5487, 5487, 5487, 5487, 5487, + 5487, 5487, 5487, 5487, 5487, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 5484, 5484, 5484, 5484, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 1426, 340, 340, 340, 340, 340, + 340, 340, 340, 1426, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 540, + 540, 540, 540, 540, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 0, + 1177, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1177, 2227, 2227, 2227, 2227, 2227, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 5488, 5489, 5490, 5491, 5492, 5493, 5494, + 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502, + 5503, 5504, 5505, 5506, 5507, 5508, 5509, 5510, + 5511, 5512, 5513, 5514, 5515, 5516, 5517, 5518, + 5519, 5520, 5521, 5522, 5523, 5524, 5525, 5526, + 5527, 5528, 5529, 5530, 5531, 5532, 5533, 5534, + 5535, 5536, 5537, 5538, 5539, 5540, 5541, 5542, + 5543, 5544, 5545, 5546, 5547, 5548, 5549, 5550, + 5551, 5552, 5553, 5554, 5555, 5556, 5557, 5558, + 5559, 5560, 5561, 5562, 5563, 5564, 5565, 5566, + 5567, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 1160, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 1160, + 340, 1160, 340, 340, 1160, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 1160, 0, + 0, 1250, 1250, 1250, 1250, 1250, 1250, 1250, + 1250, 1250, 1250, 0, 0, 0, 0, 0, + 0, 5568, 5569, 5570, 5571, 5572, 5573, 5574, + 5575, 5576, 5577, 5578, 5579, 5580, 5581, 5582, + 5583, 5584, 5585, 5586, 5587, 5588, 5589, 5590, + 5591, 5592, 5593, 5594, 5595, 5596, 5597, 5598, + 5599, 5600, 5601, 5602, 5603, 0, 0, 0, + 0, 5604, 5605, 5606, 5607, 5608, 5609, 5610, + 5611, 5612, 5613, 5614, 5615, 5616, 5617, 5618, + 5619, 5620, 5621, 5622, 5623, 5624, 5625, 5626, + 5627, 5628, 5629, 5630, 5631, 5632, 5633, 5634, + 5635, 5636, 5637, 5638, 5639, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1044, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 1160, 340, 340, 340, + 340, 1160, 340, 1160, 1160, 1160, 340, 340, + 340, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 340, 340, 1160, 340, 340, 1160, 1160, + 340, 340, 1160, 1160, 1160, 1160, 340, 1160, + 340, 340, 340, 340, 340, 1160, 1160, 1160, + 340, 1160, 340, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 340, 1160, 1160, 1160, 340, + 1160, 1160, 340, 340, 1160, 1160, 1160, 1160, + 1160, 1160, 340, 340, 1160, 1160, 1160, 340, + 340, 340, 340, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 340, 1160, 1160, 1160, 1160, + 340, 1160, 1160, 340, 340, 340, 1160, 1160, + 1160, 1160, 340, 340, 340, 1160, 1160, 1160, + 1160, 340, 1160, 1160, 1160, 1160, 1160, 1160, + 340, 1160, 1160, 1160, 1160, 1160, 340, 340, + 1160, 1160, 340, 1160, 1160, 340, 1160, 1160, + 1160, 1160, 1160, 340, 1160, 1160, 1160, 340, + 1160, 1160, 340, 1160, 1160, 340, 1160, 340, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 340, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 340, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 340, 340, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 340, 1160, + 340, 340, 340, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 340, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 340, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 1160, 1160, 1160, 1160, 1160, 1160, + 340, 340, 1160, 1160, 340, 1160, 340, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1156, 1156, 1156, 1106, 1156, 1106, 0, + 0, 1156, 0, 1106, 1156, 1156, 1156, 1156, + 1156, 1106, 1156, 1106, 1156, 1156, 1156, 1156, + 1156, 1156, 1106, 1156, 1156, 1156, 1156, 1106, + 1156, 1106, 1156, 1156, 1106, 1106, 1156, 1106, + 1156, 1106, 1106, 1106, 1106, 1156, 1106, 1106, + 1106, 1106, 1106, 1156, 1106, 1156, 1106, 0, + 1156, 1106, 0, 0, 0, 1156, 0, 0, + 1156, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 0, + 1103, 5640, 5640, 5640, 5640, 5640, 5640, 5640, + 5640, 1156, 1156, 1156, 1106, 1106, 1106, 1106, + 1156, 1106, 1106, 1156, 1106, 1156, 1106, 1106, + 1156, 1156, 1106, 1156, 1156, 1106, 1156, 1156, + 5641, 5641, 5640, 5640, 5642, 5642, 5642, 5642, + 5640, 1156, 1106, 1156, 1156, 1156, 1106, 1106, + 1106, 1106, 1106, 1156, 1156, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1156, + 1156, 1106, 1156, 1156, 1106, 1106, 1106, 1106, + 0, 0, 0, 0, 0, 0, 0, 0, + 5640, 5640, 5640, 5640, 5640, 5640, 5640, 5640, + 5640, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 0, 1106, 1106, 0, + 0, 0, 0, 0, 5640, 5640, 5640, 5640, + 5640, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 5640, + 5640, 5640, 5640, 5640, 5640, 0, 0, 0, + 9, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 0, 0, 0, 0, 0, + 1103, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1156, 1106, 1156, 1156, 1156, 1156, 1156, + 1106, 1156, 1156, 1156, 1156, 1156, 1156, 1156, + 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, + 1106, 1156, 1156, 1156, 1156, 1156, 1156, 1106, + 1156, 1156, 1106, 1156, 1106, 1156, 1106, 1106, + 1106, 1106, 1156, 1106, 1156, 1106, 1156, 1106, + 1106, 1106, 1156, 1106, 1156, 1106, 1156, 1156, + 1106, 0, 0, 0, 0, 5642, 5640, 1106, + 1156, 5640, 5640, 5640, 5640, 5642, 5642, 5642, + 5640, 5640, 5642, 5642, 5642, 5642, 5642, 5642, + 5642, 0, 0, 5642, 5642, 5642, 5642, 5642, + 5642, 5642, 5642, 5642, 5642, 5642, 5642, 5642, + 5642, 5642, 5642, 5642, 5642, 5642, 5642, 5642, + 5642, 5642, 5642, 5642, 5642, 5642, 5642, 5642, + 5642, 5642, 5642, 5642, 5642, 5642, 5642, 5640, + 5640, 5640, 5640, 5642, 5640, 5642, 5642, 5642, + 5642, 1156, 1153, 1153, 1153, 0, 1153, 1153, + 0, 0, 0, 0, 0, 1153, 553, 1153, + 540, 1156, 1156, 1156, 1156, 0, 1156, 1156, + 1156, 0, 1156, 1156, 1156, 1156, 1156, 1156, + 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, + 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, + 1156, 1156, 1156, 1156, 1156, 0, 0, 0, + 0, 540, 566, 553, 0, 0, 0, 0, + 1168, 5642, 5642, 5642, 5642, 5642, 5642, 5642, + 5642, 0, 0, 0, 0, 0, 0, 0, + 0, 1158, 1158, 1158, 1158, 1158, 1158, 1158, + 1158, 1158, 0, 0, 0, 0, 0, 0, + 0, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 5640, 5640, + 1103, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 5640, 5640, + 5640, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1106, 1156, 1156, 1106, 1106, 1106, 1156, + 1106, 5643, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1156, 1156, 1156, 1106, 1156, 1156, 1156, + 1106, 1156, 1156, 1156, 1156, 1156, 1156, 1156, + 1156, 1156, 1106, 1156, 1156, 1106, 540, 553, + 0, 0, 0, 0, 5640, 5642, 5642, 5642, + 5642, 1158, 1158, 1158, 1158, 1103, 1103, 1103, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1106, 1156, 1156, 1156, 1156, 1106, 1106, + 1106, 1156, 1156, 1156, 1156, 1106, 1106, 1106, + 1106, 1106, 1156, 1156, 1156, 1156, 1106, 1156, + 1106, 1106, 1106, 1106, 1156, 1106, 1106, 1106, + 1106, 1156, 1156, 1106, 1106, 1106, 1106, 1106, + 1156, 1106, 1106, 1156, 1156, 1106, 1106, 1106, + 1106, 1106, 1156, 1156, 1156, 1156, 1156, 0, + 0, 0, 9, 9, 9, 9, 9, 9, + 9, 1156, 1156, 1106, 1106, 1156, 1106, 1106, + 1106, 1156, 1106, 1156, 1106, 1156, 1156, 1106, + 1106, 1156, 1156, 1106, 1106, 1106, 1106, 0, + 0, 5640, 5640, 5640, 5640, 5640, 5640, 5642, + 5640, 1106, 1106, 1106, 1106, 1156, 1106, 1106, + 1156, 1106, 1106, 1106, 1106, 1156, 1106, 1156, + 1106, 1106, 1156, 1106, 0, 0, 0, 0, + 0, 5640, 5640, 5640, 5640, 5640, 5640, 5640, + 5640, 1106, 1156, 1106, 1156, 1106, 1106, 1106, + 1156, 1106, 1156, 1106, 1106, 1106, 1156, 1106, + 1106, 1156, 1106, 0, 0, 0, 0, 0, + 0, 0, 1158, 1158, 1158, 1158, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 5640, 5640, 5640, 5642, 5640, 5640, + 5642, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, + 1106, 1106, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 5644, 5645, 5646, 5647, 5648, 5649, 5650, + 5651, 5652, 5653, 5654, 5655, 5656, 5657, 5658, + 5659, 5660, 5661, 5662, 5663, 5664, 5665, 5666, + 5667, 5668, 5669, 5670, 5671, 5672, 5673, 5674, + 5675, 5676, 5677, 5678, 5679, 5680, 5681, 5682, + 5683, 5684, 5685, 5686, 5687, 5688, 5689, 5690, + 5691, 5692, 5693, 5694, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 5695, 5696, 5697, 5698, 5699, 5700, 5701, + 5702, 5703, 5704, 5705, 5706, 5707, 5708, 5709, + 5710, 5711, 5712, 5713, 5714, 5715, 5716, 5717, + 5718, 5719, 5720, 5721, 5722, 5723, 5724, 5725, + 5726, 5727, 5728, 5729, 5730, 5731, 5732, 5733, + 5734, 5735, 5736, 5737, 5738, 5739, 5740, 5741, + 5742, 5743, 5744, 5745, 0, 0, 0, 0, + 0, 0, 0, 5640, 5640, 5640, 5640, 5640, + 5640, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 5746, 5746, 5747, 5746, 5746, 5746, 5746, + 5746, 5747, 5746, 5746, 5747, 5747, 5747, 5746, + 5746, 5747, 5746, 5746, 5746, 5747, 5747, 5746, + 5747, 5747, 5746, 5746, 5747, 5747, 5747, 5747, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1159, 1153, 1159, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1168, + 1177, 1177, 1177, 1177, 1177, 1177, 1177, 0, + 0, 0, 0, 1220, 1220, 1220, 1220, 1220, + 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, + 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1168, 1153, 1153, 1159, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 5748, 5749, 5750, 5751, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 5752, 1160, + 1160, 1160, 1160, 1160, 5753, 1160, 1160, 1160, + 1160, 1159, 1159, 1159, 1153, 1153, 1153, 1153, + 1159, 1159, 1168, 5754, 1177, 1177, 5755, 1177, + 1177, 1177, 1177, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 0, 0, 0, 0, 0, 0, + 0, 1250, 1250, 1250, 1250, 1250, 1250, 1250, + 1250, 1250, 1250, 0, 0, 0, 0, 0, + 0, 540, 540, 540, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 5756, 1153, 1153, 1153, 1153, 1159, 1153, 5757, + 5758, 1153, 5759, 5760, 1168, 1168, 0, 1178, + 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1177, 1177, 1177, 1177, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 340, 340, 340, 1160, 340, 340, + 340, 340, 1160, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 1160, 340, 1160, + 1160, 1160, 1160, 1160, 340, 1160, 340, 1160, + 340, 340, 340, 340, 1180, 1044, 1044, 1160, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1153, 1153, 1159, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1159, 1159, 1159, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1159, 1452, 1160, 1237, 1237, 1160, 1177, 1177, + 1177, 1177, 1177, 1180, 1153, 1153, 1177, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 1160, 1177, 1160, 1177, 1177, + 1177, 0, 1190, 1190, 1190, 1190, 1190, 1190, + 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, + 1190, 1190, 1190, 1190, 1190, 1190, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 0, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1159, 1159, 1159, + 1153, 1153, 1153, 1159, 1159, 1153, 1452, 1180, + 1153, 1177, 1177, 1177, 1177, 1177, 1177, 1153, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 1160, 0, 1160, 1160, 1160, 1160, 0, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 0, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1177, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1153, 1159, 1159, 1159, 1153, 1153, 1153, 1153, + 1153, 1153, 1180, 1168, 0, 0, 0, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 0, 0, 0, 0, + 0, 1153, 1153, 1159, 1159, 0, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 0, 0, + 1160, 1160, 0, 0, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 0, 1160, 1160, + 1160, 1160, 1160, 0, 0, 1180, 1160, 5761, + 1159, 1153, 1159, 1159, 1159, 1159, 0, 0, + 5762, 1159, 0, 0, 5763, 5764, 1452, 0, + 0, 1160, 0, 0, 0, 0, 0, 0, + 5765, 0, 0, 0, 0, 0, 1160, 1160, + 1160, 1160, 1160, 1159, 1159, 0, 0, 540, + 540, 540, 540, 540, 540, 540, 0, 0, + 0, 540, 540, 540, 540, 540, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1159, 1159, + 1159, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1159, 1159, 1168, 1153, 1153, 1159, 1180, + 1160, 1160, 1160, 1160, 1177, 1177, 1177, 1177, + 1177, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 1177, 0, 1177, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 5766, 1159, 1159, 1153, 1153, 1153, 1153, + 1153, 1153, 5767, 5768, 5769, 5770, 5771, 5772, + 1153, 1153, 1159, 1168, 1180, 1160, 1160, 1177, + 1160, 0, 0, 0, 0, 0, 0, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 5773, 1159, 1159, 1153, 1153, 1153, 1153, 0, + 0, 5774, 5775, 5776, 5777, 1153, 1153, 1159, + 1168, 1180, 1177, 1177, 1177, 1177, 1177, 1177, + 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, + 1177, 1160, 1160, 1160, 1160, 1153, 1153, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1159, 1159, 1159, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1159, 1159, 1153, 1159, + 1168, 1153, 1177, 1177, 1177, 1160, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 0, 0, 0, 0, + 0, 1428, 1428, 1428, 1428, 1428, 1428, 1428, + 1428, 1428, 1428, 1428, 1428, 1428, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1153, 1159, 1153, 1159, + 1159, 1153, 1153, 1153, 1153, 1153, 1153, 1452, + 1180, 0, 0, 0, 0, 0, 0, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 0, 0, 0, 1153, 1153, + 1153, 1159, 1159, 1153, 1153, 1153, 1153, 1159, + 1153, 1153, 1153, 1153, 1168, 0, 0, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 1190, 1190, 1177, 1177, 1177, + 1191, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 5778, 5779, 5780, 5781, 5782, 5783, 5784, + 5785, 5786, 5787, 5788, 5789, 5790, 5791, 5792, + 5793, 5794, 5795, 5796, 5797, 5798, 5799, 5800, + 5801, 5802, 5803, 5804, 5805, 5806, 5807, 5808, + 5809, 5810, 5811, 5812, 5813, 5814, 5815, 5816, + 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, + 5825, 5826, 5827, 5828, 5829, 5830, 5831, 5832, + 5833, 5834, 5835, 5836, 5837, 5838, 5839, 5840, + 5841, 1250, 1250, 1250, 1250, 1250, 1250, 1250, + 1250, 1250, 1250, 5484, 5484, 5484, 5484, 5484, + 5484, 5484, 5484, 5484, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 340, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 0, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 5842, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 0, 1153, 1153, 1153, 1153, 1153, 1153, 1159, + 5843, 1160, 1177, 1177, 1177, 1177, 1177, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, + 1178, 1178, 1178, 1190, 1190, 1190, 1190, 1190, + 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, + 1190, 1190, 1190, 1190, 1190, 1190, 0, 0, + 0, 1044, 1044, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 0, 0, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 0, 1159, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1159, 1153, 1153, 1159, 1153, 1153, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, + 0, 1044, 1044, 1044, 1044, 1044, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 0, 1250, 1250, 1250, 1250, 1250, 1250, 1250, + 1250, 1250, 1250, 0, 0, 0, 0, 1044, + 1044, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 0, + 0, 566, 566, 566, 566, 566, 1044, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 540, 540, 540, 540, 540, 540, 540, + 1044, 1044, 1044, 1044, 1044, 838, 838, 838, + 838, 523, 523, 523, 523, 1044, 838, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1250, 1250, 1250, 1250, 1250, 1250, 1250, + 1250, 1250, 1250, 0, 5484, 5484, 5484, 5484, + 5484, 5484, 5484, 0, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 0, 0, 0, 0, 0, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1159, 1159, 1159, 1159, 1159, 1159, + 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, + 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, + 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, + 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, + 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1153, 1153, 1153, 1153, 1179, 1179, 1179, 1179, + 1179, 1179, 1179, 1179, 1179, 1179, 1179, 1179, + 1179, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1179, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 1160, 1160, + 1160, 1160, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 1160, 1160, 340, 340, + 1160, 1160, 340, 340, 1160, 1160, 1160, 1160, + 340, 340, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 1160, 1160, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 1160, 340, 340, 340, 1160, 340, 340, + 1160, 1160, 1160, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 340, 1160, 340, 340, 340, 340, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 0, 0, 0, 0, 0, 0, + 0, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 0, 0, 1191, 1153, 566, + 1177, 81, 81, 81, 81, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 838, 838, 838, 838, 838, 838, 838, + 838, 1191, 1191, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 1191, 838, 1191, 838, + 838, 838, 1191, 838, 838, 838, 1191, 1191, + 1191, 838, 1191, 838, 1191, 838, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 838, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 838, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 838, 838, 1191, 1191, 1191, 1191, 1191, 838, + 838, 838, 838, 1191, 838, 1191, 1191, 1191, + 838, 838, 838, 1191, 1191, 1191, 1191, 1191, + 838, 1191, 1191, 1191, 838, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 838, 1191, 1191, 1191, 838, + 838, 838, 1191, 1191, 838, 838, 838, 838, + 1191, 1191, 838, 838, 838, 1191, 1191, 838, + 838, 838, 838, 1191, 1191, 1191, 1191, 1191, + 838, 838, 838, 838, 838, 838, 1191, 838, + 838, 1191, 1191, 1191, 838, 1191, 1191, 1191, + 1191, 838, 838, 1191, 838, 1191, 838, 1191, + 1191, 1191, 1191, 1191, 1191, 838, 838, 838, + 1191, 1191, 838, 838, 838, 1191, 838, 1191, + 838, 1191, 838, 838, 1191, 1191, 1191, 1191, + 838, 1191, 1191, 1191, 838, 1191, 1191, 1191, + 1191, 838, 1191, 1191, 1191, 838, 1191, 1191, + 1191, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 1191, + 838, 1191, 838, 838, 838, 838, 838, 838, + 838, 1191, 838, 1191, 838, 838, 838, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 838, 1191, 838, 838, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 838, + 838, 838, 1191, 1191, 1191, 1191, 838, 838, + 0, 0, 1191, 838, 1191, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 1191, + 1191, 1191, 1191, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 5844, 5845, 1191, 838, 838, 1191, 838, 5846, + 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, + 566, 566, 566, 1191, 1191, 1191, 5855, 5856, + 5857, 5858, 5859, 5860, 81, 81, 81, 81, + 81, 81, 81, 81, 553, 553, 553, 553, + 553, 553, 553, 553, 838, 838, 540, 540, + 540, 540, 540, 553, 553, 838, 838, 838, + 838, 838, 838, 1191, 1191, 838, 838, 1191, + 1191, 1191, 1191, 838, 838, 1191, 1191, 838, + 838, 838, 838, 838, 1191, 1191, 838, 1191, + 1191, 838, 838, 540, 540, 540, 540, 1191, + 1191, 1191, 1191, 1191, 1191, 838, 1191, 1191, + 1191, 1191, 5861, 5862, 5863, 5864, 5865, 5866, + 5867, 5868, 838, 838, 838, 838, 838, 838, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 838, 838, 838, 838, 838, 838, 838, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 540, 540, 540, 1085, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1190, 1190, 1190, 1190, 1190, 1190, 1190, + 1190, 1190, 5484, 1190, 1190, 1190, 1190, 1190, + 1190, 1190, 1190, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 5869, 2157, 2132, 5870, 2159, 2160, 5871, + 2139, 2142, 5872, 5873, 2143, 2162, 2145, 5874, + 2147, 2148, 2149, 5875, 5876, 5877, 5878, 5879, + 5880, 5881, 2153, 5882, 5883, 5884, 5885, 2158, + 5886, 2138, 2140, 2168, 2177, 5887, 2144, 5888, + 5889, 2163, 5890, 5891, 5892, 5893, 5894, 5895, + 5896, 5897, 5898, 5899, 5900, 5901, 5902, 5903, + 2175, 5904, 5905, 5906, 5907, 5908, 5909, 5910, + 5911, 5912, 5913, 5914, 5915, 5916, 5917, 5918, + 5919, 5920, 5921, 5922, 5923, 5924, 5925, 5926, + 5927, 5928, 2176, 5929, 5930, 5931, 0, 5932, + 5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, + 5941, 5942, 5943, 5944, 5945, 5946, 5947, 5948, + 5949, 5901, 5902, 5903, 2175, 5904, 5905, 5906, + 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, + 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, + 5923, 5924, 5925, 5926, 5927, 5928, 2176, 5929, + 5930, 5931, 5950, 5932, 5933, 5934, 5935, 5936, + 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, + 5945, 5946, 5947, 5948, 5949, 5901, 0, 5903, + 2175, 0, 0, 5906, 0, 0, 5909, 5910, + 0, 0, 5913, 5914, 5915, 5916, 0, 5918, + 5919, 5920, 5921, 5922, 5923, 5924, 5925, 5926, + 5927, 5928, 2176, 0, 5930, 0, 5950, 5932, + 5933, 5934, 5935, 5936, 5937, 0, 5939, 5940, + 5941, 5942, 5943, 5944, 5945, 5946, 5947, 5948, + 5949, 5901, 5902, 5903, 2175, 5904, 5905, 5906, + 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, + 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, + 5923, 5924, 5925, 5926, 5927, 5928, 2176, 5929, + 5930, 5931, 5950, 5932, 5933, 5934, 5935, 5936, + 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, + 5945, 5946, 5947, 5948, 5949, 5869, 2157, 0, + 5870, 2159, 2160, 5871, 0, 0, 5872, 5873, + 2143, 2162, 2145, 5874, 2147, 2148, 0, 5875, + 5876, 5877, 5878, 5879, 5880, 5881, 0, 5882, + 5883, 5884, 5885, 2158, 5886, 2138, 2140, 2168, + 2177, 5887, 2144, 5888, 5889, 2163, 5890, 5891, + 5892, 5893, 5894, 5895, 5896, 5897, 5898, 5899, + 5900, 5869, 2157, 0, 5870, 2159, 2160, 5871, + 0, 2142, 5872, 5873, 2143, 2162, 0, 5874, + 0, 0, 0, 5875, 5876, 5877, 5878, 5879, + 5880, 5881, 0, 5882, 5883, 5884, 5885, 2158, + 5886, 2138, 2140, 2168, 2177, 5887, 2144, 5888, + 5889, 2163, 5890, 5891, 5892, 5893, 5894, 5895, + 5896, 5897, 5898, 5899, 5900, 5869, 2157, 2132, + 5870, 2159, 2160, 5871, 2139, 2142, 5872, 5873, + 2143, 2162, 2145, 5874, 2147, 2148, 2149, 5875, + 5876, 5877, 5878, 5879, 5880, 5881, 2153, 5882, + 5883, 5884, 5885, 2158, 5886, 2138, 2140, 2168, + 2177, 5887, 2144, 5888, 5889, 2163, 5890, 5891, + 5892, 5893, 5894, 5895, 5896, 5897, 5898, 5899, + 5900, 5869, 2157, 2132, 5870, 2159, 2160, 5871, + 2139, 2142, 5872, 5873, 2143, 2162, 2145, 5874, + 2147, 2148, 2149, 5875, 5876, 5877, 5878, 5879, + 5880, 5881, 2153, 5882, 5883, 5884, 5885, 2158, + 5886, 2138, 2140, 2168, 2177, 5887, 2144, 5888, + 5889, 2163, 5890, 5891, 5892, 5893, 5894, 5895, + 5896, 5897, 5898, 5899, 5900, 5869, 2157, 2132, + 5870, 2159, 2160, 5871, 2139, 2142, 5872, 5873, + 2143, 2162, 2145, 5874, 2147, 2148, 2149, 5875, + 5876, 5877, 5878, 5879, 5880, 5881, 2153, 5882, + 5883, 5884, 5885, 2158, 5886, 2138, 2140, 2168, + 2177, 5887, 2144, 5888, 5889, 2163, 5890, 5891, + 5892, 5893, 5894, 5895, 5896, 5897, 5898, 5899, + 5900, 5901, 5902, 5903, 2175, 5904, 5905, 5906, + 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, + 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, + 5923, 5924, 5925, 5926, 5927, 5928, 2176, 5929, + 5930, 5931, 5950, 5932, 5933, 5934, 5935, 5936, + 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, + 5945, 5946, 5947, 5948, 5949, 5901, 5902, 5903, + 2175, 5904, 5905, 5906, 5907, 5908, 5909, 5910, + 5911, 5912, 5913, 5914, 5915, 5916, 5917, 5918, + 5919, 5920, 5921, 5922, 5923, 5924, 5925, 5926, + 5927, 5928, 2176, 5929, 5930, 5931, 5950, 5932, + 5933, 5934, 5935, 5936, 5937, 5938, 5939, 5940, + 5941, 5942, 5943, 5944, 5945, 5946, 5947, 5948, + 5949, 5901, 5902, 5903, 2175, 5904, 5905, 5906, + 5907, 5908, 5909, 5910, 5911, 5912, 5913, 5914, + 5915, 5916, 5917, 5918, 5919, 5920, 5921, 5922, + 5923, 5924, 5925, 5926, 5927, 5928, 2176, 5929, + 5930, 5931, 5950, 5932, 5933, 5934, 5935, 5936, + 5937, 5938, 5939, 5940, 5941, 5942, 5943, 5944, + 5945, 5946, 5947, 5948, 5949, 5951, 5952, 0, + 0, 5953, 5954, 2172, 5955, 5956, 5957, 5958, + 5959, 5960, 5961, 5962, 5963, 5964, 5965, 5966, + 5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, + 5975, 5976, 5977, 5978, 5979, 5980, 5981, 5982, + 5983, 5984, 5985, 5986, 5987, 5988, 5989, 5990, + 5991, 5992, 5993, 5994, 5995, 5996, 5997, 5998, + 5999, 6000, 6001, 6002, 6003, 6004, 6005, 6006, + 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, + 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, + 6023, 6024, 2173, 6025, 6026, 6027, 6028, 6029, + 6030, 6031, 6032, 6033, 6034, 6035, 6036, 2171, + 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, + 6045, 6046, 6047, 6048, 2170, 6049, 6050, 6051, + 6052, 6053, 6054, 6055, 6056, 6057, 6058, 6059, + 6005, 6060, 6061, 6062, 6063, 6010, 6011, 6012, + 6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, + 6021, 6022, 6023, 6024, 2173, 6025, 6026, 6027, + 6028, 6029, 6030, 6031, 6032, 6033, 6034, 6035, + 6036, 2171, 6037, 6038, 6039, 6040, 6041, 6042, + 6043, 6044, 6045, 6046, 6047, 6048, 2170, 6049, + 6050, 6051, 6052, 6053, 6054, 6055, 6056, 6057, + 6058, 6059, 6064, 6060, 6061, 6062, 6063, 5953, + 5954, 2172, 5955, 5956, 5957, 5958, 5959, 5960, + 5961, 5962, 5963, 5964, 5965, 5966, 5967, 5968, + 5969, 5970, 5971, 5972, 5973, 5974, 5975, 5976, + 5977, 5978, 5979, 5980, 5981, 5982, 5983, 5984, + 5985, 5986, 5987, 5988, 5989, 5990, 5991, 5992, + 5993, 5994, 5995, 5996, 5997, 5998, 5999, 6000, + 6001, 6002, 6003, 6004, 6005, 6006, 6007, 6008, + 6009, 6010, 6011, 6012, 6013, 6014, 6015, 6016, + 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, + 2173, 6025, 6026, 6027, 6028, 6029, 6030, 6031, + 6032, 6033, 6034, 6035, 6036, 2171, 6037, 6038, + 6039, 6040, 6041, 6042, 6043, 6044, 6045, 6046, + 6047, 6048, 2170, 6049, 6050, 6051, 6052, 6053, + 6054, 6055, 6056, 6057, 6058, 6059, 6064, 6060, + 6061, 6062, 6063, 6065, 6066, 0, 0, 6067, + 6068, 6069, 6070, 6071, 6072, 6073, 6074, 6075, + 6076, 6067, 6068, 6069, 6070, 6071, 6072, 6073, + 6074, 6075, 6076, 6067, 6068, 6069, 6070, 6071, + 6072, 6073, 6074, 6075, 6076, 6067, 6068, 6069, + 6070, 6071, 6072, 6073, 6074, 6075, 6076, 6077, + 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, + 6086, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 838, 838, 838, 838, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 838, 838, + 838, 838, 838, 838, 838, 838, 1153, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 1153, 838, 838, + 1044, 1044, 1044, 1044, 1044, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1153, 1153, 1153, 1153, + 1153, 0, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, + 1153, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 540, 540, 540, 540, 540, 540, 540, + 0, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 0, 0, 540, 540, 540, 540, + 540, 540, 540, 0, 540, 540, 0, 540, + 540, 540, 540, 540, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1156, 1156, 1156, 1156, 1156, 1156, 1156, + 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, + 1156, 1156, 1156, 1156, 1106, 1106, 1106, 1106, + 1106, 1156, 1156, 1106, 1106, 1106, 1106, 1106, + 1156, 1106, 1156, 1106, 1106, 1106, 1156, 1106, + 1156, 1156, 1106, 1106, 1106, 1106, 1156, 1106, + 1106, 1106, 1156, 1156, 1106, 1156, 1156, 1156, + 1156, 1156, 1156, 1156, 1106, 1106, 1156, 1156, + 1156, 1156, 1156, 1106, 1156, 1106, 1106, 1106, + 1106, 1106, 1156, 1156, 1106, 1106, 1106, 1106, + 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, + 1106, 1156, 1156, 1106, 1106, 1106, 1106, 1156, + 1156, 1156, 1156, 1106, 1156, 1156, 1156, 1156, + 1106, 1156, 1156, 1106, 1156, 1106, 1156, 1106, + 1156, 1156, 1106, 1106, 1106, 1106, 1106, 1156, + 1156, 1156, 1106, 1156, 1106, 1156, 1106, 1156, + 1156, 1156, 1156, 1106, 1156, 1156, 1156, 1156, + 1156, 1156, 1106, 1156, 1156, 1156, 1156, 1156, + 1156, 1106, 1106, 1156, 1156, 1156, 1106, 1106, + 1156, 1156, 1156, 1156, 1106, 1156, 1156, 1106, + 1156, 1156, 1156, 1156, 1106, 1156, 1156, 1106, + 1156, 1156, 1106, 1156, 1156, 1156, 1106, 1156, + 1156, 1156, 1156, 1106, 1106, 1156, 1156, 1106, + 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1106, + 1156, 1156, 1156, 1156, 1156, 1156, 0, 0, + 5642, 5642, 5642, 5642, 5642, 5642, 5642, 5642, + 5642, 553, 553, 553, 553, 553, 553, 553, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6087, 6088, 6089, 6090, 6091, 6092, 6093, + 6094, 6095, 6096, 6097, 6098, 6099, 6100, 6101, + 6102, 6103, 6104, 6105, 6106, 6107, 6108, 6109, + 6110, 6111, 6112, 6113, 6114, 6115, 6116, 6117, + 6118, 6119, 6120, 6121, 6122, 6123, 6124, 6125, + 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, + 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, + 6142, 6143, 6144, 6145, 6146, 6147, 6148, 6149, + 6150, 6151, 6152, 6153, 6154, 540, 540, 540, + 540, 540, 540, 1180, 0, 0, 0, 0, + 0, 1154, 1154, 1154, 1154, 1154, 1154, 1154, + 1154, 1154, 1154, 0, 0, 0, 0, 1103, + 1103, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6155, 6156, 6157, 6158, 0, 6159, 6160, + 6161, 6162, 6163, 6164, 6165, 6166, 6167, 6168, + 6169, 6170, 6171, 6172, 6173, 6174, 6175, 6176, + 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, + 6185, 0, 6156, 6157, 0, 6186, 0, 0, + 6161, 0, 6163, 6164, 6165, 6166, 6167, 6168, + 6169, 6170, 6171, 6172, 0, 6174, 6175, 6176, + 6177, 0, 6179, 0, 6181, 0, 0, 0, + 0, 0, 0, 6157, 0, 0, 0, 0, + 6161, 0, 6163, 0, 6165, 0, 6167, 6168, + 6169, 0, 6171, 6172, 0, 6174, 0, 0, + 6177, 0, 6179, 0, 6181, 0, 6183, 0, + 6185, 0, 6156, 6157, 0, 6187, 0, 0, + 6161, 6162, 6163, 6164, 0, 6166, 6167, 6168, + 6169, 6170, 6171, 6172, 0, 6174, 6175, 6176, + 6177, 0, 6179, 6180, 6181, 6182, 0, 6184, + 0, 6155, 6156, 6157, 6158, 6187, 6159, 6160, + 6161, 6162, 6163, 0, 6165, 6166, 6167, 6168, + 6169, 6170, 6171, 6172, 6173, 6174, 6175, 6176, + 6177, 6178, 6179, 6180, 6181, 0, 0, 0, + 0, 0, 6188, 6189, 6190, 0, 6191, 6192, + 6193, 6194, 6195, 0, 6196, 6197, 6198, 6199, + 6200, 6201, 6202, 6203, 6204, 6205, 6206, 6207, + 6208, 6209, 6210, 6211, 6212, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1109, 1109, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 0, 0, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 0, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 0, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6213, 6214, 6215, 6216, 6217, 6218, 6219, + 6220, 6221, 6222, 6223, 1220, 1220, 0, 0, + 0, 6224, 6225, 6226, 6227, 6228, 6229, 6230, + 6231, 6232, 6233, 6234, 6235, 6236, 6237, 6238, + 6239, 6240, 6241, 6242, 6243, 6244, 6245, 6246, + 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, + 0, 6255, 6256, 6257, 6258, 6259, 6260, 6261, + 6262, 6263, 6264, 6265, 6266, 6267, 6268, 6269, + 6270, 6271, 6272, 6273, 6274, 6275, 6276, 6277, + 6278, 6279, 6280, 6281, 3613, 6282, 6283, 6284, + 6285, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 6286, 6287, 0, 0, 0, + 0, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 6288, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 6289, + 6289, 6289, 6289, 6289, 6289, 6289, 6289, 6289, + 6289, 6289, 6289, 6289, 6289, 6289, 6289, 6289, + 6289, 6289, 6289, 6289, 6289, 6289, 6289, 6289, + 6289, 6290, 6291, 6292, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6293, 6294, 6295, 6296, 6297, 6298, 6299, + 6300, 6301, 6302, 6303, 6304, 6305, 6306, 6307, + 6308, 6309, 6310, 6311, 6312, 6313, 6314, 6315, + 6316, 6317, 6318, 6319, 6320, 6321, 6322, 6323, + 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, + 6332, 6333, 6334, 6335, 6336, 0, 0, 0, + 0, 6337, 6338, 6339, 6340, 6341, 6342, 6343, + 6344, 6345, 0, 0, 0, 0, 0, 0, + 0, 6346, 6347, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 2464, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 2464, 2464, 1085, 1085, + 1085, 1085, 1085, 2464, 2464, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 6348, 6348, 6348, 6348, + 6348, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 2464, 2464, 1085, 1085, 2464, + 2464, 2464, 2464, 2464, 2464, 2464, 2464, 2464, + 2464, 2464, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 6349, + 6349, 6349, 6349, 1085, 1085, 1085, 1085, 2464, + 1085, 2464, 2464, 2464, 2464, 2464, 2464, 2464, + 2464, 2464, 1085, 1085, 1085, 2464, 1085, 1085, + 1085, 1085, 2464, 2464, 2464, 1085, 2464, 2464, + 2464, 1085, 1085, 1085, 2465, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 2464, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 2464, 1085, + 1085, 1085, 1085, 2464, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 2464, 1085, 1085, 1085, 1085, 2464, 2464, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 77, 2465, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 2464, 2464, + 2464, 1085, 1085, 1085, 2464, 2464, 2464, 2464, + 2464, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 77, + 77, 77, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 2464, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 2464, 2464, 2464, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 2464, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 77, 77, 1085, 77, 77, + 77, 1085, 1085, 1085, 1085, 77, 77, 77, + 1085, 1085, 77, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 77, 1085, 77, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 77, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 77, 77, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 77, 77, 77, 1085, 1085, 1085, 77, 77, + 77, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 77, 77, 77, 77, 77, 77, 77, + 77, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 0, 0, 0, 0, 0, 0, 0, + 0, 77, 77, 77, 77, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 77, 77, 77, + 77, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 77, 77, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 2464, 2464, 2464, 2464, 2464, 2464, 2464, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 2464, + 1085, 0, 0, 0, 0, 0, 0, 0, + 0, 2464, 0, 0, 2464, 2464, 2464, 2464, + 2464, 2464, 2464, 1085, 1085, 2464, 2464, 2464, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, + 1085, 1085, 1085, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1085, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 0, + 0, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, + 1160, 1160, 1160, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6350, 6351, 6352, 6353, 6354, 4271, 6355, + 6356, 6357, 6358, 4272, 6359, 6360, 6361, 4273, + 6362, 6363, 6364, 6365, 6366, 6367, 6368, 6369, + 6370, 6371, 6372, 6373, 4331, 6374, 6375, 6376, + 6377, 6378, 6379, 6380, 6381, 6382, 4336, 4274, + 4275, 4337, 6383, 6384, 4082, 6385, 4276, 6386, + 6387, 6388, 6389, 6389, 6389, 6390, 6391, 6392, + 6393, 6394, 6395, 6396, 6397, 6398, 6399, 6400, + 6401, 6402, 6403, 6404, 6405, 6406, 6407, 6407, + 4339, 6408, 6409, 6410, 6411, 4278, 6412, 6413, + 6414, 4235, 6415, 6416, 6417, 6418, 6419, 6420, + 6421, 6422, 6423, 6424, 6425, 6426, 6427, 6428, + 6429, 6430, 6431, 6432, 6433, 6434, 6435, 6436, + 6437, 6438, 6439, 6440, 6440, 6441, 6442, 6443, + 4078, 6444, 6445, 6446, 6447, 6448, 6449, 6450, + 6451, 4283, 6452, 6453, 6454, 6455, 6456, 6457, + 6458, 6459, 6460, 6461, 6462, 6463, 6464, 6465, + 6466, 6467, 6468, 6469, 6470, 6471, 6472, 4024, + 6473, 6474, 6475, 6475, 6476, 6477, 6477, 6478, + 6479, 6480, 6481, 6482, 6483, 6484, 6485, 6486, + 6487, 6488, 6489, 6490, 4284, 6491, 6492, 6493, + 6494, 4351, 6494, 6495, 4286, 6496, 6497, 6498, + 6499, 4287, 3997, 6500, 6501, 6502, 6503, 6504, + 6505, 6506, 6507, 6508, 6509, 6510, 6511, 6512, + 6513, 6514, 6515, 6516, 6517, 6518, 6519, 6520, + 6521, 4288, 6522, 6523, 6524, 6525, 6526, 6527, + 4290, 6528, 6529, 6530, 6531, 6532, 6533, 6534, + 6535, 4025, 4359, 6536, 6537, 6538, 6539, 6540, + 6541, 6542, 6543, 4291, 6544, 6545, 6546, 6547, + 4402, 6548, 6549, 6550, 6551, 6552, 6553, 6554, + 6555, 6556, 6557, 6558, 6559, 6560, 4095, 6561, + 6562, 6563, 6564, 6565, 6566, 6567, 6568, 6569, + 6570, 6571, 4292, 4182, 6572, 6573, 6574, 6575, + 6576, 6577, 6578, 6579, 4363, 6580, 6581, 6582, + 6583, 6584, 6585, 6586, 6587, 4364, 6588, 6589, + 6590, 6591, 6592, 6593, 6594, 6595, 6596, 6597, + 6598, 6599, 4366, 6600, 6601, 6602, 6603, 6604, + 6605, 6606, 6607, 6608, 6609, 6610, 6610, 6611, + 6612, 4368, 6613, 6614, 6615, 6616, 6617, 6618, + 6619, 4081, 6620, 6621, 6622, 6623, 6624, 6625, + 6626, 4374, 6627, 6628, 6629, 6630, 6631, 6632, + 6632, 4375, 4404, 6633, 6634, 6635, 6636, 6637, + 4043, 4377, 6638, 6639, 4303, 6640, 6641, 4257, + 6642, 6643, 4307, 6644, 6645, 6646, 6647, 6647, + 6648, 6649, 6650, 6651, 6652, 6653, 6654, 6655, + 6656, 6657, 6658, 6659, 6660, 6661, 6662, 6663, + 6664, 6665, 6666, 6667, 6668, 6669, 6670, 6671, + 6672, 6673, 6674, 4313, 6675, 6676, 6677, 6678, + 6679, 6680, 6681, 6682, 6683, 6684, 6685, 6686, + 6687, 6688, 6689, 6690, 6476, 6691, 6692, 6693, + 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6701, + 6702, 4099, 6703, 6704, 6705, 6706, 6707, 6708, + 4316, 6709, 6710, 6711, 6712, 6713, 6714, 6715, + 6716, 6717, 6718, 6719, 6720, 6721, 6722, 6723, + 6724, 6725, 6726, 6727, 6728, 4038, 6729, 6730, + 6731, 6732, 6733, 6734, 4384, 6735, 6736, 6737, + 6738, 6739, 6740, 6741, 6742, 6743, 6744, 6745, + 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, + 6754, 4389, 4390, 6755, 6756, 6757, 6758, 6759, + 6760, 6761, 6762, 6763, 6764, 6765, 6766, 6767, + 4391, 6768, 6769, 6770, 6771, 6772, 6773, 6774, + 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, + 6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, + 6791, 6792, 6793, 6794, 6795, 6796, 6797, 4397, + 4397, 6798, 6799, 6800, 6801, 6802, 6803, 6804, + 6805, 6806, 6807, 4398, 6808, 6809, 6810, 6811, + 6812, 6813, 6814, 6815, 6816, 6817, 6818, 6819, + 6820, 6821, 6822, 6823, 6824, 6825, 6826, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 81, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, + 3984, 3984, 3984, 3984, 3984, 3984, 3984, 0, + 0, }; + +static const utf8proc_property_t utf8proc_properties[] = { + {0, 0, 0, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false,false,false,false, 0, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_CC, 0, UTF8PROC_BIDI_CLASS_BN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CC, 0, UTF8PROC_BIDI_CLASS_BN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CC, 0, UTF8PROC_BIDI_CLASS_S, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CC, 0, UTF8PROC_BIDI_CLASS_B, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 0, 0, UTF8PROC_BOUNDCLASS_LF}, + {UTF8PROC_CATEGORY_CC, 0, UTF8PROC_BIDI_CLASS_WS, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CC, 0, UTF8PROC_BIDI_CLASS_B, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 0, 0, UTF8PROC_BOUNDCLASS_CR}, + {UTF8PROC_CATEGORY_CC, 0, UTF8PROC_BIDI_CLASS_B, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_ZS, 0, UTF8PROC_BIDI_CLASS_WS, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ET, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SC, 0, UTF8PROC_BIDI_CLASS_ET, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ES, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_CS, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PD, 0, UTF8PROC_BIDI_CLASS_ES, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5093, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5084, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5096, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 0, UINT16_MAX, 0, UINT16_MAX, 0, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1, UINT16_MAX, 1, UINT16_MAX, 2784, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 2, UINT16_MAX, 2, UINT16_MAX, 49, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3, UINT16_MAX, 3, UINT16_MAX, 704, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 4, UINT16_MAX, 4, UINT16_MAX, 62, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5, UINT16_MAX, 5, UINT16_MAX, 2872, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6, UINT16_MAX, 6, UINT16_MAX, 782, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7, UINT16_MAX, 7, UINT16_MAX, 808, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 8, UINT16_MAX, 8, UINT16_MAX, 111, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 9, UINT16_MAX, 9, UINT16_MAX, 898, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 10, UINT16_MAX, 10, UINT16_MAX, 913, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 11, UINT16_MAX, 11, UINT16_MAX, 999, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 12, UINT16_MAX, 12, UINT16_MAX, 2890, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 13, UINT16_MAX, 13, UINT16_MAX, 160, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 14, UINT16_MAX, 14, UINT16_MAX, 205, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 15, UINT16_MAX, 15, UINT16_MAX, 2982, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 16, UINT16_MAX, 16, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 17, UINT16_MAX, 17, UINT16_MAX, 1087, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 18, UINT16_MAX, 18, UINT16_MAX, 1173, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 19, UINT16_MAX, 19, UINT16_MAX, 1257, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 20, UINT16_MAX, 20, UINT16_MAX, 254, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 21, UINT16_MAX, 21, UINT16_MAX, 3042, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 22, UINT16_MAX, 22, UINT16_MAX, 1337, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 23, UINT16_MAX, 23, UINT16_MAX, 3122, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 24, UINT16_MAX, 24, UINT16_MAX, 303, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 25, UINT16_MAX, 25, UINT16_MAX, 1423, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PC, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1446, UINT16_MAX, 1446, 352, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1448, UINT16_MAX, 1448, 2818, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 2795, UINT16_MAX, 2795, 401, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1449, UINT16_MAX, 1449, 743, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1450, UINT16_MAX, 1450, 414, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 2820, UINT16_MAX, 2820, 2875, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1452, UINT16_MAX, 1452, 795, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1453, UINT16_MAX, 1453, 853, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1454, UINT16_MAX, 1454, 463, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1455, UINT16_MAX, 1455, 901, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1456, UINT16_MAX, 1456, 956, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1457, UINT16_MAX, 1457, 1043, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1458, UINT16_MAX, 1458, 2932, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1459, UINT16_MAX, 1459, 512, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1460, UINT16_MAX, 1460, 557, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1462, UINT16_MAX, 1462, 2994, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 2809, UINT16_MAX, 2809, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1463, UINT16_MAX, 1463, 1130, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 3288, UINT16_MAX, 3288, 1215, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1464, UINT16_MAX, 1464, 1296, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1465, UINT16_MAX, 1465, 606, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 2891, UINT16_MAX, 2891, 3082, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1466, UINT16_MAX, 1466, 1380, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 2908, UINT16_MAX, 2908, 3131, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 3295, UINT16_MAX, 3295, 655, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 2817, UINT16_MAX, 2817, 1466, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ZS, 0, UTF8PROC_BIDI_CLASS_CS, UTF8PROC_DECOMP_TYPE_NOBREAK, 26, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 8219, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 1621, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PI, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_BN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 8221, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ET, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ET, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUPER, 31, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUPER, 32, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 8225, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 35, 35, 7130, UINT16_MAX, 7130, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 8228, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUPER, 38, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 14, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PF, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 16423, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 16426, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 16429, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8240, 50, UINT16_MAX, 50, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8243, 53, UINT16_MAX, 53, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8246, 56, UINT16_MAX, 56, UINT16_MAX, 3143, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8249, 59, UINT16_MAX, 59, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8252, 62, UINT16_MAX, 62, UINT16_MAX, 1537, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8255, 65, UINT16_MAX, 65, UINT16_MAX, 1579, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 66, UINT16_MAX, 66, UINT16_MAX, 1549, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8259, 69, UINT16_MAX, 69, UINT16_MAX, 2852, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8262, 72, UINT16_MAX, 72, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8265, 75, UINT16_MAX, 75, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8268, 78, UINT16_MAX, 78, UINT16_MAX, 3357, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8271, 81, UINT16_MAX, 81, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8274, 84, UINT16_MAX, 84, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8277, 87, UINT16_MAX, 87, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8280, 90, UINT16_MAX, 90, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8283, 93, UINT16_MAX, 93, UINT16_MAX, 2878, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 94, UINT16_MAX, 94, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8287, 97, UINT16_MAX, 97, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8290, 100, UINT16_MAX, 100, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8293, 103, UINT16_MAX, 103, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8296, 106, UINT16_MAX, 106, UINT16_MAX, 3461, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8299, 109, UINT16_MAX, 109, UINT16_MAX, 1597, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8302, 112, UINT16_MAX, 112, UINT16_MAX, 1591, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 113, UINT16_MAX, 113, UINT16_MAX, 1585, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8306, 116, UINT16_MAX, 116, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8309, 119, UINT16_MAX, 119, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8312, 122, UINT16_MAX, 122, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8315, 125, UINT16_MAX, 125, UINT16_MAX, 1509, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8318, 128, UINT16_MAX, 128, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 129, UINT16_MAX, 129, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 8322, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8324, UINT16_MAX, 7977, UINT16_MAX, 7977, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8326, UINT16_MAX, 7978, UINT16_MAX, 7978, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8328, UINT16_MAX, 7979, UINT16_MAX, 7979, 3192, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8330, UINT16_MAX, 7980, UINT16_MAX, 7980, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8332, UINT16_MAX, 7981, UINT16_MAX, 7981, 1540, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8334, UINT16_MAX, 2819, UINT16_MAX, 2819, 1582, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1447, UINT16_MAX, 1447, 1558, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8336, UINT16_MAX, 7982, UINT16_MAX, 7982, 2855, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8338, UINT16_MAX, 7983, UINT16_MAX, 7983, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8340, UINT16_MAX, 7984, UINT16_MAX, 7984, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8342, UINT16_MAX, 7985, UINT16_MAX, 7985, 3406, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8344, UINT16_MAX, 7986, UINT16_MAX, 7986, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8346, UINT16_MAX, 7987, UINT16_MAX, 7987, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8348, UINT16_MAX, 7988, UINT16_MAX, 7988, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8350, UINT16_MAX, 7989, UINT16_MAX, 7989, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8352, UINT16_MAX, 7990, UINT16_MAX, 7990, 2881, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7991, UINT16_MAX, 7991, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8354, UINT16_MAX, 7992, UINT16_MAX, 7992, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8356, UINT16_MAX, 7993, UINT16_MAX, 7993, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8358, UINT16_MAX, 7994, UINT16_MAX, 7994, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8360, UINT16_MAX, 7995, UINT16_MAX, 7995, 3510, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8362, UINT16_MAX, 7996, UINT16_MAX, 7996, 1606, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8364, UINT16_MAX, 7997, UINT16_MAX, 7997, 1594, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7998, UINT16_MAX, 7998, 1588, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8366, UINT16_MAX, 7999, UINT16_MAX, 7999, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8368, UINT16_MAX, 8000, UINT16_MAX, 8000, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8370, UINT16_MAX, 8001, UINT16_MAX, 8001, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8372, UINT16_MAX, 8002, UINT16_MAX, 8002, 1523, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8374, UINT16_MAX, 8003, UINT16_MAX, 8003, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8004, UINT16_MAX, 8004, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8376, UINT16_MAX, 8005, UINT16_MAX, 8005, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8378, 188, UINT16_MAX, 188, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8381, UINT16_MAX, 8006, UINT16_MAX, 8006, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8383, 193, UINT16_MAX, 193, UINT16_MAX, 3259, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8386, UINT16_MAX, 8007, UINT16_MAX, 8007, 3308, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8388, 198, UINT16_MAX, 198, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8391, UINT16_MAX, 8008, UINT16_MAX, 8008, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8393, 203, UINT16_MAX, 203, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8396, UINT16_MAX, 8009, UINT16_MAX, 8009, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8398, 208, UINT16_MAX, 208, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8401, UINT16_MAX, 8010, UINT16_MAX, 8010, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8403, 213, UINT16_MAX, 213, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8406, UINT16_MAX, 8011, UINT16_MAX, 8011, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8408, 218, UINT16_MAX, 218, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8411, UINT16_MAX, 8012, UINT16_MAX, 8012, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8413, 223, UINT16_MAX, 223, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8416, UINT16_MAX, 8013, UINT16_MAX, 8013, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 226, UINT16_MAX, 226, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8014, UINT16_MAX, 8014, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8419, 229, UINT16_MAX, 229, UINT16_MAX, 2858, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8422, UINT16_MAX, 8015, UINT16_MAX, 8015, 2862, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8424, 234, UINT16_MAX, 234, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8427, UINT16_MAX, 8016, UINT16_MAX, 8016, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8429, 239, UINT16_MAX, 239, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8432, UINT16_MAX, 8017, UINT16_MAX, 8017, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8434, 244, UINT16_MAX, 244, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8437, UINT16_MAX, 8018, UINT16_MAX, 8018, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8439, 249, UINT16_MAX, 249, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8442, UINT16_MAX, 8019, UINT16_MAX, 8019, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8444, 254, UINT16_MAX, 254, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8447, UINT16_MAX, 8020, UINT16_MAX, 8020, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8449, 259, UINT16_MAX, 259, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8452, UINT16_MAX, 8021, UINT16_MAX, 8021, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8454, 264, UINT16_MAX, 264, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8457, UINT16_MAX, 8022, UINT16_MAX, 8022, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8459, 269, UINT16_MAX, 269, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8462, UINT16_MAX, 8023, UINT16_MAX, 8023, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8464, 274, UINT16_MAX, 274, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8467, UINT16_MAX, 8024, UINT16_MAX, 8024, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 277, UINT16_MAX, 277, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 5138, UINT16_MAX, 5138, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8470, 280, UINT16_MAX, 280, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8473, UINT16_MAX, 8025, UINT16_MAX, 8025, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8475, 285, UINT16_MAX, 285, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8478, UINT16_MAX, 8026, UINT16_MAX, 8026, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8480, 290, UINT16_MAX, 290, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8483, UINT16_MAX, 8027, UINT16_MAX, 8027, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8485, 295, UINT16_MAX, 295, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8488, UINT16_MAX, 8028, UINT16_MAX, 8028, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8490, 8492, UINT16_MAX, 8, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1454, UINT16_MAX, 1454, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8494, 304, UINT16_MAX, 304, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8497, UINT16_MAX, 8029, UINT16_MAX, 8029, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8499, 309, UINT16_MAX, 309, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8502, UINT16_MAX, 8030, UINT16_MAX, 8030, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8504, 314, UINT16_MAX, 314, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8507, UINT16_MAX, 8031, UINT16_MAX, 8031, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8509, 319, UINT16_MAX, 319, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8512, UINT16_MAX, 8032, UINT16_MAX, 8032, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8514, 324, UINT16_MAX, 324, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8517, UINT16_MAX, 8033, UINT16_MAX, 8033, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8519, 329, UINT16_MAX, 329, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8522, UINT16_MAX, 8034, UINT16_MAX, 8034, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8524, 334, UINT16_MAX, 334, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8527, UINT16_MAX, 8035, UINT16_MAX, 8035, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 337, UINT16_MAX, 337, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8036, UINT16_MAX, 8036, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8530, 340, UINT16_MAX, 340, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8533, UINT16_MAX, 8037, UINT16_MAX, 8037, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8535, 345, UINT16_MAX, 345, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8538, UINT16_MAX, 8038, UINT16_MAX, 8038, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8540, 350, UINT16_MAX, 350, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8543, UINT16_MAX, 8039, UINT16_MAX, 8039, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8545, 8545, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 355, UINT16_MAX, 355, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8040, UINT16_MAX, 8040, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8548, 358, UINT16_MAX, 358, UINT16_MAX, 2974, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8551, UINT16_MAX, 8041, UINT16_MAX, 8041, 2978, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8553, 363, UINT16_MAX, 363, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8556, UINT16_MAX, 8042, UINT16_MAX, 8042, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8558, 368, UINT16_MAX, 368, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8561, UINT16_MAX, 8043, UINT16_MAX, 8043, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 371, UINT16_MAX, 371, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8044, UINT16_MAX, 8044, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8564, 374, UINT16_MAX, 374, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8567, UINT16_MAX, 8045, UINT16_MAX, 8045, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8569, 379, UINT16_MAX, 379, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8572, UINT16_MAX, 8046, UINT16_MAX, 8046, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8574, 384, UINT16_MAX, 384, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8577, UINT16_MAX, 8047, UINT16_MAX, 8047, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8579, 389, UINT16_MAX, 389, UINT16_MAX, 3012, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8582, UINT16_MAX, 8048, UINT16_MAX, 8048, 3015, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8584, 394, UINT16_MAX, 394, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8587, UINT16_MAX, 8049, UINT16_MAX, 8049, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8589, 399, UINT16_MAX, 399, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8592, UINT16_MAX, 8050, UINT16_MAX, 8050, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8594, 404, UINT16_MAX, 404, UINT16_MAX, 3018, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8597, UINT16_MAX, 8051, UINT16_MAX, 8051, 3021, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8599, 409, UINT16_MAX, 409, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8602, UINT16_MAX, 8052, UINT16_MAX, 8052, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8604, 414, UINT16_MAX, 414, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8607, UINT16_MAX, 8053, UINT16_MAX, 8053, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 417, UINT16_MAX, 417, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8054, UINT16_MAX, 8054, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8610, 420, UINT16_MAX, 420, UINT16_MAX, 3030, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8613, UINT16_MAX, 8055, UINT16_MAX, 8055, 3033, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8615, 425, UINT16_MAX, 425, UINT16_MAX, 3036, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8618, UINT16_MAX, 8056, UINT16_MAX, 8056, 3039, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8620, 430, UINT16_MAX, 430, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8623, UINT16_MAX, 8057, UINT16_MAX, 8057, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8625, 435, UINT16_MAX, 435, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8628, UINT16_MAX, 8058, UINT16_MAX, 8058, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8630, 440, UINT16_MAX, 440, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8633, UINT16_MAX, 8059, UINT16_MAX, 8059, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8635, 445, UINT16_MAX, 445, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8638, UINT16_MAX, 8060, UINT16_MAX, 8060, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8640, 450, UINT16_MAX, 450, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8643, UINT16_MAX, 8061, UINT16_MAX, 8061, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8645, 455, UINT16_MAX, 455, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8648, UINT16_MAX, 8062, UINT16_MAX, 8062, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8650, 460, UINT16_MAX, 460, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8653, 463, UINT16_MAX, 463, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8656, UINT16_MAX, 8063, UINT16_MAX, 8063, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8658, 468, UINT16_MAX, 468, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8661, UINT16_MAX, 8064, UINT16_MAX, 8064, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8663, 473, UINT16_MAX, 473, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8666, UINT16_MAX, 8065, UINT16_MAX, 8065, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 18, 18, 3288, UINT16_MAX, 3288, 3140, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8066, UINT16_MAX, 8066, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 476, UINT16_MAX, 476, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 477, UINT16_MAX, 477, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8067, UINT16_MAX, 8067, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 478, UINT16_MAX, 478, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8068, UINT16_MAX, 8068, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 479, UINT16_MAX, 479, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 480, UINT16_MAX, 480, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8069, UINT16_MAX, 8069, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 481, UINT16_MAX, 481, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 482, UINT16_MAX, 482, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 483, UINT16_MAX, 483, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8070, UINT16_MAX, 8070, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 484, UINT16_MAX, 484, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 485, UINT16_MAX, 485, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 486, UINT16_MAX, 486, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 487, UINT16_MAX, 487, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8071, UINT16_MAX, 8071, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 488, UINT16_MAX, 488, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 489, UINT16_MAX, 489, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8072, UINT16_MAX, 8072, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 490, UINT16_MAX, 490, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 491, UINT16_MAX, 491, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 492, UINT16_MAX, 492, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8073, UINT16_MAX, 8073, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8074, UINT16_MAX, 8074, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 493, UINT16_MAX, 493, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 494, UINT16_MAX, 494, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8075, UINT16_MAX, 8075, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 495, UINT16_MAX, 495, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8688, 498, UINT16_MAX, 498, UINT16_MAX, 3565, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8691, UINT16_MAX, 8076, UINT16_MAX, 8076, 3614, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 501, UINT16_MAX, 501, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8077, UINT16_MAX, 8077, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 502, UINT16_MAX, 502, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8078, UINT16_MAX, 8078, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 503, UINT16_MAX, 503, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 504, UINT16_MAX, 504, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8079, UINT16_MAX, 8079, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 505, UINT16_MAX, 505, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 506, UINT16_MAX, 506, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8080, UINT16_MAX, 8080, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 507, UINT16_MAX, 507, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8700, 510, UINT16_MAX, 510, UINT16_MAX, 3663, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8703, UINT16_MAX, 8081, UINT16_MAX, 8081, 3712, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 513, UINT16_MAX, 513, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 514, UINT16_MAX, 514, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 515, UINT16_MAX, 515, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8082, UINT16_MAX, 8082, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 516, UINT16_MAX, 516, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8083, UINT16_MAX, 8083, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 517, UINT16_MAX, 517, UINT16_MAX, 1573, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 518, UINT16_MAX, 518, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8084, UINT16_MAX, 8084, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 519, UINT16_MAX, 519, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8085, UINT16_MAX, 8085, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8086, UINT16_MAX, 8086, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8712, 522, UINT16_MAX, 522, 8087, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8715, 522, 8088, 522, 8087, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8717, UINT16_MAX, 8088, UINT16_MAX, 8087, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8719, 529, UINT16_MAX, 529, 8089, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8722, 529, 8090, 529, 8089, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8724, UINT16_MAX, 8090, UINT16_MAX, 8089, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8726, 536, UINT16_MAX, 536, 8091, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8729, 536, 8092, 536, 8091, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8731, UINT16_MAX, 8092, UINT16_MAX, 8091, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8733, 543, UINT16_MAX, 543, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8736, UINT16_MAX, 8093, UINT16_MAX, 8093, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8738, 548, UINT16_MAX, 548, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8741, UINT16_MAX, 8094, UINT16_MAX, 8094, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8743, 553, UINT16_MAX, 553, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8746, UINT16_MAX, 8095, UINT16_MAX, 8095, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8748, 558, UINT16_MAX, 558, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8751, UINT16_MAX, 8096, UINT16_MAX, 8096, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8753, 563, UINT16_MAX, 563, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8756, UINT16_MAX, 8097, UINT16_MAX, 8097, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8758, 568, UINT16_MAX, 568, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8761, UINT16_MAX, 8098, UINT16_MAX, 8098, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8763, 573, UINT16_MAX, 573, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8766, UINT16_MAX, 8099, UINT16_MAX, 8099, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8768, 578, UINT16_MAX, 578, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8771, UINT16_MAX, 8100, UINT16_MAX, 8100, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1451, UINT16_MAX, 1451, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8773, 583, UINT16_MAX, 583, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8776, UINT16_MAX, 8101, UINT16_MAX, 8101, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8778, 588, UINT16_MAX, 588, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8781, UINT16_MAX, 8102, UINT16_MAX, 8102, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8783, 593, UINT16_MAX, 593, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8786, UINT16_MAX, 8103, UINT16_MAX, 8103, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 596, UINT16_MAX, 596, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8104, UINT16_MAX, 8104, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8789, 599, UINT16_MAX, 599, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8792, UINT16_MAX, 8105, UINT16_MAX, 8105, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8794, 604, UINT16_MAX, 604, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8797, UINT16_MAX, 8106, UINT16_MAX, 8106, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8799, 609, UINT16_MAX, 609, UINT16_MAX, 1567, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8802, UINT16_MAX, 8107, UINT16_MAX, 8107, 1570, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8804, 614, UINT16_MAX, 614, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8807, UINT16_MAX, 8108, UINT16_MAX, 8108, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8809, 619, UINT16_MAX, 619, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8812, UINT16_MAX, 8109, UINT16_MAX, 8109, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8814, 8814, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8816, 626, UINT16_MAX, 626, 8110, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8819, 626, 8111, 626, 8110, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8821, UINT16_MAX, 8111, UINT16_MAX, 8110, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8823, 633, UINT16_MAX, 633, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8826, UINT16_MAX, 8112, UINT16_MAX, 8112, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 636, UINT16_MAX, 636, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 637, UINT16_MAX, 637, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8830, 640, UINT16_MAX, 640, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8833, UINT16_MAX, 8113, UINT16_MAX, 8113, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8835, 645, UINT16_MAX, 645, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8838, UINT16_MAX, 8114, UINT16_MAX, 8114, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8840, 650, UINT16_MAX, 650, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8843, UINT16_MAX, 8115, UINT16_MAX, 8115, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8845, 655, UINT16_MAX, 655, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8848, UINT16_MAX, 8116, UINT16_MAX, 8116, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8850, 660, UINT16_MAX, 660, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8853, UINT16_MAX, 8117, UINT16_MAX, 8117, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8855, 665, UINT16_MAX, 665, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8858, UINT16_MAX, 8118, UINT16_MAX, 8118, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8860, 670, UINT16_MAX, 670, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8863, UINT16_MAX, 8119, UINT16_MAX, 8119, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8865, 675, UINT16_MAX, 675, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8868, UINT16_MAX, 8120, UINT16_MAX, 8120, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8870, 680, UINT16_MAX, 680, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8873, UINT16_MAX, 8121, UINT16_MAX, 8121, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8875, 685, UINT16_MAX, 685, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8878, UINT16_MAX, 8122, UINT16_MAX, 8122, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8880, 690, UINT16_MAX, 690, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8883, UINT16_MAX, 8123, UINT16_MAX, 8123, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8885, 695, UINT16_MAX, 695, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8888, UINT16_MAX, 8124, UINT16_MAX, 8124, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8890, 700, UINT16_MAX, 700, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8893, UINT16_MAX, 8125, UINT16_MAX, 8125, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8895, 705, UINT16_MAX, 705, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8898, UINT16_MAX, 8126, UINT16_MAX, 8126, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8900, 710, UINT16_MAX, 710, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8903, UINT16_MAX, 8127, UINT16_MAX, 8127, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8905, 715, UINT16_MAX, 715, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8908, UINT16_MAX, 8128, UINT16_MAX, 8128, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8910, 720, UINT16_MAX, 720, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8913, UINT16_MAX, 8129, UINT16_MAX, 8129, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8915, 725, UINT16_MAX, 725, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8918, UINT16_MAX, 8130, UINT16_MAX, 8130, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 728, UINT16_MAX, 728, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8131, UINT16_MAX, 8131, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8921, 731, UINT16_MAX, 731, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8924, UINT16_MAX, 8132, UINT16_MAX, 8132, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 734, UINT16_MAX, 734, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 735, UINT16_MAX, 735, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 1461, UINT16_MAX, 1461, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 736, UINT16_MAX, 736, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8133, UINT16_MAX, 8133, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8929, 739, UINT16_MAX, 739, UINT16_MAX, 1543, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8932, UINT16_MAX, 8134, UINT16_MAX, 8134, 1546, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8934, 744, UINT16_MAX, 744, UINT16_MAX, 2866, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8937, UINT16_MAX, 8135, UINT16_MAX, 8135, 2869, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8939, 749, UINT16_MAX, 749, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8942, UINT16_MAX, 8136, UINT16_MAX, 8136, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8944, 754, UINT16_MAX, 754, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8947, UINT16_MAX, 8137, UINT16_MAX, 8137, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8949, 759, UINT16_MAX, 759, UINT16_MAX, 1615, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8952, UINT16_MAX, 8138, UINT16_MAX, 8138, 1618, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8954, 764, UINT16_MAX, 764, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8957, UINT16_MAX, 8139, UINT16_MAX, 8139, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 8959, 769, UINT16_MAX, 769, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 8962, UINT16_MAX, 8140, UINT16_MAX, 8140, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 772, UINT16_MAX, 772, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 773, UINT16_MAX, 773, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8141, UINT16_MAX, 8141, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 774, UINT16_MAX, 774, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 775, UINT16_MAX, 775, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8142, UINT16_MAX, 8142, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8143, UINT16_MAX, 8143, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 776, UINT16_MAX, 776, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8144, UINT16_MAX, 8144, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 777, UINT16_MAX, 777, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 778, UINT16_MAX, 778, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 779, UINT16_MAX, 779, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 780, UINT16_MAX, 780, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8145, UINT16_MAX, 8145, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 781, UINT16_MAX, 781, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8146, UINT16_MAX, 8146, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 782, UINT16_MAX, 782, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8147, UINT16_MAX, 8147, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 783, UINT16_MAX, 783, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8148, UINT16_MAX, 8148, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 784, UINT16_MAX, 784, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8149, UINT16_MAX, 8149, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8150, UINT16_MAX, 8150, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8151, UINT16_MAX, 8151, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8152, UINT16_MAX, 8152, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8153, UINT16_MAX, 8153, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8154, UINT16_MAX, 8154, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8155, UINT16_MAX, 8155, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8156, UINT16_MAX, 8156, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8157, UINT16_MAX, 8157, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 2804, UINT16_MAX, 2804, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8158, UINT16_MAX, 8158, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8159, UINT16_MAX, 8159, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8160, UINT16_MAX, 8160, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8161, UINT16_MAX, 8161, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8162, UINT16_MAX, 8162, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8163, UINT16_MAX, 8163, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8164, UINT16_MAX, 8164, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8165, UINT16_MAX, 8165, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8166, UINT16_MAX, 8166, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8167, UINT16_MAX, 8167, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8168, UINT16_MAX, 8168, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8169, UINT16_MAX, 8169, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8170, UINT16_MAX, 8170, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8171, UINT16_MAX, 8171, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8172, UINT16_MAX, 8172, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8173, UINT16_MAX, 8173, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8174, UINT16_MAX, 8174, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8175, UINT16_MAX, 8175, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8176, UINT16_MAX, 8176, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8177, UINT16_MAX, 8177, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8178, UINT16_MAX, 8178, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8179, UINT16_MAX, 8179, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8180, UINT16_MAX, 8180, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8181, UINT16_MAX, 8181, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8182, UINT16_MAX, 8182, 1576, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8183, UINT16_MAX, 8183, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8184, UINT16_MAX, 8184, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 7, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 785, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 9, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 17, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 786, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 787, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 788, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 22, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 24, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 8981, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 8983, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 8985, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 8987, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 8989, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 8991, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 489, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 11, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 18, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 23, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 801, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32768, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32769, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32770, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32771, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32775, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32776, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32778, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32772, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32814, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32773, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32780, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32779, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32782, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32783, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32815, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32816, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 232, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 220, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 216, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32781, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 202, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 220, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32808, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 220, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32813, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 220, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32807, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 220, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32784, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 202, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32774, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 202, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32777, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 220, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32810, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 220, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32812, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 220, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32811, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 220, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32809, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 1, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 1, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32819, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, 802, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, 803, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32817, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, 804, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, 8997, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 240, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, 807, 7127, UINT16_MAX, 7127, 32818, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 233, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 234, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 808, UINT16_MAX, 808, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8185, UINT16_MAX, 8185, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 809, UINT16_MAX, 809, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8186, UINT16_MAX, 8186, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 810, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 811, UINT16_MAX, 811, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8187, UINT16_MAX, 8187, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 9004, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8188, UINT16_MAX, 8188, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8189, UINT16_MAX, 8189, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8190, UINT16_MAX, 8190, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, 0, 814, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 815, UINT16_MAX, 815, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, 9008, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9010, 820, UINT16_MAX, 820, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, 0, 821, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9014, 824, UINT16_MAX, 824, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9017, 827, UINT16_MAX, 827, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9020, 830, UINT16_MAX, 830, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9023, 833, UINT16_MAX, 833, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9026, 836, UINT16_MAX, 836, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9029, 839, UINT16_MAX, 839, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9032, 17226, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 845, UINT16_MAX, 845, UINT16_MAX, 1673, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 846, UINT16_MAX, 846, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 847, UINT16_MAX, 847, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 848, UINT16_MAX, 848, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 849, UINT16_MAX, 849, UINT16_MAX, 1726, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 850, UINT16_MAX, 850, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 851, UINT16_MAX, 851, UINT16_MAX, 1777, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 852, UINT16_MAX, 852, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 807, UINT16_MAX, 807, UINT16_MAX, 1830, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 853, UINT16_MAX, 853, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 854, UINT16_MAX, 854, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 35, UINT16_MAX, 35, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 855, UINT16_MAX, 855, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 856, UINT16_MAX, 856, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 857, UINT16_MAX, 857, UINT16_MAX, 1881, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 858, UINT16_MAX, 858, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 859, UINT16_MAX, 859, UINT16_MAX, 5027, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 860, UINT16_MAX, 860, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 861, UINT16_MAX, 861, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 862, UINT16_MAX, 862, UINT16_MAX, 1932, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 863, UINT16_MAX, 863, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 864, UINT16_MAX, 864, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 865, UINT16_MAX, 865, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 866, UINT16_MAX, 866, UINT16_MAX, 1983, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9059, 869, UINT16_MAX, 869, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9062, 872, UINT16_MAX, 872, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9065, UINT16_MAX, 2583, UINT16_MAX, 2583, 4904, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9067, UINT16_MAX, 2616, UINT16_MAX, 2616, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9069, UINT16_MAX, 2621, UINT16_MAX, 2621, 4913, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9071, UINT16_MAX, 2658, UINT16_MAX, 2658, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9073, 17267, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7121, UINT16_MAX, 7121, 2088, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7122, UINT16_MAX, 7122, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 2829, UINT16_MAX, 2829, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7123, UINT16_MAX, 7123, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7124, UINT16_MAX, 7124, 2141, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7125, UINT16_MAX, 7125, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7126, UINT16_MAX, 7126, 2192, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 915, UINT16_MAX, 915, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7127, UINT16_MAX, 7127, 2245, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7128, UINT16_MAX, 7128, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7129, UINT16_MAX, 7129, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7130, UINT16_MAX, 7130, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7131, UINT16_MAX, 7131, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7132, UINT16_MAX, 7132, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7133, UINT16_MAX, 7133, 2401, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 2830, UINT16_MAX, 2830, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7134, UINT16_MAX, 7134, 5023, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 860, 917, UINT16_MAX, 917, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 917, UINT16_MAX, 917, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7136, UINT16_MAX, 7136, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 897, UINT16_MAX, 897, 2349, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7137, UINT16_MAX, 7137, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7138, UINT16_MAX, 7138, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7139, UINT16_MAX, 7139, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 2818, UINT16_MAX, 2818, 2452, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9078, UINT16_MAX, 8191, UINT16_MAX, 8191, 2036, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9080, UINT16_MAX, 8192, UINT16_MAX, 8192, 2297, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9082, UINT16_MAX, 2727, UINT16_MAX, 2727, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9084, UINT16_MAX, 2696, UINT16_MAX, 2696, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9086, UINT16_MAX, 2732, UINT16_MAX, 2732, 5033, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 896, UINT16_MAX, 896, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 846, 846, 7122, UINT16_MAX, 7122, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 852, 852, 915, UINT16_MAX, 915, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 897, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2505, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9090, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9092, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 863, 863, 7137, UINT16_MAX, 7137, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 858, 858, 2830, UINT16_MAX, 2830, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8193, UINT16_MAX, 8193, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 902, UINT16_MAX, 902, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8194, UINT16_MAX, 8194, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 903, UINT16_MAX, 903, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8195, UINT16_MAX, 8195, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 904, UINT16_MAX, 904, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 7148, UINT16_MAX, 7148, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 905, UINT16_MAX, 905, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8196, UINT16_MAX, 8196, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 906, UINT16_MAX, 906, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8197, UINT16_MAX, 8197, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 907, UINT16_MAX, 907, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8198, UINT16_MAX, 8198, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 908, UINT16_MAX, 908, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8199, UINT16_MAX, 8199, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 909, UINT16_MAX, 909, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8200, UINT16_MAX, 8200, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 910, UINT16_MAX, 910, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8201, UINT16_MAX, 8201, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 911, UINT16_MAX, 911, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8202, UINT16_MAX, 8202, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 912, UINT16_MAX, 912, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8203, UINT16_MAX, 8203, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 913, UINT16_MAX, 913, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8204, UINT16_MAX, 8204, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 853, 853, 7128, UINT16_MAX, 7128, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 859, 859, 7134, UINT16_MAX, 7134, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 914, UINT16_MAX, 8205, UINT16_MAX, 8205, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8206, UINT16_MAX, 8206, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 915, 852, UINT16_MAX, 852, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 849, 849, 7124, UINT16_MAX, 7124, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 916, UINT16_MAX, 916, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8207, UINT16_MAX, 8207, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 917, 918, UINT16_MAX, 918, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 919, UINT16_MAX, 919, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8208, UINT16_MAX, 8208, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 920, UINT16_MAX, 920, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 921, UINT16_MAX, 921, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 922, UINT16_MAX, 922, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9115, 925, UINT16_MAX, 925, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9118, 928, UINT16_MAX, 928, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 929, UINT16_MAX, 929, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9122, 932, UINT16_MAX, 932, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 933, UINT16_MAX, 933, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 934, UINT16_MAX, 934, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 935, UINT16_MAX, 935, UINT16_MAX, 2525, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9128, 938, UINT16_MAX, 938, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 939, UINT16_MAX, 939, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 940, UINT16_MAX, 940, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 941, UINT16_MAX, 941, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 942, UINT16_MAX, 942, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9135, 945, UINT16_MAX, 945, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9138, 948, UINT16_MAX, 948, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9141, 951, UINT16_MAX, 951, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 952, UINT16_MAX, 952, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 953, UINT16_MAX, 953, UINT16_MAX, 2615, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 954, UINT16_MAX, 954, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 955, UINT16_MAX, 955, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 956, UINT16_MAX, 956, UINT16_MAX, 2522, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 957, UINT16_MAX, 957, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 958, UINT16_MAX, 958, UINT16_MAX, 2511, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 959, UINT16_MAX, 959, UINT16_MAX, 2601, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 960, UINT16_MAX, 960, UINT16_MAX, 2635, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 961, UINT16_MAX, 961, UINT16_MAX, 2531, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9154, 964, UINT16_MAX, 964, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 965, UINT16_MAX, 965, UINT16_MAX, 2528, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 966, UINT16_MAX, 966, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 967, UINT16_MAX, 967, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 968, UINT16_MAX, 968, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 969, UINT16_MAX, 969, UINT16_MAX, 2641, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 970, UINT16_MAX, 970, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 971, UINT16_MAX, 971, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 972, UINT16_MAX, 972, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 973, UINT16_MAX, 973, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 974, UINT16_MAX, 974, UINT16_MAX, 2542, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 975, UINT16_MAX, 975, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 976, UINT16_MAX, 976, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 977, UINT16_MAX, 977, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 978, UINT16_MAX, 978, UINT16_MAX, 2659, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 979, UINT16_MAX, 979, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 980, UINT16_MAX, 980, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 981, UINT16_MAX, 981, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 982, UINT16_MAX, 982, UINT16_MAX, 2665, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 983, UINT16_MAX, 983, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 984, UINT16_MAX, 984, UINT16_MAX, 2653, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 985, UINT16_MAX, 985, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 986, UINT16_MAX, 986, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8209, UINT16_MAX, 8209, 2622, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8210, UINT16_MAX, 8210, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8211, UINT16_MAX, 8211, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8212, UINT16_MAX, 8212, 2575, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8213, UINT16_MAX, 8213, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8214, UINT16_MAX, 8214, 2564, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8215, UINT16_MAX, 8215, 2608, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8216, UINT16_MAX, 8216, 2638, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8217, UINT16_MAX, 8217, 2553, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9179, UINT16_MAX, 8218, UINT16_MAX, 8218, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8219, UINT16_MAX, 8219, 2581, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8220, UINT16_MAX, 8220, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8221, UINT16_MAX, 8221, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8222, UINT16_MAX, 8222, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8223, UINT16_MAX, 8223, 2644, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8224, UINT16_MAX, 8224, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8225, UINT16_MAX, 8225, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8226, UINT16_MAX, 8226, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8227, UINT16_MAX, 8227, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8228, UINT16_MAX, 8228, 2584, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8229, UINT16_MAX, 8229, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8230, UINT16_MAX, 8230, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8231, UINT16_MAX, 8231, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8232, UINT16_MAX, 8232, 2662, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8233, UINT16_MAX, 8233, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8234, UINT16_MAX, 8234, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8235, UINT16_MAX, 8235, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8236, UINT16_MAX, 8236, 2668, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8237, UINT16_MAX, 8237, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8238, UINT16_MAX, 8238, 2656, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8239, UINT16_MAX, 8239, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8240, UINT16_MAX, 8240, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9181, UINT16_MAX, 8241, UINT16_MAX, 8241, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9183, UINT16_MAX, 8242, UINT16_MAX, 8242, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8243, UINT16_MAX, 8243, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9185, UINT16_MAX, 8244, UINT16_MAX, 8244, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8245, UINT16_MAX, 8245, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8246, UINT16_MAX, 8246, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8247, UINT16_MAX, 8247, 2578, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9187, UINT16_MAX, 8248, UINT16_MAX, 8248, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8249, UINT16_MAX, 8249, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8250, UINT16_MAX, 8250, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8251, UINT16_MAX, 8251, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8252, UINT16_MAX, 8252, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9189, UINT16_MAX, 8253, UINT16_MAX, 8253, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9191, UINT16_MAX, 8254, UINT16_MAX, 8254, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9193, UINT16_MAX, 8255, UINT16_MAX, 8255, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8256, UINT16_MAX, 8256, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1003, UINT16_MAX, 1003, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8257, UINT16_MAX, 8257, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1004, UINT16_MAX, 1004, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8258, UINT16_MAX, 8258, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1005, UINT16_MAX, 1005, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8259, UINT16_MAX, 8259, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1006, UINT16_MAX, 1006, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8260, UINT16_MAX, 8260, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1007, UINT16_MAX, 1007, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8261, UINT16_MAX, 8261, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1008, UINT16_MAX, 1008, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8262, UINT16_MAX, 8262, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1009, UINT16_MAX, 1009, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8263, UINT16_MAX, 8263, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1010, UINT16_MAX, 1010, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8264, UINT16_MAX, 8264, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1011, UINT16_MAX, 1011, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8265, UINT16_MAX, 8265, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1012, UINT16_MAX, 1012, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8266, UINT16_MAX, 8266, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1013, UINT16_MAX, 1013, UINT16_MAX, 2595, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8267, UINT16_MAX, 8267, 2598, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9206, 1016, UINT16_MAX, 1016, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9209, UINT16_MAX, 8268, UINT16_MAX, 8268, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1019, UINT16_MAX, 1019, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8269, UINT16_MAX, 8269, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1020, UINT16_MAX, 1020, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8270, UINT16_MAX, 8270, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1021, UINT16_MAX, 1021, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8271, UINT16_MAX, 8271, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1022, UINT16_MAX, 1022, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8272, UINT16_MAX, 8272, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1023, UINT16_MAX, 1023, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8273, UINT16_MAX, 8273, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ME, 0, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1024, UINT16_MAX, 1024, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8274, UINT16_MAX, 8274, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1025, UINT16_MAX, 1025, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8275, UINT16_MAX, 8275, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1026, UINT16_MAX, 1026, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8276, UINT16_MAX, 8276, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1027, UINT16_MAX, 1027, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8277, UINT16_MAX, 8277, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1028, UINT16_MAX, 1028, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8278, UINT16_MAX, 8278, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1029, UINT16_MAX, 1029, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8279, UINT16_MAX, 8279, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1030, UINT16_MAX, 1030, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8280, UINT16_MAX, 8280, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1031, UINT16_MAX, 1031, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8281, UINT16_MAX, 8281, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1032, UINT16_MAX, 1032, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8282, UINT16_MAX, 8282, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1033, UINT16_MAX, 1033, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8283, UINT16_MAX, 8283, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1034, UINT16_MAX, 1034, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8284, UINT16_MAX, 8284, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1035, UINT16_MAX, 1035, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8285, UINT16_MAX, 8285, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1036, UINT16_MAX, 1036, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8286, UINT16_MAX, 8286, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1037, UINT16_MAX, 1037, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8287, UINT16_MAX, 8287, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1038, UINT16_MAX, 1038, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8288, UINT16_MAX, 8288, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1039, UINT16_MAX, 1039, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8289, UINT16_MAX, 8289, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1040, UINT16_MAX, 1040, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8290, UINT16_MAX, 8290, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1041, UINT16_MAX, 1041, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8291, UINT16_MAX, 8291, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1042, UINT16_MAX, 1042, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8292, UINT16_MAX, 8292, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1043, UINT16_MAX, 1043, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8293, UINT16_MAX, 8293, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1044, UINT16_MAX, 1044, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8294, UINT16_MAX, 8294, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1045, UINT16_MAX, 1045, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8295, UINT16_MAX, 8295, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1046, UINT16_MAX, 1046, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8296, UINT16_MAX, 8296, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1047, UINT16_MAX, 1047, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8297, UINT16_MAX, 8297, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1048, UINT16_MAX, 1048, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8298, UINT16_MAX, 8298, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1049, UINT16_MAX, 1049, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8299, UINT16_MAX, 8299, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1050, UINT16_MAX, 1050, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8300, UINT16_MAX, 8300, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1051, UINT16_MAX, 1051, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9244, 1054, UINT16_MAX, 1054, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9247, UINT16_MAX, 8301, UINT16_MAX, 8301, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1057, UINT16_MAX, 1057, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8302, UINT16_MAX, 8302, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1058, UINT16_MAX, 1058, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8303, UINT16_MAX, 8303, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1059, UINT16_MAX, 1059, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8304, UINT16_MAX, 8304, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1060, UINT16_MAX, 1060, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8305, UINT16_MAX, 8305, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1061, UINT16_MAX, 1061, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8306, UINT16_MAX, 8306, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1062, UINT16_MAX, 1062, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8307, UINT16_MAX, 8307, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8308, UINT16_MAX, 8308, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9255, 1065, UINT16_MAX, 1065, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9258, UINT16_MAX, 8309, UINT16_MAX, 8309, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9260, 1070, UINT16_MAX, 1070, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9263, UINT16_MAX, 8310, UINT16_MAX, 8310, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1073, UINT16_MAX, 1073, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8311, UINT16_MAX, 8311, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9266, 1076, UINT16_MAX, 1076, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9269, UINT16_MAX, 8312, UINT16_MAX, 8312, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1079, UINT16_MAX, 1079, UINT16_MAX, 2629, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8313, UINT16_MAX, 8313, 2632, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9272, 1082, UINT16_MAX, 1082, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9275, UINT16_MAX, 8314, UINT16_MAX, 8314, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9277, 1087, UINT16_MAX, 1087, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9280, UINT16_MAX, 8315, UINT16_MAX, 8315, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9282, 1092, UINT16_MAX, 1092, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9285, UINT16_MAX, 8316, UINT16_MAX, 8316, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1095, UINT16_MAX, 1095, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8317, UINT16_MAX, 8317, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9288, 1098, UINT16_MAX, 1098, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9291, UINT16_MAX, 8318, UINT16_MAX, 8318, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9293, 1103, UINT16_MAX, 1103, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9296, UINT16_MAX, 8319, UINT16_MAX, 8319, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9298, 1108, UINT16_MAX, 1108, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9301, UINT16_MAX, 8320, UINT16_MAX, 8320, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1111, UINT16_MAX, 1111, UINT16_MAX, 2647, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8321, UINT16_MAX, 8321, 2650, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9304, 1114, UINT16_MAX, 1114, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9307, UINT16_MAX, 8322, UINT16_MAX, 8322, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9309, 1119, UINT16_MAX, 1119, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9312, UINT16_MAX, 8323, UINT16_MAX, 8323, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9314, 1124, UINT16_MAX, 1124, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9317, UINT16_MAX, 8324, UINT16_MAX, 8324, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9319, 1129, UINT16_MAX, 1129, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9322, UINT16_MAX, 8325, UINT16_MAX, 8325, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9324, 1134, UINT16_MAX, 1134, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9327, UINT16_MAX, 8326, UINT16_MAX, 8326, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9329, 1139, UINT16_MAX, 1139, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9332, UINT16_MAX, 8327, UINT16_MAX, 8327, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1142, UINT16_MAX, 1142, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8328, UINT16_MAX, 8328, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9335, 1145, UINT16_MAX, 1145, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9338, UINT16_MAX, 8329, UINT16_MAX, 8329, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1148, UINT16_MAX, 1148, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8330, UINT16_MAX, 8330, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1149, UINT16_MAX, 1149, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8331, UINT16_MAX, 8331, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1150, UINT16_MAX, 1150, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8332, UINT16_MAX, 8332, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1151, UINT16_MAX, 1151, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8333, UINT16_MAX, 8333, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1152, UINT16_MAX, 1152, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8334, UINT16_MAX, 8334, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1153, UINT16_MAX, 1153, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8335, UINT16_MAX, 8335, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1154, UINT16_MAX, 1154, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8336, UINT16_MAX, 8336, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1155, UINT16_MAX, 1155, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8337, UINT16_MAX, 8337, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1156, UINT16_MAX, 1156, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8338, UINT16_MAX, 8338, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1157, UINT16_MAX, 1157, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8339, UINT16_MAX, 8339, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1158, UINT16_MAX, 1158, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8340, UINT16_MAX, 8340, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1159, UINT16_MAX, 1159, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8341, UINT16_MAX, 8341, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1160, UINT16_MAX, 1160, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8342, UINT16_MAX, 8342, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1161, UINT16_MAX, 1161, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8343, UINT16_MAX, 8343, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1162, UINT16_MAX, 1162, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8344, UINT16_MAX, 8344, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1163, UINT16_MAX, 1163, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8345, UINT16_MAX, 8345, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1164, UINT16_MAX, 1164, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8346, UINT16_MAX, 8346, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1165, UINT16_MAX, 1165, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8347, UINT16_MAX, 8347, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1166, UINT16_MAX, 1166, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8348, UINT16_MAX, 8348, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1167, UINT16_MAX, 1167, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8349, UINT16_MAX, 8349, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1168, UINT16_MAX, 1168, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8350, UINT16_MAX, 8350, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1169, UINT16_MAX, 1169, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8351, UINT16_MAX, 8351, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1170, UINT16_MAX, 1170, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8352, UINT16_MAX, 8352, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1171, UINT16_MAX, 1171, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8353, UINT16_MAX, 8353, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1172, UINT16_MAX, 1172, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8354, UINT16_MAX, 8354, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1173, UINT16_MAX, 1173, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8355, UINT16_MAX, 8355, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1174, UINT16_MAX, 1174, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8356, UINT16_MAX, 8356, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1175, UINT16_MAX, 1175, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1176, UINT16_MAX, 1176, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1177, UINT16_MAX, 1177, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1178, UINT16_MAX, 1178, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1179, UINT16_MAX, 1179, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1180, UINT16_MAX, 1180, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1181, UINT16_MAX, 1181, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1182, UINT16_MAX, 1182, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1183, UINT16_MAX, 1183, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1184, UINT16_MAX, 1184, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1185, UINT16_MAX, 1185, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1186, UINT16_MAX, 1186, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1187, UINT16_MAX, 1187, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1188, UINT16_MAX, 1188, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1189, UINT16_MAX, 1189, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1190, UINT16_MAX, 1190, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1191, UINT16_MAX, 1191, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1192, UINT16_MAX, 1192, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1193, UINT16_MAX, 1193, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1194, UINT16_MAX, 1194, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1195, UINT16_MAX, 1195, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1196, UINT16_MAX, 1196, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1197, UINT16_MAX, 1197, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1198, UINT16_MAX, 1198, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1199, UINT16_MAX, 1199, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1200, UINT16_MAX, 1200, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1201, UINT16_MAX, 1201, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1202, UINT16_MAX, 1202, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1203, UINT16_MAX, 1203, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1204, UINT16_MAX, 1204, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1205, UINT16_MAX, 1205, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1206, UINT16_MAX, 1206, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1207, UINT16_MAX, 1207, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1208, UINT16_MAX, 1208, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1209, UINT16_MAX, 1209, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1210, UINT16_MAX, 1210, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1211, UINT16_MAX, 1211, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1212, UINT16_MAX, 1212, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8357, UINT16_MAX, 8357, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8358, UINT16_MAX, 8358, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8359, UINT16_MAX, 8359, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8360, UINT16_MAX, 8360, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8361, UINT16_MAX, 8361, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8362, UINT16_MAX, 8362, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8363, UINT16_MAX, 8363, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8364, UINT16_MAX, 8364, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8365, UINT16_MAX, 8365, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8366, UINT16_MAX, 8366, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8367, UINT16_MAX, 8367, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8368, UINT16_MAX, 8368, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8369, UINT16_MAX, 8369, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8370, UINT16_MAX, 8370, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8371, UINT16_MAX, 8371, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8372, UINT16_MAX, 8372, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8373, UINT16_MAX, 8373, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8374, UINT16_MAX, 8374, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8375, UINT16_MAX, 8375, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8376, UINT16_MAX, 8376, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8377, UINT16_MAX, 8377, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8378, UINT16_MAX, 8378, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8379, UINT16_MAX, 8379, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8380, UINT16_MAX, 8380, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8381, UINT16_MAX, 8381, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8382, UINT16_MAX, 8382, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8383, UINT16_MAX, 8383, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8384, UINT16_MAX, 8384, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8385, UINT16_MAX, 8385, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8386, UINT16_MAX, 8386, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8387, UINT16_MAX, 8387, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8388, UINT16_MAX, 8388, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8389, UINT16_MAX, 8389, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8390, UINT16_MAX, 8390, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8391, UINT16_MAX, 8391, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8392, UINT16_MAX, 8392, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8393, UINT16_MAX, 8393, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8394, UINT16_MAX, 8394, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 9405, 9405, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PD, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 222, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 228, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 10, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 11, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 12, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 13, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 14, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 15, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 16, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 17, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 18, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 19, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 20, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 21, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 22, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_PD, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 23, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 24, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 25, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_AN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 0, 0, UTF8PROC_BOUNDCLASS_PREPEND}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_AN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 2, 0, UTF8PROC_BOUNDCLASS_PREPEND}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SC, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 30, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 31, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 32, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, 9407, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, 9409, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, 9411, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, 9413, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, 9415, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2671, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2676, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2679, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 27, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 28, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 29, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 33, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 34, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32785, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 230, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32786, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 220, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32787, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_AN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_AN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 35, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_COMPAT, 9417, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_COMPAT, 9419, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_COMPAT, 9421, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_COMPAT, 9423, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, 9425, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2685, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, 9427, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2688, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, 9429, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2682, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 0, 0, UTF8PROC_BOUNDCLASS_PREPEND}, + {UTF8PROC_CATEGORY_MN, 36, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2691, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9431, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2694, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9433, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2697, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9435, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 7, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32788, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 9, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9437, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9439, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9441, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9443, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9445, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9447, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9449, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9451, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 7, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32789, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2700, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9453, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9455, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32790, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9457, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9459, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9461, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SC, 0, UTF8PROC_BIDI_CLASS_ET, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9465, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9467, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9469, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9471, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9473, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32792, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2704, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9475, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9477, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9479, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32791, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32793, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9481, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9483, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2709, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9485, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32795, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2712, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2716, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9487, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9489, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9491, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32794, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2719, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 9493, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 84, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 91, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32796, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2722, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9495, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32799, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2725, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9497, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9499, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9501, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2730, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9503, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32797, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32798, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32800, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2733, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2737, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9505, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9507, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9509, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_PREPEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32801, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 9, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32802, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32803, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2740, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9511, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9513, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2745, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9515, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9517, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32804, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 9519, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MN, 103, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 107, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 9521, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MN, 118, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 122, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 9523, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 9525, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NOBREAK, 1335, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 216, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9528, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9530, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9532, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9534, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9536, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9538, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 129, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 130, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 9540, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 132, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 9542, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 9544, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, UTF8PROC_DECOMP_TYPE_COMPAT, 9546, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 9548, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, UTF8PROC_DECOMP_TYPE_COMPAT, 9550, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 9552, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 9554, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 9556, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 9558, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 9560, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 9562, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 9564, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2748, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9566, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32805, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1376, UINT16_MAX, 1376, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1377, UINT16_MAX, 1377, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1378, UINT16_MAX, 1378, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1379, UINT16_MAX, 1379, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1380, UINT16_MAX, 1380, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1381, UINT16_MAX, 1381, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1382, UINT16_MAX, 1382, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1383, UINT16_MAX, 1383, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1384, UINT16_MAX, 1384, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1385, UINT16_MAX, 1385, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1386, UINT16_MAX, 1386, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1387, UINT16_MAX, 1387, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1388, UINT16_MAX, 1388, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1389, UINT16_MAX, 1389, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1390, UINT16_MAX, 1390, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1391, UINT16_MAX, 1391, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1392, UINT16_MAX, 1392, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1393, UINT16_MAX, 1393, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1394, UINT16_MAX, 1394, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1395, UINT16_MAX, 1395, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1396, UINT16_MAX, 1396, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1397, UINT16_MAX, 1397, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1398, UINT16_MAX, 1398, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1399, UINT16_MAX, 1399, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1400, UINT16_MAX, 1400, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1401, UINT16_MAX, 1401, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1402, UINT16_MAX, 1402, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1403, UINT16_MAX, 1403, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1404, UINT16_MAX, 1404, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1405, UINT16_MAX, 1405, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1406, UINT16_MAX, 1406, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1407, UINT16_MAX, 1407, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1408, UINT16_MAX, 1408, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1409, UINT16_MAX, 1409, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1410, UINT16_MAX, 1410, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1411, UINT16_MAX, 1411, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1412, UINT16_MAX, 1412, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1413, UINT16_MAX, 1413, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1414, UINT16_MAX, 1414, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1415, UINT16_MAX, 1415, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1416, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_L}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, false, 2, 0, UTF8PROC_BOUNDCLASS_L}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, false, 2, 0, UTF8PROC_BOUNDCLASS_V}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_V}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_T}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8395, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8396, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8397, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8398, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8399, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8400, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8401, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8402, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8403, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8404, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8405, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8406, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8407, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8408, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8409, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8410, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8411, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8412, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8413, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8414, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8415, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8416, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8417, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8418, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8419, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8420, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8421, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8422, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8423, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8424, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8425, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8426, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8427, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8428, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8429, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8430, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8431, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8432, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8433, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8434, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8435, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8436, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8437, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8438, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8439, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8440, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8441, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8442, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8443, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8444, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8445, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8446, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8447, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8448, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8449, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8450, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8451, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8452, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8453, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8454, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8455, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8456, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8457, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8458, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8459, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8460, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8461, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8462, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8463, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8464, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8465, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8466, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8467, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8468, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8469, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8470, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8471, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8472, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8473, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8474, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8475, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8476, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8477, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8478, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8479, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, 8480, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1417, 1417, UINT16_MAX, 1417, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1418, 1418, UINT16_MAX, 1418, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1419, 1419, UINT16_MAX, 1419, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1420, 1420, UINT16_MAX, 1420, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1421, 1421, UINT16_MAX, 1421, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1422, 1422, UINT16_MAX, 1422, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PD, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ZS, 0, UTF8PROC_BIDI_CLASS_WS, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2751, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9615, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2754, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9617, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2757, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9619, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2760, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9621, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2763, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9623, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2766, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 9625, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32806, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2769, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9627, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2772, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9629, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2775, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2778, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9631, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9633, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 2781, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 9635, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 9, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 955, 8211, UINT16_MAX, 8211, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 957, 8213, UINT16_MAX, 8213, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 969, 8223, UINT16_MAX, 8223, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 972, 8226, UINT16_MAX, 8226, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 973, 8227, UINT16_MAX, 8227, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 981, 8235, UINT16_MAX, 8235, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1004, 8258, UINT16_MAX, 8258, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1445, 8481, UINT16_MAX, 8481, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1446, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1447, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1448, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1449, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1450, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1451, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1452, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1453, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1454, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1455, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1456, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1457, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1458, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1459, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1460, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1461, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1462, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1464, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1465, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1466, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1467, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1468, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1469, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 4, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 485, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 486, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1470, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 6, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 10, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 12, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 355, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 14, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 479, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1471, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1472, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 15, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 19, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 20, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1473, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 493, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 21, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1474, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 846, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 847, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 848, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 863, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 864, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 8, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 17, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 20, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 21, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 846, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 847, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 859, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 863, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 864, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 968, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8482, UINT16_MAX, 8482, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8483, UINT16_MAX, 8483, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1475, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 2, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1476, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 94, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 5, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1477, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1478, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1479, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 491, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 490, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1480, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1481, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1482, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1483, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1484, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1485, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1486, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1487, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 494, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1488, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1489, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 495, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1490, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1491, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 505, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1492, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 778, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 513, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1493, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 514, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 779, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 25, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1494, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 1495, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 517, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 852, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 214, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9688, 1498, UINT16_MAX, 1498, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9691, UINT16_MAX, 8484, UINT16_MAX, 8484, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9693, 1503, UINT16_MAX, 1503, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9696, UINT16_MAX, 8485, UINT16_MAX, 8485, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9698, 1508, UINT16_MAX, 1508, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9701, UINT16_MAX, 8486, UINT16_MAX, 8486, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9703, 1513, UINT16_MAX, 1513, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9706, UINT16_MAX, 8487, UINT16_MAX, 8487, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9708, 1518, UINT16_MAX, 1518, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9711, UINT16_MAX, 8488, UINT16_MAX, 8488, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9713, 1523, UINT16_MAX, 1523, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9716, UINT16_MAX, 8489, UINT16_MAX, 8489, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9718, 1528, UINT16_MAX, 1528, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9721, UINT16_MAX, 8490, UINT16_MAX, 8490, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9723, 1533, UINT16_MAX, 1533, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9726, UINT16_MAX, 8491, UINT16_MAX, 8491, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9728, 1538, UINT16_MAX, 1538, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9731, UINT16_MAX, 8492, UINT16_MAX, 8492, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9733, 1543, UINT16_MAX, 1543, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9736, UINT16_MAX, 8493, UINT16_MAX, 8493, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9738, 1548, UINT16_MAX, 1548, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9741, UINT16_MAX, 8494, UINT16_MAX, 8494, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9743, 1553, UINT16_MAX, 1553, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9746, UINT16_MAX, 8495, UINT16_MAX, 8495, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9748, 1558, UINT16_MAX, 1558, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9751, UINT16_MAX, 8496, UINT16_MAX, 8496, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9753, 1563, UINT16_MAX, 1563, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9756, UINT16_MAX, 8497, UINT16_MAX, 8497, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9758, 1568, UINT16_MAX, 1568, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9761, UINT16_MAX, 8498, UINT16_MAX, 8498, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9763, 1573, UINT16_MAX, 1573, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9766, UINT16_MAX, 8499, UINT16_MAX, 8499, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9768, 1578, UINT16_MAX, 1578, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9771, UINT16_MAX, 8500, UINT16_MAX, 8500, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9773, 1583, UINT16_MAX, 1583, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9776, UINT16_MAX, 8501, UINT16_MAX, 8501, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9778, 1588, UINT16_MAX, 1588, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9781, UINT16_MAX, 8502, UINT16_MAX, 8502, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9783, 1593, UINT16_MAX, 1593, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9786, UINT16_MAX, 8503, UINT16_MAX, 8503, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9788, 1598, UINT16_MAX, 1598, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9791, UINT16_MAX, 8504, UINT16_MAX, 8504, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9793, 1603, UINT16_MAX, 1603, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9796, UINT16_MAX, 8505, UINT16_MAX, 8505, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9798, 1608, UINT16_MAX, 1608, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9801, UINT16_MAX, 8506, UINT16_MAX, 8506, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9803, 1613, UINT16_MAX, 1613, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9806, UINT16_MAX, 8507, UINT16_MAX, 8507, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9808, 1618, UINT16_MAX, 1618, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9811, UINT16_MAX, 8508, UINT16_MAX, 8508, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9813, 1623, UINT16_MAX, 1623, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9816, UINT16_MAX, 8509, UINT16_MAX, 8509, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9818, 1628, UINT16_MAX, 1628, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9821, UINT16_MAX, 8510, UINT16_MAX, 8510, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9823, 1633, UINT16_MAX, 1633, UINT16_MAX, 2884, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9826, UINT16_MAX, 8511, UINT16_MAX, 8511, 2887, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9828, 1638, UINT16_MAX, 1638, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9831, UINT16_MAX, 8512, UINT16_MAX, 8512, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9833, 1643, UINT16_MAX, 1643, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9836, UINT16_MAX, 8513, UINT16_MAX, 8513, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9838, 1648, UINT16_MAX, 1648, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9841, UINT16_MAX, 8514, UINT16_MAX, 8514, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9843, 1653, UINT16_MAX, 1653, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9846, UINT16_MAX, 8515, UINT16_MAX, 8515, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9848, 1658, UINT16_MAX, 1658, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9851, UINT16_MAX, 8516, UINT16_MAX, 8516, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9853, 1663, UINT16_MAX, 1663, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9856, UINT16_MAX, 8517, UINT16_MAX, 8517, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9858, 1668, UINT16_MAX, 1668, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9861, UINT16_MAX, 8518, UINT16_MAX, 8518, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9863, 1673, UINT16_MAX, 1673, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9866, UINT16_MAX, 8519, UINT16_MAX, 8519, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9868, 1678, UINT16_MAX, 1678, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9871, UINT16_MAX, 8520, UINT16_MAX, 8520, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9873, 1683, UINT16_MAX, 1683, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9876, UINT16_MAX, 8521, UINT16_MAX, 8521, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9878, 1688, UINT16_MAX, 1688, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9881, UINT16_MAX, 8522, UINT16_MAX, 8522, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9883, 1693, UINT16_MAX, 1693, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9886, UINT16_MAX, 8523, UINT16_MAX, 8523, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9888, 1698, UINT16_MAX, 1698, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9891, UINT16_MAX, 8524, UINT16_MAX, 8524, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9893, 1703, UINT16_MAX, 1703, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9896, UINT16_MAX, 8525, UINT16_MAX, 8525, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9898, 1708, UINT16_MAX, 1708, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9901, UINT16_MAX, 8526, UINT16_MAX, 8526, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9903, 1713, UINT16_MAX, 1713, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9906, UINT16_MAX, 8527, UINT16_MAX, 8527, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9908, 1718, UINT16_MAX, 1718, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9911, UINT16_MAX, 8528, UINT16_MAX, 8528, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9913, 1723, UINT16_MAX, 1723, UINT16_MAX, 3006, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9916, UINT16_MAX, 8529, UINT16_MAX, 8529, 3009, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9918, 1728, UINT16_MAX, 1728, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9921, UINT16_MAX, 8530, UINT16_MAX, 8530, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9923, 1733, UINT16_MAX, 1733, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9926, UINT16_MAX, 8531, UINT16_MAX, 8531, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9928, 1738, UINT16_MAX, 1738, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9931, UINT16_MAX, 8532, UINT16_MAX, 8532, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9933, 1743, UINT16_MAX, 1743, UINT16_MAX, 3024, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9936, UINT16_MAX, 8533, UINT16_MAX, 8533, 3027, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9938, 1748, UINT16_MAX, 1748, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9941, UINT16_MAX, 8534, UINT16_MAX, 8534, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9943, 1753, UINT16_MAX, 1753, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9946, UINT16_MAX, 8535, UINT16_MAX, 8535, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9948, 1758, UINT16_MAX, 1758, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9951, UINT16_MAX, 8536, UINT16_MAX, 8536, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9953, 1763, UINT16_MAX, 1763, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9956, UINT16_MAX, 8537, UINT16_MAX, 8537, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9958, 1768, UINT16_MAX, 1768, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9961, UINT16_MAX, 8538, UINT16_MAX, 8538, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9963, 1773, UINT16_MAX, 1773, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9966, UINT16_MAX, 8539, UINT16_MAX, 8539, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9968, 1778, UINT16_MAX, 1778, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9971, UINT16_MAX, 8540, UINT16_MAX, 8540, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9973, 1783, UINT16_MAX, 1783, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9976, UINT16_MAX, 8541, UINT16_MAX, 8541, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9978, 1788, UINT16_MAX, 1788, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9981, UINT16_MAX, 8542, UINT16_MAX, 8542, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9983, 1793, UINT16_MAX, 1793, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9986, UINT16_MAX, 8543, UINT16_MAX, 8543, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9988, 1798, UINT16_MAX, 1798, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9991, UINT16_MAX, 8544, UINT16_MAX, 8544, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9993, 1803, UINT16_MAX, 1803, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 9996, UINT16_MAX, 8545, UINT16_MAX, 8545, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 9998, 1808, UINT16_MAX, 1808, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10001, UINT16_MAX, 8546, UINT16_MAX, 8546, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10003, 1813, UINT16_MAX, 1813, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10006, UINT16_MAX, 8547, UINT16_MAX, 8547, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10008, 1818, UINT16_MAX, 1818, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10011, UINT16_MAX, 8548, UINT16_MAX, 8548, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10013, 1823, UINT16_MAX, 1823, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10016, UINT16_MAX, 8549, UINT16_MAX, 8549, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10018, 1828, UINT16_MAX, 1828, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10021, UINT16_MAX, 8550, UINT16_MAX, 8550, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10023, 1833, UINT16_MAX, 1833, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10026, UINT16_MAX, 8551, UINT16_MAX, 8551, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10028, 1838, UINT16_MAX, 1838, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10031, UINT16_MAX, 8552, UINT16_MAX, 8552, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10033, 1843, UINT16_MAX, 1843, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10036, UINT16_MAX, 8553, UINT16_MAX, 8553, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10038, 1848, UINT16_MAX, 1848, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10041, UINT16_MAX, 8554, UINT16_MAX, 8554, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10043, 1853, UINT16_MAX, 1853, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10046, UINT16_MAX, 8555, UINT16_MAX, 8555, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10048, 1858, UINT16_MAX, 1858, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10051, UINT16_MAX, 8556, UINT16_MAX, 8556, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10053, 1863, UINT16_MAX, 1863, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10056, UINT16_MAX, 8557, UINT16_MAX, 8557, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10058, 1868, UINT16_MAX, 1868, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10061, UINT16_MAX, 8558, UINT16_MAX, 8558, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10063, 10063, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10065, 10065, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10067, 10067, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10069, 10069, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 10071, 10071, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10073, 1738, 8532, UINT16_MAX, 8532, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1883, UINT16_MAX, 1883, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10076, 1886, UINT16_MAX, 1886, UINT16_MAX, 3241, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10079, UINT16_MAX, 8559, UINT16_MAX, 8559, 3250, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10081, 1891, UINT16_MAX, 1891, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10084, UINT16_MAX, 8560, UINT16_MAX, 8560, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10086, 1896, UINT16_MAX, 1896, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10089, UINT16_MAX, 8561, UINT16_MAX, 8561, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10091, 1901, UINT16_MAX, 1901, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10094, UINT16_MAX, 8562, UINT16_MAX, 8562, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10096, 1906, UINT16_MAX, 1906, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10099, UINT16_MAX, 8563, UINT16_MAX, 8563, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10101, 1911, UINT16_MAX, 1911, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10104, UINT16_MAX, 8564, UINT16_MAX, 8564, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10106, 1916, UINT16_MAX, 1916, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10109, UINT16_MAX, 8565, UINT16_MAX, 8565, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10111, 1921, UINT16_MAX, 1921, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10114, UINT16_MAX, 8566, UINT16_MAX, 8566, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10116, 1926, UINT16_MAX, 1926, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10119, UINT16_MAX, 8567, UINT16_MAX, 8567, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10121, 1931, UINT16_MAX, 1931, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10124, UINT16_MAX, 8568, UINT16_MAX, 8568, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10126, 1936, UINT16_MAX, 1936, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10129, UINT16_MAX, 8569, UINT16_MAX, 8569, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10131, 1941, UINT16_MAX, 1941, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10134, UINT16_MAX, 8570, UINT16_MAX, 8570, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10136, 1946, UINT16_MAX, 1946, UINT16_MAX, 3455, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10139, UINT16_MAX, 8571, UINT16_MAX, 8571, 3458, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10141, 1951, UINT16_MAX, 1951, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10144, UINT16_MAX, 8572, UINT16_MAX, 8572, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10146, 1956, UINT16_MAX, 1956, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10149, UINT16_MAX, 8573, UINT16_MAX, 8573, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10151, 1961, UINT16_MAX, 1961, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10154, UINT16_MAX, 8574, UINT16_MAX, 8574, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10156, 1966, UINT16_MAX, 1966, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10159, UINT16_MAX, 8575, UINT16_MAX, 8575, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10161, 1971, UINT16_MAX, 1971, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10164, UINT16_MAX, 8576, UINT16_MAX, 8576, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10166, 1976, UINT16_MAX, 1976, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10169, UINT16_MAX, 8577, UINT16_MAX, 8577, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10171, 1981, UINT16_MAX, 1981, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10174, UINT16_MAX, 8578, UINT16_MAX, 8578, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10176, 1986, UINT16_MAX, 1986, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10179, UINT16_MAX, 8579, UINT16_MAX, 8579, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10181, 1991, UINT16_MAX, 1991, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10184, UINT16_MAX, 8580, UINT16_MAX, 8580, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10186, 1996, UINT16_MAX, 1996, UINT16_MAX, 3559, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10189, UINT16_MAX, 8581, UINT16_MAX, 8581, 3562, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10191, 2001, UINT16_MAX, 2001, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10194, UINT16_MAX, 8582, UINT16_MAX, 8582, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10196, 2006, UINT16_MAX, 2006, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10199, UINT16_MAX, 8583, UINT16_MAX, 8583, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10201, 2011, UINT16_MAX, 2011, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10204, UINT16_MAX, 8584, UINT16_MAX, 8584, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10206, 2016, UINT16_MAX, 2016, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10209, UINT16_MAX, 8585, UINT16_MAX, 8585, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10211, 2021, UINT16_MAX, 2021, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10214, UINT16_MAX, 8586, UINT16_MAX, 8586, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10216, 2026, UINT16_MAX, 2026, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10219, UINT16_MAX, 8587, UINT16_MAX, 8587, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10221, 2031, UINT16_MAX, 2031, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10224, UINT16_MAX, 8588, UINT16_MAX, 8588, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10226, 2036, UINT16_MAX, 2036, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10229, UINT16_MAX, 8589, UINT16_MAX, 8589, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10231, 2041, UINT16_MAX, 2041, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10234, UINT16_MAX, 8590, UINT16_MAX, 8590, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10236, 2046, UINT16_MAX, 2046, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10239, UINT16_MAX, 8591, UINT16_MAX, 8591, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10241, 2051, UINT16_MAX, 2051, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10244, UINT16_MAX, 8592, UINT16_MAX, 8592, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10246, 2056, UINT16_MAX, 2056, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10249, UINT16_MAX, 8593, UINT16_MAX, 8593, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10251, 2061, UINT16_MAX, 2061, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10254, UINT16_MAX, 8594, UINT16_MAX, 8594, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10256, 2066, UINT16_MAX, 2066, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10259, UINT16_MAX, 8595, UINT16_MAX, 8595, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10261, 2071, UINT16_MAX, 2071, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10264, UINT16_MAX, 8596, UINT16_MAX, 8596, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10266, 2076, UINT16_MAX, 2076, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10269, UINT16_MAX, 8597, UINT16_MAX, 8597, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10271, 2081, UINT16_MAX, 2081, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10274, UINT16_MAX, 8598, UINT16_MAX, 8598, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10276, 2086, UINT16_MAX, 2086, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10279, UINT16_MAX, 8599, UINT16_MAX, 8599, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10281, 2091, UINT16_MAX, 2091, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10284, UINT16_MAX, 8600, UINT16_MAX, 8600, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10286, 2096, UINT16_MAX, 2096, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10289, UINT16_MAX, 8601, UINT16_MAX, 8601, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10291, 2101, UINT16_MAX, 2101, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10294, UINT16_MAX, 8602, UINT16_MAX, 8602, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10296, 2106, UINT16_MAX, 2106, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10299, UINT16_MAX, 8603, UINT16_MAX, 8603, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 2109, UINT16_MAX, 2109, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8604, UINT16_MAX, 8604, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 2110, UINT16_MAX, 2110, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8605, UINT16_MAX, 8605, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 2111, UINT16_MAX, 2111, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8606, UINT16_MAX, 8606, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10304, UINT16_MAX, 8607, UINT16_MAX, 8607, 3761, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10306, UINT16_MAX, 8608, UINT16_MAX, 8608, 3814, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10308, UINT16_MAX, 8609, UINT16_MAX, 8609, 4793, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10310, UINT16_MAX, 8610, UINT16_MAX, 8610, 4796, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10312, UINT16_MAX, 8611, UINT16_MAX, 8611, 4799, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10314, UINT16_MAX, 8612, UINT16_MAX, 8612, 4802, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10316, UINT16_MAX, 8613, UINT16_MAX, 8613, 4805, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10318, UINT16_MAX, 8614, UINT16_MAX, 8614, 4808, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10320, 2130, UINT16_MAX, 2130, UINT16_MAX, 3867, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10323, 2133, UINT16_MAX, 2133, UINT16_MAX, 3920, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10326, 2136, UINT16_MAX, 2136, UINT16_MAX, 4811, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10329, 2139, UINT16_MAX, 2139, UINT16_MAX, 4814, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10332, 2142, UINT16_MAX, 2142, UINT16_MAX, 4817, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10335, 2145, UINT16_MAX, 2145, UINT16_MAX, 4820, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10338, 2148, UINT16_MAX, 2148, UINT16_MAX, 4823, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10341, 2151, UINT16_MAX, 2151, UINT16_MAX, 4826, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10344, UINT16_MAX, 8615, UINT16_MAX, 8615, 3973, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10346, UINT16_MAX, 8616, UINT16_MAX, 8616, 3977, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10348, UINT16_MAX, 8617, UINT16_MAX, 8617, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10350, UINT16_MAX, 8618, UINT16_MAX, 8618, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10352, UINT16_MAX, 8619, UINT16_MAX, 8619, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10354, UINT16_MAX, 8620, UINT16_MAX, 8620, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10356, 2166, UINT16_MAX, 2166, UINT16_MAX, 3981, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10359, 2169, UINT16_MAX, 2169, UINT16_MAX, 3985, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10362, 2172, UINT16_MAX, 2172, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10365, 2175, UINT16_MAX, 2175, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10368, 2178, UINT16_MAX, 2178, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10371, 2181, UINT16_MAX, 2181, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10374, UINT16_MAX, 8621, UINT16_MAX, 8621, 3989, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10376, UINT16_MAX, 8622, UINT16_MAX, 8622, 4042, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10378, UINT16_MAX, 8623, UINT16_MAX, 8623, 4829, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10380, UINT16_MAX, 8624, UINT16_MAX, 8624, 4832, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10382, UINT16_MAX, 8625, UINT16_MAX, 8625, 4835, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10384, UINT16_MAX, 8626, UINT16_MAX, 8626, 4838, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10386, UINT16_MAX, 8627, UINT16_MAX, 8627, 4841, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10388, UINT16_MAX, 8628, UINT16_MAX, 8628, 4844, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10390, 2200, UINT16_MAX, 2200, UINT16_MAX, 4095, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10393, 2203, UINT16_MAX, 2203, UINT16_MAX, 4148, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10396, 2206, UINT16_MAX, 2206, UINT16_MAX, 4847, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10399, 2209, UINT16_MAX, 2209, UINT16_MAX, 4850, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10402, 2212, UINT16_MAX, 2212, UINT16_MAX, 4853, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10405, 2215, UINT16_MAX, 2215, UINT16_MAX, 4856, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10408, 2218, UINT16_MAX, 2218, UINT16_MAX, 4859, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10411, 2221, UINT16_MAX, 2221, UINT16_MAX, 4862, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10414, UINT16_MAX, 8629, UINT16_MAX, 8629, 4201, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10416, UINT16_MAX, 8630, UINT16_MAX, 8630, 4253, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10418, UINT16_MAX, 8631, UINT16_MAX, 8631, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10420, UINT16_MAX, 8632, UINT16_MAX, 8632, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10422, UINT16_MAX, 8633, UINT16_MAX, 8633, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10424, UINT16_MAX, 8634, UINT16_MAX, 8634, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10426, UINT16_MAX, 8635, UINT16_MAX, 8635, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10428, UINT16_MAX, 8636, UINT16_MAX, 8636, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10430, 2240, UINT16_MAX, 2240, UINT16_MAX, 4305, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10433, 2243, UINT16_MAX, 2243, UINT16_MAX, 4357, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10436, 2246, UINT16_MAX, 2246, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10439, 2249, UINT16_MAX, 2249, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10442, 2252, UINT16_MAX, 2252, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10445, 2255, UINT16_MAX, 2255, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10448, 2258, UINT16_MAX, 2258, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10451, 2261, UINT16_MAX, 2261, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10454, UINT16_MAX, 8637, UINT16_MAX, 8637, 4409, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10456, UINT16_MAX, 8638, UINT16_MAX, 8638, 4413, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10458, UINT16_MAX, 8639, UINT16_MAX, 8639, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10460, UINT16_MAX, 8640, UINT16_MAX, 8640, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10462, UINT16_MAX, 8641, UINT16_MAX, 8641, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10464, UINT16_MAX, 8642, UINT16_MAX, 8642, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10466, 2276, UINT16_MAX, 2276, UINT16_MAX, 4417, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10469, 2279, UINT16_MAX, 2279, UINT16_MAX, 4421, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10472, 2282, UINT16_MAX, 2282, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10475, 2285, UINT16_MAX, 2285, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10478, 2288, UINT16_MAX, 2288, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10481, 2291, UINT16_MAX, 2291, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10484, 10484, UINT16_MAX, UINT16_MAX, UINT16_MAX, 4425, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10486, UINT16_MAX, 8643, UINT16_MAX, 8643, 4477, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10488, 18682, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10493, UINT16_MAX, 8644, UINT16_MAX, 8644, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10495, 18689, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10500, UINT16_MAX, 8645, UINT16_MAX, 8645, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10502, 18696, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10507, UINT16_MAX, 8646, UINT16_MAX, 8646, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10509, 2319, UINT16_MAX, 2319, UINT16_MAX, 4529, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10512, 2322, UINT16_MAX, 2322, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10515, 2325, UINT16_MAX, 2325, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10518, 2328, UINT16_MAX, 2328, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10521, UINT16_MAX, 8647, UINT16_MAX, 8647, 4581, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10523, UINT16_MAX, 8648, UINT16_MAX, 8648, 4634, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10525, UINT16_MAX, 8649, UINT16_MAX, 8649, 4865, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10527, UINT16_MAX, 8650, UINT16_MAX, 8650, 4868, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10529, UINT16_MAX, 8651, UINT16_MAX, 8651, 4871, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10531, UINT16_MAX, 8652, UINT16_MAX, 8652, 4874, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10533, UINT16_MAX, 8653, UINT16_MAX, 8653, 4877, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10535, UINT16_MAX, 8654, UINT16_MAX, 8654, 4880, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10537, 2347, UINT16_MAX, 2347, UINT16_MAX, 4687, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10540, 2350, UINT16_MAX, 2350, UINT16_MAX, 4740, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10543, 2353, UINT16_MAX, 2353, UINT16_MAX, 4883, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10546, 2356, UINT16_MAX, 2356, UINT16_MAX, 4886, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10549, 2359, UINT16_MAX, 2359, UINT16_MAX, 4889, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10552, 2362, UINT16_MAX, 2362, UINT16_MAX, 4892, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10555, 2365, UINT16_MAX, 2365, UINT16_MAX, 4895, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10558, 2368, UINT16_MAX, 2368, UINT16_MAX, 4898, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10561, UINT16_MAX, 8655, UINT16_MAX, 8655, 4901, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 820, UINT16_MAX, 8656, UINT16_MAX, 8656, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10563, UINT16_MAX, 8657, UINT16_MAX, 8657, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 824, UINT16_MAX, 8658, UINT16_MAX, 8658, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10565, UINT16_MAX, 8659, UINT16_MAX, 8659, 4910, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 827, UINT16_MAX, 8660, UINT16_MAX, 8660, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10567, UINT16_MAX, 8661, UINT16_MAX, 8661, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 830, UINT16_MAX, 8662, UINT16_MAX, 8662, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10569, UINT16_MAX, 8663, UINT16_MAX, 8663, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 833, UINT16_MAX, 8664, UINT16_MAX, 8664, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10571, UINT16_MAX, 8665, UINT16_MAX, 8665, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 836, UINT16_MAX, 8666, UINT16_MAX, 8666, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10573, UINT16_MAX, 8667, UINT16_MAX, 8667, 5030, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 839, UINT16_MAX, 8668, UINT16_MAX, 8668, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10575, 10577, 8669, UINT16_MAX, 8669, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10579, 10581, 8670, UINT16_MAX, 8670, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10583, 10585, 8671, UINT16_MAX, 8671, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10587, 10589, 8672, UINT16_MAX, 8672, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10591, 10593, 8673, UINT16_MAX, 8673, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10595, 10597, 8674, UINT16_MAX, 8674, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10599, 10601, 8675, UINT16_MAX, 8675, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10603, 10605, 8676, UINT16_MAX, 8676, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10607, 2417, UINT16_MAX, 2417, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10610, 2420, UINT16_MAX, 2420, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10613, 2423, UINT16_MAX, 2423, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10616, 2426, UINT16_MAX, 2426, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10619, 2429, UINT16_MAX, 2429, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10622, 2432, UINT16_MAX, 2432, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10625, 2435, UINT16_MAX, 2435, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10628, 2438, UINT16_MAX, 2438, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10631, 10633, 8677, UINT16_MAX, 8677, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10635, 10637, 8678, UINT16_MAX, 8678, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10639, 10641, 8679, UINT16_MAX, 8679, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10643, 10645, 8680, UINT16_MAX, 8680, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10647, 10649, 8681, UINT16_MAX, 8681, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10651, 10653, 8682, UINT16_MAX, 8682, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10655, 10657, 8683, UINT16_MAX, 8683, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10659, 10661, 8684, UINT16_MAX, 8684, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10663, 2473, UINT16_MAX, 2473, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10666, 2476, UINT16_MAX, 2476, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10669, 2479, UINT16_MAX, 2479, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10672, 2482, UINT16_MAX, 2482, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10675, 2485, UINT16_MAX, 2485, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10678, 2488, UINT16_MAX, 2488, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10681, 2491, UINT16_MAX, 2491, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10684, 2494, UINT16_MAX, 2494, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10687, 10689, 8685, UINT16_MAX, 8685, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10691, 10693, 8686, UINT16_MAX, 8686, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10695, 10697, 8687, UINT16_MAX, 8687, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10699, 10701, 8688, UINT16_MAX, 8688, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10703, 10705, 8689, UINT16_MAX, 8689, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10707, 10709, 8690, UINT16_MAX, 8690, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10711, 10713, 8691, UINT16_MAX, 8691, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10715, 10717, 8692, UINT16_MAX, 8692, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10719, 2529, UINT16_MAX, 2529, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10722, 2532, UINT16_MAX, 2532, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10725, 2535, UINT16_MAX, 2535, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10728, 2538, UINT16_MAX, 2538, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10731, 2541, UINT16_MAX, 2541, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10734, 2544, UINT16_MAX, 2544, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10737, 2547, UINT16_MAX, 2547, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10740, 2550, UINT16_MAX, 2550, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10743, UINT16_MAX, 8693, UINT16_MAX, 8693, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10745, UINT16_MAX, 8694, UINT16_MAX, 8694, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10747, 10749, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10751, 10753, 8695, UINT16_MAX, 8695, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10755, 10757, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10759, 10759, UINT16_MAX, UINT16_MAX, UINT16_MAX, 4907, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10761, 18955, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10766, 2576, UINT16_MAX, 2576, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10769, 2579, UINT16_MAX, 2579, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10772, 2582, UINT16_MAX, 2582, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 2583, 2584, UINT16_MAX, 2584, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10777, 2587, UINT16_MAX, 2587, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10780, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 807, 807, 7127, UINT16_MAX, 7127, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10780, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 4919, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10782, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, 10784, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10786, 10788, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10790, 10792, 8696, UINT16_MAX, 8696, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10794, 10796, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10798, 10798, UINT16_MAX, UINT16_MAX, UINT16_MAX, 4916, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10800, 18994, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10805, 2615, UINT16_MAX, 2615, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 2616, 2617, UINT16_MAX, 2617, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10810, 2620, UINT16_MAX, 2620, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 2621, 2622, UINT16_MAX, 2622, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10815, 2625, UINT16_MAX, 2625, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, 10818, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, 10820, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, 10822, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10824, UINT16_MAX, 8697, UINT16_MAX, 8697, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10826, UINT16_MAX, 8698, UINT16_MAX, 8698, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10828, 19022, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 2641, 17226, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10834, 10834, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10836, 19030, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10841, 2651, UINT16_MAX, 2651, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10844, 2654, UINT16_MAX, 2654, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10847, 2657, UINT16_MAX, 2657, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 2658, 2659, UINT16_MAX, 2659, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, 10852, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, 10854, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, 10856, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10858, UINT16_MAX, 8699, UINT16_MAX, 8699, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10860, UINT16_MAX, 8700, UINT16_MAX, 8700, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10862, 19056, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 2675, 17267, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10868, 10868, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10870, UINT16_MAX, 8701, UINT16_MAX, 8701, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10872, 10872, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10874, 19068, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10879, 2689, UINT16_MAX, 2689, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10882, 2692, UINT16_MAX, 2692, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10885, 2695, UINT16_MAX, 2695, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 2696, 2697, UINT16_MAX, 2697, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10890, 2700, UINT16_MAX, 2700, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, 10893, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, 2703, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, 2704, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10897, 10899, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10901, 10903, 8702, UINT16_MAX, 8702, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10905, 10907, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10909, 10909, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5036, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, 10911, 19105, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10916, 2726, UINT16_MAX, 2726, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 2727, 2728, UINT16_MAX, 2728, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 10921, 2731, UINT16_MAX, 2731, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 2732, 2733, UINT16_MAX, 2733, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LT, 0, UTF8PROC_BIDI_CLASS_L, 0, 10926, 2736, UINT16_MAX, 2736, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, 2737, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10930, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 4971, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ZS, 0, UTF8PROC_BIDI_CLASS_WS, 0, 2740, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ZS, 0, UTF8PROC_BIDI_CLASS_WS, 0, 2741, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ZS, 0, UTF8PROC_BIDI_CLASS_WS, UTF8PROC_DECOMP_TYPE_COMPAT, 26, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ZS, 0, UTF8PROC_BIDI_CLASS_WS, UTF8PROC_DECOMP_TYPE_COMPAT, 26, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ZS, 0, UTF8PROC_BIDI_CLASS_WS, UTF8PROC_DECOMP_TYPE_NOBREAK, 26, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_BN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_BN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_ZWJ}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_PD, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_NOBREAK, 2742, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10935, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PI, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PF, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 2745, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10938, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19132, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ZL, 0, UTF8PROC_BIDI_CLASS_WS, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_ZP, 0, UTF8PROC_BIDI_CLASS_B, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_LRE, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_RLE, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_PDF, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_LRO, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_RLO, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ET, UTF8PROC_DECOMP_TYPE_COMPAT, 10943, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ET, UTF8PROC_DECOMP_TYPE_COMPAT, 19137, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10948, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19142, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10953, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10955, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_CS, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10957, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10959, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10961, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 27347, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_LRI, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_RLI, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_FSI, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_PDI, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUPER, 2775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 8, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUPER, 2776, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUPER, 2777, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUPER, 2778, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUPER, 2779, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUPER, 2780, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUPER, 2781, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ES, UTF8PROC_DECOMP_TYPE_SUPER, 2782, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ES, UTF8PROC_DECOMP_TYPE_SUPER, 2783, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SUPER, 2784, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SUPER, 2785, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SUPER, 2786, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 13, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUB, 2775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUB, 38, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUB, 31, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUB, 32, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUB, 2776, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUB, 2777, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUB, 2778, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUB, 2779, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUB, 2780, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_SUB, 2781, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ES, UTF8PROC_DECOMP_TYPE_SUB, 2782, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ES, UTF8PROC_DECOMP_TYPE_SUB, 2783, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SUB, 2784, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SUB, 2785, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SUB, 2786, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 4, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 14, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 23, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 485, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 7, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 10, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 11, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 12, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 13, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 15, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 18, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 19, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SC, 0, UTF8PROC_BIDI_CLASS_ET, UTF8PROC_DECOMP_TYPE_COMPAT, 10979, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19173, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19176, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2795, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10988, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19182, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19185, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 2804, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10997, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 6, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1453, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 277, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1454, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1457, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 11, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1459, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 10999, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1462, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2809, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SUPER, 11002, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19196, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SUPER, 11007, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2817, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 2818, 866, UINT16_MAX, 866, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 1456, 10, UINT16_MAX, 10, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, 2819, 65, UINT16_MAX, 65, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1448, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 4, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1450, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2820, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 2821, UINT16_MAX, 2821, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1458, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 14, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 2822, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 2823, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 2824, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 2825, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 8, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19210, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 858, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 847, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2829, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2830, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FONT, 2831, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1449, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 3, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 9, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8703, UINT16_MAX, 8703, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19216, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19219, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 27414, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19226, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19229, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19232, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19235, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19238, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19241, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19244, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19247, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19250, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19253, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19256, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19259, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 11070, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 1454, 2880, UINT16_MAX, 2880, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 11073, 2883, UINT16_MAX, 2883, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19268, 2887, UINT16_MAX, 2887, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 11080, 2890, UINT16_MAX, 2890, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 2891, 2892, UINT16_MAX, 2892, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 11085, 2895, UINT16_MAX, 2895, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19280, 2899, UINT16_MAX, 2899, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 27476, 2904, UINT16_MAX, 2904, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 11097, 2907, UINT16_MAX, 2907, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 2908, 2909, UINT16_MAX, 2909, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 11102, 2912, UINT16_MAX, 2912, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19297, 2916, UINT16_MAX, 2916, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 1457, 2917, UINT16_MAX, 2917, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 2795, 2918, UINT16_MAX, 2918, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 1449, 2919, UINT16_MAX, 2919, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 1458, 2920, UINT16_MAX, 2920, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 8, UINT16_MAX, 8704, UINT16_MAX, 8704, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 11113, UINT16_MAX, 8705, UINT16_MAX, 8705, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19307, UINT16_MAX, 8706, UINT16_MAX, 8706, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 11118, UINT16_MAX, 8707, UINT16_MAX, 8707, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21, UINT16_MAX, 8708, UINT16_MAX, 8708, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 11120, UINT16_MAX, 8709, UINT16_MAX, 8709, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19314, UINT16_MAX, 8710, UINT16_MAX, 8710, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 27509, UINT16_MAX, 8711, UINT16_MAX, 8711, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 11129, UINT16_MAX, 8712, UINT16_MAX, 8712, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23, UINT16_MAX, 8713, UINT16_MAX, 8713, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 11131, UINT16_MAX, 8714, UINT16_MAX, 8714, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19325, UINT16_MAX, 8715, UINT16_MAX, 8715, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 11, UINT16_MAX, 8716, UINT16_MAX, 8716, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 2, UINT16_MAX, 8717, UINT16_MAX, 8717, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3, UINT16_MAX, 8718, UINT16_MAX, 8718, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12, UINT16_MAX, 8719, UINT16_MAX, 8719, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 2944, UINT16_MAX, 2944, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8720, UINT16_MAX, 8720, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FRACTION, 19329, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5039, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5042, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5045, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11140, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11142, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11144, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11146, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11148, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11150, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5048, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5054, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5051, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5057, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11152, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5060, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11154, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5063, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11156, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5066, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11158, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5069, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11160, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 11162, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19356, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 11167, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19361, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5072, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11172, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5075, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11174, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5078, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11176, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5081, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11178, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5090, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11180, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5087, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11182, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5099, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5102, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11184, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11186, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11188, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11190, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11192, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5105, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5108, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11194, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11196, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5111, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5114, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11198, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11200, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5117, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5120, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5147, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5150, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11202, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11204, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5123, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5126, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11206, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11208, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5129, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5132, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11210, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11212, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5153, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5156, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5135, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5138, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5141, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5144, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11214, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11216, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11218, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11220, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5159, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5162, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5165, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5168, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11222, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11224, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11226, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11228, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11230, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11232, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11234, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11236, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, 0, 3046, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, 0, 3047, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 38, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 31, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 32, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 2776, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 2777, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 2778, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 2779, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 2780, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 2781, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 11240, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 11242, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 11244, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 11246, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 11248, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 11250, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 11252, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 11254, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 11256, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 11258, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 11260, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19454, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19457, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19460, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19466, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19469, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19472, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19475, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19478, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 27673, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 27677, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 27681, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 27685, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 27689, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 27693, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 27697, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 27701, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 27705, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 27709, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 27713, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 11333, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 11335, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 11337, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 11339, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 11341, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 11343, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 11345, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 11347, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 11349, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 19543, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 19546, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 19549, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 19552, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 19555, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 19558, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 19561, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 19564, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 19567, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 19570, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 19573, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19576, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19579, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19582, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19585, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19588, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19591, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19594, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19597, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19600, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19603, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19606, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19609, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19612, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19615, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19618, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19621, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19624, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19627, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19630, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19633, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19636, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19639, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19642, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19645, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19648, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 19651, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1446, 3270, UINT16_MAX, 3270, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1448, 3271, UINT16_MAX, 3271, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 2795, 3272, UINT16_MAX, 3272, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1449, 3273, UINT16_MAX, 3273, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1450, 3274, UINT16_MAX, 3274, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 2820, 3275, UINT16_MAX, 3275, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1452, 3276, UINT16_MAX, 3276, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1453, 3277, UINT16_MAX, 3277, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1454, 3278, UINT16_MAX, 3278, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1455, 3279, UINT16_MAX, 3279, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1456, 3280, UINT16_MAX, 3280, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1457, 3281, UINT16_MAX, 3281, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1458, 3282, UINT16_MAX, 3282, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1459, 3283, UINT16_MAX, 3283, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1460, 3284, UINT16_MAX, 3284, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1462, 3285, UINT16_MAX, 3285, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 2809, 3286, UINT16_MAX, 3286, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1463, 3287, UINT16_MAX, 3287, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3288, 3289, UINT16_MAX, 3289, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1464, 3290, UINT16_MAX, 3290, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1465, 3291, UINT16_MAX, 3291, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 2891, 3292, UINT16_MAX, 3292, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1466, 3293, UINT16_MAX, 3293, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 2908, 3294, UINT16_MAX, 3294, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3295, 3296, UINT16_MAX, 3296, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 2817, 3297, UINT16_MAX, 3297, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 0, UINT16_MAX, 8721, UINT16_MAX, 8721, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1, UINT16_MAX, 8722, UINT16_MAX, 8722, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 2, UINT16_MAX, 8723, UINT16_MAX, 8723, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3, UINT16_MAX, 8724, UINT16_MAX, 8724, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4, UINT16_MAX, 8725, UINT16_MAX, 8725, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 5, UINT16_MAX, 8726, UINT16_MAX, 8726, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 6, UINT16_MAX, 8727, UINT16_MAX, 8727, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 7, UINT16_MAX, 8728, UINT16_MAX, 8728, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 8, UINT16_MAX, 8729, UINT16_MAX, 8729, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 9, UINT16_MAX, 8730, UINT16_MAX, 8730, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 10, UINT16_MAX, 8731, UINT16_MAX, 8731, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 11, UINT16_MAX, 8732, UINT16_MAX, 8732, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12, UINT16_MAX, 8733, UINT16_MAX, 8733, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 13, UINT16_MAX, 8734, UINT16_MAX, 8734, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 14, UINT16_MAX, 8735, UINT16_MAX, 8735, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 15, UINT16_MAX, 8736, UINT16_MAX, 8736, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 16, UINT16_MAX, 8737, UINT16_MAX, 8737, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 17, UINT16_MAX, 8738, UINT16_MAX, 8738, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 18, UINT16_MAX, 8739, UINT16_MAX, 8739, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 19, UINT16_MAX, 8740, UINT16_MAX, 8740, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 20, UINT16_MAX, 8741, UINT16_MAX, 8741, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 21, UINT16_MAX, 8742, UINT16_MAX, 8742, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 22, UINT16_MAX, 8743, UINT16_MAX, 8743, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 23, UINT16_MAX, 8744, UINT16_MAX, 8744, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 24, UINT16_MAX, 8745, UINT16_MAX, 8745, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 25, UINT16_MAX, 8746, UINT16_MAX, 8746, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 2775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_E_BASE}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_E_BASE}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_GLUE_AFTER_ZWJ}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 27874, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19686, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 11497, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 19691, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, 11502, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, true, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5171, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3312, UINT16_MAX, 3312, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3313, UINT16_MAX, 3313, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3314, UINT16_MAX, 3314, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3315, UINT16_MAX, 3315, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3316, UINT16_MAX, 3316, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3317, UINT16_MAX, 3317, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3318, UINT16_MAX, 3318, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3319, UINT16_MAX, 3319, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3320, UINT16_MAX, 3320, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3321, UINT16_MAX, 3321, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3322, UINT16_MAX, 3322, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3323, UINT16_MAX, 3323, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3324, UINT16_MAX, 3324, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3325, UINT16_MAX, 3325, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3326, UINT16_MAX, 3326, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3327, UINT16_MAX, 3327, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3328, UINT16_MAX, 3328, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3329, UINT16_MAX, 3329, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3330, UINT16_MAX, 3330, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3331, UINT16_MAX, 3331, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3332, UINT16_MAX, 3332, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3333, UINT16_MAX, 3333, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3334, UINT16_MAX, 3334, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3335, UINT16_MAX, 3335, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3336, UINT16_MAX, 3336, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3337, UINT16_MAX, 3337, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3338, UINT16_MAX, 3338, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3339, UINT16_MAX, 3339, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3340, UINT16_MAX, 3340, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3341, UINT16_MAX, 3341, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3342, UINT16_MAX, 3342, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3343, UINT16_MAX, 3343, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3344, UINT16_MAX, 3344, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3345, UINT16_MAX, 3345, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3346, UINT16_MAX, 3346, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3347, UINT16_MAX, 3347, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3348, UINT16_MAX, 3348, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3349, UINT16_MAX, 3349, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3350, UINT16_MAX, 3350, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3351, UINT16_MAX, 3351, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3352, UINT16_MAX, 3352, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3353, UINT16_MAX, 3353, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3354, UINT16_MAX, 3354, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3355, UINT16_MAX, 3355, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3356, UINT16_MAX, 3356, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3357, UINT16_MAX, 3357, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3358, UINT16_MAX, 3358, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8747, UINT16_MAX, 8747, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8748, UINT16_MAX, 8748, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8749, UINT16_MAX, 8749, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8750, UINT16_MAX, 8750, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8751, UINT16_MAX, 8751, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8752, UINT16_MAX, 8752, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8753, UINT16_MAX, 8753, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8754, UINT16_MAX, 8754, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8755, UINT16_MAX, 8755, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8756, UINT16_MAX, 8756, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8757, UINT16_MAX, 8757, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8758, UINT16_MAX, 8758, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8759, UINT16_MAX, 8759, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8760, UINT16_MAX, 8760, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8761, UINT16_MAX, 8761, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8762, UINT16_MAX, 8762, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8763, UINT16_MAX, 8763, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8764, UINT16_MAX, 8764, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8765, UINT16_MAX, 8765, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8766, UINT16_MAX, 8766, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8767, UINT16_MAX, 8767, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8768, UINT16_MAX, 8768, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8769, UINT16_MAX, 8769, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8770, UINT16_MAX, 8770, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8771, UINT16_MAX, 8771, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8772, UINT16_MAX, 8772, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8773, UINT16_MAX, 8773, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8774, UINT16_MAX, 8774, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8775, UINT16_MAX, 8775, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8776, UINT16_MAX, 8776, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8777, UINT16_MAX, 8777, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8778, UINT16_MAX, 8778, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8779, UINT16_MAX, 8779, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8780, UINT16_MAX, 8780, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8781, UINT16_MAX, 8781, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8782, UINT16_MAX, 8782, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8783, UINT16_MAX, 8783, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8784, UINT16_MAX, 8784, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8785, UINT16_MAX, 8785, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8786, UINT16_MAX, 8786, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8787, UINT16_MAX, 8787, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8788, UINT16_MAX, 8788, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8789, UINT16_MAX, 8789, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8790, UINT16_MAX, 8790, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8791, UINT16_MAX, 8791, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8792, UINT16_MAX, 8792, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8793, UINT16_MAX, 8793, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3359, UINT16_MAX, 3359, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8794, UINT16_MAX, 8794, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3360, UINT16_MAX, 3360, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3361, UINT16_MAX, 3361, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3362, UINT16_MAX, 3362, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8795, UINT16_MAX, 8795, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8796, UINT16_MAX, 8796, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3363, UINT16_MAX, 3363, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8797, UINT16_MAX, 8797, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3364, UINT16_MAX, 3364, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8798, UINT16_MAX, 8798, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3365, UINT16_MAX, 3365, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8799, UINT16_MAX, 8799, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1468, UINT16_MAX, 1468, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1486, UINT16_MAX, 1486, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1467, UINT16_MAX, 1467, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1475, UINT16_MAX, 1475, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3366, UINT16_MAX, 3366, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8800, UINT16_MAX, 8800, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3367, UINT16_MAX, 3367, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8801, UINT16_MAX, 8801, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUB, 9, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 2891, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3368, UINT16_MAX, 3368, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3369, UINT16_MAX, 3369, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3370, UINT16_MAX, 3370, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8802, UINT16_MAX, 8802, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3371, UINT16_MAX, 3371, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8803, UINT16_MAX, 8803, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3372, UINT16_MAX, 3372, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8804, UINT16_MAX, 8804, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3373, UINT16_MAX, 3373, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8805, UINT16_MAX, 8805, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3374, UINT16_MAX, 3374, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8806, UINT16_MAX, 8806, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3375, UINT16_MAX, 3375, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8807, UINT16_MAX, 8807, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3376, UINT16_MAX, 3376, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8808, UINT16_MAX, 8808, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3377, UINT16_MAX, 3377, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8809, UINT16_MAX, 8809, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3378, UINT16_MAX, 3378, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8810, UINT16_MAX, 8810, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3379, UINT16_MAX, 3379, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8811, UINT16_MAX, 8811, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3380, UINT16_MAX, 3380, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8812, UINT16_MAX, 8812, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3381, UINT16_MAX, 3381, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8813, UINT16_MAX, 8813, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3382, UINT16_MAX, 3382, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8814, UINT16_MAX, 8814, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3383, UINT16_MAX, 3383, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8815, UINT16_MAX, 8815, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3384, UINT16_MAX, 3384, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8816, UINT16_MAX, 8816, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3385, UINT16_MAX, 3385, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8817, UINT16_MAX, 8817, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3386, UINT16_MAX, 3386, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8818, UINT16_MAX, 8818, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3387, UINT16_MAX, 3387, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8819, UINT16_MAX, 8819, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3388, UINT16_MAX, 3388, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8820, UINT16_MAX, 8820, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3389, UINT16_MAX, 3389, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8821, UINT16_MAX, 8821, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3390, UINT16_MAX, 3390, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8822, UINT16_MAX, 8822, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3391, UINT16_MAX, 3391, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8823, UINT16_MAX, 8823, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3392, UINT16_MAX, 3392, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8824, UINT16_MAX, 8824, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3393, UINT16_MAX, 3393, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8825, UINT16_MAX, 8825, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3394, UINT16_MAX, 3394, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8826, UINT16_MAX, 8826, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3395, UINT16_MAX, 3395, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8827, UINT16_MAX, 8827, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3396, UINT16_MAX, 3396, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8828, UINT16_MAX, 8828, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3397, UINT16_MAX, 3397, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8829, UINT16_MAX, 8829, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3398, UINT16_MAX, 3398, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8830, UINT16_MAX, 8830, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3399, UINT16_MAX, 3399, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8831, UINT16_MAX, 8831, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3400, UINT16_MAX, 3400, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8832, UINT16_MAX, 8832, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3401, UINT16_MAX, 3401, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8833, UINT16_MAX, 8833, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3402, UINT16_MAX, 3402, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8834, UINT16_MAX, 8834, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3403, UINT16_MAX, 3403, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8835, UINT16_MAX, 8835, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3404, UINT16_MAX, 3404, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8836, UINT16_MAX, 8836, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3405, UINT16_MAX, 3405, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8837, UINT16_MAX, 8837, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3406, UINT16_MAX, 3406, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8838, UINT16_MAX, 8838, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3407, UINT16_MAX, 3407, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8839, UINT16_MAX, 8839, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3408, UINT16_MAX, 3408, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8840, UINT16_MAX, 8840, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3409, UINT16_MAX, 3409, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8841, UINT16_MAX, 8841, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3410, UINT16_MAX, 3410, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8842, UINT16_MAX, 8842, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3411, UINT16_MAX, 3411, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8843, UINT16_MAX, 8843, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3412, UINT16_MAX, 3412, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8844, UINT16_MAX, 8844, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3413, UINT16_MAX, 3413, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8845, UINT16_MAX, 8845, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3414, UINT16_MAX, 3414, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8846, UINT16_MAX, 8846, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3415, UINT16_MAX, 3415, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8847, UINT16_MAX, 8847, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3416, UINT16_MAX, 3416, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8848, UINT16_MAX, 8848, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3417, UINT16_MAX, 3417, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8849, UINT16_MAX, 8849, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3418, UINT16_MAX, 3418, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8850, UINT16_MAX, 8850, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3419, UINT16_MAX, 3419, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8851, UINT16_MAX, 8851, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3420, UINT16_MAX, 3420, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8852, UINT16_MAX, 8852, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3421, UINT16_MAX, 3421, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8853, UINT16_MAX, 8853, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 3422, UINT16_MAX, 3422, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8854, UINT16_MAX, 8854, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8855, UINT16_MAX, 8855, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8856, UINT16_MAX, 8856, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8857, UINT16_MAX, 8857, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8858, UINT16_MAX, 8858, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8859, UINT16_MAX, 8859, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8860, UINT16_MAX, 8860, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8861, UINT16_MAX, 8861, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8862, UINT16_MAX, 8862, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8863, UINT16_MAX, 8863, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8864, UINT16_MAX, 8864, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8865, UINT16_MAX, 8865, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8866, UINT16_MAX, 8866, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8867, UINT16_MAX, 8867, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8868, UINT16_MAX, 8868, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8869, UINT16_MAX, 8869, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8870, UINT16_MAX, 8870, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8871, UINT16_MAX, 8871, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8872, UINT16_MAX, 8872, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8873, UINT16_MAX, 8873, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8874, UINT16_MAX, 8874, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8875, UINT16_MAX, 8875, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8876, UINT16_MAX, 8876, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8877, UINT16_MAX, 8877, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8878, UINT16_MAX, 8878, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8879, UINT16_MAX, 8879, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8880, UINT16_MAX, 8880, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8881, UINT16_MAX, 8881, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8882, UINT16_MAX, 8882, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8883, UINT16_MAX, 8883, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8884, UINT16_MAX, 8884, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8885, UINT16_MAX, 8885, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8886, UINT16_MAX, 8886, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8887, UINT16_MAX, 8887, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8888, UINT16_MAX, 8888, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8889, UINT16_MAX, 8889, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8890, UINT16_MAX, 8890, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8891, UINT16_MAX, 8891, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8892, UINT16_MAX, 8892, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8893, UINT16_MAX, 8893, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8894, UINT16_MAX, 8894, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3423, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3424, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3425, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3426, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3427, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3428, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3429, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3430, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3431, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3432, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3433, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3434, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3435, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3436, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3437, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3438, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3439, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3440, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3441, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3442, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3443, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3444, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3445, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3446, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3447, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3448, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3449, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3450, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3451, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3452, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3453, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3454, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3455, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3456, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3457, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3458, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3459, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3460, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3461, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3462, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3464, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3465, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3466, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3467, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3468, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3469, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3470, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3471, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3472, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3473, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3474, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3475, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3476, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3477, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3478, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3479, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3480, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3481, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3482, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3483, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3484, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3485, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3486, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3487, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3488, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3489, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3490, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3491, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3492, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3493, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3494, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3495, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3496, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3497, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3498, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3499, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3500, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3501, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3502, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3503, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3504, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3505, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3506, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3507, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3508, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3509, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3510, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3511, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3512, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3513, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3514, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3515, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3516, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3517, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3518, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3519, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3520, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3521, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3522, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3523, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3524, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3525, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3526, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3527, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3528, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3529, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3530, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3531, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3532, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3533, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3534, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3535, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3536, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3537, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3538, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3539, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3540, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3541, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3542, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3543, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3544, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3545, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3546, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3547, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3548, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3549, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3550, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3551, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3552, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3553, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3554, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3555, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3556, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3557, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3558, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3559, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3560, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3561, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3562, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3563, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3564, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3565, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3566, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3567, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3568, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3569, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3570, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3571, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3572, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3573, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3574, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3575, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3576, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3577, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3578, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3579, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3580, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3581, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3582, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3583, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3584, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3585, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3586, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3587, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3588, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3589, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3590, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3591, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3592, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3593, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3594, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3595, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3596, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3597, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3598, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3599, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3600, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3601, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3602, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3603, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3604, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3605, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3606, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3607, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3608, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3609, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3610, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3611, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3612, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3613, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3614, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3615, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3616, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3617, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3618, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3619, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3620, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3621, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3622, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3623, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3624, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3625, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3626, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3627, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3628, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3629, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3630, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3631, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3632, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3633, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3634, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3635, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3636, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3637, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3638, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3639, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ZS, 0, UTF8PROC_BIDI_CLASS_WS, UTF8PROC_DECOMP_TYPE_WIDE, 26, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 218, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 224, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 3640, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3449, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3641, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3642, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5239, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5174, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11835, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5177, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11837, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5180, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11839, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5183, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11841, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5186, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11843, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5189, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11845, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5192, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11847, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5195, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11849, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5198, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11851, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5201, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11853, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5204, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11855, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5207, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11857, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5210, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11859, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5213, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11861, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5216, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11863, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5219, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11865, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11867, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5223, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11869, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11871, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5227, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11873, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11875, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5231, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11877, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11879, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5235, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11881, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11883, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11885, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 8, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32820, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 8, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 32821, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 11887, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 11889, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5242, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, 0, 11891, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_VERTICAL, 11893, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5310, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5245, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11895, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5248, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11897, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5251, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11899, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5254, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11901, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5257, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11903, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5260, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11905, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5263, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11907, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5266, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11909, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5269, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11911, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5272, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11913, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5275, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11915, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5278, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11917, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5281, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11919, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5284, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11921, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5287, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11923, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5290, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11925, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11927, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5294, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11929, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11931, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5298, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11933, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11935, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5302, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11937, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11939, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5306, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11941, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11943, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5313, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5316, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5319, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5322, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11945, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11947, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11949, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11951, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 11953, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5325, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, 0, 11955, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_VERTICAL, 11957, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3767, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3768, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3769, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3770, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3771, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3772, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3773, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3774, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3776, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3777, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3778, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3779, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3780, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3781, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3782, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3783, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3784, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3785, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3786, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3787, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3788, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3789, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3790, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3791, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3792, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3793, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3794, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3795, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3796, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3797, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3798, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3799, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3800, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3801, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3802, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3803, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3804, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3805, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3806, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3807, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3808, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3809, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3810, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3811, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3812, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3813, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3814, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3815, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3816, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3817, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3818, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3819, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3820, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3821, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3822, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3823, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3824, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3825, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3826, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3827, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3828, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3829, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3830, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3831, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3832, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3833, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3834, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3835, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3836, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3837, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3838, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3839, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3840, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3841, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3842, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3843, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3844, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3845, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3846, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3847, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3848, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3849, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3850, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3851, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3852, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3853, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3854, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3855, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3856, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3857, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3858, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3859, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 3860, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3426, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3432, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3861, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3862, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3863, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3864, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3865, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3866, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3430, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3867, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3868, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3869, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3870, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3434, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20255, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20258, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20261, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20264, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20267, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20270, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20273, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20276, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20279, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20282, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20285, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20288, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20291, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20294, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28489, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28493, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28497, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28501, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28505, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28509, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28513, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28517, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28521, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28525, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28529, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28533, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28537, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28541, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 28545, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 53125, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 44940, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20370, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20373, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20376, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20379, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20382, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20385, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20388, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20391, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20394, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20397, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20400, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20403, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20406, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20409, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20412, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20415, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20418, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20421, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20424, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20427, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20430, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20433, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20436, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20439, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20442, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20445, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20448, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20451, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20454, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20457, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20460, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20466, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20469, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20472, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20475, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4094, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4095, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3492, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4096, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SQUARE, 20481, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12292, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12294, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12296, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12298, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12300, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12302, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12304, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12306, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12308, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12310, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12312, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12314, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12316, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12318, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12320, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3767, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3770, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3773, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3783, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3784, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3787, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3789, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3790, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3792, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3793, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3794, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3795, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3796, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12322, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12324, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12326, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12328, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12330, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12332, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12334, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12336, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12338, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12340, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12342, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12344, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12346, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 12348, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 36926, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 28739, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12359, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3426, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3432, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3861, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3862, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4169, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4170, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4171, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3437, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4172, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3449, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3499, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3511, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3510, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3500, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3592, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3457, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3497, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4173, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4174, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4175, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4176, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4177, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4178, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4179, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4180, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4181, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4182, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4183, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4184, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4185, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4186, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4187, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4188, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4189, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4190, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3863, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3864, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 3865, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4191, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4192, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4193, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4194, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4195, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4196, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4197, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4198, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4199, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4200, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12393, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12395, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12397, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12399, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12401, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12403, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12405, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12407, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12409, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12411, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12413, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12415, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12417, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12419, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_CIRCLE, 12421, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12423, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12425, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12427, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12429, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12431, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12433, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12435, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12437, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12439, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20633, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20636, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 20639, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SQUARE, 12450, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SQUARE, 20644, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SQUARE, 12455, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SQUARE, 20649, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4268, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4269, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4270, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4271, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4272, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4273, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4274, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4275, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4276, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4277, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4278, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4279, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4280, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4281, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4282, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4283, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4284, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4285, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4286, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4287, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4288, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4289, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4290, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4291, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4292, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4293, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4294, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4295, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4296, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4297, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4298, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4299, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4300, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4301, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4302, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4303, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4304, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4305, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4306, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4307, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4308, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4309, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4310, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4311, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4312, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4313, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 4314, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 28891, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 28895, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 28899, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20711, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 28906, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20718, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20721, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37108, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 28921, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20733, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20736, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20739, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 28934, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 28938, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20750, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20753, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12564, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20758, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 28953, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 28957, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12577, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37155, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 45352, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37166, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20787, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37174, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37179, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 28992, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20804, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20807, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20810, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29005, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37201, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29014, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20826, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20829, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20832, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12643, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12645, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12647, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12649, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20843, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20846, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37233, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20854, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29049, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37245, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20866, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12677, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12679, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37257, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29070, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37266, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20887, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37274, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12703, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20897, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20900, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20903, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20906, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20909, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29104, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20916, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12727, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20921, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20924, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20927, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29122, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20934, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20937, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20940, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37327, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29140, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12760, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37338, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12767, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29153, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29157, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20969, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20972, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20975, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29170, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12790, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20984, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29179, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12799, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37377, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 20998, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12809, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12811, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12813, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12815, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12817, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12819, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12821, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12823, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12825, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 12827, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21021, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21024, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21027, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21030, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21033, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21036, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21039, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21042, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21045, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21048, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21051, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21054, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21057, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21060, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21063, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21066, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12877, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12879, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21073, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12884, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12886, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SQUARE, 12888, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SQUARE, 21082, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SQUARE, 21085, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SQUARE, 12896, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12898, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12900, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12902, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12904, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29290, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12910, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12912, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12914, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12916, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12918, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12920, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12922, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12924, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21118, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29313, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12933, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12935, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12937, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12939, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12941, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12943, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12945, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21139, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21142, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21145, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21148, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12959, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12961, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12963, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12965, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12967, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12969, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12971, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12973, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12975, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12977, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21171, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21174, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12985, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21179, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21182, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21185, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 12996, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21190, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21193, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29388, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13008, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21202, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21205, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21208, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21211, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 37598, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 45795, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13033, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13035, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13037, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13039, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13041, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13043, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13045, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13047, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13049, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13051, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13053, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13055, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13057, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13059, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13061, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13063, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13065, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13067, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29453, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13073, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13075, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13077, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21275, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13086, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13088, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13090, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13092, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13094, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13096, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13098, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13100, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13102, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13104, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21298, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13109, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13111, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21305, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21308, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13119, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 29505, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 21317, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13128, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13130, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13132, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 13134, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SQUARE, 21328, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SQUARE, 21331, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13142, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13144, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13146, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13148, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13150, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13152, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13154, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13156, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13158, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21352, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21355, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21358, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21361, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21364, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21367, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21370, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21373, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21376, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21379, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21382, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21385, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21388, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21391, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21394, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21397, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21400, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21403, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21406, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21409, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21412, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 21415, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SQUARE, 21418, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5037, UINT16_MAX, 5037, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8895, UINT16_MAX, 8895, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5038, UINT16_MAX, 5038, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8896, UINT16_MAX, 8896, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5039, UINT16_MAX, 5039, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8897, UINT16_MAX, 8897, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5040, UINT16_MAX, 5040, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8898, UINT16_MAX, 8898, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5041, UINT16_MAX, 5041, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8899, UINT16_MAX, 8899, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1445, UINT16_MAX, 1445, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8481, UINT16_MAX, 8481, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5042, UINT16_MAX, 5042, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8900, UINT16_MAX, 8900, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5043, UINT16_MAX, 5043, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8901, UINT16_MAX, 8901, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5044, UINT16_MAX, 5044, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8902, UINT16_MAX, 8902, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5045, UINT16_MAX, 5045, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8903, UINT16_MAX, 8903, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5046, UINT16_MAX, 5046, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8904, UINT16_MAX, 8904, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5047, UINT16_MAX, 5047, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8905, UINT16_MAX, 8905, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5048, UINT16_MAX, 5048, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8906, UINT16_MAX, 8906, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5049, UINT16_MAX, 5049, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8907, UINT16_MAX, 8907, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5050, UINT16_MAX, 5050, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8908, UINT16_MAX, 8908, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5051, UINT16_MAX, 5051, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8909, UINT16_MAX, 8909, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5052, UINT16_MAX, 5052, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8910, UINT16_MAX, 8910, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5053, UINT16_MAX, 5053, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8911, UINT16_MAX, 8911, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5054, UINT16_MAX, 5054, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8912, UINT16_MAX, 8912, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5055, UINT16_MAX, 5055, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8913, UINT16_MAX, 8913, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5056, UINT16_MAX, 5056, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8914, UINT16_MAX, 8914, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5057, UINT16_MAX, 5057, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8915, UINT16_MAX, 8915, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5058, UINT16_MAX, 5058, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8916, UINT16_MAX, 8916, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5059, UINT16_MAX, 5059, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8917, UINT16_MAX, 8917, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5060, UINT16_MAX, 5060, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8918, UINT16_MAX, 8918, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5061, UINT16_MAX, 5061, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8919, UINT16_MAX, 8919, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5062, UINT16_MAX, 5062, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8920, UINT16_MAX, 8920, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5063, UINT16_MAX, 5063, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8921, UINT16_MAX, 8921, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5064, UINT16_MAX, 5064, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8922, UINT16_MAX, 8922, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5065, UINT16_MAX, 5065, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8923, UINT16_MAX, 8923, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5066, UINT16_MAX, 5066, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8924, UINT16_MAX, 8924, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5067, UINT16_MAX, 5067, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8925, UINT16_MAX, 8925, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5068, UINT16_MAX, 5068, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8926, UINT16_MAX, 8926, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5069, UINT16_MAX, 5069, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8927, UINT16_MAX, 8927, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5070, UINT16_MAX, 5070, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8928, UINT16_MAX, 8928, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5071, UINT16_MAX, 5071, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8929, UINT16_MAX, 8929, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5072, UINT16_MAX, 5072, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8930, UINT16_MAX, 8930, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 981, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 983, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5073, UINT16_MAX, 5073, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8931, UINT16_MAX, 8931, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5074, UINT16_MAX, 5074, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8932, UINT16_MAX, 8932, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5075, UINT16_MAX, 5075, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8933, UINT16_MAX, 8933, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5076, UINT16_MAX, 5076, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8934, UINT16_MAX, 8934, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5077, UINT16_MAX, 5077, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8935, UINT16_MAX, 8935, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5078, UINT16_MAX, 5078, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8936, UINT16_MAX, 8936, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5079, UINT16_MAX, 5079, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8937, UINT16_MAX, 8937, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5080, UINT16_MAX, 5080, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8938, UINT16_MAX, 8938, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5081, UINT16_MAX, 5081, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8939, UINT16_MAX, 8939, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5082, UINT16_MAX, 5082, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8940, UINT16_MAX, 8940, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5083, UINT16_MAX, 5083, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8941, UINT16_MAX, 8941, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5084, UINT16_MAX, 5084, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8942, UINT16_MAX, 8942, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5085, UINT16_MAX, 5085, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8943, UINT16_MAX, 8943, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5086, UINT16_MAX, 5086, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8944, UINT16_MAX, 8944, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5087, UINT16_MAX, 5087, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8945, UINT16_MAX, 8945, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5088, UINT16_MAX, 5088, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8946, UINT16_MAX, 8946, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5089, UINT16_MAX, 5089, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8947, UINT16_MAX, 8947, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5090, UINT16_MAX, 5090, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8948, UINT16_MAX, 8948, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5091, UINT16_MAX, 5091, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8949, UINT16_MAX, 8949, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5092, UINT16_MAX, 5092, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8950, UINT16_MAX, 8950, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5093, UINT16_MAX, 5093, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8951, UINT16_MAX, 8951, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5094, UINT16_MAX, 5094, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8952, UINT16_MAX, 8952, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5095, UINT16_MAX, 5095, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8953, UINT16_MAX, 8953, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5096, UINT16_MAX, 5096, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8954, UINT16_MAX, 8954, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5097, UINT16_MAX, 5097, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8955, UINT16_MAX, 8955, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5098, UINT16_MAX, 5098, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8956, UINT16_MAX, 8956, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5099, UINT16_MAX, 5099, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8957, UINT16_MAX, 8957, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5100, UINT16_MAX, 5100, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8958, UINT16_MAX, 8958, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5101, UINT16_MAX, 5101, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8959, UINT16_MAX, 8959, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5102, UINT16_MAX, 5102, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8960, UINT16_MAX, 8960, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5103, UINT16_MAX, 5103, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8961, UINT16_MAX, 8961, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5104, UINT16_MAX, 5104, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8962, UINT16_MAX, 8962, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5105, UINT16_MAX, 5105, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8963, UINT16_MAX, 8963, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5106, UINT16_MAX, 5106, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8964, UINT16_MAX, 8964, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5107, UINT16_MAX, 5107, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8965, UINT16_MAX, 8965, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5108, UINT16_MAX, 5108, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8966, UINT16_MAX, 8966, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5109, UINT16_MAX, 5109, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8967, UINT16_MAX, 8967, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5110, UINT16_MAX, 5110, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8968, UINT16_MAX, 8968, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 5110, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5111, UINT16_MAX, 5111, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8969, UINT16_MAX, 8969, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5112, UINT16_MAX, 5112, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8970, UINT16_MAX, 8970, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5113, UINT16_MAX, 5113, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5114, UINT16_MAX, 5114, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8971, UINT16_MAX, 8971, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5115, UINT16_MAX, 5115, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8972, UINT16_MAX, 8972, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5116, UINT16_MAX, 5116, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8973, UINT16_MAX, 8973, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5117, UINT16_MAX, 5117, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8974, UINT16_MAX, 8974, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5118, UINT16_MAX, 5118, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8975, UINT16_MAX, 8975, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5119, UINT16_MAX, 5119, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8976, UINT16_MAX, 8976, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1479, UINT16_MAX, 1479, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5120, UINT16_MAX, 5120, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8977, UINT16_MAX, 8977, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5121, UINT16_MAX, 5121, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8978, UINT16_MAX, 8978, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5122, UINT16_MAX, 5122, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8979, UINT16_MAX, 8979, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5123, UINT16_MAX, 5123, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8980, UINT16_MAX, 8980, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5124, UINT16_MAX, 5124, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8981, UINT16_MAX, 8981, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5125, UINT16_MAX, 5125, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8982, UINT16_MAX, 8982, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5126, UINT16_MAX, 5126, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8983, UINT16_MAX, 8983, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5127, UINT16_MAX, 5127, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8984, UINT16_MAX, 8984, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5128, UINT16_MAX, 5128, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8985, UINT16_MAX, 8985, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5129, UINT16_MAX, 5129, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8986, UINT16_MAX, 8986, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5130, UINT16_MAX, 5130, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8987, UINT16_MAX, 8987, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5131, UINT16_MAX, 5131, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8988, UINT16_MAX, 8988, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 785, UINT16_MAX, 785, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1470, UINT16_MAX, 1470, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1478, UINT16_MAX, 1478, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5132, UINT16_MAX, 5132, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1480, UINT16_MAX, 1480, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5133, UINT16_MAX, 5133, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5134, UINT16_MAX, 5134, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 1482, UINT16_MAX, 1482, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5135, UINT16_MAX, 5135, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5136, UINT16_MAX, 5136, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8989, UINT16_MAX, 8989, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5137, UINT16_MAX, 5137, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8990, UINT16_MAX, 8990, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 5138, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 371, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ET, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 8991, UINT16_MAX, 8991, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 5075, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 5139, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 3360, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SUPER, 5140, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5141, 5141, UINT16_MAX, 5141, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5142, 5142, UINT16_MAX, 5142, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5143, 5143, UINT16_MAX, 5143, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5144, 5144, UINT16_MAX, 5144, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5145, 5145, UINT16_MAX, 5145, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5146, 5146, UINT16_MAX, 5146, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5147, 5147, UINT16_MAX, 5147, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5148, 5148, UINT16_MAX, 5148, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5149, 5149, UINT16_MAX, 5149, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5150, 5150, UINT16_MAX, 5150, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5151, 5151, UINT16_MAX, 5151, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5152, 5152, UINT16_MAX, 5152, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5153, 5153, UINT16_MAX, 5153, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5154, 5154, UINT16_MAX, 5154, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5155, 5155, UINT16_MAX, 5155, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5156, 5156, UINT16_MAX, 5156, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5157, 5157, UINT16_MAX, 5157, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5158, 5158, UINT16_MAX, 5158, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5159, 5159, UINT16_MAX, 5159, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5160, 5160, UINT16_MAX, 5160, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5161, 5161, UINT16_MAX, 5161, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5162, 5162, UINT16_MAX, 5162, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5163, 5163, UINT16_MAX, 5163, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5164, 5164, UINT16_MAX, 5164, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5165, 5165, UINT16_MAX, 5165, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5166, 5166, UINT16_MAX, 5166, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5167, 5167, UINT16_MAX, 5167, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5168, 5168, UINT16_MAX, 5168, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5169, 5169, UINT16_MAX, 5169, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5170, 5170, UINT16_MAX, 5170, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5171, 5171, UINT16_MAX, 5171, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5172, 5172, UINT16_MAX, 5172, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5173, 5173, UINT16_MAX, 5173, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5174, 5174, UINT16_MAX, 5174, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5175, 5175, UINT16_MAX, 5175, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5176, 5176, UINT16_MAX, 5176, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5177, 5177, UINT16_MAX, 5177, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5178, 5178, UINT16_MAX, 5178, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5179, 5179, UINT16_MAX, 5179, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5180, 5180, UINT16_MAX, 5180, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5181, 5181, UINT16_MAX, 5181, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5182, 5182, UINT16_MAX, 5182, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5183, 5183, UINT16_MAX, 5183, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5184, 5184, UINT16_MAX, 5184, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5185, 5185, UINT16_MAX, 5185, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5186, 5186, UINT16_MAX, 5186, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5187, 5187, UINT16_MAX, 5187, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5188, 5188, UINT16_MAX, 5188, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5189, 5189, UINT16_MAX, 5189, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5190, 5190, UINT16_MAX, 5190, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5191, 5191, UINT16_MAX, 5191, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5192, 5192, UINT16_MAX, 5192, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5193, 5193, UINT16_MAX, 5193, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5194, 5194, UINT16_MAX, 5194, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5195, 5195, UINT16_MAX, 5195, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5196, 5196, UINT16_MAX, 5196, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5197, 5197, UINT16_MAX, 5197, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5198, 5198, UINT16_MAX, 5198, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5199, 5199, UINT16_MAX, 5199, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5200, 5200, UINT16_MAX, 5200, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5201, 5201, UINT16_MAX, 5201, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5202, 5202, UINT16_MAX, 5202, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5203, 5203, UINT16_MAX, 5203, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5204, 5204, UINT16_MAX, 5204, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5205, 5205, UINT16_MAX, 5205, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5206, 5206, UINT16_MAX, 5206, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5207, 5207, UINT16_MAX, 5207, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5208, 5208, UINT16_MAX, 5208, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5209, 5209, UINT16_MAX, 5209, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5210, 5210, UINT16_MAX, 5210, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5211, 5211, UINT16_MAX, 5211, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5212, 5212, UINT16_MAX, 5212, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5213, 5213, UINT16_MAX, 5213, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5214, 5214, UINT16_MAX, 5214, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5215, 5215, UINT16_MAX, 5215, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5216, 5216, UINT16_MAX, 5216, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5217, 5217, UINT16_MAX, 5217, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5218, 5218, UINT16_MAX, 5218, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5219, 5219, UINT16_MAX, 5219, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 5220, 5220, UINT16_MAX, 5220, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_LV}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_LVT}, + {UTF8PROC_CATEGORY_CS, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_CO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5221, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5222, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3584, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5223, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5224, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5225, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5226, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3638, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5227, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3592, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5228, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5229, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5230, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5231, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5232, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5233, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5234, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5235, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5236, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5237, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5238, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5239, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5240, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5241, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5242, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5243, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5244, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5245, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5246, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5247, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5248, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5249, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5250, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5251, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5252, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5253, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5254, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5255, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5256, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5257, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5258, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5259, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5260, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5261, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5262, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5263, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5264, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5265, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5266, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5267, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5268, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3550, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5269, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5270, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5271, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5272, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5273, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5274, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5275, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5276, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5277, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5278, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5279, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3623, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5280, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5281, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5282, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5283, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5284, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5285, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5286, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5287, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5288, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5289, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5290, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5291, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5292, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5293, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5294, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5295, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5296, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5297, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5298, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5299, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5300, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5301, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5302, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5303, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5304, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5305, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5306, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5307, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5308, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5309, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5310, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5311, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5312, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5313, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5314, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5315, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5316, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5317, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5318, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5319, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5320, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5321, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5322, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5323, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5324, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5325, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5326, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3586, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5327, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5328, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5329, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5330, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5331, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5332, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5333, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5334, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5335, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5336, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5337, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5338, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5339, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5340, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5341, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5342, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5343, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5344, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5345, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5346, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5347, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5348, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5349, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3444, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5350, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5351, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5352, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5353, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5354, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5355, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5356, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5357, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5358, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5359, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5360, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5361, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5362, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5363, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5364, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5365, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5366, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5367, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5368, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5369, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5370, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5371, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5372, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5373, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5374, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5375, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5376, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5377, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5378, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5379, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5380, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5381, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5382, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5383, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5384, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5385, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5386, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5387, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5388, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5389, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5390, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5391, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5392, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5393, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5394, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5395, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5396, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5397, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5398, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5399, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5400, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5401, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5402, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5403, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3637, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5404, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5405, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5406, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5407, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5408, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5409, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5410, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5411, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5412, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5413, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5414, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5415, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 4170, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5416, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5417, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5418, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5419, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5420, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5421, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5422, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5423, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5424, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5425, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5426, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5427, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5428, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5429, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5430, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5431, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5432, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5433, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5434, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5435, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5436, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5437, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3591, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5438, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5439, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5440, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5441, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5442, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5443, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5444, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5445, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5446, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5447, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5448, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5449, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5450, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3542, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5451, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5452, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5453, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5454, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5455, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5456, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5457, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5458, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5459, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5460, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5461, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5462, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5464, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5465, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5466, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3569, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5467, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3572, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5468, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5469, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5470, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5471, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5472, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5473, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5474, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5475, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5476, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5477, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5478, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5479, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5480, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5481, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3549, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5482, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5483, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5484, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5485, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5486, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5487, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5488, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5489, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5490, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5491, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5492, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5493, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5494, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5495, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5496, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5497, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5498, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5499, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5500, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5501, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5502, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5503, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3470, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5504, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5505, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5506, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5507, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5508, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5509, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5510, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5511, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5512, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5513, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5514, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5515, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5516, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5517, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5518, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 4175, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5519, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5520, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5521, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5522, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 4179, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5523, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5524, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5525, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5526, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5527, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5528, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5529, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5530, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5531, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5532, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5533, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5534, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5535, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5536, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5537, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5538, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5539, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5540, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5541, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5542, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5543, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5544, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5545, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5546, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5548, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5549, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5550, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5551, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5552, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5553, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5554, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5555, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5556, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5557, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5558, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5559, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5560, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5561, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5562, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5563, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5564, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5565, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5566, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5567, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5568, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5569, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5570, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5571, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5572, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5573, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5574, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5575, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5576, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5577, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5578, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5579, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3503, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5580, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5581, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5582, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5583, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5584, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5585, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5586, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5587, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5588, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5589, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5590, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5591, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5592, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5593, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5594, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5595, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5596, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5597, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5598, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5599, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5600, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5601, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5602, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5603, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5604, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5605, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5606, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5607, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5608, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5609, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5610, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5611, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5612, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5613, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5614, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5615, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5616, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5617, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5619, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5621, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5623, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5624, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5625, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5626, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5628, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5630, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5632, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 5633, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13826, 13826, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13828, 13828, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13830, 13830, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 22024, 22024, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 22027, 22027, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13838, 13840, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13840, 13840, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13842, 13842, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13844, 13844, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13846, 13846, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13848, 13848, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 13850, 13850, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13852, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 26, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13854, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, UTF8PROC_DECOMP_TYPE_FONT, 5664, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, UTF8PROC_DECOMP_TYPE_FONT, 2822, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, UTF8PROC_DECOMP_TYPE_FONT, 2825, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, UTF8PROC_DECOMP_TYPE_FONT, 5665, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, UTF8PROC_DECOMP_TYPE_FONT, 5666, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, UTF8PROC_DECOMP_TYPE_FONT, 5667, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, UTF8PROC_DECOMP_TYPE_FONT, 5668, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, UTF8PROC_DECOMP_TYPE_FONT, 5669, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, UTF8PROC_DECOMP_TYPE_FONT, 5670, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ES, UTF8PROC_DECOMP_TYPE_FONT, 2782, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13863, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13865, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13867, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13869, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13871, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13873, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13875, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13877, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13879, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13881, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13883, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13885, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13887, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13889, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13891, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13893, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13895, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13897, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13899, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13901, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13903, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13905, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13907, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13909, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13911, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13913, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13915, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13917, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13919, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13921, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13923, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, 0, 13925, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_R, UTF8PROC_DECOMP_TYPE_COMPAT, 13927, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5737, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5737, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5738, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5738, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5738, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5738, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5739, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5739, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5739, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5739, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5740, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5740, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5740, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5740, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5741, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5741, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5741, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5741, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5742, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5742, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5742, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5742, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5743, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5743, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5743, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5743, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5744, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5744, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5744, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5744, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5745, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5745, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5745, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5745, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5746, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5746, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5746, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5746, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5747, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5747, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5747, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5747, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5748, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5748, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5748, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5748, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5749, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5749, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5749, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5749, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5750, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5750, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5751, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5751, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5752, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5752, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5753, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5753, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5754, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5754, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5755, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5755, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5756, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5756, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5756, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5756, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5757, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5757, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5757, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5757, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5758, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5758, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5758, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5758, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5759, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5759, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5759, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5759, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5760, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5760, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5761, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5761, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5761, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5761, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5762, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5762, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5763, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5763, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5763, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5763, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5764, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5764, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5764, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5764, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5765, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5765, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5766, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5766, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_AL, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5767, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5767, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5767, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5767, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5768, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5768, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5769, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5769, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5770, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5770, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5771, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5772, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5772, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5773, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5773, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5774, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5774, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5776, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5776, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13969, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 13969, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13971, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 13971, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13973, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 13973, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13975, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 13975, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13977, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 13977, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13979, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 13979, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13981, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 13981, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 13981, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13983, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 13983, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 13983, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5793, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5793, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 5793, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 5793, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13986, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13988, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13990, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13992, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13994, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13996, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 13998, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14000, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14002, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14004, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14006, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14008, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14010, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14012, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14014, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14016, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14018, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14020, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14022, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14024, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14026, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14028, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14030, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14032, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14034, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14036, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14038, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14040, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14042, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14044, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14046, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14048, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14050, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14052, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14054, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14056, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14058, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14060, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14062, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14064, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14066, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14068, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14070, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14072, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14074, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14076, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14078, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14080, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14082, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14084, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14086, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14088, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14090, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14092, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14094, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14096, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14098, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14100, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14102, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14104, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14106, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14108, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14110, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14112, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14114, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14116, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14118, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14120, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14122, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14124, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14126, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14128, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14130, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14132, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14134, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14136, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14138, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14140, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14142, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14144, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14146, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14148, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14150, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14152, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14154, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14156, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14158, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14160, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14162, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14164, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14166, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14168, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14170, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 22364, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 22367, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 22370, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 22373, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 22376, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 22379, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14190, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14192, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 13990, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14194, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 13992, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14196, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14198, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14000, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14200, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14002, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14004, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14202, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14204, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14012, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14206, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14014, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14016, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14208, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14210, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14020, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14212, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14022, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14024, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14082, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14084, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14090, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14092, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14094, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14102, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14104, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14106, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14108, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14116, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14118, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14120, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14214, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14128, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14216, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14218, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14140, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14220, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14142, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14144, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14170, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14222, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14224, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14160, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14226, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14162, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14164, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 13986, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 13988, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14228, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 13990, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14230, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 13994, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 13996, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 13998, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14000, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14232, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14006, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14008, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14010, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14012, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14234, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14020, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14026, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14028, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14030, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14032, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14034, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14038, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14040, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14042, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14044, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14046, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14048, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14236, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14050, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14052, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14054, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14056, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14058, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14060, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14064, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14066, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14068, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14070, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14072, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14074, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14076, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14078, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14080, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14086, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14088, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14096, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14098, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14100, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14102, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14104, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14110, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14112, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14114, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14116, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14238, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14122, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14124, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14126, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14128, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14134, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14136, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14138, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14140, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14240, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14146, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14148, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14242, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14154, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14156, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14158, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14160, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14244, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 13990, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14230, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14000, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14232, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14012, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14234, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14020, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14246, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14046, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14248, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14250, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14252, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14102, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14104, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14116, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14140, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14240, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14160, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14244, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 22446, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 22449, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 22452, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14263, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14265, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14267, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14269, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14271, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14273, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14275, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14277, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14279, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14281, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14283, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14285, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14287, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14289, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14291, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14293, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14295, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14297, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14299, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14301, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14303, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14305, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14307, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14250, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14309, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14311, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14313, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14315, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14263, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14265, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14267, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14269, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14271, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14273, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14275, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14277, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14279, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14281, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14283, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14285, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14287, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14289, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14291, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14293, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14295, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14297, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14299, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14301, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14303, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14305, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14307, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14250, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14309, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14311, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14313, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14315, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14303, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14305, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14307, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14250, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14248, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14252, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 14062, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14040, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14042, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14044, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14303, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14305, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14307, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14062, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14064, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14317, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14317, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22511, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22514, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22514, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22517, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22520, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22523, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22526, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22529, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22532, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22532, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22535, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22538, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22541, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22544, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22547, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22550, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22550, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22553, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22556, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22556, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22559, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22559, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22562, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22565, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22565, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22568, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22571, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22571, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22574, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22574, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22577, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22580, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22580, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22583, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22583, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22586, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22589, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22592, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22595, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22595, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22598, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22601, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22604, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22607, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22610, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22610, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22613, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22616, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22619, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22622, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22625, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22628, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22628, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22631, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22631, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22634, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22634, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22637, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22640, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22643, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22646, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22649, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22652, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22655, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22658, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22661, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22664, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22667, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22670, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22673, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22673, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22676, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22679, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22682, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22685, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22685, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22688, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22691, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22694, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22697, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22700, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22703, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22706, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22709, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22712, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22715, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22718, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22721, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22724, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22727, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22730, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22733, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22736, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22739, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22742, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22745, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22748, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22751, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22613, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22619, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22754, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22757, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22760, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22763, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22766, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22769, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22766, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22760, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22772, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22778, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22781, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22784, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22769, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22592, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 22562, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22787, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 22790, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 22793, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 22796, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 30991, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 30995, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 30999, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 31003, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 31007, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 31011, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 31015, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 22827, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 63790, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 63809, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SC, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 31050, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6478, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6479, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6480, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6481, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 814, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6482, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6483, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6484, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6485, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6486, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6487, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PD, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6488, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PD, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6489, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PC, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6490, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 2785, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 2786, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6491, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6492, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6493, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6494, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6495, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6496, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6497, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6498, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 3046, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 3047, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6499, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6500, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6501, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6502, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6503, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_VERTICAL, 6504, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 6505, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PC, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_COMPAT, 6490, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_CS, UTF8PROC_DECOMP_TYPE_SMALL, 6478, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6479, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_CS, UTF8PROC_DECOMP_TYPE_SMALL, 2745, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 814, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_CS, UTF8PROC_DECOMP_TYPE_SMALL, 6481, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6483, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6482, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PD, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6488, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 2785, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 2786, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6491, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6492, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6493, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6494, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ET, UTF8PROC_DECOMP_TYPE_SMALL, 6506, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6507, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6508, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ES, UTF8PROC_DECOMP_TYPE_SMALL, 2782, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PD, 0, UTF8PROC_BIDI_CLASS_ES, UTF8PROC_DECOMP_TYPE_SMALL, 6509, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6510, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6511, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 2784, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6512, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SC, 0, UTF8PROC_BIDI_CLASS_ET, UTF8PROC_DECOMP_TYPE_SMALL, 6513, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ET, UTF8PROC_DECOMP_TYPE_SMALL, 6514, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SMALL, 6515, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14708, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14710, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14712, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14714, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14716, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14718, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14720, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14722, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14724, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14726, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14728, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14730, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14732, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 14734, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6544, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6545, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6545, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6546, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6546, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6547, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6547, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6548, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6548, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6549, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6549, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6549, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6549, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6550, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6550, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6551, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6551, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6551, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6551, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6552, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6552, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6553, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6553, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6553, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6553, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6554, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6554, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6554, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6554, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6555, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6555, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6555, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6555, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6556, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6556, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6556, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6556, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6557, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6557, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6557, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6557, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6558, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6558, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6559, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6559, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6560, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6560, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6561, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6561, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6562, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6562, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6562, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6562, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6563, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6563, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6563, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6563, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6564, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6564, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6564, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6564, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6565, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6565, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6565, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6565, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6566, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6566, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6566, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6566, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6567, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6567, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6567, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6567, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6568, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6568, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6568, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6568, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6569, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6569, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6569, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6569, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6570, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6570, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6570, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6570, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6571, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6571, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6571, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6571, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6572, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6572, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6572, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6572, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6573, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6573, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6573, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6573, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6574, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6574, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6574, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6574, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6575, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6575, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6575, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6575, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6576, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6576, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6576, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6576, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6577, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6577, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 5776, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 5776, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 6578, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 6578, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_INITIAL, 6578, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_MEDIAL, 6578, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14771, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14771, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14773, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14773, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_ISOLATED, 14777, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FINAL, 14777, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6482, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6587, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ET, UTF8PROC_DECOMP_TYPE_WIDE, 6506, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SC, 0, UTF8PROC_BIDI_CLASS_ET, UTF8PROC_DECOMP_TYPE_WIDE, 6513, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ET, UTF8PROC_DECOMP_TYPE_WIDE, 6514, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6507, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6588, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 2785, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 2786, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6508, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ES, UTF8PROC_DECOMP_TYPE_WIDE, 2782, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_CS, UTF8PROC_DECOMP_TYPE_WIDE, 6478, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PD, 0, UTF8PROC_BIDI_CLASS_ES, UTF8PROC_DECOMP_TYPE_WIDE, 6509, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_CS, UTF8PROC_DECOMP_TYPE_WIDE, 2745, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_CS, UTF8PROC_DECOMP_TYPE_WIDE, 6589, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_WIDE, 2775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_WIDE, 38, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_WIDE, 31, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_WIDE, 32, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_WIDE, 2776, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_WIDE, 2777, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_WIDE, 2778, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_WIDE, 2779, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_WIDE, 2780, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_WIDE, 2781, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_CS, UTF8PROC_DECOMP_TYPE_WIDE, 6481, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 814, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6510, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 2784, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6511, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6483, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6515, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1446, 6590, UINT16_MAX, 6590, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1448, 6591, UINT16_MAX, 6591, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 2795, 6592, UINT16_MAX, 6592, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1449, 6593, UINT16_MAX, 6593, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1450, 6594, UINT16_MAX, 6594, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 2820, 6595, UINT16_MAX, 6595, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1452, 6596, UINT16_MAX, 6596, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1453, 6597, UINT16_MAX, 6597, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1454, 6598, UINT16_MAX, 6598, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1455, 6599, UINT16_MAX, 6599, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1456, 6600, UINT16_MAX, 6600, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1457, 6601, UINT16_MAX, 6601, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1458, 6602, UINT16_MAX, 6602, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1459, 6603, UINT16_MAX, 6603, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1460, 6604, UINT16_MAX, 6604, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1462, 6605, UINT16_MAX, 6605, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 2809, 6606, UINT16_MAX, 6606, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1463, 6607, UINT16_MAX, 6607, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 3288, 6608, UINT16_MAX, 6608, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1464, 6609, UINT16_MAX, 6609, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1465, 6610, UINT16_MAX, 6610, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 2891, 6611, UINT16_MAX, 6611, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1466, 6612, UINT16_MAX, 6612, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 2908, 6613, UINT16_MAX, 6613, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 3295, 6614, UINT16_MAX, 6614, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 2817, 6615, UINT16_MAX, 6615, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6503, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6512, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6504, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6616, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PC, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6490, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 2704, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 0, UINT16_MAX, 8992, UINT16_MAX, 8992, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 1, UINT16_MAX, 8993, UINT16_MAX, 8993, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 2, UINT16_MAX, 8994, UINT16_MAX, 8994, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 3, UINT16_MAX, 8995, UINT16_MAX, 8995, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 4, UINT16_MAX, 8996, UINT16_MAX, 8996, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 5, UINT16_MAX, 8997, UINT16_MAX, 8997, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 6, UINT16_MAX, 8998, UINT16_MAX, 8998, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 7, UINT16_MAX, 8999, UINT16_MAX, 8999, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 8, UINT16_MAX, 9000, UINT16_MAX, 9000, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 9, UINT16_MAX, 9001, UINT16_MAX, 9001, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 10, UINT16_MAX, 9002, UINT16_MAX, 9002, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 11, UINT16_MAX, 9003, UINT16_MAX, 9003, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 12, UINT16_MAX, 9004, UINT16_MAX, 9004, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 13, UINT16_MAX, 9005, UINT16_MAX, 9005, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 14, UINT16_MAX, 9006, UINT16_MAX, 9006, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 15, UINT16_MAX, 9007, UINT16_MAX, 9007, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 16, UINT16_MAX, 9008, UINT16_MAX, 9008, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 17, UINT16_MAX, 9009, UINT16_MAX, 9009, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 18, UINT16_MAX, 9010, UINT16_MAX, 9010, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 19, UINT16_MAX, 9011, UINT16_MAX, 9011, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 20, UINT16_MAX, 9012, UINT16_MAX, 9012, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 21, UINT16_MAX, 9013, UINT16_MAX, 9013, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 22, UINT16_MAX, 9014, UINT16_MAX, 9014, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 23, UINT16_MAX, 9015, UINT16_MAX, 9015, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 24, UINT16_MAX, 9016, UINT16_MAX, 9016, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_WIDE, 25, UINT16_MAX, 9017, UINT16_MAX, 9017, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6491, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6617, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6492, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6618, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6619, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6620, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_NARROW, 6480, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PS, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_NARROW, 6499, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PE, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_NARROW, 6500, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_NARROW, 6479, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_PO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_NARROW, 6621, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4314, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6622, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6623, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6624, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6625, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6626, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6627, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6628, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6629, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6630, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6631, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4268, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4269, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4270, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4271, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4272, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4273, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4274, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4275, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4276, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4277, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4278, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4279, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4280, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4281, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4282, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4283, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4284, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4285, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4286, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4287, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4288, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4289, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4290, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4291, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4292, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4293, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4294, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4295, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4296, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4297, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4298, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4299, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4300, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4301, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4302, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4303, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4304, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4305, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4306, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4307, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4308, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4309, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4310, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 4311, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6632, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6633, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6634, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6635, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, true, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6636, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6637, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6638, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6639, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6640, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6641, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6642, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6643, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6644, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6645, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6646, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6647, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6648, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6649, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6650, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6651, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6652, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6653, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6654, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6655, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6656, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6657, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6658, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6659, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6660, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6661, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6662, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6663, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6664, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6665, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6666, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6667, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6668, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6669, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6670, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6671, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6672, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6673, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6674, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6675, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6676, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6677, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6678, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6679, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6680, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6681, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6682, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6683, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6684, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6685, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_NARROW, 6686, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SC, 0, UTF8PROC_BIDI_CLASS_ET, UTF8PROC_DECOMP_TYPE_WIDE, 6687, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SC, 0, UTF8PROC_BIDI_CLASS_ET, UTF8PROC_DECOMP_TYPE_WIDE, 6688, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6689, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6690, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_WIDE, 6691, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SC, 0, UTF8PROC_BIDI_CLASS_ET, UTF8PROC_DECOMP_TYPE_WIDE, 6692, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SC, 0, UTF8PROC_BIDI_CLASS_ET, UTF8PROC_DECOMP_TYPE_WIDE, 6693, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_NARROW, 6694, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_NARROW, 6695, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_NARROW, 6696, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_NARROW, 6697, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_NARROW, 6698, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_NARROW, 6699, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_NARROW, 6700, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 0, 0, UTF8PROC_BOUNDCLASS_CONTROL}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NL, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6701, UINT16_MAX, 6701, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6703, UINT16_MAX, 6703, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6705, UINT16_MAX, 6705, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6707, UINT16_MAX, 6707, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6709, UINT16_MAX, 6709, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6711, UINT16_MAX, 6711, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6713, UINT16_MAX, 6713, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6715, UINT16_MAX, 6715, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6717, UINT16_MAX, 6717, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6719, UINT16_MAX, 6719, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6721, UINT16_MAX, 6721, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6723, UINT16_MAX, 6723, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6725, UINT16_MAX, 6725, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6727, UINT16_MAX, 6727, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6729, UINT16_MAX, 6729, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6731, UINT16_MAX, 6731, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6733, UINT16_MAX, 6733, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6735, UINT16_MAX, 6735, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6737, UINT16_MAX, 6737, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6739, UINT16_MAX, 6739, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6741, UINT16_MAX, 6741, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6743, UINT16_MAX, 6743, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6745, UINT16_MAX, 6745, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6747, UINT16_MAX, 6747, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6749, UINT16_MAX, 6749, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6751, UINT16_MAX, 6751, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6753, UINT16_MAX, 6753, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6755, UINT16_MAX, 6755, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6757, UINT16_MAX, 6757, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6759, UINT16_MAX, 6759, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6761, UINT16_MAX, 6761, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6763, UINT16_MAX, 6763, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6765, UINT16_MAX, 6765, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6767, UINT16_MAX, 6767, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6769, UINT16_MAX, 6769, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6771, UINT16_MAX, 6771, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6773, UINT16_MAX, 6773, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6775, UINT16_MAX, 6775, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6777, UINT16_MAX, 6777, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6779, UINT16_MAX, 6779, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9018, UINT16_MAX, 9018, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9020, UINT16_MAX, 9020, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9022, UINT16_MAX, 9022, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9024, UINT16_MAX, 9024, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9026, UINT16_MAX, 9026, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9028, UINT16_MAX, 9028, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9030, UINT16_MAX, 9030, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9032, UINT16_MAX, 9032, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9034, UINT16_MAX, 9034, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9036, UINT16_MAX, 9036, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9038, UINT16_MAX, 9038, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9040, UINT16_MAX, 9040, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9042, UINT16_MAX, 9042, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9044, UINT16_MAX, 9044, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9046, UINT16_MAX, 9046, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9048, UINT16_MAX, 9048, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9050, UINT16_MAX, 9050, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9052, UINT16_MAX, 9052, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9054, UINT16_MAX, 9054, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9056, UINT16_MAX, 9056, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9058, UINT16_MAX, 9058, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9060, UINT16_MAX, 9060, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9062, UINT16_MAX, 9062, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9064, UINT16_MAX, 9064, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9066, UINT16_MAX, 9066, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9068, UINT16_MAX, 9068, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9070, UINT16_MAX, 9070, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9072, UINT16_MAX, 9072, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9074, UINT16_MAX, 9074, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9076, UINT16_MAX, 9076, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9078, UINT16_MAX, 9078, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9080, UINT16_MAX, 9080, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9082, UINT16_MAX, 9082, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9084, UINT16_MAX, 9084, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9086, UINT16_MAX, 9086, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9088, UINT16_MAX, 9088, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9090, UINT16_MAX, 9090, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9092, UINT16_MAX, 9092, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9094, UINT16_MAX, 9094, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9096, UINT16_MAX, 9096, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6781, UINT16_MAX, 6781, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6783, UINT16_MAX, 6783, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6785, UINT16_MAX, 6785, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6787, UINT16_MAX, 6787, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6789, UINT16_MAX, 6789, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6791, UINT16_MAX, 6791, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6793, UINT16_MAX, 6793, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6795, UINT16_MAX, 6795, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6797, UINT16_MAX, 6797, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6799, UINT16_MAX, 6799, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6801, UINT16_MAX, 6801, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6803, UINT16_MAX, 6803, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6805, UINT16_MAX, 6805, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6807, UINT16_MAX, 6807, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6809, UINT16_MAX, 6809, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6811, UINT16_MAX, 6811, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6813, UINT16_MAX, 6813, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6815, UINT16_MAX, 6815, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6817, UINT16_MAX, 6817, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6819, UINT16_MAX, 6819, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6821, UINT16_MAX, 6821, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6823, UINT16_MAX, 6823, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6825, UINT16_MAX, 6825, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6827, UINT16_MAX, 6827, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6829, UINT16_MAX, 6829, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6831, UINT16_MAX, 6831, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6833, UINT16_MAX, 6833, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6835, UINT16_MAX, 6835, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6837, UINT16_MAX, 6837, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6839, UINT16_MAX, 6839, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6841, UINT16_MAX, 6841, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6843, UINT16_MAX, 6843, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6845, UINT16_MAX, 6845, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6847, UINT16_MAX, 6847, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6849, UINT16_MAX, 6849, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 6851, UINT16_MAX, 6851, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9098, UINT16_MAX, 9098, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9100, UINT16_MAX, 9100, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9102, UINT16_MAX, 9102, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9104, UINT16_MAX, 9104, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9106, UINT16_MAX, 9106, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9108, UINT16_MAX, 9108, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9110, UINT16_MAX, 9110, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9112, UINT16_MAX, 9112, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9114, UINT16_MAX, 9114, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9116, UINT16_MAX, 9116, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9118, UINT16_MAX, 9118, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9120, UINT16_MAX, 9120, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9122, UINT16_MAX, 9122, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9124, UINT16_MAX, 9124, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9126, UINT16_MAX, 9126, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9128, UINT16_MAX, 9128, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9130, UINT16_MAX, 9130, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9132, UINT16_MAX, 9132, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9134, UINT16_MAX, 9134, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9136, UINT16_MAX, 9136, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9138, UINT16_MAX, 9138, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9140, UINT16_MAX, 9140, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9142, UINT16_MAX, 9142, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9144, UINT16_MAX, 9144, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9146, UINT16_MAX, 9146, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9148, UINT16_MAX, 9148, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9150, UINT16_MAX, 9150, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9152, UINT16_MAX, 9152, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9154, UINT16_MAX, 9154, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9156, UINT16_MAX, 9156, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9158, UINT16_MAX, 9158, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9160, UINT16_MAX, 9160, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9162, UINT16_MAX, 9162, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9164, UINT16_MAX, 9164, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9166, UINT16_MAX, 9166, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9168, UINT16_MAX, 9168, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6853, UINT16_MAX, 6853, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6855, UINT16_MAX, 6855, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6857, UINT16_MAX, 6857, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6859, UINT16_MAX, 6859, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6861, UINT16_MAX, 6861, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6863, UINT16_MAX, 6863, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6865, UINT16_MAX, 6865, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6867, UINT16_MAX, 6867, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6869, UINT16_MAX, 6869, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6871, UINT16_MAX, 6871, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6873, UINT16_MAX, 6873, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6875, UINT16_MAX, 6875, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6877, UINT16_MAX, 6877, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6879, UINT16_MAX, 6879, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6881, UINT16_MAX, 6881, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6883, UINT16_MAX, 6883, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6885, UINT16_MAX, 6885, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6887, UINT16_MAX, 6887, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6889, UINT16_MAX, 6889, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6891, UINT16_MAX, 6891, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6893, UINT16_MAX, 6893, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6895, UINT16_MAX, 6895, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6897, UINT16_MAX, 6897, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6899, UINT16_MAX, 6899, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6901, UINT16_MAX, 6901, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6903, UINT16_MAX, 6903, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6905, UINT16_MAX, 6905, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6907, UINT16_MAX, 6907, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6909, UINT16_MAX, 6909, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6911, UINT16_MAX, 6911, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6913, UINT16_MAX, 6913, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6915, UINT16_MAX, 6915, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6917, UINT16_MAX, 6917, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6919, UINT16_MAX, 6919, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6921, UINT16_MAX, 6921, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6923, UINT16_MAX, 6923, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6925, UINT16_MAX, 6925, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6927, UINT16_MAX, 6927, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6929, UINT16_MAX, 6929, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6931, UINT16_MAX, 6931, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6933, UINT16_MAX, 6933, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6935, UINT16_MAX, 6935, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6937, UINT16_MAX, 6937, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6939, UINT16_MAX, 6939, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6941, UINT16_MAX, 6941, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6943, UINT16_MAX, 6943, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6945, UINT16_MAX, 6945, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6947, UINT16_MAX, 6947, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6949, UINT16_MAX, 6949, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6951, UINT16_MAX, 6951, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 6953, UINT16_MAX, 6953, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9170, UINT16_MAX, 9170, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9172, UINT16_MAX, 9172, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9174, UINT16_MAX, 9174, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9176, UINT16_MAX, 9176, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9178, UINT16_MAX, 9178, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9180, UINT16_MAX, 9180, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9182, UINT16_MAX, 9182, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9184, UINT16_MAX, 9184, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9186, UINT16_MAX, 9186, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9188, UINT16_MAX, 9188, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9190, UINT16_MAX, 9190, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9192, UINT16_MAX, 9192, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9194, UINT16_MAX, 9194, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9196, UINT16_MAX, 9196, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9198, UINT16_MAX, 9198, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9200, UINT16_MAX, 9200, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9202, UINT16_MAX, 9202, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9204, UINT16_MAX, 9204, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9206, UINT16_MAX, 9206, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9208, UINT16_MAX, 9208, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9210, UINT16_MAX, 9210, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9212, UINT16_MAX, 9212, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9214, UINT16_MAX, 9214, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9216, UINT16_MAX, 9216, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9218, UINT16_MAX, 9218, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9220, UINT16_MAX, 9220, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9222, UINT16_MAX, 9222, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9224, UINT16_MAX, 9224, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9226, UINT16_MAX, 9226, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9228, UINT16_MAX, 9228, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9230, UINT16_MAX, 9230, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9232, UINT16_MAX, 9232, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9234, UINT16_MAX, 9234, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9236, UINT16_MAX, 9236, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9238, UINT16_MAX, 9238, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9240, UINT16_MAX, 9240, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9242, UINT16_MAX, 9242, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9244, UINT16_MAX, 9244, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9246, UINT16_MAX, 9246, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9248, UINT16_MAX, 9248, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9250, UINT16_MAX, 9250, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9252, UINT16_MAX, 9252, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9254, UINT16_MAX, 9254, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9256, UINT16_MAX, 9256, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9258, UINT16_MAX, 9258, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9260, UINT16_MAX, 9260, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9262, UINT16_MAX, 9262, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9264, UINT16_MAX, 9264, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9266, UINT16_MAX, 9266, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9268, UINT16_MAX, 9268, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9270, UINT16_MAX, 9270, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_AN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_AN, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5328, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15147, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5332, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15151, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5336, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15155, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MN, 7, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49206, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_CF, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, true, 0, 0, UTF8PROC_BOUNDCLASS_PREPEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49208, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 15159, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, 15163, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5340, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5344, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49210, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5348, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 15167, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 15171, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49212, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49216, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5354, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MN, 0, UTF8PROC_BIDI_CLASS_NSM, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49214, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 15175, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 15179, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49218, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 15183, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49220, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5362, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5366, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 15187, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, 15191, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7003, UINT16_MAX, 7003, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7005, UINT16_MAX, 7005, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7007, UINT16_MAX, 7007, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7009, UINT16_MAX, 7009, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7011, UINT16_MAX, 7011, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7013, UINT16_MAX, 7013, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7015, UINT16_MAX, 7015, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7017, UINT16_MAX, 7017, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7019, UINT16_MAX, 7019, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7021, UINT16_MAX, 7021, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7023, UINT16_MAX, 7023, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7025, UINT16_MAX, 7025, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7027, UINT16_MAX, 7027, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7029, UINT16_MAX, 7029, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7031, UINT16_MAX, 7031, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7033, UINT16_MAX, 7033, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7035, UINT16_MAX, 7035, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7037, UINT16_MAX, 7037, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7039, UINT16_MAX, 7039, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7041, UINT16_MAX, 7041, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7043, UINT16_MAX, 7043, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7045, UINT16_MAX, 7045, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7047, UINT16_MAX, 7047, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7049, UINT16_MAX, 7049, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7051, UINT16_MAX, 7051, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7053, UINT16_MAX, 7053, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7055, UINT16_MAX, 7055, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7057, UINT16_MAX, 7057, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7059, UINT16_MAX, 7059, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7061, UINT16_MAX, 7061, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7063, UINT16_MAX, 7063, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, 7065, UINT16_MAX, 7065, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9272, UINT16_MAX, 9272, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9274, UINT16_MAX, 9274, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9276, UINT16_MAX, 9276, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9278, UINT16_MAX, 9278, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9280, UINT16_MAX, 9280, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9282, UINT16_MAX, 9282, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9284, UINT16_MAX, 9284, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9286, UINT16_MAX, 9286, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9288, UINT16_MAX, 9288, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9290, UINT16_MAX, 9290, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9292, UINT16_MAX, 9292, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9294, UINT16_MAX, 9294, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9296, UINT16_MAX, 9296, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9298, UINT16_MAX, 9298, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9300, UINT16_MAX, 9300, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9302, UINT16_MAX, 9302, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9304, UINT16_MAX, 9304, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9306, UINT16_MAX, 9306, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9308, UINT16_MAX, 9308, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9310, UINT16_MAX, 9310, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9312, UINT16_MAX, 9312, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9314, UINT16_MAX, 9314, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9316, UINT16_MAX, 9316, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9318, UINT16_MAX, 9318, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9320, UINT16_MAX, 9320, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9322, UINT16_MAX, 9322, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9324, UINT16_MAX, 9324, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9326, UINT16_MAX, 9326, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9328, UINT16_MAX, 9328, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9330, UINT16_MAX, 9330, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9332, UINT16_MAX, 9332, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, 9334, UINT16_MAX, 9334, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MC, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MN, 9, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5370, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5374, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15259, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15263, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5378, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15267, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15271, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15275, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15279, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15283, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_MC, 216, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49222, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 216, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 226, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_SPACINGMARK}, + {UTF8PROC_CATEGORY_MC, 216, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49224, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 216, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49226, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 216, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49228, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 216, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49230, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_MC, 216, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 49232, false, false, false, false, 0, 0, UTF8PROC_BOUNDCLASS_EXTEND}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5390, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5394, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15287, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5398, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15291, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, 5404, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15295, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15299, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15303, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, 15307, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, true, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1446, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1449, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1452, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1455, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1456, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1460, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 3288, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1464, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1465, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2891, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1466, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2908, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 3295, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 3, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 5, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 10, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 12, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 13, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 15, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 16, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 17, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 18, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 19, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 20, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 21, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 22, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 23, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 24, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 25, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1446, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1448, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2795, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1450, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2820, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1452, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1453, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1454, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1455, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1456, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1457, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1458, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1459, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1460, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1462, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2809, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 3288, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1464, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1465, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2891, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1466, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2908, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 3295, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2817, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 1, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 4, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 5, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 6, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 8, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 9, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 10, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 11, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 12, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 13, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 14, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 15, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 16, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 17, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 18, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 19, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 20, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 21, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 22, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 23, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 24, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 25, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7119, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7120, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7121, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7122, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7123, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7124, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7125, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7126, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 915, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7127, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7128, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7129, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7130, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7131, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7132, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7133, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2830, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7134, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7135, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 917, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7136, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 897, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7137, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7138, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7139, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2818, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7140, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 845, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 846, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 847, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 848, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 849, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 850, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 851, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 852, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 807, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 853, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 854, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 35, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 855, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 856, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 857, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 858, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 859, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 914, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 860, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 861, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 862, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 863, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 864, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 865, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 866, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FONT, 7141, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7142, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7143, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7144, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7145, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7146, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7147, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7121, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7122, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2829, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7123, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7124, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7125, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7126, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 915, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7127, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7128, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7129, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7130, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7131, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7132, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7133, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7134, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7135, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 917, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7136, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 897, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7137, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7138, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7139, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 2818, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7140, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 845, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 846, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 848, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 849, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 850, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 851, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 852, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 807, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 853, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 854, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 35, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 855, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 856, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 857, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 859, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 914, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 860, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 861, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 862, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 863, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 864, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 865, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 866, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SM, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_FONT, 7141, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, true, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7142, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7144, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7145, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7146, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7147, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7143, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 7148, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_FONT, 904, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 38, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 31, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 32, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2776, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2777, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2778, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2779, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2780, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2781, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 38, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 31, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 32, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2776, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2777, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2778, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2779, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2780, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_ND, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_FONT, 2781, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7149, UINT16_MAX, 7149, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7151, UINT16_MAX, 7151, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7153, UINT16_MAX, 7153, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7155, UINT16_MAX, 7155, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7157, UINT16_MAX, 7157, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7159, UINT16_MAX, 7159, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7161, UINT16_MAX, 7161, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7163, UINT16_MAX, 7163, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7165, UINT16_MAX, 7165, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7167, UINT16_MAX, 7167, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7169, UINT16_MAX, 7169, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7171, UINT16_MAX, 7171, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7173, UINT16_MAX, 7173, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7175, UINT16_MAX, 7175, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7177, UINT16_MAX, 7177, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7179, UINT16_MAX, 7179, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7181, UINT16_MAX, 7181, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7183, UINT16_MAX, 7183, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7185, UINT16_MAX, 7185, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7187, UINT16_MAX, 7187, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7189, UINT16_MAX, 7189, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7191, UINT16_MAX, 7191, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7193, UINT16_MAX, 7193, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7195, UINT16_MAX, 7195, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7197, UINT16_MAX, 7197, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7199, UINT16_MAX, 7199, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7201, UINT16_MAX, 7201, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7203, UINT16_MAX, 7203, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7205, UINT16_MAX, 7205, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7207, UINT16_MAX, 7207, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7209, UINT16_MAX, 7209, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7211, UINT16_MAX, 7211, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7213, UINT16_MAX, 7213, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LU, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, 7215, UINT16_MAX, 7215, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9336, UINT16_MAX, 9336, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9338, UINT16_MAX, 9338, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9340, UINT16_MAX, 9340, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9342, UINT16_MAX, 9342, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9344, UINT16_MAX, 9344, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9346, UINT16_MAX, 9346, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9348, UINT16_MAX, 9348, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9350, UINT16_MAX, 9350, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9352, UINT16_MAX, 9352, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9354, UINT16_MAX, 9354, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9356, UINT16_MAX, 9356, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9358, UINT16_MAX, 9358, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9360, UINT16_MAX, 9360, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9362, UINT16_MAX, 9362, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9364, UINT16_MAX, 9364, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9366, UINT16_MAX, 9366, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9368, UINT16_MAX, 9368, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9370, UINT16_MAX, 9370, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9372, UINT16_MAX, 9372, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9374, UINT16_MAX, 9374, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9376, UINT16_MAX, 9376, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9378, UINT16_MAX, 9378, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9380, UINT16_MAX, 9380, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9382, UINT16_MAX, 9382, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9384, UINT16_MAX, 9384, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9386, UINT16_MAX, 9386, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9388, UINT16_MAX, 9388, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9390, UINT16_MAX, 9390, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9392, UINT16_MAX, 9392, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9394, UINT16_MAX, 9394, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9396, UINT16_MAX, 9396, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9398, UINT16_MAX, 9398, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9400, UINT16_MAX, 9400, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LL, 0, UTF8PROC_BIDI_CLASS_R, 0, UINT16_MAX, UINT16_MAX, 9402, UINT16_MAX, 9402, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6550, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6551, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6555, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6558, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6577, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6561, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6556, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6566, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6578, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6572, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6573, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6574, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6575, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6562, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6568, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6570, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6564, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6571, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6560, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6563, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6553, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6554, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6557, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6559, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6565, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6567, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6569, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 7217, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 5760, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 7218, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 7219, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6576, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 1, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6576, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6551, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6555, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6558, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6577, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6561, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6556, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6566, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6578, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6573, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6574, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6575, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6562, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6568, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6570, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6564, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6571, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6560, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6563, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6553, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6554, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6557, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6559, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6565, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6567, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_AL, UTF8PROC_DECOMP_TYPE_FONT, 6569, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 15412, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 15414, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 15416, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 15418, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 15420, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 15422, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 15424, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 15426, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 15428, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 15430, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_NO, 0, UTF8PROC_BIDI_CLASS_EN, UTF8PROC_DECOMP_TYPE_COMPAT, 15432, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23626, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23629, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23632, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23635, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23638, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23641, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23644, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23647, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23650, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23653, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23656, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23659, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23662, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23665, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23668, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23671, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23674, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23677, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23680, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23683, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23686, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23689, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23692, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23695, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23698, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23701, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23704, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 2795, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 1463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 15515, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 15517, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1446, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1448, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 2795, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1449, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1450, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 2820, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1452, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1453, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1454, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1455, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1456, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1457, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1458, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1459, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1460, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1462, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 2809, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 3288, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1464, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1465, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 2891, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 1466, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 2908, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 3295, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 2817, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 15519, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 15521, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 15523, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 23717, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 15528, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SUPER, 15530, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, UTF8PROC_DECOMP_TYPE_SUPER, 15532, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 15534, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_REGIONAL_INDICATOR}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 15536, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 15538, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 4278, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 3489, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7348, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7349, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7350, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 3432, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7351, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7352, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 3869, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7353, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7354, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7355, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 5399, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7356, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7357, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7358, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7359, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7360, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7361, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 3525, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7362, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7363, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7364, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7365, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7366, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7367, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 3426, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 3861, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7368, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 4191, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 3864, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 4192, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7369, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 3581, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7370, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7371, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7372, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7373, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7374, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 4174, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 3499, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7375, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7376, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7377, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_SQUARE, 7378, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23763, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23766, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23769, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23772, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23778, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23781, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23784, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_COMPAT, 23787, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 7406, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_L, UTF8PROC_DECOMP_TYPE_CIRCLE, 7407, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_SK, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_E_MODIFIER}, + {UTF8PROC_CATEGORY_SO, 0, UTF8PROC_BIDI_CLASS_ON, 0, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_E_BASE_GAZ}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7408, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7409, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7410, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7411, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7413, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7414, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7415, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7416, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7417, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7418, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7419, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7420, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7422, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7423, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7424, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7425, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7427, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7428, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7358, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7429, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7431, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7432, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7433, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7434, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7435, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3442, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7437, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7438, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7439, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7440, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7376, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7441, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7442, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7443, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7444, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7445, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7446, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7447, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7448, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7449, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7450, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7452, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7453, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7454, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7455, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7457, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7458, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7459, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7460, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7461, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7462, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7463, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7464, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7465, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7466, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7467, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7468, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7469, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7470, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7471, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7472, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7473, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7474, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7475, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7476, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7477, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7478, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7479, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7480, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7481, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7482, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7483, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7484, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7485, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7487, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7488, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7489, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7351, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7490, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7491, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7492, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7494, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7496, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7497, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7498, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7499, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7500, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7501, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7502, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7503, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7504, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7505, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7507, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7508, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7509, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7510, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7512, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7513, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7514, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3468, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7515, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7516, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7517, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7518, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7519, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7521, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7522, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7524, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7525, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7526, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7527, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7528, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7529, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7530, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7531, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7532, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7533, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7534, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7535, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7537, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7538, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7539, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7540, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7541, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3480, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7543, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7545, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7546, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7547, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7548, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7550, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7552, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7553, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7554, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7555, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7556, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7557, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7558, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7559, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7560, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7561, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7562, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7564, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7565, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7566, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7567, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7568, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7569, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7570, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7571, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7572, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7573, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7574, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7575, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7576, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7577, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7578, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7580, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7581, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7582, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7583, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7584, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7585, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7587, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7588, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7589, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7590, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7591, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7592, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7593, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7594, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7595, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7596, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7597, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7599, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7600, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7601, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7602, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7603, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7604, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7605, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7606, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7607, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7608, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7609, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7610, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7611, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7612, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7613, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7614, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7616, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7617, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7618, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7619, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7620, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7622, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7623, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7624, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7625, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7626, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7627, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7628, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7629, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7631, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7632, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7633, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7634, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7636, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7637, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7638, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7639, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7640, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7641, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7643, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7645, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7647, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7648, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7650, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7651, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7652, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7653, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7654, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7655, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7656, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7657, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7658, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7660, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7661, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7662, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7663, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7664, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7665, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7667, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7668, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7669, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7671, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7673, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7674, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7675, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7676, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7677, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7678, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7679, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7680, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7681, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7683, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7684, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7686, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7687, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7689, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7690, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7691, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7693, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7694, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7695, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7697, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7699, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7700, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7701, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7702, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7703, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7704, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7705, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7706, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7707, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7708, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7709, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7710, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7712, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7713, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7715, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7717, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7718, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7720, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7722, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7724, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7725, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7726, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7728, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7730, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7732, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7734, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7735, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7736, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7737, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7738, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7739, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7741, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7742, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7743, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7745, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7747, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7749, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7750, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7751, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7752, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7753, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7755, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7757, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7758, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7759, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7761, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7762, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7763, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7764, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7766, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7767, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7768, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7769, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7770, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7771, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7773, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7774, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7775, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7776, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7777, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7778, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7779, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7781, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7783, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7784, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7786, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7787, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7789, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7790, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7791, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7793, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7795, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7796, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7798, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7799, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7801, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7802, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7803, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7804, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7805, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7806, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7807, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7809, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7811, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7813, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7815, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7816, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7817, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7818, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7819, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7820, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7821, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7822, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7823, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7824, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7825, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7826, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7828, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7829, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7830, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7831, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7832, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7833, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7834, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7835, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7836, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7837, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7838, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7840, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7842, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7844, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7845, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7846, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7847, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7848, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7850, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7851, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7853, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7854, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7855, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7857, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7859, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7860, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7861, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7862, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7863, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7864, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7865, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7866, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7867, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7868, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7869, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7870, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7871, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7872, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7873, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7874, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3570, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7875, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7877, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7878, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7879, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7880, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7881, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7882, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7884, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7886, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7887, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7888, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3577, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7889, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7891, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7892, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7893, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7894, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7895, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7897, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7899, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7900, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7901, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7902, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7904, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7905, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7907, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7909, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7910, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7911, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7912, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7914, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7915, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7916, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7917, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7918, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7919, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7920, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7921, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7923, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7924, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7925, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7926, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7928, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7929, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7930, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7931, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7932, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7934, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7936, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7937, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7938, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7939, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7941, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7942, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7944, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7945, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7947, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7948, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7949, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7950, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7951, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7952, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7953, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7954, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7956, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7957, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7958, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7959, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7960, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7961, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7963, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7964, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7966, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7968, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3625, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7970, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3629, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7971, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7972, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7973, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7974, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 3634, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, + {UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, 7975, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, false, false, false, false, 2, 0, UTF8PROC_BOUNDCLASS_OTHER}, +}; + +static const utf8proc_uint16_t utf8proc_combinations[] = { + 0, 46, 192, 193, 194, 195, 196, 197, 0, + 256, 258, 260, 550, 461, 0, 0, 512, + 514, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7680, 7840, 0, 0, 0, 0, 0, 7842, +1, 11, + 262, 264, 0, 0, 0, 199, 0, 0, + 0, 266, 268, +0, 46, 200, 201, 202, 7868, 203, + 0, 552, 274, 276, 280, 278, 282, 0, + 0, 516, 518, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7864, 0, 7704, 7706, 0, + 0, 7866, +0, 46, 204, 205, 206, 296, 207, 0, + 0, 298, 300, 302, 304, 463, 0, 0, + 520, 522, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7882, 0, 0, 7724, 0, 0, + 7880, +0, 42, 504, 323, 0, 209, 0, 0, 325, + 0, 0, 0, 7748, 327, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 7750, 7752, 7754, +0, 46, 210, 211, 212, 213, + 214, 0, 0, 332, 334, 490, 558, 465, + 336, 416, 524, 526, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 7884, 0, 0, 0, + 0, 0, 7886, +0, 46, 217, 218, 219, 360, 220, + 366, 0, 362, 364, 370, 0, 467, 368, + 431, 532, 534, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7908, 0, 7798, 7796, 0, + 7794, 7910, +0, 46, 7922, 221, 374, 7928, 376, 0, + 0, 562, 0, 0, 7822, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7924, 0, 0, 0, 0, 0, + 7926, +0, 46, 224, 225, 226, 227, 228, 229, 0, + 257, 259, 261, 551, 462, 0, 0, 513, + 515, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7681, 7841, 0, 0, 0, 0, 0, 7843, +1, 11, + 263, 265, 0, 0, 0, 231, 0, 0, + 0, 267, 269, +0, 46, 232, 233, 234, 7869, 235, + 0, 553, 275, 277, 281, 279, 283, 0, + 0, 517, 519, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7865, 0, 7705, 7707, 0, + 0, 7867, +0, 46, 236, 237, 238, 297, 239, 0, + 0, 299, 301, 303, 0, 464, 0, 0, + 521, 523, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7883, 0, 0, 7725, 0, 0, + 7881, +0, 42, 505, 324, 0, 241, 0, 0, 326, + 0, 0, 0, 7749, 328, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 7751, 7753, 7755, +0, 46, 242, 243, 244, 245, + 246, 0, 0, 333, 335, 491, 559, 466, + 337, 417, 525, 527, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 7885, 0, 0, 0, + 0, 0, 7887, +0, 46, 249, 250, 251, 361, 252, + 367, 0, 363, 365, 371, 0, 468, 369, + 432, 533, 535, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7909, 0, 7799, 7797, 0, + 7795, 7911, +0, 46, 7923, 253, 375, 7929, 255, 7833, + 0, 563, 0, 0, 7823, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7925, 0, 0, 0, 0, 0, + 7927, +6, 42, 7696, 0, 0, 0, 7690, 270, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7692, 7694, 7698, +6, 42, 7697, 0, + 0, 0, 7691, 271, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7693, 7695, 7699, +1, 11, 500, 284, 0, 0, 0, + 290, 7712, 286, 0, 288, 486, +1, 11, 501, 285, + 0, 0, 0, 291, 7713, 287, 0, 289, + 487, +2, 44, 292, 0, 7718, 0, 7720, 0, 0, + 0, 7714, 542, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7716, + 0, 0, 0, 7722, +2, 44, 293, 0, 7719, 0, + 7721, 0, 0, 0, 7715, 543, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7717, 7830, 0, 0, 7723, +2, 2, 308, +2, 11, + 309, 0, 0, 0, 0, 0, 0, 0, + 0, 496, +1, 41, 7728, 0, 0, 0, 0, 310, + 0, 0, 0, 0, 488, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 7730, 7732, +1, 41, 7729, 0, 0, 0, 0, + 311, 0, 0, 0, 0, 489, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7731, 7733, +1, 42, 313, 0, 0, 0, + 0, 315, 0, 0, 0, 0, 317, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7734, 7738, 7740, +1, 42, 314, 0, + 0, 0, 0, 316, 0, 0, 0, 0, + 318, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7735, 7739, 7741, +1, 41, + 340, 0, 0, 0, 0, 342, 0, 0, + 0, 7768, 344, 0, 0, 528, 530, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7770, + 7774, +1, 41, 341, 0, 0, 0, 0, 343, 0, + 0, 0, 7769, 345, 0, 0, 529, 531, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7771, 7775, +1, 40, 346, 348, 0, 0, 0, 350, + 0, 0, 0, 7776, 352, 0, 0, 0, + 0, 536, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 7778, +1, 40, 347, 349, 0, 0, 0, 351, + 0, 0, 0, 7777, 353, 0, 0, 0, + 0, 537, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 7779, +6, 42, 354, 0, 0, 0, 7786, 356, + 0, 0, 0, 0, 538, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 7788, 7790, 7792, +4, 42, 7831, + 0, 355, 0, 0, 0, 7787, 357, 0, + 0, 0, 0, 539, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7789, 7791, 7793, +0, 40, 7808, 7810, + 372, 0, 7812, 0, 0, 0, 0, 0, + 7814, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7816, +0, 40, 7809, + 7811, 373, 0, 7813, 7832, 0, 0, 0, + 0, 7815, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7817, +1, 41, + 377, 7824, 0, 0, 0, 0, 0, 0, + 0, 379, 381, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7826, + 7828, +1, 41, 378, 7825, 0, 0, 0, 0, 0, + 0, 0, 380, 382, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7827, 7829, +0, 11, 475, 471, 0, 0, 0, 0, + 0, 469, 0, 0, 0, 473, +0, 11, 476, 472, + 0, 0, 0, 0, 0, 470, 0, 0, + 0, 474, +7, 7, 478, +7, 7, 479, +7, 7, 480, +7, 7, 481, +1, 7, 508, 0, + 0, 0, 0, 0, 482, +1, 7, 509, 0, 0, + 0, 0, 0, 483, +7, 7, 492, +7, 7, 493, +11, 11, 494, +11, 11, 495, +1, 1, + 506, +1, 1, 507, +1, 1, 510, +1, 1, 511, +7, 7, 554, +7, 7, 555, +1, 7, 7756, 0, + 0, 7758, 0, 0, 556, +1, 7, 7757, 0, 0, + 7759, 0, 0, 557, +7, 7, 560, +7, 7, 561, +0, 49, 8173, 901, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 8129, +0, 50, + 8122, 902, 0, 0, 0, 0, 0, 8121, + 8120, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7944, + 7945, 0, 8124, +0, 48, 8136, 904, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7960, 7961, +0, 50, 8138, 905, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7976, 7977, 0, 8140, +0, 48, 8154, + 906, 0, 0, 938, 0, 0, 8153, 8152, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7992, 7993, +0, 48, + 8184, 908, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 8008, + 8009, +0, 48, 8170, 910, 0, 0, 939, 0, 0, + 8169, 8168, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 8025, +0, 50, 8186, 911, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 8040, 8041, 0, 8188, +0, 49, 8146, 912, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 8151, +0, 50, 8048, + 940, 0, 0, 0, 0, 0, 8113, 8112, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7936, 7937, + 8118, 8115, +0, 48, 8050, 941, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 7952, 7953, +0, 50, 8052, 942, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7968, 7969, 8134, 8131, +0, 49, 8054, 943, + 0, 0, 970, 0, 0, 8145, 8144, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7984, 7985, 8150, +0, 49, + 8162, 944, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 8167, +0, 49, 8058, 973, 0, 0, 971, 0, + 0, 8161, 8160, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 8016, 8017, 8166, +0, 48, 8056, 972, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 8000, 8001, +0, 50, 8060, 974, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 8032, 8033, 8182, 8179, +1, 4, + 979, 0, 0, 980, +0, 8, 1024, 0, 0, 0, + 1025, 0, 0, 0, 1238, +1, 1, 1027, +4, 4, 1031, +1, 1, 1036, +0, 8, + 1037, 0, 0, 0, 1252, 0, 0, 1250, + 1049, +4, 12, 1264, 0, 0, 1262, 1038, 0, 0, + 0, 1266, +0, 8, 1117, 0, 0, 0, 1253, 0, + 0, 1251, 1081, +0, 8, 1104, 0, 0, 0, 1105, + 0, 0, 0, 1239, +1, 1, 1107, +4, 4, 1111, +1, 1, 1116, +4, 12, 1265, + 0, 0, 1263, 1118, 0, 0, 0, 1267, +14, 14, + 1142, +14, 14, 1143, +4, 8, 1244, 0, 0, 0, 1217, +4, 8, 1245, + 0, 0, 0, 1218, +4, 8, 1234, 0, 0, 0, + 1232, +4, 8, 1235, 0, 0, 0, 1233, +4, 4, 1242, +4, 4, 1243, +4, 4, + 1246, +4, 4, 1247, +4, 4, 1254, +4, 4, 1255, +4, 4, 1258, +4, 4, 1259, +4, 4, 1260, +4, 4, 1261, +4, 4, + 1268, +4, 4, 1269, +4, 4, 1272, +4, 4, 1273, +17, 19, 1570, 1571, 1573, +18, 18, 1572, +18, 18, + 1574, +18, 18, 1728, +18, 18, 1730, +18, 18, 1747, +20, 20, 2345, +20, 20, 2353, +20, 20, 2356, +21, 22, 2507, + 2508, +23, 25, 2888, 2891, 2892, +26, 26, 2964, +26, 27, 3020, 3018, +27, 27, 3019, +28, 28, + 3144, +29, 29, 3264, +29, 31, 3271, 3272, 3274, +29, 29, 3275, +32, 33, 3402, 3404, +32, 32, + 3403, +34, 36, 3546, 3548, 3550, +34, 34, 3549, +37, 37, 4134, +38, 38, 6918, +38, 38, 6920, +38, 38, + 6922, +38, 38, 6924, +38, 38, 6926, +38, 38, 6930, +38, 38, 6971, +38, 38, 6973, +38, 38, 6976, +38, 38, 6977, +38, 38, + 6979, +10, 41, 7682, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7684, + 7686, +10, 41, 7683, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7685, + 7687, +1, 1, 7688, +1, 1, 7689, +0, 1, 7700, 7702, +0, 1, 7701, 7703, +8, 8, 7708, +8, 8, + 7709, +10, 10, 7710, +10, 10, 7711, +1, 1, 7726, +1, 1, 7727, +7, 7, 7736, +7, 7, 7737, +1, 40, 7742, + 0, 0, 0, 0, 0, 0, 0, 0, + 7744, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7746, +1, 40, 7743, + 0, 0, 0, 0, 0, 0, 0, 0, + 7745, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7747, +0, 1, 7760, + 7762, +0, 1, 7761, 7763, +1, 10, 7764, 0, 0, 0, 0, + 0, 0, 0, 0, 7766, +1, 10, 7765, 0, 0, + 0, 0, 0, 0, 0, 0, 7767, +7, 7, 7772, +7, 7, + 7773, +10, 10, 7780, +10, 10, 7781, +10, 10, 7782, +10, 10, 7783, +10, 10, 7784, +10, 10, 7785, +1, 1, 7800, +1, 1, + 7801, +4, 4, 7802, +4, 4, 7803, +3, 40, 7804, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7806, +3, 40, 7805, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7807, +4, 10, 7820, + 0, 0, 0, 0, 0, 7818, +4, 10, 7821, 0, + 0, 0, 0, 0, 7819, +10, 10, 7835, +0, 46, 7846, 7844, + 0, 7850, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 7848, +0, 46, 7847, 7845, 0, + 7851, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7849, +2, 8, 7852, 0, 0, 0, + 0, 0, 7862, +2, 8, 7853, 0, 0, 0, 0, + 0, 7863, +0, 46, 7856, 7854, 0, 7860, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7858, +0, 46, 7857, 7855, 0, 7861, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7859, +0, 46, + 7872, 7870, 0, 7876, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7874, +0, 46, 7873, + 7871, 0, 7877, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7875, +2, 2, 7878, +2, 2, 7879, +0, 46, + 7890, 7888, 0, 7894, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7892, +0, 46, 7891, + 7889, 0, 7895, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7893, +2, 2, 7896, +2, 2, 7897, +0, 46, + 7900, 7898, 0, 7904, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7906, 0, 0, 0, 0, 0, 7902, +0, 46, 7901, + 7899, 0, 7905, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7907, + 0, 0, 0, 0, 0, 7903, +0, 46, 7914, 7912, + 0, 7918, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7920, 0, + 0, 0, 0, 0, 7916, +0, 46, 7915, 7913, 0, + 7919, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7921, 0, 0, + 0, 0, 0, 7917, +0, 50, 7938, 7940, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7942, 8064, +0, 50, 7939, + 7941, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7943, 8065, +0, 50, 7946, 7948, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7950, 8072, +0, 50, 7947, 7949, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7951, 8073, +0, 1, + 7954, 7956, +0, 1, 7955, 7957, +0, 1, 7962, 7964, +0, 1, 7963, 7965, +0, 50, + 7970, 7972, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 7974, 8080, +0, 50, 7971, 7973, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 7975, 8081, +0, 50, 7978, 7980, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7982, + 8088, +0, 50, 7979, 7981, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7983, 8089, +0, 49, 7986, 7988, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7990, +0, 49, 7987, 7989, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7991, +0, 49, + 7994, 7996, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 7998, +0, 49, 7995, 7997, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7999, +0, 1, 8002, 8004, +0, 1, 8003, 8005, +0, 1, + 8010, 8012, +0, 1, 8011, 8013, +0, 49, 8018, 8020, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 8022, +0, 49, 8019, 8021, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 8023, +0, 49, + 8027, 8029, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 8031, +0, 50, 8034, 8036, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 8038, 8096, +0, 50, 8035, 8037, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 8039, 8097, +0, 50, + 8042, 8044, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 8046, 8104, +0, 50, 8043, 8045, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 8047, 8105, +50, 50, 8066, +50, 50, 8067, +50, 50, + 8068, +50, 50, 8069, +50, 50, 8070, +50, 50, 8071, +50, 50, 8074, +50, 50, 8075, +50, 50, 8076, +50, 50, 8077, +50, 50, + 8078, +50, 50, 8079, +50, 50, 8082, +50, 50, 8083, +50, 50, 8084, +50, 50, 8085, +50, 50, 8086, +50, 50, 8087, +50, 50, + 8090, +50, 50, 8091, +50, 50, 8092, +50, 50, 8093, +50, 50, 8094, +50, 50, 8095, +50, 50, 8098, +50, 50, 8099, +50, 50, + 8100, +50, 50, 8101, +50, 50, 8102, +50, 50, 8103, +50, 50, 8106, +50, 50, 8107, +50, 50, 8108, +50, 50, 8109, +50, 50, + 8110, +50, 50, 8111, +50, 50, 8114, +50, 50, 8116, +50, 50, 8119, +50, 50, 8130, +50, 50, 8132, +50, 50, 8135, +0, 49, + 8141, 8142, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 8143, +0, 49, 8157, 8158, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 8159, +47, 48, 8164, 8165, +48, 48, 8172, +50, 50, 8178, +50, 50, + 8180, +50, 50, 8183, +51, 51, 8602, +51, 51, 8603, +51, 51, 8622, +51, 51, 8653, +51, 51, 8654, +51, 51, 8655, +51, 51, + 8708, +51, 51, 8713, +51, 51, 8716, +51, 51, 8740, +51, 51, 8742, +51, 51, 8769, +51, 51, 8772, +51, 51, 8775, +51, 51, + 8777, +51, 51, 8800, +51, 51, 8802, +51, 51, 8813, +51, 51, 8814, +51, 51, 8815, +51, 51, 8816, +51, 51, 8817, +51, 51, + 8820, +51, 51, 8821, +51, 51, 8824, +51, 51, 8825, +51, 51, 8832, +51, 51, 8833, +51, 51, 8836, +51, 51, 8837, +51, 51, + 8840, +51, 51, 8841, +51, 51, 8876, +51, 51, 8877, +51, 51, 8878, +51, 51, 8879, +51, 51, 8928, +51, 51, 8929, +51, 51, + 8930, +51, 51, 8931, +51, 51, 8938, +51, 51, 8939, +51, 51, 8940, +51, 51, 8941, +51, 51, 10972, +52, 52, 12364, +52, 52, + 12366, +52, 52, 12368, +52, 52, 12370, +52, 52, 12372, +52, 52, 12374, +52, 52, 12376, +52, 52, 12378, +52, 52, 12380, +52, 52, + 12382, +52, 52, 12384, +52, 52, 12386, +52, 52, 12389, +52, 52, 12391, +52, 52, 12393, +52, 53, 12400, 12401, +52, 53, + 12403, 12404, +52, 53, 12406, 12407, +52, 53, 12409, 12410, +52, 53, 12412, 12413, +52, 52, + 12436, +52, 52, 12446, +52, 52, 12460, +52, 52, 12462, +52, 52, 12464, +52, 52, 12466, +52, 52, 12468, +52, 52, 12470, +52, 52, + 12472, +52, 52, 12474, +52, 52, 12476, +52, 52, 12478, +52, 52, 12480, +52, 52, 12482, +52, 52, 12485, +52, 52, 12487, +52, 52, + 12489, +52, 53, 12496, 12497, +52, 53, 12499, 12500, +52, 53, 12502, 12503, +52, 53, 12505, + 12506, +52, 53, 12508, 12509, +52, 52, 12532, +52, 52, 12535, +52, 52, 12536, +52, 52, 12537, +52, 52, 12538, +52, 52, + 12542, +54, 55, 1, 4250, +54, 55, 1, 4252, +54, 55, 1, 4267, +56, 57, 1, 4398, +56, 57, 1, 4399, +58, 61, 1, 4939, 1, 4940, +62, 67, + 1, 5307, 1, 5308, 1, 5310, +68, 69, 1, 5562, +68, 69, 1, 5563, +70, 71, 1, 53598, +70, 71, 1, 53599, +72, 81, 1, 53600, + 1, 53601, 1, 53602, 1, 53603, 1, 53604, +70, 71, 1, 53691, +70, 71, 1, 53692, +72, 75, 1, 53693, 1, 53695, +72, 75, + 1, 53694, 1, 53696, +}; + diff --git a/tcod_sys/libtcod/src/zlib/adler32.c b/tcod_sys/libtcod/src/vendor/zlib/adler32.c similarity index 92% rename from tcod_sys/libtcod/src/zlib/adler32.c rename to tcod_sys/libtcod/src/vendor/zlib/adler32.c index a868f073d..d0be4380a 100644 --- a/tcod_sys/libtcod/src/zlib/adler32.c +++ b/tcod_sys/libtcod/src/vendor/zlib/adler32.c @@ -1,5 +1,5 @@ /* adler32.c -- compute the Adler-32 checksum of a data stream - * Copyright (C) 1995-2011 Mark Adler + * Copyright (C) 1995-2011, 2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -7,11 +7,9 @@ #include "zutil.h" -#define local static - local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); -#define BASE 65521 /* largest prime smaller than 65536 */ +#define BASE 65521U /* largest prime smaller than 65536 */ #define NMAX 5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ @@ -62,10 +60,10 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); #endif /* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) +uLong ZEXPORT adler32_z(adler, buf, len) uLong adler; const Bytef *buf; - uInt len; + z_size_t len; { unsigned long sum2; unsigned n; @@ -132,6 +130,15 @@ uLong ZEXPORT adler32(adler, buf, len) return adler | (sum2 << 16); } +/* ========================================================================= */ +uLong ZEXPORT adler32(adler, buf, len) + uLong adler; + const Bytef *buf; + uInt len; +{ + return adler32_z(adler, buf, len); +} + /* ========================================================================= */ local uLong adler32_combine_(adler1, adler2, len2) uLong adler1; @@ -156,7 +163,7 @@ local uLong adler32_combine_(adler1, adler2, len2) sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; if (sum1 >= BASE) sum1 -= BASE; if (sum1 >= BASE) sum1 -= BASE; - if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1); + if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1); if (sum2 >= BASE) sum2 -= BASE; return sum1 | (sum2 << 16); } diff --git a/tcod_sys/libtcod/src/zlib/compress.c b/tcod_sys/libtcod/src/vendor/zlib/compress.c similarity index 74% rename from tcod_sys/libtcod/src/zlib/compress.c rename to tcod_sys/libtcod/src/vendor/zlib/compress.c index 6e9762676..e2db404ab 100644 --- a/tcod_sys/libtcod/src/zlib/compress.c +++ b/tcod_sys/libtcod/src/vendor/zlib/compress.c @@ -1,5 +1,5 @@ /* compress.c -- compress a memory buffer - * Copyright (C) 1995-2005 Jean-loup Gailly. + * Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -28,16 +28,11 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) { z_stream stream; int err; + const uInt max = (uInt)-1; + uLong left; - stream.next_in = (z_const Bytef *)source; - stream.avail_in = (uInt)sourceLen; -#ifdef MAXSEG_64K - /* Check for source > 64K on 16-bit machine: */ - if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; -#endif - stream.next_out = dest; - stream.avail_out = (uInt)*destLen; - if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; + left = *destLen; + *destLen = 0; stream.zalloc = (alloc_func)0; stream.zfree = (free_func)0; @@ -46,15 +41,26 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) err = deflateInit(&stream, level); if (err != Z_OK) return err; - err = deflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - deflateEnd(&stream); - return err == Z_OK ? Z_BUF_ERROR : err; - } - *destLen = stream.total_out; + stream.next_out = dest; + stream.avail_out = 0; + stream.next_in = (z_const Bytef *)source; + stream.avail_in = 0; + + do { + if (stream.avail_out == 0) { + stream.avail_out = left > (uLong)max ? max : (uInt)left; + left -= stream.avail_out; + } + if (stream.avail_in == 0) { + stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen; + sourceLen -= stream.avail_in; + } + err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH); + } while (err == Z_OK); - err = deflateEnd(&stream); - return err; + *destLen = stream.total_out; + deflateEnd(&stream); + return err == Z_STREAM_END ? Z_OK : err; } /* =========================================================================== diff --git a/tcod_sys/libtcod/src/zlib/crc32.c b/tcod_sys/libtcod/src/vendor/zlib/crc32.c similarity index 91% rename from tcod_sys/libtcod/src/zlib/crc32.c rename to tcod_sys/libtcod/src/vendor/zlib/crc32.c index 979a7190a..9580440c0 100644 --- a/tcod_sys/libtcod/src/zlib/crc32.c +++ b/tcod_sys/libtcod/src/vendor/zlib/crc32.c @@ -1,5 +1,5 @@ /* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler + * Copyright (C) 1995-2006, 2010, 2011, 2012, 2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h * * Thanks to Rodney Brown for his contribution of faster @@ -30,17 +30,15 @@ #include "zutil.h" /* for STDC and FAR definitions */ -#define local static - /* Definitions for doing the crc four data bytes at a time. */ #if !defined(NOBYFOUR) && defined(Z_U4) # define BYFOUR #endif #ifdef BYFOUR local unsigned long crc32_little OF((unsigned long, - const unsigned char FAR *, unsigned)); + const unsigned char FAR *, z_size_t)); local unsigned long crc32_big OF((unsigned long, - const unsigned char FAR *, unsigned)); + const unsigned char FAR *, z_size_t)); # define TBLS 8 #else # define TBLS 1 @@ -201,10 +199,10 @@ const z_crc_t FAR * ZEXPORT get_crc_table() #define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 /* ========================================================================= */ -unsigned long ZEXPORT crc32(crc, buf, len) +unsigned long ZEXPORT crc32_z(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; - uInt len; + z_size_t len; { if (buf == Z_NULL) return 0UL; @@ -235,8 +233,29 @@ unsigned long ZEXPORT crc32(crc, buf, len) return crc ^ 0xffffffffUL; } +/* ========================================================================= */ +unsigned long ZEXPORT crc32(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + uInt len; +{ + return crc32_z(crc, buf, len); +} + #ifdef BYFOUR +/* + This BYFOUR code accesses the passed unsigned char * buffer with a 32-bit + integer pointer type. This violates the strict aliasing rule, where a + compiler can assume, for optimization purposes, that two pointers to + fundamentally different types won't ever point to the same memory. This can + manifest as a problem only if one of the pointers is written to. This code + only reads from those pointers. So long as this code remains isolated in + this compilation unit, there won't be a problem. For this reason, this code + should not be copied and pasted into a compilation unit in which other code + writes to the buffer that is passed to these routines. + */ + /* ========================================================================= */ #define DOLIT4 c ^= *buf4++; \ c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \ @@ -247,7 +266,7 @@ unsigned long ZEXPORT crc32(crc, buf, len) local unsigned long crc32_little(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; - unsigned len; + z_size_t len; { register z_crc_t c; register const z_crc_t FAR *buf4; @@ -278,7 +297,7 @@ local unsigned long crc32_little(crc, buf, len) } /* ========================================================================= */ -#define DOBIG4 c ^= *++buf4; \ +#define DOBIG4 c ^= *buf4++; \ c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \ crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24] #define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4 @@ -287,7 +306,7 @@ local unsigned long crc32_little(crc, buf, len) local unsigned long crc32_big(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; - unsigned len; + z_size_t len; { register z_crc_t c; register const z_crc_t FAR *buf4; @@ -300,7 +319,6 @@ local unsigned long crc32_big(crc, buf, len) } buf4 = (const z_crc_t FAR *)(const void FAR *)buf; - buf4--; while (len >= 32) { DOBIG32; len -= 32; @@ -309,7 +327,6 @@ local unsigned long crc32_big(crc, buf, len) DOBIG4; len -= 4; } - buf4++; buf = (const unsigned char FAR *)buf4; if (len) do { diff --git a/tcod_sys/libtcod/src/zlib/crc32.h b/tcod_sys/libtcod/src/vendor/zlib/crc32.h similarity index 100% rename from tcod_sys/libtcod/src/zlib/crc32.h rename to tcod_sys/libtcod/src/vendor/zlib/crc32.h diff --git a/tcod_sys/libtcod/src/zlib/deflate.c b/tcod_sys/libtcod/src/vendor/zlib/deflate.c similarity index 75% rename from tcod_sys/libtcod/src/zlib/deflate.c rename to tcod_sys/libtcod/src/vendor/zlib/deflate.c index 696957705..1ec761448 100644 --- a/tcod_sys/libtcod/src/zlib/deflate.c +++ b/tcod_sys/libtcod/src/vendor/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.11 Copyright 1995-2017 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -73,6 +73,8 @@ typedef enum { typedef block_state (*compress_func) OF((deflate_state *s, int flush)); /* Compression function. Returns the block state after the call. */ +local int deflateStateCheck OF((z_streamp strm)); +local void slide_hash OF((deflate_state *s)); local void fill_window OF((deflate_state *s)); local block_state deflate_stored OF((deflate_state *s, int flush)); local block_state deflate_fast OF((deflate_state *s, int flush)); @@ -84,15 +86,16 @@ local block_state deflate_huff OF((deflate_state *s, int flush)); local void lm_init OF((deflate_state *s)); local void putShortMSB OF((deflate_state *s, uInt b)); local void flush_pending OF((z_streamp strm)); -local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); +local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); #ifdef ASMV +# pragma message("Assembler code may have bugs -- use at your own risk") void match_init OF((void)); /* asm code initialization */ uInt longest_match OF((deflate_state *s, IPos cur_match)); #else local uInt longest_match OF((deflate_state *s, IPos cur_match)); #endif -#ifdef DEBUG +#ifdef ZLIB_DEBUG local void check_match OF((deflate_state *s, IPos start, IPos match, int length)); #endif @@ -148,21 +151,14 @@ local const config configuration_table[10] = { * meaning. */ -#define EQUAL 0 -/* result of memcmp for equal strings */ - -#ifndef NO_DUMMY_DECL -struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ -#endif - /* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */ -#define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0)) +#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0)) /* =========================================================================== * Update a hash value with the given input byte - * IN assertion: all calls to to UPDATE_HASH are made with consecutive - * input characters, so that a running hash key can be computed from the - * previous key instead of complete recalculation each time. + * IN assertion: all calls to UPDATE_HASH are made with consecutive input + * characters, so that a running hash key can be computed from the previous + * key instead of complete recalculation each time. */ #define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) @@ -173,9 +169,9 @@ struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ * the previous length of the hash chain. * If this file is compiled with -DFASTEST, the compression level is forced * to 1, and no hash chains are maintained. - * IN assertion: all calls to to INSERT_STRING are made with consecutive - * input characters and the first MIN_MATCH bytes of str are valid - * (except for the last MIN_MATCH-1 bytes of the input file). + * IN assertion: all calls to INSERT_STRING are made with consecutive input + * characters and the first MIN_MATCH bytes of str are valid (except for + * the last MIN_MATCH-1 bytes of the input file). */ #ifdef FASTEST #define INSERT_STRING(s, str, match_head) \ @@ -197,6 +193,37 @@ struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ s->head[s->hash_size-1] = NIL; \ zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); +/* =========================================================================== + * Slide the hash table when sliding the window down (could be avoided with 32 + * bit values at the expense of memory usage). We slide even when level == 0 to + * keep the hash table consistent if we switch back to level > 0 later. + */ +local void slide_hash(s) + deflate_state *s; +{ + unsigned n, m; + Posf *p; + uInt wsize = s->w_size; + + n = s->hash_size; + p = &s->head[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m - wsize : NIL); + } while (--n); + n = wsize; +#ifndef FASTEST + p = &s->prev[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m - wsize : NIL); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); +#endif +} + /* ========================================================================= */ int ZEXPORT deflateInit_(strm, level, version, stream_size) z_streamp strm; @@ -270,7 +297,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, #endif if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED) { + strategy < 0 || strategy > Z_FIXED || (windowBits == 8 && wrap != 1)) { return Z_STREAM_ERROR; } if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ @@ -278,14 +305,15 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, if (s == Z_NULL) return Z_MEM_ERROR; strm->state = (struct internal_state FAR *)s; s->strm = strm; + s->status = INIT_STATE; /* to pass state test in deflateReset() */ s->wrap = wrap; s->gzhead = Z_NULL; - s->w_bits = windowBits; + s->w_bits = (uInt)windowBits; s->w_size = 1 << s->w_bits; s->w_mask = s->w_size - 1; - s->hash_bits = memLevel + 7; + s->hash_bits = (uInt)memLevel + 7; s->hash_size = 1 << s->hash_bits; s->hash_mask = s->hash_size - 1; s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); @@ -319,6 +347,31 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, return deflateReset(strm); } +/* ========================================================================= + * Check for a valid deflate stream state. Return 0 if ok, 1 if not. + */ +local int deflateStateCheck (strm) + z_streamp strm; +{ + deflate_state *s; + if (strm == Z_NULL || + strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) + return 1; + s = strm->state; + if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE && +#ifdef GZIP + s->status != GZIP_STATE && +#endif + s->status != EXTRA_STATE && + s->status != NAME_STATE && + s->status != COMMENT_STATE && + s->status != HCRC_STATE && + s->status != BUSY_STATE && + s->status != FINISH_STATE)) + return 1; + return 0; +} + /* ========================================================================= */ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) z_streamp strm; @@ -331,7 +384,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) unsigned avail; z_const unsigned char *next; - if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL) + if (deflateStateCheck(strm) || dictionary == Z_NULL) return Z_STREAM_ERROR; s = strm->state; wrap = s->wrap; @@ -388,14 +441,35 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) return Z_OK; } +/* ========================================================================= */ +int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength) + z_streamp strm; + Bytef *dictionary; + uInt *dictLength; +{ + deflate_state *s; + uInt len; + + if (deflateStateCheck(strm)) + return Z_STREAM_ERROR; + s = strm->state; + len = s->strstart + s->lookahead; + if (len > s->w_size) + len = s->w_size; + if (dictionary != Z_NULL && len) + zmemcpy(dictionary, s->window + s->strstart + s->lookahead - len, len); + if (dictLength != Z_NULL) + *dictLength = len; + return Z_OK; +} + /* ========================================================================= */ int ZEXPORT deflateResetKeep (strm) z_streamp strm; { deflate_state *s; - if (strm == Z_NULL || strm->state == Z_NULL || - strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) { + if (deflateStateCheck(strm)) { return Z_STREAM_ERROR; } @@ -410,7 +484,11 @@ int ZEXPORT deflateResetKeep (strm) if (s->wrap < 0) { s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */ } - s->status = s->wrap ? INIT_STATE : BUSY_STATE; + s->status = +#ifdef GZIP + s->wrap == 2 ? GZIP_STATE : +#endif + s->wrap ? INIT_STATE : BUSY_STATE; strm->adler = #ifdef GZIP s->wrap == 2 ? crc32(0L, Z_NULL, 0) : @@ -440,8 +518,8 @@ int ZEXPORT deflateSetHeader (strm, head) z_streamp strm; gz_headerp head; { - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - if (strm->state->wrap != 2) return Z_STREAM_ERROR; + if (deflateStateCheck(strm) || strm->state->wrap != 2) + return Z_STREAM_ERROR; strm->state->gzhead = head; return Z_OK; } @@ -452,7 +530,7 @@ int ZEXPORT deflatePending (strm, pending, bits) int *bits; z_streamp strm; { - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (deflateStateCheck(strm)) return Z_STREAM_ERROR; if (pending != Z_NULL) *pending = strm->state->pending; if (bits != Z_NULL) @@ -469,7 +547,7 @@ int ZEXPORT deflatePrime (strm, bits, value) deflate_state *s; int put; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3)) return Z_BUF_ERROR; @@ -494,9 +572,8 @@ int ZEXPORT deflateParams(strm, level, strategy) { deflate_state *s; compress_func func; - int err = Z_OK; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; #ifdef FASTEST @@ -510,13 +587,22 @@ int ZEXPORT deflateParams(strm, level, strategy) func = configuration_table[s->level].func; if ((strategy != s->strategy || func != configuration_table[level].func) && - strm->total_in != 0) { + s->high_water) { /* Flush the last buffer: */ - err = deflate(strm, Z_BLOCK); - if (err == Z_BUF_ERROR && s->pending == 0) - err = Z_OK; + int err = deflate(strm, Z_BLOCK); + if (err == Z_STREAM_ERROR) + return err; + if (strm->avail_out == 0) + return Z_BUF_ERROR; } if (s->level != level) { + if (s->level == 0 && s->matches != 0) { + if (s->matches == 1) + slide_hash(s); + else + CLEAR_HASH(s); + s->matches = 0; + } s->level = level; s->max_lazy_match = configuration_table[level].max_lazy; s->good_match = configuration_table[level].good_length; @@ -524,7 +610,7 @@ int ZEXPORT deflateParams(strm, level, strategy) s->max_chain_length = configuration_table[level].max_chain; } s->strategy = strategy; - return err; + return Z_OK; } /* ========================================================================= */ @@ -537,12 +623,12 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) { deflate_state *s; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; - s->good_match = good_length; - s->max_lazy_match = max_lazy; + s->good_match = (uInt)good_length; + s->max_lazy_match = (uInt)max_lazy; s->nice_match = nice_length; - s->max_chain_length = max_chain; + s->max_chain_length = (uInt)max_chain; return Z_OK; } @@ -569,14 +655,13 @@ uLong ZEXPORT deflateBound(strm, sourceLen) { deflate_state *s; uLong complen, wraplen; - Bytef *str; /* conservative upper bound for compressed data */ complen = sourceLen + ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5; /* if can't get parameters, return conservative bound plus zlib wrapper */ - if (strm == Z_NULL || strm->state == Z_NULL) + if (deflateStateCheck(strm)) return complen + 6; /* compute wrapper length */ @@ -588,9 +673,11 @@ uLong ZEXPORT deflateBound(strm, sourceLen) case 1: /* zlib wrapper */ wraplen = 6 + (s->strstart ? 4 : 0); break; +#ifdef GZIP case 2: /* gzip wrapper */ wraplen = 18; if (s->gzhead != Z_NULL) { /* user-supplied gzip header */ + Bytef *str; if (s->gzhead->extra != Z_NULL) wraplen += 2 + s->gzhead->extra_len; str = s->gzhead->name; @@ -607,6 +694,7 @@ uLong ZEXPORT deflateBound(strm, sourceLen) wraplen += 2; } break; +#endif default: /* for compiler happiness */ wraplen = 6; } @@ -634,10 +722,10 @@ local void putShortMSB (s, b) } /* ========================================================================= - * Flush as much pending output as possible. All deflate() output goes - * through this function so some applications may wish to modify it - * to avoid allocating a large strm->next_out buffer and copying into it. - * (See also read_buf()). + * Flush as much pending output as possible. All deflate() output, except for + * some deflate_stored() output, goes through this function so some + * applications may wish to modify it to avoid allocating a large + * strm->next_out buffer and copying into it. (See also read_buf()). */ local void flush_pending(strm) z_streamp strm; @@ -654,13 +742,23 @@ local void flush_pending(strm) strm->next_out += len; s->pending_out += len; strm->total_out += len; - strm->avail_out -= len; - s->pending -= len; + strm->avail_out -= len; + s->pending -= len; if (s->pending == 0) { s->pending_out = s->pending_buf; } } +/* =========================================================================== + * Update the header CRC with the bytes s->pending_buf[beg..s->pending - 1]. + */ +#define HCRC_UPDATE(beg) \ + do { \ + if (s->gzhead->hcrc && s->pending > (beg)) \ + strm->adler = crc32(strm->adler, s->pending_buf + (beg), \ + s->pending - (beg)); \ + } while (0) + /* ========================================================================= */ int ZEXPORT deflate (strm, flush) z_streamp strm; @@ -669,230 +767,229 @@ int ZEXPORT deflate (strm, flush) int old_flush; /* value of flush param for previous deflate call */ deflate_state *s; - if (strm == Z_NULL || strm->state == Z_NULL || - flush > Z_BLOCK || flush < 0) { + if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) { return Z_STREAM_ERROR; } s = strm->state; if (strm->next_out == Z_NULL || - (strm->next_in == Z_NULL && strm->avail_in != 0) || + (strm->avail_in != 0 && strm->next_in == Z_NULL) || (s->status == FINISH_STATE && flush != Z_FINISH)) { ERR_RETURN(strm, Z_STREAM_ERROR); } if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); - s->strm = strm; /* just in case */ old_flush = s->last_flush; s->last_flush = flush; + /* Flush as much pending output as possible */ + if (s->pending != 0) { + flush_pending(strm); + if (strm->avail_out == 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s->last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUF_ERROR. + */ + } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) && + flush != Z_FINISH) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s->status == FINISH_STATE && strm->avail_in != 0) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + /* Write the header */ if (s->status == INIT_STATE) { -#ifdef GZIP - if (s->wrap == 2) { - strm->adler = crc32(0L, Z_NULL, 0); - put_byte(s, 31); - put_byte(s, 139); - put_byte(s, 8); - if (s->gzhead == Z_NULL) { - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, s->level == 9 ? 2 : - (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? - 4 : 0)); - put_byte(s, OS_CODE); - s->status = BUSY_STATE; - } - else { - put_byte(s, (s->gzhead->text ? 1 : 0) + - (s->gzhead->hcrc ? 2 : 0) + - (s->gzhead->extra == Z_NULL ? 0 : 4) + - (s->gzhead->name == Z_NULL ? 0 : 8) + - (s->gzhead->comment == Z_NULL ? 0 : 16) - ); - put_byte(s, (Byte)(s->gzhead->time & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff)); - put_byte(s, s->level == 9 ? 2 : - (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? - 4 : 0)); - put_byte(s, s->gzhead->os & 0xff); - if (s->gzhead->extra != Z_NULL) { - put_byte(s, s->gzhead->extra_len & 0xff); - put_byte(s, (s->gzhead->extra_len >> 8) & 0xff); - } - if (s->gzhead->hcrc) - strm->adler = crc32(strm->adler, s->pending_buf, - s->pending); - s->gzindex = 0; - s->status = EXTRA_STATE; - } - } + /* zlib header */ + uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; + uInt level_flags; + + if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) + level_flags = 0; + else if (s->level < 6) + level_flags = 1; + else if (s->level == 6) + level_flags = 2; else -#endif - { - uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; - uInt level_flags; - - if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) - level_flags = 0; - else if (s->level < 6) - level_flags = 1; - else if (s->level == 6) - level_flags = 2; - else - level_flags = 3; - header |= (level_flags << 6); - if (s->strstart != 0) header |= PRESET_DICT; - header += 31 - (header % 31); + level_flags = 3; + header |= (level_flags << 6); + if (s->strstart != 0) header |= PRESET_DICT; + header += 31 - (header % 31); + + putShortMSB(s, header); + /* Save the adler32 of the preset dictionary: */ + if (s->strstart != 0) { + putShortMSB(s, (uInt)(strm->adler >> 16)); + putShortMSB(s, (uInt)(strm->adler & 0xffff)); + } + strm->adler = adler32(0L, Z_NULL, 0); + s->status = BUSY_STATE; + + /* Compression must start with an empty pending buffer */ + flush_pending(strm); + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; + } + } +#ifdef GZIP + if (s->status == GZIP_STATE) { + /* gzip header */ + strm->adler = crc32(0L, Z_NULL, 0); + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (s->gzhead == Z_NULL) { + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); s->status = BUSY_STATE; - putShortMSB(s, header); - /* Save the adler32 of the preset dictionary: */ - if (s->strstart != 0) { - putShortMSB(s, (uInt)(strm->adler >> 16)); - putShortMSB(s, (uInt)(strm->adler & 0xffff)); + /* Compression must start with an empty pending buffer */ + flush_pending(strm); + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; + } + } + else { + put_byte(s, (s->gzhead->text ? 1 : 0) + + (s->gzhead->hcrc ? 2 : 0) + + (s->gzhead->extra == Z_NULL ? 0 : 4) + + (s->gzhead->name == Z_NULL ? 0 : 8) + + (s->gzhead->comment == Z_NULL ? 0 : 16) + ); + put_byte(s, (Byte)(s->gzhead->time & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff)); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, s->gzhead->os & 0xff); + if (s->gzhead->extra != Z_NULL) { + put_byte(s, s->gzhead->extra_len & 0xff); + put_byte(s, (s->gzhead->extra_len >> 8) & 0xff); } - strm->adler = adler32(0L, Z_NULL, 0); + if (s->gzhead->hcrc) + strm->adler = crc32(strm->adler, s->pending_buf, + s->pending); + s->gzindex = 0; + s->status = EXTRA_STATE; } } -#ifdef GZIP if (s->status == EXTRA_STATE) { if (s->gzhead->extra != Z_NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ - - while (s->gzindex < (s->gzhead->extra_len & 0xffff)) { - if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) - break; + ulg beg = s->pending; /* start of bytes to update crc */ + uInt left = (s->gzhead->extra_len & 0xffff) - s->gzindex; + while (s->pending + left > s->pending_buf_size) { + uInt copy = s->pending_buf_size - s->pending; + zmemcpy(s->pending_buf + s->pending, + s->gzhead->extra + s->gzindex, copy); + s->pending = s->pending_buf_size; + HCRC_UPDATE(beg); + s->gzindex += copy; + flush_pending(strm); + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; } - put_byte(s, s->gzhead->extra[s->gzindex]); - s->gzindex++; - } - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (s->gzindex == s->gzhead->extra_len) { - s->gzindex = 0; - s->status = NAME_STATE; + beg = 0; + left -= copy; } + zmemcpy(s->pending_buf + s->pending, + s->gzhead->extra + s->gzindex, left); + s->pending += left; + HCRC_UPDATE(beg); + s->gzindex = 0; } - else - s->status = NAME_STATE; + s->status = NAME_STATE; } if (s->status == NAME_STATE) { if (s->gzhead->name != Z_NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ + ulg beg = s->pending; /* start of bytes to update crc */ int val; - do { if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); + HCRC_UPDATE(beg); flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) { - val = 1; - break; + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; } + beg = 0; } val = s->gzhead->name[s->gzindex++]; put_byte(s, val); } while (val != 0); - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (val == 0) { - s->gzindex = 0; - s->status = COMMENT_STATE; - } + HCRC_UPDATE(beg); + s->gzindex = 0; } - else - s->status = COMMENT_STATE; + s->status = COMMENT_STATE; } if (s->status == COMMENT_STATE) { if (s->gzhead->comment != Z_NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ + ulg beg = s->pending; /* start of bytes to update crc */ int val; - do { if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); + HCRC_UPDATE(beg); flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) { - val = 1; - break; + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; } + beg = 0; } val = s->gzhead->comment[s->gzindex++]; put_byte(s, val); } while (val != 0); - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (val == 0) - s->status = HCRC_STATE; + HCRC_UPDATE(beg); } - else - s->status = HCRC_STATE; + s->status = HCRC_STATE; } if (s->status == HCRC_STATE) { if (s->gzhead->hcrc) { - if (s->pending + 2 > s->pending_buf_size) + if (s->pending + 2 > s->pending_buf_size) { flush_pending(strm); - if (s->pending + 2 <= s->pending_buf_size) { - put_byte(s, (Byte)(strm->adler & 0xff)); - put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); - strm->adler = crc32(0L, Z_NULL, 0); - s->status = BUSY_STATE; + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; + } } + put_byte(s, (Byte)(strm->adler & 0xff)); + put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); + strm->adler = crc32(0L, Z_NULL, 0); } - else - s->status = BUSY_STATE; - } -#endif + s->status = BUSY_STATE; - /* Flush as much pending output as possible */ - if (s->pending != 0) { + /* Compression must start with an empty pending buffer */ flush_pending(strm); - if (strm->avail_out == 0) { - /* Since avail_out is 0, deflate will be called again with - * more output space, but possibly with both pending and - * avail_in equal to zero. There won't be anything to do, - * but this is not an error situation so make sure we - * return OK instead of BUF_ERROR at next call of deflate: - */ + if (s->pending != 0) { s->last_flush = -1; return Z_OK; } - - /* Make sure there is something to do and avoid duplicate consecutive - * flushes. For repeated and useless calls with Z_FINISH, we keep - * returning Z_STREAM_END instead of Z_BUF_ERROR. - */ - } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) && - flush != Z_FINISH) { - ERR_RETURN(strm, Z_BUF_ERROR); - } - - /* User must not provide more input after the first FINISH: */ - if (s->status == FINISH_STATE && strm->avail_in != 0) { - ERR_RETURN(strm, Z_BUF_ERROR); } +#endif /* Start a new block or continue the current one. */ @@ -900,9 +997,10 @@ int ZEXPORT deflate (strm, flush) (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { block_state bstate; - bstate = s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : - (s->strategy == Z_RLE ? deflate_rle(s, flush) : - (*(configuration_table[s->level].func))(s, flush)); + bstate = s->level == 0 ? deflate_stored(s, flush) : + s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : + s->strategy == Z_RLE ? deflate_rle(s, flush) : + (*(configuration_table[s->level].func))(s, flush); if (bstate == finish_started || bstate == finish_done) { s->status = FINISH_STATE; @@ -944,7 +1042,6 @@ int ZEXPORT deflate (strm, flush) } } } - Assert(strm->avail_out > 0, "bug2"); if (flush != Z_FINISH) return Z_OK; if (s->wrap <= 0) return Z_STREAM_END; @@ -981,18 +1078,9 @@ int ZEXPORT deflateEnd (strm) { int status; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (deflateStateCheck(strm)) return Z_STREAM_ERROR; status = strm->state->status; - if (status != INIT_STATE && - status != EXTRA_STATE && - status != NAME_STATE && - status != COMMENT_STATE && - status != HCRC_STATE && - status != BUSY_STATE && - status != FINISH_STATE) { - return Z_STREAM_ERROR; - } /* Deallocate in reverse order of allocations: */ TRY_FREE(strm, strm->state->pending_buf); @@ -1023,7 +1111,7 @@ int ZEXPORT deflateCopy (dest, source) ushf *overlay; - if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) { + if (deflateStateCheck(source) || dest == Z_NULL) { return Z_STREAM_ERROR; } @@ -1073,7 +1161,7 @@ int ZEXPORT deflateCopy (dest, source) * allocating a large strm->next_in buffer and copying from it. * (See also flush_pending()). */ -local int read_buf(strm, buf, size) +local unsigned read_buf(strm, buf, size) z_streamp strm; Bytef *buf; unsigned size; @@ -1097,7 +1185,7 @@ local int read_buf(strm, buf, size) strm->next_in += len; strm->total_in += len; - return (int)len; + return len; } /* =========================================================================== @@ -1151,9 +1239,9 @@ local uInt longest_match(s, cur_match) { unsigned chain_length = s->max_chain_length;/* max hash chain length */ register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ + register Bytef *match; /* matched string */ register int len; /* length of current match */ - int best_len = s->prev_length; /* best match length so far */ + int best_len = (int)s->prev_length; /* best match length so far */ int nice_match = s->nice_match; /* stop if match long enough */ IPos limit = s->strstart > (IPos)MAX_DIST(s) ? s->strstart - (IPos)MAX_DIST(s) : NIL; @@ -1188,7 +1276,7 @@ local uInt longest_match(s, cur_match) /* Do not look for matches beyond the end of the input. This is necessary * to make deflate deterministic. */ - if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; + if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead; Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); @@ -1349,7 +1437,11 @@ local uInt longest_match(s, cur_match) #endif /* FASTEST */ -#ifdef DEBUG +#ifdef ZLIB_DEBUG + +#define EQUAL 0 +/* result of memcmp for equal strings */ + /* =========================================================================== * Check that the match at match_start is indeed a match. */ @@ -1375,7 +1467,7 @@ local void check_match(s, start, match, length) } #else # define check_match(s, start, match, length) -#endif /* DEBUG */ +#endif /* ZLIB_DEBUG */ /* =========================================================================== * Fill the window when the lookahead becomes insufficient. @@ -1390,8 +1482,7 @@ local void check_match(s, start, match, length) local void fill_window(s) deflate_state *s; { - register unsigned n, m; - register Posf *p; + unsigned n; unsigned more; /* Amount of free space at the end of the window. */ uInt wsize = s->w_size; @@ -1418,35 +1509,11 @@ local void fill_window(s) */ if (s->strstart >= wsize+MAX_DIST(s)) { - zmemcpy(s->window, s->window+wsize, (unsigned)wsize); + zmemcpy(s->window, s->window+wsize, (unsigned)wsize - more); s->match_start -= wsize; s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ s->block_start -= (long) wsize; - - /* Slide the hash table (could be avoided with 32 bit values - at the expense of memory usage). We slide even when level == 0 - to keep the hash table consistent if we switch back to level > 0 - later. (Using level 0 permanently is not an optimal usage of - zlib, so we don't care about this pathological case.) - */ - n = s->hash_size; - p = &s->head[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m-wsize : NIL); - } while (--n); - - n = wsize; -#ifndef FASTEST - p = &s->prev[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m-wsize : NIL); - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - } while (--n); -#endif + slide_hash(s); more += wsize; } if (s->strm->avail_in == 0) break; @@ -1552,70 +1619,199 @@ local void fill_window(s) if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \ } +/* Maximum stored block length in deflate format (not including header). */ +#define MAX_STORED 65535 + +/* Minimum of a and b. */ +#define MIN(a, b) ((a) > (b) ? (b) : (a)) + /* =========================================================================== * Copy without compression as much as possible from the input stream, return * the current block state. - * This function does not insert new strings in the dictionary since - * uncompressible data is probably not useful. This function is used - * only for the level=0 compression option. - * NOTE: this function should be optimized to avoid extra copying from - * window to pending_buf. + * + * In case deflateParams() is used to later switch to a non-zero compression + * level, s->matches (otherwise unused when storing) keeps track of the number + * of hash table slides to perform. If s->matches is 1, then one hash table + * slide will be done when switching. If s->matches is 2, the maximum value + * allowed here, then the hash table will be cleared, since two or more slides + * is the same as a clear. + * + * deflate_stored() is written to minimize the number of times an input byte is + * copied. It is most efficient with large input and output buffers, which + * maximizes the opportunites to have a single copy from next_in to next_out. */ local block_state deflate_stored(s, flush) deflate_state *s; int flush; { - /* Stored blocks are limited to 0xffff bytes, pending_buf is limited - * to pending_buf_size, and each stored block has a 5 byte header: + /* Smallest worthy block size when not flushing or finishing. By default + * this is 32K. This can be as small as 507 bytes for memLevel == 1. For + * large input and output buffers, the stored block size will be larger. */ - ulg max_block_size = 0xffff; - ulg max_start; - - if (max_block_size > s->pending_buf_size - 5) { - max_block_size = s->pending_buf_size - 5; - } + unsigned min_block = MIN(s->pending_buf_size - 5, s->w_size); - /* Copy as much as possible from input to output: */ - for (;;) { - /* Fill the window as much as possible: */ - if (s->lookahead <= 1) { - - Assert(s->strstart < s->w_size+MAX_DIST(s) || - s->block_start >= (long)s->w_size, "slide too late"); + /* Copy as many min_block or larger stored blocks directly to next_out as + * possible. If flushing, copy the remaining available input to next_out as + * stored blocks, if there is enough space. + */ + unsigned len, left, have, last = 0; + unsigned used = s->strm->avail_in; + do { + /* Set len to the maximum size block that we can copy directly with the + * available input data and output space. Set left to how much of that + * would be copied from what's left in the window. + */ + len = MAX_STORED; /* maximum deflate stored block length */ + have = (s->bi_valid + 42) >> 3; /* number of header bytes */ + if (s->strm->avail_out < have) /* need room for header */ + break; + /* maximum stored block length that will fit in avail_out: */ + have = s->strm->avail_out - have; + left = s->strstart - s->block_start; /* bytes left in window */ + if (len > (ulg)left + s->strm->avail_in) + len = left + s->strm->avail_in; /* limit len to the input */ + if (len > have) + len = have; /* limit len to the output */ + + /* If the stored block would be less than min_block in length, or if + * unable to copy all of the available input when flushing, then try + * copying to the window and the pending buffer instead. Also don't + * write an empty block when flushing -- deflate() does that. + */ + if (len < min_block && ((len == 0 && flush != Z_FINISH) || + flush == Z_NO_FLUSH || + len != left + s->strm->avail_in)) + break; - fill_window(s); - if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more; + /* Make a dummy stored block in pending to get the header bytes, + * including any pending bits. This also updates the debugging counts. + */ + last = flush == Z_FINISH && len == left + s->strm->avail_in ? 1 : 0; + _tr_stored_block(s, (char *)0, 0L, last); + + /* Replace the lengths in the dummy stored block with len. */ + s->pending_buf[s->pending - 4] = len; + s->pending_buf[s->pending - 3] = len >> 8; + s->pending_buf[s->pending - 2] = ~len; + s->pending_buf[s->pending - 1] = ~len >> 8; + + /* Write the stored block header bytes. */ + flush_pending(s->strm); + +#ifdef ZLIB_DEBUG + /* Update debugging counts for the data about to be copied. */ + s->compressed_len += len << 3; + s->bits_sent += len << 3; +#endif - if (s->lookahead == 0) break; /* flush the current block */ + /* Copy uncompressed bytes from the window to next_out. */ + if (left) { + if (left > len) + left = len; + zmemcpy(s->strm->next_out, s->window + s->block_start, left); + s->strm->next_out += left; + s->strm->avail_out -= left; + s->strm->total_out += left; + s->block_start += left; + len -= left; } - Assert(s->block_start >= 0L, "block gone"); - - s->strstart += s->lookahead; - s->lookahead = 0; - - /* Emit a stored block if pending_buf will be full: */ - max_start = s->block_start + max_block_size; - if (s->strstart == 0 || (ulg)s->strstart >= max_start) { - /* strstart == 0 is possible when wraparound on 16-bit machine */ - s->lookahead = (uInt)(s->strstart - max_start); - s->strstart = (uInt)max_start; - FLUSH_BLOCK(s, 0); + + /* Copy uncompressed bytes directly from next_in to next_out, updating + * the check value. + */ + if (len) { + read_buf(s->strm, s->strm->next_out, len); + s->strm->next_out += len; + s->strm->avail_out -= len; + s->strm->total_out += len; } - /* Flush if we may have to slide, otherwise block_start may become - * negative and the data will be gone: + } while (last == 0); + + /* Update the sliding window with the last s->w_size bytes of the copied + * data, or append all of the copied data to the existing window if less + * than s->w_size bytes were copied. Also update the number of bytes to + * insert in the hash tables, in the event that deflateParams() switches to + * a non-zero compression level. + */ + used -= s->strm->avail_in; /* number of input bytes directly copied */ + if (used) { + /* If any input was used, then no unused input remains in the window, + * therefore s->block_start == s->strstart. */ - if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) { - FLUSH_BLOCK(s, 0); + if (used >= s->w_size) { /* supplant the previous history */ + s->matches = 2; /* clear hash */ + zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size); + s->strstart = s->w_size; } + else { + if (s->window_size - s->strstart <= used) { + /* Slide the window down. */ + s->strstart -= s->w_size; + zmemcpy(s->window, s->window + s->w_size, s->strstart); + if (s->matches < 2) + s->matches++; /* add a pending slide_hash() */ + } + zmemcpy(s->window + s->strstart, s->strm->next_in - used, used); + s->strstart += used; + } + s->block_start = s->strstart; + s->insert += MIN(used, s->w_size - s->insert); } - s->insert = 0; - if (flush == Z_FINISH) { - FLUSH_BLOCK(s, 1); + if (s->high_water < s->strstart) + s->high_water = s->strstart; + + /* If the last block was written to next_out, then done. */ + if (last) return finish_done; + + /* If flushing and all input has been consumed, then done. */ + if (flush != Z_NO_FLUSH && flush != Z_FINISH && + s->strm->avail_in == 0 && (long)s->strstart == s->block_start) + return block_done; + + /* Fill the window with any remaining input. */ + have = s->window_size - s->strstart - 1; + if (s->strm->avail_in > have && s->block_start >= (long)s->w_size) { + /* Slide the window down. */ + s->block_start -= s->w_size; + s->strstart -= s->w_size; + zmemcpy(s->window, s->window + s->w_size, s->strstart); + if (s->matches < 2) + s->matches++; /* add a pending slide_hash() */ + have += s->w_size; /* more space now */ } - if ((long)s->strstart > s->block_start) - FLUSH_BLOCK(s, 0); - return block_done; + if (have > s->strm->avail_in) + have = s->strm->avail_in; + if (have) { + read_buf(s->strm, s->window + s->strstart, have); + s->strstart += have; + } + if (s->high_water < s->strstart) + s->high_water = s->strstart; + + /* There was not enough avail_out to write a complete worthy or flushed + * stored block to next_out. Write a stored block to pending instead, if we + * have enough input for a worthy block, or if flushing and there is enough + * room for the remaining input as a stored block in the pending buffer. + */ + have = (s->bi_valid + 42) >> 3; /* number of header bytes */ + /* maximum stored block length that will fit in pending: */ + have = MIN(s->pending_buf_size - have, MAX_STORED); + min_block = MIN(have, s->w_size); + left = s->strstart - s->block_start; + if (left >= min_block || + ((left || flush == Z_FINISH) && flush != Z_NO_FLUSH && + s->strm->avail_in == 0 && left <= have)) { + len = MIN(left, have); + last = flush == Z_FINISH && s->strm->avail_in == 0 && + len == left ? 1 : 0; + _tr_stored_block(s, (charf *)s->window + s->block_start, len, last); + s->block_start += len; + flush_pending(s->strm); + } + + /* We've done all we can with the available input and output. */ + return last ? finish_started : need_more; } /* =========================================================================== @@ -1892,7 +2088,7 @@ local block_state deflate_rle(s, flush) prev == *++scan && prev == *++scan && prev == *++scan && prev == *++scan && scan < strend); - s->match_length = MAX_MATCH - (int)(strend - scan); + s->match_length = MAX_MATCH - (uInt)(strend - scan); if (s->match_length > s->lookahead) s->match_length = s->lookahead; } diff --git a/tcod_sys/libtcod/src/zlib/deflate.h b/tcod_sys/libtcod/src/vendor/zlib/deflate.h similarity index 92% rename from tcod_sys/libtcod/src/zlib/deflate.h rename to tcod_sys/libtcod/src/vendor/zlib/deflate.h index ce0299edd..23ecdd312 100644 --- a/tcod_sys/libtcod/src/zlib/deflate.h +++ b/tcod_sys/libtcod/src/vendor/zlib/deflate.h @@ -1,5 +1,5 @@ /* deflate.h -- internal compression state - * Copyright (C) 1995-2012 Jean-loup Gailly + * Copyright (C) 1995-2016 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -51,13 +51,16 @@ #define Buf_size 16 /* size of bit buffer in bi_buf */ -#define INIT_STATE 42 -#define EXTRA_STATE 69 -#define NAME_STATE 73 -#define COMMENT_STATE 91 -#define HCRC_STATE 103 -#define BUSY_STATE 113 -#define FINISH_STATE 666 +#define INIT_STATE 42 /* zlib header -> BUSY_STATE */ +#ifdef GZIP +# define GZIP_STATE 57 /* gzip header -> BUSY_STATE | EXTRA_STATE */ +#endif +#define EXTRA_STATE 69 /* gzip extra block -> NAME_STATE */ +#define NAME_STATE 73 /* gzip file name -> COMMENT_STATE */ +#define COMMENT_STATE 91 /* gzip comment -> HCRC_STATE */ +#define HCRC_STATE 103 /* gzip header CRC -> BUSY_STATE */ +#define BUSY_STATE 113 /* deflate -> FINISH_STATE */ +#define FINISH_STATE 666 /* stream complete */ /* Stream status */ @@ -83,7 +86,7 @@ typedef struct static_tree_desc_s static_tree_desc; typedef struct tree_desc_s { ct_data *dyn_tree; /* the dynamic tree */ int max_code; /* largest code with non zero frequency */ - static_tree_desc *stat_desc; /* the corresponding static tree */ + const static_tree_desc *stat_desc; /* the corresponding static tree */ } FAR tree_desc; typedef ush Pos; @@ -100,10 +103,10 @@ typedef struct internal_state { Bytef *pending_buf; /* output still pending */ ulg pending_buf_size; /* size of pending_buf */ Bytef *pending_out; /* next pending byte to output to the stream */ - uInt pending; /* nb of bytes in the pending buffer */ + ulg pending; /* nb of bytes in the pending buffer */ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ gz_headerp gzhead; /* gzip header information to write */ - uInt gzindex; /* where in extra, name, or comment */ + ulg gzindex; /* where in extra, name, or comment */ Byte method; /* can only be DEFLATED */ int last_flush; /* value of flush param for previous deflate call */ @@ -249,7 +252,7 @@ typedef struct internal_state { uInt matches; /* number of string matches in current block */ uInt insert; /* bytes at end of window left to insert */ -#ifdef DEBUG +#ifdef ZLIB_DEBUG ulg compressed_len; /* total bit length of compressed file mod 2^32 */ ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ #endif @@ -275,7 +278,7 @@ typedef struct internal_state { /* Output a byte on the stream. * IN assertion: there is enough room in pending_buf. */ -#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} +#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);} #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) @@ -309,7 +312,7 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, * used. */ -#ifndef DEBUG +#ifndef ZLIB_DEBUG /* Inline versions of _tr_tally for speed: */ #if defined(GEN_TREES_H) || !defined(STDC) @@ -328,8 +331,8 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, flush = (s->last_lit == s->lit_bufsize-1); \ } # define _tr_tally_dist(s, distance, length, flush) \ - { uch len = (length); \ - ush dist = (distance); \ + { uch len = (uch)(length); \ + ush dist = (ush)(distance); \ s->d_buf[s->last_lit] = dist; \ s->l_buf[s->last_lit++] = len; \ dist--; \ diff --git a/tcod_sys/libtcod/src/zlib/gzclose.c b/tcod_sys/libtcod/src/vendor/zlib/gzclose.c similarity index 100% rename from tcod_sys/libtcod/src/zlib/gzclose.c rename to tcod_sys/libtcod/src/vendor/zlib/gzclose.c diff --git a/tcod_sys/libtcod/src/zlib/gzguts.h b/tcod_sys/libtcod/src/vendor/zlib/gzguts.h similarity index 89% rename from tcod_sys/libtcod/src/zlib/gzguts.h rename to tcod_sys/libtcod/src/vendor/zlib/gzguts.h index d87659d03..990a4d251 100644 --- a/tcod_sys/libtcod/src/zlib/gzguts.h +++ b/tcod_sys/libtcod/src/vendor/zlib/gzguts.h @@ -1,5 +1,5 @@ /* gzguts.h -- zlib internal header definitions for gz* operations - * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler + * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -25,6 +25,10 @@ # include # include #endif + +#ifndef _POSIX_SOURCE +# define _POSIX_SOURCE +#endif #include #ifdef _WIN32 @@ -35,6 +39,10 @@ # include #endif +#if defined(_WIN32) || defined(__CYGWIN__) +# define WIDECHAR +#endif + #ifdef WINAPI_FAMILY # define open _open # define read _read @@ -95,18 +103,19 @@ # endif #endif -/* unlike snprintf (which is required in C99, yet still not supported by - Microsoft more than a decade later!), _snprintf does not guarantee null - termination of the result -- however this is only used in gzlib.c where +/* unlike snprintf (which is required in C99), _snprintf does not guarantee + null termination of the result -- however this is only used in gzlib.c where the result is assured to fit in the space provided */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER < 1900 # define snprintf _snprintf #endif #ifndef local # define local static #endif -/* compile with -Dlocal if your debugger can't find static symbols */ +/* since "static" is used to mean two completely different things in C, we + define "local" for the non-static meaning of "static", for readability + (compile with -Dlocal if your debugger can't find static symbols) */ /* gz* functions always use library allocation functions */ #ifndef STDC @@ -170,7 +179,7 @@ typedef struct { char *path; /* path or fd for error messages */ unsigned size; /* buffer size, zero if not allocated yet */ unsigned want; /* requested buffer size, default is GZBUFSIZE */ - unsigned char *in; /* input buffer */ + unsigned char *in; /* input buffer (double-sized when writing) */ unsigned char *out; /* output buffer (double-sized when reading) */ int direct; /* 0 if processing gzip, 1 if transparent */ /* just for reading */ diff --git a/tcod_sys/libtcod/src/zlib/gzlib.c b/tcod_sys/libtcod/src/vendor/zlib/gzlib.c similarity index 95% rename from tcod_sys/libtcod/src/zlib/gzlib.c rename to tcod_sys/libtcod/src/vendor/zlib/gzlib.c index fae202ef8..4105e6aff 100644 --- a/tcod_sys/libtcod/src/zlib/gzlib.c +++ b/tcod_sys/libtcod/src/vendor/zlib/gzlib.c @@ -1,11 +1,11 @@ /* gzlib.c -- zlib functions common to reading and writing gzip files - * Copyright (C) 2004, 2010, 2011, 2012, 2013 Mark Adler + * Copyright (C) 2004-2017 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "gzguts.h" -#if defined(_WIN32) && !defined(__BORLANDC__) +#if defined(_WIN32) && !defined(__BORLANDC__) && !defined(__MINGW32__) # define LSEEK _lseeki64 #else #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 @@ -94,7 +94,7 @@ local gzFile gz_open(path, fd, mode) const char *mode; { gz_statep state; - size_t len; + z_size_t len; int oflag; #ifdef O_CLOEXEC int cloexec = 0; @@ -188,10 +188,10 @@ local gzFile gz_open(path, fd, mode) } /* save the path name for error messages */ -#ifdef _WIN32 +#ifdef WIDECHAR if (fd == -2) { len = wcstombs(NULL, path, 0); - if (len == (size_t)-1) + if (len == (z_size_t)-1) len = 0; } else @@ -202,7 +202,7 @@ local gzFile gz_open(path, fd, mode) free(state); return NULL; } -#ifdef _WIN32 +#ifdef WIDECHAR if (fd == -2) if (len) wcstombs(state->path, path, len + 1); @@ -211,7 +211,7 @@ local gzFile gz_open(path, fd, mode) else #endif #if !defined(NO_snprintf) && !defined(NO_vsnprintf) - snprintf(state->path, len + 1, "%s", (const char *)path); + (void)snprintf(state->path, len + 1, "%s", (const char *)path); #else strcpy(state->path, path); #endif @@ -239,7 +239,7 @@ local gzFile gz_open(path, fd, mode) /* open the file with the appropriate flags (or just use fd) */ state->fd = fd > -1 ? fd : ( -#ifdef _WIN32 +#ifdef WIDECHAR fd == -2 ? _wopen(path, oflag, 0666) : #endif open((const char *)path, oflag, 0666)); @@ -248,8 +248,10 @@ local gzFile gz_open(path, fd, mode) free(state); return NULL; } - if (state->mode == GZ_APPEND) + if (state->mode == GZ_APPEND) { + LSEEK(state->fd, 0, SEEK_END); /* so gzoffset() is correct */ state->mode = GZ_WRITE; /* simplify later checks */ + } /* save the current position for rewinding (only if reading) */ if (state->mode == GZ_READ) { @@ -291,7 +293,7 @@ gzFile ZEXPORT gzdopen(fd, mode) if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL) return NULL; #if !defined(NO_snprintf) && !defined(NO_vsnprintf) - snprintf(path, 7 + 3 * sizeof(int), "", fd); /* for debugging */ + (void)snprintf(path, 7 + 3 * sizeof(int), "", fd); #else sprintf(path, "", fd); /* for debugging */ #endif @@ -301,7 +303,7 @@ gzFile ZEXPORT gzdopen(fd, mode) } /* -- see zlib.h -- */ -#ifdef _WIN32 +#ifdef WIDECHAR gzFile ZEXPORT gzopen_w(path, mode) const wchar_t *path; const char *mode; @@ -329,6 +331,8 @@ int ZEXPORT gzbuffer(file, size) return -1; /* check and set requested size */ + if ((size << 1) < size) + return -1; /* need to be able to double it */ if (size < 2) size = 2; /* need two bytes to check magic header */ state->want = size; @@ -604,14 +608,13 @@ void ZLIB_INTERNAL gz_error(state, err, msg) return; } #if !defined(NO_snprintf) && !defined(NO_vsnprintf) - snprintf(state->msg, strlen(state->path) + strlen(msg) + 3, - "%s%s%s", state->path, ": ", msg); + (void)snprintf(state->msg, strlen(state->path) + strlen(msg) + 3, + "%s%s%s", state->path, ": ", msg); #else strcpy(state->msg, state->path); strcat(state->msg, ": "); strcat(state->msg, msg); #endif - return; } #ifndef INT_MAX diff --git a/tcod_sys/libtcod/src/zlib/gzread.c b/tcod_sys/libtcod/src/vendor/zlib/gzread.c similarity index 85% rename from tcod_sys/libtcod/src/zlib/gzread.c rename to tcod_sys/libtcod/src/vendor/zlib/gzread.c index bf4538eb2..956b91ea7 100644 --- a/tcod_sys/libtcod/src/zlib/gzread.c +++ b/tcod_sys/libtcod/src/vendor/zlib/gzread.c @@ -1,5 +1,5 @@ /* gzread.c -- zlib functions for reading gzip files - * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler + * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -12,6 +12,7 @@ local int gz_look OF((gz_statep)); local int gz_decomp OF((gz_statep)); local int gz_fetch OF((gz_statep)); local int gz_skip OF((gz_statep, z_off64_t)); +local z_size_t gz_read OF((gz_statep, voidp, z_size_t)); /* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from state->fd, and update state->eof, state->err, and state->msg as appropriate. @@ -24,13 +25,17 @@ local int gz_load(state, buf, len, have) unsigned *have; { int ret; + unsigned get, max = ((unsigned)-1 >> 2) + 1; *have = 0; do { - ret = read(state->fd, buf + *have, len - *have); + get = len - *have; + if (get > max) + get = max; + ret = read(state->fd, buf + *have, get); if (ret <= 0) break; - *have += ret; + *have += (unsigned)ret; } while (*have < len); if (ret < 0) { gz_error(state, Z_ERRNO, zstrerror()); @@ -94,10 +99,8 @@ local int gz_look(state) state->in = (unsigned char *)malloc(state->want); state->out = (unsigned char *)malloc(state->want << 1); if (state->in == NULL || state->out == NULL) { - if (state->out != NULL) - free(state->out); - if (state->in != NULL) - free(state->in); + free(state->out); + free(state->in); gz_error(state, Z_MEM_ERROR, "out of memory"); return -1; } @@ -284,33 +287,17 @@ local int gz_skip(state, len) return 0; } -/* -- see zlib.h -- */ -int ZEXPORT gzread(file, buf, len) - gzFile file; +/* Read len bytes into buf from file, or less than len up to the end of the + input. Return the number of bytes read. If zero is returned, either the + end of file was reached, or there was an error. state->err must be + consulted in that case to determine which. */ +local z_size_t gz_read(state, buf, len) + gz_statep state; voidp buf; - unsigned len; + z_size_t len; { - unsigned got, n; - gz_statep state; - z_streamp strm; - - /* get internal structure */ - if (file == NULL) - return -1; - state = (gz_statep)file; - strm = &(state->strm); - - /* check that we're reading and that there's no (serious) error */ - if (state->mode != GZ_READ || - (state->err != Z_OK && state->err != Z_BUF_ERROR)) - return -1; - - /* since an int is returned, make sure len fits in one, otherwise return - with an error (this avoids the flaw in the interface) */ - if ((int)len < 0) { - gz_error(state, Z_DATA_ERROR, "requested length does not fit in int"); - return -1; - } + z_size_t got; + unsigned n; /* if len is zero, avoid unnecessary operations */ if (len == 0) @@ -320,32 +307,38 @@ int ZEXPORT gzread(file, buf, len) if (state->seek) { state->seek = 0; if (gz_skip(state, state->skip) == -1) - return -1; + return 0; } /* get len bytes to buf, or less than len if at the end */ got = 0; do { + /* set n to the maximum amount of len that fits in an unsigned int */ + n = -1; + if (n > len) + n = len; + /* first just try copying data from the output buffer */ if (state->x.have) { - n = state->x.have > len ? len : state->x.have; + if (state->x.have < n) + n = state->x.have; memcpy(buf, state->x.next, n); state->x.next += n; state->x.have -= n; } /* output buffer empty -- return if we're at the end of the input */ - else if (state->eof && strm->avail_in == 0) { + else if (state->eof && state->strm.avail_in == 0) { state->past = 1; /* tried to read past end */ break; } /* need output data -- for small len or new stream load up our output buffer */ - else if (state->how == LOOK || len < (state->size << 1)) { + else if (state->how == LOOK || n < (state->size << 1)) { /* get more output, looking for header if required */ if (gz_fetch(state) == -1) - return -1; + return 0; continue; /* no progress yet -- go back to copy above */ /* the copy above assures that we will leave with space in the output buffer, allowing at least one gzungetc() to succeed */ @@ -353,16 +346,16 @@ int ZEXPORT gzread(file, buf, len) /* large len -- read directly into user buffer */ else if (state->how == COPY) { /* read directly */ - if (gz_load(state, (unsigned char *)buf, len, &n) == -1) - return -1; + if (gz_load(state, (unsigned char *)buf, n, &n) == -1) + return 0; } /* large len -- decompress directly into user buffer */ else { /* state->how == GZIP */ - strm->avail_out = len; - strm->next_out = (unsigned char *)buf; + state->strm.avail_out = n; + state->strm.next_out = (unsigned char *)buf; if (gz_decomp(state) == -1) - return -1; + return 0; n = state->x.have; state->x.have = 0; } @@ -374,8 +367,75 @@ int ZEXPORT gzread(file, buf, len) state->x.pos += n; } while (len); - /* return number of bytes read into user buffer (will fit in int) */ - return (int)got; + /* return number of bytes read into user buffer */ + return got; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzread(file, buf, len) + gzFile file; + voidp buf; + unsigned len; +{ + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + + /* check that we're reading and that there's no (serious) error */ + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) + return -1; + + /* since an int is returned, make sure len fits in one, otherwise return + with an error (this avoids a flaw in the interface) */ + if ((int)len < 0) { + gz_error(state, Z_STREAM_ERROR, "request does not fit in an int"); + return -1; + } + + /* read len or fewer bytes to buf */ + len = gz_read(state, buf, len); + + /* check for an error */ + if (len == 0 && state->err != Z_OK && state->err != Z_BUF_ERROR) + return -1; + + /* return the number of bytes read (this is assured to fit in an int) */ + return (int)len; +} + +/* -- see zlib.h -- */ +z_size_t ZEXPORT gzfread(buf, size, nitems, file) + voidp buf; + z_size_t size; + z_size_t nitems; + gzFile file; +{ + z_size_t len; + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return 0; + state = (gz_statep)file; + + /* check that we're reading and that there's no (serious) error */ + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) + return 0; + + /* compute bytes to read -- error on overflow */ + len = nitems * size; + if (size && len / size != nitems) { + gz_error(state, Z_STREAM_ERROR, "request does not fit in a size_t"); + return 0; + } + + /* read len or fewer bytes to buf, return the number of full items read */ + return len ? gz_read(state, buf, len) / size : 0; } /* -- see zlib.h -- */ @@ -408,8 +468,8 @@ int ZEXPORT gzgetc(file) return *(state->x.next)++; } - /* nothing there -- try gzread() */ - ret = gzread(file, buf, 1); + /* nothing there -- try gz_read() */ + ret = gz_read(state, buf, 1); return ret < 1 ? -1 : buf[0]; } @@ -451,7 +511,7 @@ int ZEXPORT gzungetc(c, file) if (state->x.have == 0) { state->x.have = 1; state->x.next = state->out + (state->size << 1) - 1; - state->x.next[0] = c; + state->x.next[0] = (unsigned char)c; state->x.pos--; state->past = 0; return c; @@ -473,7 +533,7 @@ int ZEXPORT gzungetc(c, file) } state->x.have++; state->x.next--; - state->x.next[0] = c; + state->x.next[0] = (unsigned char)c; state->x.pos--; state->past = 0; return c; diff --git a/tcod_sys/libtcod/src/zlib/gzwrite.c b/tcod_sys/libtcod/src/vendor/zlib/gzwrite.c similarity index 63% rename from tcod_sys/libtcod/src/zlib/gzwrite.c rename to tcod_sys/libtcod/src/vendor/zlib/gzwrite.c index aa767fbf6..c7b5651d7 100644 --- a/tcod_sys/libtcod/src/zlib/gzwrite.c +++ b/tcod_sys/libtcod/src/vendor/zlib/gzwrite.c @@ -1,5 +1,5 @@ /* gzwrite.c -- zlib functions for writing gzip files - * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler + * Copyright (C) 2004-2017 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,17 +9,19 @@ local int gz_init OF((gz_statep)); local int gz_comp OF((gz_statep, int)); local int gz_zero OF((gz_statep, z_off64_t)); +local z_size_t gz_write OF((gz_statep, voidpc, z_size_t)); /* Initialize state for writing a gzip file. Mark initialization by setting - state->size to non-zero. Return -1 on failure or 0 on success. */ + state->size to non-zero. Return -1 on a memory allocation failure, or 0 on + success. */ local int gz_init(state) gz_statep state; { int ret; z_streamp strm = &(state->strm); - /* allocate input buffer */ - state->in = (unsigned char *)malloc(state->want); + /* allocate input buffer (double size for gzprintf) */ + state->in = (unsigned char *)malloc(state->want << 1); if (state->in == NULL) { gz_error(state, Z_MEM_ERROR, "out of memory"); return -1; @@ -47,6 +49,7 @@ local int gz_init(state) gz_error(state, Z_MEM_ERROR, "out of memory"); return -1; } + strm->next_in = NULL; } /* mark state as initialized */ @@ -62,17 +65,17 @@ local int gz_init(state) } /* Compress whatever is at avail_in and next_in and write to the output file. - Return -1 if there is an error writing to the output file, otherwise 0. - flush is assumed to be a valid deflate() flush value. If flush is Z_FINISH, - then the deflate() state is reset to start a new gzip stream. If gz->direct - is true, then simply write to the output file without compressing, and - ignore flush. */ + Return -1 if there is an error writing to the output file or if gz_init() + fails to allocate memory, otherwise 0. flush is assumed to be a valid + deflate() flush value. If flush is Z_FINISH, then the deflate() state is + reset to start a new gzip stream. If gz->direct is true, then simply write + to the output file without compressing, and ignore flush. */ local int gz_comp(state, flush) gz_statep state; int flush; { - int ret, got; - unsigned have; + int ret, writ; + unsigned have, put, max = ((unsigned)-1 >> 2) + 1; z_streamp strm = &(state->strm); /* allocate memory if this is the first time through */ @@ -81,12 +84,16 @@ local int gz_comp(state, flush) /* write directly if requested */ if (state->direct) { - got = write(state->fd, strm->next_in, strm->avail_in); - if (got < 0 || (unsigned)got != strm->avail_in) { - gz_error(state, Z_ERRNO, zstrerror()); - return -1; + while (strm->avail_in) { + put = strm->avail_in > max ? max : strm->avail_in; + writ = write(state->fd, strm->next_in, put); + if (writ < 0) { + gz_error(state, Z_ERRNO, zstrerror()); + return -1; + } + strm->avail_in -= (unsigned)writ; + strm->next_in += writ; } - strm->avail_in = 0; return 0; } @@ -97,17 +104,21 @@ local int gz_comp(state, flush) doing Z_FINISH then don't write until we get to Z_STREAM_END */ if (strm->avail_out == 0 || (flush != Z_NO_FLUSH && (flush != Z_FINISH || ret == Z_STREAM_END))) { - have = (unsigned)(strm->next_out - state->x.next); - if (have && ((got = write(state->fd, state->x.next, have)) < 0 || - (unsigned)got != have)) { - gz_error(state, Z_ERRNO, zstrerror()); - return -1; + while (strm->next_out > state->x.next) { + put = strm->next_out - state->x.next > (int)max ? max : + (unsigned)(strm->next_out - state->x.next); + writ = write(state->fd, state->x.next, put); + if (writ < 0) { + gz_error(state, Z_ERRNO, zstrerror()); + return -1; + } + state->x.next += writ; } if (strm->avail_out == 0) { strm->avail_out = state->size; strm->next_out = state->out; + state->x.next = state->out; } - state->x.next = strm->next_out; } /* compress */ @@ -129,7 +140,8 @@ local int gz_comp(state, flush) return 0; } -/* Compress len zeros to output. Return -1 on error, 0 on success. */ +/* Compress len zeros to output. Return -1 on a write error or memory + allocation failure by gz_comp(), or 0 on success. */ local int gz_zero(state, len) gz_statep state; z_off64_t len; @@ -161,32 +173,14 @@ local int gz_zero(state, len) return 0; } -/* -- see zlib.h -- */ -int ZEXPORT gzwrite(file, buf, len) - gzFile file; +/* Write len bytes from buf to file. Return the number of bytes written. If + the returned value is less than len, then there was an error. */ +local z_size_t gz_write(state, buf, len) + gz_statep state; voidpc buf; - unsigned len; + z_size_t len; { - unsigned put = len; - gz_statep state; - z_streamp strm; - - /* get internal structure */ - if (file == NULL) - return 0; - state = (gz_statep)file; - strm = &(state->strm); - - /* check that we're writing and that there's no error */ - if (state->mode != GZ_WRITE || state->err != Z_OK) - return 0; - - /* since an int is returned, make sure len fits in one, otherwise return - with an error (this avoids the flaw in the interface) */ - if ((int)len < 0) { - gz_error(state, Z_DATA_ERROR, "requested length does not fit in int"); - return 0; - } + z_size_t put = len; /* if len is zero, avoid unnecessary operations */ if (len == 0) @@ -209,14 +203,15 @@ int ZEXPORT gzwrite(file, buf, len) do { unsigned have, copy; - if (strm->avail_in == 0) - strm->next_in = state->in; - have = (unsigned)((strm->next_in + strm->avail_in) - state->in); + if (state->strm.avail_in == 0) + state->strm.next_in = state->in; + have = (unsigned)((state->strm.next_in + state->strm.avail_in) - + state->in); copy = state->size - have; if (copy > len) copy = len; memcpy(state->in + have, buf, copy); - strm->avail_in += copy; + state->strm.avail_in += copy; state->x.pos += copy; buf = (const char *)buf + copy; len -= copy; @@ -226,19 +221,83 @@ int ZEXPORT gzwrite(file, buf, len) } else { /* consume whatever's left in the input buffer */ - if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1) + if (state->strm.avail_in && gz_comp(state, Z_NO_FLUSH) == -1) return 0; /* directly compress user buffer to file */ - strm->avail_in = len; - strm->next_in = (z_const Bytef *)buf; - state->x.pos += len; - if (gz_comp(state, Z_NO_FLUSH) == -1) - return 0; + state->strm.next_in = (z_const Bytef *)buf; + do { + unsigned n = (unsigned)-1; + if (n > len) + n = len; + state->strm.avail_in = n; + state->x.pos += n; + if (gz_comp(state, Z_NO_FLUSH) == -1) + return 0; + len -= n; + } while (len); + } + + /* input was all buffered or compressed */ + return put; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzwrite(file, buf, len) + gzFile file; + voidpc buf; + unsigned len; +{ + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return 0; + state = (gz_statep)file; + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return 0; + + /* since an int is returned, make sure len fits in one, otherwise return + with an error (this avoids a flaw in the interface) */ + if ((int)len < 0) { + gz_error(state, Z_DATA_ERROR, "requested length does not fit in int"); + return 0; + } + + /* write len bytes from buf (the return value will fit in an int) */ + return (int)gz_write(state, buf, len); +} + +/* -- see zlib.h -- */ +z_size_t ZEXPORT gzfwrite(buf, size, nitems, file) + voidpc buf; + z_size_t size; + z_size_t nitems; + gzFile file; +{ + z_size_t len; + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return 0; + state = (gz_statep)file; + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return 0; + + /* compute bytes to read -- error on overflow */ + len = nitems * size; + if (size && len / size != nitems) { + gz_error(state, Z_STREAM_ERROR, "request does not fit in a size_t"); + return 0; } - /* input was all buffered or compressed (put will fit in int) */ - return (int)put; + /* write len bytes to buf, return the number of full items written */ + return len ? gz_write(state, buf, len) / size : 0; } /* -- see zlib.h -- */ @@ -275,7 +334,7 @@ int ZEXPORT gzputc(file, c) strm->next_in = state->in; have = (unsigned)((strm->next_in + strm->avail_in) - state->in); if (have < state->size) { - state->in[have] = c; + state->in[have] = (unsigned char)c; strm->avail_in++; state->x.pos++; return c & 0xff; @@ -283,8 +342,8 @@ int ZEXPORT gzputc(file, c) } /* no room in buffer or not initialized, use gz_write() */ - buf[0] = c; - if (gzwrite(file, buf, 1) != 1) + buf[0] = (unsigned char)c; + if (gz_write(state, buf, 1) != 1) return -1; return c & 0xff; } @@ -295,11 +354,21 @@ int ZEXPORT gzputs(file, str) const char *str; { int ret; - unsigned len; + z_size_t len; + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return -1; /* write string */ - len = (unsigned)strlen(str); - ret = gzwrite(file, str, len); + len = strlen(str); + ret = gz_write(state, str, len); return ret == 0 && len != 0 ? -1 : ret; } @@ -309,63 +378,73 @@ int ZEXPORT gzputs(file, str) /* -- see zlib.h -- */ int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) { - int size, len; + int len; + unsigned left; + char *next; gz_statep state; z_streamp strm; /* get internal structure */ if (file == NULL) - return -1; + return Z_STREAM_ERROR; state = (gz_statep)file; strm = &(state->strm); /* check that we're writing and that there's no error */ if (state->mode != GZ_WRITE || state->err != Z_OK) - return 0; + return Z_STREAM_ERROR; /* make sure we have some buffer space */ if (state->size == 0 && gz_init(state) == -1) - return 0; + return state->err; /* check for seek request */ if (state->seek) { state->seek = 0; if (gz_zero(state, state->skip) == -1) - return 0; + return state->err; } - /* consume whatever's left in the input buffer */ - if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1) - return 0; - - /* do the printf() into the input buffer, put length in len */ - size = (int)(state->size); - state->in[size - 1] = 0; + /* do the printf() into the input buffer, put length in len -- the input + buffer is double-sized just for this function, so there is guaranteed to + be state->size bytes available after the current contents */ + if (strm->avail_in == 0) + strm->next_in = state->in; + next = (char *)(state->in + (strm->next_in - state->in) + strm->avail_in); + next[state->size - 1] = 0; #ifdef NO_vsnprintf # ifdef HAS_vsprintf_void - (void)vsprintf((char *)(state->in), format, va); - for (len = 0; len < size; len++) - if (state->in[len] == 0) break; + (void)vsprintf(next, format, va); + for (len = 0; len < state->size; len++) + if (next[len] == 0) break; # else - len = vsprintf((char *)(state->in), format, va); + len = vsprintf(next, format, va); # endif #else # ifdef HAS_vsnprintf_void - (void)vsnprintf((char *)(state->in), size, format, va); - len = strlen((char *)(state->in)); + (void)vsnprintf(next, state->size, format, va); + len = strlen(next); # else - len = vsnprintf((char *)(state->in), size, format, va); + len = vsnprintf(next, state->size, format, va); # endif #endif /* check that printf() results fit in buffer */ - if (len <= 0 || len >= (int)size || state->in[size - 1] != 0) + if (len == 0 || (unsigned)len >= state->size || next[state->size - 1] != 0) return 0; - /* update buffer and position, defer compression until needed */ - strm->avail_in = (unsigned)len; - strm->next_in = state->in; + /* update buffer and position, compress first half if past that */ + strm->avail_in += (unsigned)len; state->x.pos += len; + if (strm->avail_in >= state->size) { + left = strm->avail_in - state->size; + strm->avail_in = state->size; + if (gz_comp(state, Z_NO_FLUSH) == -1) + return state->err; + memcpy(state->in, state->in + state->size, left); + strm->next_in = state->in; + strm->avail_in = left; + } return len; } @@ -390,73 +469,82 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20; { - int size, len; + unsigned len, left; + char *next; gz_statep state; z_streamp strm; /* get internal structure */ if (file == NULL) - return -1; + return Z_STREAM_ERROR; state = (gz_statep)file; strm = &(state->strm); /* check that can really pass pointer in ints */ if (sizeof(int) != sizeof(void *)) - return 0; + return Z_STREAM_ERROR; /* check that we're writing and that there's no error */ if (state->mode != GZ_WRITE || state->err != Z_OK) - return 0; + return Z_STREAM_ERROR; /* make sure we have some buffer space */ if (state->size == 0 && gz_init(state) == -1) - return 0; + return state->error; /* check for seek request */ if (state->seek) { state->seek = 0; if (gz_zero(state, state->skip) == -1) - return 0; + return state->error; } - /* consume whatever's left in the input buffer */ - if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1) - return 0; - - /* do the printf() into the input buffer, put length in len */ - size = (int)(state->size); - state->in[size - 1] = 0; + /* do the printf() into the input buffer, put length in len -- the input + buffer is double-sized just for this function, so there is guaranteed to + be state->size bytes available after the current contents */ + if (strm->avail_in == 0) + strm->next_in = state->in; + next = (char *)(strm->next_in + strm->avail_in); + next[state->size - 1] = 0; #ifdef NO_snprintf # ifdef HAS_sprintf_void - sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); + sprintf(next, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, + a13, a14, a15, a16, a17, a18, a19, a20); for (len = 0; len < size; len++) - if (state->in[len] == 0) break; + if (next[len] == 0) + break; # else - len = sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); + len = sprintf(next, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, + a12, a13, a14, a15, a16, a17, a18, a19, a20); # endif #else # ifdef HAS_snprintf_void - snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); - len = strlen((char *)(state->in)); + snprintf(next, state->size, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); + len = strlen(next); # else - len = snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6, - a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, - a19, a20); + len = snprintf(next, state->size, format, a1, a2, a3, a4, a5, a6, a7, a8, + a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); # endif #endif /* check that printf() results fit in buffer */ - if (len <= 0 || len >= (int)size || state->in[size - 1] != 0) + if (len == 0 || len >= state->size || next[state->size - 1] != 0) return 0; - /* update buffer and position, defer compression until needed */ - strm->avail_in = (unsigned)len; - strm->next_in = state->in; + /* update buffer and position, compress first half if past that */ + strm->avail_in += len; state->x.pos += len; - return len; + if (strm->avail_in >= state->size) { + left = strm->avail_in - state->size; + strm->avail_in = state->size; + if (gz_comp(state, Z_NO_FLUSH) == -1) + return state->err; + memcpy(state->in, state->in + state->size, left); + strm->next_in = state->in; + strm->avail_in = left; + } + return (int)len; } #endif @@ -470,7 +558,7 @@ int ZEXPORT gzflush(file, flush) /* get internal structure */ if (file == NULL) - return -1; + return Z_STREAM_ERROR; state = (gz_statep)file; /* check that we're writing and that there's no error */ @@ -485,11 +573,11 @@ int ZEXPORT gzflush(file, flush) if (state->seek) { state->seek = 0; if (gz_zero(state, state->skip) == -1) - return -1; + return state->err; } /* compress remaining data with requested flush */ - gz_comp(state, flush); + (void)gz_comp(state, flush); return state->err; } @@ -520,13 +608,13 @@ int ZEXPORT gzsetparams(file, level, strategy) if (state->seek) { state->seek = 0; if (gz_zero(state, state->skip) == -1) - return -1; + return state->err; } /* change compression parameters for subsequent input */ if (state->size) { /* flush previous input with previous parameters before changing */ - if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1) + if (strm->avail_in && gz_comp(state, Z_BLOCK) == -1) return state->err; deflateParams(strm, level, strategy); } diff --git a/tcod_sys/libtcod/src/zlib/infback.c b/tcod_sys/libtcod/src/vendor/zlib/infback.c similarity index 99% rename from tcod_sys/libtcod/src/zlib/infback.c rename to tcod_sys/libtcod/src/vendor/zlib/infback.c index f3833c2e4..59679ecbf 100644 --- a/tcod_sys/libtcod/src/zlib/infback.c +++ b/tcod_sys/libtcod/src/vendor/zlib/infback.c @@ -1,5 +1,5 @@ /* infback.c -- inflate using a call-back interface - * Copyright (C) 1995-2011 Mark Adler + * Copyright (C) 1995-2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -61,7 +61,7 @@ int stream_size; Tracev((stderr, "inflate: allocated\n")); strm->state = (struct internal_state FAR *)state; state->dmax = 32768U; - state->wbits = windowBits; + state->wbits = (uInt)windowBits; state->wsize = 1U << windowBits; state->window = window; state->wnext = 0; diff --git a/tcod_sys/libtcod/src/zlib/inffast.c b/tcod_sys/libtcod/src/vendor/zlib/inffast.c similarity index 85% rename from tcod_sys/libtcod/src/zlib/inffast.c rename to tcod_sys/libtcod/src/vendor/zlib/inffast.c index bda59ceb6..0dbd1dbc0 100644 --- a/tcod_sys/libtcod/src/zlib/inffast.c +++ b/tcod_sys/libtcod/src/vendor/zlib/inffast.c @@ -1,5 +1,5 @@ /* inffast.c -- fast decoding - * Copyright (C) 1995-2008, 2010, 2013 Mark Adler + * Copyright (C) 1995-2017 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -8,26 +8,9 @@ #include "inflate.h" #include "inffast.h" -#ifndef ASMINF - -/* Allow machine dependent optimization for post-increment or pre-increment. - Based on testing to date, - Pre-increment preferred for: - - PowerPC G3 (Adler) - - MIPS R5000 (Randers-Pehrson) - Post-increment preferred for: - - none - No measurable difference: - - Pentium III (Anderson) - - M68060 (Nikl) - */ -#ifdef POSTINC -# define OFF 0 -# define PUP(a) *(a)++ +#ifdef ASMINF +# pragma message("Assembler code may have bugs -- use at your own risk") #else -# define OFF 1 -# define PUP(a) *++(a) -#endif /* Decode literal, length, and distance codes and write out the resulting @@ -96,9 +79,9 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ /* copy state to local variables */ state = (struct inflate_state FAR *)strm->state; - in = strm->next_in - OFF; + in = strm->next_in; last = in + (strm->avail_in - 5); - out = strm->next_out - OFF; + out = strm->next_out; beg = out - (start - strm->avail_out); end = out + (strm->avail_out - 257); #ifdef INFLATE_STRICT @@ -119,9 +102,9 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ input data or output space */ do { if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; } here = lcode[hold & lmask]; @@ -134,14 +117,14 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? "inflate: literal '%c'\n" : "inflate: literal 0x%02x\n", here.val)); - PUP(out) = (unsigned char)(here.val); + *out++ = (unsigned char)(here.val); } else if (op & 16) { /* length base */ len = (unsigned)(here.val); op &= 15; /* number of extra bits */ if (op) { if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; } len += (unsigned)hold & ((1U << op) - 1); @@ -150,9 +133,9 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ } Tracevv((stderr, "inflate: length %u\n", len)); if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; } here = dcode[hold & dmask]; @@ -165,10 +148,10 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ dist = (unsigned)(here.val); op &= 15; /* number of extra bits */ if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; } } @@ -196,30 +179,30 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR if (len <= op - whave) { do { - PUP(out) = 0; + *out++ = 0; } while (--len); continue; } len -= op - whave; do { - PUP(out) = 0; + *out++ = 0; } while (--op > whave); if (op == 0) { from = out - dist; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--len); continue; } #endif } - from = window - OFF; + from = window; if (wnext == 0) { /* very common case */ from += wsize - op; if (op < len) { /* some from window */ len -= op; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--op); from = out - dist; /* rest from output */ } @@ -230,14 +213,14 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ if (op < len) { /* some from end of window */ len -= op; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--op); - from = window - OFF; + from = window; if (wnext < len) { /* some from start of window */ op = wnext; len -= op; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--op); from = out - dist; /* rest from output */ } @@ -248,35 +231,35 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ if (op < len) { /* some from window */ len -= op; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--op); from = out - dist; /* rest from output */ } } while (len > 2) { - PUP(out) = PUP(from); - PUP(out) = PUP(from); - PUP(out) = PUP(from); + *out++ = *from++; + *out++ = *from++; + *out++ = *from++; len -= 3; } if (len) { - PUP(out) = PUP(from); + *out++ = *from++; if (len > 1) - PUP(out) = PUP(from); + *out++ = *from++; } } else { from = out - dist; /* copy direct from output */ do { /* minimum length is three */ - PUP(out) = PUP(from); - PUP(out) = PUP(from); - PUP(out) = PUP(from); + *out++ = *from++; + *out++ = *from++; + *out++ = *from++; len -= 3; } while (len > 2); if (len) { - PUP(out) = PUP(from); + *out++ = *from++; if (len > 1) - PUP(out) = PUP(from); + *out++ = *from++; } } } @@ -313,8 +296,8 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ hold &= (1U << bits) - 1; /* update state and return */ - strm->next_in = in + OFF; - strm->next_out = out + OFF; + strm->next_in = in; + strm->next_out = out; strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); strm->avail_out = (unsigned)(out < end ? 257 + (end - out) : 257 - (out - end)); diff --git a/tcod_sys/libtcod/src/zlib/inffast.h b/tcod_sys/libtcod/src/vendor/zlib/inffast.h similarity index 100% rename from tcod_sys/libtcod/src/zlib/inffast.h rename to tcod_sys/libtcod/src/vendor/zlib/inffast.h diff --git a/tcod_sys/libtcod/src/zlib/inffixed.h b/tcod_sys/libtcod/src/vendor/zlib/inffixed.h similarity index 100% rename from tcod_sys/libtcod/src/zlib/inffixed.h rename to tcod_sys/libtcod/src/vendor/zlib/inffixed.h diff --git a/tcod_sys/libtcod/src/zlib/inflate.c b/tcod_sys/libtcod/src/vendor/zlib/inflate.c similarity index 93% rename from tcod_sys/libtcod/src/zlib/inflate.c rename to tcod_sys/libtcod/src/vendor/zlib/inflate.c index 870f89bb4..ac333e8c2 100644 --- a/tcod_sys/libtcod/src/zlib/inflate.c +++ b/tcod_sys/libtcod/src/vendor/zlib/inflate.c @@ -1,5 +1,5 @@ /* inflate.c -- zlib decompression - * Copyright (C) 1995-2012 Mark Adler + * Copyright (C) 1995-2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -92,6 +92,7 @@ #endif /* function prototypes */ +local int inflateStateCheck OF((z_streamp strm)); local void fixedtables OF((struct inflate_state FAR *state)); local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, unsigned copy)); @@ -101,12 +102,26 @@ local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, unsigned len)); +local int inflateStateCheck(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + if (strm == Z_NULL || + strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) + return 1; + state = (struct inflate_state FAR *)strm->state; + if (state == Z_NULL || state->strm != strm || + state->mode < HEAD || state->mode > SYNC) + return 1; + return 0; +} + int ZEXPORT inflateResetKeep(strm) z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; strm->total_in = strm->total_out = state->total = 0; strm->msg = Z_NULL; @@ -131,7 +146,7 @@ z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; state->wsize = 0; state->whave = 0; @@ -147,7 +162,7 @@ int windowBits; struct inflate_state FAR *state; /* get the state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; /* extract wrap request from windowBits parameter */ @@ -156,7 +171,7 @@ int windowBits; windowBits = -windowBits; } else { - wrap = (windowBits >> 4) + 1; + wrap = (windowBits >> 4) + 5; #ifdef GUNZIP if (windowBits < 48) windowBits &= 15; @@ -210,7 +225,9 @@ int stream_size; if (state == Z_NULL) return Z_MEM_ERROR; Tracev((stderr, "inflate: allocated\n")); strm->state = (struct internal_state FAR *)state; + state->strm = strm; state->window = Z_NULL; + state->mode = HEAD; /* to pass state test in inflateReset2() */ ret = inflateReset2(strm, windowBits); if (ret != Z_OK) { ZFREE(strm, state); @@ -234,17 +251,17 @@ int value; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; if (bits < 0) { state->hold = 0; state->bits = 0; return Z_OK; } - if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; + if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR; value &= (1L << bits) - 1; - state->hold += value << state->bits; - state->bits += bits; + state->hold += (unsigned)value << state->bits; + state->bits += (uInt)bits; return Z_OK; } @@ -625,7 +642,7 @@ int flush; static const unsigned short order[19] = /* permutation of code lengths */ {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL || + if (inflateStateCheck(strm) || strm->next_out == Z_NULL || (strm->next_in == Z_NULL && strm->avail_in != 0)) return Z_STREAM_ERROR; @@ -645,6 +662,8 @@ int flush; NEEDBITS(16); #ifdef GUNZIP if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ + if (state->wbits == 0) + state->wbits = 15; state->check = crc32(0L, Z_NULL, 0); CRC2(state->check, hold); INITBITS(); @@ -672,7 +691,7 @@ int flush; len = BITS(4) + 8; if (state->wbits == 0) state->wbits = len; - else if (len > state->wbits) { + if (len > 15 || len > state->wbits) { strm->msg = (char *)"invalid window size"; state->mode = BAD; break; @@ -699,14 +718,16 @@ int flush; } if (state->head != Z_NULL) state->head->text = (int)((hold >> 8) & 1); - if (state->flags & 0x0200) CRC2(state->check, hold); + if ((state->flags & 0x0200) && (state->wrap & 4)) + CRC2(state->check, hold); INITBITS(); state->mode = TIME; case TIME: NEEDBITS(32); if (state->head != Z_NULL) state->head->time = hold; - if (state->flags & 0x0200) CRC4(state->check, hold); + if ((state->flags & 0x0200) && (state->wrap & 4)) + CRC4(state->check, hold); INITBITS(); state->mode = OS; case OS: @@ -715,7 +736,8 @@ int flush; state->head->xflags = (int)(hold & 0xff); state->head->os = (int)(hold >> 8); } - if (state->flags & 0x0200) CRC2(state->check, hold); + if ((state->flags & 0x0200) && (state->wrap & 4)) + CRC2(state->check, hold); INITBITS(); state->mode = EXLEN; case EXLEN: @@ -724,7 +746,8 @@ int flush; state->length = (unsigned)(hold); if (state->head != Z_NULL) state->head->extra_len = (unsigned)hold; - if (state->flags & 0x0200) CRC2(state->check, hold); + if ((state->flags & 0x0200) && (state->wrap & 4)) + CRC2(state->check, hold); INITBITS(); } else if (state->head != Z_NULL) @@ -742,7 +765,7 @@ int flush; len + copy > state->head->extra_max ? state->head->extra_max - len : copy); } - if (state->flags & 0x0200) + if ((state->flags & 0x0200) && (state->wrap & 4)) state->check = crc32(state->check, next, copy); have -= copy; next += copy; @@ -761,9 +784,9 @@ int flush; if (state->head != Z_NULL && state->head->name != Z_NULL && state->length < state->head->name_max) - state->head->name[state->length++] = len; + state->head->name[state->length++] = (Bytef)len; } while (len && copy < have); - if (state->flags & 0x0200) + if ((state->flags & 0x0200) && (state->wrap & 4)) state->check = crc32(state->check, next, copy); have -= copy; next += copy; @@ -782,9 +805,9 @@ int flush; if (state->head != Z_NULL && state->head->comment != Z_NULL && state->length < state->head->comm_max) - state->head->comment[state->length++] = len; + state->head->comment[state->length++] = (Bytef)len; } while (len && copy < have); - if (state->flags & 0x0200) + if ((state->flags & 0x0200) && (state->wrap & 4)) state->check = crc32(state->check, next, copy); have -= copy; next += copy; @@ -796,7 +819,7 @@ int flush; case HCRC: if (state->flags & 0x0200) { NEEDBITS(16); - if (hold != (state->check & 0xffff)) { + if ((state->wrap & 4) && hold != (state->check & 0xffff)) { strm->msg = (char *)"header crc mismatch"; state->mode = BAD; break; @@ -1177,11 +1200,11 @@ int flush; out -= left; strm->total_out += out; state->total += out; - if (out) + if ((state->wrap & 4) && out) strm->adler = state->check = UPDATE(state->check, put - out, out); out = left; - if (( + if ((state->wrap & 4) && ( #ifdef GUNZIP state->flags ? hold : #endif @@ -1240,10 +1263,10 @@ int flush; strm->total_in += in; strm->total_out += out; state->total += out; - if (state->wrap && out) + if ((state->wrap & 4) && out) strm->adler = state->check = UPDATE(state->check, strm->next_out - out, out); - strm->data_type = state->bits + (state->last ? 64 : 0) + + strm->data_type = (int)state->bits + (state->last ? 64 : 0) + (state->mode == TYPE ? 128 : 0) + (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0); if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) @@ -1255,7 +1278,7 @@ int ZEXPORT inflateEnd(strm) z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; if (state->window != Z_NULL) ZFREE(strm, state->window); @@ -1273,7 +1296,7 @@ uInt *dictLength; struct inflate_state FAR *state; /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; /* copy dictionary */ @@ -1298,7 +1321,7 @@ uInt dictLength; int ret; /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; if (state->wrap != 0 && state->mode != DICT) return Z_STREAM_ERROR; @@ -1330,7 +1353,7 @@ gz_headerp head; struct inflate_state FAR *state; /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; @@ -1383,7 +1406,7 @@ z_streamp strm; struct inflate_state FAR *state; /* check parameters */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; @@ -1430,7 +1453,7 @@ z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; return state->mode == STORED && state->bits == 0; } @@ -1445,8 +1468,7 @@ z_streamp source; unsigned wsize; /* check input */ - if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL || - source->zalloc == (alloc_func)0 || source->zfree == (free_func)0) + if (inflateStateCheck(source) || dest == Z_NULL) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)source->state; @@ -1467,6 +1489,7 @@ z_streamp source; /* copy state */ zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream)); zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state)); + copy->strm = dest; if (state->lencode >= state->codes && state->lencode <= state->codes + ENOUGH - 1) { copy->lencode = copy->codes + (state->lencode - state->codes); @@ -1488,25 +1511,51 @@ int subvert; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; - state->sane = !subvert; #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR + state->sane = !subvert; return Z_OK; #else + (void)subvert; state->sane = 1; return Z_DATA_ERROR; #endif } +int ZEXPORT inflateValidate(strm, check) +z_streamp strm; +int check; +{ + struct inflate_state FAR *state; + + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (check) + state->wrap |= 4; + else + state->wrap &= ~4; + return Z_OK; +} + long ZEXPORT inflateMark(strm) z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; + if (inflateStateCheck(strm)) + return -(1L << 16); state = (struct inflate_state FAR *)strm->state; - return ((long)(state->back) << 16) + + return (long)(((unsigned long)((long)state->back)) << 16) + (state->mode == COPY ? state->length : (state->mode == MATCH ? state->was - state->length : 0)); } + +unsigned long ZEXPORT inflateCodesUsed(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + if (inflateStateCheck(strm)) return (unsigned long)-1; + state = (struct inflate_state FAR *)strm->state; + return (unsigned long)(state->next - state->codes); +} diff --git a/tcod_sys/libtcod/src/zlib/inflate.h b/tcod_sys/libtcod/src/vendor/zlib/inflate.h similarity index 94% rename from tcod_sys/libtcod/src/zlib/inflate.h rename to tcod_sys/libtcod/src/vendor/zlib/inflate.h index 95f4986d4..a46cce6b6 100644 --- a/tcod_sys/libtcod/src/zlib/inflate.h +++ b/tcod_sys/libtcod/src/vendor/zlib/inflate.h @@ -1,5 +1,5 @@ /* inflate.h -- internal inflate state definition - * Copyright (C) 1995-2009 Mark Adler + * Copyright (C) 1995-2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -18,7 +18,7 @@ /* Possible inflate modes between inflate() calls */ typedef enum { - HEAD, /* i: waiting for magic header */ + HEAD = 16180, /* i: waiting for magic header */ FLAGS, /* i: waiting for method and flags (gzip) */ TIME, /* i: waiting for modification time (gzip) */ OS, /* i: waiting for extra flags and operating system (gzip) */ @@ -77,11 +77,14 @@ typedef enum { CHECK -> LENGTH -> DONE */ -/* state maintained between inflate() calls. Approximately 10K bytes. */ +/* State maintained between inflate() calls -- approximately 7K bytes, not + including the allocated sliding window, which is up to 32K bytes. */ struct inflate_state { + z_streamp strm; /* pointer back to this zlib stream */ inflate_mode mode; /* current inflate mode */ int last; /* true if processing last block */ - int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + int wrap; /* bit 0 true for zlib, bit 1 true for gzip, + bit 2 true to validate check value */ int havedict; /* true if dictionary provided */ int flags; /* gzip header method and flags (0 if zlib) */ unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ diff --git a/tcod_sys/libtcod/src/zlib/inftrees.c b/tcod_sys/libtcod/src/vendor/zlib/inftrees.c similarity index 95% rename from tcod_sys/libtcod/src/zlib/inftrees.c rename to tcod_sys/libtcod/src/vendor/zlib/inftrees.c index 44d89cf24..2ea08fc13 100644 --- a/tcod_sys/libtcod/src/zlib/inftrees.c +++ b/tcod_sys/libtcod/src/vendor/zlib/inftrees.c @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2013 Mark Adler + * Copyright (C) 1995-2017 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.8 Copyright 1995-2013 Mark Adler "; + " inflate 1.2.11 Copyright 1995-2017 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -54,7 +54,7 @@ unsigned short FAR *work; code FAR *next; /* next available space in table */ const unsigned short FAR *base; /* base value table to use */ const unsigned short FAR *extra; /* extra bits table to use */ - int end; /* use base and extra for symbol > end */ + unsigned match; /* use base and extra for symbol >= match */ unsigned short count[MAXBITS+1]; /* number of codes of each length */ unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ static const unsigned short lbase[31] = { /* Length codes 257..285 base */ @@ -62,7 +62,7 @@ unsigned short FAR *work; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 77, 202}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, @@ -181,19 +181,17 @@ unsigned short FAR *work; switch (type) { case CODES: base = extra = work; /* dummy value--not used */ - end = 19; + match = 20; break; case LENS: base = lbase; - base -= 257; extra = lext; - extra -= 257; - end = 256; + match = 257; break; - default: /* DISTS */ + default: /* DISTS */ base = dbase; extra = dext; - end = -1; + match = 0; } /* initialize state for loop */ @@ -216,13 +214,13 @@ unsigned short FAR *work; for (;;) { /* create table entry */ here.bits = (unsigned char)(len - drop); - if ((int)(work[sym]) < end) { + if (work[sym] + 1U < match) { here.op = (unsigned char)0; here.val = work[sym]; } - else if ((int)(work[sym]) > end) { - here.op = (unsigned char)(extra[work[sym]]); - here.val = base[work[sym]]; + else if (work[sym] >= match) { + here.op = (unsigned char)(extra[work[sym] - match]); + here.val = base[work[sym] - match]; } else { here.op = (unsigned char)(32 + 64); /* end of block */ diff --git a/tcod_sys/libtcod/src/zlib/inftrees.h b/tcod_sys/libtcod/src/vendor/zlib/inftrees.h similarity index 100% rename from tcod_sys/libtcod/src/zlib/inftrees.h rename to tcod_sys/libtcod/src/vendor/zlib/inftrees.h diff --git a/tcod_sys/libtcod/src/zlib/trees.c b/tcod_sys/libtcod/src/vendor/zlib/trees.c similarity index 95% rename from tcod_sys/libtcod/src/zlib/trees.c rename to tcod_sys/libtcod/src/vendor/zlib/trees.c index 1fd7759ef..50cf4b457 100644 --- a/tcod_sys/libtcod/src/zlib/trees.c +++ b/tcod_sys/libtcod/src/vendor/zlib/trees.c @@ -1,5 +1,5 @@ /* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2012 Jean-loup Gailly + * Copyright (C) 1995-2017 Jean-loup Gailly * detect_data_type() function provided freely by Cosmin Truta, 2006 * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -36,7 +36,7 @@ #include "deflate.h" -#ifdef DEBUG +#ifdef ZLIB_DEBUG # include #endif @@ -122,13 +122,13 @@ struct static_tree_desc_s { int max_length; /* max bit length for the codes */ }; -local static_tree_desc static_l_desc = +local const static_tree_desc static_l_desc = {static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; -local static_tree_desc static_d_desc = +local const static_tree_desc static_d_desc = {static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; -local static_tree_desc static_bl_desc = +local const static_tree_desc static_bl_desc = {(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; /* =========================================================================== @@ -152,18 +152,16 @@ local int detect_data_type OF((deflate_state *s)); local unsigned bi_reverse OF((unsigned value, int length)); local void bi_windup OF((deflate_state *s)); local void bi_flush OF((deflate_state *s)); -local void copy_block OF((deflate_state *s, charf *buf, unsigned len, - int header)); #ifdef GEN_TREES_H local void gen_trees_header OF((void)); #endif -#ifndef DEBUG +#ifndef ZLIB_DEBUG # define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len) /* Send a code of the given tree. c and tree must not have side effects */ -#else /* DEBUG */ +#else /* !ZLIB_DEBUG */ # define send_code(s, c, tree) \ { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \ send_bits(s, tree[c].Code, tree[c].Len); } @@ -182,7 +180,7 @@ local void gen_trees_header OF((void)); * Send a value on a given number of bits. * IN assertion: length <= 16 and value fits in length bits. */ -#ifdef DEBUG +#ifdef ZLIB_DEBUG local void send_bits OF((deflate_state *s, int value, int length)); local void send_bits(s, value, length) @@ -208,12 +206,12 @@ local void send_bits(s, value, length) s->bi_valid += length; } } -#else /* !DEBUG */ +#else /* !ZLIB_DEBUG */ #define send_bits(s, value, length) \ { int len = length;\ if (s->bi_valid > (int)Buf_size - len) {\ - int val = value;\ + int val = (int)value;\ s->bi_buf |= (ush)val << s->bi_valid;\ put_short(s, s->bi_buf);\ s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\ @@ -223,7 +221,7 @@ local void send_bits(s, value, length) s->bi_valid += len;\ }\ } -#endif /* DEBUG */ +#endif /* ZLIB_DEBUG */ /* the arguments must not have side effects */ @@ -317,7 +315,7 @@ local void tr_static_init() * Genererate the file trees.h describing the static trees. */ #ifdef GEN_TREES_H -# ifndef DEBUG +# ifndef ZLIB_DEBUG # include # endif @@ -394,7 +392,7 @@ void ZLIB_INTERNAL _tr_init(s) s->bi_buf = 0; s->bi_valid = 0; -#ifdef DEBUG +#ifdef ZLIB_DEBUG s->compressed_len = 0L; s->bits_sent = 0L; #endif @@ -522,12 +520,12 @@ local void gen_bitlen(s, desc) xbits = 0; if (n >= base) xbits = extra[n-base]; f = tree[n].Freq; - s->opt_len += (ulg)f * (bits + xbits); - if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits); + s->opt_len += (ulg)f * (unsigned)(bits + xbits); + if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits); } if (overflow == 0) return; - Trace((stderr,"\nbit length overflow\n")); + Tracev((stderr,"\nbit length overflow\n")); /* This happens for example on obj2 and pic of the Calgary corpus */ /* Find the first bit length which could increase: */ @@ -554,9 +552,8 @@ local void gen_bitlen(s, desc) m = s->heap[--h]; if (m > max_code) continue; if ((unsigned) tree[m].Len != (unsigned) bits) { - Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); - s->opt_len += ((long)bits - (long)tree[m].Len) - *(long)tree[m].Freq; + Tracev((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq; tree[m].Len = (ush)bits; } n--; @@ -578,7 +575,7 @@ local void gen_codes (tree, max_code, bl_count) ushf *bl_count; /* number of codes at each bit length */ { ush next_code[MAX_BITS+1]; /* next code value for each bit length */ - ush code = 0; /* running code value */ + unsigned code = 0; /* running code value */ int bits; /* bit index */ int n; /* code index */ @@ -586,7 +583,8 @@ local void gen_codes (tree, max_code, bl_count) * without bit reversal. */ for (bits = 1; bits <= MAX_BITS; bits++) { - next_code[bits] = code = (code + bl_count[bits-1]) << 1; + code = (code + bl_count[bits-1]) << 1; + next_code[bits] = (ush)code; } /* Check that the bit counts in bl_count are consistent. The last code * must be all ones. @@ -599,7 +597,7 @@ local void gen_codes (tree, max_code, bl_count) int len = tree[n].Len; if (len == 0) continue; /* Now reverse the bits */ - tree[n].Code = bi_reverse(next_code[len]++, len); + tree[n].Code = (ush)bi_reverse(next_code[len]++, len); Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ", n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1)); @@ -821,7 +819,7 @@ local int build_bl_tree(s) if (s->bl_tree[bl_order[max_blindex]].Len != 0) break; } /* Update opt_len to include the bit length tree and counts */ - s->opt_len += 3*(max_blindex+1) + 5+5+4; + s->opt_len += 3*((ulg)max_blindex+1) + 5+5+4; Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", s->opt_len, s->static_len)); @@ -869,11 +867,17 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last) int last; /* one if this is the last block for a file */ { send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */ -#ifdef DEBUG + bi_windup(s); /* align on byte boundary */ + put_short(s, (ush)stored_len); + put_short(s, (ush)~stored_len); + zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len); + s->pending += stored_len; +#ifdef ZLIB_DEBUG s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; s->compressed_len += (stored_len + 4) << 3; + s->bits_sent += 2*16; + s->bits_sent += stored_len<<3; #endif - copy_block(s, buf, (unsigned)stored_len, 1); /* with header */ } /* =========================================================================== @@ -894,7 +898,7 @@ void ZLIB_INTERNAL _tr_align(s) { send_bits(s, STATIC_TREES<<1, 3); send_code(s, END_BLOCK, static_ltree); -#ifdef DEBUG +#ifdef ZLIB_DEBUG s->compressed_len += 10L; /* 3 for block type, 7 for EOB */ #endif bi_flush(s); @@ -902,7 +906,7 @@ void ZLIB_INTERNAL _tr_align(s) /* =========================================================================== * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. + * trees or store, and write out the encoded block. */ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) deflate_state *s; @@ -974,7 +978,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) send_bits(s, (STATIC_TREES<<1)+last, 3); compress_block(s, (const ct_data *)static_ltree, (const ct_data *)static_dtree); -#ifdef DEBUG +#ifdef ZLIB_DEBUG s->compressed_len += 3 + s->static_len; #endif } else { @@ -983,7 +987,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) max_blindex+1); compress_block(s, (const ct_data *)s->dyn_ltree, (const ct_data *)s->dyn_dtree); -#ifdef DEBUG +#ifdef ZLIB_DEBUG s->compressed_len += 3 + s->opt_len; #endif } @@ -995,7 +999,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) if (last) { bi_windup(s); -#ifdef DEBUG +#ifdef ZLIB_DEBUG s->compressed_len += 7; /* align on byte boundary */ #endif } @@ -1090,7 +1094,7 @@ local void compress_block(s, ltree, dtree) send_code(s, code, dtree); /* send the distance code */ extra = extra_dbits[code]; if (extra != 0) { - dist -= base_dist[code]; + dist -= (unsigned)base_dist[code]; send_bits(s, dist, extra); /* send the extra distance bits */ } } /* literal or match pair ? */ @@ -1193,34 +1197,7 @@ local void bi_windup(s) } s->bi_buf = 0; s->bi_valid = 0; -#ifdef DEBUG +#ifdef ZLIB_DEBUG s->bits_sent = (s->bits_sent+7) & ~7; #endif } - -/* =========================================================================== - * Copy a stored block, storing first the length and its - * one's complement if requested. - */ -local void copy_block(s, buf, len, header) - deflate_state *s; - charf *buf; /* the input data */ - unsigned len; /* its length */ - int header; /* true if block header must be written */ -{ - bi_windup(s); /* align on byte boundary */ - - if (header) { - put_short(s, (ush)len); - put_short(s, (ush)~len); -#ifdef DEBUG - s->bits_sent += 2*16; -#endif - } -#ifdef DEBUG - s->bits_sent += (ulg)len<<3; -#endif - while (len--) { - put_byte(s, *buf++); - } -} diff --git a/tcod_sys/libtcod/src/zlib/trees.h b/tcod_sys/libtcod/src/vendor/zlib/trees.h similarity index 100% rename from tcod_sys/libtcod/src/zlib/trees.h rename to tcod_sys/libtcod/src/vendor/zlib/trees.h diff --git a/tcod_sys/libtcod/src/vendor/zlib/uncompr.c b/tcod_sys/libtcod/src/vendor/zlib/uncompr.c new file mode 100644 index 000000000..f03a1a865 --- /dev/null +++ b/tcod_sys/libtcod/src/vendor/zlib/uncompr.c @@ -0,0 +1,93 @@ +/* uncompr.c -- decompress a memory buffer + * Copyright (C) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#define ZLIB_INTERNAL +#include "zlib.h" + +/* =========================================================================== + Decompresses the source buffer into the destination buffer. *sourceLen is + the byte length of the source buffer. Upon entry, *destLen is the total size + of the destination buffer, which must be large enough to hold the entire + uncompressed data. (The size of the uncompressed data must have been saved + previously by the compressor and transmitted to the decompressor by some + mechanism outside the scope of this compression library.) Upon exit, + *destLen is the size of the decompressed data and *sourceLen is the number + of source bytes consumed. Upon return, source + *sourceLen points to the + first unused input byte. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, or + Z_DATA_ERROR if the input data was corrupted, including if the input data is + an incomplete zlib stream. +*/ +int ZEXPORT uncompress2 (dest, destLen, source, sourceLen) + Bytef *dest; + uLongf *destLen; + const Bytef *source; + uLong *sourceLen; +{ + z_stream stream; + int err; + const uInt max = (uInt)-1; + uLong len, left; + Byte buf[1]; /* for detection of incomplete stream when *destLen == 0 */ + + len = *sourceLen; + if (*destLen) { + left = *destLen; + *destLen = 0; + } + else { + left = 1; + dest = buf; + } + + stream.next_in = (z_const Bytef *)source; + stream.avail_in = 0; + stream.zalloc = (alloc_func)0; + stream.zfree = (free_func)0; + stream.opaque = (voidpf)0; + + err = inflateInit(&stream); + if (err != Z_OK) return err; + + stream.next_out = dest; + stream.avail_out = 0; + + do { + if (stream.avail_out == 0) { + stream.avail_out = left > (uLong)max ? max : (uInt)left; + left -= stream.avail_out; + } + if (stream.avail_in == 0) { + stream.avail_in = len > (uLong)max ? max : (uInt)len; + len -= stream.avail_in; + } + err = inflate(&stream, Z_NO_FLUSH); + } while (err == Z_OK); + + *sourceLen -= len + stream.avail_in; + if (dest != buf) + *destLen = stream.total_out; + else if (stream.total_out && err == Z_BUF_ERROR) + left = 1; + + inflateEnd(&stream); + return err == Z_STREAM_END ? Z_OK : + err == Z_NEED_DICT ? Z_DATA_ERROR : + err == Z_BUF_ERROR && left + stream.avail_out ? Z_DATA_ERROR : + err; +} + +int ZEXPORT uncompress (dest, destLen, source, sourceLen) + Bytef *dest; + uLongf *destLen; + const Bytef *source; + uLong sourceLen; +{ + return uncompress2(dest, destLen, source, &sourceLen); +} diff --git a/tcod_sys/libtcod/src/zlib/zconf.h b/tcod_sys/libtcod/src/vendor/zlib/zconf.h similarity index 93% rename from tcod_sys/libtcod/src/zlib/zconf.h rename to tcod_sys/libtcod/src/vendor/zlib/zconf.h index 9987a7755..5e1d68a00 100644 --- a/tcod_sys/libtcod/src/zlib/zconf.h +++ b/tcod_sys/libtcod/src/vendor/zlib/zconf.h @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2013 Jean-loup Gailly. + * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -17,7 +17,7 @@ #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ # define Z_PREFIX_SET -/* all linked symbols */ +/* all linked symbols and init macros */ # define _dist_code z__dist_code # define _length_code z__length_code # define _tr_align z__tr_align @@ -29,6 +29,7 @@ # define adler32 z_adler32 # define adler32_combine z_adler32_combine # define adler32_combine64 z_adler32_combine64 +# define adler32_z z_adler32_z # ifndef Z_SOLO # define compress z_compress # define compress2 z_compress2 @@ -37,10 +38,14 @@ # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 +# define crc32_z z_crc32_z # define deflate z_deflate # define deflateBound z_deflateBound # define deflateCopy z_deflateCopy # define deflateEnd z_deflateEnd +# define deflateGetDictionary z_deflateGetDictionary +# define deflateInit z_deflateInit +# define deflateInit2 z_deflateInit2 # define deflateInit2_ z_deflateInit2_ # define deflateInit_ z_deflateInit_ # define deflateParams z_deflateParams @@ -67,6 +72,8 @@ # define gzeof z_gzeof # define gzerror z_gzerror # define gzflush z_gzflush +# define gzfread z_gzfread +# define gzfwrite z_gzfwrite # define gzgetc z_gzgetc # define gzgetc_ z_gzgetc_ # define gzgets z_gzgets @@ -78,7 +85,6 @@ # define gzopen_w z_gzopen_w # endif # define gzprintf z_gzprintf -# define gzvprintf z_gzvprintf # define gzputc z_gzputc # define gzputs z_gzputs # define gzread z_gzread @@ -89,32 +95,39 @@ # define gztell z_gztell # define gztell64 z_gztell64 # define gzungetc z_gzungetc +# define gzvprintf z_gzvprintf # define gzwrite z_gzwrite # endif # define inflate z_inflate # define inflateBack z_inflateBack # define inflateBackEnd z_inflateBackEnd +# define inflateBackInit z_inflateBackInit # define inflateBackInit_ z_inflateBackInit_ +# define inflateCodesUsed z_inflateCodesUsed # define inflateCopy z_inflateCopy # define inflateEnd z_inflateEnd +# define inflateGetDictionary z_inflateGetDictionary # define inflateGetHeader z_inflateGetHeader +# define inflateInit z_inflateInit +# define inflateInit2 z_inflateInit2 # define inflateInit2_ z_inflateInit2_ # define inflateInit_ z_inflateInit_ # define inflateMark z_inflateMark # define inflatePrime z_inflatePrime # define inflateReset z_inflateReset # define inflateReset2 z_inflateReset2 +# define inflateResetKeep z_inflateResetKeep # define inflateSetDictionary z_inflateSetDictionary -# define inflateGetDictionary z_inflateGetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateUndermine z_inflateUndermine -# define inflateResetKeep z_inflateResetKeep +# define inflateValidate z_inflateValidate # define inflate_copyright z_inflate_copyright # define inflate_fast z_inflate_fast # define inflate_table z_inflate_table # ifndef Z_SOLO # define uncompress z_uncompress +# define uncompress2 z_uncompress2 # endif # define zError z_zError # ifndef Z_SOLO @@ -224,9 +237,19 @@ # define z_const #endif -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL +#ifdef Z_SOLO + typedef unsigned long z_size_t; +#else +# define z_longlong long long +# if defined(NO_SIZE_T) + typedef unsigned NO_SIZE_T z_size_t; +# elif defined(STDC) +# include + typedef size_t z_size_t; +# else + typedef unsigned long z_size_t; +# endif +# undef z_longlong #endif /* Maximum value for memLevel in deflateInit2 */ @@ -256,7 +279,7 @@ Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes + that is, 32K for windowBits=15 (default value) plus about 7 kilobytes for small objects. */ diff --git a/tcod_sys/libtcod/src/zlib/zlib.h b/tcod_sys/libtcod/src/vendor/zlib/zlib.h similarity index 82% rename from tcod_sys/libtcod/src/zlib/zlib.h rename to tcod_sys/libtcod/src/vendor/zlib/zlib.h index 3e0c7672a..f09cdaf1e 100644 --- a/tcod_sys/libtcod/src/zlib/zlib.h +++ b/tcod_sys/libtcod/src/vendor/zlib/zlib.h @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.8, April 28th, 2013 + version 1.2.11, January 15th, 2017 - Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,11 +37,11 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.8" -#define ZLIB_VERNUM 0x1280 +#define ZLIB_VERSION "1.2.11" +#define ZLIB_VERNUM 0x12b0 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 8 +#define ZLIB_VER_REVISION 11 #define ZLIB_VER_SUBREVISION 0 /* @@ -65,7 +65,8 @@ extern "C" { with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - This library can optionally read and write gzip streams in memory as well. + This library can optionally read and write gzip and raw deflate streams in + memory as well. The zlib format was designed to be compact and fast for use in memory and on communications channels. The gzip format was designed for single- @@ -74,7 +75,7 @@ extern "C" { The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash - even in case of corrupted input. + even in the case of corrupted input. */ typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); @@ -87,7 +88,7 @@ typedef struct z_stream_s { uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total number of input bytes read so far */ - Bytef *next_out; /* next output byte should be put there */ + Bytef *next_out; /* next output byte will go here */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total number of bytes output so far */ @@ -98,8 +99,9 @@ typedef struct z_stream_s { free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ + int data_type; /* best guess about the data type: binary or text + for deflate, or the decoding state for inflate */ + uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ } z_stream; @@ -142,7 +144,9 @@ typedef gz_header FAR *gz_headerp; zalloc must return Z_NULL if there is not enough memory for the object. If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. + thread safe. In that case, zlib is thread-safe. When zalloc and zfree are + Z_NULL on entry to the initialization function, they are set to internal + routines that use the standard library functions malloc() and free(). On 16-bit systems, the functions zalloc and zfree must be able to allocate exactly 65536 bytes, but will not be required to allocate more than this if @@ -155,7 +159,7 @@ typedef gz_header FAR *gz_headerp; The fields total_in and total_out can be used for statistics or progress reports. After compression, total_in holds the total size of the - uncompressed data and may be saved for use in the decompressor (particularly + uncompressed data and may be saved for use by the decompressor (particularly if the decompressor wants to decompress everything in a single step). */ @@ -200,7 +204,7 @@ typedef gz_header FAR *gz_headerp; #define Z_TEXT 1 #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ #define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ +/* Possible values of the data_type field for deflate() */ #define Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ @@ -258,11 +262,11 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); enough room in the output buffer), next_in and avail_in are updated and processing will resume at this point for the next call of deflate(). - - Provide more output starting at next_out and update next_out and avail_out + - Generate more output starting at next_out and update next_out and avail_out accordingly. This action is forced if the parameter flush is non zero. Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). Some - output may be provided even if flush is not set. + should be set only when necessary. Some output may be provided even if + flush is zero. Before the call of deflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more @@ -271,7 +275,9 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK and with zero avail_out, it must be called again after making room in the output - buffer because there might be more output pending. + buffer because there might be more output pending. See deflatePending(), + which can be used if desired to determine whether or not there is more ouput + in that case. Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to decide how much data to accumulate before producing output, in order to @@ -292,8 +298,8 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. This completes the current deflate block and follows it with an empty fixed codes block that is 10 bits long. This assures that enough bytes are output - in order for the decompressor to finish the block before the empty fixed code - block. + in order for the decompressor to finish the block before the empty fixed + codes block. If flush is set to Z_BLOCK, a deflate block is completed and emitted, as for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to @@ -319,34 +325,38 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was - enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the stream - are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least the - value returned by deflateBound (see below). Then deflate is guaranteed to - return Z_STREAM_END. If not enough output space is provided, deflate will - not return Z_STREAM_END, and it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). + enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this + function must be called again with Z_FINISH and more output space (updated + avail_out) but no more input data, until it returns with Z_STREAM_END or an + error. After deflate has returned Z_STREAM_END, the only possible operations + on the stream are deflateReset or deflateEnd. + + Z_FINISH can be used in the first deflate call after deflateInit if all the + compression is to be done in a single step. In order to complete in one + call, avail_out must be at least the value returned by deflateBound (see + below). Then deflate is guaranteed to return Z_STREAM_END. If not enough + output space is provided, deflate will not return Z_STREAM_END, and it must + be called again as described above. + + deflate() sets strm->adler to the Adler-32 checksum of all input read + so far (that is, total_in bytes). If a gzip stream is being generated, then + strm->adler will be the CRC-32 checksum of the input read so far. (See + deflateInit2 below.) deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect the - compression algorithm in any manner. + the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is + considered binary. This field is only for information purposes and does not + affect the compression algorithm in any manner. deflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if all input has been consumed and all output has been produced (only when flush is set to Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. + if next_in or next_out was Z_NULL or the state was inadvertently written over + by the application), or Z_BUF_ERROR if no progress is possible (for example + avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and + deflate() can be called again with more input and more output space to + continue compressing. */ @@ -369,23 +379,21 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the - exact value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. + the caller. In the current version of inflate, the provided input is not + read or consumed. The allocation of a sliding window will be deferred to + the first call of inflate (if the decompression does not complete on the + first call). If zalloc and zfree are set to Z_NULL, inflateInit updates + them to use default allocation functions. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit does not perform any decompression - apart from possibly reading the zlib header if present: actual decompression - will be done by inflate(). (So next_in and avail_in may be modified, but - next_out and avail_out are unused and unchanged.) The current implementation - of inflateInit() does not process any header information -- that is deferred - until inflate() is called. + there is no error message. inflateInit does not perform any decompression. + Actual decompression will be done by inflate(). So next_in, and avail_in, + next_out, and avail_out are unused and unchanged. The current + implementation of inflateInit() does not process any header information -- + that is deferred until inflate() is called. */ @@ -401,17 +409,20 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); - Decompress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing will - resume at this point for the next call of inflate(). + enough room in the output buffer), then next_in and avail_in are updated + accordingly, and processing will resume at this point for the next call of + inflate(). - - Provide more output starting at next_out and update next_out and avail_out + - Generate more output starting at next_out and update next_out and avail_out accordingly. inflate() provides as much output as possible, until there is no more input data or no more space in the output buffer (see below about the flush parameter). Before the call of inflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more - output, and updating the next_* and avail_* values accordingly. The + output, and updating the next_* and avail_* values accordingly. If the + caller of inflate() does not provide both available input and available + output space, it is possible that there will be no progress made. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of inflate(). If inflate returns Z_OK and with zero avail_out, it must be @@ -428,7 +439,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); gets to the end of that block, or when it runs out of data. The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the + To assist in this, on return inflate() always sets strm->data_type to the number of unused bits in the last byte taken from strm->next_in, plus 64 if inflate() is currently decoding the last block in the deflate stream, plus 128 if inflate() returned immediately after decoding an end-of-block code or @@ -454,7 +465,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all of the uncompressed data for the operation to complete. (The size of the uncompressed data may have been - saved by the compressor for this purpose.) The use of Z_FINISH is not + saved by the compressor for this purpose.) The use of Z_FINISH is not required to perform an inflation in one step. However it may be used to inform inflate that a faster approach can be used for the single inflate() call. Z_FINISH also informs inflate to not maintain a sliding window if the @@ -476,32 +487,33 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the Adler-32 checksum of all output produced so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 + below. At the end of the stream, inflate() checks that its computed Adler-32 checksum is equal to that saved by the compressor and returns Z_STREAM_END only if the checksum is correct. inflate() can decompress and check either zlib-wrapped or gzip-wrapped deflate data. The header type is detected automatically, if requested when initializing with inflateInit2(). Any information contained in the gzip - header is not retained, so applications that need that information should - instead use raw inflate, see inflateInit2() below, or inflateBack() and - perform their own processing of the gzip header and trailer. When processing + header is not retained unless inflateGetHeader() is used. When processing gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output - producted so far. The CRC-32 is checked against the gzip trailer. + produced so far. The CRC-32 is checked against the gzip trailer, as is the + uncompressed length, modulo 2^32. inflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced, Z_NEED_DICT if a preset dictionary is needed at this point, Z_DATA_ERROR if the input data was corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and + value, in which case strm->msg points to a string with a more specific + error), Z_STREAM_ERROR if the stream structure was inconsistent (for example + next_in or next_out was Z_NULL, or the state was inadvertently written over + by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR + if no progress was possible or if there was not enough room in the output + buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and inflate() can be called again with more input and more output space to continue decompressing. If Z_DATA_ERROR is returned, the application may then call inflateSync() to look for a good compression block if a partial - recovery of the data is desired. + recovery of the data is to be attempted. */ @@ -511,9 +523,8 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); This function discards any unprocessed input and does not flush any pending output. - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). + inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state + was inconsistent. */ @@ -544,16 +555,29 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, compression at the expense of memory usage. The default value is 15 if deflateInit is used instead. + For the current implementation of deflate(), a windowBits value of 8 (a + window size of 256 bytes) is not supported. As a result, a request for 8 + will result in 9 (a 512-byte window). In that case, providing 8 to + inflateInit2() will result in an error when the zlib header with 9 is + checked against the initialization of inflate(). The remedy is to not use 8 + with deflateInit2() with this initialization, or at least in that case use 9 + with inflateInit2(). + windowBits can also be -8..-15 for raw deflate. In this case, -windowBits determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. + with no zlib header or trailer, and will not compute a check value. windowBits can also be greater than 15 for optional gzip encoding. Add 16 to windowBits to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper. The gzip header will have no file name, no extra data, no comment, no modification time (set to zero), no - header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. + header crc, and the operating system will be set to the appropriate value, + if the operating system was determined at compile time. If a gzip stream is + being written, strm->adler is a CRC-32 instead of an Adler-32. + + For raw deflate or gzip encoding, a request for a 256-byte window is + rejected as invalid, since only the zlib header provides a means of + transmitting the window size to the decompressor. The memLevel parameter specifies how much memory should be allocated for the internal compression state. memLevel=1 uses minimum memory but is @@ -614,12 +638,12 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, addition, the current implementation of deflate will use at most the window size minus 262 bytes of the provided dictionary. - Upon return of this function, strm->adler is set to the adler32 value + Upon return of this function, strm->adler is set to the Adler-32 value of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value + which dictionary has been used by the compressor. (The Adler-32 value applies to the whole dictionary even if only a subset of the dictionary is actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. + Adler-32 value is not computed and strm->adler is not set. deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is @@ -628,6 +652,28 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, not perform any compression: this will be done by deflate(). */ +ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, + Bytef *dictionary, + uInt *dictLength)); +/* + Returns the sliding dictionary being maintained by deflate. dictLength is + set to the number of bytes in the dictionary, and that many bytes are copied + to dictionary. dictionary must have enough space, where 32768 bytes is + always enough. If deflateGetDictionary() is called with dictionary equal to + Z_NULL, then only the dictionary length is returned, and nothing is copied. + Similary, if dictLength is Z_NULL, then it is not set. + + deflateGetDictionary() may return a length less than the window size, even + when more than the window size in input has been provided. It may return up + to 258 bytes less in that case, due to how zlib's implementation of deflate + manages the sliding window and lookahead for matches, where matches can be + up to 258 bytes long. If the application needs the last window-size bytes of + input, then that would need to be saved by the application outside of zlib. + + deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the + stream state is inconsistent. +*/ + ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, z_streamp source)); /* @@ -648,10 +694,10 @@ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); /* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. The - stream will keep the same compression level and any other attributes that - may have been set by deflateInit2. + This function is equivalent to deflateEnd followed by deflateInit, but + does not free and reallocate the internal compression state. The stream + will leave the compression level and any other attributes that may have been + set unchanged. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). @@ -662,20 +708,36 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, int strategy)); /* Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be + interpretation of level and strategy is as in deflateInit2(). This can be used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. - If the compression level is changed, the input available so far is - compressed with the old level (and may be flushed); the new level will take - effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to be - compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if - strm->avail_out was zero. + If the compression approach (which is a function of the level) or the + strategy is changed, and if any input has been consumed in a previous + deflate() call, then the input available so far is compressed with the old + level and strategy using deflate(strm, Z_BLOCK). There are three approaches + for the compression levels 0, 1..3, and 4..9 respectively. The new level + and strategy will take effect at the next call of deflate(). + + If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does + not have enough output space to complete, then the parameter change will not + take effect. In this case, deflateParams() can be called again with the + same parameters and more output space to try again. + + In order to assure a change in the parameters on the first try, the + deflate stream should be flushed using deflate() with Z_BLOCK or other flush + request until strm.avail_out is not zero, before calling deflateParams(). + Then no more input data should be provided before the deflateParams() call. + If this is done, the old level and strategy will be applied to the data + compressed before deflateParams(), and the new level and strategy will be + applied to the the data compressed after deflateParams(). + + deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream + state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if + there was not enough output space to complete the compression of the + available input data before a change in the strategy or approach. Note that + in the case of a Z_BUF_ERROR, the parameters are not changed. A return + value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be + retried with more output space. */ ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, @@ -793,7 +855,7 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, is for use with other formats that use the deflate compressed data format such as zip. Those formats provide their own check values. If a custom format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to + recommended that a check value such as an Adler-32 or a CRC-32 be applied to the uncompressed data as is done in the zlib, gzip, and zip formats. For most applications, the zlib format should be used as is. Note that comments above on the use in deflateInit2() applies to the magnitude of windowBits. @@ -802,7 +864,10 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a - crc32 instead of an adler32. + CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see + below), inflate() will not automatically decode concatenated gzip streams. + inflate() will return Z_STREAM_END at the end of the gzip stream. The state + would need to be reset to continue decoding a subsequent gzip stream. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the @@ -823,7 +888,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. + can be determined from the Adler-32 value returned by that call of inflate. The compressor and decompressor must use exactly the same dictionary (see deflateSetDictionary). For raw inflate, this function can be called at any time to set the dictionary. If the provided dictionary is smaller than the @@ -834,7 +899,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not + expected one (incorrect Adler-32 value). inflateSetDictionary does not perform any decompression: this will be done by subsequent calls of inflate(). */ @@ -892,7 +957,7 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); /* This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. The + but does not free and reallocate the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source @@ -904,7 +969,9 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, /* This function is the same as inflateReset, but it also permits changing the wrap and window size requests. The windowBits parameter is interpreted - the same as it is for inflateInit2. + the same as it is for inflateInit2. If the window size is changed, then the + memory allocated for the window is freed, and the window will be reallocated + by inflate() if needed. inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL), or if @@ -956,7 +1023,7 @@ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); location in the input stream can be determined from avail_in and data_type as noted in the description for the Z_BLOCK flush parameter for inflate. - inflateMark returns the value noted above or -1 << 16 if the provided + inflateMark returns the value noted above, or -65536 if the provided source stream state was inconsistent. */ @@ -1048,9 +1115,9 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, This routine would normally be used in a utility that reads zip or gzip files and writes out uncompressed files. The utility would decode the header and process the trailer on its own, hence this routine expects only - the raw deflate stream to decompress. This is different from the normal - behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. + the raw deflate stream to decompress. This is different from the default + behavior of inflate(), which expects a zlib header and trailer around the + deflate stream. inflateBack() uses two subroutines supplied by the caller that are then called by inflateBack() for input and output. inflateBack() calls those @@ -1059,12 +1126,12 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, parameters and return types are defined above in the in_func and out_func typedefs. inflateBack() will call in(in_desc, &buf) which should return the number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to + there is no input available, in() must return zero -- buf is ignored in that + case -- and inflateBack() will return a buffer error. inflateBack() will + call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. + out() should return zero on success, or non-zero on failure. If out() + returns non-zero, inflateBack() will return with an error. Neither in() nor + out() are permitted to change the contents of the window provided to inflateBackInit(), which is also the buffer that out() uses to write from. The length written by out() will be at most the window size. Any non-zero amount of input may be provided by in(). @@ -1092,7 +1159,7 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, using strm->next_in which will be Z_NULL only if in() returned an error. If strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning non-zero. (in() will always be called before out(), so strm->next_in is - assured to be defined if out() returns non-zero.) Note that inflateBack() + assured to be defined if out() returns non-zero.) Note that inflateBack() cannot return Z_OK. */ @@ -1114,7 +1181,7 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); 7.6: size of z_off_t Compiler, assembler, and debug options: - 8: DEBUG + 8: ZLIB_DEBUG 9: ASMV or ASMINF -- use ASM code 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention 11: 0 (reserved) @@ -1164,7 +1231,8 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. + compressed data. compress() is equivalent to compress2() with a level + parameter of Z_DEFAULT_COMPRESSION. compress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output @@ -1180,7 +1248,7 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. + compressed data. compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, @@ -1203,7 +1271,7 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some mechanism outside the scope of this compression library.) Upon exit, destLen - is the actual size of the uncompressed buffer. + is the actual size of the uncompressed data. uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output @@ -1212,6 +1280,14 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, buffer with the uncompressed data up to that point. */ +ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen)); +/* + Same as uncompress, except that sourceLen is a pointer, where the + length of the source is *sourceLen. On return, *sourceLen is the number of + source bytes consumed. +*/ + /* gzip file access functions */ /* @@ -1290,10 +1366,9 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); default buffer size is 8192 bytes. This function must be called after gzopen() or gzdopen(), and before any other calls that read or write the file. The buffer memory allocation is always deferred to the first read or - write. Two buffers are allocated, either both of the specified size when - writing, or one of the specified size and the other twice that size when - reading. A larger buffer size of, for example, 64K or 128K bytes will - noticeably increase the speed of decompression (reading). + write. Three times that size in buffer space is allocated. A larger buffer + size of, for example, 64K or 128K bytes will noticeably increase the speed + of decompression (reading). The new buffer size also affects the maximum length for gzprintf(). @@ -1304,10 +1379,12 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); /* Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. + of deflateInit2 for the meaning of these parameters. Previously provided + data is flushed before the parameter change. - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. + gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not + opened for writing, Z_ERRNO if there is an error writing the flushed data, + or Z_MEM_ERROR if there is a memory allocation error. */ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); @@ -1335,7 +1412,35 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); case. gzread returns the number of uncompressed bytes actually read, less than - len for end of file, or -1 for error. + len for end of file, or -1 for error. If len is too large to fit in an int, + then nothing is read, -1 is returned, and the error state is set to + Z_STREAM_ERROR. +*/ + +ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, + gzFile file)); +/* + Read up to nitems items of size size from file to buf, otherwise operating + as gzread() does. This duplicates the interface of stdio's fread(), with + size_t request and return types. If the library defines size_t, then + z_size_t is identical to size_t. If not, then z_size_t is an unsigned + integer type that can contain a pointer. + + gzfread() returns the number of full items read of size size, or zero if + the end of the file was reached and a full item could not be read, or if + there was an error. gzerror() must be consulted if zero is returned in + order to determine if there was an error. If the multiplication of size and + nitems overflows, i.e. the product does not fit in a z_size_t, then nothing + is read, zero is returned, and the error state is set to Z_STREAM_ERROR. + + In the event that the end of file is reached and only a partial item is + available at the end, i.e. the remaining uncompressed data length is not a + multiple of size, then the final partial item is nevetheless read into buf + and the end-of-file flag is set. The length of the partial item read is not + provided, but could be inferred from the result of gztell(). This behavior + is the same as the behavior of fread() implementations in common libraries, + but it prevents the direct use of gzfread() to read a concurrently written + file, reseting and retrying on end-of-file, when size is not 1. */ ZEXTERN int ZEXPORT gzwrite OF((gzFile file, @@ -1346,19 +1451,33 @@ ZEXTERN int ZEXPORT gzwrite OF((gzFile file, error. */ +ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, + z_size_t nitems, gzFile file)); +/* + gzfwrite() writes nitems items of size size from buf to file, duplicating + the interface of stdio's fwrite(), with size_t request and return types. If + the library defines size_t, then z_size_t is identical to size_t. If not, + then z_size_t is an unsigned integer type that can contain a pointer. + + gzfwrite() returns the number of full items written of size size, or zero + if there was an error. If the multiplication of size and nitems overflows, + i.e. the product does not fit in a z_size_t, then nothing is written, zero + is returned, and the error state is set to Z_STREAM_ERROR. +*/ + ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); /* Converts, formats, and writes the arguments to the compressed file under control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written, or 0 in case of error. The number of - uncompressed bytes written is limited to 8191, or one less than the buffer - size given to gzbuffer(). The caller should assure that this limit is not - exceeded. If it is exceeded, then gzprintf() will return an error (0) with - nothing written. In this case, there may also be a buffer overflow with - unpredictable consequences, which is possible only if zlib was compiled with - the insecure functions sprintf() or vsprintf() because the secure snprintf() - or vsnprintf() functions were not available. This can be determined using - zlibCompileFlags(). + uncompressed bytes actually written, or a negative zlib error code in case + of error. The number of uncompressed bytes written is limited to 8191, or + one less than the buffer size given to gzbuffer(). The caller should assure + that this limit is not exceeded. If it is exceeded, then gzprintf() will + return an error (0) with nothing written. In this case, there may also be a + buffer overflow with unpredictable consequences, which is possible only if + zlib was compiled with the insecure functions sprintf() or vsprintf() + because the secure snprintf() or vsnprintf() functions were not available. + This can be determined using zlibCompileFlags(). */ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); @@ -1418,7 +1537,7 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); If the flush parameter is Z_FINISH, the remaining data is written and the gzip stream is completed in the output. If gzwrite() is called again, a new gzip stream will be started in the output. gzread() is able to read such - concatented gzip streams. + concatenated gzip streams. gzflush should be called only when strictly necessary because it will degrade compression if called too often. @@ -1572,7 +1691,7 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); return the updated checksum. If buf is Z_NULL, this function returns the required initial value for the checksum. - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed much faster. Usage example: @@ -1585,6 +1704,12 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); if (adler != original_adler) error(); */ +ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, + z_size_t len)); +/* + Same as adler32(), but with a size_t length. +*/ + /* ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, z_off_t len2)); @@ -1614,6 +1739,12 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); if (crc != original_crc) error(); */ +ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf, + z_size_t len)); +/* + Same as crc32(), but with a size_t length. +*/ + /* ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); @@ -1644,19 +1775,35 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, unsigned char FAR *window, const char *version, int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ - (int)sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, (int)sizeof(z_stream)) +#ifdef Z_PREFIX_SET +# define z_deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +# define z_inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) +#else +# define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +# define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +# define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +# define inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) +#endif #ifndef Z_SOLO @@ -1676,10 +1823,10 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ #ifdef Z_PREFIX_SET # undef z_gzgetc # define z_gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) #else # define gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) #endif /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or @@ -1737,19 +1884,16 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ #endif /* !Z_SOLO */ -/* hack for buggy compilers */ -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; -#endif - /* undocumented functions */ ZEXTERN const char * ZEXPORT zError OF((int)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); +ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); +ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp)); ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); -#if defined(_WIN32) && !defined(Z_SOLO) +#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO) ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, const char *mode)); #endif diff --git a/tcod_sys/libtcod/src/zlib/zutil.c b/tcod_sys/libtcod/src/vendor/zlib/zutil.c similarity index 86% rename from tcod_sys/libtcod/src/zlib/zutil.c rename to tcod_sys/libtcod/src/vendor/zlib/zutil.c index 23d2ebef0..a76c6b0c7 100644 --- a/tcod_sys/libtcod/src/zlib/zutil.c +++ b/tcod_sys/libtcod/src/vendor/zlib/zutil.c @@ -1,5 +1,5 @@ /* zutil.c -- target dependent utility functions for the compression library - * Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly. + * Copyright (C) 1995-2017 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -10,21 +10,18 @@ # include "gzguts.h" #endif -#ifndef NO_DUMMY_DECL -struct internal_state {int dummy;}; /* for buggy compilers */ -#endif - z_const char * const z_errmsg[10] = { -"need dictionary", /* Z_NEED_DICT 2 */ -"stream end", /* Z_STREAM_END 1 */ -"", /* Z_OK 0 */ -"file error", /* Z_ERRNO (-1) */ -"stream error", /* Z_STREAM_ERROR (-2) */ -"data error", /* Z_DATA_ERROR (-3) */ -"insufficient memory", /* Z_MEM_ERROR (-4) */ -"buffer error", /* Z_BUF_ERROR (-5) */ -"incompatible version",/* Z_VERSION_ERROR (-6) */ -""}; + (z_const char *)"need dictionary", /* Z_NEED_DICT 2 */ + (z_const char *)"stream end", /* Z_STREAM_END 1 */ + (z_const char *)"", /* Z_OK 0 */ + (z_const char *)"file error", /* Z_ERRNO (-1) */ + (z_const char *)"stream error", /* Z_STREAM_ERROR (-2) */ + (z_const char *)"data error", /* Z_DATA_ERROR (-3) */ + (z_const char *)"insufficient memory", /* Z_MEM_ERROR (-4) */ + (z_const char *)"buffer error", /* Z_BUF_ERROR (-5) */ + (z_const char *)"incompatible version",/* Z_VERSION_ERROR (-6) */ + (z_const char *)"" +}; const char * ZEXPORT zlibVersion() @@ -61,7 +58,7 @@ uLong ZEXPORT zlibCompileFlags() case 8: flags += 2 << 6; break; default: flags += 3 << 6; } -#ifdef DEBUG +#ifdef ZLIB_DEBUG flags += 1 << 8; #endif #if defined(ASMV) || defined(ASMINF) @@ -115,8 +112,8 @@ uLong ZEXPORT zlibCompileFlags() return flags; } -#ifdef DEBUG - +#ifdef ZLIB_DEBUG +#include # ifndef verbose # define verbose 0 # endif @@ -219,9 +216,11 @@ local ptr_table table[MAX_PTR]; voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) { - voidpf buf = opaque; /* just to make some compilers happy */ + voidpf buf; ulg bsize = (ulg)items*size; + (void)opaque; + /* If we allocate less than 65520 bytes, we assume that farmalloc * will return a usable pointer which doesn't have to be normalized. */ @@ -244,6 +243,9 @@ voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) { int n; + + (void)opaque; + if (*(ush*)&ptr != 0) { /* object < 64K */ farfree(ptr); return; @@ -259,7 +261,6 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) next_ptr--; return; } - ptr = opaque; /* just to make some compilers happy */ Assert(0, "zcfree: ptr not found"); } @@ -278,13 +279,13 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size) { - if (opaque) opaque = 0; /* to make compiler happy */ + (void)opaque; return _halloc((long)items, size); } void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) { - if (opaque) opaque = 0; /* to make compiler happy */ + (void)opaque; _hfree(ptr); } @@ -306,7 +307,7 @@ voidpf ZLIB_INTERNAL zcalloc (opaque, items, size) unsigned items; unsigned size; { - if (opaque) items += size - size; /* make compiler happy */ + (void)opaque; return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : (voidpf)calloc(items, size); } @@ -315,8 +316,8 @@ void ZLIB_INTERNAL zcfree (opaque, ptr) voidpf opaque; voidpf ptr; { + (void)opaque; free(ptr); - if (opaque) return; /* make compiler happy */ } #endif /* MY_ZCALLOC */ diff --git a/tcod_sys/libtcod/src/zlib/zutil.h b/tcod_sys/libtcod/src/vendor/zlib/zutil.h similarity index 88% rename from tcod_sys/libtcod/src/zlib/zutil.h rename to tcod_sys/libtcod/src/vendor/zlib/zutil.h index 24ab06b1c..b079ea6a8 100644 --- a/tcod_sys/libtcod/src/zlib/zutil.h +++ b/tcod_sys/libtcod/src/vendor/zlib/zutil.h @@ -1,5 +1,5 @@ /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2013 Jean-loup Gailly. + * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -36,7 +36,9 @@ #ifndef local # define local static #endif -/* compile with -Dlocal if your debugger can't find static symbols */ +/* since "static" is used to mean two completely different things in C, we + define "local" for the non-static meaning of "static", for readability + (compile with -Dlocal if your debugger can't find static symbols) */ typedef unsigned char uch; typedef uch FAR uchf; @@ -98,28 +100,38 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #endif #ifdef AMIGA -# define OS_CODE 0x01 +# define OS_CODE 1 #endif #if defined(VAXC) || defined(VMS) -# define OS_CODE 0x02 +# define OS_CODE 2 # define F_OPEN(name, mode) \ fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") #endif +#ifdef __370__ +# if __TARGET_LIB__ < 0x20000000 +# define OS_CODE 4 +# elif __TARGET_LIB__ < 0x40000000 +# define OS_CODE 11 +# else +# define OS_CODE 8 +# endif +#endif + #if defined(ATARI) || defined(atarist) -# define OS_CODE 0x05 +# define OS_CODE 5 #endif #ifdef OS2 -# define OS_CODE 0x06 +# define OS_CODE 6 # if defined(M_I86) && !defined(Z_SOLO) # include # endif #endif #if defined(MACOS) || defined(TARGET_OS_MAC) -# define OS_CODE 0x07 +# define OS_CODE 7 # ifndef Z_SOLO # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os # include /* for fdopen */ @@ -131,18 +143,24 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # endif #endif -#ifdef TOPS20 -# define OS_CODE 0x0a +#ifdef __acorn +# define OS_CODE 13 #endif -#ifdef WIN32 -# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ -# define OS_CODE 0x0b -# endif +#if defined(WIN32) && !defined(__CYGWIN__) +# define OS_CODE 10 +#endif + +#ifdef _BEOS_ +# define OS_CODE 16 +#endif + +#ifdef __TOS_OS400__ +# define OS_CODE 18 #endif -#ifdef __50SERIES /* Prime/PRIMOS */ -# define OS_CODE 0x0f +#ifdef __APPLE__ +# define OS_CODE 19 #endif #if defined(_BEOS_) || defined(RISCOS) @@ -177,7 +195,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* common defaults */ #ifndef OS_CODE -# define OS_CODE 0x03 /* assume Unix */ +# define OS_CODE 3 /* assume Unix */ #endif #ifndef F_OPEN @@ -216,7 +234,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #endif /* Diagnostic functions */ -#ifdef DEBUG +#ifdef ZLIB_DEBUG # include extern int ZLIB_INTERNAL z_verbose; extern void ZLIB_INTERNAL z_error OF((char *m)); diff --git a/tcod_sys/libtcod/src/zip.cpp b/tcod_sys/libtcod/src/zip.cpp deleted file mode 100644 index cfb5b8661..000000000 --- a/tcod_sys/libtcod/src/zip.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* -* libtcod -* Copyright (c) 2008-2018 Jice & Mingos & rmtew -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * The name of Jice or Mingos may not be used to endorse or promote -* products derived from this software without specific prior written -* permission. -* -* THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#include - -TCODZip::TCODZip() { - data=TCOD_zip_new(); -} - -TCODZip::~TCODZip() { - TCOD_zip_delete(data); -} - -void TCODZip::putChar(char val) { - TCOD_zip_put_char(data,val); -} - -void TCODZip::putInt(int val) { - TCOD_zip_put_int(data,val); -} - -void TCODZip::putFloat(float val) { - TCOD_zip_put_float(data,val); -} - -void TCODZip::putString(const char *val) { - TCOD_zip_put_string(data,val); -} - -void TCODZip::putData(int nbBytes, const void *pdata) { - TCOD_zip_put_data(data,nbBytes,pdata); -} - -void TCODZip::putColor(const TCODColor *val) { - TCOD_color_t col; - col.r=val->r; - col.g=val->g; - col.b=val->b; - TCOD_zip_put_color(data,col); -} - -#ifdef TCOD_IMAGE_SUPPORT -void TCODZip::putImage(const TCODImage *val) { - TCOD_zip_put_image(data,val->data); -} -#endif - -#ifdef TCOD_CONSOLE_SUPPORT -void TCODZip::putConsole(const TCODConsole *val) { - TCOD_zip_put_console(data,val->data); -} -#endif - -int TCODZip::saveToFile(const char *filename) { - return TCOD_zip_save_to_file(data,filename); -} - -int TCODZip::loadFromFile(const char *filename) { - return TCOD_zip_load_from_file(data,filename); -} - -char TCODZip::getChar() { - return TCOD_zip_get_char(data); -} - -int TCODZip::getInt() { - return TCOD_zip_get_int(data); -} - -float TCODZip::getFloat() { - return TCOD_zip_get_float(data); -} - -const char *TCODZip::getString() { - return TCOD_zip_get_string(data); -} - -int TCODZip::getData(int nbBytes, void *pdata) { - return TCOD_zip_get_data(data,nbBytes,pdata); -} - -TCODColor TCODZip::getColor() { - return TCODColor(TCOD_zip_get_color(data)); -} - -#ifdef TCOD_IMAGE_SUPPORT -TCODImage *TCODZip::getImage() { - return new TCODImage(TCOD_zip_get_image(data)); -} -#endif - -#ifdef TCOD_CONSOLE_SUPPORT -TCODConsole *TCODZip::getConsole() { - return new TCODConsole(TCOD_zip_get_console(data)); -} -#endif - -uint32_t TCODZip::getCurrentBytes() const { - return TCOD_zip_get_current_bytes(data); -} - -uint32_t TCODZip::getRemainingBytes() const { - return TCOD_zip_get_remaining_bytes(data); -} - -void TCODZip::skipBytes(uint32_t nbBytes) { - TCOD_zip_skip_bytes(data,nbBytes); -} diff --git a/tcod_sys/libtcod/src/zlib/uncompr.c b/tcod_sys/libtcod/src/zlib/uncompr.c deleted file mode 100644 index 242e9493d..000000000 --- a/tcod_sys/libtcod/src/zlib/uncompr.c +++ /dev/null @@ -1,59 +0,0 @@ -/* uncompr.c -- decompress a memory buffer - * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#define ZLIB_INTERNAL -#include "zlib.h" - -/* =========================================================================== - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted. -*/ -int ZEXPORT uncompress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; -{ - z_stream stream; - int err; - - stream.next_in = (z_const Bytef *)source; - stream.avail_in = (uInt)sourceLen; - /* Check for source > 64K on 16-bit machine: */ - if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; - - stream.next_out = dest; - stream.avail_out = (uInt)*destLen; - if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; - - stream.zalloc = (alloc_func)0; - stream.zfree = (free_func)0; - - err = inflateInit(&stream); - if (err != Z_OK) return err; - - err = inflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - inflateEnd(&stream); - if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) - return Z_DATA_ERROR; - return err; - } - *destLen = stream.total_out; - - err = inflateEnd(&stream); - return err; -} diff --git a/tcod_sys/x86_64-pc-windows-msvc_bindings.rs b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs index c88618fca..adb609095 100644 --- a/tcod_sys/x86_64-pc-windows-msvc_bindings.rs +++ b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs @@ -2,6 +2,36 @@ pub type TCOD_font_flags_t_type = i32; +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub const fn new() -> Self { + __IncompleteArrayField(::std::marker::PhantomData, []) + } + #[inline] + pub fn as_ptr(&self) -> *const T { + self as *const _ as *const T + } + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut T { + self as *mut _ as *mut T + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::std::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::std::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} pub const __llvm__: u32 = 1; pub const __clang__: u32 = 1; pub const __clang_major__: u32 = 10; @@ -432,70 +462,18 @@ pub const S_IWRITE: u32 = 128; pub const S_IEXEC: u32 = 64; pub const WCHAR_MIN: u32 = 0; pub const WCHAR_MAX: u32 = 65535; -pub const CHAR_BIT: u32 = 8; -pub const SCHAR_MIN: i32 = -128; -pub const SCHAR_MAX: u32 = 127; -pub const UCHAR_MAX: u32 = 255; -pub const CHAR_MIN: i32 = -128; -pub const CHAR_MAX: u32 = 127; -pub const MB_LEN_MAX: u32 = 5; -pub const SHRT_MIN: i32 = -32768; -pub const SHRT_MAX: u32 = 32767; -pub const USHRT_MAX: u32 = 65535; -pub const INT_MIN: i32 = -2147483648; -pub const INT_MAX: u32 = 2147483647; -pub const UINT_MAX: u32 = 4294967295; -pub const LONG_MIN: i32 = -2147483648; -pub const LONG_MAX: u32 = 2147483647; -pub const ULONG_MAX: u32 = 4294967295; -pub const LLONG_MAX: u64 = 9223372036854775807; -pub const LLONG_MIN: i64 = -9223372036854775808; -pub const ULLONG_MAX: i32 = -1; -pub const LONG_LONG_MAX: u64 = 9223372036854775807; -pub const LONG_LONG_MIN: i64 = -9223372036854775808; -pub const ULONG_LONG_MAX: i32 = -1; -pub const NSIG: u32 = 23; -pub const SIGINT: u32 = 2; -pub const SIGILL: u32 = 4; -pub const SIGFPE: u32 = 8; -pub const SIGSEGV: u32 = 11; -pub const SIGTERM: u32 = 15; -pub const SIGBREAK: u32 = 21; -pub const SIGABRT: u32 = 22; -pub const SIGABRT_COMPAT: u32 = 6; pub const WINT_MIN: u32 = 0; pub const WINT_MAX: u32 = 65535; -pub const PRINTF_INT64_MODIFIER: &'static [u8; 3usize] = b"ll\0"; -pub const PRINTF_INT32_MODIFIER: &'static [u8; 1usize] = b"\0"; -pub const PRINTF_INT16_MODIFIER: &'static [u8; 2usize] = b"h\0"; -pub const PRINTF_INTMAX_MODIFIER: &'static [u8; 3usize] = b"ll\0"; -pub const PRINTF_INT64_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; -pub const PRINTF_UINT64_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; -pub const PRINTF_INT32_HEX_WIDTH: &'static [u8; 2usize] = b"8\0"; -pub const PRINTF_UINT32_HEX_WIDTH: &'static [u8; 2usize] = b"8\0"; -pub const PRINTF_INT16_HEX_WIDTH: &'static [u8; 2usize] = b"4\0"; -pub const PRINTF_UINT16_HEX_WIDTH: &'static [u8; 2usize] = b"4\0"; -pub const PRINTF_INT8_HEX_WIDTH: &'static [u8; 2usize] = b"2\0"; -pub const PRINTF_UINT8_HEX_WIDTH: &'static [u8; 2usize] = b"2\0"; -pub const PRINTF_INT64_DEC_WIDTH: &'static [u8; 3usize] = b"19\0"; -pub const PRINTF_UINT64_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; -pub const PRINTF_INT32_DEC_WIDTH: &'static [u8; 3usize] = b"10\0"; -pub const PRINTF_UINT32_DEC_WIDTH: &'static [u8; 3usize] = b"10\0"; -pub const PRINTF_INT16_DEC_WIDTH: &'static [u8; 2usize] = b"5\0"; -pub const PRINTF_UINT16_DEC_WIDTH: &'static [u8; 2usize] = b"5\0"; -pub const PRINTF_INT8_DEC_WIDTH: &'static [u8; 2usize] = b"3\0"; -pub const PRINTF_UINT8_DEC_WIDTH: &'static [u8; 2usize] = b"3\0"; -pub const PRINTF_INTMAX_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; -pub const PRINTF_UINTMAX_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; -pub const PRINTF_INTMAX_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; -pub const PRINTF_UINTMAX_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; pub const true_: u32 = 1; pub const false_: u32 = 0; pub const __bool_true_false_are_defined: u32 = 1; -pub const TCOD_HEXVERSION: u32 = 67328; -pub const TCOD_STRVERSION: &'static [u8; 6usize] = b"1.7.0\0"; -pub const TCOD_TECHVERSION: u32 = 17235968; -pub const TCOD_STRVERSIONNAME: &'static [u8; 14usize] = b"libtcod 1.7.0\0"; +pub const TCOD_MAJOR_VERSION: u32 = 1; +pub const TCOD_MINOR_VERSION: u32 = 16; +pub const TCOD_PATCHLEVEL: u32 = 0; +pub const TCOD_STRVERSION: &'static [u8; 16usize] = b"1.16.0-alpha.12\0"; +pub const TCOD_HEXVERSION: u32 = 69632; +pub const TCOD_TECHVERSION: u32 = 17825792; +pub const TCOD_STRVERSIONNAME: &'static [u8; 24usize] = b"libtcod 1.16.0-alpha.12\0"; pub const TCOD_KEY_TEXT_SIZE: u32 = 32; pub const TCOD_NOISE_MAX_OCTAVES: u32 = 128; pub const TCOD_NOISE_MAX_DIMENSIONS: u32 = 4; @@ -519,6 +497,9 @@ pub const TCOD_LEX_MAX_SYMBOLS: u32 = 100; pub const TCOD_LEX_SYMBOL_SIZE: u32 = 5; pub const TCOD_LEX_MAX_KEYWORDS: u32 = 100; pub const TCOD_LEX_KEYWORD_SIZE: u32 = 20; +pub const TCOD_HEAP_DEFAULT_CAPACITY: u32 = 256; +pub const TCOD_HEAP_MAX_NODE_SIZE: u32 = 256; +pub const TCOD_PATHFINDER_MAX_DIMENSIONS: u32 = 4; pub type va_list = *mut ::std::os::raw::c_char; extern "C" { pub fn __va_start(arg1: *mut *mut ::std::os::raw::c_char, ...); @@ -3405,18 +3386,6 @@ extern "C" { pub fn wmemmove_s(_S1: *mut wchar_t, _N1: rsize_t, _S2: *const wchar_t, _N: rsize_t) -> errno_t; } -pub type max_align_t = f64; -pub type sig_atomic_t = ::std::os::raw::c_int; -pub type _crt_signal_t = ::std::option::Option; -extern "C" { - pub fn __pxcptinfoptrs() -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn signal(_Signal: ::std::os::raw::c_int, _Function: _crt_signal_t) -> _crt_signal_t; -} -extern "C" { - pub fn raise(_Signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} pub type int_least8_t = ::std::os::raw::c_schar; pub type int_least16_t = ::std::os::raw::c_short; pub type int_least32_t = ::std::os::raw::c_int; @@ -3451,12 +3420,6 @@ extern "C" { n: size_t, ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn strcasestr( - haystack: *const ::std::os::raw::c_char, - needle: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} #[doc = " \\brief A callback to be passed to TCOD_line"] #[doc = ""] #[doc = " The points given to the callback include both the starting and ending"] @@ -3635,7 +3598,12 @@ extern "C" { data: *mut TCOD_bresenham_data_t, ) -> bool; } -pub type TCOD_random_t = *mut ::std::os::raw::c_void; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Random { + _unused: [u8; 0], +} +pub type TCOD_random_t = *mut TCOD_Random; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct TCOD_dice_t { @@ -3992,56 +3960,119 @@ extern "C" { extern "C" { pub fn TCOD_bsp_remove_sons(node: *mut TCOD_bsp_t); } -#[doc = " \\brief An RGB color struct."] +#[doc = " A three channel color struct."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct TCOD_color_t { +pub struct TCOD_ColorRGB { pub r: u8, pub g: u8, pub b: u8, } #[test] -fn bindgen_test_layout_TCOD_color_t() { +fn bindgen_test_layout_TCOD_ColorRGB() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 3usize, - concat!("Size of: ", stringify!(TCOD_color_t)) + concat!("Size of: ", stringify!(TCOD_ColorRGB)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_ColorRGB)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGB), + "::", + stringify!(r) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGB), + "::", + stringify!(g) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGB), + "::", + stringify!(b) + ) + ); +} +pub type TCOD_color_t = TCOD_ColorRGB; +#[doc = " A four channel color struct."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ColorRGBA { + pub r: u8, + pub g: u8, + pub b: u8, + pub a: u8, +} +#[test] +fn bindgen_test_layout_TCOD_ColorRGBA() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(TCOD_ColorRGBA)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(TCOD_color_t)) + concat!("Alignment of ", stringify!(TCOD_ColorRGBA)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_color_t), + stringify!(TCOD_ColorRGBA), "::", stringify!(r) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, 1usize, concat!( "Offset of field: ", - stringify!(TCOD_color_t), + stringify!(TCOD_ColorRGBA), "::", stringify!(g) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, 2usize, concat!( "Offset of field: ", - stringify!(TCOD_color_t), + stringify!(TCOD_ColorRGBA), "::", stringify!(b) ) ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGBA), + "::", + stringify!(a) + ) + ); } extern "C" { pub fn TCOD_color_RGB(r: u8, g: u8, b: u8) -> TCOD_color_t; @@ -4067,6 +4098,13 @@ extern "C" { extern "C" { pub fn TCOD_color_lerp(c1: TCOD_color_t, c2: TCOD_color_t, coef: f32) -> TCOD_color_t; } +extern "C" { + #[doc = " Blend `src` into `dst` as an alpha blending operation."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_color_alpha_blend(dst: *mut TCOD_ColorRGBA, src: *const TCOD_ColorRGBA); +} extern "C" { pub fn TCOD_color_set_HSV(color: *mut TCOD_color_t, hue: f32, saturation: f32, value: f32); } @@ -4774,746 +4812,825 @@ extern "C" { extern "C" { pub static TCOD_peach: TCOD_color_t; } -pub type TCOD_console_t = *mut ::std::os::raw::c_void; #[repr(i32)] +#[doc = " An enum of libtcod error codes."] +#[doc = ""] +#[doc = " On values other than `TCOD_E_OK` you can use `TCOD_get_error()` to learn"] +#[doc = " more information."] +#[doc = " \\rst"] +#[doc = " .. versionadded:: 1.16"] +#[doc = " \\endrst"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_keycode_t { - TCODK_NONE = 0, - TCODK_ESCAPE = 1, - TCODK_BACKSPACE = 2, - TCODK_TAB = 3, - TCODK_ENTER = 4, - TCODK_SHIFT = 5, - TCODK_CONTROL = 6, - TCODK_ALT = 7, - TCODK_PAUSE = 8, - TCODK_CAPSLOCK = 9, - TCODK_PAGEUP = 10, - TCODK_PAGEDOWN = 11, - TCODK_END = 12, - TCODK_HOME = 13, - TCODK_UP = 14, - TCODK_LEFT = 15, - TCODK_RIGHT = 16, - TCODK_DOWN = 17, - TCODK_PRINTSCREEN = 18, - TCODK_INSERT = 19, - TCODK_DELETE = 20, - TCODK_LWIN = 21, - TCODK_RWIN = 22, - TCODK_APPS = 23, - TCODK_0 = 24, - TCODK_1 = 25, - TCODK_2 = 26, - TCODK_3 = 27, - TCODK_4 = 28, - TCODK_5 = 29, - TCODK_6 = 30, - TCODK_7 = 31, - TCODK_8 = 32, - TCODK_9 = 33, - TCODK_KP0 = 34, - TCODK_KP1 = 35, - TCODK_KP2 = 36, - TCODK_KP3 = 37, - TCODK_KP4 = 38, - TCODK_KP5 = 39, - TCODK_KP6 = 40, - TCODK_KP7 = 41, - TCODK_KP8 = 42, - TCODK_KP9 = 43, - TCODK_KPADD = 44, - TCODK_KPSUB = 45, - TCODK_KPDIV = 46, - TCODK_KPMUL = 47, - TCODK_KPDEC = 48, - TCODK_KPENTER = 49, - TCODK_F1 = 50, - TCODK_F2 = 51, - TCODK_F3 = 52, - TCODK_F4 = 53, - TCODK_F5 = 54, - TCODK_F6 = 55, - TCODK_F7 = 56, - TCODK_F8 = 57, - TCODK_F9 = 58, - TCODK_F10 = 59, - TCODK_F11 = 60, - TCODK_F12 = 61, - TCODK_NUMLOCK = 62, - TCODK_SCROLLLOCK = 63, - TCODK_SPACE = 64, - TCODK_CHAR = 65, - TCODK_TEXT = 66, +pub enum TCOD_Error { + #[doc = " The function completed successfully without issues."] + #[doc = ""] + #[doc = " A function is successful when `(err >= 0)`. Positive values may be used"] + #[doc = " for warnings, or for other outputs."] + TCOD_E_OK = 0, + #[doc = " The error code for generic runtime errors."] + #[doc = ""] + #[doc = " The returned code my be changed in the future to something more specific."] + #[doc = " Use `(err < 0)` to check if the value is an error."] + TCOD_E_ERROR = -1, + #[doc = " The function failed because a given input argument was invalid."] + TCOD_E_INVALID_ARGUMENT = -2, + #[doc = " The function failed because it was unable to allocate enough memory."] + TCOD_E_OUT_OF_MEMORY = -3, + #[doc = " The function completed, but a minor issue was detected."] + TCOD_E_WARN = 1, +} +extern "C" { + #[doc = " Return the last error message. If there is no error then the string will"] + #[doc = " have a length of zero."] + #[doc = ""] + #[doc = " The error state is thread specific."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.12"] + #[doc = " \\endrst"] + pub fn TCOD_get_error() -> *const ::std::os::raw::c_char; +} +extern "C" { + #[doc = " Set an error message and return TCOD_E_ERROR."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.12"] + #[doc = " \\endrst"] + pub fn TCOD_set_error(msg: *const ::std::os::raw::c_char) -> TCOD_Error; +} +extern "C" { + #[doc = " Set an error message and return TCOD_E_ERROR."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_set_errorf(fmt: *const ::std::os::raw::c_char, ...) -> TCOD_Error; +} +extern "C" { + #[doc = " Clear a current existing error message."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_clear_error(); } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct TCOD_key_t { - pub vk: TCOD_keycode_t, - pub c: ::std::os::raw::c_char, - pub text: [::std::os::raw::c_char; 32usize], - pub pressed: bool, - pub lalt: bool, - pub lctrl: bool, - pub lmeta: bool, - pub ralt: bool, - pub rctrl: bool, - pub rmeta: bool, - pub shift: bool, +pub struct TCOD_TilesetObserver { + pub tileset: *mut TCOD_Tileset, + pub next: *mut TCOD_TilesetObserver, + pub userdata: *mut ::std::os::raw::c_void, + pub on_observer_delete: + ::std::option::Option, + pub on_tile_changed: ::std::option::Option< + unsafe extern "C" fn( + observer: *mut TCOD_TilesetObserver, + tile_id: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, } #[test] -fn bindgen_test_layout_TCOD_key_t() { +fn bindgen_test_layout_TCOD_TilesetObserver() { assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(TCOD_key_t)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_TilesetObserver)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(TCOD_key_t)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_TilesetObserver)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).vk as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_TilesetObserver), "::", - stringify!(vk) + stringify!(tileset) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_TilesetObserver), "::", - stringify!(c) + stringify!(next) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).text as *const _ as usize }, - 5usize, + unsafe { &(*(::std::ptr::null::())).userdata as *const _ as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_TilesetObserver), "::", - stringify!(text) + stringify!(userdata) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pressed as *const _ as usize }, - 37usize, + unsafe { + &(*(::std::ptr::null::())).on_observer_delete as *const _ as usize + }, + 24usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_TilesetObserver), "::", - stringify!(pressed) + stringify!(on_observer_delete) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lalt as *const _ as usize }, - 38usize, + unsafe { + &(*(::std::ptr::null::())).on_tile_changed as *const _ as usize + }, + 32usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_TilesetObserver), "::", - stringify!(lalt) + stringify!(on_tile_changed) ) ); +} +impl Default for TCOD_TilesetObserver { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Tileset { + pub tile_width: ::std::os::raw::c_int, + pub tile_height: ::std::os::raw::c_int, + pub tile_length: ::std::os::raw::c_int, + pub tiles_capacity: ::std::os::raw::c_int, + pub tiles_count: ::std::os::raw::c_int, + pub pixels: *mut TCOD_ColorRGBA, + pub character_map_length: ::std::os::raw::c_int, + pub character_map: *mut ::std::os::raw::c_int, + pub observer_list: *mut TCOD_TilesetObserver, + pub virtual_columns: ::std::os::raw::c_int, + pub ref_count: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_Tileset() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(TCOD_Tileset)) + ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lctrl as *const _ as usize }, - 39usize, + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Tileset)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tile_width as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Tileset), "::", - stringify!(lctrl) + stringify!(tile_width) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lmeta as *const _ as usize }, - 40usize, + unsafe { &(*(::std::ptr::null::())).tile_height as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Tileset), "::", - stringify!(lmeta) + stringify!(tile_height) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ralt as *const _ as usize }, - 41usize, + unsafe { &(*(::std::ptr::null::())).tile_length as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Tileset), "::", - stringify!(ralt) + stringify!(tile_length) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rctrl as *const _ as usize }, - 42usize, + unsafe { &(*(::std::ptr::null::())).tiles_capacity as *const _ as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Tileset), "::", - stringify!(rctrl) + stringify!(tiles_capacity) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rmeta as *const _ as usize }, - 43usize, + unsafe { &(*(::std::ptr::null::())).tiles_count as *const _ as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Tileset), "::", - stringify!(rmeta) + stringify!(tiles_count) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).shift as *const _ as usize }, - 44usize, + unsafe { &(*(::std::ptr::null::())).pixels as *const _ as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Tileset), "::", - stringify!(shift) + stringify!(pixels) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).character_map_length as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(character_map_length) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).character_map as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(character_map) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).observer_list as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(observer_list) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).virtual_columns as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(virtual_columns) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ref_count as *const _ as usize }, + 60usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(ref_count) ) ); } -impl Default for TCOD_key_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_chars_t { - TCOD_CHAR_HLINE = 196, - TCOD_CHAR_VLINE = 179, - TCOD_CHAR_NE = 191, - TCOD_CHAR_NW = 218, - TCOD_CHAR_SE = 217, - TCOD_CHAR_SW = 192, - TCOD_CHAR_TEEW = 180, - TCOD_CHAR_TEEE = 195, - TCOD_CHAR_TEEN = 193, - TCOD_CHAR_TEES = 194, - TCOD_CHAR_CROSS = 197, - TCOD_CHAR_DHLINE = 205, - TCOD_CHAR_DVLINE = 186, - TCOD_CHAR_DNE = 187, - TCOD_CHAR_DNW = 201, - TCOD_CHAR_DSE = 188, - TCOD_CHAR_DSW = 200, - TCOD_CHAR_DTEEW = 185, - TCOD_CHAR_DTEEE = 204, - TCOD_CHAR_DTEEN = 202, - TCOD_CHAR_DTEES = 203, - TCOD_CHAR_DCROSS = 206, - TCOD_CHAR_BLOCK1 = 176, - TCOD_CHAR_BLOCK2 = 177, - TCOD_CHAR_BLOCK3 = 178, - TCOD_CHAR_ARROW_N = 24, - TCOD_CHAR_ARROW_S = 25, - TCOD_CHAR_ARROW_E = 26, - TCOD_CHAR_ARROW_W = 27, - TCOD_CHAR_ARROW2_N = 30, - TCOD_CHAR_ARROW2_S = 31, - TCOD_CHAR_ARROW2_E = 16, - TCOD_CHAR_ARROW2_W = 17, - TCOD_CHAR_DARROW_H = 29, - TCOD_CHAR_DARROW_V = 18, - TCOD_CHAR_CHECKBOX_UNSET = 224, - TCOD_CHAR_CHECKBOX_SET = 225, - TCOD_CHAR_RADIO_UNSET = 9, - TCOD_CHAR_RADIO_SET = 10, - TCOD_CHAR_SUBP_NW = 226, - TCOD_CHAR_SUBP_NE = 227, - TCOD_CHAR_SUBP_N = 228, - TCOD_CHAR_SUBP_SE = 229, - TCOD_CHAR_SUBP_DIAG = 230, - TCOD_CHAR_SUBP_E = 231, - TCOD_CHAR_SUBP_SW = 232, - TCOD_CHAR_SMILIE = 1, - TCOD_CHAR_SMILIE_INV = 2, - TCOD_CHAR_HEART = 3, - TCOD_CHAR_DIAMOND = 4, - TCOD_CHAR_CLUB = 5, - TCOD_CHAR_SPADE = 6, - TCOD_CHAR_BULLET = 7, - TCOD_CHAR_BULLET_INV = 8, - TCOD_CHAR_MALE = 11, - TCOD_CHAR_FEMALE = 12, - TCOD_CHAR_NOTE = 13, - TCOD_CHAR_NOTE_DOUBLE = 14, - TCOD_CHAR_LIGHT = 15, - TCOD_CHAR_EXCLAM_DOUBLE = 19, - TCOD_CHAR_PILCROW = 20, - TCOD_CHAR_SECTION = 21, - TCOD_CHAR_POUND = 156, - TCOD_CHAR_MULTIPLICATION = 158, - TCOD_CHAR_FUNCTION = 159, - TCOD_CHAR_RESERVED = 169, - TCOD_CHAR_HALF = 171, - TCOD_CHAR_ONE_QUARTER = 172, - TCOD_CHAR_COPYRIGHT = 184, - TCOD_CHAR_CENT = 189, - TCOD_CHAR_YEN = 190, - TCOD_CHAR_CURRENCY = 207, - TCOD_CHAR_THREE_QUARTERS = 243, - TCOD_CHAR_DIVISION = 246, - TCOD_CHAR_GRADE = 248, - TCOD_CHAR_UMLAUT = 249, - TCOD_CHAR_POW1 = 251, - TCOD_CHAR_POW3 = 252, - TCOD_CHAR_POW2 = 253, - TCOD_CHAR_BULLET_SQUARE = 254, -} -impl TCOD_colctrl_t { - pub const TCOD_COLCTRL_NUMBER: TCOD_colctrl_t = TCOD_colctrl_t::TCOD_COLCTRL_5; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_colctrl_t { - TCOD_COLCTRL_1 = 1, - TCOD_COLCTRL_2 = 2, - TCOD_COLCTRL_3 = 3, - TCOD_COLCTRL_4 = 4, - TCOD_COLCTRL_5 = 5, - TCOD_COLCTRL_FORE_RGB = 6, - TCOD_COLCTRL_BACK_RGB = 7, - TCOD_COLCTRL_STOP = 8, +impl Default for TCOD_Tileset { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_bkgnd_flag_t { - TCOD_BKGND_NONE = 0, - TCOD_BKGND_SET = 1, - TCOD_BKGND_MULTIPLY = 2, - TCOD_BKGND_LIGHTEN = 3, - TCOD_BKGND_DARKEN = 4, - TCOD_BKGND_SCREEN = 5, - TCOD_BKGND_COLOR_DODGE = 6, - TCOD_BKGND_COLOR_BURN = 7, - TCOD_BKGND_ADD = 8, - TCOD_BKGND_ADDA = 9, - TCOD_BKGND_BURN = 10, - TCOD_BKGND_OVERLAY = 11, - TCOD_BKGND_ALPH = 12, - TCOD_BKGND_DEFAULT = 13, +extern "C" { + #[doc = " Create a new tile-set with the given tile size."] + pub fn TCOD_tileset_new( + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; } -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_key_status_t { - TCOD_KEY_PRESSED = 1, - TCOD_KEY_RELEASED = 2, +extern "C" { + #[doc = " Delete a tile-set."] + pub fn TCOD_tileset_delete(tileset: *mut TCOD_Tileset); } -impl TCOD_font_flags_t { - #[doc = " Tiles are arranged in column-major order."] +extern "C" { + #[doc = " Return the pixel width of tiles in this tileset."] #[doc = ""] - #[doc = " 0 3 6"] - #[doc = " 1 4 7"] - #[doc = " 2 5 8"] - pub const TCOD_FONT_LAYOUT_ASCII_INCOL: TCOD_font_flags_t = TCOD_font_flags_t(1); + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_width_(tileset: *const TCOD_Tileset) -> ::std::os::raw::c_int; } -impl TCOD_font_flags_t { - #[doc = " Tiles are arranged in row-major order."] +extern "C" { + #[doc = " Return the pixel height of tiles in this tileset."] #[doc = ""] - #[doc = " 0 1 2"] - #[doc = " 3 4 5"] - #[doc = " 6 7 8"] - pub const TCOD_FONT_LAYOUT_ASCII_INROW: TCOD_font_flags_t = TCOD_font_flags_t(2); -} -impl TCOD_font_flags_t { - #[doc = " Converts all tiles into a monochrome gradient."] - pub const TCOD_FONT_TYPE_GREYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); -} -impl TCOD_font_flags_t { - #[doc = " Converts all tiles into a monochrome gradient."] - pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); -} -impl TCOD_font_flags_t { - #[doc = " A unique layout used by some of libtcod's fonts."] - pub const TCOD_FONT_LAYOUT_TCOD: TCOD_font_flags_t = TCOD_font_flags_t(8); -} -impl ::std::ops::BitOr for TCOD_font_flags_t { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - TCOD_font_flags_t(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for TCOD_font_flags_t { - #[inline] - fn bitor_assign(&mut self, rhs: TCOD_font_flags_t) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for TCOD_font_flags_t { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - TCOD_font_flags_t(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for TCOD_font_flags_t { - #[inline] - fn bitand_assign(&mut self, rhs: TCOD_font_flags_t) { - self.0 &= rhs.0; - } + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_height_(tileset: *const TCOD_Tileset) -> ::std::os::raw::c_int; } -#[repr(transparent)] -#[doc = " These font flags can be OR'd together into a bit-field and passed to"] -#[doc = " TCOD_console_set_custom_font"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub struct TCOD_font_flags_t(pub i32); -#[repr(i32)] -#[doc = " The available renderers."] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_renderer_t { - #[doc = " An OpenGL implementation using a shader."] - TCOD_RENDERER_GLSL = 0, - #[doc = " An OpenGL implementation without a shader."] +extern "C" { + #[doc = " Fetch a tile, outputting its data to a pixel buffer."] #[doc = ""] - #[doc = " Performs worse than TCOD_RENDERER_GLSL without many benefits."] - TCOD_RENDERER_OPENGL = 1, - #[doc = " A software based renderer."] + #[doc = " `codepoint` is the index for the tile. Unicode is recommend."] #[doc = ""] - #[doc = " The font file is loaded into RAM instead of VRAM in this implementation."] - TCOD_RENDERER_SDL = 2, - #[doc = " A software based renderer."] + #[doc = " `buffer` is a pointer to a contiguous row-major array of pixels. The tile"] + #[doc = " data will be outputted here. This pointer can be NULL if you only want to"] + #[doc = " know if the tileset has a specific tile."] #[doc = ""] - #[doc = " The font file is loaded into RAM instead of VRAM in this implementation."] - TCOD_NB_RENDERERS = 3, -} -#[repr(i32)] -#[doc = " \\enum TCOD_alignment_t"] -#[doc = ""] -#[doc = " Print justification options."] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_alignment_t { - TCOD_LEFT = 0, - TCOD_RIGHT = 1, - TCOD_CENTER = 2, + #[doc = " Returns 0 if the tile exists. Returns a negative value on an error or if"] + #[doc = " the tileset does not have a tile for this codepoint."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_( + tileset: *const TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + buffer: *mut TCOD_ColorRGBA, + ) -> TCOD_Error; } -pub type TCOD_image_t = *mut ::std::os::raw::c_void; extern "C" { - pub fn TCOD_image_new( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> TCOD_image_t; + #[doc = " Upload a tile from a pixel buffer into this tileset."] + #[doc = ""] + #[doc = " `codepoint` is the index for the tile. Unicode is recommend."] + #[doc = ""] + #[doc = " `buffer` is a pointer to a contiguous row-major array of pixels."] + #[doc = " This can not be NULL."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_set_tile_( + tileset: *mut TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + buffer: *const TCOD_ColorRGBA, + ) -> TCOD_Error; } extern "C" { - pub fn TCOD_image_from_console(console: TCOD_console_t) -> TCOD_image_t; + #[doc = " Load a font from a tilesheet."] + pub fn TCOD_tileset_load( + filename: *const ::std::os::raw::c_char, + columns: ::std::os::raw::c_int, + rows: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + charmap: *mut ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; } extern "C" { - pub fn TCOD_image_refresh_console(image: TCOD_image_t, console: TCOD_console_t); + #[doc = " Assign a codepoint to an existing tile based on its tile ID."] + #[doc = ""] + #[doc = " Returns the tile ID on success."] + #[doc = ""] + #[doc = " Returns a negative value on error."] + pub fn TCOD_tileset_assign_tile( + tileset: *mut TCOD_Tileset, + tile_id: ::std::os::raw::c_int, + codepoint: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_image_load(filename: *const ::std::os::raw::c_char) -> TCOD_image_t; + #[doc = " Return a pointer to the tile for `codepoint`."] + #[doc = ""] + #[doc = " Returns NULL if no tile exists for codepoint."] + pub fn TCOD_tileset_get_tile( + tileset: *const TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + ) -> *const TCOD_ColorRGBA; } extern "C" { - pub fn TCOD_image_clear(image: TCOD_image_t, color: TCOD_color_t); + #[doc = " Return a new observer to this tileset."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_observer_new(tileset: *mut TCOD_Tileset) -> *mut TCOD_TilesetObserver; } extern "C" { - pub fn TCOD_image_invert(image: TCOD_image_t); + #[doc = " Delete an existing observer."] + #[doc = ""] + #[doc = " Will call this observers on_observer_delete callback."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_observer_delete(observer: *mut TCOD_TilesetObserver); } extern "C" { - pub fn TCOD_image_hflip(image: TCOD_image_t); + #[doc = " Called to notify any observers that a tile has been changed. This may"] + #[doc = " cause running atlases to update or mark cache consoles as dirty."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_notify_tile_changed( + tileset: *mut TCOD_Tileset, + tile_id: ::std::os::raw::c_int, + ); } extern "C" { - pub fn TCOD_image_rotate90(image: TCOD_image_t, numRotations: ::std::os::raw::c_int); + #[doc = " Reserve memory for a specific amount of tiles."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_reserve( + tileset: *mut TCOD_Tileset, + desired: ::std::os::raw::c_int, + ) -> TCOD_Error; } -extern "C" { - pub fn TCOD_image_vflip(image: TCOD_image_t); +#[repr(i32)] +#[doc = " \\enum TCOD_bkgnd_flag_t"] +#[doc = ""] +#[doc = " Background color blend modes."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_bkgnd_flag_t { + TCOD_BKGND_NONE = 0, + TCOD_BKGND_SET = 1, + TCOD_BKGND_MULTIPLY = 2, + TCOD_BKGND_LIGHTEN = 3, + TCOD_BKGND_DARKEN = 4, + TCOD_BKGND_SCREEN = 5, + TCOD_BKGND_COLOR_DODGE = 6, + TCOD_BKGND_COLOR_BURN = 7, + TCOD_BKGND_ADD = 8, + TCOD_BKGND_ADDA = 9, + TCOD_BKGND_BURN = 10, + TCOD_BKGND_OVERLAY = 11, + TCOD_BKGND_ALPH = 12, + TCOD_BKGND_DEFAULT = 13, } -extern "C" { - pub fn TCOD_image_scale( - image: TCOD_image_t, - neww: ::std::os::raw::c_int, - newh: ::std::os::raw::c_int, +#[repr(i32)] +#[doc = " \\enum TCOD_alignment_t"] +#[doc = ""] +#[doc = " Print justification options."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_alignment_t { + TCOD_LEFT = 0, + TCOD_RIGHT = 1, + TCOD_CENTER = 2, +} +#[doc = " A console tile."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ConsoleTile { + #[doc = " The Unicode codepoint for this tile."] + pub ch: ::std::os::raw::c_int, + #[doc = " The tile glyph color, rendered on top of the background."] + pub fg: TCOD_ColorRGBA, + #[doc = " The tile background color, rendered behind the glyph."] + pub bg: TCOD_ColorRGBA, +} +#[test] +fn bindgen_test_layout_TCOD_ConsoleTile() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(TCOD_ConsoleTile)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_ConsoleTile)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ch as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ConsoleTile), + "::", + stringify!(ch) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fg as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ConsoleTile), + "::", + stringify!(fg) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bg as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ConsoleTile), + "::", + stringify!(bg) + ) ); } -extern "C" { - pub fn TCOD_image_save(image: TCOD_image_t, filename: *const ::std::os::raw::c_char); +#[doc = " The libtcod console struct."] +#[doc = ""] +#[doc = " All attributes should be considered private."] +#[doc = ""] +#[doc = " All C++ methods should be considered provisional, and are subject to"] +#[doc = " change."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Console { + #[doc = " Console width and height (in characters, not pixels.)"] + pub w: ::std::os::raw::c_int, + #[doc = " Console width and height (in characters, not pixels.)"] + pub h: ::std::os::raw::c_int, + #[doc = " A contiguous array of console tiles."] + pub tiles: *mut TCOD_ConsoleTile, + #[doc = " Default background operator for print & print_rect functions."] + pub bkgnd_flag: TCOD_bkgnd_flag_t, + #[doc = " Default alignment for print & print_rect functions."] + pub alignment: TCOD_alignment_t, + #[doc = " Foreground (text) and background colors."] + pub fore: TCOD_color_t, + #[doc = " Foreground (text) and background colors."] + pub back: TCOD_color_t, + #[doc = " True if a key color is being used."] + pub has_key_color: bool, + #[doc = " The current key color for this console."] + pub key_color: TCOD_color_t, + #[doc = "The total length of the tiles array. Same as `w * h`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub elements: ::std::os::raw::c_int, + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub userdata: *mut ::std::os::raw::c_void, + #[doc = " Internal use."] + pub on_delete: ::std::option::Option, } -extern "C" { - pub fn TCOD_image_get_size( - image: TCOD_image_t, - w: *mut ::std::os::raw::c_int, - h: *mut ::std::os::raw::c_int, +#[test] +fn bindgen_test_layout_TCOD_Console() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(TCOD_Console)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Console)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tiles as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(tiles) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bkgnd_flag as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(bkgnd_flag) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).alignment as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(alignment) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fore as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(fore) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).back as *const _ as usize }, + 27usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(back) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).has_key_color as *const _ as usize }, + 30usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(has_key_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).key_color as *const _ as usize }, + 31usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(key_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).elements as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(elements) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).userdata as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(userdata) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).on_delete as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(on_delete) + ) ); } -extern "C" { - pub fn TCOD_image_get_pixel( - image: TCOD_image_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> TCOD_color_t; +impl Default for TCOD_Console { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } +pub type TCOD_console_t = *mut TCOD_Console; extern "C" { - pub fn TCOD_image_get_alpha( - image: TCOD_image_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + #[doc = " Return a new console with a specific number of columns and rows."] + #[doc = ""] + #[doc = " \\param w Number of columns."] + #[doc = " \\param h Number of columns."] + #[doc = " \\return A pointer to the new console, or NULL on error."] + pub fn TCOD_console_new( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_Console; } extern "C" { - pub fn TCOD_image_get_mipmap_pixel( - image: TCOD_image_t, - x0: f32, - y0: f32, - x1: f32, - y1: f32, - ) -> TCOD_color_t; + #[doc = " Return the width of a console."] + pub fn TCOD_console_get_width(con: *const TCOD_Console) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_image_put_pixel( - image: TCOD_image_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - col: TCOD_color_t, - ); + #[doc = " Return the height of a console."] + pub fn TCOD_console_get_height(con: *const TCOD_Console) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_image_blit( - image: TCOD_image_t, - console: TCOD_console_t, - x: f32, - y: f32, - bkgnd_flag: TCOD_bkgnd_flag_t, - scalex: f32, - scaley: f32, - angle: f32, - ); + pub fn TCOD_console_set_key_color(con: *mut TCOD_Console, col: TCOD_color_t); } extern "C" { - pub fn TCOD_image_blit_rect( - image: TCOD_image_t, - console: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - bkgnd_flag: TCOD_bkgnd_flag_t, + #[doc = " Blit from one console to another."] + #[doc = ""] + #[doc = " \\param srcCon Pointer to the source console."] + #[doc = " \\param xSrc The left region of the source console to blit from."] + #[doc = " \\param ySrc The top region of the source console to blit from."] + #[doc = " \\param wSrc The width of the region to blit from."] + #[doc = " If 0 then it will fill to the maximum width."] + #[doc = " \\param hSrc The height of the region to blit from."] + #[doc = " If 0 then it will fill to the maximum height."] + #[doc = " \\param dstCon Pointer to the destination console."] + #[doc = " \\param xDst The left corner to blit onto the destination console."] + #[doc = " \\param yDst The top corner to blit onto the destination console."] + #[doc = " \\param foreground_alpha Foreground blending alpha."] + #[doc = " \\param background_alpha Background blending alpha."] + #[doc = ""] + #[doc = " If the source console has a key color, this function will use it."] + #[doc = " \\rst"] + #[doc = " .. versionchanged:: 1.16"] + #[doc = " Blits can now handle per-cell alpha transparency."] + #[doc = " \\endrst"] + pub fn TCOD_console_blit( + src: *const TCOD_Console, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + dst: *mut TCOD_Console, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + foreground_alpha: f32, + background_alpha: f32, ); } extern "C" { - pub fn TCOD_image_blit_2x( - image: TCOD_image_t, - dest: TCOD_console_t, - dx: ::std::os::raw::c_int, - dy: ::std::os::raw::c_int, - sx: ::std::os::raw::c_int, - sy: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, + pub fn TCOD_console_blit_key_color( + src: *const TCOD_Console, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + dst: *mut TCOD_Console, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + foreground_alpha: f32, + background_alpha: f32, + key_color: *const TCOD_color_t, ); } extern "C" { - pub fn TCOD_image_delete(image: TCOD_image_t); + #[doc = " Delete a console."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = ""] + #[doc = " If the console being deleted is the root console, then the display will be"] + #[doc = " uninitialized."] + pub fn TCOD_console_delete(console: *mut TCOD_Console); } extern "C" { - pub fn TCOD_image_set_key_color(image: TCOD_image_t, key_color: TCOD_color_t); + pub fn TCOD_console_set_default_background(con: *mut TCOD_Console, col: TCOD_color_t); } extern "C" { - pub fn TCOD_image_is_pixel_transparent( - image: TCOD_image_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; + pub fn TCOD_console_set_default_foreground(con: *mut TCOD_Console, col: TCOD_color_t); } -pub type TCOD_list_t = *mut ::std::os::raw::c_void; extern "C" { - pub fn TCOD_list_new() -> TCOD_list_t; + #[doc = " Clear a console to its default colors and the space character code."] + pub fn TCOD_console_clear(con: *mut TCOD_Console); } extern "C" { - pub fn TCOD_list_allocate(nb_elements: ::std::os::raw::c_int) -> TCOD_list_t; + #[doc = " Blend a background color onto a console tile."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param col The background color to blend."] + #[doc = " \\param flag The blend mode to use."] + pub fn TCOD_console_set_char_background( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); } extern "C" { - pub fn TCOD_list_duplicate(l: TCOD_list_t) -> TCOD_list_t; -} -extern "C" { - pub fn TCOD_list_delete(l: TCOD_list_t); -} -extern "C" { - pub fn TCOD_list_push(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); -} -extern "C" { - pub fn TCOD_list_pop(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_peek(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_add_all(l: TCOD_list_t, l2: TCOD_list_t); -} -extern "C" { - pub fn TCOD_list_get(l: TCOD_list_t, idx: ::std::os::raw::c_int) - -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_set( - l: TCOD_list_t, - elt: *const ::std::os::raw::c_void, - idx: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn TCOD_list_begin(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_end(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_reverse(l: TCOD_list_t); -} -extern "C" { - pub fn TCOD_list_remove_iterator( - l: TCOD_list_t, - elt: *mut *mut ::std::os::raw::c_void, - ) -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_remove(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); -} -extern "C" { - pub fn TCOD_list_remove_iterator_fast( - l: TCOD_list_t, - elt: *mut *mut ::std::os::raw::c_void, - ) -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_remove_fast(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); -} -extern "C" { - pub fn TCOD_list_contains(l: TCOD_list_t, elt: *const ::std::os::raw::c_void) -> bool; -} -extern "C" { - pub fn TCOD_list_clear(l: TCOD_list_t); -} -extern "C" { - pub fn TCOD_list_clear_and_delete(l: TCOD_list_t); -} -extern "C" { - pub fn TCOD_list_size(l: TCOD_list_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_list_insert_before( - l: TCOD_list_t, - elt: *const ::std::os::raw::c_void, - before: ::std::os::raw::c_int, - ) -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_is_empty(l: TCOD_list_t) -> bool; -} -extern "C" { - pub fn TCOD_console_init_root( - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - title: *const ::std::os::raw::c_char, - fullscreen: bool, - renderer: TCOD_renderer_t, - ); -} -extern "C" { - pub fn TCOD_console_set_window_title(title: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn TCOD_console_set_fullscreen(fullscreen: bool); -} -extern "C" { - pub fn TCOD_console_is_fullscreen() -> bool; -} -extern "C" { - pub fn TCOD_console_is_window_closed() -> bool; -} -extern "C" { - pub fn TCOD_console_has_mouse_focus() -> bool; -} -extern "C" { - pub fn TCOD_console_is_active() -> bool; -} -extern "C" { - pub fn TCOD_console_set_custom_font( - fontFile: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, - nb_char_horiz: ::std::os::raw::c_int, - nb_char_vertic: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn TCOD_console_map_ascii_code_to_font( - asciiCode: ::std::os::raw::c_int, - fontCharX: ::std::os::raw::c_int, - fontCharY: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn TCOD_console_map_ascii_codes_to_font( - asciiCode: ::std::os::raw::c_int, - nbCodes: ::std::os::raw::c_int, - fontCharX: ::std::os::raw::c_int, - fontCharY: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn TCOD_console_map_string_to_font( - s: *const ::std::os::raw::c_char, - fontCharX: ::std::os::raw::c_int, - fontCharY: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn TCOD_console_set_dirty( - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn TCOD_console_set_default_background(con: TCOD_console_t, col: TCOD_color_t); -} -extern "C" { - pub fn TCOD_console_set_default_foreground(con: TCOD_console_t, col: TCOD_color_t); -} -extern "C" { - pub fn TCOD_console_clear(con: TCOD_console_t); -} -extern "C" { - pub fn TCOD_console_set_char_background( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - col: TCOD_color_t, - flag: TCOD_bkgnd_flag_t, - ); -} -extern "C" { - pub fn TCOD_console_set_char_foreground( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - col: TCOD_color_t, - ); + #[doc = " Change the foreground color of a console tile."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param col The foreground color to set."] + pub fn TCOD_console_set_char_foreground( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); } extern "C" { + #[doc = " Change a character on a console tile, without changing its colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to set."] pub fn TCOD_console_set_char( - con: TCOD_console_t, + con: *mut TCOD_Console, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int, c: ::std::os::raw::c_int, ); } extern "C" { + #[doc = " Draw a character on a console using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to place."] + #[doc = " \\param flag A TCOD_bkgnd_flag_t flag."] pub fn TCOD_console_put_char( - con: TCOD_console_t, + con: *mut TCOD_Console, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int, c: ::std::os::raw::c_int, @@ -5521,8 +5638,16 @@ extern "C" { ); } extern "C" { + #[doc = " Draw a character on the console with the given colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to place."] + #[doc = " \\param fore The foreground color."] + #[doc = " \\param back The background color. This color will not be blended."] pub fn TCOD_console_put_char_ex( - con: TCOD_console_t, + con: *mut TCOD_Console, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int, c: ::std::os::raw::c_int, @@ -5531,2132 +5656,5570 @@ extern "C" { ); } extern "C" { - pub fn TCOD_console_set_background_flag(con: TCOD_console_t, flag: TCOD_bkgnd_flag_t); + #[doc = " Set a consoles default background flag."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param flag One of `TCOD_bkgnd_flag_t`."] + pub fn TCOD_console_set_background_flag(con: *mut TCOD_Console, flag: TCOD_bkgnd_flag_t); } extern "C" { - pub fn TCOD_console_get_background_flag(con: TCOD_console_t) -> TCOD_bkgnd_flag_t; + #[doc = " Return a consoles default background flag."] + pub fn TCOD_console_get_background_flag(con: *mut TCOD_Console) -> TCOD_bkgnd_flag_t; } extern "C" { - pub fn TCOD_console_set_alignment(con: TCOD_console_t, alignment: TCOD_alignment_t); + #[doc = " Set a consoles default alignment."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param alignment One of TCOD_alignment_t"] + pub fn TCOD_console_set_alignment(con: *mut TCOD_Console, alignment: TCOD_alignment_t); } extern "C" { - pub fn TCOD_console_get_alignment(con: TCOD_console_t) -> TCOD_alignment_t; + #[doc = " Return a consoles default alignment."] + pub fn TCOD_console_get_alignment(con: *mut TCOD_Console) -> TCOD_alignment_t; } extern "C" { - pub fn TCOD_console_print( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - fmt: *const ::std::os::raw::c_char, - ... - ); + pub fn TCOD_console_get_default_background(con: *mut TCOD_Console) -> TCOD_color_t; } extern "C" { - pub fn TCOD_console_print_ex( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - alignment: TCOD_alignment_t, - fmt: *const ::std::os::raw::c_char, - ... - ); + pub fn TCOD_console_get_default_foreground(con: *mut TCOD_Console) -> TCOD_color_t; } extern "C" { - pub fn TCOD_console_print_rect( - con: TCOD_console_t, + #[doc = " Return the background color of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return A TCOD_color_t struct with a copy of the background color."] + pub fn TCOD_console_get_char_background( + con: *const TCOD_Console, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; + ) -> TCOD_color_t; } extern "C" { - pub fn TCOD_console_print_rect_ex( - con: TCOD_console_t, + #[doc = " Return the foreground color of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return A TCOD_color_t struct with a copy of the foreground color."] + pub fn TCOD_console_get_char_foreground( + con: *const TCOD_Console, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - alignment: TCOD_alignment_t, - fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; + ) -> TCOD_color_t; } extern "C" { - pub fn TCOD_console_get_height_rect( - con: TCOD_console_t, + #[doc = " Return a character code of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return The character code."] + pub fn TCOD_console_get_char( + con: *const TCOD_Console, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - fmt: *const ::std::os::raw::c_char, - ... ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_console_rect( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - clear: bool, - flag: TCOD_bkgnd_flag_t, - ); + #[doc = " Fade the color of the display."] + #[doc = ""] + #[doc = " \\param val Where at 255 colors are normal and at 0 colors are completely"] + #[doc = " faded."] + #[doc = " \\param fadecol Color to fade towards."] + pub fn TCOD_console_set_fade(val: u8, fade: TCOD_color_t); } extern "C" { - pub fn TCOD_console_hline( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - l: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - ); + #[doc = " Return the fade value."] + #[doc = ""] + #[doc = " \\return At 255 colors are normal and at 0 colors are completely faded."] + pub fn TCOD_console_get_fade() -> u8; } extern "C" { - pub fn TCOD_console_vline( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - l: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - ); + #[doc = " Return the fade color."] + #[doc = ""] + #[doc = " \\return The current fading color."] + pub fn TCOD_console_get_fading_color() -> TCOD_color_t; } extern "C" { - pub fn TCOD_console_print_frame( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - empty: bool, - flag: TCOD_bkgnd_flag_t, - fmt: *const ::std::os::raw::c_char, - ... + pub fn TCOD_console_resize_( + console: *mut TCOD_Console, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ); +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_keycode_t { + TCODK_NONE = 0, + TCODK_ESCAPE = 1, + TCODK_BACKSPACE = 2, + TCODK_TAB = 3, + TCODK_ENTER = 4, + TCODK_SHIFT = 5, + TCODK_CONTROL = 6, + TCODK_ALT = 7, + TCODK_PAUSE = 8, + TCODK_CAPSLOCK = 9, + TCODK_PAGEUP = 10, + TCODK_PAGEDOWN = 11, + TCODK_END = 12, + TCODK_HOME = 13, + TCODK_UP = 14, + TCODK_LEFT = 15, + TCODK_RIGHT = 16, + TCODK_DOWN = 17, + TCODK_PRINTSCREEN = 18, + TCODK_INSERT = 19, + TCODK_DELETE = 20, + TCODK_LWIN = 21, + TCODK_RWIN = 22, + TCODK_APPS = 23, + TCODK_0 = 24, + TCODK_1 = 25, + TCODK_2 = 26, + TCODK_3 = 27, + TCODK_4 = 28, + TCODK_5 = 29, + TCODK_6 = 30, + TCODK_7 = 31, + TCODK_8 = 32, + TCODK_9 = 33, + TCODK_KP0 = 34, + TCODK_KP1 = 35, + TCODK_KP2 = 36, + TCODK_KP3 = 37, + TCODK_KP4 = 38, + TCODK_KP5 = 39, + TCODK_KP6 = 40, + TCODK_KP7 = 41, + TCODK_KP8 = 42, + TCODK_KP9 = 43, + TCODK_KPADD = 44, + TCODK_KPSUB = 45, + TCODK_KPDIV = 46, + TCODK_KPMUL = 47, + TCODK_KPDEC = 48, + TCODK_KPENTER = 49, + TCODK_F1 = 50, + TCODK_F2 = 51, + TCODK_F3 = 52, + TCODK_F4 = 53, + TCODK_F5 = 54, + TCODK_F6 = 55, + TCODK_F7 = 56, + TCODK_F8 = 57, + TCODK_F9 = 58, + TCODK_F10 = 59, + TCODK_F11 = 60, + TCODK_F12 = 61, + TCODK_NUMLOCK = 62, + TCODK_SCROLLLOCK = 63, + TCODK_SPACE = 64, + TCODK_CHAR = 65, + TCODK_TEXT = 66, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_key_t { + pub vk: TCOD_keycode_t, + pub c: ::std::os::raw::c_char, + pub text: [::std::os::raw::c_char; 32usize], + pub pressed: bool, + pub lalt: bool, + pub lctrl: bool, + pub lmeta: bool, + pub ralt: bool, + pub rctrl: bool, + pub rmeta: bool, + pub shift: bool, +} +#[test] +fn bindgen_test_layout_TCOD_key_t() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(TCOD_key_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_key_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vk as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(vk) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(c) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).text as *const _ as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(text) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pressed as *const _ as usize }, + 37usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lalt as *const _ as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lalt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lctrl as *const _ as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lctrl) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lmeta as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lmeta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ralt as *const _ as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(ralt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rctrl as *const _ as usize }, + 42usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(rctrl) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rmeta as *const _ as usize }, + 43usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(rmeta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).shift as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(shift) + ) + ); +} +impl Default for TCOD_key_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_chars_t { + TCOD_CHAR_HLINE = 196, + TCOD_CHAR_VLINE = 179, + TCOD_CHAR_NE = 191, + TCOD_CHAR_NW = 218, + TCOD_CHAR_SE = 217, + TCOD_CHAR_SW = 192, + TCOD_CHAR_TEEW = 180, + TCOD_CHAR_TEEE = 195, + TCOD_CHAR_TEEN = 193, + TCOD_CHAR_TEES = 194, + TCOD_CHAR_CROSS = 197, + TCOD_CHAR_DHLINE = 205, + TCOD_CHAR_DVLINE = 186, + TCOD_CHAR_DNE = 187, + TCOD_CHAR_DNW = 201, + TCOD_CHAR_DSE = 188, + TCOD_CHAR_DSW = 200, + TCOD_CHAR_DTEEW = 185, + TCOD_CHAR_DTEEE = 204, + TCOD_CHAR_DTEEN = 202, + TCOD_CHAR_DTEES = 203, + TCOD_CHAR_DCROSS = 206, + TCOD_CHAR_BLOCK1 = 176, + TCOD_CHAR_BLOCK2 = 177, + TCOD_CHAR_BLOCK3 = 178, + TCOD_CHAR_ARROW_N = 24, + TCOD_CHAR_ARROW_S = 25, + TCOD_CHAR_ARROW_E = 26, + TCOD_CHAR_ARROW_W = 27, + TCOD_CHAR_ARROW2_N = 30, + TCOD_CHAR_ARROW2_S = 31, + TCOD_CHAR_ARROW2_E = 16, + TCOD_CHAR_ARROW2_W = 17, + TCOD_CHAR_DARROW_H = 29, + TCOD_CHAR_DARROW_V = 18, + TCOD_CHAR_CHECKBOX_UNSET = 224, + TCOD_CHAR_CHECKBOX_SET = 225, + TCOD_CHAR_RADIO_UNSET = 9, + TCOD_CHAR_RADIO_SET = 10, + TCOD_CHAR_SUBP_NW = 226, + TCOD_CHAR_SUBP_NE = 227, + TCOD_CHAR_SUBP_N = 228, + TCOD_CHAR_SUBP_SE = 229, + TCOD_CHAR_SUBP_DIAG = 230, + TCOD_CHAR_SUBP_E = 231, + TCOD_CHAR_SUBP_SW = 232, + TCOD_CHAR_SMILIE = 1, + TCOD_CHAR_SMILIE_INV = 2, + TCOD_CHAR_HEART = 3, + TCOD_CHAR_DIAMOND = 4, + TCOD_CHAR_CLUB = 5, + TCOD_CHAR_SPADE = 6, + TCOD_CHAR_BULLET = 7, + TCOD_CHAR_BULLET_INV = 8, + TCOD_CHAR_MALE = 11, + TCOD_CHAR_FEMALE = 12, + TCOD_CHAR_NOTE = 13, + TCOD_CHAR_NOTE_DOUBLE = 14, + TCOD_CHAR_LIGHT = 15, + TCOD_CHAR_EXCLAM_DOUBLE = 19, + TCOD_CHAR_PILCROW = 20, + TCOD_CHAR_SECTION = 21, + TCOD_CHAR_POUND = 156, + TCOD_CHAR_MULTIPLICATION = 158, + TCOD_CHAR_FUNCTION = 159, + TCOD_CHAR_RESERVED = 169, + TCOD_CHAR_HALF = 171, + TCOD_CHAR_ONE_QUARTER = 172, + TCOD_CHAR_COPYRIGHT = 184, + TCOD_CHAR_CENT = 189, + TCOD_CHAR_YEN = 190, + TCOD_CHAR_CURRENCY = 207, + TCOD_CHAR_THREE_QUARTERS = 243, + TCOD_CHAR_DIVISION = 246, + TCOD_CHAR_GRADE = 248, + TCOD_CHAR_UMLAUT = 249, + TCOD_CHAR_POW1 = 251, + TCOD_CHAR_POW3 = 252, + TCOD_CHAR_POW2 = 253, + TCOD_CHAR_BULLET_SQUARE = 254, +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_key_status_t { + TCOD_KEY_PRESSED = 1, + TCOD_KEY_RELEASED = 2, +} +impl TCOD_font_flags_t { + #[doc = " Tiles are arranged in column-major order."] + #[doc = ""] + #[doc = " 0 3 6"] + #[doc = " 1 4 7"] + #[doc = " 2 5 8"] + pub const TCOD_FONT_LAYOUT_ASCII_INCOL: TCOD_font_flags_t = TCOD_font_flags_t(1); +} +impl TCOD_font_flags_t { + #[doc = " Tiles are arranged in row-major order."] + #[doc = ""] + #[doc = " 0 1 2"] + #[doc = " 3 4 5"] + #[doc = " 6 7 8"] + pub const TCOD_FONT_LAYOUT_ASCII_INROW: TCOD_font_flags_t = TCOD_font_flags_t(2); +} +impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] + pub const TCOD_FONT_TYPE_GREYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); +} +impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] + pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); +} +impl TCOD_font_flags_t { + #[doc = " A unique layout used by some of libtcod's fonts."] + pub const TCOD_FONT_LAYOUT_TCOD: TCOD_font_flags_t = TCOD_font_flags_t(8); +} +impl TCOD_font_flags_t { + #[doc = " Decode a code page 437 tileset into Unicode code-points."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.10"] + #[doc = " \\endrst"] + pub const TCOD_FONT_LAYOUT_CP437: TCOD_font_flags_t = TCOD_font_flags_t(16); +} +impl ::std::ops::BitOr for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for TCOD_font_flags_t { + #[inline] + fn bitor_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for TCOD_font_flags_t { + #[inline] + fn bitand_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[doc = " These font flags can be OR'd together into a bit-field and passed to"] +#[doc = " TCOD_console_set_custom_font"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct TCOD_font_flags_t(pub i32); +#[repr(i32)] +#[doc = " The available renderers."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_renderer_t { + #[doc = " Alias for TCOD_RENDERER_OPENGL2."] + TCOD_RENDERER_GLSL = 0, + #[doc = " An OpenGL 1.1 implementation."] + #[doc = ""] + #[doc = " Performs worse than TCOD_RENDERER_GLSL without many benefits."] + TCOD_RENDERER_OPENGL = 1, + #[doc = " A software based renderer."] + #[doc = ""] + #[doc = " The font file is loaded into RAM instead of VRAM in this implementation."] + TCOD_RENDERER_SDL = 2, + #[doc = " A new SDL2 renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.8"] + #[doc = " \\endrst"] + TCOD_RENDERER_SDL2 = 3, + #[doc = " A new OpenGL 2.0 core renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.9"] + #[doc = ""] + #[doc = " .. versionchanged:: 1.11.0"] + #[doc = " This renderer now uses OpenGL 2.0 instead of 2.1."] + #[doc = " \\endrst"] + TCOD_RENDERER_OPENGL2 = 4, + #[doc = " A new OpenGL 2.0 core renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.9"] + #[doc = ""] + #[doc = " .. versionchanged:: 1.11.0"] + #[doc = " This renderer now uses OpenGL 2.0 instead of 2.1."] + #[doc = " \\endrst"] + TCOD_NB_RENDERERS = 5, +} +extern "C" { + #[doc = " Draw a rectangle onto a console."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting region, the left-most position being 0."] + #[doc = " \\param y The starting region, the top-most position being 0."] + #[doc = " \\param rw The width of the rectangle."] + #[doc = " \\param rh The height of the rectangle."] + #[doc = " \\param clear If true the drawing region will be filled with spaces."] + #[doc = " \\param flag The blending flag to use."] + pub fn TCOD_console_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + clear: bool, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a horizontal line using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting X coordinate, the left-most position being 0."] + #[doc = " \\param y The starting Y coordinate, the top-most position being 0."] + #[doc = " \\param l The width of the line."] + #[doc = " \\param flag The blending flag."] + #[doc = ""] + #[doc = " This function makes assumptions about the fonts character encoding."] + #[doc = " It will fail if the font encoding is not `cp437`."] + pub fn TCOD_console_hline( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a vertical line using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting X coordinate, the left-most position being 0."] + #[doc = " \\param y The starting Y coordinate, the top-most position being 0."] + #[doc = " \\param l The height of the line."] + #[doc = " \\param flag The blending flag."] + #[doc = ""] + #[doc = " This function makes assumptions about the fonts character encoding."] + #[doc = " It will fail if the font encoding is not `cp437`."] + pub fn TCOD_console_vline( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Place a single tile on a `console` at `x`,`y`."] + #[doc = ""] + #[doc = " If `ch` is 0 then the character code will not be updated."] + #[doc = ""] + #[doc = " If `fg`,`bg` is NULL then their respective colors will not be updated."] + pub fn TCOD_console_put_rgb( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ch: ::std::os::raw::c_int, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a rectangle on a `console` with a shape of `x`,`y`,`width`,`height`."] + #[doc = ""] + #[doc = " If `ch` is 0 then the character code will not be updated."] + #[doc = ""] + #[doc = " If `fg`,`bg` is NULL then their respective colors will not be updated."] + pub fn TCOD_console_draw_rect_rgb( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ch: ::std::os::raw::c_int, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +#[doc = "Viewport options for the rendering context."] +#[doc = "\\rst"] +#[doc = ".. versionadded:: 1.16"] +#[doc = "\\endrst"] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ViewportOptions { + #[doc = "If true then the aspect ratio will be kept square when the console is"] + #[doc = "scaled. The view will be letter-boxed."] + #[doc = ""] + #[doc = "If false the console will be stretched to fill the screen."] + #[doc = ""] + #[doc = "Set this is true if your tileset is deigned for square pixels."] + pub keep_aspect: bool, + #[doc = "If true then console scaling will be fixed to integer increments."] + #[doc = ""] + #[doc = "Has no effect if the console must be scaled down."] + pub integer_scaling: bool, + #[doc = "Not used."] + pub reserved_: bool, + #[doc = "The color to clear the screen with before rendering the console."] + pub clear_color: TCOD_ColorRGBA, + #[doc = "Alignment of the console when it is letter-boxed: 0.0f renders the"] + #[doc = "console in the upper-left corner, and 1.0f in the lower-right."] + #[doc = ""] + #[doc = "Values of 0.5f will center the console."] + #[doc = "Values outside of the range 0.0f to 1.0f are clamped."] + pub align_x: f32, + pub align_y: f32, +} +#[test] +fn bindgen_test_layout_TCOD_ViewportOptions() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_ViewportOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_ViewportOptions)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).keep_aspect as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(keep_aspect) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).integer_scaling as *const _ as usize + }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(integer_scaling) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved_ as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(reserved_) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).clear_color as *const _ as usize + }, + 3usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(clear_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).align_x as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(align_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).align_y as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(align_y) + ) + ); +} +extern "C" { + pub static TCOD_VIEWPORT_DEFAULT_: TCOD_ViewportOptions; +} +extern "C" { + #[doc = "Allocate a new viewport options struct."] + #[doc = ""] + #[doc = "You should not allocate this struct manually since the size of it may change"] + #[doc = "between versions."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_viewport_new() -> *mut TCOD_ViewportOptions; +} +extern "C" { + #[doc = "Delete a viewport."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_viewport_delete(viewport: *mut TCOD_ViewportOptions); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Window { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Renderer { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Rect { + _unused: [u8; 0], +} +#[doc = " A rendering context for libtcod."] +#[doc = " \\rst"] +#[doc = " .. versionadded:: 1.16"] +#[doc = " \\endrst"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Context { + pub type_: ::std::os::raw::c_int, + pub contextdata: *mut ::std::os::raw::c_void, + pub destructor_: ::std::option::Option, + pub present_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error, + >, + pub pixel_to_tile_: ::std::option::Option< + unsafe extern "C" fn(self_: *mut TCOD_Context, x: *mut f64, y: *mut f64), + >, + pub save_screenshot_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + filename: *const ::std::os::raw::c_char, + ) -> TCOD_Error, + >, + pub get_sdl_window_: + ::std::option::Option *mut SDL_Window>, + pub get_sdl_renderer_: + ::std::option::Option *mut SDL_Renderer>, + pub accumulate_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error, + >, + #[doc = "Change the tileset used by this context."] + pub set_tileset: ::std::option::Option< + unsafe extern "C" fn(self_: *mut TCOD_Context, tileset: *mut TCOD_Tileset) -> TCOD_Error, + >, + #[doc = "Output the recommended console size to `columns` and `rows`."] + pub cb_recommended_console_size_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + columns: *mut ::std::os::raw::c_int, + rows: *mut ::std::os::raw::c_int, + ) -> TCOD_Error, + >, +} +#[test] +fn bindgen_test_layout_TCOD_Context() { + assert_eq!( + ::std::mem::size_of::(), + 88usize, + concat!("Size of: ", stringify!(TCOD_Context)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Context)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).contextdata as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(contextdata) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).destructor_ as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(destructor_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).present_ as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(present_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pixel_to_tile_ as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(pixel_to_tile_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).save_screenshot_ as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(save_screenshot_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).get_sdl_window_ as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(get_sdl_window_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).get_sdl_renderer_ as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(get_sdl_renderer_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).accumulate_ as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(accumulate_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).set_tileset as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(set_tileset) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).cb_recommended_console_size_ as *const _ + as usize + }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(cb_recommended_console_size_) + ) + ); +} +impl Default for TCOD_Context { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + #[doc = " Delete a rendering context."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_context_delete(renderer: *mut TCOD_Context); +} +extern "C" { + #[doc = " Create an uninitialized rendering context."] + #[doc = ""] + #[doc = " Used internally."] + pub fn TCOD_context_new_() -> *mut TCOD_Context; +} +extern "C" { + #[doc = "Present a console to the screen, using a rendering context."] + #[doc = ""] + #[doc = "`console` is the console to present, the console can be any size."] + #[doc = ""] + #[doc = "`viewport` is the optional viewport options to use."] + #[doc = "This will affect the scaling of the console with the current context."] + #[doc = "This can be NULL to use the default options, which are to stretch the"] + #[doc = "console to fit the screen."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_present( + context: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Convert the screen coordinates to tile coordinates for this context."] + #[doc = ""] + #[doc = "`x` and `y` are the pointers to the screen coordinates, these will be"] + #[doc = "converted to tile coordinates after the call to this function."] + #[doc = ""] + #[doc = "The parameters given to the last call to `TCOD_context_present` will"] + #[doc = "determine where the tiles are for this call."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_screen_pixel_to_tile_d( + context: *mut TCOD_Context, + x: *mut f64, + y: *mut f64, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Convert the screen coordinates to integer tile coordinates for this context."] + #[doc = ""] + #[doc = "Save as `TCOD_context_screen_pixel_to_tile` but the inputs and results are"] + #[doc = "integers. This is useful if you don't need sub-tile coordinates."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_screen_pixel_to_tile_i( + context: *mut TCOD_Context, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Save the last presented console to a PNG file."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_save_screenshot( + context: *mut TCOD_Context, + filename: *const ::std::os::raw::c_char, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return a pointer the SDL_Window for this context if it uses one."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_sdl_window(context: *mut TCOD_Context) -> *mut SDL_Window; +} +extern "C" { + #[doc = "Return a pointer the SDL_Renderer for this context if it uses one."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_sdl_renderer(context: *mut TCOD_Context) -> *mut SDL_Renderer; +} +extern "C" { + #[doc = "Change the active tileset for this context."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_change_tileset( + self_: *mut TCOD_Context, + tileset: *mut TCOD_Tileset, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return the `TCOD_renderer_t` renderer type for this context."] + #[doc = ""] + #[doc = "Returns a negative number on error, such as `context` being NULL."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_renderer_type(context: *mut TCOD_Context) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Set `columns` and `rows` to the recommended console size for this context."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_recommended_console_size( + context: *mut TCOD_Context, + columns: *mut ::std::os::raw::c_int, + rows: *mut ::std::os::raw::c_int, + ) -> TCOD_Error; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_mipmap_ { + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub fwidth: f32, + pub fheight: f32, + pub buf: *mut TCOD_ColorRGB, + pub dirty: bool, +} +#[test] +fn bindgen_test_layout_TCOD_mipmap_() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(TCOD_mipmap_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_mipmap_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fwidth as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(fwidth) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fheight as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(fheight) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dirty as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(dirty) + ) + ); +} +impl Default for TCOD_mipmap_ { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Image { + pub nb_mipmaps: ::std::os::raw::c_int, + pub mipmaps: *mut TCOD_mipmap_, + pub key_color: TCOD_ColorRGB, + pub has_key_color: bool, +} +#[test] +fn bindgen_test_layout_TCOD_Image() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(TCOD_Image)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Image)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_mipmaps as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(nb_mipmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mipmaps as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(mipmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).key_color as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(key_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).has_key_color as *const _ as usize }, + 19usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(has_key_color) + ) + ); +} +impl Default for TCOD_Image { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_image_t = *mut TCOD_Image; +extern "C" { + pub fn TCOD_image_new( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> *mut TCOD_Image; +} +extern "C" { + #[doc = " Return a new image rendered from a console."] + #[doc = ""] + #[doc = " This effectively returns a screenshot of the console."] + pub fn TCOD_image_from_console(console: *const TCOD_Console) -> *mut TCOD_Image; +} +extern "C" { + #[doc = " Same as TCOD_image_from_console, but with an existing image."] + pub fn TCOD_image_refresh_console(image: *mut TCOD_Image, console: *const TCOD_Console); +} +extern "C" { + pub fn TCOD_image_load(filename: *const ::std::os::raw::c_char) -> *mut TCOD_Image; +} +extern "C" { + pub fn TCOD_image_clear(image: *mut TCOD_Image, color: TCOD_color_t); +} +extern "C" { + pub fn TCOD_image_invert(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_hflip(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_rotate90(image: *mut TCOD_Image, numRotations: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_image_vflip(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_scale( + image: *mut TCOD_Image, + neww: ::std::os::raw::c_int, + newh: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_save(image: *const TCOD_Image, filename: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_image_get_size( + image: *const TCOD_Image, + w: *mut ::std::os::raw::c_int, + h: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_get_pixel( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_image_get_alpha( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return a mipmapped pixel of image."] + #[doc = ""] + #[doc = " Mipmaps are updated when you call this, so it can't be called from multiple"] + #[doc = " threads."] + pub fn TCOD_image_get_mipmap_pixel( + image: *mut TCOD_Image, + x0: f32, + y0: f32, + x1: f32, + y1: f32, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_image_put_pixel( + image: *mut TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); +} +extern "C" { + pub fn TCOD_image_blit( + image: *mut TCOD_Image, + console: TCOD_console_t, + x: f32, + y: f32, + bkgnd_flag: TCOD_bkgnd_flag_t, + scalex: f32, + scaley: f32, + angle: f32, + ); +} +extern "C" { + pub fn TCOD_image_blit_rect( + image: *mut TCOD_Image, + console: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + bkgnd_flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_image_blit_2x( + image: *const TCOD_Image, + dest: TCOD_console_t, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + sx: ::std::os::raw::c_int, + sy: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_delete(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_set_key_color(image: *mut TCOD_Image, key_color: TCOD_color_t); +} +extern "C" { + pub fn TCOD_image_is_pixel_transparent( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_List { + _unused: [u8; 0], +} +pub type TCOD_list_t = *mut TCOD_List; +extern "C" { + pub fn TCOD_list_new() -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_allocate(nb_elements: ::std::os::raw::c_int) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_duplicate(l: TCOD_list_t) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_delete(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_push(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_pop(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_peek(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_add_all(l: TCOD_list_t, l2: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_get(l: TCOD_list_t, idx: ::std::os::raw::c_int) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_set( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + idx: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_list_begin(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_end(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_reverse(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_remove_iterator( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_remove(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_remove_iterator_fast( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_remove_fast(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_contains(l: TCOD_list_t, elt: *const ::std::os::raw::c_void) -> bool; +} +extern "C" { + pub fn TCOD_list_clear(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_clear_and_delete(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_size(l: TCOD_list_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_list_insert_before( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + before: ::std::os::raw::c_int, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_is_empty(l: TCOD_list_t) -> bool; +} +extern "C" { + pub fn TCOD_console_set_custom_font( + fontFile: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + nb_char_horiz: ::std::os::raw::c_int, + nb_char_vertic: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_map_ascii_code_to_font( + asciiCode: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_ascii_codes_to_font( + asciiCode: ::std::os::raw::c_int, + nbCodes: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_string_to_font( + s: *const ::std::os::raw::c_char, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_string_to_font_utf( + s: *const wchar_t, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_set_dirty( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + #[doc = "Render and present a console with optional viewport options."] + #[doc = ""] + #[doc = "`console` is the console to render."] + #[doc = ""] + #[doc = "`viewport` is optional."] + #[doc = ""] + #[doc = "Returns a negative values on error. See `TCOD_get_error`."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_console_flush_ex( + console: *mut TCOD_Console, + viewport: *mut TCOD_ViewportOptions, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Render and present the root console to the active display."] + pub fn TCOD_console_flush() -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_check_for_keypress(flags: ::std::os::raw::c_int) -> TCOD_key_t; +} +extern "C" { + pub fn TCOD_console_wait_for_keypress(flush: bool) -> TCOD_key_t; +} +extern "C" { + pub fn TCOD_console_is_key_pressed(key: TCOD_keycode_t) -> bool; +} +extern "C" { + pub fn TCOD_console_from_file(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_load_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_load_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_credits(); +} +extern "C" { + pub fn TCOD_console_credits_reset(); +} +extern "C" { + pub fn TCOD_console_credits_render( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + alpha: bool, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_set_keyboard_repeat( + initial_delay: ::std::os::raw::c_int, + interval: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_disable_keyboard_repeat(); +} +extern "C" { + #[doc = " \\brief Initialize the libtcod graphical engine."] + #[doc = ""] + #[doc = " \\param w The width in tiles."] + #[doc = " \\param h The height in tiles."] + #[doc = " \\param title The title for the window."] + #[doc = " \\param fullscreen Fullscreen option."] + #[doc = " \\param renderer Which renderer to use when rendering the console."] + #[doc = ""] + #[doc = " You may want to call TCOD_console_set_custom_font BEFORE calling this"] + #[doc = " function. By default this function loads libtcod's `terminal.png` image"] + #[doc = " from the working directory."] + #[doc = ""] + #[doc = " Afterwards TCOD_quit must be called before the program exits."] + #[doc = ""] + #[doc = " Returns 0 on success, or -1 on an error, you can check the error with"] + #[doc = " TCOD_sys_get_error()"] + #[doc = ""] + #[doc = " `renderer` and vsync settings can be overridden by the `TCOD_RENDERER` or"] + #[doc = " `TCOD_VSYNC` environment variables."] + #[doc = ""] + #[doc = " Valid case-sensitive options for `TCOD_RENDERER` are:"] + #[doc = " - sdl"] + #[doc = " - opengl"] + #[doc = " - glsl"] + #[doc = " - sdl2"] + #[doc = " - opengl2"] + #[doc = ""] + #[doc = " Valid options for `TCOD_VSYNC` are `0` or `1`."] + #[doc = ""] + #[doc = " \\rst"] + #[doc = " .. versionchanged:: 1.12"] + #[doc = " Now returns -1 on error instead of crashing."] + #[doc = ""] + #[doc = " .. versionchanged:: 1.13"] + #[doc = " Added the `TCOD_RENDERER` and `TCOD_VSYNC` overrides."] + #[doc = " \\endrst"] + pub fn TCOD_console_init_root( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fullscreen: bool, + renderer: TCOD_renderer_t, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_init_root_( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fullscreen: bool, + renderer: TCOD_renderer_t, + vsync: bool, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Shutdown libtcod. This must be called before your program exits."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.8"] + #[doc = " \\endrst"] + pub fn TCOD_quit(); +} +extern "C" { + #[doc = " Change the title string of the active window."] + #[doc = ""] + #[doc = " \\param title A utf8 string."] + pub fn TCOD_console_set_window_title(title: *const ::std::os::raw::c_char); +} +extern "C" { + #[doc = " Set the display to be full-screen or windowed."] + #[doc = ""] + #[doc = " \\param fullscreen If true the display will go full-screen."] + pub fn TCOD_console_set_fullscreen(fullscreen: bool); +} +extern "C" { + #[doc = " Return true if the display is full-screen."] + pub fn TCOD_console_is_fullscreen() -> bool; +} +extern "C" { + #[doc = " Return true if the window has mouse focus."] + pub fn TCOD_console_has_mouse_focus() -> bool; +} +extern "C" { + #[doc = " Return true if the window has keyboard focus."] + #[doc = ""] + #[doc = " \\verbatim embed:rst:leading-asterisk"] + #[doc = " .. versionchanged: 1.7"] + #[doc = " This function was previously broken. It now keeps track of keyboard"] + #[doc = " focus."] + #[doc = " \\endverbatim"] + pub fn TCOD_console_is_active() -> bool; +} +extern "C" { + #[doc = " Return true if the window is closing."] + pub fn TCOD_console_is_window_closed() -> bool; +} +extern "C" { + #[doc = " Return an SDL_Window pointer if one is in use, returns NULL otherwise."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_get_sdl_window() -> *mut SDL_Window; +} +extern "C" { + #[doc = " Return an SDL_Renderer pointer if one is in use, returns NULL otherwise."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_get_sdl_renderer() -> *mut SDL_Renderer; +} +extern "C" { + #[doc = " Render a console over the display."] + #[doc = " \\rst"] + #[doc = " `console` can be any size, the active render will try to scale it to fit"] + #[doc = " the screen."] + #[doc = ""] + #[doc = " The function will only work for the SDL2/OPENGL2 renderers."] + #[doc = ""] + #[doc = " Unlike :any:`TCOD_console_flush` this will not present the display."] + #[doc = " You will need to do that manually, likely with the SDL API."] + #[doc = ""] + #[doc = " Returns 0 on success, or a negative number on a failure such as the"] + #[doc = " incorrect renderer being active."] + #[doc = ""] + #[doc = " .. versionadded:: 1.11"] + #[doc = ""] + #[doc = " .. seealso::"] + #[doc = " :any:`TCOD_sys_get_sdl_window` :any:`TCOD_sys_get_sdl_renderer`"] + #[doc = " \\endrst"] + pub fn TCOD_sys_accumulate_console(console: *const TCOD_Console) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_sys_accumulate_console_( + console: *const TCOD_Console, + viewport: *const SDL_Rect, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_rect_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_frame( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + empty: bool, + flag: TCOD_bkgnd_flag_t, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_get_height_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_ex_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_rect_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_rect_ex_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +impl TCOD_colctrl_t { + pub const TCOD_COLCTRL_NUMBER: TCOD_colctrl_t = TCOD_colctrl_t::TCOD_COLCTRL_5; +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_colctrl_t { + TCOD_COLCTRL_1 = 1, + TCOD_COLCTRL_2 = 2, + TCOD_COLCTRL_3 = 3, + TCOD_COLCTRL_4 = 4, + TCOD_COLCTRL_5 = 5, + TCOD_COLCTRL_FORE_RGB = 6, + TCOD_COLCTRL_BACK_RGB = 7, + TCOD_COLCTRL_STOP = 8, +} +extern "C" { + pub fn TCOD_console_set_color_control( + con: TCOD_colctrl_t, + fore: TCOD_color_t, + back: TCOD_color_t, + ); +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_rect_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Print a framed and optionally titled region to a console, using default"] + #[doc = "colors and alignment."] + #[doc = ""] + #[doc = "This function uses Unicode box-drawing characters and a UTF-8 formatted"] + #[doc = "string."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_frame( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + empty: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return the number of lines that would be printed by this formatted string."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_get_height_rect_fmt( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_printn( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_printn_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_n( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_wn( + width: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_printn_frame( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + empty: bool, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_load_xp( + con: *mut TCOD_Console, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_xp( + con: *const TCOD_Console, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_list_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_console_list_save_xp( + console_list: TCOD_list_t, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + #[doc = "Create a new context with the given console size."] + #[doc = ""] + #[doc = ""] + #[doc = "Same as `TCOD_context_new_window`, but the following parameters have"] + #[doc = "different effects:"] + #[doc = ""] + #[doc = "`columns` and `rows` is the desired size of the terminal window."] + #[doc = "The actual size of the window will be derived from this and the given"] + #[doc = "`tileset`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_new_terminal( + columns: ::std::os::raw::c_int, + rows: ::std::os::raw::c_int, + renderer_type: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + vsync: bool, + sdl_window_flags: ::std::os::raw::c_int, + window_title: *const ::std::os::raw::c_char, + out: *mut *mut TCOD_Context, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Create a new context with a window of the given size."] + #[doc = ""] + #[doc = "Same as `TCOD_context_new_terminal`, but the following parameters have"] + #[doc = "different effects:"] + #[doc = ""] + #[doc = "`pixel_width` and `pixel_height` are the desired size of the window in"] + #[doc = "pixels."] + #[doc = ""] + #[doc = "`renderer_type` is a `TCOD_renderer_t` type."] + #[doc = ""] + #[doc = "`tileset` is an optional pointer to a tileset object."] + #[doc = ""] + #[doc = "If `vsync` is True, then vertical sync will be enabled whenever possible."] + #[doc = "A value of true is recommended."] + #[doc = ""] + #[doc = "`sdl_window_flags` is a bitfield of SDL_WindowFlags flags."] + #[doc = "For a window, a value of ``SDL_WINDOW_RESIZABLE`` is recommended."] + #[doc = "For fullscreen, a value of"] + #[doc = "``SDL_WINDOW_RESIZABLE | SDL_WINDOW_FULLSCREEN_DESKTOP`` is recommended."] + #[doc = "You should avoid the ``SDL_WINDOW_FULLSCREEN`` flag whenever possible."] + #[doc = ""] + #[doc = "`window_title` is the title of the opened window."] + #[doc = ""] + #[doc = "`out` is the output for the `TCOD_Context`, must not be NULL."] + #[doc = ""] + #[doc = "Returns a negative error code on failure, `out` will unlikely be set in this"] + #[doc = "case."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_new_window( + pixel_width: ::std::os::raw::c_int, + pixel_height: ::std::os::raw::c_int, + renderer_type: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + vsync: bool, + sdl_window_flags: ::std::os::raw::c_int, + window_title: *const ::std::os::raw::c_char, + out: *mut *mut TCOD_Context, + ) -> TCOD_Error; +} +#[doc = " Private map cell struct."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_MapCell { + pub transparent: bool, + pub walkable: bool, + pub fov: bool, +} +#[test] +fn bindgen_test_layout_TCOD_MapCell() { + assert_eq!( + ::std::mem::size_of::(), + 3usize, + concat!("Size of: ", stringify!(TCOD_MapCell)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_MapCell)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).transparent as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(transparent) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).walkable as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(walkable) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fov as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(fov) + ) + ); +} +#[doc = " Private map struct."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Map { + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub nbcells: ::std::os::raw::c_int, + pub cells: *mut TCOD_MapCell, +} +#[test] +fn bindgen_test_layout_TCOD_Map() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(TCOD_Map)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Map)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nbcells as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(nbcells) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cells as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(cells) + ) + ); +} +impl Default for TCOD_Map { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_map_t = *mut TCOD_Map; +#[repr(i32)] +#[doc = " Field-of-view options."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_fov_algorithm_t { + #[doc = " Basic: http://roguebasin.roguelikedevelopment.org/index.php?title=Ray_casting"] + FOV_BASIC = 0, + #[doc = " Diamond: http://www.geocities.com/temerra/los_rays.html"] + FOV_DIAMOND = 1, + #[doc = " Shadow casting: http://roguebasin.roguelikedevelopment.org/index.php?title=FOV_using_recursive_shadowcasting"] + FOV_SHADOW = 2, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_0 = 3, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_1 = 4, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_2 = 5, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_3 = 6, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_4 = 7, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_5 = 8, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_6 = 9, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_7 = 10, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_8 = 11, + #[doc = " Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos)"] + FOV_RESTRICTIVE = 12, + #[doc = " Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos)"] + NB_FOV_ALGORITHMS = 13, +} +extern "C" { + pub fn TCOD_map_new( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> *mut TCOD_Map; +} +extern "C" { + pub fn TCOD_map_clear(map: *mut TCOD_Map, transparent: bool, walkable: bool); +} +extern "C" { + pub fn TCOD_map_copy(source: *const TCOD_Map, dest: *mut TCOD_Map); +} +extern "C" { + pub fn TCOD_map_set_properties( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + is_transparent: bool, + is_walkable: bool, + ); +} +extern "C" { + pub fn TCOD_map_delete(map: *mut TCOD_Map); +} +extern "C" { + pub fn TCOD_map_compute_fov( + map: *mut TCOD_Map, + player_x: ::std::os::raw::c_int, + player_y: ::std::os::raw::c_int, + max_radius: ::std::os::raw::c_int, + light_walls: bool, + algo: TCOD_fov_algorithm_t, + ); +} +extern "C" { + pub fn TCOD_map_is_in_fov( + map: *const TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_set_in_fov( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fov: bool, + ); +} +extern "C" { + pub fn TCOD_map_is_transparent( + map: *const TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_is_walkable( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_get_width(map: *const TCOD_Map) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_map_get_height(map: *const TCOD_Map) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_map_get_nb_cells(map: *const TCOD_Map) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Return the default tileset, may be NULL."] + #[doc = ""] + #[doc = "A non-NULL return value is a new reference to the global tileset."] + #[doc = "When you are done you will need to call `TCOD_tileset_delete` on this"] + #[doc = "pointer."] + #[doc = ""] + #[doc = "This function is provisional, the API may change in the future."] + pub fn TCOD_get_default_tileset() -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Set the default tileset and update the default display to use it."] + #[doc = ""] + #[doc = "This will keep alive a reference to the given tileset. If you no longer"] + #[doc = "need the pointer then you should call `TCOD_tileset_delete` on it after"] + #[doc = "this function."] + #[doc = ""] + #[doc = "This function is provisional, the API may change in the future."] + pub fn TCOD_set_default_tileset(tileset: *mut TCOD_Tileset); +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_noise_type_t { + TCOD_NOISE_PERLIN = 1, + TCOD_NOISE_SIMPLEX = 2, + TCOD_NOISE_WAVELET = 4, + TCOD_NOISE_DEFAULT = 0, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct TCOD_Noise { + pub ndim: ::std::os::raw::c_int, + #[doc = " Randomized map of indexes into buffer"] + pub map: [::std::os::raw::c_uchar; 256usize], + #[doc = " Random 256 x ndim buffer"] + pub buffer: [[f32; 4usize]; 256usize], + pub H: f32, + pub lacunarity: f32, + pub exponent: [f32; 128usize], + pub waveletTileData: *mut f32, + pub rand: TCOD_random_t, + pub noise_type: TCOD_noise_type_t, +} +#[test] +fn bindgen_test_layout_TCOD_Noise() { + assert_eq!( + ::std::mem::size_of::(), + 4904usize, + concat!("Size of: ", stringify!(TCOD_Noise)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Noise)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).map as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(map) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buffer as *const _ as usize }, + 260usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(buffer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).H as *const _ as usize }, + 4356usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(H) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lacunarity as *const _ as usize }, + 4360usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(lacunarity) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).exponent as *const _ as usize }, + 4364usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(exponent) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).waveletTileData as *const _ as usize }, + 4880usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(waveletTileData) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rand as *const _ as usize }, + 4888usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(rand) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).noise_type as *const _ as usize }, + 4896usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(noise_type) + ) + ); +} +impl Default for TCOD_Noise { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_noise_t = *mut TCOD_Noise; +extern "C" { + pub fn TCOD_noise_new( + dimensions: ::std::os::raw::c_int, + hurst: f32, + lacunarity: f32, + random: TCOD_random_t, + ) -> TCOD_noise_t; +} +extern "C" { + pub fn TCOD_noise_set_type(noise: TCOD_noise_t, type_: TCOD_noise_type_t); +} +extern "C" { + pub fn TCOD_noise_get_ex(noise: TCOD_noise_t, f: *mut f32, type_: TCOD_noise_type_t) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_fbm_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_turbulence_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; +} +extern "C" { + pub fn TCOD_noise_get(noise: TCOD_noise_t, f: *mut f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_fbm(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_turbulence(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_delete(noise: TCOD_noise_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_heightmap_t { + pub w: ::std::os::raw::c_int, + pub h: ::std::os::raw::c_int, + pub values: *mut f32, +} +#[test] +fn bindgen_test_layout_TCOD_heightmap_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).values as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(values) + ) + ); +} +impl Default for TCOD_heightmap_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_heightmap_new( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_heightmap_t; +} +extern "C" { + pub fn TCOD_heightmap_delete(hm: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_get_value( + hm: *const TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_get_interpolated_value( + hm: *const TCOD_heightmap_t, + x: f32, + y: f32, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_set_value( + hm: *mut TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + value: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_get_slope( + hm: *const TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_get_normal( + hm: *const TCOD_heightmap_t, + x: f32, + y: f32, + n: *mut f32, + waterLevel: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_count_cells( + hm: *const TCOD_heightmap_t, + min: f32, + max: f32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_heightmap_has_land_on_border(hm: *const TCOD_heightmap_t, waterLevel: f32) -> bool; +} +extern "C" { + pub fn TCOD_heightmap_get_minmax(hm: *const TCOD_heightmap_t, min: *mut f32, max: *mut f32); +} +extern "C" { + pub fn TCOD_heightmap_copy(hm_source: *const TCOD_heightmap_t, hm_dest: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_add(hm: *mut TCOD_heightmap_t, value: f32); +} +extern "C" { + pub fn TCOD_heightmap_scale(hm: *mut TCOD_heightmap_t, value: f32); +} +extern "C" { + pub fn TCOD_heightmap_clamp(hm: *mut TCOD_heightmap_t, min: f32, max: f32); +} +extern "C" { + pub fn TCOD_heightmap_normalize(hm: *mut TCOD_heightmap_t, min: f32, max: f32); +} +extern "C" { + pub fn TCOD_heightmap_clear(hm: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_lerp_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + coef: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_multiply_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_dig_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_dig_bezier( + hm: *mut TCOD_heightmap_t, + px: *mut ::std::os::raw::c_int, + py: *mut ::std::os::raw::c_int, + startRadius: f32, + startDepth: f32, + endRadius: f32, + endDepth: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_rain_erosion( + hm: *mut TCOD_heightmap_t, + nbDrops: ::std::os::raw::c_int, + erosionCoef: f32, + sedimentationCoef: f32, + rnd: TCOD_random_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_kernel_transform( + hm: *mut TCOD_heightmap_t, + kernelsize: ::std::os::raw::c_int, + dx: *const ::std::os::raw::c_int, + dy: *const ::std::os::raw::c_int, + weight: *const f32, + minLevel: f32, + maxLevel: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_voronoi( + hm: *mut TCOD_heightmap_t, + nbPoints: ::std::os::raw::c_int, + nbCoef: ::std::os::raw::c_int, + coef: *const f32, + rnd: TCOD_random_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_mid_point_displacement( + hm: *mut TCOD_heightmap_t, + rnd: TCOD_random_t, + roughness: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_scale_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_islandify(hm: *mut TCOD_heightmap_t, seaLevel: f32, rnd: TCOD_random_t); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct TCOD_lex_t { + pub file_line: ::std::os::raw::c_int, + pub token_type: ::std::os::raw::c_int, + pub token_int_val: ::std::os::raw::c_int, + pub token_idx: ::std::os::raw::c_int, + pub token_float_val: f32, + pub tok: *mut ::std::os::raw::c_char, + pub toklen: ::std::os::raw::c_int, + pub lastStringDelim: ::std::os::raw::c_char, + pub pos: *mut ::std::os::raw::c_char, + pub buf: *mut ::std::os::raw::c_char, + pub filename: *mut ::std::os::raw::c_char, + pub last_javadoc_comment: *mut ::std::os::raw::c_char, + pub nb_symbols: ::std::os::raw::c_int, + pub nb_keywords: ::std::os::raw::c_int, + pub flags: ::std::os::raw::c_int, + pub symbols: [[::std::os::raw::c_char; 5usize]; 100usize], + pub keywords: [[::std::os::raw::c_char; 20usize]; 100usize], + pub simpleCmt: *const ::std::os::raw::c_char, + pub cmtStart: *const ::std::os::raw::c_char, + pub cmtStop: *const ::std::os::raw::c_char, + pub javadocCmtStart: *const ::std::os::raw::c_char, + pub stringDelim: *const ::std::os::raw::c_char, + pub javadoc_read: bool, + pub allocBuf: bool, + pub savept: bool, +} +#[test] +fn bindgen_test_layout_TCOD_lex_t() { + assert_eq!( + ::std::mem::size_of::(), + 2632usize, + concat!("Size of: ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).file_line as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(file_line) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_type as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_type) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_int_val as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_int_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_idx as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_idx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_float_val as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_float_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tok as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(tok) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).toklen as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(toklen) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lastStringDelim as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(lastStringDelim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pos as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(pos) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).filename as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(filename) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_javadoc_comment as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(last_javadoc_comment) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_symbols as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_symbols) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_keywords as *const _ as usize }, + 76usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_keywords) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).symbols as *const _ as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(symbols) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).keywords as *const _ as usize }, + 584usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(keywords) + ) ); -} -extern "C" { - pub fn TCOD_console_map_string_to_font_utf( - s: *const wchar_t, - fontCharX: ::std::os::raw::c_int, - fontCharY: ::std::os::raw::c_int, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).simpleCmt as *const _ as usize }, + 2584usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(simpleCmt) + ) ); -} -extern "C" { - pub fn TCOD_console_print_utf( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - fmt: *const wchar_t, - ... + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStart as *const _ as usize }, + 2592usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStart) + ) ); -} -extern "C" { - pub fn TCOD_console_print_ex_utf( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - alignment: TCOD_alignment_t, - fmt: *const wchar_t, - ... + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStop as *const _ as usize }, + 2600usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStop) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadocCmtStart as *const _ as usize }, + 2608usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadocCmtStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stringDelim as *const _ as usize }, + 2616usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(stringDelim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadoc_read as *const _ as usize }, + 2624usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadoc_read) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).allocBuf as *const _ as usize }, + 2625usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(allocBuf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).savept as *const _ as usize }, + 2626usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(savept) + ) ); } -extern "C" { - pub fn TCOD_console_print_rect_utf( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - fmt: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; +impl Default for TCOD_lex_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn TCOD_console_print_rect_ex_utf( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - alignment: TCOD_alignment_t, - fmt: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; + pub fn TCOD_lex_new_intern() -> *mut TCOD_lex_t; } extern "C" { - pub fn TCOD_console_get_height_rect_utf( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - fmt: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; + pub fn TCOD_lex_new( + symbols: *mut *const ::std::os::raw::c_char, + keywords: *mut *const ::std::os::raw::c_char, + simpleComment: *const ::std::os::raw::c_char, + commentStart: *const ::std::os::raw::c_char, + commentStop: *const ::std::os::raw::c_char, + javadocCommentStart: *const ::std::os::raw::c_char, + stringDelim: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + ) -> *mut TCOD_lex_t; } extern "C" { - pub fn TCOD_console_get_default_background(con: TCOD_console_t) -> TCOD_color_t; + pub fn TCOD_lex_delete(lex: *mut TCOD_lex_t); } extern "C" { - pub fn TCOD_console_get_default_foreground(con: TCOD_console_t) -> TCOD_color_t; + pub fn TCOD_lex_set_data_buffer(lex: *mut TCOD_lex_t, dat: *mut ::std::os::raw::c_char); } extern "C" { - pub fn TCOD_console_get_char_background( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> TCOD_color_t; + pub fn TCOD_lex_set_data_file( + lex: *mut TCOD_lex_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; } extern "C" { - pub fn TCOD_console_get_char_foreground( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> TCOD_color_t; + pub fn TCOD_lex_parse(lex: *mut TCOD_lex_t) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_console_get_char( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, + pub fn TCOD_lex_parse_until_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_console_get_background_color_image(con: TCOD_console_t) -> TCOD_image_t; -} -extern "C" { - pub fn TCOD_console_get_foreground_color_image(con: TCOD_console_t) -> TCOD_image_t; -} -extern "C" { - pub fn TCOD_console_set_fade(val: u8, fade: TCOD_color_t); -} -extern "C" { - pub fn TCOD_console_get_fade() -> u8; + pub fn TCOD_lex_parse_until_token_value( + lex: *mut TCOD_lex_t, + token_value: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_console_get_fading_color() -> TCOD_color_t; + pub fn TCOD_lex_expect_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + ) -> bool; } extern "C" { - pub fn TCOD_console_flush(); + pub fn TCOD_lex_expect_token_value( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + token_value: *const ::std::os::raw::c_char, + ) -> bool; } extern "C" { - pub fn TCOD_console_set_color_control( - con: TCOD_colctrl_t, - fore: TCOD_color_t, - back: TCOD_color_t, - ); + pub fn TCOD_lex_savepoint(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); } extern "C" { - pub fn TCOD_console_check_for_keypress(flags: ::std::os::raw::c_int) -> TCOD_key_t; + pub fn TCOD_lex_restore(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); } extern "C" { - pub fn TCOD_console_wait_for_keypress(flush: bool) -> TCOD_key_t; + pub fn TCOD_lex_get_last_javadoc(lex: *mut TCOD_lex_t) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn TCOD_console_is_key_pressed(key: TCOD_keycode_t) -> bool; + pub fn TCOD_lex_get_token_name( + token_type: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn TCOD_console_from_file(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; + pub fn TCOD_lex_get_last_error() -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn TCOD_console_load_asc( - con: TCOD_console_t, - filename: *const ::std::os::raw::c_char, - ) -> bool; + pub fn TCOD_lex_hextoint(c: ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_console_load_apf( - con: TCOD_console_t, - filename: *const ::std::os::raw::c_char, - ) -> bool; + pub fn TCOD_random_get_instance() -> TCOD_random_t; } extern "C" { - pub fn TCOD_console_save_asc( - con: TCOD_console_t, - filename: *const ::std::os::raw::c_char, - ) -> bool; + pub fn TCOD_random_new(algo: TCOD_random_algo_t) -> TCOD_random_t; } extern "C" { - pub fn TCOD_console_save_apf( - con: TCOD_console_t, - filename: *const ::std::os::raw::c_char, - ) -> bool; + pub fn TCOD_random_save(mersenne: TCOD_random_t) -> TCOD_random_t; } extern "C" { - pub fn TCOD_console_new(w: ::std::os::raw::c_int, h: ::std::os::raw::c_int) -> TCOD_console_t; + pub fn TCOD_random_restore(mersenne: TCOD_random_t, backup: TCOD_random_t); } extern "C" { - pub fn TCOD_console_get_width(con: TCOD_console_t) -> ::std::os::raw::c_int; + pub fn TCOD_random_new_from_seed(algo: TCOD_random_algo_t, seed: u32) -> TCOD_random_t; } extern "C" { - pub fn TCOD_console_get_height(con: TCOD_console_t) -> ::std::os::raw::c_int; + pub fn TCOD_random_delete(mersenne: TCOD_random_t); } extern "C" { - pub fn TCOD_console_set_key_color(con: TCOD_console_t, col: TCOD_color_t); + pub fn TCOD_random_set_distribution(mersenne: TCOD_random_t, distribution: TCOD_distribution_t); } extern "C" { - pub fn TCOD_console_blit( - src: TCOD_console_t, - xSrc: ::std::os::raw::c_int, - ySrc: ::std::os::raw::c_int, - wSrc: ::std::os::raw::c_int, - hSrc: ::std::os::raw::c_int, - dst: TCOD_console_t, - xDst: ::std::os::raw::c_int, - yDst: ::std::os::raw::c_int, - foreground_alpha: f32, - background_alpha: f32, - ); + pub fn TCOD_random_get_int( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_console_delete(console: TCOD_console_t); + pub fn TCOD_random_get_float(mersenne: TCOD_random_t, min: f32, max: f32) -> f32; } extern "C" { - pub fn TCOD_console_credits(); + pub fn TCOD_random_get_double(mersenne: TCOD_random_t, min: f64, max: f64) -> f64; } extern "C" { - pub fn TCOD_console_credits_reset(); + pub fn TCOD_random_get_int_mean( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + mean: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_console_credits_render( - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - alpha: bool, - ) -> bool; + pub fn TCOD_random_get_float_mean( + mersenne: TCOD_random_t, + min: f32, + max: f32, + mean: f32, + ) -> f32; } extern "C" { - pub fn TCOD_console_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; + pub fn TCOD_random_get_double_mean( + mersenne: TCOD_random_t, + min: f64, + max: f64, + mean: f64, + ) -> f64; } extern "C" { - pub fn TCOD_console_load_xp( - con: TCOD_console_t, - filename: *const ::std::os::raw::c_char, - ) -> bool; + pub fn TCOD_random_dice_new(s: *const ::std::os::raw::c_char) -> TCOD_dice_t; } extern "C" { - pub fn TCOD_console_save_xp( - con: TCOD_console_t, - filename: *const ::std::os::raw::c_char, - compress_level: ::std::os::raw::c_int, - ) -> bool; + pub fn TCOD_random_dice_roll( + mersenne: TCOD_random_t, + dice: TCOD_dice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_console_list_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_list_t; + pub fn TCOD_random_dice_roll_s( + mersenne: TCOD_random_t, + s: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn TCOD_console_list_save_xp( - console_list: TCOD_list_t, - filename: *const ::std::os::raw::c_char, - compress_level: ::std::os::raw::c_int, - ) -> bool; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_mouse_t { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub dx: ::std::os::raw::c_int, + pub dy: ::std::os::raw::c_int, + pub cx: ::std::os::raw::c_int, + pub cy: ::std::os::raw::c_int, + pub dcx: ::std::os::raw::c_int, + pub dcy: ::std::os::raw::c_int, + pub lbutton: bool, + pub rbutton: bool, + pub mbutton: bool, + pub lbutton_pressed: bool, + pub rbutton_pressed: bool, + pub mbutton_pressed: bool, + pub wheel_up: bool, + pub wheel_down: bool, } -pub type TCOD_map_t = *mut ::std::os::raw::c_void; -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_fov_algorithm_t { - FOV_BASIC = 0, - FOV_DIAMOND = 1, - FOV_SHADOW = 2, - FOV_PERMISSIVE_0 = 3, - FOV_PERMISSIVE_1 = 4, - FOV_PERMISSIVE_2 = 5, - FOV_PERMISSIVE_3 = 6, - FOV_PERMISSIVE_4 = 7, - FOV_PERMISSIVE_5 = 8, - FOV_PERMISSIVE_6 = 9, - FOV_PERMISSIVE_7 = 10, - FOV_PERMISSIVE_8 = 11, - FOV_RESTRICTIVE = 12, - NB_FOV_ALGORITHMS = 13, +#[test] +fn bindgen_test_layout_TCOD_mouse_t() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_mouse_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_mouse_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dx as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dy as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cx as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cy as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcx as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcy as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton as *const _ as usize }, + 33usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton as *const _ as usize }, + 34usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(mbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton_pressed as *const _ as usize }, + 35usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton_pressed as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton_pressed as *const _ as usize }, + 37usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(mbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wheel_up as *const _ as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(wheel_up) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wheel_down as *const _ as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(wheel_down) + ) + ); } extern "C" { - pub fn TCOD_map_new(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int) -> TCOD_map_t; + pub fn TCOD_mouse_show_cursor(visible: bool); } extern "C" { - pub fn TCOD_map_clear(map: TCOD_map_t, transparent: bool, walkable: bool); + pub fn TCOD_mouse_get_status() -> TCOD_mouse_t; } extern "C" { - pub fn TCOD_map_copy(source: TCOD_map_t, dest: TCOD_map_t); + pub fn TCOD_mouse_is_cursor_visible() -> bool; } extern "C" { - pub fn TCOD_map_set_properties( - map: TCOD_map_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - is_transparent: bool, - is_walkable: bool, - ); + pub fn TCOD_mouse_move(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); } extern "C" { - pub fn TCOD_map_delete(map: TCOD_map_t); + pub fn TCOD_mouse_includes_touch(enable: bool); } -extern "C" { - pub fn TCOD_map_compute_fov( - map: TCOD_map_t, - player_x: ::std::os::raw::c_int, - player_y: ::std::os::raw::c_int, - max_radius: ::std::os::raw::c_int, - light_walls: bool, - algo: TCOD_fov_algorithm_t, - ); +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_NameGen { + _unused: [u8; 0], } +pub type TCOD_namegen_t = *mut TCOD_NameGen; extern "C" { - pub fn TCOD_map_is_in_fov( - map: TCOD_map_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; + pub fn TCOD_namegen_parse(filename: *const ::std::os::raw::c_char, random: TCOD_random_t); } extern "C" { - pub fn TCOD_map_set_in_fov( - map: TCOD_map_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - fov: bool, - ); + pub fn TCOD_namegen_generate( + name: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn TCOD_map_is_transparent( - map: TCOD_map_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; + pub fn TCOD_namegen_generate_custom( + name: *mut ::std::os::raw::c_char, + rule: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn TCOD_map_is_walkable( - map: TCOD_map_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; + pub fn TCOD_namegen_get_sets() -> TCOD_list_t; } extern "C" { - pub fn TCOD_map_get_width(map: TCOD_map_t) -> ::std::os::raw::c_int; + pub fn TCOD_namegen_destroy(); } -extern "C" { - pub fn TCOD_map_get_height(map: TCOD_map_t) -> ::std::os::raw::c_int; +pub type TCOD_path_func_t = ::std::option::Option< + unsafe extern "C" fn( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + user_data: *mut ::std::os::raw::c_void, + ) -> f32, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Path { + _unused: [u8; 0], } +pub type TCOD_path_t = *mut TCOD_Path; extern "C" { - pub fn TCOD_map_get_nb_cells(map: TCOD_map_t) -> ::std::os::raw::c_int; + pub fn TCOD_path_new_using_map(map: TCOD_map_t, diagonalCost: f32) -> TCOD_path_t; } -pub type TCOD_noise_t = *mut ::std::os::raw::c_void; -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_noise_type_t { - TCOD_NOISE_PERLIN = 1, - TCOD_NOISE_SIMPLEX = 2, - TCOD_NOISE_WAVELET = 4, - TCOD_NOISE_DEFAULT = 0, +extern "C" { + pub fn TCOD_path_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_path_t; } extern "C" { - pub fn TCOD_noise_new( - dimensions: ::std::os::raw::c_int, - hurst: f32, - lacunarity: f32, - random: TCOD_random_t, - ) -> TCOD_noise_t; + pub fn TCOD_path_compute( + path: TCOD_path_t, + ox: ::std::os::raw::c_int, + oy: ::std::os::raw::c_int, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + ) -> bool; } extern "C" { - pub fn TCOD_noise_set_type(noise: TCOD_noise_t, type_: TCOD_noise_type_t); + pub fn TCOD_path_walk( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + recalculate_when_needed: bool, + ) -> bool; } extern "C" { - pub fn TCOD_noise_get_ex(noise: TCOD_noise_t, f: *mut f32, type_: TCOD_noise_type_t) -> f32; + pub fn TCOD_path_is_empty(path: TCOD_path_t) -> bool; } extern "C" { - pub fn TCOD_noise_get_fbm_ex( - noise: TCOD_noise_t, - f: *mut f32, - octaves: f32, - type_: TCOD_noise_type_t, - ) -> f32; + pub fn TCOD_path_size(path: TCOD_path_t) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_noise_get_turbulence_ex( - noise: TCOD_noise_t, - f: *mut f32, - octaves: f32, - type_: TCOD_noise_type_t, - ) -> f32; + pub fn TCOD_path_reverse(path: TCOD_path_t); } extern "C" { - pub fn TCOD_noise_get(noise: TCOD_noise_t, f: *mut f32) -> f32; + pub fn TCOD_path_get( + path: TCOD_path_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); } extern "C" { - pub fn TCOD_noise_get_fbm(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; + pub fn TCOD_path_get_origin( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); } extern "C" { - pub fn TCOD_noise_get_turbulence(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; + pub fn TCOD_path_get_destination( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); } extern "C" { - pub fn TCOD_noise_delete(noise: TCOD_noise_t); + pub fn TCOD_path_delete(path: TCOD_path_t); } +#[doc = " Dijkstra data structure"] +#[doc = ""] +#[doc = " All attributes are considered private."] #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct TCOD_heightmap_t { - pub w: ::std::os::raw::c_int, - pub h: ::std::os::raw::c_int, - pub values: *mut f32, +pub struct TCOD_Dijkstra { + pub diagonal_cost: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub nodes_max: ::std::os::raw::c_int, + pub map: TCOD_map_t, + pub func: TCOD_path_func_t, + pub user_data: *mut ::std::os::raw::c_void, + pub distances: *mut ::std::os::raw::c_uint, + pub nodes: *mut ::std::os::raw::c_uint, + pub path: TCOD_list_t, } #[test] -fn bindgen_test_layout_TCOD_heightmap_t() { +fn bindgen_test_layout_TCOD_Dijkstra() { assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(TCOD_heightmap_t)) + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(TCOD_Dijkstra)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TCOD_heightmap_t)) + concat!("Alignment of ", stringify!(TCOD_Dijkstra)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).diagonal_cost as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_heightmap_t), + stringify!(TCOD_Dijkstra), "::", - stringify!(w) + stringify!(diagonal_cost) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, 4usize, concat!( "Offset of field: ", - stringify!(TCOD_heightmap_t), + stringify!(TCOD_Dijkstra), "::", - stringify!(h) + stringify!(width) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).values as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, 8usize, concat!( "Offset of field: ", - stringify!(TCOD_heightmap_t), + stringify!(TCOD_Dijkstra), "::", - stringify!(values) + stringify!(height) ) ); -} -impl Default for TCOD_heightmap_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -extern "C" { - pub fn TCOD_heightmap_new( - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - ) -> *mut TCOD_heightmap_t; -} -extern "C" { - pub fn TCOD_heightmap_delete(hm: *mut TCOD_heightmap_t); -} -extern "C" { - pub fn TCOD_heightmap_get_value( - hm: *const TCOD_heightmap_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> f32; -} -extern "C" { - pub fn TCOD_heightmap_get_interpolated_value( - hm: *const TCOD_heightmap_t, - x: f32, - y: f32, - ) -> f32; -} -extern "C" { - pub fn TCOD_heightmap_set_value( - hm: *mut TCOD_heightmap_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - value: f32, - ); -} -extern "C" { - pub fn TCOD_heightmap_get_slope( - hm: *const TCOD_heightmap_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> f32; -} -extern "C" { - pub fn TCOD_heightmap_get_normal( - hm: *const TCOD_heightmap_t, - x: f32, - y: f32, - n: *mut f32, - waterLevel: f32, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nodes_max as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(nodes_max) + ) ); -} -extern "C" { - pub fn TCOD_heightmap_count_cells( - hm: *const TCOD_heightmap_t, - min: f32, - max: f32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_heightmap_has_land_on_border(hm: *const TCOD_heightmap_t, waterLevel: f32) -> bool; -} -extern "C" { - pub fn TCOD_heightmap_get_minmax(hm: *const TCOD_heightmap_t, min: *mut f32, max: *mut f32); -} -extern "C" { - pub fn TCOD_heightmap_copy(hm_source: *const TCOD_heightmap_t, hm_dest: *mut TCOD_heightmap_t); -} -extern "C" { - pub fn TCOD_heightmap_add(hm: *mut TCOD_heightmap_t, value: f32); -} -extern "C" { - pub fn TCOD_heightmap_scale(hm: *mut TCOD_heightmap_t, value: f32); -} -extern "C" { - pub fn TCOD_heightmap_clamp(hm: *mut TCOD_heightmap_t, min: f32, max: f32); -} -extern "C" { - pub fn TCOD_heightmap_normalize(hm: *mut TCOD_heightmap_t, min: f32, max: f32); -} -extern "C" { - pub fn TCOD_heightmap_clear(hm: *mut TCOD_heightmap_t); -} -extern "C" { - pub fn TCOD_heightmap_lerp_hm( - hm1: *const TCOD_heightmap_t, - hm2: *const TCOD_heightmap_t, - hmres: *mut TCOD_heightmap_t, - coef: f32, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).map as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(map) + ) ); -} -extern "C" { - pub fn TCOD_heightmap_add_hm( - hm1: *const TCOD_heightmap_t, - hm2: *const TCOD_heightmap_t, - hmres: *mut TCOD_heightmap_t, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).func as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(func) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).user_data as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(user_data) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).distances as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(distances) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nodes as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(nodes) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).path as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(path) + ) ); } +impl Default for TCOD_Dijkstra { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_dijkstra_t = *mut TCOD_Dijkstra; extern "C" { - pub fn TCOD_heightmap_multiply_hm( - hm1: *const TCOD_heightmap_t, - hm2: *const TCOD_heightmap_t, - hmres: *mut TCOD_heightmap_t, - ); + pub fn TCOD_dijkstra_new(map: TCOD_map_t, diagonalCost: f32) -> TCOD_dijkstra_t; } extern "C" { - pub fn TCOD_heightmap_add_hill( - hm: *mut TCOD_heightmap_t, - hx: f32, - hy: f32, - hradius: f32, - hheight: f32, - ); + pub fn TCOD_dijkstra_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_dijkstra_t; } extern "C" { - pub fn TCOD_heightmap_dig_hill( - hm: *mut TCOD_heightmap_t, - hx: f32, - hy: f32, - hradius: f32, - hheight: f32, + pub fn TCOD_dijkstra_compute( + dijkstra: TCOD_dijkstra_t, + root_x: ::std::os::raw::c_int, + root_y: ::std::os::raw::c_int, ); } extern "C" { - pub fn TCOD_heightmap_dig_bezier( - hm: *mut TCOD_heightmap_t, - px: *mut ::std::os::raw::c_int, - py: *mut ::std::os::raw::c_int, - startRadius: f32, - startDepth: f32, - endRadius: f32, - endDepth: f32, - ); + pub fn TCOD_dijkstra_get_distance( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; } extern "C" { - pub fn TCOD_heightmap_rain_erosion( - hm: *mut TCOD_heightmap_t, - nbDrops: ::std::os::raw::c_int, - erosionCoef: f32, - sedimentationCoef: f32, - rnd: TCOD_random_t, - ); + pub fn TCOD_dijkstra_path_set( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; } extern "C" { - pub fn TCOD_heightmap_kernel_transform( - hm: *mut TCOD_heightmap_t, - kernelsize: ::std::os::raw::c_int, - dx: *const ::std::os::raw::c_int, - dy: *const ::std::os::raw::c_int, - weight: *const f32, - minLevel: f32, - maxLevel: f32, - ); + pub fn TCOD_dijkstra_is_empty(path: TCOD_dijkstra_t) -> bool; } extern "C" { - pub fn TCOD_heightmap_add_voronoi( - hm: *mut TCOD_heightmap_t, - nbPoints: ::std::os::raw::c_int, - nbCoef: ::std::os::raw::c_int, - coef: *const f32, - rnd: TCOD_random_t, - ); + pub fn TCOD_dijkstra_size(path: TCOD_dijkstra_t) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_heightmap_mid_point_displacement( - hm: *mut TCOD_heightmap_t, - rnd: TCOD_random_t, - roughness: f32, - ); + pub fn TCOD_dijkstra_reverse(path: TCOD_dijkstra_t); } extern "C" { - pub fn TCOD_heightmap_add_fbm( - hm: *mut TCOD_heightmap_t, - noise: TCOD_noise_t, - mulx: f32, - muly: f32, - addx: f32, - addy: f32, - octaves: f32, - delta: f32, - scale: f32, + pub fn TCOD_dijkstra_get( + path: TCOD_dijkstra_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, ); } extern "C" { - pub fn TCOD_heightmap_scale_fbm( - hm: *mut TCOD_heightmap_t, - noise: TCOD_noise_t, - mulx: f32, - muly: f32, - addx: f32, - addy: f32, - octaves: f32, - delta: f32, - scale: f32, - ); + pub fn TCOD_dijkstra_path_walk( + dijkstra: TCOD_dijkstra_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ) -> bool; } extern "C" { - pub fn TCOD_heightmap_islandify(hm: *mut TCOD_heightmap_t, seaLevel: f32, rnd: TCOD_random_t); + pub fn TCOD_dijkstra_delete(dijkstra: TCOD_dijkstra_t); } +pub type max_align_t = f64; #[repr(C)] -#[derive(Copy, Clone)] -pub struct TCOD_lex_t { - pub file_line: ::std::os::raw::c_int, - pub token_type: ::std::os::raw::c_int, - pub token_int_val: ::std::os::raw::c_int, - pub token_idx: ::std::os::raw::c_int, - pub token_float_val: f32, - pub tok: *mut ::std::os::raw::c_char, - pub toklen: ::std::os::raw::c_int, - pub lastStringDelim: ::std::os::raw::c_char, - pub pos: *mut ::std::os::raw::c_char, - pub buf: *mut ::std::os::raw::c_char, - pub filename: *mut ::std::os::raw::c_char, - pub last_javadoc_comment: *mut ::std::os::raw::c_char, - pub nb_symbols: ::std::os::raw::c_int, - pub nb_keywords: ::std::os::raw::c_int, - pub flags: ::std::os::raw::c_int, - pub symbols: [[::std::os::raw::c_char; 5usize]; 100usize], - pub keywords: [[::std::os::raw::c_char; 20usize]; 100usize], - pub simpleCmt: *const ::std::os::raw::c_char, - pub cmtStart: *const ::std::os::raw::c_char, - pub cmtStop: *const ::std::os::raw::c_char, - pub javadocCmtStart: *const ::std::os::raw::c_char, - pub stringDelim: *const ::std::os::raw::c_char, - pub javadoc_read: bool, - pub allocBuf: bool, - pub savept: bool, +#[derive(Debug, Default)] +pub struct TCOD_HeapNode { + pub priority: ::std::os::raw::c_int, + pub data: __IncompleteArrayField<::std::os::raw::c_uchar>, } #[test] -fn bindgen_test_layout_TCOD_lex_t() { +fn bindgen_test_layout_TCOD_HeapNode() { assert_eq!( - ::std::mem::size_of::(), - 2632usize, - concat!("Size of: ", stringify!(TCOD_lex_t)) + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(TCOD_HeapNode)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(TCOD_lex_t)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_HeapNode)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).file_line as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).priority as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_HeapNode), "::", - stringify!(file_line) + stringify!(priority) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).token_type as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, 4usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_HeapNode), "::", - stringify!(token_type) + stringify!(data) ) ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Heap { + pub heap: *mut TCOD_HeapNode, + pub size: ::std::os::raw::c_int, + pub capacity: ::std::os::raw::c_int, + pub node_size: size_t, + pub data_size: size_t, +} +#[test] +fn bindgen_test_layout_TCOD_Heap() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(TCOD_Heap)) + ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).token_int_val as *const _ as usize }, + ::std::mem::align_of::(), 8usize, + concat!("Alignment of ", stringify!(TCOD_Heap)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Heap), "::", - stringify!(token_int_val) + stringify!(heap) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).token_idx as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).capacity as *const _ as usize }, 12usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Heap), "::", - stringify!(token_idx) + stringify!(capacity) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).token_float_val as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).node_size as *const _ as usize }, 16usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Heap), "::", - stringify!(token_float_val) + stringify!(node_size) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tok as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).data_size as *const _ as usize }, 24usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Heap), "::", - stringify!(tok) + stringify!(data_size) ) ); +} +impl Default for TCOD_Heap { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_heap_init(heap: *mut TCOD_Heap, data_size: size_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_heap_uninit(heap: *mut TCOD_Heap); +} +extern "C" { + pub fn TCOD_heap_clear(heap: *mut TCOD_Heap); +} +extern "C" { + pub fn TCOD_minheap_push( + minheap: *mut TCOD_Heap, + priority: ::std::os::raw::c_int, + data: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_minheap_pop(minheap: *mut TCOD_Heap, out: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_minheap_heapify(minheap: *mut TCOD_Heap); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_ArrayData { + pub ndim: i8, + pub int_type: ::std::os::raw::c_int, + pub shape: [size_t; 5usize], + pub strides: [size_t; 5usize], + pub data: *mut ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_TCOD_ArrayData() { + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(TCOD_ArrayData)) + ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).toklen as *const _ as usize }, - 32usize, + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_ArrayData)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_ArrayData), "::", - stringify!(toklen) + stringify!(ndim) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lastStringDelim as *const _ as usize }, - 36usize, + unsafe { &(*(::std::ptr::null::())).int_type as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_ArrayData), "::", - stringify!(lastStringDelim) + stringify!(int_type) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pos as *const _ as usize }, - 40usize, + unsafe { &(*(::std::ptr::null::())).shape as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_ArrayData), "::", - stringify!(pos) + stringify!(shape) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).strides as *const _ as usize }, 48usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_ArrayData), "::", - stringify!(buf) + stringify!(strides) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).filename as *const _ as usize }, - 56usize, + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 88usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_ArrayData), "::", - stringify!(filename) + stringify!(data) ) ); +} +impl Default for TCOD_ArrayData { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_BasicGraph2D { + pub cost: TCOD_ArrayData, + pub cardinal: ::std::os::raw::c_int, + pub diagonal: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_BasicGraph2D() { assert_eq!( - unsafe { &(*(::std::ptr::null::())).last_javadoc_comment as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(TCOD_lex_t), - "::", - stringify!(last_javadoc_comment) - ) + ::std::mem::size_of::(), + 104usize, + concat!("Size of: ", stringify!(TCOD_BasicGraph2D)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).nb_symbols as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(TCOD_lex_t), - "::", - stringify!(nb_symbols) - ) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_BasicGraph2D)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).nb_keywords as *const _ as usize }, - 76usize, + unsafe { &(*(::std::ptr::null::())).cost as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_BasicGraph2D), "::", - stringify!(nb_keywords) + stringify!(cost) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 80usize, + unsafe { &(*(::std::ptr::null::())).cardinal as *const _ as usize }, + 96usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_BasicGraph2D), "::", - stringify!(flags) + stringify!(cardinal) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).symbols as *const _ as usize }, - 84usize, + unsafe { &(*(::std::ptr::null::())).diagonal as *const _ as usize }, + 100usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_BasicGraph2D), "::", - stringify!(symbols) + stringify!(diagonal) ) ); +} +impl Default for TCOD_BasicGraph2D { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Pathfinder { + pub ndim: i8, + pub shape: [size_t; 4usize], + pub owns_distance: bool, + pub owns_graph: bool, + pub owns_traversal: bool, + pub distance: TCOD_ArrayData, + pub graph: TCOD_BasicGraph2D, + pub traversal: TCOD_ArrayData, + pub heap: TCOD_Heap, +} +#[test] +fn bindgen_test_layout_TCOD_Pathfinder() { + assert_eq!( + ::std::mem::size_of::(), + 376usize, + concat!("Size of: ", stringify!(TCOD_Pathfinder)) + ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keywords as *const _ as usize }, - 584usize, + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Pathfinder)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(keywords) + stringify!(ndim) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).simpleCmt as *const _ as usize }, - 2584usize, + unsafe { &(*(::std::ptr::null::())).shape as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(simpleCmt) + stringify!(shape) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cmtStart as *const _ as usize }, - 2592usize, + unsafe { &(*(::std::ptr::null::())).owns_distance as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(cmtStart) + stringify!(owns_distance) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cmtStop as *const _ as usize }, - 2600usize, + unsafe { &(*(::std::ptr::null::())).owns_graph as *const _ as usize }, + 41usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(cmtStop) + stringify!(owns_graph) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).javadocCmtStart as *const _ as usize }, - 2608usize, + unsafe { &(*(::std::ptr::null::())).owns_traversal as *const _ as usize }, + 42usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(javadocCmtStart) + stringify!(owns_traversal) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stringDelim as *const _ as usize }, - 2616usize, + unsafe { &(*(::std::ptr::null::())).distance as *const _ as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(stringDelim) + stringify!(distance) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).javadoc_read as *const _ as usize }, - 2624usize, + unsafe { &(*(::std::ptr::null::())).graph as *const _ as usize }, + 144usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(javadoc_read) + stringify!(graph) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).allocBuf as *const _ as usize }, - 2625usize, + unsafe { &(*(::std::ptr::null::())).traversal as *const _ as usize }, + 248usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(allocBuf) + stringify!(traversal) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).savept as *const _ as usize }, - 2626usize, + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 344usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(savept) + stringify!(heap) ) ); } -impl Default for TCOD_lex_t { +impl Default for TCOD_Pathfinder { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } extern "C" { - pub fn TCOD_lex_new_intern() -> *mut TCOD_lex_t; -} -extern "C" { - pub fn TCOD_lex_new( - symbols: *mut *const ::std::os::raw::c_char, - keywords: *mut *const ::std::os::raw::c_char, - simpleComment: *const ::std::os::raw::c_char, - commentStart: *const ::std::os::raw::c_char, - commentStop: *const ::std::os::raw::c_char, - javadocCommentStart: *const ::std::os::raw::c_char, - stringDelim: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, - ) -> *mut TCOD_lex_t; -} -extern "C" { - pub fn TCOD_lex_delete(lex: *mut TCOD_lex_t); -} -extern "C" { - pub fn TCOD_lex_set_data_buffer(lex: *mut TCOD_lex_t, dat: *mut ::std::os::raw::c_char); -} -extern "C" { - pub fn TCOD_lex_set_data_file( - lex: *mut TCOD_lex_t, - filename: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn TCOD_lex_parse(lex: *mut TCOD_lex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_lex_parse_until_token_type( - lex: *mut TCOD_lex_t, - token_type: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_lex_parse_until_token_value( - lex: *mut TCOD_lex_t, - token_value: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_lex_expect_token_type( - lex: *mut TCOD_lex_t, - token_type: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn TCOD_lex_expect_token_value( - lex: *mut TCOD_lex_t, - token_type: ::std::os::raw::c_int, - token_value: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn TCOD_lex_savepoint(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); -} -extern "C" { - pub fn TCOD_lex_restore(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); -} -extern "C" { - pub fn TCOD_lex_get_last_javadoc(lex: *mut TCOD_lex_t) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_lex_get_token_name( - token_type: ::std::os::raw::c_int, - ) -> *const ::std::os::raw::c_char; + pub fn TCOD_pf_new(ndim: ::std::os::raw::c_int, shape: *const size_t) -> *mut TCOD_Pathfinder; } extern "C" { - pub fn TCOD_lex_get_last_error() -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_lex_hextoint(c: ::std::os::raw::c_char) -> ::std::os::raw::c_int; + pub fn TCOD_pf_delete(path: *mut TCOD_Pathfinder); } extern "C" { - pub fn TCOD_random_get_instance() -> TCOD_random_t; -} -extern "C" { - pub fn TCOD_random_new(algo: TCOD_random_algo_t) -> TCOD_random_t; + pub fn TCOD_pf_set_distance_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + ); } extern "C" { - pub fn TCOD_random_save(mersenne: TCOD_random_t) -> TCOD_random_t; + pub fn TCOD_pf_set_graph2d_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + cardinal: ::std::os::raw::c_int, + diagonal: ::std::os::raw::c_int, + ); } extern "C" { - pub fn TCOD_random_restore(mersenne: TCOD_random_t, backup: TCOD_random_t); + pub fn TCOD_pf_set_traversal_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + ); } extern "C" { - pub fn TCOD_random_new_from_seed(algo: TCOD_random_algo_t, seed: u32) -> TCOD_random_t; + pub fn TCOD_pf_recompile(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_random_delete(mersenne: TCOD_random_t); + pub fn TCOD_pf_compute(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_random_set_distribution(mersenne: TCOD_random_t, distribution: TCOD_distribution_t); + pub fn TCOD_pf_compute_step(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; } -extern "C" { - pub fn TCOD_random_get_int( - mersenne: TCOD_random_t, - min: ::std::os::raw::c_int, - max: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Frontier { + pub ndim: i8, + pub active_dist: ::std::os::raw::c_int, + pub active_index: [::std::os::raw::c_int; 4usize], + pub heap: TCOD_Heap, } -extern "C" { - pub fn TCOD_random_get_float(mersenne: TCOD_random_t, min: f32, max: f32) -> f32; +#[test] +fn bindgen_test_layout_TCOD_Frontier() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(TCOD_Frontier)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Frontier)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).active_dist as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(active_dist) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).active_index as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(active_index) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(heap) + ) + ); } -extern "C" { - pub fn TCOD_random_get_double(mersenne: TCOD_random_t, min: f64, max: f64) -> f64; +impl Default for TCOD_Frontier { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn TCOD_random_get_int_mean( - mersenne: TCOD_random_t, - min: ::std::os::raw::c_int, - max: ::std::os::raw::c_int, - mean: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + #[doc = "Create a new pathfinder frontier."] + #[doc = ""] + #[doc = "`ndim` is the number of dimensions. Must be in the range `1 <= n <= 4`."] + pub fn TCOD_frontier_new(ndim: ::std::os::raw::c_int) -> *mut TCOD_Frontier; } extern "C" { - pub fn TCOD_random_get_float_mean( - mersenne: TCOD_random_t, - min: f32, - max: f32, - mean: f32, - ) -> f32; + #[doc = "Delete a pathfinder frontier."] + pub fn TCOD_frontier_delete(frontier: *mut TCOD_Frontier); } extern "C" { - pub fn TCOD_random_get_double_mean( - mersenne: TCOD_random_t, - min: f64, - max: f64, - mean: f64, - ) -> f64; + #[doc = "Pop the next node from this frontier."] + #[doc = ""] + #[doc = "The popped node variables will placed in the `active_dist` and"] + #[doc = "`active_index` attributes."] + pub fn TCOD_frontier_pop(frontier: *mut TCOD_Frontier) -> TCOD_Error; } extern "C" { - pub fn TCOD_random_dice_new(s: *const ::std::os::raw::c_char) -> TCOD_dice_t; + #[doc = "Add a node to this frontier."] + #[doc = ""] + #[doc = "`index[frontier->ndim]` is the position of the node to add to the frontier."] + #[doc = ""] + #[doc = "`dist` is the total distance of the node. This should be a low number"] + #[doc = "like 0, but can also be a negative number such as `INT_MIN`."] + #[doc = "When adding a node as an edge then `dist` is `frontier->active_dist` plus"] + #[doc = "the cost of the edge."] + #[doc = ""] + #[doc = "`heuristic` is the true priority of the node, used to affect node order."] + #[doc = "For Dijkstra-like algorithms this should be the same as `dist`."] + #[doc = "For A* this should be `dist` plus the maximum possible distance to the"] + #[doc = "goal."] + pub fn TCOD_frontier_push( + frontier: *mut TCOD_Frontier, + index: *const ::std::os::raw::c_int, + dist: ::std::os::raw::c_int, + heuristic: ::std::os::raw::c_int, + ) -> TCOD_Error; } extern "C" { - pub fn TCOD_random_dice_roll( - mersenne: TCOD_random_t, - dice: TCOD_dice_t, - ) -> ::std::os::raw::c_int; + #[doc = "Return the current number of nodes in this frontier."] + pub fn TCOD_frontier_size(frontier: *const TCOD_Frontier) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_random_dice_roll_s( - mersenne: TCOD_random_t, - s: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; + #[doc = "Remove all nodes from this frontier."] + pub fn TCOD_frontier_clear(frontier: *mut TCOD_Frontier) -> TCOD_Error; +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_value_type_t { + TCOD_TYPE_NONE = 0, + TCOD_TYPE_BOOL = 1, + TCOD_TYPE_CHAR = 2, + TCOD_TYPE_INT = 3, + TCOD_TYPE_FLOAT = 4, + TCOD_TYPE_STRING = 5, + TCOD_TYPE_COLOR = 6, + TCOD_TYPE_DICE = 7, + TCOD_TYPE_VALUELIST00 = 8, + TCOD_TYPE_VALUELIST01 = 9, + TCOD_TYPE_VALUELIST02 = 10, + TCOD_TYPE_VALUELIST03 = 11, + TCOD_TYPE_VALUELIST04 = 12, + TCOD_TYPE_VALUELIST05 = 13, + TCOD_TYPE_VALUELIST06 = 14, + TCOD_TYPE_VALUELIST07 = 15, + TCOD_TYPE_VALUELIST08 = 16, + TCOD_TYPE_VALUELIST09 = 17, + TCOD_TYPE_VALUELIST10 = 18, + TCOD_TYPE_VALUELIST11 = 19, + TCOD_TYPE_VALUELIST12 = 20, + TCOD_TYPE_VALUELIST13 = 21, + TCOD_TYPE_VALUELIST14 = 22, + TCOD_TYPE_VALUELIST15 = 23, + TCOD_TYPE_CUSTOM00 = 24, + TCOD_TYPE_CUSTOM01 = 25, + TCOD_TYPE_CUSTOM02 = 26, + TCOD_TYPE_CUSTOM03 = 27, + TCOD_TYPE_CUSTOM04 = 28, + TCOD_TYPE_CUSTOM05 = 29, + TCOD_TYPE_CUSTOM06 = 30, + TCOD_TYPE_CUSTOM07 = 31, + TCOD_TYPE_CUSTOM08 = 32, + TCOD_TYPE_CUSTOM09 = 33, + TCOD_TYPE_CUSTOM10 = 34, + TCOD_TYPE_CUSTOM11 = 35, + TCOD_TYPE_CUSTOM12 = 36, + TCOD_TYPE_CUSTOM13 = 37, + TCOD_TYPE_CUSTOM14 = 38, + TCOD_TYPE_CUSTOM15 = 39, + TCOD_TYPE_LIST = 1024, } #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct TCOD_mouse_t { - pub x: ::std::os::raw::c_int, - pub y: ::std::os::raw::c_int, - pub dx: ::std::os::raw::c_int, - pub dy: ::std::os::raw::c_int, - pub cx: ::std::os::raw::c_int, - pub cy: ::std::os::raw::c_int, - pub dcx: ::std::os::raw::c_int, - pub dcy: ::std::os::raw::c_int, - pub lbutton: bool, - pub rbutton: bool, - pub mbutton: bool, - pub lbutton_pressed: bool, - pub rbutton_pressed: bool, - pub mbutton_pressed: bool, - pub wheel_up: bool, - pub wheel_down: bool, +#[derive(Copy, Clone)] +pub union TCOD_value_t { + pub b: bool, + pub c: ::std::os::raw::c_char, + pub i: i32, + pub f: f32, + pub s: *mut ::std::os::raw::c_char, + pub col: TCOD_color_t, + pub dice: TCOD_dice_t, + pub list: TCOD_list_t, + pub custom: *mut ::std::os::raw::c_void, + _bindgen_union_align: [u64; 2usize], } #[test] -fn bindgen_test_layout_TCOD_mouse_t() { +fn bindgen_test_layout_TCOD_value_t() { assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(TCOD_mouse_t)) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_value_t)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(TCOD_mouse_t)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_value_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(x) + stringify!(b) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(y) + stringify!(c) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dx as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).i as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(dx) + stringify!(i) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dy as *const _ as usize }, - 12usize, + unsafe { &(*(::std::ptr::null::())).f as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(dy) + stringify!(f) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cx as *const _ as usize }, - 16usize, + unsafe { &(*(::std::ptr::null::())).s as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(cx) + stringify!(s) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cy as *const _ as usize }, - 20usize, + unsafe { &(*(::std::ptr::null::())).col as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(cy) + stringify!(col) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dcx as *const _ as usize }, - 24usize, + unsafe { &(*(::std::ptr::null::())).dice as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(dcx) + stringify!(dice) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dcy as *const _ as usize }, - 28usize, + unsafe { &(*(::std::ptr::null::())).list as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(dcy) + stringify!(list) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lbutton as *const _ as usize }, - 32usize, + unsafe { &(*(::std::ptr::null::())).custom as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(lbutton) + stringify!(custom) ) ); +} +impl Default for TCOD_value_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_parser_struct_t = *mut TCOD_ParserStruct; +extern "C" { + pub fn TCOD_struct_get_name(def: TCOD_parser_struct_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_struct_add_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_list_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list_sized( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + size: ::std::os::raw::c_int, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_flag(def: TCOD_parser_struct_t, propname: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_struct_add_structure( + def: TCOD_parser_struct_t, + sub_structure: TCOD_parser_struct_t, + ); +} +extern "C" { + pub fn TCOD_struct_is_mandatory( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_struct_get_type( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> TCOD_value_type_t; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_parser_listener_t { + pub new_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub new_flag: + ::std::option::Option bool>, + pub new_property: ::std::option::Option< + unsafe extern "C" fn( + propname: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + value: TCOD_value_t, + ) -> bool, + >, + pub end_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub error: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_TCOD_parser_listener_t() { assert_eq!( - unsafe { &(*(::std::ptr::null::())).rbutton as *const _ as usize }, - 33usize, - concat!( - "Offset of field: ", - stringify!(TCOD_mouse_t), - "::", - stringify!(rbutton) - ) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_parser_listener_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mbutton as *const _ as usize }, - 34usize, - concat!( - "Offset of field: ", - stringify!(TCOD_mouse_t), - "::", - stringify!(mbutton) - ) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_parser_listener_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lbutton_pressed as *const _ as usize }, - 35usize, + unsafe { + &(*(::std::ptr::null::())).new_struct as *const _ as usize + }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_parser_listener_t), "::", - stringify!(lbutton_pressed) + stringify!(new_struct) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rbutton_pressed as *const _ as usize }, - 36usize, + unsafe { &(*(::std::ptr::null::())).new_flag as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_parser_listener_t), "::", - stringify!(rbutton_pressed) + stringify!(new_flag) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mbutton_pressed as *const _ as usize }, - 37usize, + unsafe { + &(*(::std::ptr::null::())).new_property as *const _ as usize + }, + 16usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_parser_listener_t), "::", - stringify!(mbutton_pressed) + stringify!(new_property) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).wheel_up as *const _ as usize }, - 38usize, + unsafe { + &(*(::std::ptr::null::())).end_struct as *const _ as usize + }, + 24usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_parser_listener_t), "::", - stringify!(wheel_up) + stringify!(end_struct) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).wheel_down as *const _ as usize }, - 39usize, + unsafe { &(*(::std::ptr::null::())).error as *const _ as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_parser_listener_t), "::", - stringify!(wheel_down) + stringify!(error) ) ); } +pub type TCOD_parser_custom_t = ::std::option::Option< + unsafe extern "C" fn( + lex: *mut TCOD_lex_t, + listener: *mut TCOD_parser_listener_t, + str: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + ) -> TCOD_value_t, +>; +pub type TCOD_parser_t = *mut TCOD_Parser; extern "C" { - pub fn TCOD_mouse_show_cursor(visible: bool); + pub fn TCOD_parser_new() -> TCOD_parser_t; } extern "C" { - pub fn TCOD_mouse_get_status() -> TCOD_mouse_t; + pub fn TCOD_parser_new_struct( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_parser_struct_t; } extern "C" { - pub fn TCOD_mouse_is_cursor_visible() -> bool; + pub fn TCOD_parser_new_custom_type( + parser: TCOD_parser_t, + custom_type_parser: TCOD_parser_custom_t, + ) -> TCOD_value_type_t; } extern "C" { - pub fn TCOD_mouse_move(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); + pub fn TCOD_parser_run( + parser: TCOD_parser_t, + filename: *const ::std::os::raw::c_char, + listener: *mut TCOD_parser_listener_t, + ); } extern "C" { - pub fn TCOD_mouse_includes_touch(enable: bool); + pub fn TCOD_parser_delete(parser: TCOD_parser_t); } -pub type TCOD_namegen_t = *mut ::std::os::raw::c_void; extern "C" { - pub fn TCOD_namegen_parse(filename: *const ::std::os::raw::c_char, random: TCOD_random_t); + pub fn TCOD_parser_error(msg: *const ::std::os::raw::c_char, ...); } extern "C" { - pub fn TCOD_namegen_generate( - name: *mut ::std::os::raw::c_char, - allocate: bool, - ) -> *mut ::std::os::raw::c_char; + pub fn TCOD_parser_has_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; } extern "C" { - pub fn TCOD_namegen_generate_custom( - name: *mut ::std::os::raw::c_char, - rule: *mut ::std::os::raw::c_char, - allocate: bool, - ) -> *mut ::std::os::raw::c_char; + pub fn TCOD_parser_get_bool_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; } extern "C" { - pub fn TCOD_namegen_get_sets() -> TCOD_list_t; + pub fn TCOD_parser_get_char_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_namegen_destroy(); + pub fn TCOD_parser_get_int_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } -pub type TCOD_path_func_t = ::std::option::Option< - unsafe extern "C" fn( - xFrom: ::std::os::raw::c_int, - yFrom: ::std::os::raw::c_int, - xTo: ::std::os::raw::c_int, - yTo: ::std::os::raw::c_int, - user_data: *mut ::std::os::raw::c_void, - ) -> f32, ->; -pub type TCOD_path_t = *mut ::std::os::raw::c_void; extern "C" { - pub fn TCOD_path_new_using_map(map: TCOD_map_t, diagonalCost: f32) -> TCOD_path_t; + pub fn TCOD_parser_get_float_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> f32; } extern "C" { - pub fn TCOD_path_new_using_function( - map_width: ::std::os::raw::c_int, - map_height: ::std::os::raw::c_int, - func: TCOD_path_func_t, - user_data: *mut ::std::os::raw::c_void, - diagonalCost: f32, - ) -> TCOD_path_t; + pub fn TCOD_parser_get_string_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn TCOD_path_compute( - path: TCOD_path_t, - ox: ::std::os::raw::c_int, - oy: ::std::os::raw::c_int, - dx: ::std::os::raw::c_int, - dy: ::std::os::raw::c_int, - ) -> bool; + pub fn TCOD_parser_get_color_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_color_t; } extern "C" { - pub fn TCOD_path_walk( - path: TCOD_path_t, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int, - recalculate_when_needed: bool, - ) -> bool; + pub fn TCOD_parser_get_dice_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_dice_t; } extern "C" { - pub fn TCOD_path_is_empty(path: TCOD_path_t) -> bool; + pub fn TCOD_parser_get_dice_property_py( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + dice: *mut TCOD_dice_t, + ); +} +extern "C" { + pub fn TCOD_parser_get_custom_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_parser_get_list_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + ) -> TCOD_list_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_ParserStruct { + pub name: *mut ::std::os::raw::c_char, + pub flags: TCOD_list_t, + pub props: TCOD_list_t, + pub lists: TCOD_list_t, + pub structs: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_ParserStruct() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_ParserStruct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_ParserStruct)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(props) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lists as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(lists) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(structs) + ) + ); } -extern "C" { - pub fn TCOD_path_size(path: TCOD_path_t) -> ::std::os::raw::c_int; +impl Default for TCOD_ParserStruct { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } -extern "C" { - pub fn TCOD_path_reverse(path: TCOD_path_t); +pub type TCOD_struct_int_t = TCOD_ParserStruct; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Parser { + pub structs: TCOD_list_t, + pub customs: [TCOD_parser_custom_t; 16usize], + pub fatal: bool, + pub props: TCOD_list_t, } -extern "C" { - pub fn TCOD_path_get( - path: TCOD_path_t, - index: ::std::os::raw::c_int, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int, +#[test] +fn bindgen_test_layout_TCOD_Parser() { + assert_eq!( + ::std::mem::size_of::(), + 152usize, + concat!("Size of: ", stringify!(TCOD_Parser)) ); -} -extern "C" { - pub fn TCOD_path_get_origin( - path: TCOD_path_t, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int, + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Parser)) ); -} -extern "C" { - pub fn TCOD_path_get_destination( - path: TCOD_path_t, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(structs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).customs as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(customs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fatal as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(fatal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(props) + ) ); } -extern "C" { - pub fn TCOD_path_delete(path: TCOD_path_t); -} -pub type TCOD_dijkstra_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_dijkstra_new(map: TCOD_map_t, diagonalCost: f32) -> TCOD_dijkstra_t; -} -extern "C" { - pub fn TCOD_dijkstra_new_using_function( - map_width: ::std::os::raw::c_int, - map_height: ::std::os::raw::c_int, - func: TCOD_path_func_t, - user_data: *mut ::std::os::raw::c_void, - diagonalCost: f32, - ) -> TCOD_dijkstra_t; +impl Default for TCOD_Parser { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } +pub type TCOD_parser_int_t = TCOD_Parser; extern "C" { - pub fn TCOD_dijkstra_compute( - dijkstra: TCOD_dijkstra_t, - root_x: ::std::os::raw::c_int, - root_y: ::std::os::raw::c_int, - ); + pub fn TCOD_parse_bool_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_get_distance( - dijkstra: TCOD_dijkstra_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> f32; + pub fn TCOD_parse_char_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_path_set( - dijkstra: TCOD_dijkstra_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; + pub fn TCOD_parse_integer_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_is_empty(path: TCOD_dijkstra_t) -> bool; + pub fn TCOD_parse_float_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_size(path: TCOD_dijkstra_t) -> ::std::os::raw::c_int; + pub fn TCOD_parse_string_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_reverse(path: TCOD_dijkstra_t); + pub fn TCOD_parse_color_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_get( - path: TCOD_dijkstra_t, - index: ::std::os::raw::c_int, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int, - ); + pub fn TCOD_parse_dice_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_path_walk( - dijkstra: TCOD_dijkstra_t, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int, - ) -> bool; + pub fn TCOD_parse_value_list_value( + def: *mut TCOD_struct_int_t, + listnum: ::std::os::raw::c_int, + ) -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_delete(dijkstra: TCOD_dijkstra_t); -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_value_type_t { - TCOD_TYPE_NONE = 0, - TCOD_TYPE_BOOL = 1, - TCOD_TYPE_CHAR = 2, - TCOD_TYPE_INT = 3, - TCOD_TYPE_FLOAT = 4, - TCOD_TYPE_STRING = 5, - TCOD_TYPE_COLOR = 6, - TCOD_TYPE_DICE = 7, - TCOD_TYPE_VALUELIST00 = 8, - TCOD_TYPE_VALUELIST01 = 9, - TCOD_TYPE_VALUELIST02 = 10, - TCOD_TYPE_VALUELIST03 = 11, - TCOD_TYPE_VALUELIST04 = 12, - TCOD_TYPE_VALUELIST05 = 13, - TCOD_TYPE_VALUELIST06 = 14, - TCOD_TYPE_VALUELIST07 = 15, - TCOD_TYPE_VALUELIST08 = 16, - TCOD_TYPE_VALUELIST09 = 17, - TCOD_TYPE_VALUELIST10 = 18, - TCOD_TYPE_VALUELIST11 = 19, - TCOD_TYPE_VALUELIST12 = 20, - TCOD_TYPE_VALUELIST13 = 21, - TCOD_TYPE_VALUELIST14 = 22, - TCOD_TYPE_VALUELIST15 = 23, - TCOD_TYPE_CUSTOM00 = 24, - TCOD_TYPE_CUSTOM01 = 25, - TCOD_TYPE_CUSTOM02 = 26, - TCOD_TYPE_CUSTOM03 = 27, - TCOD_TYPE_CUSTOM04 = 28, - TCOD_TYPE_CUSTOM05 = 29, - TCOD_TYPE_CUSTOM06 = 30, - TCOD_TYPE_CUSTOM07 = 31, - TCOD_TYPE_CUSTOM08 = 32, - TCOD_TYPE_CUSTOM09 = 33, - TCOD_TYPE_CUSTOM10 = 34, - TCOD_TYPE_CUSTOM11 = 35, - TCOD_TYPE_CUSTOM12 = 36, - TCOD_TYPE_CUSTOM13 = 37, - TCOD_TYPE_CUSTOM14 = 38, - TCOD_TYPE_CUSTOM15 = 39, - TCOD_TYPE_LIST = 1024, + pub fn TCOD_parse_property_value( + parser: *mut TCOD_parser_int_t, + def: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + list: bool, + ) -> TCOD_value_t; } #[repr(C)] -#[derive(Copy, Clone)] -pub union TCOD_value_t { - pub b: bool, - pub c: ::std::os::raw::c_char, - pub i: i32, - pub f: f32, - pub s: *mut ::std::os::raw::c_char, - pub col: TCOD_color_t, - pub dice: TCOD_dice_t, - pub list: TCOD_list_t, - pub custom: *mut ::std::os::raw::c_void, - _bindgen_union_align: [u64; 2usize], +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetAtlasOpenGL { + pub tileset: *mut TCOD_Tileset, + pub observer: *mut TCOD_TilesetObserver, + pub texture: u32, + pub texture_size: ::std::os::raw::c_int, + pub texture_columns: ::std::os::raw::c_int, + pub texture_rows: ::std::os::raw::c_int, } #[test] -fn bindgen_test_layout_TCOD_value_t() { +fn bindgen_test_layout_TCOD_TilesetAtlasOpenGL() { assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(TCOD_value_t)) + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(TCOD_TilesetAtlasOpenGL)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TCOD_value_t)) + concat!("Alignment of ", stringify!(TCOD_TilesetAtlasOpenGL)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(tileset) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).observer as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(observer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_size as *const _ as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_columns as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_columns) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).texture_rows as *const _ as usize + }, + 28usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_TilesetAtlasOpenGL), "::", - stringify!(b) + stringify!(texture_rows) ) ); +} +impl Default for TCOD_TilesetAtlasOpenGL { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGLCommon { + pub window: *mut SDL_Window, + pub glcontext: *mut ::std::os::raw::c_void, + pub atlas: *mut TCOD_TilesetAtlasOpenGL, + pub sdl_subsystems: u32, + pub last_offset_x: f64, + pub last_offset_y: f64, + pub last_scale_x: f64, + pub last_scale_y: f64, +} +#[test] +fn bindgen_test_layout_TCOD_RendererGLCommon() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(TCOD_RendererGLCommon)) + ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererGLCommon)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(c) + stringify!(window) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).i as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).glcontext as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(i) + stringify!(glcontext) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).f as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).atlas as *const _ as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(f) + stringify!(atlas) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).s as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).sdl_subsystems as *const _ as usize + }, + 24usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(s) + stringify!(sdl_subsystems) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).col as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).last_offset_x as *const _ as usize + }, + 32usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(col) + stringify!(last_offset_x) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dice as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).last_offset_y as *const _ as usize + }, + 40usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(dice) + stringify!(last_offset_y) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).list as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).last_scale_x as *const _ as usize + }, + 48usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(list) + stringify!(last_scale_x) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).custom as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).last_scale_y as *const _ as usize + }, + 56usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(custom) + stringify!(last_scale_y) ) ); } -impl Default for TCOD_value_t { +impl Default for TCOD_RendererGLCommon { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } -pub type TCOD_parser_struct_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_struct_get_name(def: TCOD_parser_struct_t) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_struct_add_property( - def: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - type_: TCOD_value_type_t, - mandatory: bool, - ); -} -extern "C" { - pub fn TCOD_struct_add_list_property( - def: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - type_: TCOD_value_type_t, - mandatory: bool, - ); -} -extern "C" { - pub fn TCOD_struct_add_value_list( - def: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - value_list: *mut *const ::std::os::raw::c_char, - mandatory: bool, - ); -} -extern "C" { - pub fn TCOD_struct_add_value_list_sized( - def: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - value_list: *mut *const ::std::os::raw::c_char, - size: ::std::os::raw::c_int, - mandatory: bool, - ); -} -extern "C" { - pub fn TCOD_struct_add_flag(def: TCOD_parser_struct_t, propname: *const ::std::os::raw::c_char); -} extern "C" { - pub fn TCOD_struct_add_structure( - def: TCOD_parser_struct_t, - sub_structure: TCOD_parser_struct_t, - ); -} -extern "C" { - pub fn TCOD_struct_is_mandatory( - def: TCOD_parser_struct_t, - propname: *const ::std::os::raw::c_char, - ) -> bool; + pub fn TCOD_gl_atlas_new(tileset: *mut TCOD_Tileset) -> *mut TCOD_TilesetAtlasOpenGL; } extern "C" { - pub fn TCOD_struct_get_type( - def: TCOD_parser_struct_t, - propname: *const ::std::os::raw::c_char, - ) -> TCOD_value_type_t; + pub fn TCOD_gl_atlas_delete(atlas: *mut TCOD_TilesetAtlasOpenGL); } #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct TCOD_parser_listener_t { - pub new_struct: ::std::option::Option< - unsafe extern "C" fn( - str: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - ) -> bool, - >, - pub new_flag: - ::std::option::Option bool>, - pub new_property: ::std::option::Option< - unsafe extern "C" fn( - propname: *const ::std::os::raw::c_char, - type_: TCOD_value_type_t, - value: TCOD_value_t, - ) -> bool, - >, - pub end_struct: ::std::option::Option< - unsafe extern "C" fn( - str: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - ) -> bool, - >, - pub error: ::std::option::Option, +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGL1 { + pub common: TCOD_RendererGLCommon, + pub background_texture: u32, + pub background_width: ::std::os::raw::c_int, + pub background_height: ::std::os::raw::c_int, } #[test] -fn bindgen_test_layout_TCOD_parser_listener_t() { +fn bindgen_test_layout_TCOD_RendererGL1() { assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(TCOD_parser_listener_t)) + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(TCOD_RendererGL1)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TCOD_parser_listener_t)) + concat!("Alignment of ", stringify!(TCOD_RendererGL1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).new_struct as *const _ as usize - }, + unsafe { &(*(::std::ptr::null::())).common as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_listener_t), - "::", - stringify!(new_struct) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).new_flag as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(TCOD_parser_listener_t), + stringify!(TCOD_RendererGL1), "::", - stringify!(new_flag) + stringify!(common) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).new_property as *const _ as usize + &(*(::std::ptr::null::())).background_texture as *const _ as usize }, - 16usize, + 64usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_listener_t), + stringify!(TCOD_RendererGL1), "::", - stringify!(new_property) + stringify!(background_texture) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).end_struct as *const _ as usize + &(*(::std::ptr::null::())).background_width as *const _ as usize }, - 24usize, + 68usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_listener_t), + stringify!(TCOD_RendererGL1), "::", - stringify!(end_struct) + stringify!(background_width) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).error as *const _ as usize }, - 32usize, + unsafe { + &(*(::std::ptr::null::())).background_height as *const _ as usize + }, + 72usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_listener_t), + stringify!(TCOD_RendererGL1), "::", - stringify!(error) + stringify!(background_height) ) - ); -} -pub type TCOD_parser_custom_t = ::std::option::Option< - unsafe extern "C" fn( - lex: *mut TCOD_lex_t, - listener: *mut TCOD_parser_listener_t, - str: TCOD_parser_struct_t, - propname: *mut ::std::os::raw::c_char, - ) -> TCOD_value_t, ->; -pub type TCOD_parser_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_parser_new() -> TCOD_parser_t; -} -extern "C" { - pub fn TCOD_parser_new_struct( - parser: TCOD_parser_t, - name: *mut ::std::os::raw::c_char, - ) -> TCOD_parser_struct_t; -} -extern "C" { - pub fn TCOD_parser_new_custom_type( - parser: TCOD_parser_t, - custom_type_parser: TCOD_parser_custom_t, - ) -> TCOD_value_type_t; -} -extern "C" { - pub fn TCOD_parser_run( - parser: TCOD_parser_t, - filename: *const ::std::os::raw::c_char, - listener: *mut TCOD_parser_listener_t, - ); -} -extern "C" { - pub fn TCOD_parser_delete(parser: TCOD_parser_t); -} -extern "C" { - pub fn TCOD_parser_error(msg: *const ::std::os::raw::c_char, ...); -} -extern "C" { - pub fn TCOD_parser_has_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn TCOD_parser_get_bool_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn TCOD_parser_get_char_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_parser_get_int_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_parser_get_float_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> f32; + ); } -extern "C" { - pub fn TCOD_parser_get_string_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; +impl Default for TCOD_RendererGL1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn TCOD_parser_get_color_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> TCOD_color_t; + pub fn TCOD_renderer_init_gl1( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + vsync: bool, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; } -extern "C" { - pub fn TCOD_parser_get_dice_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> TCOD_dice_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGL2 { + pub common: TCOD_RendererGLCommon, + pub program: u32, + pub console_textures: [u32; 3usize], + pub console_width: ::std::os::raw::c_int, + pub console_height: ::std::os::raw::c_int, + pub vertex_buffer: u32, } -extern "C" { - pub fn TCOD_parser_get_dice_property_py( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - dice: *mut TCOD_dice_t, +#[test] +fn bindgen_test_layout_TCOD_RendererGL2() { + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(TCOD_RendererGL2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererGL2)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).common as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(common) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).program as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(program) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).console_textures as *const _ as usize + }, + 68usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_textures) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).console_width as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).console_height as *const _ as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vertex_buffer as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(vertex_buffer) + ) ); } -extern "C" { - pub fn TCOD_parser_get_custom_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_void; +impl Default for TCOD_RendererGL2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn TCOD_parser_get_list_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - type_: TCOD_value_type_t, - ) -> TCOD_list_t; + pub fn TCOD_renderer_new_gl2( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + vsync: bool, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct TCOD_struct_int_t { - pub name: *mut ::std::os::raw::c_char, - pub flags: TCOD_list_t, - pub props: TCOD_list_t, - pub lists: TCOD_list_t, - pub structs: TCOD_list_t, +pub struct SDL_Texture { + _unused: [u8; 0], +} +#[doc = "An SDL2 tileset atlas. This prepares a tileset for use with SDL2."] +#[doc = "\\rst"] +#[doc = ".. versionadded:: 1.16"] +#[doc = "\\endrst"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetAtlasSDL2 { + #[doc = " The renderer used to create this atlas."] + pub renderer: *mut SDL_Renderer, + #[doc = " The atlas texture."] + pub texture: *mut SDL_Texture, + #[doc = " The tileset used to create this atlas. Internal use only."] + pub tileset: *mut TCOD_Tileset, + #[doc = " Internal use only."] + pub observer: *mut TCOD_TilesetObserver, + #[doc = " Internal use only."] + pub texture_columns: ::std::os::raw::c_int, } #[test] -fn bindgen_test_layout_TCOD_struct_int_t() { +fn bindgen_test_layout_TCOD_TilesetAtlasSDL2() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 40usize, - concat!("Size of: ", stringify!(TCOD_struct_int_t)) + concat!("Size of: ", stringify!(TCOD_TilesetAtlasSDL2)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TCOD_struct_int_t)) + concat!("Alignment of ", stringify!(TCOD_TilesetAtlasSDL2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).renderer as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_struct_int_t), + stringify!(TCOD_TilesetAtlasSDL2), "::", - stringify!(name) + stringify!(renderer) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, 8usize, concat!( "Offset of field: ", - stringify!(TCOD_struct_int_t), + stringify!(TCOD_TilesetAtlasSDL2), "::", - stringify!(flags) + stringify!(texture) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, 16usize, concat!( "Offset of field: ", - stringify!(TCOD_struct_int_t), + stringify!(TCOD_TilesetAtlasSDL2), "::", - stringify!(props) + stringify!(tileset) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lists as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).observer as *const _ as usize }, 24usize, concat!( "Offset of field: ", - stringify!(TCOD_struct_int_t), + stringify!(TCOD_TilesetAtlasSDL2), "::", - stringify!(lists) + stringify!(observer) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::())).texture_columns as *const _ as usize + }, 32usize, concat!( "Offset of field: ", - stringify!(TCOD_struct_int_t), + stringify!(TCOD_TilesetAtlasSDL2), "::", - stringify!(structs) + stringify!(texture_columns) ) ); } -impl Default for TCOD_struct_int_t { +impl Default for TCOD_TilesetAtlasSDL2 { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } +#[doc = "The renderer data for an SDL2 rendering context."] +#[doc = "Internal use only."] #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct TCOD_parser_int_t { - pub structs: TCOD_list_t, - pub customs: [TCOD_parser_custom_t; 16usize], - pub fatal: bool, - pub props: TCOD_list_t, +pub struct TCOD_RendererSDL2 { + pub window: *mut SDL_Window, + pub renderer: *mut SDL_Renderer, + pub atlas: *mut TCOD_TilesetAtlasSDL2, + pub cache_console: *mut TCOD_Console, + pub cache_texture: *mut SDL_Texture, + pub sdl_subsystems: u32, + pub last_offset_x: f64, + pub last_offset_y: f64, + pub last_scale_x: f64, + pub last_scale_y: f64, } #[test] -fn bindgen_test_layout_TCOD_parser_int_t() { +fn bindgen_test_layout_TCOD_RendererSDL2() { assert_eq!( - ::std::mem::size_of::(), - 152usize, - concat!("Size of: ", stringify!(TCOD_parser_int_t)) + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(TCOD_RendererSDL2)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TCOD_parser_int_t)) + concat!("Alignment of ", stringify!(TCOD_RendererSDL2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_int_t), + stringify!(TCOD_RendererSDL2), "::", - stringify!(structs) + stringify!(window) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).customs as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).renderer as *const _ as usize }, 8usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_int_t), + stringify!(TCOD_RendererSDL2), "::", - stringify!(customs) + stringify!(renderer) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fatal as *const _ as usize }, - 136usize, + unsafe { &(*(::std::ptr::null::())).atlas as *const _ as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_int_t), + stringify!(TCOD_RendererSDL2), "::", - stringify!(fatal) + stringify!(atlas) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, - 144usize, + unsafe { &(*(::std::ptr::null::())).cache_console as *const _ as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_int_t), + stringify!(TCOD_RendererSDL2), "::", - stringify!(props) + stringify!(cache_console) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cache_texture as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(cache_texture) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).sdl_subsystems as *const _ as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(sdl_subsystems) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_offset_x as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_offset_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_offset_y as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_offset_y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_scale_x as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_scale_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_scale_y as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_scale_y) ) ); } -impl Default for TCOD_parser_int_t { +impl Default for TCOD_RendererSDL2 { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } extern "C" { - pub fn TCOD_parse_bool_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_char_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_integer_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_float_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_string_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_color_value() -> TCOD_value_t; + #[doc = "Return a libtcod rendering context using an SDL2 renderer."] + pub fn TCOD_renderer_init_sdl2( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + renderer_flags: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; } extern "C" { - pub fn TCOD_parse_dice_value() -> TCOD_value_t; + #[doc = "Return a new SDL2 atlas created from a tileset for an SDL2 renderer."] + #[doc = ""] + #[doc = "You may delete the tileset if you no longer have use for it."] + #[doc = ""] + #[doc = "Will return NULL on an error, you can check the error with"] + #[doc = "`TCOD_get_error`."] + pub fn TCOD_sdl2_atlas_new( + renderer: *mut SDL_Renderer, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_TilesetAtlasSDL2; } extern "C" { - pub fn TCOD_parse_value_list_value( - def: *mut TCOD_struct_int_t, - listnum: ::std::os::raw::c_int, - ) -> TCOD_value_t; + #[doc = "Delete an SDL2 tileset atlas."] + pub fn TCOD_sdl2_atlas_delete(atlas: *mut TCOD_TilesetAtlasSDL2); } extern "C" { - pub fn TCOD_parse_property_value( - parser: *mut TCOD_parser_int_t, - def: TCOD_parser_struct_t, - propname: *mut ::std::os::raw::c_char, - list: bool, - ) -> TCOD_value_t; + #[doc = "Render a console onto a managed target texture."] + #[doc = ""] + #[doc = "`atlas` is an SDL2 atlas created with `TCOD_sdl2_atlas_new`."] + #[doc = "The renderer used to make this `atlas` must support"] + #[doc = "`SDL_RENDERER_TARGETTEXTURE`, unless `target` is NULL."] + #[doc = ""] + #[doc = "`console` is a non-NULL pointer to the libtcod console you want to render."] + #[doc = ""] + #[doc = "`cache` can be NULL, or be pointer to a console pointer."] + #[doc = "If `*cache` is NULL then a console will be created."] + #[doc = "If `*cache` isn't NULL then the console pointed to might be deleted or"] + #[doc = "recreated, especially if it does not match the size of `console`."] + #[doc = ""] + #[doc = "`target` can be NULL, or be pointer to where you want the output texture"] + #[doc = "to be placed."] + #[doc = "The texture at `*target` may be deleted or recreated. When this function"] + #[doc = "is successful then the texture at `*target` will be non-NULL and will be"] + #[doc = "exactly fitted to the size of `console` and the tile size of `atlas`."] + #[doc = ""] + #[doc = "If `target` is NULL when the current render target is used instead, the"] + #[doc = "drawn area will not be scaled to fit the render target."] + #[doc = ""] + #[doc = "If SDL2 ever provides a `SDL_RENDER_TARGETS_RESET` event then the console"] + #[doc = "at `*cache` must be deleted and set to NULL, or else the next render will"] + #[doc = "only partially update the texture at `*target`."] + #[doc = ""] + #[doc = "Returns a negative value on an error, check `TCOD_get_error`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_sdl2_render_texture( + atlas: *const TCOD_TilesetAtlasSDL2, + console: *const TCOD_Console, + cache: *mut *mut TCOD_Console, + target: *mut *mut SDL_Texture, + ) -> TCOD_Error; } extern "C" { pub fn TCOD_sys_startup(); @@ -7692,7 +11255,7 @@ extern "C" { ); } extern "C" { - pub fn TCOD_sys_set_renderer(renderer: TCOD_renderer_t); + pub fn TCOD_sys_set_renderer(renderer: TCOD_renderer_t) -> ::std::os::raw::c_int; } extern "C" { pub fn TCOD_sys_get_renderer() -> TCOD_renderer_t; @@ -7713,6 +11276,15 @@ extern "C" { pub fn TCOD_sys_get_char_size(w: *mut ::std::os::raw::c_int, h: *mut ::std::os::raw::c_int); } extern "C" { + #[doc = " Upload a tile to the active tileset."] + #[doc = ""] + #[doc = " `asciiCode` is the Unicode codepoint for this tile."] + #[doc = ""] + #[doc = " `fontx` and `fonty` are the tile-coordinates on the active tilemap."] + #[doc = ""] + #[doc = " `img` is the tile to upload."] + #[doc = ""] + #[doc = " `x` and `y` are the upper-left pixel-coordinates of the tile on the `img`."] pub fn TCOD_sys_update_char( asciiCode: ::std::os::raw::c_int, fontx: ::std::os::raw::c_int, @@ -7723,10 +11295,10 @@ extern "C" { ); } extern "C" { - pub fn TCOD_sys_get_SDL_window() -> *mut ::std::os::raw::c_void; + pub fn TCOD_sys_get_SDL_window() -> *mut SDL_Window; } extern "C" { - pub fn TCOD_sys_get_SDL_renderer() -> *mut ::std::os::raw::c_void; + pub fn TCOD_sys_get_SDL_renderer() -> *mut SDL_Renderer; } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -7874,12 +11446,102 @@ extern "C" { extern "C" { pub fn TCOD_close_library(arg1: TCOD_library_t); } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Surface { + _unused: [u8; 0], +} pub type SDL_renderer_t = - ::std::option::Option; + ::std::option::Option; extern "C" { pub fn TCOD_sys_register_SDL_renderer(renderer: SDL_renderer_t); } -pub type TCOD_text_t = *mut ::std::os::raw::c_void; +extern "C" { + #[doc = "Load a BDF font from a file path."] + #[doc = ""] + #[doc = "For the best results, you should use a BDF font with a cell-based"] + #[doc = "monospace alignment."] + #[doc = ""] + #[doc = "May return NULL on failure. See `TCOD_get_error` for the error message."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_load_bdf(path: *const ::std::os::raw::c_char) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Load a BDF font from memory."] + #[doc = ""] + #[doc = "`size` is the byte length of `buffer`. `buffer` is the BDF data to load."] + #[doc = ""] + #[doc = "May return NULL on failure. See `TCOD_get_error` for the error message."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_load_bdf_memory( + size: ::std::os::raw::c_int, + buffer: *const ::std::os::raw::c_uchar, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Try to return a fall-back Tileset, may return NULL."] + #[doc = ""] + #[doc = " Used when one is needed, but was not provided by the user."] + pub fn TCOD_tileset_load_fallback_font_( + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Render a console to a SDL_Surface with a software renderer."] + #[doc = ""] + #[doc = "`tileset` is the tiles to render with, must not be NULL."] + #[doc = ""] + #[doc = "`console` is the console to render, must not be NULL."] + #[doc = ""] + #[doc = "`cache` is an optional pointer to a consoled used as a cache. The console"] + #[doc = "at `*cache` will be created or modified. The `cache` will be used to skip"] + #[doc = "drawing already drawn tiles on any subsequent calls."] + #[doc = ""] + #[doc = "`surface_out` is a pointer to where to put the surface will be managed."] + #[doc = "The surface at `*surface_out` will be created or modified and will change"] + #[doc = "to match the size of `console` and `tileset`. The pixel format will be"] + #[doc = "SDL_PIXELFORMAT_RGBA32."] + #[doc = ""] + #[doc = "Returns a negative value on error, see `TCOD_get_error`."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_tileset_render_to_surface( + tileset: *const TCOD_Tileset, + console: *const TCOD_Console, + cache: *mut *mut TCOD_Console, + surface_out: *mut *mut SDL_Surface, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Return a tileset from a TrueType font file."] + pub fn TCOD_load_truetype_font_( + path: *const ::std::os::raw::c_char, + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Set the global tileset from a TrueType font file."] + pub fn TCOD_tileset_load_truetype_( + path: *const ::std::os::raw::c_char, + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Text { + _unused: [u8; 0], +} +pub type TCOD_text_t = *mut TCOD_Text; extern "C" { pub fn TCOD_text_init( x: ::std::os::raw::c_int, @@ -7931,7 +11593,12 @@ extern "C" { extern "C" { pub fn TCOD_text_delete(txt: TCOD_text_t); } -pub type TCOD_zip_t = *mut ::std::os::raw::c_void; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Zip { + _unused: [u8; 0], +} +pub type TCOD_zip_t = *mut TCOD_Zip; extern "C" { pub fn TCOD_zip_new() -> TCOD_zip_t; } @@ -7957,7 +11624,14 @@ extern "C" { pub fn TCOD_zip_put_image(zip: TCOD_zip_t, val: TCOD_image_t); } extern "C" { - pub fn TCOD_zip_put_console(zip: TCOD_zip_t, val: TCOD_console_t); + pub fn TCOD_zip_put_console(zip: TCOD_zip_t, val: *const TCOD_Console); +} +extern "C" { + #[doc = "Write a TCOD_Random* object."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_zip_put_random(zip: TCOD_zip_t, val: *const TCOD_Random); } extern "C" { pub fn TCOD_zip_put_data( @@ -8002,6 +11676,13 @@ extern "C" { extern "C" { pub fn TCOD_zip_get_console(zip: TCOD_zip_t) -> TCOD_console_t; } +extern "C" { + #[doc = "Read a TCOD_Random* object."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_zip_get_random(zip: TCOD_zip_t) -> TCOD_random_t; +} extern "C" { pub fn TCOD_zip_get_data( zip: TCOD_zip_t, @@ -8016,6 +11697,32 @@ extern "C" { pub fn TCOD_zip_skip_bytes(zip: TCOD_zip_t, nbBytes: u32); } #[repr(C)] +#[derive(Copy, Clone)] +pub struct SDL_Event { + _unused: [u8; 0], +} +extern "C" { + #[doc = " Parse an SDL_Event into a key event and return the relevant TCOD_event_t."] + #[doc = ""] + #[doc = " Returns TCOD_EVENT_NONE if the event wasn't keyboard related."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_process_key_event(in_: *const SDL_Event, out: *mut TCOD_key_t) -> TCOD_event_t; +} +extern "C" { + #[doc = " Parse an SDL_Event into a mouse event and return the relevant TCOD_event_t."] + #[doc = ""] + #[doc = " Returns TCOD_EVENT_NONE if the event wasn't mouse related."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_process_mouse_event( + in_: *const SDL_Event, + out: *mut TCOD_mouse_t, + ) -> TCOD_event_t; +} +#[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct __crt_locale_data { pub _address: u8, diff --git a/terminal.png b/terminal.png index d1dabf4546cc38a814a6c4a9d22426180d329e02..3cffb5b3c3c815955a348103594d5127aad3263a 100644 GIT binary patch literal 3429 zcmV-r4VvPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXM_ z4J0GADXVw@01V|xL_t(|+U;G-jvU7k%pUZ?2O5I3LmR&62L#Z70qOt0z<>>Z!pxF{ z3B3RrvJ7#2SaR5`%8ZPRsvdGB_JLUT^rN~eD>L%FSa4h}mt|S3a$GK#>)+dZx96`v zH7DI$$N@y}#gB5&Z@;>kf#&+_f8F!_QJqY?ygf?S4P{nYDu{I2W0 z%iE)Qa`TXWLNU|0K4EYT))GmQSC&RoW{wlo#M*JHUdK zFe^iF0`a9%5G??PFDP@R2uTLZowvY?3Q#&tY$4@R42`b#mxKe+=@{UMg?FZqBQ_yF#<>$x|ZcIcqu7_-*B2K z1pbjI1mk*uwgX1=fK}LEj450o&*nT})>T6gsljdeen}2Tqhi+YfbG|=^?s z>G|nqIOf-qIeOU~GH^IVFcj!t*gQLtC%86!-~)-UHZx#Bp}TAj9doBVOY;t??^mTGM`cYh|hokDJm+3rwV$Z&$bfnicn^j$w8Ok<5bbQg+=c3?Ihs-Ez@vK0nr00xFT72S5P8%GmH|7> z!wO7nC1EHN={OHzHXq|h6HK<4<)%PjS(bwU`Ad30^b@#Ve(&~a>GKCEdW&Ki2;PLu z81Iy4bTlx6R2%B=Ek)Qd#4f9;!nR9qX(nV9Rz6}uj3L2ArGW3b{(zDTfmAX^=0UsV z;qR64s4+W0V58eHrOE*gKbhi*(=<)641hGR|2_2IiP>DwOd49o^02okVBMmjVn)X7 zdPH${f?wpFIXdzId?*yeSXI*>ktuT*hdRC@$#6+5jJMGx(x4-2v$)!d$Yd zA*b>jgzfWIOhJ$e!A@XDw&v(9LQ3Hyj>nJ24P-126W!;#cpM}mOhG|bj9ZB2b2TqU zRWo^}!Kz!kTN?VB0x&E~0J4~_2aGJ_8b!!N##knrVHVUQp|`69Xu^CyJs_G-qz9zT zy2sb0%|zN*v<1U@K&0qZJq^4+Ao{4)Xa^9cAOXn@?vkn(mz1&9Ei(8yhu*GIGC~Qq zBm5Jl%|7;~R|9+6-@}aDNcdUNe4h@x@oX*tbeEJpEj(=s9MqB(jE=mU#Xo%vZ7`9V zv=F3`susjQO<91_8n~`U;ZfBwha(|(0O=;f))kPTVO)eAfBoErv^b|j+X3%nn9L$d zBwt;~QXYWt-l{PXJY0yN9`cCE46ziyH=diH`U61r0MHLg^Ui$5d-(x(3PwsG@~Q@JDzM?`Yi!~ah480C2FIZ(qHIUywhKuMd-$!G;3X?Y zI;A_ldK~6r5*O*uN(Ep524)msJY=~Y>&p8L<_WJPJ2uae!mw99XaG|jQ@A#YeyG~Z zTwLdZh-o_@@{haG(Q@P#gGsjJDFom%g%*>Ge%V8j<) z&;xkoes4uVP|H8sOy<7gm$T#LVjb1E719DKsDyIDBG#yJiKLNonZ{>HMzsMk6BrRz zRZQ)UB&vguatuD|L;$;u9kY#!z{NT&h={Ok zH8K;vca6dqQqZ}FX)sb3HJeQ2pV@w3R3%+jwxe-IirX|8TCHx*3quY5_KSp-dCiDD z69tX?1FC^E6B|JY9IRPpQg}{hl`B6)Qb_J(nBSW+XDfPzM1E3IDb zup|RC6jVY-B_ujO&+Sp;`Y8)AjRozhp@3pURUs)vQ-4&tSXmE{Aw1bkSo`KF;xW<# zc>SPM^WVrGGJFIl6BW^<>XkfeDd-w3PZ@c>Tmim|F%HKGgU(JPeU(bBo5(t&<0_T= z>y(nllnjXI8hfBhCK0!Ufv{j!@A${xMf%JIIo~b-AMKRpG6*)TQZ87(TKfsulDCUu z`puTIqBB}B4GQ_gjEbbyAJt%J>60J59`FH^6(*Xa3!3l<$y8^P&!`~-Oof((j8GYo z4SZ2mYw`nJ;Wij6St_hgPG1zRLDuoVf!WIFCZ%htLzx3V2)}2rzNkrpfmg&RISkY%?YVzQ9sBGmd0WhVNsyoF@ zpE<4ftE`B*ddX^&0-O1%>@CS7`T-t~5&exzJ7AU`V0}YpCest|cV;Sq#y>aE5hR0H z&_lOMZPj&hU$I)fDH_=&27q+@OaYRCTbx>{6735dlFD`wnD}q3!!U2}WAuQsF&L}h z(?3tHw*y2JU+QNM@*2#eK41gGtbOVh<*0UHtagS2K4jZDDIwJZ-sK0Rf{O&dd}lnK z(yN{EQUYWGI9#4nMf!Y2;58K>X;o3C0Z?C^U6ZSBrYe3c8O|ga*sHwSeZ@-RXfnMP zj7-3Jk$P47=INcYUE>m;E!zCF8r^?VQ@*F*Iax7G42GV{I?d%dShq(*FVnkknHw7_%ROMy z0d-%+f8I%k*m1onuf4S?j5WdNL{+BjePy5EJufHHp}%^fBou@hv$E@AHK0)zjaSB z(p;2Nh1Z6uC(5jMNo(0i+h=BXb~)S6FYVQT?EbZ#%+3RmabzaDT$~TAw_C2xD#cu` zu_{_-t7J)hX8%3f_eXnvvh%&2U)lL*J6+bEC>T9pziKH={hwyyaCu)$2k9DsyusS> z-Cym+(av{vzO(aFJD=?Q{BrtUDOYp*S~bFg8CQ@lqPB^Cm^a72p4sUOyMI`Nqun3v zbX@*@Ui*M=w|Etq2@I;O?onz);1X#`v9x`LD8~Nz7dw4s_fPG7wDZwk9PP(DdwpE3 zYYvn8POF7WaK+nb!7!RC=>gH;HSjLN(0?p;eqyIT*o)8YyF2^e(d^EaFUm#xG`|>M zTmZ*$;`33bzVYDS32N})7rQt6cC}wVx62c=r;GjB>`(s(_qHv{@c3h@00000NkvXX Hu0mjfxK3;J literal 4903 zcmV+?6WHvDP)QIH^g%M!w*6Tfxr?}wmMtUQRfwTt9sg=DXBGGH!~w5<2>Sy zLH18S`On|{7Q17`_}|+PidWayzPe|htAC;xd)*cTHuM}UhRdPW*INDb?`sX6ug}yv z>J!Q_?vDa43AVxAdpp2=eK!J;fW=tPQJkc{-c$zSDfkKS^4DtSnT6D+ z0@TJ;rK3wTC0+q(pM4=Nlme?xk8QiWgK8Thf;Iu0Mkn)ITZ*_;fUnD#)Jqej_QpgV^SaO>8a{=z-{}J zcL3Bp#dJrA-hfTU4mxuKoOB^71mzu=6BASyvf5|h>zNa&OddUf3)7Z84gs9f$lV(+G?>5gAUR{6{ zv0Q+;jdPHb#y#VV8Xk4Dh2RftGO6aPC)IA zNyY`ra}|8$L^U?5H+cuJ1gKymhE|YR(^T`=ngciisFDnkqt^aX-bqrzAO#{&n3#G$ zQGZhc^nEDjUv8UJ%^%J<2SC7gP?UnZOZ28YfZaNZS4n^f*2%8EyLyxRCHBt<(1An* zSbG-e>$Ab%f4cf!nNovxX72#X0Tg>(0gS0VZ?AE$S4G!YEUzOJaw_Kl?*7UF5~Zq| zH~9U}N;+AeQ$trkB|=?WK&&73L5)R)p?#fvHHTC9+N;PrB}96UO27(6Cxd9&`%)KW z$82q^%I~>ljvB0QRBNlL_2U|YtSlwK&V$IeNLQb)@2nP-uRe1%BDJFPtdGnI6hO=& z5|9(;dX3|fBrN?c>|p>uvvy_wkI0*h5Su3@z*1UQepi*VaONDfhPnsU#@6jc&4$D| zYCR}ikAdvFlfu=lhM@>deLm*e%Q|qpw3205(#R z@nd^|3hO{t@b`WOfNIc=s|a*LqE6yo+y1`x_1vzBO3}8tWxV!0`@4(51X{)5TuJ6g z9RLC2im&UNLrQ3; z63k*dAm}^G#d4&zO>%F7Iq|W56XDsth>iW(2CzOyN=C^#_=pUs$*F?b$WSV;bvjaC zB>=PjiNIWq3gp-U+{Q|R6nr#a69pphwi^0-#CrZxX6^dU&es@-1PLfkFg-_&+0UxI zY`k0{10{+Be;-_poq%uc=R4VefKSNwY3)HQRW_+?5nU{C54ESRF%@5FmJ>iRUf8@=L<$b8-JMVF z%*eX&yUTHv0LgjP@D1<=zh834SEENc#ERS3k&8@Jo&fP^2T1Ef`{daKz(m!QVQ-zN zc@hPtL~ssqqAGS@6wCEya#vRCekWNA7XgTmVJ_bQ+tH zgDIc&@`PkR&V(IsO?T^InrIu$g;{vNjM;5E@;Z%15LhlEQaS|KZ zIJ+})ixfZl4p56mzjyn+V$-YG9q;AsmfeQcs8Y?^aU*$@P5nOVI}*m^9YEFQNX15l z!|ydGV@_`<3YM_CHXrRrOgJV=FC93UZ>8VwT%L~&5< zmAtOErvN6zQ6jj*kJ+Om0J=c8Z)fGTm<{MlI0761J4_`C0*E<{i|^Lm-4h^{10?6s z-C)dayAuYbMY4uwI!n}?U5TX4yR-UozyZR+mF4V17Eu7 zY6P%3m7wg-su`Hf+@uD##{rYBZ)K|er)%yGYTaQF|1~hR}%05Q&)+GL=gJN-#%G2Q=$z1-{o)?~yvt`@b!u7p00s%AXJ@bs%*Kcfnob+V^t%arL?N6NgF&i^Or2 z09%MQKVmPMe?8!|z#sd02cAU$Cy@7wu7JB$w*Ew)szRh7B!^OUu!xgKpg`sMkfIp6K?kHT9_Tz^Dci1KC;Oqf8B%jBfwQIgo7i6 z1K6!!`agwM1x&&3D({z{0>ISeW?*cSfK7@3F0XSBw|=GW57vJrP`CH4$Qrv7B)uSO zq^mn2kRnZbzSmKS>}qswh(=-WN9quF`%vNR(&!=;>`nwW!#fGOf|$MUc;nZ_IXAE1->HzTW5`R?*guI6A&5km;?4cD}lKY>FyCbNG(EL z=*QaE?m#Mtqgyx?qM(l5`wX+`laX(&{OlaZSc z_;rseqOZB8p`-}>wQoPK_TNEQ`5i!xK$G(mAQ-`?`BI_ueJ2=2|C;razzlpg1`q*O zj7pg82K`yDZ|CkL+VN8IDU*7gIFd+mF-D{3lfAtOr~#<)E(cRnza%55B9H<@S-o%QxsYd8Xu&3IHyS6~OA=fC0r2}q7WOns@NF_2RSU}|?bIRa6lu)-z|pxyx-z;3-0 zD0v6yF>4GK4-q4AC|CcEq12zK_)`eb+1H!mScaPG=BsOvOyQ8W{on^|N zfPb1>=0KpMrY42{9``s=eCs=3A=Z2CKi_`)_4f1Mx1aU<}RRK-49acrNu zgmVZsn^Rz1eCI$tzq9JpfRjKO%>7wR9{f;y58u zm=gk20Co}U8M+vHUiUeYutHDCha3c1B2%7gdL;mI0u(oiiCo8>ONsQM$LR=gDpcy+ z2|E}GF;ZqLf*=B4iTeoGs3b(L($`aAIHBCd`T6!FeFY z)MQw6AV&hFD5Ie^`|%H!Ne*0_NF=k4c@W!L(BJ?kVu_PH&sDr?W& zv^mJms{KDIcGAR?nv*jQV7Jb4uyK^s^t$ICZ#(~R`}3E#pY?lP>j0_u00w@lPNcY< z-^E5bkaP5=DFr>-0i5f_K%Q>=>)XKv{w`+yzCLS>HE@%Ft)DiI5hZaIMu6%j41Bi7 z-6J8`ihZhZhpVg4oqq*+eHa0H05=8_pt_?}P!NbHCbK^DeC12s!!^`78Cz!rNCi|$ zgw80E%eBb}aNsMePLFbq(d3#-7G->Ojp;-yxKOD`A|{-TH(Gcf@2DT+gd*B62up zP6}f{PYBS#ci_7EkUOboNj`TUMK0IxRA|&*QGiD{Kx&~=^&%CaT(0Q}`PLp}^XRMs zs_vhN%DD*}L6S6#&Ao|^1PSwY1AA;#!^-E>iPpDkJ*s}BXapdd*+|I_q`s~|ceO?D zASnT&U}6&kCbEq0d!m<$XMTi9=G15zt< zDMrGn13aun&nCet6pay=Hz5yl5!4tqrWA0gwO2qK>y0DOGE&lm#;{KPu9BG!5J zVV7rfSmjpzI008#eCiO62+95XNO_Mry|62$uPg9-b69NW1W5zb9_1paKZsb0948LY z$HcVnX^r$hqLhN83UlC3awrlc1aJ*Z0qk)Qc@nZYcXIWj-nl+dqW3wN+Ve?~tbx5D zC^jR3yLdu0H$#;>RkikBvhR!l>G_m+C?32^q5zdtS=K}m&NUDTo<#uHWHcUjA0`&g zM#KpjCV5|pkTBFKUD>m86LmqAQzP;9Ql=xZ%bTv>^|mHvY+EGQpZfb%7ALl* zUZT?TYoDrH5u}q$k#piw)83^uj^cLKjSfFxa{{2M(VgGx3HU5lwQ>Z0Uw3;>+m;u%4yw7tRe-4e-C2Qwyr#SHN6Sw9WurdwZUJc|@8@h}|f*U)AZr za{##WOkC669VxpcIVJ!C|C9t(<;>b@zNASG02d=YuK-A5u=5C*`pk_0cfWof*1;~o z*n3hS0w38ud&VxBG(T|wr4Xr}X49ICdkXjQ$Lf-~{~c4$OKJ zFgigik!x)z76Z%y+(A^Z5;ISA`X+Sh3fcl&E1)QrmsE(TBlepZue4Og!7&Fq~O Z{eKVIk9wwIZZH4<002ovPDHLkV1hh%F~9%- From fc50ae8e1154638713aa7caa6fee689ab7513ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sun, 28 Jun 2020 08:13:31 +0200 Subject: [PATCH 14/27] Update bindings for x86_64 Linux --- tcod_sys/x86_64-unknown-linux-gnu_bindings.rs | 12631 ++++++++-------- 1 file changed, 6152 insertions(+), 6479 deletions(-) diff --git a/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs b/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs index 68401dd85..6ab22b037 100644 --- a/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs +++ b/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs @@ -2,6 +2,36 @@ pub type TCOD_font_flags_t_type = u32; +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub const fn new() -> Self { + __IncompleteArrayField(::std::marker::PhantomData, []) + } + #[inline] + pub fn as_ptr(&self) -> *const T { + self as *const _ as *const T + } + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut T { + self as *mut _ as *mut T + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::std::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::std::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} pub const __llvm__: u32 = 1; pub const __clang__: u32 = 1; pub const __clang_major__: u32 = 10; @@ -355,102 +385,7 @@ pub const _BITS_TYPES___LOCALE_T_H: u32 = 1; pub const WCHAR_MIN: i32 = -2147483648; pub const WCHAR_MAX: u32 = 2147483647; pub const WEOF: u32 = 4294967295; -pub const _LIBC_LIMITS_H_: u32 = 1; -pub const MB_LEN_MAX: u32 = 16; -pub const LLONG_MAX: u64 = 9223372036854775807; -pub const ULLONG_MAX: i32 = -1; -pub const _BITS_POSIX1_LIM_H: u32 = 1; -pub const _POSIX_AIO_LISTIO_MAX: u32 = 2; -pub const _POSIX_AIO_MAX: u32 = 1; -pub const _POSIX_ARG_MAX: u32 = 4096; -pub const _POSIX_CHILD_MAX: u32 = 25; -pub const _POSIX_DELAYTIMER_MAX: u32 = 32; -pub const _POSIX_HOST_NAME_MAX: u32 = 255; -pub const _POSIX_LINK_MAX: u32 = 8; -pub const _POSIX_LOGIN_NAME_MAX: u32 = 9; -pub const _POSIX_MAX_CANON: u32 = 255; -pub const _POSIX_MAX_INPUT: u32 = 255; -pub const _POSIX_MQ_OPEN_MAX: u32 = 8; -pub const _POSIX_MQ_PRIO_MAX: u32 = 32; -pub const _POSIX_NAME_MAX: u32 = 14; -pub const _POSIX_NGROUPS_MAX: u32 = 8; -pub const _POSIX_OPEN_MAX: u32 = 20; -pub const _POSIX_PATH_MAX: u32 = 256; -pub const _POSIX_PIPE_BUF: u32 = 512; -pub const _POSIX_RE_DUP_MAX: u32 = 255; -pub const _POSIX_RTSIG_MAX: u32 = 8; -pub const _POSIX_SEM_NSEMS_MAX: u32 = 256; -pub const _POSIX_SEM_VALUE_MAX: u32 = 32767; -pub const _POSIX_SIGQUEUE_MAX: u32 = 32; -pub const _POSIX_SSIZE_MAX: u32 = 32767; -pub const _POSIX_STREAM_MAX: u32 = 8; -pub const _POSIX_SYMLINK_MAX: u32 = 255; -pub const _POSIX_SYMLOOP_MAX: u32 = 8; -pub const _POSIX_TIMER_MAX: u32 = 32; -pub const _POSIX_TTY_NAME_MAX: u32 = 9; -pub const _POSIX_TZNAME_MAX: u32 = 6; -pub const _POSIX_CLOCKRES_MIN: u32 = 20000000; -pub const NR_OPEN: u32 = 1024; -pub const NGROUPS_MAX: u32 = 65536; -pub const ARG_MAX: u32 = 131072; -pub const LINK_MAX: u32 = 127; -pub const MAX_CANON: u32 = 255; -pub const MAX_INPUT: u32 = 255; -pub const NAME_MAX: u32 = 255; -pub const PATH_MAX: u32 = 4096; -pub const PIPE_BUF: u32 = 4096; -pub const XATTR_NAME_MAX: u32 = 255; -pub const XATTR_SIZE_MAX: u32 = 65536; -pub const XATTR_LIST_MAX: u32 = 65536; -pub const RTSIG_MAX: u32 = 32; -pub const _POSIX_THREAD_KEYS_MAX: u32 = 128; -pub const PTHREAD_KEYS_MAX: u32 = 1024; -pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: u32 = 4; -pub const PTHREAD_DESTRUCTOR_ITERATIONS: u32 = 4; -pub const _POSIX_THREAD_THREADS_MAX: u32 = 64; -pub const AIO_PRIO_DELTA_MAX: u32 = 20; -pub const PTHREAD_STACK_MIN: u32 = 16384; -pub const DELAYTIMER_MAX: u32 = 2147483647; -pub const TTY_NAME_MAX: u32 = 32; -pub const LOGIN_NAME_MAX: u32 = 256; -pub const HOST_NAME_MAX: u32 = 64; -pub const MQ_PRIO_MAX: u32 = 32768; -pub const SEM_VALUE_MAX: u32 = 2147483647; -pub const _BITS_POSIX2_LIM_H: u32 = 1; -pub const _POSIX2_BC_BASE_MAX: u32 = 99; -pub const _POSIX2_BC_DIM_MAX: u32 = 2048; -pub const _POSIX2_BC_SCALE_MAX: u32 = 99; -pub const _POSIX2_BC_STRING_MAX: u32 = 1000; -pub const _POSIX2_COLL_WEIGHTS_MAX: u32 = 2; -pub const _POSIX2_EXPR_NEST_MAX: u32 = 32; -pub const _POSIX2_LINE_MAX: u32 = 2048; -pub const _POSIX2_RE_DUP_MAX: u32 = 255; -pub const _POSIX2_CHARCLASS_NAME_MAX: u32 = 14; -pub const BC_BASE_MAX: u32 = 99; -pub const BC_DIM_MAX: u32 = 2048; -pub const BC_SCALE_MAX: u32 = 99; -pub const BC_STRING_MAX: u32 = 1000; -pub const COLL_WEIGHTS_MAX: u32 = 255; -pub const EXPR_NEST_MAX: u32 = 32; -pub const LINE_MAX: u32 = 2048; -pub const CHARCLASS_NAME_MAX: u32 = 2048; -pub const RE_DUP_MAX: u32 = 32767; -pub const SCHAR_MAX: u32 = 127; -pub const SHRT_MAX: u32 = 32767; -pub const INT_MAX: u32 = 2147483647; -pub const LONG_MAX: u64 = 9223372036854775807; -pub const SCHAR_MIN: i32 = -128; -pub const SHRT_MIN: i32 = -32768; -pub const INT_MIN: i32 = -2147483648; -pub const LONG_MIN: i64 = -9223372036854775808; -pub const UCHAR_MAX: u32 = 255; -pub const USHRT_MAX: u32 = 65535; -pub const UINT_MAX: u32 = 4294967295; -pub const ULONG_MAX: i32 = -1; -pub const CHAR_BIT: u32 = 8; -pub const CHAR_MIN: i32 = -128; -pub const CHAR_MAX: u32 = 127; -pub const LLONG_MIN: i64 = -9223372036854775808; +pub const _STDINT_H: u32 = 1; pub const _BITS_TYPES_H: u32 = 1; pub const __TIMESIZE: u32 = 64; pub const _BITS_TYPESIZES_H: u32 = 1; @@ -460,110 +395,6 @@ pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; pub const __STATFS_MATCHES_STATFS64: u32 = 1; pub const __FD_SETSIZE: u32 = 1024; pub const _BITS_TIME64_H: u32 = 1; -pub const _BITS_SIGNUM_H: u32 = 1; -pub const _BITS_SIGNUM_GENERIC_H: u32 = 1; -pub const SIGINT: u32 = 2; -pub const SIGILL: u32 = 4; -pub const SIGABRT: u32 = 6; -pub const SIGFPE: u32 = 8; -pub const SIGSEGV: u32 = 11; -pub const SIGTERM: u32 = 15; -pub const SIGHUP: u32 = 1; -pub const SIGQUIT: u32 = 3; -pub const SIGTRAP: u32 = 5; -pub const SIGKILL: u32 = 9; -pub const SIGBUS: u32 = 10; -pub const SIGSYS: u32 = 12; -pub const SIGPIPE: u32 = 13; -pub const SIGALRM: u32 = 14; -pub const SIGURG: u32 = 16; -pub const SIGSTOP: u32 = 17; -pub const SIGTSTP: u32 = 18; -pub const SIGCONT: u32 = 19; -pub const SIGCHLD: u32 = 20; -pub const SIGTTIN: u32 = 21; -pub const SIGTTOU: u32 = 22; -pub const SIGPOLL: u32 = 23; -pub const SIGXCPU: u32 = 24; -pub const SIGXFSZ: u32 = 25; -pub const SIGVTALRM: u32 = 26; -pub const SIGPROF: u32 = 27; -pub const SIGUSR1: u32 = 30; -pub const SIGUSR2: u32 = 31; -pub const SIGWINCH: u32 = 28; -pub const SIGIO: u32 = 23; -pub const SIGIOT: u32 = 6; -pub const SIGCLD: u32 = 20; -pub const __SIGRTMIN: u32 = 32; -pub const __SIGRTMAX: u32 = 32; -pub const _NSIG: u32 = 33; -pub const SIGSTKFLT: u32 = 16; -pub const SIGPWR: u32 = 30; -pub const __sig_atomic_t_defined: u32 = 1; -pub const __sigset_t_defined: u32 = 1; -pub const _STRUCT_TIMESPEC: u32 = 1; -pub const _BITS_ENDIAN_H: u32 = 1; -pub const __LITTLE_ENDIAN: u32 = 1234; -pub const __BIG_ENDIAN: u32 = 4321; -pub const __PDP_ENDIAN: u32 = 3412; -pub const _BITS_ENDIANNESS_H: u32 = 1; -pub const __BYTE_ORDER: u32 = 1234; -pub const __FLOAT_WORD_ORDER: u32 = 1234; -pub const __siginfo_t_defined: u32 = 1; -pub const __SI_MAX_SIZE: u32 = 128; -pub const _BITS_SIGINFO_ARCH_H: u32 = 1; -pub const __SI_ERRNO_THEN_CODE: u32 = 1; -pub const __SI_HAVE_SIGSYS: u32 = 1; -pub const _BITS_SIGINFO_CONSTS_H: u32 = 1; -pub const __SI_ASYNCIO_AFTER_SIGIO: u32 = 1; -pub const __sigevent_t_defined: u32 = 1; -pub const __SIGEV_MAX_SIZE: u32 = 64; -pub const __have_pthread_attr_t: u32 = 1; -pub const _BITS_SIGEVENT_CONSTS_H: u32 = 1; -pub const NSIG: u32 = 33; -pub const _BITS_SIGACTION_H: u32 = 1; -pub const SA_NOCLDSTOP: u32 = 1; -pub const SA_NOCLDWAIT: u32 = 2; -pub const SA_SIGINFO: u32 = 4; -pub const SA_ONSTACK: u32 = 134217728; -pub const SA_RESTART: u32 = 268435456; -pub const SA_NODEFER: u32 = 1073741824; -pub const SA_RESETHAND: u32 = 2147483648; -pub const SA_INTERRUPT: u32 = 536870912; -pub const SA_NOMASK: u32 = 1073741824; -pub const SA_ONESHOT: u32 = 2147483648; -pub const SA_STACK: u32 = 134217728; -pub const SIG_BLOCK: u32 = 0; -pub const SIG_UNBLOCK: u32 = 1; -pub const SIG_SETMASK: u32 = 2; -pub const _BITS_SIGCONTEXT_H: u32 = 1; -pub const FP_XSTATE_MAGIC1: u32 = 1179670611; -pub const FP_XSTATE_MAGIC2: u32 = 1179670597; -pub const __stack_t_defined: u32 = 1; -pub const _SYS_UCONTEXT_H: u32 = 1; -pub const __NGREG: u32 = 23; -pub const NGREG: u32 = 23; -pub const _BITS_SIGSTACK_H: u32 = 1; -pub const MINSIGSTKSZ: u32 = 2048; -pub const SIGSTKSZ: u32 = 8192; -pub const _BITS_SS_FLAGS_H: u32 = 1; -pub const __sigstack_defined: u32 = 1; -pub const _BITS_PTHREADTYPES_COMMON_H: u32 = 1; -pub const _THREAD_SHARED_TYPES_H: u32 = 1; -pub const _BITS_PTHREADTYPES_ARCH_H: u32 = 1; -pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40; -pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56; -pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56; -pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32; -pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4; -pub const __SIZEOF_PTHREAD_COND_T: u32 = 48; -pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4; -pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8; -pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4; -pub const _THREAD_MUTEX_INTERNAL_H: u32 = 1; -pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1; -pub const _BITS_SIGTHREAD_H: u32 = 1; -pub const _STDINT_H: u32 = 1; pub const _BITS_STDINT_INTN_H: u32 = 1; pub const _BITS_STDINT_UINTN_H: u32 = 1; pub const INT8_MIN: i32 = -128; @@ -603,37 +434,16 @@ pub const SIG_ATOMIC_MAX: u32 = 2147483647; pub const SIZE_MAX: i32 = -1; pub const WINT_MIN: u32 = 0; pub const WINT_MAX: u32 = 4294967295; -pub const PRINTF_INT64_MODIFIER: &'static [u8; 2usize] = b"l\0"; -pub const PRINTF_INT32_MODIFIER: &'static [u8; 1usize] = b"\0"; -pub const PRINTF_INT16_MODIFIER: &'static [u8; 2usize] = b"h\0"; -pub const PRINTF_INTMAX_MODIFIER: &'static [u8; 2usize] = b"l\0"; -pub const PRINTF_INT64_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; -pub const PRINTF_UINT64_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; -pub const PRINTF_INT32_HEX_WIDTH: &'static [u8; 2usize] = b"8\0"; -pub const PRINTF_UINT32_HEX_WIDTH: &'static [u8; 2usize] = b"8\0"; -pub const PRINTF_INT16_HEX_WIDTH: &'static [u8; 2usize] = b"4\0"; -pub const PRINTF_UINT16_HEX_WIDTH: &'static [u8; 2usize] = b"4\0"; -pub const PRINTF_INT8_HEX_WIDTH: &'static [u8; 2usize] = b"2\0"; -pub const PRINTF_UINT8_HEX_WIDTH: &'static [u8; 2usize] = b"2\0"; -pub const PRINTF_INT64_DEC_WIDTH: &'static [u8; 3usize] = b"19\0"; -pub const PRINTF_UINT64_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; -pub const PRINTF_INT32_DEC_WIDTH: &'static [u8; 3usize] = b"10\0"; -pub const PRINTF_UINT32_DEC_WIDTH: &'static [u8; 3usize] = b"10\0"; -pub const PRINTF_INT16_DEC_WIDTH: &'static [u8; 2usize] = b"5\0"; -pub const PRINTF_UINT16_DEC_WIDTH: &'static [u8; 2usize] = b"5\0"; -pub const PRINTF_INT8_DEC_WIDTH: &'static [u8; 2usize] = b"3\0"; -pub const PRINTF_UINT8_DEC_WIDTH: &'static [u8; 2usize] = b"3\0"; -pub const PRINTF_INTMAX_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; -pub const PRINTF_UINTMAX_HEX_WIDTH: &'static [u8; 3usize] = b"16\0"; -pub const PRINTF_INTMAX_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; -pub const PRINTF_UINTMAX_DEC_WIDTH: &'static [u8; 3usize] = b"20\0"; pub const true_: u32 = 1; pub const false_: u32 = 0; pub const __bool_true_false_are_defined: u32 = 1; -pub const TCOD_HEXVERSION: u32 = 67328; -pub const TCOD_STRVERSION: &'static [u8; 6usize] = b"1.7.0\0"; -pub const TCOD_TECHVERSION: u32 = 17235968; -pub const TCOD_STRVERSIONNAME: &'static [u8; 14usize] = b"libtcod 1.7.0\0"; +pub const TCOD_MAJOR_VERSION: u32 = 1; +pub const TCOD_MINOR_VERSION: u32 = 16; +pub const TCOD_PATCHLEVEL: u32 = 0; +pub const TCOD_STRVERSION: &'static [u8; 16usize] = b"1.16.0-alpha.12\0"; +pub const TCOD_HEXVERSION: u32 = 69632; +pub const TCOD_TECHVERSION: u32 = 17825792; +pub const TCOD_STRVERSIONNAME: &'static [u8; 24usize] = b"libtcod 1.16.0-alpha.12\0"; pub const TCOD_KEY_TEXT_SIZE: u32 = 32; pub const TCOD_NOISE_MAX_OCTAVES: u32 = 128; pub const TCOD_NOISE_MAX_DIMENSIONS: u32 = 4; @@ -657,6 +467,9 @@ pub const TCOD_LEX_MAX_SYMBOLS: u32 = 100; pub const TCOD_LEX_SYMBOL_SIZE: u32 = 5; pub const TCOD_LEX_MAX_KEYWORDS: u32 = 100; pub const TCOD_LEX_KEYWORD_SIZE: u32 = 20; +pub const TCOD_HEAP_DEFAULT_CAPACITY: u32 = 256; +pub const TCOD_HEAP_MAX_NODE_SIZE: u32 = 256; +pub const TCOD_PATHFINDER_MAX_DIMENSIONS: u32 = 4; pub type _Float32 = f32; pub type _Float64 = f64; pub type _Float32x = f64; @@ -1231,51 +1044,6 @@ extern "C" { __tp: *const tm, ) -> size_t; } -#[repr(C)] -#[repr(align(16))] -#[derive(Debug, Default, Copy, Clone)] -pub struct max_align_t { - pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, - pub __bindgen_padding_0: u64, - pub __clang_max_align_nonce2: u128, -} -#[test] -fn bindgen_test_layout_max_align_t() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(max_align_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - concat!("Alignment of ", stringify!(max_align_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce1 as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(max_align_t), - "::", - stringify!(__clang_max_align_nonce1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce2 as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(max_align_t), - "::", - stringify!(__clang_max_align_nonce2) - ) - ); -} pub type __u_char = ::std::os::raw::c_uchar; pub type __u_short = ::std::os::raw::c_ushort; pub type __u_int = ::std::os::raw::c_uint; @@ -1365,8123 +1133,7884 @@ pub type __caddr_t = *mut ::std::os::raw::c_char; pub type __intptr_t = ::std::os::raw::c_long; pub type __socklen_t = ::std::os::raw::c_uint; pub type __sig_atomic_t = ::std::os::raw::c_int; -pub type sig_atomic_t = __sig_atomic_t; +pub type int_least8_t = __int_least8_t; +pub type int_least16_t = __int_least16_t; +pub type int_least32_t = __int_least32_t; +pub type int_least64_t = __int_least64_t; +pub type uint_least8_t = __uint_least8_t; +pub type uint_least16_t = __uint_least16_t; +pub type uint_least32_t = __uint_least32_t; +pub type uint_least64_t = __uint_least64_t; +pub type int_fast8_t = ::std::os::raw::c_schar; +pub type int_fast16_t = ::std::os::raw::c_long; +pub type int_fast32_t = ::std::os::raw::c_long; +pub type int_fast64_t = ::std::os::raw::c_long; +pub type uint_fast8_t = ::std::os::raw::c_uchar; +pub type uint_fast16_t = ::std::os::raw::c_ulong; +pub type uint_fast32_t = ::std::os::raw::c_ulong; +pub type uint_fast64_t = ::std::os::raw::c_ulong; +pub type intmax_t = __intmax_t; +pub type uintmax_t = __uintmax_t; +extern "C" { + pub fn TCOD_strdup(s: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_strcasecmp( + s1: *const ::std::os::raw::c_char, + s2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_strncasecmp( + s1: *const ::std::os::raw::c_char, + s2: *const ::std::os::raw::c_char, + n: size_t, + ) -> ::std::os::raw::c_int; +} +#[doc = " \\brief A callback to be passed to TCOD_line"] +#[doc = ""] +#[doc = " The points given to the callback include both the starting and ending"] +#[doc = " positions."] +#[doc = ""] +#[doc = " \\param x"] +#[doc = " \\param y"] +#[doc = " \\return As long as this callback returns true it will be called with the"] +#[doc = " next x,y point on the line."] +pub type TCOD_line_listener_t = ::std::option::Option< + unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> bool, +>; +extern "C" { + pub fn TCOD_line_init( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_line_step( + xCur: *mut ::std::os::raw::c_int, + yCur: *mut ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_line( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + listener: TCOD_line_listener_t, + ) -> bool; +} +#[doc = " \\brief A struct used for computing a bresenham line."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct __sigset_t { - pub __val: [::std::os::raw::c_ulong; 16usize], +pub struct TCOD_bresenham_data_t { + pub stepx: ::std::os::raw::c_int, + pub stepy: ::std::os::raw::c_int, + pub e: ::std::os::raw::c_int, + pub deltax: ::std::os::raw::c_int, + pub deltay: ::std::os::raw::c_int, + pub origx: ::std::os::raw::c_int, + pub origy: ::std::os::raw::c_int, + pub destx: ::std::os::raw::c_int, + pub desty: ::std::os::raw::c_int, } #[test] -fn bindgen_test_layout___sigset_t() { +fn bindgen_test_layout_TCOD_bresenham_data_t() { assert_eq!( - ::std::mem::size_of::<__sigset_t>(), - 128usize, - concat!("Size of: ", stringify!(__sigset_t)) + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(TCOD_bresenham_data_t)) ); assert_eq!( - ::std::mem::align_of::<__sigset_t>(), - 8usize, - concat!("Alignment of ", stringify!(__sigset_t)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_bresenham_data_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<__sigset_t>())).__val as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).stepx as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(__sigset_t), + stringify!(TCOD_bresenham_data_t), "::", - stringify!(__val) + stringify!(stepx) ) ); -} -pub type sigset_t = __sigset_t; -pub type pid_t = __pid_t; -pub type uid_t = __uid_t; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct timespec { - pub tv_sec: __time_t, - pub tv_nsec: __syscall_slong_t, -} -#[test] -fn bindgen_test_layout_timespec() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(timespec)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(timespec)) - ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).stepy as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(timespec), + stringify!(TCOD_bresenham_data_t), "::", - stringify!(tv_sec) + stringify!(stepy) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_nsec as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).e as *const _ as usize }, 8usize, concat!( "Offset of field: ", - stringify!(timespec), + stringify!(TCOD_bresenham_data_t), "::", - stringify!(tv_nsec) + stringify!(e) ) ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union sigval { - pub sival_int: ::std::os::raw::c_int, - pub sival_ptr: *mut ::std::os::raw::c_void, - _bindgen_union_align: u64, -} -#[test] -fn bindgen_test_layout_sigval() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(sigval)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigval)) - ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sival_int as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).deltax as *const _ as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(sigval), + stringify!(TCOD_bresenham_data_t), "::", - stringify!(sival_int) + stringify!(deltax) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sival_ptr as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).deltay as *const _ as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(sigval), + stringify!(TCOD_bresenham_data_t), "::", - stringify!(sival_ptr) + stringify!(deltay) ) ); -} -impl Default for sigval { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type __sigval_t = sigval; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct siginfo_t { - pub si_signo: ::std::os::raw::c_int, - pub si_errno: ::std::os::raw::c_int, - pub si_code: ::std::os::raw::c_int, - pub __pad0: ::std::os::raw::c_int, - pub _sifields: siginfo_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union siginfo_t__bindgen_ty_1 { - pub _pad: [::std::os::raw::c_int; 28usize], - pub _kill: siginfo_t__bindgen_ty_1__bindgen_ty_1, - pub _timer: siginfo_t__bindgen_ty_1__bindgen_ty_2, - pub _rt: siginfo_t__bindgen_ty_1__bindgen_ty_3, - pub _sigchld: siginfo_t__bindgen_ty_1__bindgen_ty_4, - pub _sigfault: siginfo_t__bindgen_ty_1__bindgen_ty_5, - pub _sigpoll: siginfo_t__bindgen_ty_1__bindgen_ty_6, - pub _sigsys: siginfo_t__bindgen_ty_1__bindgen_ty_7, - _bindgen_union_align: [u64; 14usize], -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_1 { - pub si_pid: __pid_t, - pub si_uid: __uid_t, -} -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), - 8usize, + unsafe { &(*(::std::ptr::null::())).origx as *const _ as usize }, + 20usize, concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_1) + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(origx) ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, + unsafe { &(*(::std::ptr::null::())).origy as *const _ as usize }, + 24usize, concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_1) + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(origy) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_pid as *const _ - as usize - }, - 0usize, + unsafe { &(*(::std::ptr::null::())).destx as *const _ as usize }, + 28usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_1), + stringify!(TCOD_bresenham_data_t), "::", - stringify!(si_pid) + stringify!(destx) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_uid as *const _ - as usize - }, - 4usize, + unsafe { &(*(::std::ptr::null::())).desty as *const _ as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_1), + stringify!(TCOD_bresenham_data_t), "::", - stringify!(si_uid) + stringify!(desty) ) ); } -#[repr(C)] -#[derive(Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_2 { - pub si_tid: ::std::os::raw::c_int, - pub si_overrun: ::std::os::raw::c_int, - pub si_sigval: __sigval_t, -} -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_2() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2) - ) +extern "C" { + pub fn TCOD_line_init_mt( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + data: *mut TCOD_bresenham_data_t, ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2) - ) +} +extern "C" { + pub fn TCOD_line_step_mt( + xCur: *mut ::std::os::raw::c_int, + yCur: *mut ::std::os::raw::c_int, + data: *mut TCOD_bresenham_data_t, + ) -> bool; +} +extern "C" { + pub fn TCOD_line_mt( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + listener: TCOD_line_listener_t, + data: *mut TCOD_bresenham_data_t, + ) -> bool; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Random { + _unused: [u8; 0], +} +pub type TCOD_random_t = *mut TCOD_Random; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_dice_t { + pub nb_rolls: ::std::os::raw::c_int, + pub nb_faces: ::std::os::raw::c_int, + pub multiplier: f32, + pub addsub: f32, +} +#[test] +fn bindgen_test_layout_TCOD_dice_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_dice_t)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_tid as *const _ - as usize - }, + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_dice_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_rolls as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2), + stringify!(TCOD_dice_t), "::", - stringify!(si_tid) + stringify!(nb_rolls) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_overrun as *const _ - as usize - }, + unsafe { &(*(::std::ptr::null::())).nb_faces as *const _ as usize }, 4usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2), + stringify!(TCOD_dice_t), "::", - stringify!(si_overrun) + stringify!(nb_faces) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_sigval as *const _ - as usize - }, + unsafe { &(*(::std::ptr::null::())).multiplier as *const _ as usize }, 8usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2), + stringify!(TCOD_dice_t), + "::", + stringify!(multiplier) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).addsub as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), "::", - stringify!(si_sigval) + stringify!(addsub) ) ); } -impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_2 { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_random_algo_t { + TCOD_RNG_MT = 0, + TCOD_RNG_CMWC = 1, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_distribution_t { + TCOD_DISTRIBUTION_LINEAR = 0, + TCOD_DISTRIBUTION_GAUSSIAN = 1, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE = 2, + TCOD_DISTRIBUTION_GAUSSIAN_INVERSE = 3, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE = 4, } #[repr(C)] -#[derive(Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_3 { - pub si_pid: __pid_t, - pub si_uid: __uid_t, - pub si_sigval: __sigval_t, +#[derive(Debug, Copy, Clone)] +pub struct _TCOD_tree_t { + pub next: *mut _TCOD_tree_t, + pub father: *mut _TCOD_tree_t, + pub sons: *mut _TCOD_tree_t, } #[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_3() { +fn bindgen_test_layout__TCOD_tree_t() { assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3) - ) + ::std::mem::size_of::<_TCOD_tree_t>(), + 24usize, + concat!("Size of: ", stringify!(_TCOD_tree_t)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::<_TCOD_tree_t>(), 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3) - ) + concat!("Alignment of ", stringify!(_TCOD_tree_t)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_pid as *const _ - as usize - }, + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).next as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3), + stringify!(_TCOD_tree_t), "::", - stringify!(si_pid) + stringify!(next) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_uid as *const _ - as usize - }, - 4usize, + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).father as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3), + stringify!(_TCOD_tree_t), "::", - stringify!(si_uid) + stringify!(father) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_sigval as *const _ - as usize - }, - 8usize, + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).sons as *const _ as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3), + stringify!(_TCOD_tree_t), "::", - stringify!(si_sigval) + stringify!(sons) ) ); } -impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_3 { +impl Default for _TCOD_tree_t { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } +pub type TCOD_tree_t = _TCOD_tree_t; +extern "C" { + pub fn TCOD_tree_new() -> *mut TCOD_tree_t; +} +extern "C" { + pub fn TCOD_tree_add_son(node: *mut TCOD_tree_t, son: *mut TCOD_tree_t); +} #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_4 { - pub si_pid: __pid_t, - pub si_uid: __uid_t, - pub si_status: ::std::os::raw::c_int, - pub si_utime: __clock_t, - pub si_stime: __clock_t, +#[derive(Debug, Copy, Clone)] +pub struct TCOD_bsp_t { + pub tree: TCOD_tree_t, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub w: ::std::os::raw::c_int, + pub h: ::std::os::raw::c_int, + pub position: ::std::os::raw::c_int, + pub level: u8, + pub horizontal: bool, } #[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_4() { +fn bindgen_test_layout_TCOD_bsp_t() { assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4) - ) + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(TCOD_bsp_t)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4) - ) + concat!("Alignment of ", stringify!(TCOD_bsp_t)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_pid as *const _ - as usize - }, + unsafe { &(*(::std::ptr::null::())).tree as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), + stringify!(TCOD_bsp_t), "::", - stringify!(si_pid) + stringify!(tree) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_uid as *const _ - as usize - }, - 4usize, + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), + stringify!(TCOD_bsp_t), "::", - stringify!(si_uid) + stringify!(x) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_status as *const _ - as usize - }, - 8usize, + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 28usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), + stringify!(TCOD_bsp_t), "::", - stringify!(si_status) + stringify!(y) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_utime as *const _ - as usize - }, - 16usize, + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), + stringify!(TCOD_bsp_t), "::", - stringify!(si_utime) + stringify!(w) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_stime as *const _ - as usize - }, - 24usize, + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 36usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), + stringify!(TCOD_bsp_t), "::", - stringify!(si_stime) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_5 { - pub si_addr: *mut ::std::os::raw::c_void, - pub si_addr_lsb: ::std::os::raw::c_short, - pub _bounds: siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1 { - pub _addr_bnd: siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, - pub _pkey: __uint32_t, - _bindgen_union_align: [u64; 2usize], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { - pub _lower: *mut ::std::os::raw::c_void, - pub _upper: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1) + stringify!(h) ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, + unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, + 40usize, concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1) + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(position) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::< - siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, - >())) - ._lower as *const _ as usize - }, - 0usize, + unsafe { &(*(::std::ptr::null::())).level as *const _ as usize }, + 44usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1), + stringify!(TCOD_bsp_t), "::", - stringify!(_lower) + stringify!(level) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::< - siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, - >())) - ._upper as *const _ as usize - }, - 8usize, + unsafe { &(*(::std::ptr::null::())).horizontal as *const _ as usize }, + 45usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1), + stringify!(TCOD_bsp_t), "::", - stringify!(_upper) + stringify!(horizontal) ) ); } -impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { +impl Default for TCOD_bsp_t { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - ._addr_bnd as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_addr_bnd) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._pkey - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_pkey) - ) - ); +pub type TCOD_bsp_callback_t = ::std::option::Option< + unsafe extern "C" fn(node: *mut TCOD_bsp_t, userData: *mut ::std::os::raw::c_void) -> bool, +>; +extern "C" { + pub fn TCOD_bsp_new() -> *mut TCOD_bsp_t; } -impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1 { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub fn TCOD_bsp_new_with_size( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_bsp_t; } -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_5() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_addr as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5), - "::", - stringify!(si_addr) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_addr_lsb - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5), - "::", - stringify!(si_addr_lsb) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._bounds as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5), - "::", - stringify!(_bounds) - ) - ); +extern "C" { + pub fn TCOD_bsp_delete(node: *mut TCOD_bsp_t); } -impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_5 { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub fn TCOD_bsp_left(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_6 { - pub si_band: ::std::os::raw::c_long, - pub si_fd: ::std::os::raw::c_int, +extern "C" { + pub fn TCOD_bsp_right(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; } -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_6() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_6) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_6) - ) +extern "C" { + pub fn TCOD_bsp_father(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_is_leaf(node: *mut TCOD_bsp_t) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_pre_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_in_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_post_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_level_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_inverted_level_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_contains( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_find_node( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_resize( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_band as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_6), - "::", - stringify!(si_band) - ) +} +extern "C" { + pub fn TCOD_bsp_split_once( + node: *mut TCOD_bsp_t, + horizontal: bool, + position: ::std::os::raw::c_int, ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).si_fd as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_6), - "::", - stringify!(si_fd) - ) +} +extern "C" { + pub fn TCOD_bsp_split_recursive( + node: *mut TCOD_bsp_t, + randomizer: TCOD_random_t, + nb: ::std::os::raw::c_int, + minHSize: ::std::os::raw::c_int, + minVSize: ::std::os::raw::c_int, + maxHRatio: f32, + maxVRatio: f32, ); } +extern "C" { + pub fn TCOD_bsp_remove_sons(node: *mut TCOD_bsp_t); +} +#[doc = " A three channel color struct."] #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_7 { - pub _call_addr: *mut ::std::os::raw::c_void, - pub _syscall: ::std::os::raw::c_int, - pub _arch: ::std::os::raw::c_uint, +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ColorRGB { + pub r: u8, + pub g: u8, + pub b: u8, } #[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_7() { +fn bindgen_test_layout_TCOD_ColorRGB() { assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7) - ) + ::std::mem::size_of::(), + 3usize, + concat!("Size of: ", stringify!(TCOD_ColorRGB)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7) - ) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_ColorRGB)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._call_addr as *const _ - as usize - }, + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7), + stringify!(TCOD_ColorRGB), "::", - stringify!(_call_addr) + stringify!(r) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._syscall as *const _ - as usize - }, - 8usize, + unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, + 1usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7), + stringify!(TCOD_ColorRGB), "::", - stringify!(_syscall) + stringify!(g) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._arch as *const _ - as usize - }, - 12usize, + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 2usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7), + stringify!(TCOD_ColorRGB), "::", - stringify!(_arch) + stringify!(b) ) ); } -impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_7 { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +pub type TCOD_color_t = TCOD_ColorRGB; +#[doc = " A four channel color struct."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ColorRGBA { + pub r: u8, + pub g: u8, + pub b: u8, + pub a: u8, } #[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(siginfo_t__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(siginfo_t__bindgen_ty_1)) - ); +fn bindgen_test_layout_TCOD_ColorRGBA() { assert_eq!( - unsafe { &(*(::std::ptr::null::()))._pad as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), - "::", - stringify!(_pad) - ) + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(TCOD_ColorRGBA)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._kill as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), - "::", - stringify!(_kill) - ) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_ColorRGBA)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._timer as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), + stringify!(TCOD_ColorRGBA), "::", - stringify!(_timer) + stringify!(r) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::()))._rt as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, + 1usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), + stringify!(TCOD_ColorRGBA), "::", - stringify!(_rt) + stringify!(g) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._sigchld as *const _ as usize - }, - 0usize, + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 2usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), + stringify!(TCOD_ColorRGBA), "::", - stringify!(_sigchld) + stringify!(b) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._sigfault as *const _ as usize - }, - 0usize, + unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, + 3usize, concat!( "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), + stringify!(TCOD_ColorRGBA), "::", - stringify!(_sigfault) + stringify!(a) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._sigpoll as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), - "::", - stringify!(_sigpoll) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::()))._sigsys as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), - "::", - stringify!(_sigsys) - ) - ); -} -impl Default for siginfo_t__bindgen_ty_1 { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[test] -fn bindgen_test_layout_siginfo_t() { - assert_eq!( - ::std::mem::size_of::(), - 128usize, - concat!("Size of: ", stringify!(siginfo_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(siginfo_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).si_signo as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t), - "::", - stringify!(si_signo) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).si_errno as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t), - "::", - stringify!(si_errno) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).si_code as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t), - "::", - stringify!(si_code) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__pad0 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t), - "::", - stringify!(__pad0) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::()))._sifields as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t), - "::", - stringify!(_sifields) - ) - ); -} -impl Default for siginfo_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub const SI_ASYNCNL: _bindgen_ty_1 = _bindgen_ty_1::SI_ASYNCNL; -pub const SI_DETHREAD: _bindgen_ty_1 = _bindgen_ty_1::SI_DETHREAD; -pub const SI_TKILL: _bindgen_ty_1 = _bindgen_ty_1::SI_TKILL; -pub const SI_SIGIO: _bindgen_ty_1 = _bindgen_ty_1::SI_SIGIO; -pub const SI_ASYNCIO: _bindgen_ty_1 = _bindgen_ty_1::SI_ASYNCIO; -pub const SI_MESGQ: _bindgen_ty_1 = _bindgen_ty_1::SI_MESGQ; -pub const SI_TIMER: _bindgen_ty_1 = _bindgen_ty_1::SI_TIMER; -pub const SI_QUEUE: _bindgen_ty_1 = _bindgen_ty_1::SI_QUEUE; -pub const SI_USER: _bindgen_ty_1 = _bindgen_ty_1::SI_USER; -pub const SI_KERNEL: _bindgen_ty_1 = _bindgen_ty_1::SI_KERNEL; -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_1 { - SI_ASYNCNL = -60, - SI_DETHREAD = -7, - SI_TKILL = -6, - SI_SIGIO = -5, - SI_ASYNCIO = -4, - SI_MESGQ = -3, - SI_TIMER = -2, - SI_QUEUE = -1, - SI_USER = 0, - SI_KERNEL = 128, -} -pub const ILL_ILLOPC: _bindgen_ty_2 = _bindgen_ty_2::ILL_ILLOPC; -pub const ILL_ILLOPN: _bindgen_ty_2 = _bindgen_ty_2::ILL_ILLOPN; -pub const ILL_ILLADR: _bindgen_ty_2 = _bindgen_ty_2::ILL_ILLADR; -pub const ILL_ILLTRP: _bindgen_ty_2 = _bindgen_ty_2::ILL_ILLTRP; -pub const ILL_PRVOPC: _bindgen_ty_2 = _bindgen_ty_2::ILL_PRVOPC; -pub const ILL_PRVREG: _bindgen_ty_2 = _bindgen_ty_2::ILL_PRVREG; -pub const ILL_COPROC: _bindgen_ty_2 = _bindgen_ty_2::ILL_COPROC; -pub const ILL_BADSTK: _bindgen_ty_2 = _bindgen_ty_2::ILL_BADSTK; -pub const ILL_BADIADDR: _bindgen_ty_2 = _bindgen_ty_2::ILL_BADIADDR; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_2 { - ILL_ILLOPC = 1, - ILL_ILLOPN = 2, - ILL_ILLADR = 3, - ILL_ILLTRP = 4, - ILL_PRVOPC = 5, - ILL_PRVREG = 6, - ILL_COPROC = 7, - ILL_BADSTK = 8, - ILL_BADIADDR = 9, -} -pub const FPE_INTDIV: _bindgen_ty_3 = _bindgen_ty_3::FPE_INTDIV; -pub const FPE_INTOVF: _bindgen_ty_3 = _bindgen_ty_3::FPE_INTOVF; -pub const FPE_FLTDIV: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTDIV; -pub const FPE_FLTOVF: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTOVF; -pub const FPE_FLTUND: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTUND; -pub const FPE_FLTRES: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTRES; -pub const FPE_FLTINV: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTINV; -pub const FPE_FLTSUB: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTSUB; -pub const FPE_FLTUNK: _bindgen_ty_3 = _bindgen_ty_3::FPE_FLTUNK; -pub const FPE_CONDTRAP: _bindgen_ty_3 = _bindgen_ty_3::FPE_CONDTRAP; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_3 { - FPE_INTDIV = 1, - FPE_INTOVF = 2, - FPE_FLTDIV = 3, - FPE_FLTOVF = 4, - FPE_FLTUND = 5, - FPE_FLTRES = 6, - FPE_FLTINV = 7, - FPE_FLTSUB = 8, - FPE_FLTUNK = 14, - FPE_CONDTRAP = 15, -} -pub const SEGV_MAPERR: _bindgen_ty_4 = _bindgen_ty_4::SEGV_MAPERR; -pub const SEGV_ACCERR: _bindgen_ty_4 = _bindgen_ty_4::SEGV_ACCERR; -pub const SEGV_BNDERR: _bindgen_ty_4 = _bindgen_ty_4::SEGV_BNDERR; -pub const SEGV_PKUERR: _bindgen_ty_4 = _bindgen_ty_4::SEGV_PKUERR; -pub const SEGV_ACCADI: _bindgen_ty_4 = _bindgen_ty_4::SEGV_ACCADI; -pub const SEGV_ADIDERR: _bindgen_ty_4 = _bindgen_ty_4::SEGV_ADIDERR; -pub const SEGV_ADIPERR: _bindgen_ty_4 = _bindgen_ty_4::SEGV_ADIPERR; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_4 { - SEGV_MAPERR = 1, - SEGV_ACCERR = 2, - SEGV_BNDERR = 3, - SEGV_PKUERR = 4, - SEGV_ACCADI = 5, - SEGV_ADIDERR = 6, - SEGV_ADIPERR = 7, -} -pub const BUS_ADRALN: _bindgen_ty_5 = _bindgen_ty_5::BUS_ADRALN; -pub const BUS_ADRERR: _bindgen_ty_5 = _bindgen_ty_5::BUS_ADRERR; -pub const BUS_OBJERR: _bindgen_ty_5 = _bindgen_ty_5::BUS_OBJERR; -pub const BUS_MCEERR_AR: _bindgen_ty_5 = _bindgen_ty_5::BUS_MCEERR_AR; -pub const BUS_MCEERR_AO: _bindgen_ty_5 = _bindgen_ty_5::BUS_MCEERR_AO; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_5 { - BUS_ADRALN = 1, - BUS_ADRERR = 2, - BUS_OBJERR = 3, - BUS_MCEERR_AR = 4, - BUS_MCEERR_AO = 5, -} -pub const CLD_EXITED: _bindgen_ty_6 = _bindgen_ty_6::CLD_EXITED; -pub const CLD_KILLED: _bindgen_ty_6 = _bindgen_ty_6::CLD_KILLED; -pub const CLD_DUMPED: _bindgen_ty_6 = _bindgen_ty_6::CLD_DUMPED; -pub const CLD_TRAPPED: _bindgen_ty_6 = _bindgen_ty_6::CLD_TRAPPED; -pub const CLD_STOPPED: _bindgen_ty_6 = _bindgen_ty_6::CLD_STOPPED; -pub const CLD_CONTINUED: _bindgen_ty_6 = _bindgen_ty_6::CLD_CONTINUED; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_6 { - CLD_EXITED = 1, - CLD_KILLED = 2, - CLD_DUMPED = 3, - CLD_TRAPPED = 4, - CLD_STOPPED = 5, - CLD_CONTINUED = 6, -} -pub const POLL_IN: _bindgen_ty_7 = _bindgen_ty_7::POLL_IN; -pub const POLL_OUT: _bindgen_ty_7 = _bindgen_ty_7::POLL_OUT; -pub const POLL_MSG: _bindgen_ty_7 = _bindgen_ty_7::POLL_MSG; -pub const POLL_ERR: _bindgen_ty_7 = _bindgen_ty_7::POLL_ERR; -pub const POLL_PRI: _bindgen_ty_7 = _bindgen_ty_7::POLL_PRI; -pub const POLL_HUP: _bindgen_ty_7 = _bindgen_ty_7::POLL_HUP; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_7 { - POLL_IN = 1, - POLL_OUT = 2, - POLL_MSG = 3, - POLL_ERR = 4, - POLL_PRI = 5, - POLL_HUP = 6, -} -pub type sigval_t = __sigval_t; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct sigevent { - pub sigev_value: __sigval_t, - pub sigev_signo: ::std::os::raw::c_int, - pub sigev_notify: ::std::os::raw::c_int, - pub _sigev_un: sigevent__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union sigevent__bindgen_ty_1 { - pub _pad: [::std::os::raw::c_int; 12usize], - pub _tid: __pid_t, - pub _sigev_thread: sigevent__bindgen_ty_1__bindgen_ty_1, - _bindgen_union_align: [u64; 6usize], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct sigevent__bindgen_ty_1__bindgen_ty_1 { - pub _function: ::std::option::Option, - pub _attribute: *mut pthread_attr_t, -} -#[test] -fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(sigevent__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(sigevent__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._function as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigevent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(_function) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._attribute as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(sigevent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(_attribute) - ) - ); -} -impl Default for sigevent__bindgen_ty_1__bindgen_ty_1 { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[test] -fn bindgen_test_layout_sigevent__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(sigevent__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigevent__bindgen_ty_1)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::()))._pad as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigevent__bindgen_ty_1), - "::", - stringify!(_pad) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::()))._tid as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigevent__bindgen_ty_1), - "::", - stringify!(_tid) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::()))._sigev_thread as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigevent__bindgen_ty_1), - "::", - stringify!(_sigev_thread) - ) - ); -} -impl Default for sigevent__bindgen_ty_1 { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[test] -fn bindgen_test_layout_sigevent() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(sigevent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigevent)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_value as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigevent), - "::", - stringify!(sigev_value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_signo as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(sigevent), - "::", - stringify!(sigev_signo) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_notify as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(sigevent), - "::", - stringify!(sigev_notify) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::()))._sigev_un as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(sigevent), - "::", - stringify!(_sigev_un) - ) - ); -} -impl Default for sigevent { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type sigevent_t = sigevent; -pub const SIGEV_SIGNAL: _bindgen_ty_8 = _bindgen_ty_8::SIGEV_SIGNAL; -pub const SIGEV_NONE: _bindgen_ty_8 = _bindgen_ty_8::SIGEV_NONE; -pub const SIGEV_THREAD: _bindgen_ty_8 = _bindgen_ty_8::SIGEV_THREAD; -pub const SIGEV_THREAD_ID: _bindgen_ty_8 = _bindgen_ty_8::SIGEV_THREAD_ID; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_8 { - SIGEV_SIGNAL = 0, - SIGEV_NONE = 1, - SIGEV_THREAD = 2, - SIGEV_THREAD_ID = 4, } -pub type __sighandler_t = ::std::option::Option; extern "C" { - pub fn __sysv_signal(__sig: ::std::os::raw::c_int, __handler: __sighandler_t) - -> __sighandler_t; + pub fn TCOD_color_RGB(r: u8, g: u8, b: u8) -> TCOD_color_t; } extern "C" { - pub fn signal(__sig: ::std::os::raw::c_int, __handler: __sighandler_t) -> __sighandler_t; + pub fn TCOD_color_HSV(hue: f32, saturation: f32, value: f32) -> TCOD_color_t; } extern "C" { - pub fn kill(__pid: __pid_t, __sig: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn TCOD_color_equals(c1: TCOD_color_t, c2: TCOD_color_t) -> bool; } extern "C" { - pub fn killpg(__pgrp: __pid_t, __sig: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn TCOD_color_add(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; } extern "C" { - pub fn raise(__sig: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn TCOD_color_subtract(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; } extern "C" { - pub fn ssignal(__sig: ::std::os::raw::c_int, __handler: __sighandler_t) -> __sighandler_t; + pub fn TCOD_color_multiply(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; } extern "C" { - pub fn gsignal(__sig: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn TCOD_color_multiply_scalar(c1: TCOD_color_t, value: f32) -> TCOD_color_t; } extern "C" { - pub fn psignal(__sig: ::std::os::raw::c_int, __s: *const ::std::os::raw::c_char); + pub fn TCOD_color_lerp(c1: TCOD_color_t, c2: TCOD_color_t, coef: f32) -> TCOD_color_t; } extern "C" { - pub fn psiginfo(__pinfo: *const siginfo_t, __s: *const ::std::os::raw::c_char); + #[doc = " Blend `src` into `dst` as an alpha blending operation."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_color_alpha_blend(dst: *mut TCOD_ColorRGBA, src: *const TCOD_ColorRGBA); } extern "C" { - pub fn sigblock(__mask: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn TCOD_color_set_HSV(color: *mut TCOD_color_t, hue: f32, saturation: f32, value: f32); } extern "C" { - pub fn sigsetmask(__mask: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn TCOD_color_get_HSV( + color: TCOD_color_t, + hue: *mut f32, + saturation: *mut f32, + value: *mut f32, + ); } extern "C" { - pub fn siggetmask() -> ::std::os::raw::c_int; + pub fn TCOD_color_get_hue(color: TCOD_color_t) -> f32; } -pub type sig_t = __sighandler_t; extern "C" { - pub fn sigemptyset(__set: *mut sigset_t) -> ::std::os::raw::c_int; + pub fn TCOD_color_set_hue(color: *mut TCOD_color_t, hue: f32); } extern "C" { - pub fn sigfillset(__set: *mut sigset_t) -> ::std::os::raw::c_int; + pub fn TCOD_color_get_saturation(color: TCOD_color_t) -> f32; } extern "C" { - pub fn sigaddset(__set: *mut sigset_t, __signo: ::std::os::raw::c_int) - -> ::std::os::raw::c_int; + pub fn TCOD_color_set_saturation(color: *mut TCOD_color_t, saturation: f32); } extern "C" { - pub fn sigdelset(__set: *mut sigset_t, __signo: ::std::os::raw::c_int) - -> ::std::os::raw::c_int; + pub fn TCOD_color_get_value(color: TCOD_color_t) -> f32; } extern "C" { - pub fn sigismember( - __set: *const sigset_t, - __signo: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub fn TCOD_color_set_value(color: *mut TCOD_color_t, value: f32); } -#[repr(C)] -#[derive(Copy, Clone)] -pub struct sigaction { - pub __sigaction_handler: sigaction__bindgen_ty_1, - pub sa_mask: __sigset_t, - pub sa_flags: ::std::os::raw::c_int, - pub sa_restorer: ::std::option::Option, +extern "C" { + pub fn TCOD_color_shift_hue(color: *mut TCOD_color_t, hshift: f32); } -#[repr(C)] -#[derive(Copy, Clone)] -pub union sigaction__bindgen_ty_1 { - pub sa_handler: __sighandler_t, - pub sa_sigaction: ::std::option::Option< - unsafe extern "C" fn( - arg1: ::std::os::raw::c_int, - arg2: *mut siginfo_t, - arg3: *mut ::std::os::raw::c_void, - ), - >, - _bindgen_union_align: u64, +extern "C" { + pub fn TCOD_color_scale_HSV(color: *mut TCOD_color_t, saturation_coef: f32, value_coef: f32); } -#[test] -fn bindgen_test_layout_sigaction__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(sigaction__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigaction__bindgen_ty_1)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_handler as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigaction__bindgen_ty_1), - "::", - stringify!(sa_handler) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sa_sigaction as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigaction__bindgen_ty_1), - "::", - stringify!(sa_sigaction) - ) +extern "C" { + pub fn TCOD_color_gen_map( + map: *mut TCOD_color_t, + nb_key: ::std::os::raw::c_int, + key_color: *const TCOD_color_t, + key_index: *const ::std::os::raw::c_int, ); } -impl Default for sigaction__bindgen_ty_1 { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +pub const TCOD_COLOR_RED: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_RED; +pub const TCOD_COLOR_FLAME: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_FLAME; +pub const TCOD_COLOR_ORANGE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_ORANGE; +pub const TCOD_COLOR_AMBER: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_AMBER; +pub const TCOD_COLOR_YELLOW: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_YELLOW; +pub const TCOD_COLOR_LIME: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_LIME; +pub const TCOD_COLOR_CHARTREUSE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CHARTREUSE; +pub const TCOD_COLOR_GREEN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_GREEN; +pub const TCOD_COLOR_SEA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_SEA; +pub const TCOD_COLOR_TURQUOISE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_TURQUOISE; +pub const TCOD_COLOR_CYAN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CYAN; +pub const TCOD_COLOR_SKY: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_SKY; +pub const TCOD_COLOR_AZURE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_AZURE; +pub const TCOD_COLOR_BLUE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_BLUE; +pub const TCOD_COLOR_HAN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_HAN; +pub const TCOD_COLOR_VIOLET: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_VIOLET; +pub const TCOD_COLOR_PURPLE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_PURPLE; +pub const TCOD_COLOR_FUCHSIA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_FUCHSIA; +pub const TCOD_COLOR_MAGENTA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_MAGENTA; +pub const TCOD_COLOR_PINK: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_PINK; +pub const TCOD_COLOR_CRIMSON: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CRIMSON; +pub const TCOD_COLOR_NB: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_NB; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_1 { + TCOD_COLOR_RED = 0, + TCOD_COLOR_FLAME = 1, + TCOD_COLOR_ORANGE = 2, + TCOD_COLOR_AMBER = 3, + TCOD_COLOR_YELLOW = 4, + TCOD_COLOR_LIME = 5, + TCOD_COLOR_CHARTREUSE = 6, + TCOD_COLOR_GREEN = 7, + TCOD_COLOR_SEA = 8, + TCOD_COLOR_TURQUOISE = 9, + TCOD_COLOR_CYAN = 10, + TCOD_COLOR_SKY = 11, + TCOD_COLOR_AZURE = 12, + TCOD_COLOR_BLUE = 13, + TCOD_COLOR_HAN = 14, + TCOD_COLOR_VIOLET = 15, + TCOD_COLOR_PURPLE = 16, + TCOD_COLOR_FUCHSIA = 17, + TCOD_COLOR_MAGENTA = 18, + TCOD_COLOR_PINK = 19, + TCOD_COLOR_CRIMSON = 20, + TCOD_COLOR_NB = 21, } -#[test] -fn bindgen_test_layout_sigaction() { - assert_eq!( - ::std::mem::size_of::(), - 152usize, - concat!("Size of: ", stringify!(sigaction)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigaction)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__sigaction_handler as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigaction), - "::", - stringify!(__sigaction_handler) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_mask as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(sigaction), - "::", - stringify!(sa_mask) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_flags as *const _ as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(sigaction), - "::", - stringify!(sa_flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_restorer as *const _ as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(sigaction), - "::", - stringify!(sa_restorer) - ) - ); +pub const TCOD_COLOR_DESATURATED: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DESATURATED; +pub const TCOD_COLOR_LIGHTEST: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHTEST; +pub const TCOD_COLOR_LIGHTER: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHTER; +pub const TCOD_COLOR_LIGHT: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHT; +pub const TCOD_COLOR_NORMAL: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_NORMAL; +pub const TCOD_COLOR_DARK: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARK; +pub const TCOD_COLOR_DARKER: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARKER; +pub const TCOD_COLOR_DARKEST: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARKEST; +pub const TCOD_COLOR_LEVELS: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LEVELS; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_2 { + TCOD_COLOR_DESATURATED = 0, + TCOD_COLOR_LIGHTEST = 1, + TCOD_COLOR_LIGHTER = 2, + TCOD_COLOR_LIGHT = 3, + TCOD_COLOR_NORMAL = 4, + TCOD_COLOR_DARK = 5, + TCOD_COLOR_DARKER = 6, + TCOD_COLOR_DARKEST = 7, + TCOD_COLOR_LEVELS = 8, } -impl Default for sigaction { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static mut TCOD_colors: [[TCOD_color_t; 8usize]; 21usize]; } extern "C" { - pub fn sigprocmask( - __how: ::std::os::raw::c_int, - __set: *const sigset_t, - __oset: *mut sigset_t, - ) -> ::std::os::raw::c_int; + pub static TCOD_black: TCOD_color_t; } extern "C" { - pub fn sigsuspend(__set: *const sigset_t) -> ::std::os::raw::c_int; + pub static TCOD_darkest_grey: TCOD_color_t; } extern "C" { - pub fn sigaction( - __sig: ::std::os::raw::c_int, - __act: *const sigaction, - __oact: *mut sigaction, - ) -> ::std::os::raw::c_int; + pub static TCOD_darker_grey: TCOD_color_t; } extern "C" { - pub fn sigpending(__set: *mut sigset_t) -> ::std::os::raw::c_int; + pub static TCOD_dark_grey: TCOD_color_t; } extern "C" { - pub fn sigwait( - __set: *const sigset_t, - __sig: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub static TCOD_grey: TCOD_color_t; } extern "C" { - pub fn sigwaitinfo(__set: *const sigset_t, __info: *mut siginfo_t) -> ::std::os::raw::c_int; + pub static TCOD_light_grey: TCOD_color_t; } extern "C" { - pub fn sigtimedwait( - __set: *const sigset_t, - __info: *mut siginfo_t, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; + pub static TCOD_lighter_grey: TCOD_color_t; } extern "C" { - pub fn sigqueue( - __pid: __pid_t, - __sig: ::std::os::raw::c_int, - __val: sigval, - ) -> ::std::os::raw::c_int; + pub static TCOD_lightest_grey: TCOD_color_t; } extern "C" { - pub static _sys_siglist: [*const ::std::os::raw::c_char; 65usize]; + pub static TCOD_darkest_gray: TCOD_color_t; } extern "C" { - pub static sys_siglist: [*const ::std::os::raw::c_char; 65usize]; + pub static TCOD_darker_gray: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct _fpx_sw_bytes { - pub magic1: __uint32_t, - pub extended_size: __uint32_t, - pub xstate_bv: __uint64_t, - pub xstate_size: __uint32_t, - pub __glibc_reserved1: [__uint32_t; 7usize], +extern "C" { + pub static TCOD_dark_gray: TCOD_color_t; } -#[test] -fn bindgen_test_layout__fpx_sw_bytes() { - assert_eq!( - ::std::mem::size_of::<_fpx_sw_bytes>(), - 48usize, - concat!("Size of: ", stringify!(_fpx_sw_bytes)) - ); - assert_eq!( - ::std::mem::align_of::<_fpx_sw_bytes>(), - 8usize, - concat!("Alignment of ", stringify!(_fpx_sw_bytes)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).magic1 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_fpx_sw_bytes), - "::", - stringify!(magic1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).extended_size as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_fpx_sw_bytes), - "::", - stringify!(extended_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).xstate_bv as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_fpx_sw_bytes), - "::", - stringify!(xstate_bv) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).xstate_size as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_fpx_sw_bytes), - "::", - stringify!(xstate_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpx_sw_bytes>())).__glibc_reserved1 as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(_fpx_sw_bytes), - "::", - stringify!(__glibc_reserved1) - ) - ); +extern "C" { + pub static TCOD_gray: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct _fpreg { - pub significand: [::std::os::raw::c_ushort; 4usize], - pub exponent: ::std::os::raw::c_ushort, +extern "C" { + pub static TCOD_light_gray: TCOD_color_t; } -#[test] -fn bindgen_test_layout__fpreg() { - assert_eq!( - ::std::mem::size_of::<_fpreg>(), - 10usize, - concat!("Size of: ", stringify!(_fpreg)) - ); - assert_eq!( - ::std::mem::align_of::<_fpreg>(), - 2usize, - concat!("Alignment of ", stringify!(_fpreg)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpreg>())).significand as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_fpreg), - "::", - stringify!(significand) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpreg>())).exponent as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_fpreg), - "::", - stringify!(exponent) - ) - ); +extern "C" { + pub static TCOD_lighter_gray: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct _fpxreg { - pub significand: [::std::os::raw::c_ushort; 4usize], - pub exponent: ::std::os::raw::c_ushort, - pub __glibc_reserved1: [::std::os::raw::c_ushort; 3usize], +extern "C" { + pub static TCOD_lightest_gray: TCOD_color_t; } -#[test] -fn bindgen_test_layout__fpxreg() { - assert_eq!( - ::std::mem::size_of::<_fpxreg>(), - 16usize, - concat!("Size of: ", stringify!(_fpxreg)) - ); - assert_eq!( - ::std::mem::align_of::<_fpxreg>(), - 2usize, - concat!("Alignment of ", stringify!(_fpxreg)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpxreg>())).significand as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_fpxreg), - "::", - stringify!(significand) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpxreg>())).exponent as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_fpxreg), - "::", - stringify!(exponent) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpxreg>())).__glibc_reserved1 as *const _ as usize }, - 10usize, - concat!( - "Offset of field: ", - stringify!(_fpxreg), - "::", - stringify!(__glibc_reserved1) - ) - ); +extern "C" { + pub static TCOD_white: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct _xmmreg { - pub element: [__uint32_t; 4usize], +extern "C" { + pub static TCOD_darkest_sepia: TCOD_color_t; } -#[test] -fn bindgen_test_layout__xmmreg() { - assert_eq!( - ::std::mem::size_of::<_xmmreg>(), - 16usize, - concat!("Size of: ", stringify!(_xmmreg)) - ); - assert_eq!( - ::std::mem::align_of::<_xmmreg>(), - 4usize, - concat!("Alignment of ", stringify!(_xmmreg)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_xmmreg>())).element as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_xmmreg), - "::", - stringify!(element) - ) - ); +extern "C" { + pub static TCOD_darker_sepia: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct _fpstate { - pub cwd: __uint16_t, - pub swd: __uint16_t, - pub ftw: __uint16_t, - pub fop: __uint16_t, - pub rip: __uint64_t, - pub rdp: __uint64_t, - pub mxcsr: __uint32_t, - pub mxcr_mask: __uint32_t, - pub _st: [_fpxreg; 8usize], - pub _xmm: [_xmmreg; 16usize], - pub __glibc_reserved1: [__uint32_t; 24usize], +extern "C" { + pub static TCOD_dark_sepia: TCOD_color_t; } -#[test] -fn bindgen_test_layout__fpstate() { - assert_eq!( - ::std::mem::size_of::<_fpstate>(), - 512usize, - concat!("Size of: ", stringify!(_fpstate)) - ); - assert_eq!( - ::std::mem::align_of::<_fpstate>(), - 8usize, - concat!("Alignment of ", stringify!(_fpstate)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate>())).cwd as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_fpstate), - "::", - stringify!(cwd) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate>())).swd as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(_fpstate), - "::", - stringify!(swd) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate>())).ftw as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_fpstate), - "::", - stringify!(ftw) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate>())).fop as *const _ as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(_fpstate), - "::", - stringify!(fop) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate>())).rip as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_fpstate), - "::", - stringify!(rip) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate>())).rdp as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_fpstate), - "::", - stringify!(rdp) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate>())).mxcsr as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_fpstate), - "::", - stringify!(mxcsr) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate>())).mxcr_mask as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(_fpstate), - "::", - stringify!(mxcr_mask) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate>()))._st as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_fpstate), - "::", - stringify!(_st) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate>()))._xmm as *const _ as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_fpstate), - "::", - stringify!(_xmm) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_fpstate>())).__glibc_reserved1 as *const _ as usize }, - 416usize, - concat!( - "Offset of field: ", - stringify!(_fpstate), - "::", - stringify!(__glibc_reserved1) - ) - ); +extern "C" { + pub static TCOD_sepia: TCOD_color_t; } -#[repr(C)] -#[derive(Copy, Clone)] -pub struct sigcontext { - pub r8: __uint64_t, - pub r9: __uint64_t, - pub r10: __uint64_t, - pub r11: __uint64_t, - pub r12: __uint64_t, - pub r13: __uint64_t, - pub r14: __uint64_t, - pub r15: __uint64_t, - pub rdi: __uint64_t, - pub rsi: __uint64_t, - pub rbp: __uint64_t, - pub rbx: __uint64_t, - pub rdx: __uint64_t, - pub rax: __uint64_t, - pub rcx: __uint64_t, - pub rsp: __uint64_t, - pub rip: __uint64_t, - pub eflags: __uint64_t, - pub cs: ::std::os::raw::c_ushort, - pub gs: ::std::os::raw::c_ushort, - pub fs: ::std::os::raw::c_ushort, - pub __pad0: ::std::os::raw::c_ushort, - pub err: __uint64_t, - pub trapno: __uint64_t, - pub oldmask: __uint64_t, - pub cr2: __uint64_t, - pub __bindgen_anon_1: sigcontext__bindgen_ty_1, - pub __reserved1: [__uint64_t; 8usize], +extern "C" { + pub static TCOD_light_sepia: TCOD_color_t; } -#[repr(C)] -#[derive(Copy, Clone)] -pub union sigcontext__bindgen_ty_1 { - pub fpstate: *mut _fpstate, - pub __fpstate_word: __uint64_t, - _bindgen_union_align: u64, +extern "C" { + pub static TCOD_lighter_sepia: TCOD_color_t; } -#[test] -fn bindgen_test_layout_sigcontext__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(sigcontext__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigcontext__bindgen_ty_1)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).fpstate as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigcontext__bindgen_ty_1), - "::", - stringify!(fpstate) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__fpstate_word as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigcontext__bindgen_ty_1), - "::", - stringify!(__fpstate_word) - ) - ); +extern "C" { + pub static TCOD_lightest_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_purple: TCOD_color_t; } -impl Default for sigcontext__bindgen_ty_1 { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_light_fuchsia: TCOD_color_t; } -#[test] -fn bindgen_test_layout_sigcontext() { - assert_eq!( - ::std::mem::size_of::(), - 256usize, - concat!("Size of: ", stringify!(sigcontext)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigcontext)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r8 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(r8) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r9 as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(r9) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r10 as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(r10) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r11 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(r11) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r12 as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(r12) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r13 as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(r13) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r14 as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(r14) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r15 as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(r15) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rdi as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(rdi) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rsi as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(rsi) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rbp as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(rbp) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rbx as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(rbx) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rdx as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(rdx) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rax as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(rax) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rcx as *const _ as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(rcx) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rsp as *const _ as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(rsp) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rip as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(rip) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).eflags as *const _ as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(eflags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cs as *const _ as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(cs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).gs as *const _ as usize }, - 146usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(gs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).fs as *const _ as usize }, - 148usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(fs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__pad0 as *const _ as usize }, - 150usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(__pad0) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).err as *const _ as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(err) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).trapno as *const _ as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(trapno) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).oldmask as *const _ as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(oldmask) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cr2 as *const _ as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(cr2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__reserved1 as *const _ as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(sigcontext), - "::", - stringify!(__reserved1) - ) - ); +extern "C" { + pub static TCOD_light_magenta: TCOD_color_t; } -impl Default for sigcontext { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_light_pink: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct _xsave_hdr { - pub xstate_bv: __uint64_t, - pub __glibc_reserved1: [__uint64_t; 2usize], - pub __glibc_reserved2: [__uint64_t; 5usize], +extern "C" { + pub static TCOD_light_crimson: TCOD_color_t; } -#[test] -fn bindgen_test_layout__xsave_hdr() { - assert_eq!( - ::std::mem::size_of::<_xsave_hdr>(), - 64usize, - concat!("Size of: ", stringify!(_xsave_hdr)) - ); - assert_eq!( - ::std::mem::align_of::<_xsave_hdr>(), - 8usize, - concat!("Alignment of ", stringify!(_xsave_hdr)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_xsave_hdr>())).xstate_bv as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_xsave_hdr), - "::", - stringify!(xstate_bv) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_xsave_hdr>())).__glibc_reserved1 as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_xsave_hdr), - "::", - stringify!(__glibc_reserved1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_xsave_hdr>())).__glibc_reserved2 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_xsave_hdr), - "::", - stringify!(__glibc_reserved2) - ) - ); +extern "C" { + pub static TCOD_lighter_red: TCOD_color_t; } -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _ymmh_state { - pub ymmh_space: [__uint32_t; 64usize], +extern "C" { + pub static TCOD_lighter_flame: TCOD_color_t; } -#[test] -fn bindgen_test_layout__ymmh_state() { - assert_eq!( - ::std::mem::size_of::<_ymmh_state>(), - 256usize, - concat!("Size of: ", stringify!(_ymmh_state)) - ); - assert_eq!( - ::std::mem::align_of::<_ymmh_state>(), - 4usize, - concat!("Alignment of ", stringify!(_ymmh_state)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ymmh_state>())).ymmh_space as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_ymmh_state), - "::", - stringify!(ymmh_space) - ) - ); +extern "C" { + pub static TCOD_lighter_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_amber: TCOD_color_t; } -impl Default for _ymmh_state { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_lighter_yellow: TCOD_color_t; } -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _xstate { - pub fpstate: _fpstate, - pub xstate_hdr: _xsave_hdr, - pub ymmh: _ymmh_state, +extern "C" { + pub static TCOD_lighter_lime: TCOD_color_t; } -#[test] -fn bindgen_test_layout__xstate() { - assert_eq!( - ::std::mem::size_of::<_xstate>(), - 832usize, - concat!("Size of: ", stringify!(_xstate)) - ); - assert_eq!( - ::std::mem::align_of::<_xstate>(), - 8usize, - concat!("Alignment of ", stringify!(_xstate)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_xstate>())).fpstate as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_xstate), - "::", - stringify!(fpstate) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_xstate>())).xstate_hdr as *const _ as usize }, - 512usize, - concat!( - "Offset of field: ", - stringify!(_xstate), - "::", - stringify!(xstate_hdr) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_xstate>())).ymmh as *const _ as usize }, - 576usize, - concat!( - "Offset of field: ", - stringify!(_xstate), - "::", - stringify!(ymmh) - ) - ); +extern "C" { + pub static TCOD_lighter_chartreuse: TCOD_color_t; } -impl Default for _xstate { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_lighter_green: TCOD_color_t; } extern "C" { - pub fn sigreturn(__scp: *mut sigcontext) -> ::std::os::raw::c_int; + pub static TCOD_lighter_sea: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct stack_t { - pub ss_sp: *mut ::std::os::raw::c_void, - pub ss_flags: ::std::os::raw::c_int, - pub ss_size: size_t, +extern "C" { + pub static TCOD_lighter_turquoise: TCOD_color_t; } -#[test] -fn bindgen_test_layout_stack_t() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(stack_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(stack_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_sp as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(stack_t), - "::", - stringify!(ss_sp) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_flags as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(stack_t), - "::", - stringify!(ss_flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_size as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(stack_t), - "::", - stringify!(ss_size) - ) - ); +extern "C" { + pub static TCOD_lighter_cyan: TCOD_color_t; } -impl Default for stack_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_lighter_sky: TCOD_color_t; } -pub type greg_t = ::std::os::raw::c_longlong; -pub type gregset_t = [greg_t; 23usize]; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct _libc_fpxreg { - pub significand: [::std::os::raw::c_ushort; 4usize], - pub exponent: ::std::os::raw::c_ushort, - pub __glibc_reserved1: [::std::os::raw::c_ushort; 3usize], +extern "C" { + pub static TCOD_lighter_azure: TCOD_color_t; } -#[test] -fn bindgen_test_layout__libc_fpxreg() { - assert_eq!( - ::std::mem::size_of::<_libc_fpxreg>(), - 16usize, - concat!("Size of: ", stringify!(_libc_fpxreg)) - ); - assert_eq!( - ::std::mem::align_of::<_libc_fpxreg>(), - 2usize, - concat!("Alignment of ", stringify!(_libc_fpxreg)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpxreg>())).significand as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpxreg), - "::", - stringify!(significand) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpxreg>())).exponent as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpxreg), - "::", - stringify!(exponent) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpxreg>())).__glibc_reserved1 as *const _ as usize }, - 10usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpxreg), - "::", - stringify!(__glibc_reserved1) - ) - ); +extern "C" { + pub static TCOD_lighter_blue: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct _libc_xmmreg { - pub element: [__uint32_t; 4usize], +extern "C" { + pub static TCOD_lighter_han: TCOD_color_t; } -#[test] -fn bindgen_test_layout__libc_xmmreg() { - assert_eq!( - ::std::mem::size_of::<_libc_xmmreg>(), - 16usize, - concat!("Size of: ", stringify!(_libc_xmmreg)) - ); - assert_eq!( - ::std::mem::align_of::<_libc_xmmreg>(), - 4usize, - concat!("Alignment of ", stringify!(_libc_xmmreg)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_xmmreg>())).element as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_libc_xmmreg), - "::", - stringify!(element) - ) - ); +extern "C" { + pub static TCOD_lighter_violet: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct _libc_fpstate { - pub cwd: __uint16_t, - pub swd: __uint16_t, - pub ftw: __uint16_t, - pub fop: __uint16_t, - pub rip: __uint64_t, - pub rdp: __uint64_t, - pub mxcsr: __uint32_t, - pub mxcr_mask: __uint32_t, - pub _st: [_libc_fpxreg; 8usize], - pub _xmm: [_libc_xmmreg; 16usize], - pub __glibc_reserved1: [__uint32_t; 24usize], +extern "C" { + pub static TCOD_lighter_purple: TCOD_color_t; } -#[test] -fn bindgen_test_layout__libc_fpstate() { - assert_eq!( - ::std::mem::size_of::<_libc_fpstate>(), - 512usize, - concat!("Size of: ", stringify!(_libc_fpstate)) - ); - assert_eq!( - ::std::mem::align_of::<_libc_fpstate>(), - 8usize, - concat!("Alignment of ", stringify!(_libc_fpstate)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).cwd as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpstate), - "::", - stringify!(cwd) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).swd as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpstate), - "::", - stringify!(swd) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).ftw as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpstate), - "::", - stringify!(ftw) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).fop as *const _ as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpstate), - "::", - stringify!(fop) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).rip as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpstate), - "::", - stringify!(rip) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).rdp as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpstate), - "::", - stringify!(rdp) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).mxcsr as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpstate), - "::", - stringify!(mxcsr) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).mxcr_mask as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpstate), - "::", - stringify!(mxcr_mask) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>()))._st as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpstate), - "::", - stringify!(_st) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>()))._xmm as *const _ as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpstate), - "::", - stringify!(_xmm) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_libc_fpstate>())).__glibc_reserved1 as *const _ as usize }, - 416usize, - concat!( - "Offset of field: ", - stringify!(_libc_fpstate), - "::", - stringify!(__glibc_reserved1) - ) - ); +extern "C" { + pub static TCOD_lighter_fuchsia: TCOD_color_t; } -pub type fpregset_t = *mut _libc_fpstate; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mcontext_t { - pub gregs: gregset_t, - pub fpregs: fpregset_t, - pub __reserved1: [::std::os::raw::c_ulonglong; 8usize], +extern "C" { + pub static TCOD_lighter_magenta: TCOD_color_t; } -#[test] -fn bindgen_test_layout_mcontext_t() { - assert_eq!( - ::std::mem::size_of::(), - 256usize, - concat!("Size of: ", stringify!(mcontext_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mcontext_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).gregs as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mcontext_t), - "::", - stringify!(gregs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).fpregs as *const _ as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(mcontext_t), - "::", - stringify!(fpregs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__reserved1 as *const _ as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(mcontext_t), - "::", - stringify!(__reserved1) - ) - ); +extern "C" { + pub static TCOD_lighter_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_red: TCOD_color_t; } -impl Default for mcontext_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_lightest_flame: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ucontext_t { - pub uc_flags: ::std::os::raw::c_ulong, - pub uc_link: *mut ucontext_t, - pub uc_stack: stack_t, - pub uc_mcontext: mcontext_t, - pub uc_sigmask: sigset_t, - pub __fpregs_mem: _libc_fpstate, - pub __ssp: [::std::os::raw::c_ulonglong; 4usize], +extern "C" { + pub static TCOD_lightest_orange: TCOD_color_t; } -#[test] -fn bindgen_test_layout_ucontext_t() { - assert_eq!( - ::std::mem::size_of::(), - 968usize, - concat!("Size of: ", stringify!(ucontext_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ucontext_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_flags as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ucontext_t), - "::", - stringify!(uc_flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_link as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ucontext_t), - "::", - stringify!(uc_link) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_stack as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ucontext_t), - "::", - stringify!(uc_stack) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_mcontext as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ucontext_t), - "::", - stringify!(uc_mcontext) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).uc_sigmask as *const _ as usize }, - 296usize, - concat!( - "Offset of field: ", - stringify!(ucontext_t), - "::", - stringify!(uc_sigmask) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__fpregs_mem as *const _ as usize }, - 424usize, - concat!( - "Offset of field: ", - stringify!(ucontext_t), - "::", - stringify!(__fpregs_mem) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__ssp as *const _ as usize }, - 936usize, - concat!( - "Offset of field: ", - stringify!(ucontext_t), - "::", - stringify!(__ssp) - ) - ); +extern "C" { + pub static TCOD_lightest_amber: TCOD_color_t; } -impl Default for ucontext_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_lightest_yellow: TCOD_color_t; } extern "C" { - pub fn siginterrupt( - __sig: ::std::os::raw::c_int, - __interrupt: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub static TCOD_lightest_lime: TCOD_color_t; } -pub const SS_ONSTACK: _bindgen_ty_9 = _bindgen_ty_9::SS_ONSTACK; -pub const SS_DISABLE: _bindgen_ty_9 = _bindgen_ty_9::SS_DISABLE; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_9 { - SS_ONSTACK = 1, - SS_DISABLE = 2, +extern "C" { + pub static TCOD_lightest_chartreuse: TCOD_color_t; } extern "C" { - pub fn sigaltstack(__ss: *const stack_t, __oss: *mut stack_t) -> ::std::os::raw::c_int; + pub static TCOD_lightest_green: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct sigstack { - pub ss_sp: *mut ::std::os::raw::c_void, - pub ss_onstack: ::std::os::raw::c_int, +extern "C" { + pub static TCOD_lightest_sea: TCOD_color_t; } -#[test] -fn bindgen_test_layout_sigstack() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(sigstack)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigstack)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_sp as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigstack), - "::", - stringify!(ss_sp) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_onstack as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(sigstack), - "::", - stringify!(ss_onstack) - ) - ); +extern "C" { + pub static TCOD_lightest_turquoise: TCOD_color_t; } -impl Default for sigstack { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_lightest_cyan: TCOD_color_t; } extern "C" { - pub fn sigstack(__ss: *mut sigstack, __oss: *mut sigstack) -> ::std::os::raw::c_int; + pub static TCOD_lightest_sky: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_internal_list { - pub __prev: *mut __pthread_internal_list, - pub __next: *mut __pthread_internal_list, +extern "C" { + pub static TCOD_lightest_azure: TCOD_color_t; } -#[test] -fn bindgen_test_layout___pthread_internal_list() { - assert_eq!( - ::std::mem::size_of::<__pthread_internal_list>(), - 16usize, - concat!("Size of: ", stringify!(__pthread_internal_list)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_internal_list>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_internal_list)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_internal_list>())).__prev as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__prev) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_internal_list>())).__next as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__next) - ) - ); +extern "C" { + pub static TCOD_lightest_blue: TCOD_color_t; } -impl Default for __pthread_internal_list { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_lightest_han: TCOD_color_t; } -pub type __pthread_list_t = __pthread_internal_list; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_internal_slist { - pub __next: *mut __pthread_internal_slist, +extern "C" { + pub static TCOD_lightest_violet: TCOD_color_t; } -#[test] -fn bindgen_test_layout___pthread_internal_slist() { - assert_eq!( - ::std::mem::size_of::<__pthread_internal_slist>(), - 8usize, - concat!("Size of: ", stringify!(__pthread_internal_slist)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_internal_slist>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_internal_slist)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_internal_slist>())).__next as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_slist), - "::", - stringify!(__next) - ) - ); +extern "C" { + pub static TCOD_lightest_purple: TCOD_color_t; } -impl Default for __pthread_internal_slist { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_lightest_fuchsia: TCOD_color_t; } -pub type __pthread_slist_t = __pthread_internal_slist; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_mutex_s { - pub __lock: ::std::os::raw::c_int, - pub __count: ::std::os::raw::c_uint, - pub __owner: ::std::os::raw::c_int, - pub __nusers: ::std::os::raw::c_uint, - pub __kind: ::std::os::raw::c_int, - pub __spins: ::std::os::raw::c_short, - pub __elision: ::std::os::raw::c_short, - pub __list: __pthread_list_t, +extern "C" { + pub static TCOD_lightest_magenta: TCOD_color_t; } -#[test] -fn bindgen_test_layout___pthread_mutex_s() { - assert_eq!( - ::std::mem::size_of::<__pthread_mutex_s>(), - 40usize, - concat!("Size of: ", stringify!(__pthread_mutex_s)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_mutex_s>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_mutex_s)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__lock as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__lock) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__count as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__count) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__owner as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__owner) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__nusers as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__nusers) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__kind as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__kind) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__spins as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__spins) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__elision as *const _ as usize }, - 22usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__elision) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_mutex_s>())).__list as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__list) - ) - ); +extern "C" { + pub static TCOD_lightest_pink: TCOD_color_t; } -impl Default for __pthread_mutex_s { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_lightest_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_yellow: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct __pthread_rwlock_arch_t { - pub __readers: ::std::os::raw::c_uint, - pub __writers: ::std::os::raw::c_uint, - pub __wrphase_futex: ::std::os::raw::c_uint, - pub __writers_futex: ::std::os::raw::c_uint, - pub __pad3: ::std::os::raw::c_uint, - pub __pad4: ::std::os::raw::c_uint, - pub __cur_writer: ::std::os::raw::c_int, - pub __shared: ::std::os::raw::c_int, - pub __rwelision: ::std::os::raw::c_schar, - pub __pad1: [::std::os::raw::c_uchar; 7usize], - pub __pad2: ::std::os::raw::c_ulong, - pub __flags: ::std::os::raw::c_uint, +extern "C" { + pub static TCOD_desaturated_lime: TCOD_color_t; } -#[test] -fn bindgen_test_layout___pthread_rwlock_arch_t() { - assert_eq!( - ::std::mem::size_of::<__pthread_rwlock_arch_t>(), - 56usize, - concat!("Size of: ", stringify!(__pthread_rwlock_arch_t)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_rwlock_arch_t>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_rwlock_arch_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__readers as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__readers) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__writers as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__wrphase_futex as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__wrphase_futex) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__writers_futex as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers_futex) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__pad3 as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__pad4 as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__cur_writer as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__cur_writer) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__shared as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__shared) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__rwelision as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__rwelision) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__pad1 as *const _ as usize }, - 33usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__pad2 as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__flags as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__flags) - ) - ); +extern "C" { + pub static TCOD_desaturated_chartreuse: TCOD_color_t; } -#[repr(C)] -#[derive(Copy, Clone)] -pub struct __pthread_cond_s { - pub __bindgen_anon_1: __pthread_cond_s__bindgen_ty_1, - pub __bindgen_anon_2: __pthread_cond_s__bindgen_ty_2, - pub __g_refs: [::std::os::raw::c_uint; 2usize], - pub __g_size: [::std::os::raw::c_uint; 2usize], - pub __g1_orig_size: ::std::os::raw::c_uint, - pub __wrefs: ::std::os::raw::c_uint, - pub __g_signals: [::std::os::raw::c_uint; 2usize], +extern "C" { + pub static TCOD_desaturated_green: TCOD_color_t; } -#[repr(C)] -#[derive(Copy, Clone)] -pub union __pthread_cond_s__bindgen_ty_1 { - pub __wseq: ::std::os::raw::c_ulonglong, - pub __wseq32: __pthread_cond_s__bindgen_ty_1__bindgen_ty_1, - _bindgen_union_align: u64, +extern "C" { + pub static TCOD_desaturated_sea: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct __pthread_cond_s__bindgen_ty_1__bindgen_ty_1 { - pub __low: ::std::os::raw::c_uint, - pub __high: ::std::os::raw::c_uint, +extern "C" { + pub static TCOD_desaturated_turquoise: TCOD_color_t; } -#[test] -fn bindgen_test_layout___pthread_cond_s__bindgen_ty_1__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>(), - 8usize, - concat!( - "Size of: ", - stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>(), - 4usize, - concat!( - "Alignment of ", - stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>())).__low - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(__low) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>())).__high - as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(__high) - ) - ); +extern "C" { + pub static TCOD_desaturated_cyan: TCOD_color_t; } -#[test] -fn bindgen_test_layout___pthread_cond_s__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_1>(), - 8usize, - concat!("Size of: ", stringify!(__pthread_cond_s__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_1>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s__bindgen_ty_1)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_1>())).__wseq as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_1), - "::", - stringify!(__wseq) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_1>())).__wseq32 as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_1), - "::", - stringify!(__wseq32) - ) - ); +extern "C" { + pub static TCOD_desaturated_sky: TCOD_color_t; } -impl Default for __pthread_cond_s__bindgen_ty_1 { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_desaturated_azure: TCOD_color_t; } -#[repr(C)] -#[derive(Copy, Clone)] -pub union __pthread_cond_s__bindgen_ty_2 { - pub __g1_start: ::std::os::raw::c_ulonglong, - pub __g1_start32: __pthread_cond_s__bindgen_ty_2__bindgen_ty_1, - _bindgen_union_align: u64, +extern "C" { + pub static TCOD_desaturated_blue: TCOD_color_t; } -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct __pthread_cond_s__bindgen_ty_2__bindgen_ty_1 { - pub __low: ::std::os::raw::c_uint, - pub __high: ::std::os::raw::c_uint, +extern "C" { + pub static TCOD_desaturated_han: TCOD_color_t; } -#[test] -fn bindgen_test_layout___pthread_cond_s__bindgen_ty_2__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>(), - 8usize, - concat!( - "Size of: ", - stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>(), - 4usize, - concat!( - "Alignment of ", - stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>())).__low - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1), - "::", - stringify!(__low) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>())).__high - as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1), - "::", - stringify!(__high) - ) - ); +extern "C" { + pub static TCOD_desaturated_violet: TCOD_color_t; } -#[test] -fn bindgen_test_layout___pthread_cond_s__bindgen_ty_2() { - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_2>(), - 8usize, - concat!("Size of: ", stringify!(__pthread_cond_s__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_2>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s__bindgen_ty_2)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_2>())).__g1_start as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_2), - "::", - stringify!(__g1_start) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_2>())).__g1_start32 as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_2), - "::", - stringify!(__g1_start32) - ) - ); +extern "C" { + pub static TCOD_desaturated_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_fuchsia: TCOD_color_t; } -impl Default for __pthread_cond_s__bindgen_ty_2 { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_desaturated_magenta: TCOD_color_t; } -#[test] -fn bindgen_test_layout___pthread_cond_s() { - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s>(), - 48usize, - concat!("Size of: ", stringify!(__pthread_cond_s)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_cond_s>())).__g_refs as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_refs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_cond_s>())).__g_size as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_cond_s>())).__g1_orig_size as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g1_orig_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_cond_s>())).__wrefs as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__wrefs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__pthread_cond_s>())).__g_signals as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_signals) - ) - ); +extern "C" { + pub static TCOD_desaturated_pink: TCOD_color_t; } -impl Default for __pthread_cond_s { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_desaturated_crimson: TCOD_color_t; } -pub type pthread_t = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutexattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, - _bindgen_union_align: u32, +extern "C" { + pub static TCOD_brass: TCOD_color_t; } -#[test] -fn bindgen_test_layout_pthread_mutexattr_t() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_mutexattr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_mutexattr_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__align) - ) - ); +extern "C" { + pub static TCOD_copper: TCOD_color_t; } -impl Default for pthread_mutexattr_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_gold: TCOD_color_t; } -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_condattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, - _bindgen_union_align: u32, +extern "C" { + pub static TCOD_silver: TCOD_color_t; } -#[test] -fn bindgen_test_layout_pthread_condattr_t() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_condattr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_condattr_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__align) - ) - ); +extern "C" { + pub static TCOD_celadon: TCOD_color_t; } -impl Default for pthread_condattr_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub static TCOD_peach: TCOD_color_t; } -pub type pthread_key_t = ::std::os::raw::c_uint; -pub type pthread_once_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_attr_t { - pub __size: [::std::os::raw::c_char; 56usize], - pub __align: ::std::os::raw::c_long, - _bindgen_union_align: [u64; 7usize], +#[repr(i32)] +#[doc = " An enum of libtcod error codes."] +#[doc = ""] +#[doc = " On values other than `TCOD_E_OK` you can use `TCOD_get_error()` to learn"] +#[doc = " more information."] +#[doc = " \\rst"] +#[doc = " .. versionadded:: 1.16"] +#[doc = " \\endrst"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_Error { + #[doc = " The function completed successfully without issues."] + #[doc = ""] + #[doc = " A function is successful when `(err >= 0)`. Positive values may be used"] + #[doc = " for warnings, or for other outputs."] + TCOD_E_OK = 0, + #[doc = " The error code for generic runtime errors."] + #[doc = ""] + #[doc = " The returned code my be changed in the future to something more specific."] + #[doc = " Use `(err < 0)` to check if the value is an error."] + TCOD_E_ERROR = -1, + #[doc = " The function failed because a given input argument was invalid."] + TCOD_E_INVALID_ARGUMENT = -2, + #[doc = " The function failed because it was unable to allocate enough memory."] + TCOD_E_OUT_OF_MEMORY = -3, + #[doc = " The function completed, but a minor issue was detected."] + TCOD_E_WARN = 1, +} +extern "C" { + #[doc = " Return the last error message. If there is no error then the string will"] + #[doc = " have a length of zero."] + #[doc = ""] + #[doc = " The error state is thread specific."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.12"] + #[doc = " \\endrst"] + pub fn TCOD_get_error() -> *const ::std::os::raw::c_char; } -#[test] -fn bindgen_test_layout_pthread_attr_t() { - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(pthread_attr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_attr_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__align) - ) - ); +extern "C" { + #[doc = " Set an error message and return TCOD_E_ERROR."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.12"] + #[doc = " \\endrst"] + pub fn TCOD_set_error(msg: *const ::std::os::raw::c_char) -> TCOD_Error; } -impl Default for pthread_attr_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + #[doc = " Set an error message and return TCOD_E_ERROR."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_set_errorf(fmt: *const ::std::os::raw::c_char, ...) -> TCOD_Error; +} +extern "C" { + #[doc = " Clear a current existing error message."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_clear_error(); } #[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutex_t { - pub __data: __pthread_mutex_s, - pub __size: [::std::os::raw::c_char; 40usize], - pub __align: ::std::os::raw::c_long, - _bindgen_union_align: [u64; 5usize], +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetObserver { + pub tileset: *mut TCOD_Tileset, + pub next: *mut TCOD_TilesetObserver, + pub userdata: *mut ::std::os::raw::c_void, + pub on_observer_delete: + ::std::option::Option, + pub on_tile_changed: ::std::option::Option< + unsafe extern "C" fn( + observer: *mut TCOD_TilesetObserver, + tile_id: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, } #[test] -fn bindgen_test_layout_pthread_mutex_t() { +fn bindgen_test_layout_TCOD_TilesetObserver() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 40usize, - concat!("Size of: ", stringify!(pthread_mutex_t)) + concat!("Size of: ", stringify!(TCOD_TilesetObserver)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__data as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__data) - ) + concat!("Alignment of ", stringify!(TCOD_TilesetObserver)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pthread_mutex_t), + stringify!(TCOD_TilesetObserver), "::", - stringify!(__size) + stringify!(tileset) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(pthread_mutex_t), + stringify!(TCOD_TilesetObserver), "::", - stringify!(__align) + stringify!(next) ) ); -} -impl Default for pthread_mutex_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_cond_t { - pub __data: __pthread_cond_s, - pub __size: [::std::os::raw::c_char; 48usize], - pub __align: ::std::os::raw::c_longlong, - _bindgen_union_align: [u64; 6usize], -} -#[test] -fn bindgen_test_layout_pthread_cond_t() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(pthread_cond_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_cond_t)) - ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__data as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).userdata as *const _ as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(pthread_cond_t), + stringify!(TCOD_TilesetObserver), "::", - stringify!(__data) + stringify!(userdata) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).on_observer_delete as *const _ as usize + }, + 24usize, concat!( "Offset of field: ", - stringify!(pthread_cond_t), + stringify!(TCOD_TilesetObserver), "::", - stringify!(__size) + stringify!(on_observer_delete) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).on_tile_changed as *const _ as usize + }, + 32usize, concat!( "Offset of field: ", - stringify!(pthread_cond_t), + stringify!(TCOD_TilesetObserver), "::", - stringify!(__align) + stringify!(on_tile_changed) ) ); } -impl Default for pthread_cond_t { +impl Default for TCOD_TilesetObserver { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_rwlock_t { - pub __data: __pthread_rwlock_arch_t, - pub __size: [::std::os::raw::c_char; 56usize], - pub __align: ::std::os::raw::c_long, - _bindgen_union_align: [u64; 7usize], +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Tileset { + pub tile_width: ::std::os::raw::c_int, + pub tile_height: ::std::os::raw::c_int, + pub tile_length: ::std::os::raw::c_int, + pub tiles_capacity: ::std::os::raw::c_int, + pub tiles_count: ::std::os::raw::c_int, + pub pixels: *mut TCOD_ColorRGBA, + pub character_map_length: ::std::os::raw::c_int, + pub character_map: *mut ::std::os::raw::c_int, + pub observer_list: *mut TCOD_TilesetObserver, + pub virtual_columns: ::std::os::raw::c_int, + pub ref_count: ::std::os::raw::c_int, } #[test] -fn bindgen_test_layout_pthread_rwlock_t() { +fn bindgen_test_layout_TCOD_Tileset() { assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(pthread_rwlock_t)) + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(TCOD_Tileset)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_rwlock_t)) + concat!("Alignment of ", stringify!(TCOD_Tileset)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__data as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).tile_width as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(pthread_rwlock_t), + stringify!(TCOD_Tileset), "::", - stringify!(__data) + stringify!(tile_width) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).tile_height as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(pthread_rwlock_t), + stringify!(TCOD_Tileset), "::", - stringify!(__size) + stringify!(tile_height) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).tile_length as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(pthread_rwlock_t), + stringify!(TCOD_Tileset), "::", - stringify!(__align) + stringify!(tile_length) ) ); -} -impl Default for pthread_rwlock_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_rwlockattr_t { - pub __size: [::std::os::raw::c_char; 8usize], - pub __align: ::std::os::raw::c_long, - _bindgen_union_align: u64, -} -#[test] -fn bindgen_test_layout_pthread_rwlockattr_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pthread_rwlockattr_t)) - ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_rwlockattr_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).tiles_capacity as *const _ as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(pthread_rwlockattr_t), + stringify!(TCOD_Tileset), "::", - stringify!(__size) + stringify!(tiles_capacity) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).tiles_count as *const _ as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(pthread_rwlockattr_t), + stringify!(TCOD_Tileset), "::", - stringify!(__align) + stringify!(tiles_count) ) ); -} -impl Default for pthread_rwlockattr_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type pthread_spinlock_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_barrier_t { - pub __size: [::std::os::raw::c_char; 32usize], - pub __align: ::std::os::raw::c_long, - _bindgen_union_align: [u64; 4usize], -} -#[test] -fn bindgen_test_layout_pthread_barrier_t() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_barrier_t)) - ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).pixels as *const _ as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(pthread_barrier_t), + stringify!(TCOD_Tileset), "::", - stringify!(__size) + stringify!(pixels) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).character_map_length as *const _ as usize + }, + 32usize, concat!( "Offset of field: ", - stringify!(pthread_barrier_t), + stringify!(TCOD_Tileset), "::", - stringify!(__align) + stringify!(character_map_length) ) ); -} -impl Default for pthread_barrier_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_barrierattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, - _bindgen_union_align: u32, -} -#[test] -fn bindgen_test_layout_pthread_barrierattr_t() { assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_barrierattr_t)) + unsafe { &(*(::std::ptr::null::())).character_map as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(character_map) + ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_barrierattr_t)) + unsafe { &(*(::std::ptr::null::())).observer_list as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(observer_list) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).virtual_columns as *const _ as usize }, + 56usize, concat!( "Offset of field: ", - stringify!(pthread_barrierattr_t), + stringify!(TCOD_Tileset), "::", - stringify!(__size) + stringify!(virtual_columns) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).ref_count as *const _ as usize }, + 60usize, concat!( "Offset of field: ", - stringify!(pthread_barrierattr_t), + stringify!(TCOD_Tileset), "::", - stringify!(__align) + stringify!(ref_count) ) ); } -impl Default for pthread_barrierattr_t { +impl Default for TCOD_Tileset { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } extern "C" { - pub fn pthread_sigmask( - __how: ::std::os::raw::c_int, - __newmask: *const __sigset_t, - __oldmask: *mut __sigset_t, - ) -> ::std::os::raw::c_int; + #[doc = " Create a new tile-set with the given tile size."] + pub fn TCOD_tileset_new( + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; } extern "C" { - pub fn pthread_kill( - __threadid: pthread_t, - __signo: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + #[doc = " Delete a tile-set."] + pub fn TCOD_tileset_delete(tileset: *mut TCOD_Tileset); } extern "C" { - pub fn __libc_current_sigrtmin() -> ::std::os::raw::c_int; + #[doc = " Return the pixel width of tiles in this tileset."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_width_(tileset: *const TCOD_Tileset) -> ::std::os::raw::c_int; } extern "C" { - pub fn __libc_current_sigrtmax() -> ::std::os::raw::c_int; + #[doc = " Return the pixel height of tiles in this tileset."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_height_(tileset: *const TCOD_Tileset) -> ::std::os::raw::c_int; } -pub type int_least8_t = __int_least8_t; -pub type int_least16_t = __int_least16_t; -pub type int_least32_t = __int_least32_t; -pub type int_least64_t = __int_least64_t; -pub type uint_least8_t = __uint_least8_t; -pub type uint_least16_t = __uint_least16_t; -pub type uint_least32_t = __uint_least32_t; -pub type uint_least64_t = __uint_least64_t; -pub type int_fast8_t = ::std::os::raw::c_schar; -pub type int_fast16_t = ::std::os::raw::c_long; -pub type int_fast32_t = ::std::os::raw::c_long; -pub type int_fast64_t = ::std::os::raw::c_long; -pub type uint_fast8_t = ::std::os::raw::c_uchar; -pub type uint_fast16_t = ::std::os::raw::c_ulong; -pub type uint_fast32_t = ::std::os::raw::c_ulong; -pub type uint_fast64_t = ::std::os::raw::c_ulong; -pub type intmax_t = __intmax_t; -pub type uintmax_t = __uintmax_t; extern "C" { - pub fn TCOD_strdup(s: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; + #[doc = " Fetch a tile, outputting its data to a pixel buffer."] + #[doc = ""] + #[doc = " `codepoint` is the index for the tile. Unicode is recommend."] + #[doc = ""] + #[doc = " `buffer` is a pointer to a contiguous row-major array of pixels. The tile"] + #[doc = " data will be outputted here. This pointer can be NULL if you only want to"] + #[doc = " know if the tileset has a specific tile."] + #[doc = ""] + #[doc = " Returns 0 if the tile exists. Returns a negative value on an error or if"] + #[doc = " the tileset does not have a tile for this codepoint."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_( + tileset: *const TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + buffer: *mut TCOD_ColorRGBA, + ) -> TCOD_Error; } extern "C" { - pub fn TCOD_strcasecmp( - s1: *const ::std::os::raw::c_char, - s2: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; + #[doc = " Upload a tile from a pixel buffer into this tileset."] + #[doc = ""] + #[doc = " `codepoint` is the index for the tile. Unicode is recommend."] + #[doc = ""] + #[doc = " `buffer` is a pointer to a contiguous row-major array of pixels."] + #[doc = " This can not be NULL."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_set_tile_( + tileset: *mut TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + buffer: *const TCOD_ColorRGBA, + ) -> TCOD_Error; } extern "C" { - pub fn TCOD_strncasecmp( - s1: *const ::std::os::raw::c_char, - s2: *const ::std::os::raw::c_char, - n: size_t, + #[doc = " Load a font from a tilesheet."] + pub fn TCOD_tileset_load( + filename: *const ::std::os::raw::c_char, + columns: ::std::os::raw::c_int, + rows: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + charmap: *mut ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Assign a codepoint to an existing tile based on its tile ID."] + #[doc = ""] + #[doc = " Returns the tile ID on success."] + #[doc = ""] + #[doc = " Returns a negative value on error."] + pub fn TCOD_tileset_assign_tile( + tileset: *mut TCOD_Tileset, + tile_id: ::std::os::raw::c_int, + codepoint: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -#[doc = " \\brief A callback to be passed to TCOD_line"] -#[doc = ""] -#[doc = " The points given to the callback include both the starting and ending"] -#[doc = " positions."] -#[doc = ""] -#[doc = " \\param x"] -#[doc = " \\param y"] -#[doc = " \\return As long as this callback returns true it will be called with the"] -#[doc = " next x,y point on the line."] -pub type TCOD_line_listener_t = ::std::option::Option< - unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> bool, ->; extern "C" { - pub fn TCOD_line_init( - xFrom: ::std::os::raw::c_int, - yFrom: ::std::os::raw::c_int, - xTo: ::std::os::raw::c_int, - yTo: ::std::os::raw::c_int, - ); + #[doc = " Return a pointer to the tile for `codepoint`."] + #[doc = ""] + #[doc = " Returns NULL if no tile exists for codepoint."] + pub fn TCOD_tileset_get_tile( + tileset: *const TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + ) -> *const TCOD_ColorRGBA; } extern "C" { - pub fn TCOD_line_step( - xCur: *mut ::std::os::raw::c_int, - yCur: *mut ::std::os::raw::c_int, - ) -> bool; + #[doc = " Return a new observer to this tileset."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_observer_new(tileset: *mut TCOD_Tileset) -> *mut TCOD_TilesetObserver; } extern "C" { - pub fn TCOD_line( - xFrom: ::std::os::raw::c_int, - yFrom: ::std::os::raw::c_int, - xTo: ::std::os::raw::c_int, - yTo: ::std::os::raw::c_int, - listener: TCOD_line_listener_t, - ) -> bool; + #[doc = " Delete an existing observer."] + #[doc = ""] + #[doc = " Will call this observers on_observer_delete callback."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_observer_delete(observer: *mut TCOD_TilesetObserver); } -#[doc = " \\brief A struct used for computing a bresenham line."] +extern "C" { + #[doc = " Called to notify any observers that a tile has been changed. This may"] + #[doc = " cause running atlases to update or mark cache consoles as dirty."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_notify_tile_changed( + tileset: *mut TCOD_Tileset, + tile_id: ::std::os::raw::c_int, + ); +} +extern "C" { + #[doc = " Reserve memory for a specific amount of tiles."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_reserve( + tileset: *mut TCOD_Tileset, + desired: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +#[repr(u32)] +#[doc = " \\enum TCOD_bkgnd_flag_t"] +#[doc = ""] +#[doc = " Background color blend modes."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_bkgnd_flag_t { + TCOD_BKGND_NONE = 0, + TCOD_BKGND_SET = 1, + TCOD_BKGND_MULTIPLY = 2, + TCOD_BKGND_LIGHTEN = 3, + TCOD_BKGND_DARKEN = 4, + TCOD_BKGND_SCREEN = 5, + TCOD_BKGND_COLOR_DODGE = 6, + TCOD_BKGND_COLOR_BURN = 7, + TCOD_BKGND_ADD = 8, + TCOD_BKGND_ADDA = 9, + TCOD_BKGND_BURN = 10, + TCOD_BKGND_OVERLAY = 11, + TCOD_BKGND_ALPH = 12, + TCOD_BKGND_DEFAULT = 13, +} +#[repr(u32)] +#[doc = " \\enum TCOD_alignment_t"] +#[doc = ""] +#[doc = " Print justification options."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_alignment_t { + TCOD_LEFT = 0, + TCOD_RIGHT = 1, + TCOD_CENTER = 2, +} +#[doc = " A console tile."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct TCOD_bresenham_data_t { - pub stepx: ::std::os::raw::c_int, - pub stepy: ::std::os::raw::c_int, - pub e: ::std::os::raw::c_int, - pub deltax: ::std::os::raw::c_int, - pub deltay: ::std::os::raw::c_int, - pub origx: ::std::os::raw::c_int, - pub origy: ::std::os::raw::c_int, - pub destx: ::std::os::raw::c_int, - pub desty: ::std::os::raw::c_int, +pub struct TCOD_ConsoleTile { + #[doc = " The Unicode codepoint for this tile."] + pub ch: ::std::os::raw::c_int, + #[doc = " The tile glyph color, rendered on top of the background."] + pub fg: TCOD_ColorRGBA, + #[doc = " The tile background color, rendered behind the glyph."] + pub bg: TCOD_ColorRGBA, } #[test] -fn bindgen_test_layout_TCOD_bresenham_data_t() { +fn bindgen_test_layout_TCOD_ConsoleTile() { assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(TCOD_bresenham_data_t)) + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(TCOD_ConsoleTile)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TCOD_bresenham_data_t)) + concat!("Alignment of ", stringify!(TCOD_ConsoleTile)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stepx as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).ch as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_bresenham_data_t), + stringify!(TCOD_ConsoleTile), "::", - stringify!(stepx) + stringify!(ch) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stepy as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).fg as *const _ as usize }, 4usize, concat!( "Offset of field: ", - stringify!(TCOD_bresenham_data_t), + stringify!(TCOD_ConsoleTile), "::", - stringify!(stepy) + stringify!(fg) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).e as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).bg as *const _ as usize }, 8usize, concat!( "Offset of field: ", - stringify!(TCOD_bresenham_data_t), - "::", - stringify!(e) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).deltax as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(TCOD_bresenham_data_t), + stringify!(TCOD_ConsoleTile), "::", - stringify!(deltax) + stringify!(bg) ) ); +} +#[doc = " The libtcod console struct."] +#[doc = ""] +#[doc = " All attributes should be considered private."] +#[doc = ""] +#[doc = " All C++ methods should be considered provisional, and are subject to"] +#[doc = " change."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Console { + #[doc = " Console width and height (in characters, not pixels.)"] + pub w: ::std::os::raw::c_int, + #[doc = " Console width and height (in characters, not pixels.)"] + pub h: ::std::os::raw::c_int, + #[doc = " A contiguous array of console tiles."] + pub tiles: *mut TCOD_ConsoleTile, + #[doc = " Default background operator for print & print_rect functions."] + pub bkgnd_flag: TCOD_bkgnd_flag_t, + #[doc = " Default alignment for print & print_rect functions."] + pub alignment: TCOD_alignment_t, + #[doc = " Foreground (text) and background colors."] + pub fore: TCOD_color_t, + #[doc = " Foreground (text) and background colors."] + pub back: TCOD_color_t, + #[doc = " True if a key color is being used."] + pub has_key_color: bool, + #[doc = " The current key color for this console."] + pub key_color: TCOD_color_t, + #[doc = "The total length of the tiles array. Same as `w * h`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub elements: ::std::os::raw::c_int, + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub userdata: *mut ::std::os::raw::c_void, + #[doc = " Internal use."] + pub on_delete: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_TCOD_Console() { assert_eq!( - unsafe { &(*(::std::ptr::null::())).deltay as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(TCOD_bresenham_data_t), - "::", - stringify!(deltay) - ) + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(TCOD_Console)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).origx as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(TCOD_bresenham_data_t), - "::", - stringify!(origx) - ) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Console)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).origy as *const _ as usize }, - 24usize, + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_bresenham_data_t), + stringify!(TCOD_Console), "::", - stringify!(origy) + stringify!(w) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).destx as *const _ as usize }, - 28usize, + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(TCOD_bresenham_data_t), + stringify!(TCOD_Console), "::", - stringify!(destx) + stringify!(h) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).desty as *const _ as usize }, - 32usize, + unsafe { &(*(::std::ptr::null::())).tiles as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(TCOD_bresenham_data_t), - "::", - stringify!(desty) - ) - ); -} -extern "C" { - pub fn TCOD_line_init_mt( - xFrom: ::std::os::raw::c_int, - yFrom: ::std::os::raw::c_int, - xTo: ::std::os::raw::c_int, - yTo: ::std::os::raw::c_int, - data: *mut TCOD_bresenham_data_t, - ); -} -extern "C" { - pub fn TCOD_line_step_mt( - xCur: *mut ::std::os::raw::c_int, - yCur: *mut ::std::os::raw::c_int, - data: *mut TCOD_bresenham_data_t, - ) -> bool; -} -extern "C" { - pub fn TCOD_line_mt( - xFrom: ::std::os::raw::c_int, - yFrom: ::std::os::raw::c_int, - xTo: ::std::os::raw::c_int, - yTo: ::std::os::raw::c_int, - listener: TCOD_line_listener_t, - data: *mut TCOD_bresenham_data_t, - ) -> bool; -} -pub type TCOD_random_t = *mut ::std::os::raw::c_void; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct TCOD_dice_t { - pub nb_rolls: ::std::os::raw::c_int, - pub nb_faces: ::std::os::raw::c_int, - pub multiplier: f32, - pub addsub: f32, -} -#[test] -fn bindgen_test_layout_TCOD_dice_t() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(TCOD_dice_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(TCOD_dice_t)) + stringify!(TCOD_Console), + "::", + stringify!(tiles) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).nb_rolls as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).bkgnd_flag as *const _ as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(TCOD_dice_t), + stringify!(TCOD_Console), "::", - stringify!(nb_rolls) + stringify!(bkgnd_flag) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).nb_faces as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).alignment as *const _ as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(TCOD_dice_t), + stringify!(TCOD_Console), "::", - stringify!(nb_faces) + stringify!(alignment) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).multiplier as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).fore as *const _ as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(TCOD_dice_t), + stringify!(TCOD_Console), "::", - stringify!(multiplier) + stringify!(fore) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).addsub as *const _ as usize }, - 12usize, + unsafe { &(*(::std::ptr::null::())).back as *const _ as usize }, + 27usize, concat!( "Offset of field: ", - stringify!(TCOD_dice_t), + stringify!(TCOD_Console), "::", - stringify!(addsub) + stringify!(back) ) ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_random_algo_t { - TCOD_RNG_MT = 0, - TCOD_RNG_CMWC = 1, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_distribution_t { - TCOD_DISTRIBUTION_LINEAR = 0, - TCOD_DISTRIBUTION_GAUSSIAN = 1, - TCOD_DISTRIBUTION_GAUSSIAN_RANGE = 2, - TCOD_DISTRIBUTION_GAUSSIAN_INVERSE = 3, - TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE = 4, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _TCOD_tree_t { - pub next: *mut _TCOD_tree_t, - pub father: *mut _TCOD_tree_t, - pub sons: *mut _TCOD_tree_t, -} -#[test] -fn bindgen_test_layout__TCOD_tree_t() { assert_eq!( - ::std::mem::size_of::<_TCOD_tree_t>(), - 24usize, - concat!("Size of: ", stringify!(_TCOD_tree_t)) + unsafe { &(*(::std::ptr::null::())).has_key_color as *const _ as usize }, + 30usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(has_key_color) + ) ); assert_eq!( - ::std::mem::align_of::<_TCOD_tree_t>(), - 8usize, - concat!("Alignment of ", stringify!(_TCOD_tree_t)) + unsafe { &(*(::std::ptr::null::())).key_color as *const _ as usize }, + 31usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(key_color) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).next as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).elements as *const _ as usize }, + 36usize, concat!( "Offset of field: ", - stringify!(_TCOD_tree_t), + stringify!(TCOD_Console), "::", - stringify!(next) + stringify!(elements) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).father as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).userdata as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(_TCOD_tree_t), + stringify!(TCOD_Console), "::", - stringify!(father) + stringify!(userdata) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).sons as *const _ as usize }, - 16usize, + unsafe { &(*(::std::ptr::null::())).on_delete as *const _ as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(_TCOD_tree_t), + stringify!(TCOD_Console), "::", - stringify!(sons) + stringify!(on_delete) ) ); } -impl Default for _TCOD_tree_t { +impl Default for TCOD_Console { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } -pub type TCOD_tree_t = _TCOD_tree_t; +pub type TCOD_console_t = *mut TCOD_Console; extern "C" { - pub fn TCOD_tree_new() -> *mut TCOD_tree_t; + #[doc = " Return a new console with a specific number of columns and rows."] + #[doc = ""] + #[doc = " \\param w Number of columns."] + #[doc = " \\param h Number of columns."] + #[doc = " \\return A pointer to the new console, or NULL on error."] + pub fn TCOD_console_new( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_Console; } extern "C" { - pub fn TCOD_tree_add_son(node: *mut TCOD_tree_t, son: *mut TCOD_tree_t); + #[doc = " Return the width of a console."] + pub fn TCOD_console_get_width(con: *const TCOD_Console) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return the height of a console."] + pub fn TCOD_console_get_height(con: *const TCOD_Console) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_set_key_color(con: *mut TCOD_Console, col: TCOD_color_t); +} +extern "C" { + #[doc = " Blit from one console to another."] + #[doc = ""] + #[doc = " \\param srcCon Pointer to the source console."] + #[doc = " \\param xSrc The left region of the source console to blit from."] + #[doc = " \\param ySrc The top region of the source console to blit from."] + #[doc = " \\param wSrc The width of the region to blit from."] + #[doc = " If 0 then it will fill to the maximum width."] + #[doc = " \\param hSrc The height of the region to blit from."] + #[doc = " If 0 then it will fill to the maximum height."] + #[doc = " \\param dstCon Pointer to the destination console."] + #[doc = " \\param xDst The left corner to blit onto the destination console."] + #[doc = " \\param yDst The top corner to blit onto the destination console."] + #[doc = " \\param foreground_alpha Foreground blending alpha."] + #[doc = " \\param background_alpha Background blending alpha."] + #[doc = ""] + #[doc = " If the source console has a key color, this function will use it."] + #[doc = " \\rst"] + #[doc = " .. versionchanged:: 1.16"] + #[doc = " Blits can now handle per-cell alpha transparency."] + #[doc = " \\endrst"] + pub fn TCOD_console_blit( + src: *const TCOD_Console, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + dst: *mut TCOD_Console, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + foreground_alpha: f32, + background_alpha: f32, + ); +} +extern "C" { + pub fn TCOD_console_blit_key_color( + src: *const TCOD_Console, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + dst: *mut TCOD_Console, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + foreground_alpha: f32, + background_alpha: f32, + key_color: *const TCOD_color_t, + ); +} +extern "C" { + #[doc = " Delete a console."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = ""] + #[doc = " If the console being deleted is the root console, then the display will be"] + #[doc = " uninitialized."] + pub fn TCOD_console_delete(console: *mut TCOD_Console); +} +extern "C" { + pub fn TCOD_console_set_default_background(con: *mut TCOD_Console, col: TCOD_color_t); +} +extern "C" { + pub fn TCOD_console_set_default_foreground(con: *mut TCOD_Console, col: TCOD_color_t); +} +extern "C" { + #[doc = " Clear a console to its default colors and the space character code."] + pub fn TCOD_console_clear(con: *mut TCOD_Console); +} +extern "C" { + #[doc = " Blend a background color onto a console tile."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param col The background color to blend."] + #[doc = " \\param flag The blend mode to use."] + pub fn TCOD_console_set_char_background( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Change the foreground color of a console tile."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param col The foreground color to set."] + pub fn TCOD_console_set_char_foreground( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); +} +extern "C" { + #[doc = " Change a character on a console tile, without changing its colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to set."] + pub fn TCOD_console_set_char( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + ); +} +extern "C" { + #[doc = " Draw a character on a console using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to place."] + #[doc = " \\param flag A TCOD_bkgnd_flag_t flag."] + pub fn TCOD_console_put_char( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a character on the console with the given colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to place."] + #[doc = " \\param fore The foreground color."] + #[doc = " \\param back The background color. This color will not be blended."] + pub fn TCOD_console_put_char_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + fore: TCOD_color_t, + back: TCOD_color_t, + ); +} +extern "C" { + #[doc = " Set a consoles default background flag."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param flag One of `TCOD_bkgnd_flag_t`."] + pub fn TCOD_console_set_background_flag(con: *mut TCOD_Console, flag: TCOD_bkgnd_flag_t); +} +extern "C" { + #[doc = " Return a consoles default background flag."] + pub fn TCOD_console_get_background_flag(con: *mut TCOD_Console) -> TCOD_bkgnd_flag_t; +} +extern "C" { + #[doc = " Set a consoles default alignment."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param alignment One of TCOD_alignment_t"] + pub fn TCOD_console_set_alignment(con: *mut TCOD_Console, alignment: TCOD_alignment_t); +} +extern "C" { + #[doc = " Return a consoles default alignment."] + pub fn TCOD_console_get_alignment(con: *mut TCOD_Console) -> TCOD_alignment_t; +} +extern "C" { + pub fn TCOD_console_get_default_background(con: *mut TCOD_Console) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_get_default_foreground(con: *mut TCOD_Console) -> TCOD_color_t; +} +extern "C" { + #[doc = " Return the background color of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return A TCOD_color_t struct with a copy of the background color."] + pub fn TCOD_console_get_char_background( + con: *const TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + #[doc = " Return the foreground color of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return A TCOD_color_t struct with a copy of the foreground color."] + pub fn TCOD_console_get_char_foreground( + con: *const TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + #[doc = " Return a character code of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return The character code."] + pub fn TCOD_console_get_char( + con: *const TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Fade the color of the display."] + #[doc = ""] + #[doc = " \\param val Where at 255 colors are normal and at 0 colors are completely"] + #[doc = " faded."] + #[doc = " \\param fadecol Color to fade towards."] + pub fn TCOD_console_set_fade(val: u8, fade: TCOD_color_t); +} +extern "C" { + #[doc = " Return the fade value."] + #[doc = ""] + #[doc = " \\return At 255 colors are normal and at 0 colors are completely faded."] + pub fn TCOD_console_get_fade() -> u8; +} +extern "C" { + #[doc = " Return the fade color."] + #[doc = ""] + #[doc = " \\return The current fading color."] + pub fn TCOD_console_get_fading_color() -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_resize_( + console: *mut TCOD_Console, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_keycode_t { + TCODK_NONE = 0, + TCODK_ESCAPE = 1, + TCODK_BACKSPACE = 2, + TCODK_TAB = 3, + TCODK_ENTER = 4, + TCODK_SHIFT = 5, + TCODK_CONTROL = 6, + TCODK_ALT = 7, + TCODK_PAUSE = 8, + TCODK_CAPSLOCK = 9, + TCODK_PAGEUP = 10, + TCODK_PAGEDOWN = 11, + TCODK_END = 12, + TCODK_HOME = 13, + TCODK_UP = 14, + TCODK_LEFT = 15, + TCODK_RIGHT = 16, + TCODK_DOWN = 17, + TCODK_PRINTSCREEN = 18, + TCODK_INSERT = 19, + TCODK_DELETE = 20, + TCODK_LWIN = 21, + TCODK_RWIN = 22, + TCODK_APPS = 23, + TCODK_0 = 24, + TCODK_1 = 25, + TCODK_2 = 26, + TCODK_3 = 27, + TCODK_4 = 28, + TCODK_5 = 29, + TCODK_6 = 30, + TCODK_7 = 31, + TCODK_8 = 32, + TCODK_9 = 33, + TCODK_KP0 = 34, + TCODK_KP1 = 35, + TCODK_KP2 = 36, + TCODK_KP3 = 37, + TCODK_KP4 = 38, + TCODK_KP5 = 39, + TCODK_KP6 = 40, + TCODK_KP7 = 41, + TCODK_KP8 = 42, + TCODK_KP9 = 43, + TCODK_KPADD = 44, + TCODK_KPSUB = 45, + TCODK_KPDIV = 46, + TCODK_KPMUL = 47, + TCODK_KPDEC = 48, + TCODK_KPENTER = 49, + TCODK_F1 = 50, + TCODK_F2 = 51, + TCODK_F3 = 52, + TCODK_F4 = 53, + TCODK_F5 = 54, + TCODK_F6 = 55, + TCODK_F7 = 56, + TCODK_F8 = 57, + TCODK_F9 = 58, + TCODK_F10 = 59, + TCODK_F11 = 60, + TCODK_F12 = 61, + TCODK_NUMLOCK = 62, + TCODK_SCROLLLOCK = 63, + TCODK_SPACE = 64, + TCODK_CHAR = 65, + TCODK_TEXT = 66, } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct TCOD_bsp_t { - pub tree: TCOD_tree_t, - pub x: ::std::os::raw::c_int, - pub y: ::std::os::raw::c_int, - pub w: ::std::os::raw::c_int, - pub h: ::std::os::raw::c_int, - pub position: ::std::os::raw::c_int, - pub level: u8, - pub horizontal: bool, +pub struct TCOD_key_t { + pub vk: TCOD_keycode_t, + pub c: ::std::os::raw::c_char, + pub text: [::std::os::raw::c_char; 32usize], + pub pressed: bool, + pub lalt: bool, + pub lctrl: bool, + pub lmeta: bool, + pub ralt: bool, + pub rctrl: bool, + pub rmeta: bool, + pub shift: bool, } #[test] -fn bindgen_test_layout_TCOD_bsp_t() { +fn bindgen_test_layout_TCOD_key_t() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 48usize, - concat!("Size of: ", stringify!(TCOD_bsp_t)) + concat!("Size of: ", stringify!(TCOD_key_t)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(TCOD_bsp_t)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_key_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tree as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).vk as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_bsp_t), - "::", - stringify!(tree) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(TCOD_bsp_t), + stringify!(TCOD_key_t), "::", - stringify!(x) + stringify!(vk) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 28usize, + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(TCOD_bsp_t), + stringify!(TCOD_key_t), "::", - stringify!(y) + stringify!(c) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, - 32usize, + unsafe { &(*(::std::ptr::null::())).text as *const _ as usize }, + 5usize, concat!( "Offset of field: ", - stringify!(TCOD_bsp_t), + stringify!(TCOD_key_t), "::", - stringify!(w) + stringify!(text) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, - 36usize, + unsafe { &(*(::std::ptr::null::())).pressed as *const _ as usize }, + 37usize, concat!( "Offset of field: ", - stringify!(TCOD_bsp_t), + stringify!(TCOD_key_t), "::", - stringify!(h) + stringify!(pressed) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 40usize, + unsafe { &(*(::std::ptr::null::())).lalt as *const _ as usize }, + 38usize, concat!( "Offset of field: ", - stringify!(TCOD_bsp_t), + stringify!(TCOD_key_t), "::", - stringify!(position) + stringify!(lalt) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).level as *const _ as usize }, - 44usize, + unsafe { &(*(::std::ptr::null::())).lctrl as *const _ as usize }, + 39usize, concat!( "Offset of field: ", - stringify!(TCOD_bsp_t), + stringify!(TCOD_key_t), "::", - stringify!(level) + stringify!(lctrl) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).horizontal as *const _ as usize }, - 45usize, + unsafe { &(*(::std::ptr::null::())).lmeta as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(TCOD_bsp_t), + stringify!(TCOD_key_t), "::", - stringify!(horizontal) + stringify!(lmeta) ) ); -} -impl Default for TCOD_bsp_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -pub type TCOD_bsp_callback_t = ::std::option::Option< - unsafe extern "C" fn(node: *mut TCOD_bsp_t, userData: *mut ::std::os::raw::c_void) -> bool, ->; -extern "C" { - pub fn TCOD_bsp_new() -> *mut TCOD_bsp_t; -} -extern "C" { - pub fn TCOD_bsp_new_with_size( - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - ) -> *mut TCOD_bsp_t; -} -extern "C" { - pub fn TCOD_bsp_delete(node: *mut TCOD_bsp_t); -} -extern "C" { - pub fn TCOD_bsp_left(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; -} -extern "C" { - pub fn TCOD_bsp_right(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; -} -extern "C" { - pub fn TCOD_bsp_father(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; -} -extern "C" { - pub fn TCOD_bsp_is_leaf(node: *mut TCOD_bsp_t) -> bool; -} -extern "C" { - pub fn TCOD_bsp_traverse_pre_order( - node: *mut TCOD_bsp_t, - listener: TCOD_bsp_callback_t, - userData: *mut ::std::os::raw::c_void, - ) -> bool; -} -extern "C" { - pub fn TCOD_bsp_traverse_in_order( - node: *mut TCOD_bsp_t, - listener: TCOD_bsp_callback_t, - userData: *mut ::std::os::raw::c_void, - ) -> bool; -} -extern "C" { - pub fn TCOD_bsp_traverse_post_order( - node: *mut TCOD_bsp_t, - listener: TCOD_bsp_callback_t, - userData: *mut ::std::os::raw::c_void, - ) -> bool; -} -extern "C" { - pub fn TCOD_bsp_traverse_level_order( - node: *mut TCOD_bsp_t, - listener: TCOD_bsp_callback_t, - userData: *mut ::std::os::raw::c_void, - ) -> bool; -} -extern "C" { - pub fn TCOD_bsp_traverse_inverted_level_order( - node: *mut TCOD_bsp_t, - listener: TCOD_bsp_callback_t, - userData: *mut ::std::os::raw::c_void, - ) -> bool; -} -extern "C" { - pub fn TCOD_bsp_contains( - node: *mut TCOD_bsp_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn TCOD_bsp_find_node( - node: *mut TCOD_bsp_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> *mut TCOD_bsp_t; -} -extern "C" { - pub fn TCOD_bsp_resize( - node: *mut TCOD_bsp_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn TCOD_bsp_split_once( - node: *mut TCOD_bsp_t, - horizontal: bool, - position: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn TCOD_bsp_split_recursive( - node: *mut TCOD_bsp_t, - randomizer: TCOD_random_t, - nb: ::std::os::raw::c_int, - minHSize: ::std::os::raw::c_int, - minVSize: ::std::os::raw::c_int, - maxHRatio: f32, - maxVRatio: f32, - ); -} -extern "C" { - pub fn TCOD_bsp_remove_sons(node: *mut TCOD_bsp_t); -} -#[doc = " \\brief An RGB color struct."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct TCOD_color_t { - pub r: u8, - pub g: u8, - pub b: u8, -} -#[test] -fn bindgen_test_layout_TCOD_color_t() { - assert_eq!( - ::std::mem::size_of::(), - 3usize, - concat!("Size of: ", stringify!(TCOD_color_t)) - ); assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(TCOD_color_t)) + unsafe { &(*(::std::ptr::null::())).ralt as *const _ as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(ralt) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).rctrl as *const _ as usize }, + 42usize, concat!( "Offset of field: ", - stringify!(TCOD_color_t), + stringify!(TCOD_key_t), "::", - stringify!(r) + stringify!(rctrl) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, - 1usize, + unsafe { &(*(::std::ptr::null::())).rmeta as *const _ as usize }, + 43usize, concat!( "Offset of field: ", - stringify!(TCOD_color_t), + stringify!(TCOD_key_t), "::", - stringify!(g) + stringify!(rmeta) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, - 2usize, + unsafe { &(*(::std::ptr::null::())).shift as *const _ as usize }, + 44usize, concat!( "Offset of field: ", - stringify!(TCOD_color_t), + stringify!(TCOD_key_t), "::", - stringify!(b) + stringify!(shift) ) ); } -extern "C" { - pub fn TCOD_color_RGB(r: u8, g: u8, b: u8) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_HSV(hue: f32, saturation: f32, value: f32) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_equals(c1: TCOD_color_t, c2: TCOD_color_t) -> bool; -} -extern "C" { - pub fn TCOD_color_add(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_subtract(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_multiply(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_multiply_scalar(c1: TCOD_color_t, value: f32) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_lerp(c1: TCOD_color_t, c2: TCOD_color_t, coef: f32) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_color_set_HSV(color: *mut TCOD_color_t, hue: f32, saturation: f32, value: f32); -} -extern "C" { - pub fn TCOD_color_get_HSV( - color: TCOD_color_t, - hue: *mut f32, - saturation: *mut f32, - value: *mut f32, - ); -} -extern "C" { - pub fn TCOD_color_get_hue(color: TCOD_color_t) -> f32; -} -extern "C" { - pub fn TCOD_color_set_hue(color: *mut TCOD_color_t, hue: f32); -} -extern "C" { - pub fn TCOD_color_get_saturation(color: TCOD_color_t) -> f32; -} -extern "C" { - pub fn TCOD_color_set_saturation(color: *mut TCOD_color_t, saturation: f32); -} -extern "C" { - pub fn TCOD_color_get_value(color: TCOD_color_t) -> f32; -} -extern "C" { - pub fn TCOD_color_set_value(color: *mut TCOD_color_t, value: f32); -} -extern "C" { - pub fn TCOD_color_shift_hue(color: *mut TCOD_color_t, hshift: f32); -} -extern "C" { - pub fn TCOD_color_scale_HSV(color: *mut TCOD_color_t, saturation_coef: f32, value_coef: f32); -} -extern "C" { - pub fn TCOD_color_gen_map( - map: *mut TCOD_color_t, - nb_key: ::std::os::raw::c_int, - key_color: *const TCOD_color_t, - key_index: *const ::std::os::raw::c_int, - ); -} -pub const TCOD_COLOR_RED: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_RED; -pub const TCOD_COLOR_FLAME: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_FLAME; -pub const TCOD_COLOR_ORANGE: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_ORANGE; -pub const TCOD_COLOR_AMBER: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_AMBER; -pub const TCOD_COLOR_YELLOW: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_YELLOW; -pub const TCOD_COLOR_LIME: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_LIME; -pub const TCOD_COLOR_CHARTREUSE: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_CHARTREUSE; -pub const TCOD_COLOR_GREEN: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_GREEN; -pub const TCOD_COLOR_SEA: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_SEA; -pub const TCOD_COLOR_TURQUOISE: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_TURQUOISE; -pub const TCOD_COLOR_CYAN: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_CYAN; -pub const TCOD_COLOR_SKY: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_SKY; -pub const TCOD_COLOR_AZURE: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_AZURE; -pub const TCOD_COLOR_BLUE: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_BLUE; -pub const TCOD_COLOR_HAN: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_HAN; -pub const TCOD_COLOR_VIOLET: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_VIOLET; -pub const TCOD_COLOR_PURPLE: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_PURPLE; -pub const TCOD_COLOR_FUCHSIA: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_FUCHSIA; -pub const TCOD_COLOR_MAGENTA: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_MAGENTA; -pub const TCOD_COLOR_PINK: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_PINK; -pub const TCOD_COLOR_CRIMSON: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_CRIMSON; -pub const TCOD_COLOR_NB: _bindgen_ty_10 = _bindgen_ty_10::TCOD_COLOR_NB; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_10 { - TCOD_COLOR_RED = 0, - TCOD_COLOR_FLAME = 1, - TCOD_COLOR_ORANGE = 2, - TCOD_COLOR_AMBER = 3, - TCOD_COLOR_YELLOW = 4, - TCOD_COLOR_LIME = 5, - TCOD_COLOR_CHARTREUSE = 6, - TCOD_COLOR_GREEN = 7, - TCOD_COLOR_SEA = 8, - TCOD_COLOR_TURQUOISE = 9, - TCOD_COLOR_CYAN = 10, - TCOD_COLOR_SKY = 11, - TCOD_COLOR_AZURE = 12, - TCOD_COLOR_BLUE = 13, - TCOD_COLOR_HAN = 14, - TCOD_COLOR_VIOLET = 15, - TCOD_COLOR_PURPLE = 16, - TCOD_COLOR_FUCHSIA = 17, - TCOD_COLOR_MAGENTA = 18, - TCOD_COLOR_PINK = 19, - TCOD_COLOR_CRIMSON = 20, - TCOD_COLOR_NB = 21, +impl Default for TCOD_key_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } -pub const TCOD_COLOR_DESATURATED: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_DESATURATED; -pub const TCOD_COLOR_LIGHTEST: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_LIGHTEST; -pub const TCOD_COLOR_LIGHTER: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_LIGHTER; -pub const TCOD_COLOR_LIGHT: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_LIGHT; -pub const TCOD_COLOR_NORMAL: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_NORMAL; -pub const TCOD_COLOR_DARK: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_DARK; -pub const TCOD_COLOR_DARKER: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_DARKER; -pub const TCOD_COLOR_DARKEST: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_DARKEST; -pub const TCOD_COLOR_LEVELS: _bindgen_ty_11 = _bindgen_ty_11::TCOD_COLOR_LEVELS; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_11 { - TCOD_COLOR_DESATURATED = 0, - TCOD_COLOR_LIGHTEST = 1, - TCOD_COLOR_LIGHTER = 2, - TCOD_COLOR_LIGHT = 3, - TCOD_COLOR_NORMAL = 4, - TCOD_COLOR_DARK = 5, - TCOD_COLOR_DARKER = 6, - TCOD_COLOR_DARKEST = 7, - TCOD_COLOR_LEVELS = 8, -} -extern "C" { - pub static mut TCOD_colors: [[TCOD_color_t; 8usize]; 21usize]; -} -extern "C" { - pub static TCOD_black: TCOD_color_t; -} -extern "C" { - pub static TCOD_darkest_grey: TCOD_color_t; -} -extern "C" { - pub static TCOD_darker_grey: TCOD_color_t; -} -extern "C" { - pub static TCOD_dark_grey: TCOD_color_t; -} -extern "C" { - pub static TCOD_grey: TCOD_color_t; -} -extern "C" { - pub static TCOD_light_grey: TCOD_color_t; -} -extern "C" { - pub static TCOD_lighter_grey: TCOD_color_t; -} -extern "C" { - pub static TCOD_lightest_grey: TCOD_color_t; -} -extern "C" { - pub static TCOD_darkest_gray: TCOD_color_t; -} -extern "C" { - pub static TCOD_darker_gray: TCOD_color_t; -} -extern "C" { - pub static TCOD_dark_gray: TCOD_color_t; -} -extern "C" { - pub static TCOD_gray: TCOD_color_t; -} -extern "C" { - pub static TCOD_light_gray: TCOD_color_t; -} -extern "C" { - pub static TCOD_lighter_gray: TCOD_color_t; -} -extern "C" { - pub static TCOD_lightest_gray: TCOD_color_t; -} -extern "C" { - pub static TCOD_white: TCOD_color_t; -} -extern "C" { - pub static TCOD_darkest_sepia: TCOD_color_t; -} -extern "C" { - pub static TCOD_darker_sepia: TCOD_color_t; -} -extern "C" { - pub static TCOD_dark_sepia: TCOD_color_t; -} -extern "C" { - pub static TCOD_sepia: TCOD_color_t; -} -extern "C" { - pub static TCOD_light_sepia: TCOD_color_t; -} -extern "C" { - pub static TCOD_lighter_sepia: TCOD_color_t; -} -extern "C" { - pub static TCOD_lightest_sepia: TCOD_color_t; -} -extern "C" { - pub static TCOD_red: TCOD_color_t; +pub enum TCOD_chars_t { + TCOD_CHAR_HLINE = 196, + TCOD_CHAR_VLINE = 179, + TCOD_CHAR_NE = 191, + TCOD_CHAR_NW = 218, + TCOD_CHAR_SE = 217, + TCOD_CHAR_SW = 192, + TCOD_CHAR_TEEW = 180, + TCOD_CHAR_TEEE = 195, + TCOD_CHAR_TEEN = 193, + TCOD_CHAR_TEES = 194, + TCOD_CHAR_CROSS = 197, + TCOD_CHAR_DHLINE = 205, + TCOD_CHAR_DVLINE = 186, + TCOD_CHAR_DNE = 187, + TCOD_CHAR_DNW = 201, + TCOD_CHAR_DSE = 188, + TCOD_CHAR_DSW = 200, + TCOD_CHAR_DTEEW = 185, + TCOD_CHAR_DTEEE = 204, + TCOD_CHAR_DTEEN = 202, + TCOD_CHAR_DTEES = 203, + TCOD_CHAR_DCROSS = 206, + TCOD_CHAR_BLOCK1 = 176, + TCOD_CHAR_BLOCK2 = 177, + TCOD_CHAR_BLOCK3 = 178, + TCOD_CHAR_ARROW_N = 24, + TCOD_CHAR_ARROW_S = 25, + TCOD_CHAR_ARROW_E = 26, + TCOD_CHAR_ARROW_W = 27, + TCOD_CHAR_ARROW2_N = 30, + TCOD_CHAR_ARROW2_S = 31, + TCOD_CHAR_ARROW2_E = 16, + TCOD_CHAR_ARROW2_W = 17, + TCOD_CHAR_DARROW_H = 29, + TCOD_CHAR_DARROW_V = 18, + TCOD_CHAR_CHECKBOX_UNSET = 224, + TCOD_CHAR_CHECKBOX_SET = 225, + TCOD_CHAR_RADIO_UNSET = 9, + TCOD_CHAR_RADIO_SET = 10, + TCOD_CHAR_SUBP_NW = 226, + TCOD_CHAR_SUBP_NE = 227, + TCOD_CHAR_SUBP_N = 228, + TCOD_CHAR_SUBP_SE = 229, + TCOD_CHAR_SUBP_DIAG = 230, + TCOD_CHAR_SUBP_E = 231, + TCOD_CHAR_SUBP_SW = 232, + TCOD_CHAR_SMILIE = 1, + TCOD_CHAR_SMILIE_INV = 2, + TCOD_CHAR_HEART = 3, + TCOD_CHAR_DIAMOND = 4, + TCOD_CHAR_CLUB = 5, + TCOD_CHAR_SPADE = 6, + TCOD_CHAR_BULLET = 7, + TCOD_CHAR_BULLET_INV = 8, + TCOD_CHAR_MALE = 11, + TCOD_CHAR_FEMALE = 12, + TCOD_CHAR_NOTE = 13, + TCOD_CHAR_NOTE_DOUBLE = 14, + TCOD_CHAR_LIGHT = 15, + TCOD_CHAR_EXCLAM_DOUBLE = 19, + TCOD_CHAR_PILCROW = 20, + TCOD_CHAR_SECTION = 21, + TCOD_CHAR_POUND = 156, + TCOD_CHAR_MULTIPLICATION = 158, + TCOD_CHAR_FUNCTION = 159, + TCOD_CHAR_RESERVED = 169, + TCOD_CHAR_HALF = 171, + TCOD_CHAR_ONE_QUARTER = 172, + TCOD_CHAR_COPYRIGHT = 184, + TCOD_CHAR_CENT = 189, + TCOD_CHAR_YEN = 190, + TCOD_CHAR_CURRENCY = 207, + TCOD_CHAR_THREE_QUARTERS = 243, + TCOD_CHAR_DIVISION = 246, + TCOD_CHAR_GRADE = 248, + TCOD_CHAR_UMLAUT = 249, + TCOD_CHAR_POW1 = 251, + TCOD_CHAR_POW3 = 252, + TCOD_CHAR_POW2 = 253, + TCOD_CHAR_BULLET_SQUARE = 254, } -extern "C" { - pub static TCOD_flame: TCOD_color_t; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_key_status_t { + TCOD_KEY_PRESSED = 1, + TCOD_KEY_RELEASED = 2, } -extern "C" { - pub static TCOD_orange: TCOD_color_t; +impl TCOD_font_flags_t { + #[doc = " Tiles are arranged in column-major order."] + #[doc = ""] + #[doc = " 0 3 6"] + #[doc = " 1 4 7"] + #[doc = " 2 5 8"] + pub const TCOD_FONT_LAYOUT_ASCII_INCOL: TCOD_font_flags_t = TCOD_font_flags_t(1); } -extern "C" { - pub static TCOD_amber: TCOD_color_t; +impl TCOD_font_flags_t { + #[doc = " Tiles are arranged in row-major order."] + #[doc = ""] + #[doc = " 0 1 2"] + #[doc = " 3 4 5"] + #[doc = " 6 7 8"] + pub const TCOD_FONT_LAYOUT_ASCII_INROW: TCOD_font_flags_t = TCOD_font_flags_t(2); } -extern "C" { - pub static TCOD_yellow: TCOD_color_t; +impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] + pub const TCOD_FONT_TYPE_GREYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); } -extern "C" { - pub static TCOD_lime: TCOD_color_t; +impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] + pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); } -extern "C" { - pub static TCOD_chartreuse: TCOD_color_t; +impl TCOD_font_flags_t { + #[doc = " A unique layout used by some of libtcod's fonts."] + pub const TCOD_FONT_LAYOUT_TCOD: TCOD_font_flags_t = TCOD_font_flags_t(8); } -extern "C" { - pub static TCOD_green: TCOD_color_t; +impl TCOD_font_flags_t { + #[doc = " Decode a code page 437 tileset into Unicode code-points."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.10"] + #[doc = " \\endrst"] + pub const TCOD_FONT_LAYOUT_CP437: TCOD_font_flags_t = TCOD_font_flags_t(16); } -extern "C" { - pub static TCOD_sea: TCOD_color_t; +impl ::std::ops::BitOr for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 | other.0) + } } -extern "C" { - pub static TCOD_turquoise: TCOD_color_t; +impl ::std::ops::BitOrAssign for TCOD_font_flags_t { + #[inline] + fn bitor_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 |= rhs.0; + } } -extern "C" { - pub static TCOD_cyan: TCOD_color_t; +impl ::std::ops::BitAnd for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 & other.0) + } } -extern "C" { - pub static TCOD_sky: TCOD_color_t; +impl ::std::ops::BitAndAssign for TCOD_font_flags_t { + #[inline] + fn bitand_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 &= rhs.0; + } } -extern "C" { - pub static TCOD_azure: TCOD_color_t; +#[repr(transparent)] +#[doc = " These font flags can be OR'd together into a bit-field and passed to"] +#[doc = " TCOD_console_set_custom_font"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct TCOD_font_flags_t(pub u32); +#[repr(u32)] +#[doc = " The available renderers."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_renderer_t { + #[doc = " Alias for TCOD_RENDERER_OPENGL2."] + TCOD_RENDERER_GLSL = 0, + #[doc = " An OpenGL 1.1 implementation."] + #[doc = ""] + #[doc = " Performs worse than TCOD_RENDERER_GLSL without many benefits."] + TCOD_RENDERER_OPENGL = 1, + #[doc = " A software based renderer."] + #[doc = ""] + #[doc = " The font file is loaded into RAM instead of VRAM in this implementation."] + TCOD_RENDERER_SDL = 2, + #[doc = " A new SDL2 renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.8"] + #[doc = " \\endrst"] + TCOD_RENDERER_SDL2 = 3, + #[doc = " A new OpenGL 2.0 core renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.9"] + #[doc = ""] + #[doc = " .. versionchanged:: 1.11.0"] + #[doc = " This renderer now uses OpenGL 2.0 instead of 2.1."] + #[doc = " \\endrst"] + TCOD_RENDERER_OPENGL2 = 4, + #[doc = " A new OpenGL 2.0 core renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.9"] + #[doc = ""] + #[doc = " .. versionchanged:: 1.11.0"] + #[doc = " This renderer now uses OpenGL 2.0 instead of 2.1."] + #[doc = " \\endrst"] + TCOD_NB_RENDERERS = 5, } extern "C" { - pub static TCOD_blue: TCOD_color_t; + #[doc = " Draw a rectangle onto a console."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting region, the left-most position being 0."] + #[doc = " \\param y The starting region, the top-most position being 0."] + #[doc = " \\param rw The width of the rectangle."] + #[doc = " \\param rh The height of the rectangle."] + #[doc = " \\param clear If true the drawing region will be filled with spaces."] + #[doc = " \\param flag The blending flag to use."] + pub fn TCOD_console_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + clear: bool, + flag: TCOD_bkgnd_flag_t, + ); } extern "C" { - pub static TCOD_han: TCOD_color_t; + #[doc = " Draw a horizontal line using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting X coordinate, the left-most position being 0."] + #[doc = " \\param y The starting Y coordinate, the top-most position being 0."] + #[doc = " \\param l The width of the line."] + #[doc = " \\param flag The blending flag."] + #[doc = ""] + #[doc = " This function makes assumptions about the fonts character encoding."] + #[doc = " It will fail if the font encoding is not `cp437`."] + pub fn TCOD_console_hline( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); } extern "C" { - pub static TCOD_violet: TCOD_color_t; + #[doc = " Draw a vertical line using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting X coordinate, the left-most position being 0."] + #[doc = " \\param y The starting Y coordinate, the top-most position being 0."] + #[doc = " \\param l The height of the line."] + #[doc = " \\param flag The blending flag."] + #[doc = ""] + #[doc = " This function makes assumptions about the fonts character encoding."] + #[doc = " It will fail if the font encoding is not `cp437`."] + pub fn TCOD_console_vline( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); } extern "C" { - pub static TCOD_purple: TCOD_color_t; + #[doc = " Place a single tile on a `console` at `x`,`y`."] + #[doc = ""] + #[doc = " If `ch` is 0 then the character code will not be updated."] + #[doc = ""] + #[doc = " If `fg`,`bg` is NULL then their respective colors will not be updated."] + pub fn TCOD_console_put_rgb( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ch: ::std::os::raw::c_int, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); } extern "C" { - pub static TCOD_fuchsia: TCOD_color_t; + #[doc = " Draw a rectangle on a `console` with a shape of `x`,`y`,`width`,`height`."] + #[doc = ""] + #[doc = " If `ch` is 0 then the character code will not be updated."] + #[doc = ""] + #[doc = " If `fg`,`bg` is NULL then their respective colors will not be updated."] + pub fn TCOD_console_draw_rect_rgb( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ch: ::std::os::raw::c_int, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); } -extern "C" { - pub static TCOD_magenta: TCOD_color_t; +#[doc = "Viewport options for the rendering context."] +#[doc = "\\rst"] +#[doc = ".. versionadded:: 1.16"] +#[doc = "\\endrst"] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ViewportOptions { + #[doc = "If true then the aspect ratio will be kept square when the console is"] + #[doc = "scaled. The view will be letter-boxed."] + #[doc = ""] + #[doc = "If false the console will be stretched to fill the screen."] + #[doc = ""] + #[doc = "Set this is true if your tileset is deigned for square pixels."] + pub keep_aspect: bool, + #[doc = "If true then console scaling will be fixed to integer increments."] + #[doc = ""] + #[doc = "Has no effect if the console must be scaled down."] + pub integer_scaling: bool, + #[doc = "Not used."] + pub reserved_: bool, + #[doc = "The color to clear the screen with before rendering the console."] + pub clear_color: TCOD_ColorRGBA, + #[doc = "Alignment of the console when it is letter-boxed: 0.0f renders the"] + #[doc = "console in the upper-left corner, and 1.0f in the lower-right."] + #[doc = ""] + #[doc = "Values of 0.5f will center the console."] + #[doc = "Values outside of the range 0.0f to 1.0f are clamped."] + pub align_x: f32, + pub align_y: f32, } -extern "C" { - pub static TCOD_pink: TCOD_color_t; +#[test] +fn bindgen_test_layout_TCOD_ViewportOptions() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_ViewportOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_ViewportOptions)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).keep_aspect as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(keep_aspect) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).integer_scaling as *const _ as usize + }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(integer_scaling) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved_ as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(reserved_) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).clear_color as *const _ as usize + }, + 3usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(clear_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).align_x as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(align_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).align_y as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(align_y) + ) + ); } extern "C" { - pub static TCOD_crimson: TCOD_color_t; + pub static TCOD_VIEWPORT_DEFAULT_: TCOD_ViewportOptions; } extern "C" { - pub static TCOD_dark_red: TCOD_color_t; + #[doc = "Allocate a new viewport options struct."] + #[doc = ""] + #[doc = "You should not allocate this struct manually since the size of it may change"] + #[doc = "between versions."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_viewport_new() -> *mut TCOD_ViewportOptions; } extern "C" { - pub static TCOD_dark_flame: TCOD_color_t; + #[doc = "Delete a viewport."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_viewport_delete(viewport: *mut TCOD_ViewportOptions); } -extern "C" { - pub static TCOD_dark_orange: TCOD_color_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Window { + _unused: [u8; 0], } -extern "C" { - pub static TCOD_dark_amber: TCOD_color_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Renderer { + _unused: [u8; 0], } -extern "C" { - pub static TCOD_dark_yellow: TCOD_color_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Rect { + _unused: [u8; 0], } -extern "C" { - pub static TCOD_dark_lime: TCOD_color_t; +#[doc = " A rendering context for libtcod."] +#[doc = " \\rst"] +#[doc = " .. versionadded:: 1.16"] +#[doc = " \\endrst"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Context { + pub type_: ::std::os::raw::c_int, + pub contextdata: *mut ::std::os::raw::c_void, + pub destructor_: ::std::option::Option, + pub present_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error, + >, + pub pixel_to_tile_: ::std::option::Option< + unsafe extern "C" fn(self_: *mut TCOD_Context, x: *mut f64, y: *mut f64), + >, + pub save_screenshot_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + filename: *const ::std::os::raw::c_char, + ) -> TCOD_Error, + >, + pub get_sdl_window_: + ::std::option::Option *mut SDL_Window>, + pub get_sdl_renderer_: + ::std::option::Option *mut SDL_Renderer>, + pub accumulate_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error, + >, + #[doc = "Change the tileset used by this context."] + pub set_tileset: ::std::option::Option< + unsafe extern "C" fn(self_: *mut TCOD_Context, tileset: *mut TCOD_Tileset) -> TCOD_Error, + >, + #[doc = "Output the recommended console size to `columns` and `rows`."] + pub cb_recommended_console_size_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + columns: *mut ::std::os::raw::c_int, + rows: *mut ::std::os::raw::c_int, + ) -> TCOD_Error, + >, } -extern "C" { - pub static TCOD_dark_chartreuse: TCOD_color_t; +#[test] +fn bindgen_test_layout_TCOD_Context() { + assert_eq!( + ::std::mem::size_of::(), + 88usize, + concat!("Size of: ", stringify!(TCOD_Context)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Context)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).contextdata as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(contextdata) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).destructor_ as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(destructor_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).present_ as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(present_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pixel_to_tile_ as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(pixel_to_tile_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).save_screenshot_ as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(save_screenshot_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).get_sdl_window_ as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(get_sdl_window_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).get_sdl_renderer_ as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(get_sdl_renderer_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).accumulate_ as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(accumulate_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).set_tileset as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(set_tileset) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).cb_recommended_console_size_ as *const _ + as usize + }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(cb_recommended_console_size_) + ) + ); } -extern "C" { - pub static TCOD_dark_green: TCOD_color_t; +impl Default for TCOD_Context { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub static TCOD_dark_sea: TCOD_color_t; + #[doc = " Delete a rendering context."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_context_delete(renderer: *mut TCOD_Context); } extern "C" { - pub static TCOD_dark_turquoise: TCOD_color_t; + #[doc = " Create an uninitialized rendering context."] + #[doc = ""] + #[doc = " Used internally."] + pub fn TCOD_context_new_() -> *mut TCOD_Context; } extern "C" { - pub static TCOD_dark_cyan: TCOD_color_t; + #[doc = "Present a console to the screen, using a rendering context."] + #[doc = ""] + #[doc = "`console` is the console to present, the console can be any size."] + #[doc = ""] + #[doc = "`viewport` is the optional viewport options to use."] + #[doc = "This will affect the scaling of the console with the current context."] + #[doc = "This can be NULL to use the default options, which are to stretch the"] + #[doc = "console to fit the screen."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_present( + context: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error; } extern "C" { - pub static TCOD_dark_sky: TCOD_color_t; + #[doc = "Convert the screen coordinates to tile coordinates for this context."] + #[doc = ""] + #[doc = "`x` and `y` are the pointers to the screen coordinates, these will be"] + #[doc = "converted to tile coordinates after the call to this function."] + #[doc = ""] + #[doc = "The parameters given to the last call to `TCOD_context_present` will"] + #[doc = "determine where the tiles are for this call."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_screen_pixel_to_tile_d( + context: *mut TCOD_Context, + x: *mut f64, + y: *mut f64, + ) -> TCOD_Error; } extern "C" { - pub static TCOD_dark_azure: TCOD_color_t; + #[doc = "Convert the screen coordinates to integer tile coordinates for this context."] + #[doc = ""] + #[doc = "Save as `TCOD_context_screen_pixel_to_tile` but the inputs and results are"] + #[doc = "integers. This is useful if you don't need sub-tile coordinates."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_screen_pixel_to_tile_i( + context: *mut TCOD_Context, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ) -> TCOD_Error; } extern "C" { - pub static TCOD_dark_blue: TCOD_color_t; + #[doc = "Save the last presented console to a PNG file."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_save_screenshot( + context: *mut TCOD_Context, + filename: *const ::std::os::raw::c_char, + ) -> TCOD_Error; } extern "C" { - pub static TCOD_dark_han: TCOD_color_t; + #[doc = "Return a pointer the SDL_Window for this context if it uses one."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_sdl_window(context: *mut TCOD_Context) -> *mut SDL_Window; } extern "C" { - pub static TCOD_dark_violet: TCOD_color_t; + #[doc = "Return a pointer the SDL_Renderer for this context if it uses one."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_sdl_renderer(context: *mut TCOD_Context) -> *mut SDL_Renderer; } extern "C" { - pub static TCOD_dark_purple: TCOD_color_t; + #[doc = "Change the active tileset for this context."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_change_tileset( + self_: *mut TCOD_Context, + tileset: *mut TCOD_Tileset, + ) -> TCOD_Error; } extern "C" { - pub static TCOD_dark_fuchsia: TCOD_color_t; + #[doc = "Return the `TCOD_renderer_t` renderer type for this context."] + #[doc = ""] + #[doc = "Returns a negative number on error, such as `context` being NULL."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_renderer_type(context: *mut TCOD_Context) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_dark_magenta: TCOD_color_t; + #[doc = "Set `columns` and `rows` to the recommended console size for this context."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_recommended_console_size( + context: *mut TCOD_Context, + columns: *mut ::std::os::raw::c_int, + rows: *mut ::std::os::raw::c_int, + ) -> TCOD_Error; } -extern "C" { - pub static TCOD_dark_pink: TCOD_color_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_mipmap_ { + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub fwidth: f32, + pub fheight: f32, + pub buf: *mut TCOD_ColorRGB, + pub dirty: bool, } -extern "C" { - pub static TCOD_dark_crimson: TCOD_color_t; +#[test] +fn bindgen_test_layout_TCOD_mipmap_() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(TCOD_mipmap_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_mipmap_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fwidth as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(fwidth) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fheight as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(fheight) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dirty as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(dirty) + ) + ); } -extern "C" { - pub static TCOD_darker_red: TCOD_color_t; +impl Default for TCOD_mipmap_ { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } -extern "C" { - pub static TCOD_darker_flame: TCOD_color_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Image { + pub nb_mipmaps: ::std::os::raw::c_int, + pub mipmaps: *mut TCOD_mipmap_, + pub key_color: TCOD_ColorRGB, + pub has_key_color: bool, } -extern "C" { - pub static TCOD_darker_orange: TCOD_color_t; +#[test] +fn bindgen_test_layout_TCOD_Image() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(TCOD_Image)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Image)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_mipmaps as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(nb_mipmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mipmaps as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(mipmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).key_color as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(key_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).has_key_color as *const _ as usize }, + 19usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(has_key_color) + ) + ); } -extern "C" { - pub static TCOD_darker_amber: TCOD_color_t; +impl Default for TCOD_Image { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } +pub type TCOD_image_t = *mut TCOD_Image; extern "C" { - pub static TCOD_darker_yellow: TCOD_color_t; + pub fn TCOD_image_new( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> *mut TCOD_Image; } extern "C" { - pub static TCOD_darker_lime: TCOD_color_t; + #[doc = " Return a new image rendered from a console."] + #[doc = ""] + #[doc = " This effectively returns a screenshot of the console."] + pub fn TCOD_image_from_console(console: *const TCOD_Console) -> *mut TCOD_Image; } extern "C" { - pub static TCOD_darker_chartreuse: TCOD_color_t; + #[doc = " Same as TCOD_image_from_console, but with an existing image."] + pub fn TCOD_image_refresh_console(image: *mut TCOD_Image, console: *const TCOD_Console); } extern "C" { - pub static TCOD_darker_green: TCOD_color_t; + pub fn TCOD_image_load(filename: *const ::std::os::raw::c_char) -> *mut TCOD_Image; } extern "C" { - pub static TCOD_darker_sea: TCOD_color_t; + pub fn TCOD_image_clear(image: *mut TCOD_Image, color: TCOD_color_t); } extern "C" { - pub static TCOD_darker_turquoise: TCOD_color_t; + pub fn TCOD_image_invert(image: *mut TCOD_Image); } extern "C" { - pub static TCOD_darker_cyan: TCOD_color_t; + pub fn TCOD_image_hflip(image: *mut TCOD_Image); } extern "C" { - pub static TCOD_darker_sky: TCOD_color_t; + pub fn TCOD_image_rotate90(image: *mut TCOD_Image, numRotations: ::std::os::raw::c_int); } extern "C" { - pub static TCOD_darker_azure: TCOD_color_t; + pub fn TCOD_image_vflip(image: *mut TCOD_Image); } extern "C" { - pub static TCOD_darker_blue: TCOD_color_t; + pub fn TCOD_image_scale( + image: *mut TCOD_Image, + neww: ::std::os::raw::c_int, + newh: ::std::os::raw::c_int, + ); } extern "C" { - pub static TCOD_darker_han: TCOD_color_t; + pub fn TCOD_image_save(image: *const TCOD_Image, filename: *const ::std::os::raw::c_char); } extern "C" { - pub static TCOD_darker_violet: TCOD_color_t; + pub fn TCOD_image_get_size( + image: *const TCOD_Image, + w: *mut ::std::os::raw::c_int, + h: *mut ::std::os::raw::c_int, + ); } extern "C" { - pub static TCOD_darker_purple: TCOD_color_t; + pub fn TCOD_image_get_pixel( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; } extern "C" { - pub static TCOD_darker_fuchsia: TCOD_color_t; + pub fn TCOD_image_get_alpha( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_darker_magenta: TCOD_color_t; + #[doc = " Return a mipmapped pixel of image."] + #[doc = ""] + #[doc = " Mipmaps are updated when you call this, so it can't be called from multiple"] + #[doc = " threads."] + pub fn TCOD_image_get_mipmap_pixel( + image: *mut TCOD_Image, + x0: f32, + y0: f32, + x1: f32, + y1: f32, + ) -> TCOD_color_t; } extern "C" { - pub static TCOD_darker_pink: TCOD_color_t; + pub fn TCOD_image_put_pixel( + image: *mut TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); } extern "C" { - pub static TCOD_darker_crimson: TCOD_color_t; + pub fn TCOD_image_blit( + image: *mut TCOD_Image, + console: TCOD_console_t, + x: f32, + y: f32, + bkgnd_flag: TCOD_bkgnd_flag_t, + scalex: f32, + scaley: f32, + angle: f32, + ); } extern "C" { - pub static TCOD_darkest_red: TCOD_color_t; + pub fn TCOD_image_blit_rect( + image: *mut TCOD_Image, + console: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + bkgnd_flag: TCOD_bkgnd_flag_t, + ); } extern "C" { - pub static TCOD_darkest_flame: TCOD_color_t; + pub fn TCOD_image_blit_2x( + image: *const TCOD_Image, + dest: TCOD_console_t, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + sx: ::std::os::raw::c_int, + sy: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); } extern "C" { - pub static TCOD_darkest_orange: TCOD_color_t; + pub fn TCOD_image_delete(image: *mut TCOD_Image); } extern "C" { - pub static TCOD_darkest_amber: TCOD_color_t; + pub fn TCOD_image_set_key_color(image: *mut TCOD_Image, key_color: TCOD_color_t); } extern "C" { - pub static TCOD_darkest_yellow: TCOD_color_t; + pub fn TCOD_image_is_pixel_transparent( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; } -extern "C" { - pub static TCOD_darkest_lime: TCOD_color_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_List { + _unused: [u8; 0], } +pub type TCOD_list_t = *mut TCOD_List; extern "C" { - pub static TCOD_darkest_chartreuse: TCOD_color_t; + pub fn TCOD_list_new() -> TCOD_list_t; } extern "C" { - pub static TCOD_darkest_green: TCOD_color_t; + pub fn TCOD_list_allocate(nb_elements: ::std::os::raw::c_int) -> TCOD_list_t; } extern "C" { - pub static TCOD_darkest_sea: TCOD_color_t; + pub fn TCOD_list_duplicate(l: TCOD_list_t) -> TCOD_list_t; } extern "C" { - pub static TCOD_darkest_turquoise: TCOD_color_t; + pub fn TCOD_list_delete(l: TCOD_list_t); } extern "C" { - pub static TCOD_darkest_cyan: TCOD_color_t; + pub fn TCOD_list_push(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); } extern "C" { - pub static TCOD_darkest_sky: TCOD_color_t; + pub fn TCOD_list_pop(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; } extern "C" { - pub static TCOD_darkest_azure: TCOD_color_t; + pub fn TCOD_list_peek(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; } extern "C" { - pub static TCOD_darkest_blue: TCOD_color_t; + pub fn TCOD_list_add_all(l: TCOD_list_t, l2: TCOD_list_t); } extern "C" { - pub static TCOD_darkest_han: TCOD_color_t; + pub fn TCOD_list_get(l: TCOD_list_t, idx: ::std::os::raw::c_int) + -> *mut ::std::os::raw::c_void; } extern "C" { - pub static TCOD_darkest_violet: TCOD_color_t; + pub fn TCOD_list_set( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + idx: ::std::os::raw::c_int, + ); } extern "C" { - pub static TCOD_darkest_purple: TCOD_color_t; + pub fn TCOD_list_begin(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; } extern "C" { - pub static TCOD_darkest_fuchsia: TCOD_color_t; + pub fn TCOD_list_end(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; } extern "C" { - pub static TCOD_darkest_magenta: TCOD_color_t; + pub fn TCOD_list_reverse(l: TCOD_list_t); } extern "C" { - pub static TCOD_darkest_pink: TCOD_color_t; + pub fn TCOD_list_remove_iterator( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; } extern "C" { - pub static TCOD_darkest_crimson: TCOD_color_t; + pub fn TCOD_list_remove(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); } extern "C" { - pub static TCOD_light_red: TCOD_color_t; + pub fn TCOD_list_remove_iterator_fast( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; } extern "C" { - pub static TCOD_light_flame: TCOD_color_t; + pub fn TCOD_list_remove_fast(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); } extern "C" { - pub static TCOD_light_orange: TCOD_color_t; + pub fn TCOD_list_contains(l: TCOD_list_t, elt: *const ::std::os::raw::c_void) -> bool; } extern "C" { - pub static TCOD_light_amber: TCOD_color_t; + pub fn TCOD_list_clear(l: TCOD_list_t); } extern "C" { - pub static TCOD_light_yellow: TCOD_color_t; + pub fn TCOD_list_clear_and_delete(l: TCOD_list_t); } extern "C" { - pub static TCOD_light_lime: TCOD_color_t; + pub fn TCOD_list_size(l: TCOD_list_t) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_light_chartreuse: TCOD_color_t; + pub fn TCOD_list_insert_before( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + before: ::std::os::raw::c_int, + ) -> *mut *mut ::std::os::raw::c_void; } extern "C" { - pub static TCOD_light_green: TCOD_color_t; + pub fn TCOD_list_is_empty(l: TCOD_list_t) -> bool; } extern "C" { - pub static TCOD_light_sea: TCOD_color_t; + pub fn TCOD_console_set_custom_font( + fontFile: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + nb_char_horiz: ::std::os::raw::c_int, + nb_char_vertic: ::std::os::raw::c_int, + ) -> TCOD_Error; } extern "C" { - pub static TCOD_light_turquoise: TCOD_color_t; + pub fn TCOD_console_map_ascii_code_to_font( + asciiCode: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); } extern "C" { - pub static TCOD_light_cyan: TCOD_color_t; + pub fn TCOD_console_map_ascii_codes_to_font( + asciiCode: ::std::os::raw::c_int, + nbCodes: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); } extern "C" { - pub static TCOD_light_sky: TCOD_color_t; + pub fn TCOD_console_map_string_to_font( + s: *const ::std::os::raw::c_char, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); } extern "C" { - pub static TCOD_light_azure: TCOD_color_t; + pub fn TCOD_console_map_string_to_font_utf( + s: *const wchar_t, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); } extern "C" { - pub static TCOD_light_blue: TCOD_color_t; + pub fn TCOD_console_set_dirty( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); } extern "C" { - pub static TCOD_light_han: TCOD_color_t; + #[doc = "Render and present a console with optional viewport options."] + #[doc = ""] + #[doc = "`console` is the console to render."] + #[doc = ""] + #[doc = "`viewport` is optional."] + #[doc = ""] + #[doc = "Returns a negative values on error. See `TCOD_get_error`."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_console_flush_ex( + console: *mut TCOD_Console, + viewport: *mut TCOD_ViewportOptions, + ) -> TCOD_Error; } extern "C" { - pub static TCOD_light_violet: TCOD_color_t; + #[doc = " Render and present the root console to the active display."] + pub fn TCOD_console_flush() -> TCOD_Error; } extern "C" { - pub static TCOD_light_purple: TCOD_color_t; + pub fn TCOD_console_check_for_keypress(flags: ::std::os::raw::c_int) -> TCOD_key_t; } extern "C" { - pub static TCOD_light_fuchsia: TCOD_color_t; + pub fn TCOD_console_wait_for_keypress(flush: bool) -> TCOD_key_t; } extern "C" { - pub static TCOD_light_magenta: TCOD_color_t; + pub fn TCOD_console_is_key_pressed(key: TCOD_keycode_t) -> bool; } extern "C" { - pub static TCOD_light_pink: TCOD_color_t; + pub fn TCOD_console_from_file(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; } extern "C" { - pub static TCOD_light_crimson: TCOD_color_t; + pub fn TCOD_console_load_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; } extern "C" { - pub static TCOD_lighter_red: TCOD_color_t; + pub fn TCOD_console_load_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; } extern "C" { - pub static TCOD_lighter_flame: TCOD_color_t; + pub fn TCOD_console_save_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; } extern "C" { - pub static TCOD_lighter_orange: TCOD_color_t; + pub fn TCOD_console_save_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; } extern "C" { - pub static TCOD_lighter_amber: TCOD_color_t; + pub fn TCOD_console_credits(); } extern "C" { - pub static TCOD_lighter_yellow: TCOD_color_t; + pub fn TCOD_console_credits_reset(); } extern "C" { - pub static TCOD_lighter_lime: TCOD_color_t; + pub fn TCOD_console_credits_render( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + alpha: bool, + ) -> bool; } extern "C" { - pub static TCOD_lighter_chartreuse: TCOD_color_t; + pub fn TCOD_console_set_keyboard_repeat( + initial_delay: ::std::os::raw::c_int, + interval: ::std::os::raw::c_int, + ); } extern "C" { - pub static TCOD_lighter_green: TCOD_color_t; + pub fn TCOD_console_disable_keyboard_repeat(); } extern "C" { - pub static TCOD_lighter_sea: TCOD_color_t; + #[doc = " \\brief Initialize the libtcod graphical engine."] + #[doc = ""] + #[doc = " \\param w The width in tiles."] + #[doc = " \\param h The height in tiles."] + #[doc = " \\param title The title for the window."] + #[doc = " \\param fullscreen Fullscreen option."] + #[doc = " \\param renderer Which renderer to use when rendering the console."] + #[doc = ""] + #[doc = " You may want to call TCOD_console_set_custom_font BEFORE calling this"] + #[doc = " function. By default this function loads libtcod's `terminal.png` image"] + #[doc = " from the working directory."] + #[doc = ""] + #[doc = " Afterwards TCOD_quit must be called before the program exits."] + #[doc = ""] + #[doc = " Returns 0 on success, or -1 on an error, you can check the error with"] + #[doc = " TCOD_sys_get_error()"] + #[doc = ""] + #[doc = " `renderer` and vsync settings can be overridden by the `TCOD_RENDERER` or"] + #[doc = " `TCOD_VSYNC` environment variables."] + #[doc = ""] + #[doc = " Valid case-sensitive options for `TCOD_RENDERER` are:"] + #[doc = " - sdl"] + #[doc = " - opengl"] + #[doc = " - glsl"] + #[doc = " - sdl2"] + #[doc = " - opengl2"] + #[doc = ""] + #[doc = " Valid options for `TCOD_VSYNC` are `0` or `1`."] + #[doc = ""] + #[doc = " \\rst"] + #[doc = " .. versionchanged:: 1.12"] + #[doc = " Now returns -1 on error instead of crashing."] + #[doc = ""] + #[doc = " .. versionchanged:: 1.13"] + #[doc = " Added the `TCOD_RENDERER` and `TCOD_VSYNC` overrides."] + #[doc = " \\endrst"] + pub fn TCOD_console_init_root( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fullscreen: bool, + renderer: TCOD_renderer_t, + ) -> TCOD_Error; } extern "C" { - pub static TCOD_lighter_turquoise: TCOD_color_t; + pub fn TCOD_console_init_root_( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fullscreen: bool, + renderer: TCOD_renderer_t, + vsync: bool, + ) -> TCOD_Error; } extern "C" { - pub static TCOD_lighter_cyan: TCOD_color_t; + #[doc = " Shutdown libtcod. This must be called before your program exits."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.8"] + #[doc = " \\endrst"] + pub fn TCOD_quit(); } extern "C" { - pub static TCOD_lighter_sky: TCOD_color_t; + #[doc = " Change the title string of the active window."] + #[doc = ""] + #[doc = " \\param title A utf8 string."] + pub fn TCOD_console_set_window_title(title: *const ::std::os::raw::c_char); } extern "C" { - pub static TCOD_lighter_azure: TCOD_color_t; + #[doc = " Set the display to be full-screen or windowed."] + #[doc = ""] + #[doc = " \\param fullscreen If true the display will go full-screen."] + pub fn TCOD_console_set_fullscreen(fullscreen: bool); } extern "C" { - pub static TCOD_lighter_blue: TCOD_color_t; + #[doc = " Return true if the display is full-screen."] + pub fn TCOD_console_is_fullscreen() -> bool; } extern "C" { - pub static TCOD_lighter_han: TCOD_color_t; + #[doc = " Return true if the window has mouse focus."] + pub fn TCOD_console_has_mouse_focus() -> bool; } extern "C" { - pub static TCOD_lighter_violet: TCOD_color_t; + #[doc = " Return true if the window has keyboard focus."] + #[doc = ""] + #[doc = " \\verbatim embed:rst:leading-asterisk"] + #[doc = " .. versionchanged: 1.7"] + #[doc = " This function was previously broken. It now keeps track of keyboard"] + #[doc = " focus."] + #[doc = " \\endverbatim"] + pub fn TCOD_console_is_active() -> bool; } extern "C" { - pub static TCOD_lighter_purple: TCOD_color_t; + #[doc = " Return true if the window is closing."] + pub fn TCOD_console_is_window_closed() -> bool; } extern "C" { - pub static TCOD_lighter_fuchsia: TCOD_color_t; + #[doc = " Return an SDL_Window pointer if one is in use, returns NULL otherwise."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_get_sdl_window() -> *mut SDL_Window; } extern "C" { - pub static TCOD_lighter_magenta: TCOD_color_t; + #[doc = " Return an SDL_Renderer pointer if one is in use, returns NULL otherwise."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_get_sdl_renderer() -> *mut SDL_Renderer; } extern "C" { - pub static TCOD_lighter_pink: TCOD_color_t; + #[doc = " Render a console over the display."] + #[doc = " \\rst"] + #[doc = " `console` can be any size, the active render will try to scale it to fit"] + #[doc = " the screen."] + #[doc = ""] + #[doc = " The function will only work for the SDL2/OPENGL2 renderers."] + #[doc = ""] + #[doc = " Unlike :any:`TCOD_console_flush` this will not present the display."] + #[doc = " You will need to do that manually, likely with the SDL API."] + #[doc = ""] + #[doc = " Returns 0 on success, or a negative number on a failure such as the"] + #[doc = " incorrect renderer being active."] + #[doc = ""] + #[doc = " .. versionadded:: 1.11"] + #[doc = ""] + #[doc = " .. seealso::"] + #[doc = " :any:`TCOD_sys_get_sdl_window` :any:`TCOD_sys_get_sdl_renderer`"] + #[doc = " \\endrst"] + pub fn TCOD_sys_accumulate_console(console: *const TCOD_Console) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_lighter_crimson: TCOD_color_t; + pub fn TCOD_sys_accumulate_console_( + console: *const TCOD_Console, + viewport: *const SDL_Rect, + ) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_lightest_red: TCOD_color_t; + pub fn TCOD_console_print( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ); } extern "C" { - pub static TCOD_lightest_flame: TCOD_color_t; + pub fn TCOD_console_print_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ); } extern "C" { - pub static TCOD_lightest_orange: TCOD_color_t; + pub fn TCOD_console_print_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_lightest_amber: TCOD_color_t; + pub fn TCOD_console_print_rect_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_lightest_yellow: TCOD_color_t; + pub fn TCOD_console_print_frame( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + empty: bool, + flag: TCOD_bkgnd_flag_t, + fmt: *const ::std::os::raw::c_char, + ... + ); } extern "C" { - pub static TCOD_lightest_lime: TCOD_color_t; + pub fn TCOD_console_get_height_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_lightest_chartreuse: TCOD_color_t; + pub fn TCOD_console_print_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ); } extern "C" { - pub static TCOD_lightest_green: TCOD_color_t; + pub fn TCOD_console_print_ex_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ); } extern "C" { - pub static TCOD_lightest_sea: TCOD_color_t; + pub fn TCOD_console_print_rect_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_lightest_turquoise: TCOD_color_t; + pub fn TCOD_console_print_rect_ex_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_lightest_cyan: TCOD_color_t; + pub fn TCOD_console_get_height_rect_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +impl TCOD_colctrl_t { + pub const TCOD_COLCTRL_NUMBER: TCOD_colctrl_t = TCOD_colctrl_t::TCOD_COLCTRL_5; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_colctrl_t { + TCOD_COLCTRL_1 = 1, + TCOD_COLCTRL_2 = 2, + TCOD_COLCTRL_3 = 3, + TCOD_COLCTRL_4 = 4, + TCOD_COLCTRL_5 = 5, + TCOD_COLCTRL_FORE_RGB = 6, + TCOD_COLCTRL_BACK_RGB = 7, + TCOD_COLCTRL_STOP = 8, } extern "C" { - pub static TCOD_lightest_sky: TCOD_color_t; + pub fn TCOD_console_set_color_control( + con: TCOD_colctrl_t, + fore: TCOD_color_t, + back: TCOD_color_t, + ); } extern "C" { - pub static TCOD_lightest_azure: TCOD_color_t; + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; } extern "C" { - pub static TCOD_lightest_blue: TCOD_color_t; + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; } extern "C" { - pub static TCOD_lightest_han: TCOD_color_t; + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_lightest_violet: TCOD_color_t; + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_rect_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_lightest_purple: TCOD_color_t; + #[doc = "Print a framed and optionally titled region to a console, using default"] + #[doc = "colors and alignment."] + #[doc = ""] + #[doc = "This function uses Unicode box-drawing characters and a UTF-8 formatted"] + #[doc = "string."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_frame( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + empty: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; } extern "C" { - pub static TCOD_lightest_fuchsia: TCOD_color_t; + #[doc = "Return the number of lines that would be printed by this formatted string."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_get_height_rect_fmt( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_lightest_magenta: TCOD_color_t; + pub fn TCOD_console_printn( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + ) -> TCOD_Error; } extern "C" { - pub static TCOD_lightest_pink: TCOD_color_t; + pub fn TCOD_console_printn_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + ) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_lightest_crimson: TCOD_color_t; + pub fn TCOD_console_get_height_rect_n( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_desaturated_red: TCOD_color_t; + pub fn TCOD_console_get_height_rect_wn( + width: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_desaturated_flame: TCOD_color_t; + pub fn TCOD_console_printn_frame( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + empty: bool, + ) -> TCOD_Error; } extern "C" { - pub static TCOD_desaturated_orange: TCOD_color_t; + pub fn TCOD_console_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; } extern "C" { - pub static TCOD_desaturated_amber: TCOD_color_t; + pub fn TCOD_console_load_xp( + con: *mut TCOD_Console, + filename: *const ::std::os::raw::c_char, + ) -> bool; } extern "C" { - pub static TCOD_desaturated_yellow: TCOD_color_t; + pub fn TCOD_console_save_xp( + con: *const TCOD_Console, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; } extern "C" { - pub static TCOD_desaturated_lime: TCOD_color_t; + pub fn TCOD_console_list_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_list_t; } extern "C" { - pub static TCOD_desaturated_chartreuse: TCOD_color_t; + pub fn TCOD_console_list_save_xp( + console_list: TCOD_list_t, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; } extern "C" { - pub static TCOD_desaturated_green: TCOD_color_t; + #[doc = "Create a new context with the given console size."] + #[doc = ""] + #[doc = ""] + #[doc = "Same as `TCOD_context_new_window`, but the following parameters have"] + #[doc = "different effects:"] + #[doc = ""] + #[doc = "`columns` and `rows` is the desired size of the terminal window."] + #[doc = "The actual size of the window will be derived from this and the given"] + #[doc = "`tileset`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_new_terminal( + columns: ::std::os::raw::c_int, + rows: ::std::os::raw::c_int, + renderer_type: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + vsync: bool, + sdl_window_flags: ::std::os::raw::c_int, + window_title: *const ::std::os::raw::c_char, + out: *mut *mut TCOD_Context, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Create a new context with a window of the given size."] + #[doc = ""] + #[doc = "Same as `TCOD_context_new_terminal`, but the following parameters have"] + #[doc = "different effects:"] + #[doc = ""] + #[doc = "`pixel_width` and `pixel_height` are the desired size of the window in"] + #[doc = "pixels."] + #[doc = ""] + #[doc = "`renderer_type` is a `TCOD_renderer_t` type."] + #[doc = ""] + #[doc = "`tileset` is an optional pointer to a tileset object."] + #[doc = ""] + #[doc = "If `vsync` is True, then vertical sync will be enabled whenever possible."] + #[doc = "A value of true is recommended."] + #[doc = ""] + #[doc = "`sdl_window_flags` is a bitfield of SDL_WindowFlags flags."] + #[doc = "For a window, a value of ``SDL_WINDOW_RESIZABLE`` is recommended."] + #[doc = "For fullscreen, a value of"] + #[doc = "``SDL_WINDOW_RESIZABLE | SDL_WINDOW_FULLSCREEN_DESKTOP`` is recommended."] + #[doc = "You should avoid the ``SDL_WINDOW_FULLSCREEN`` flag whenever possible."] + #[doc = ""] + #[doc = "`window_title` is the title of the opened window."] + #[doc = ""] + #[doc = "`out` is the output for the `TCOD_Context`, must not be NULL."] + #[doc = ""] + #[doc = "Returns a negative error code on failure, `out` will unlikely be set in this"] + #[doc = "case."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_new_window( + pixel_width: ::std::os::raw::c_int, + pixel_height: ::std::os::raw::c_int, + renderer_type: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + vsync: bool, + sdl_window_flags: ::std::os::raw::c_int, + window_title: *const ::std::os::raw::c_char, + out: *mut *mut TCOD_Context, + ) -> TCOD_Error; +} +#[doc = " Private map cell struct."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_MapCell { + pub transparent: bool, + pub walkable: bool, + pub fov: bool, +} +#[test] +fn bindgen_test_layout_TCOD_MapCell() { + assert_eq!( + ::std::mem::size_of::(), + 3usize, + concat!("Size of: ", stringify!(TCOD_MapCell)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_MapCell)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).transparent as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(transparent) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).walkable as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(walkable) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fov as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(fov) + ) + ); } -extern "C" { - pub static TCOD_desaturated_sea: TCOD_color_t; +#[doc = " Private map struct."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Map { + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub nbcells: ::std::os::raw::c_int, + pub cells: *mut TCOD_MapCell, } -extern "C" { - pub static TCOD_desaturated_turquoise: TCOD_color_t; +#[test] +fn bindgen_test_layout_TCOD_Map() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(TCOD_Map)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Map)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nbcells as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(nbcells) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cells as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(cells) + ) + ); } -extern "C" { - pub static TCOD_desaturated_cyan: TCOD_color_t; +impl Default for TCOD_Map { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } -extern "C" { - pub static TCOD_desaturated_sky: TCOD_color_t; +pub type TCOD_map_t = *mut TCOD_Map; +#[repr(u32)] +#[doc = " Field-of-view options."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_fov_algorithm_t { + #[doc = " Basic: http://roguebasin.roguelikedevelopment.org/index.php?title=Ray_casting"] + FOV_BASIC = 0, + #[doc = " Diamond: http://www.geocities.com/temerra/los_rays.html"] + FOV_DIAMOND = 1, + #[doc = " Shadow casting: http://roguebasin.roguelikedevelopment.org/index.php?title=FOV_using_recursive_shadowcasting"] + FOV_SHADOW = 2, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_0 = 3, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_1 = 4, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_2 = 5, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_3 = 6, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_4 = 7, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_5 = 8, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_6 = 9, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_7 = 10, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_8 = 11, + #[doc = " Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos)"] + FOV_RESTRICTIVE = 12, + #[doc = " Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos)"] + NB_FOV_ALGORITHMS = 13, } extern "C" { - pub static TCOD_desaturated_azure: TCOD_color_t; + pub fn TCOD_map_new( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> *mut TCOD_Map; } extern "C" { - pub static TCOD_desaturated_blue: TCOD_color_t; + pub fn TCOD_map_clear(map: *mut TCOD_Map, transparent: bool, walkable: bool); } extern "C" { - pub static TCOD_desaturated_han: TCOD_color_t; + pub fn TCOD_map_copy(source: *const TCOD_Map, dest: *mut TCOD_Map); } extern "C" { - pub static TCOD_desaturated_violet: TCOD_color_t; + pub fn TCOD_map_set_properties( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + is_transparent: bool, + is_walkable: bool, + ); } extern "C" { - pub static TCOD_desaturated_purple: TCOD_color_t; + pub fn TCOD_map_delete(map: *mut TCOD_Map); } extern "C" { - pub static TCOD_desaturated_fuchsia: TCOD_color_t; + pub fn TCOD_map_compute_fov( + map: *mut TCOD_Map, + player_x: ::std::os::raw::c_int, + player_y: ::std::os::raw::c_int, + max_radius: ::std::os::raw::c_int, + light_walls: bool, + algo: TCOD_fov_algorithm_t, + ); } extern "C" { - pub static TCOD_desaturated_magenta: TCOD_color_t; + pub fn TCOD_map_is_in_fov( + map: *const TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; } extern "C" { - pub static TCOD_desaturated_pink: TCOD_color_t; + pub fn TCOD_map_set_in_fov( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fov: bool, + ); } extern "C" { - pub static TCOD_desaturated_crimson: TCOD_color_t; + pub fn TCOD_map_is_transparent( + map: *const TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; } extern "C" { - pub static TCOD_brass: TCOD_color_t; + pub fn TCOD_map_is_walkable( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; } extern "C" { - pub static TCOD_copper: TCOD_color_t; + pub fn TCOD_map_get_width(map: *const TCOD_Map) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_gold: TCOD_color_t; + pub fn TCOD_map_get_height(map: *const TCOD_Map) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_silver: TCOD_color_t; + pub fn TCOD_map_get_nb_cells(map: *const TCOD_Map) -> ::std::os::raw::c_int; } extern "C" { - pub static TCOD_celadon: TCOD_color_t; + #[doc = "Return the default tileset, may be NULL."] + #[doc = ""] + #[doc = "A non-NULL return value is a new reference to the global tileset."] + #[doc = "When you are done you will need to call `TCOD_tileset_delete` on this"] + #[doc = "pointer."] + #[doc = ""] + #[doc = "This function is provisional, the API may change in the future."] + pub fn TCOD_get_default_tileset() -> *mut TCOD_Tileset; } extern "C" { - pub static TCOD_peach: TCOD_color_t; + #[doc = "Set the default tileset and update the default display to use it."] + #[doc = ""] + #[doc = "This will keep alive a reference to the given tileset. If you no longer"] + #[doc = "need the pointer then you should call `TCOD_tileset_delete` on it after"] + #[doc = "this function."] + #[doc = ""] + #[doc = "This function is provisional, the API may change in the future."] + pub fn TCOD_set_default_tileset(tileset: *mut TCOD_Tileset); } -pub type TCOD_console_t = *mut ::std::os::raw::c_void; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_keycode_t { - TCODK_NONE = 0, - TCODK_ESCAPE = 1, - TCODK_BACKSPACE = 2, - TCODK_TAB = 3, - TCODK_ENTER = 4, - TCODK_SHIFT = 5, - TCODK_CONTROL = 6, - TCODK_ALT = 7, - TCODK_PAUSE = 8, - TCODK_CAPSLOCK = 9, - TCODK_PAGEUP = 10, - TCODK_PAGEDOWN = 11, - TCODK_END = 12, - TCODK_HOME = 13, - TCODK_UP = 14, - TCODK_LEFT = 15, - TCODK_RIGHT = 16, - TCODK_DOWN = 17, - TCODK_PRINTSCREEN = 18, - TCODK_INSERT = 19, - TCODK_DELETE = 20, - TCODK_LWIN = 21, - TCODK_RWIN = 22, - TCODK_APPS = 23, - TCODK_0 = 24, - TCODK_1 = 25, - TCODK_2 = 26, - TCODK_3 = 27, - TCODK_4 = 28, - TCODK_5 = 29, - TCODK_6 = 30, - TCODK_7 = 31, - TCODK_8 = 32, - TCODK_9 = 33, - TCODK_KP0 = 34, - TCODK_KP1 = 35, - TCODK_KP2 = 36, - TCODK_KP3 = 37, - TCODK_KP4 = 38, - TCODK_KP5 = 39, - TCODK_KP6 = 40, - TCODK_KP7 = 41, - TCODK_KP8 = 42, - TCODK_KP9 = 43, - TCODK_KPADD = 44, - TCODK_KPSUB = 45, - TCODK_KPDIV = 46, - TCODK_KPMUL = 47, - TCODK_KPDEC = 48, - TCODK_KPENTER = 49, - TCODK_F1 = 50, - TCODK_F2 = 51, - TCODK_F3 = 52, - TCODK_F4 = 53, - TCODK_F5 = 54, - TCODK_F6 = 55, - TCODK_F7 = 56, - TCODK_F8 = 57, - TCODK_F9 = 58, - TCODK_F10 = 59, - TCODK_F11 = 60, - TCODK_F12 = 61, - TCODK_NUMLOCK = 62, - TCODK_SCROLLLOCK = 63, - TCODK_SPACE = 64, - TCODK_CHAR = 65, - TCODK_TEXT = 66, +pub enum TCOD_noise_type_t { + TCOD_NOISE_PERLIN = 1, + TCOD_NOISE_SIMPLEX = 2, + TCOD_NOISE_WAVELET = 4, + TCOD_NOISE_DEFAULT = 0, } #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TCOD_key_t { - pub vk: TCOD_keycode_t, - pub c: ::std::os::raw::c_char, - pub text: [::std::os::raw::c_char; 32usize], - pub pressed: bool, - pub lalt: bool, - pub lctrl: bool, - pub lmeta: bool, - pub ralt: bool, - pub rctrl: bool, - pub rmeta: bool, - pub shift: bool, +#[derive(Copy, Clone)] +pub struct TCOD_Noise { + pub ndim: ::std::os::raw::c_int, + #[doc = " Randomized map of indexes into buffer"] + pub map: [::std::os::raw::c_uchar; 256usize], + #[doc = " Random 256 x ndim buffer"] + pub buffer: [[f32; 4usize]; 256usize], + pub H: f32, + pub lacunarity: f32, + pub exponent: [f32; 128usize], + pub waveletTileData: *mut f32, + pub rand: TCOD_random_t, + pub noise_type: TCOD_noise_type_t, } #[test] -fn bindgen_test_layout_TCOD_key_t() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(TCOD_key_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(TCOD_key_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vk as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(TCOD_key_t), - "::", - stringify!(vk) - ) - ); +fn bindgen_test_layout_TCOD_Noise() { assert_eq!( - unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(TCOD_key_t), - "::", - stringify!(c) - ) + ::std::mem::size_of::(), + 4904usize, + concat!("Size of: ", stringify!(TCOD_Noise)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).text as *const _ as usize }, - 5usize, + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Noise)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Noise), "::", - stringify!(text) + stringify!(ndim) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pressed as *const _ as usize }, - 37usize, + unsafe { &(*(::std::ptr::null::())).map as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Noise), "::", - stringify!(pressed) + stringify!(map) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lalt as *const _ as usize }, - 38usize, + unsafe { &(*(::std::ptr::null::())).buffer as *const _ as usize }, + 260usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Noise), "::", - stringify!(lalt) + stringify!(buffer) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lctrl as *const _ as usize }, - 39usize, + unsafe { &(*(::std::ptr::null::())).H as *const _ as usize }, + 4356usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Noise), "::", - stringify!(lctrl) + stringify!(H) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lmeta as *const _ as usize }, - 40usize, + unsafe { &(*(::std::ptr::null::())).lacunarity as *const _ as usize }, + 4360usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Noise), "::", - stringify!(lmeta) + stringify!(lacunarity) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ralt as *const _ as usize }, - 41usize, + unsafe { &(*(::std::ptr::null::())).exponent as *const _ as usize }, + 4364usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Noise), "::", - stringify!(ralt) + stringify!(exponent) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rctrl as *const _ as usize }, - 42usize, + unsafe { &(*(::std::ptr::null::())).waveletTileData as *const _ as usize }, + 4880usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Noise), "::", - stringify!(rctrl) + stringify!(waveletTileData) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rmeta as *const _ as usize }, - 43usize, + unsafe { &(*(::std::ptr::null::())).rand as *const _ as usize }, + 4888usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Noise), "::", - stringify!(rmeta) + stringify!(rand) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).shift as *const _ as usize }, - 44usize, + unsafe { &(*(::std::ptr::null::())).noise_type as *const _ as usize }, + 4896usize, concat!( "Offset of field: ", - stringify!(TCOD_key_t), + stringify!(TCOD_Noise), "::", - stringify!(shift) + stringify!(noise_type) ) - ); -} -impl Default for TCOD_key_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_chars_t { - TCOD_CHAR_HLINE = 196, - TCOD_CHAR_VLINE = 179, - TCOD_CHAR_NE = 191, - TCOD_CHAR_NW = 218, - TCOD_CHAR_SE = 217, - TCOD_CHAR_SW = 192, - TCOD_CHAR_TEEW = 180, - TCOD_CHAR_TEEE = 195, - TCOD_CHAR_TEEN = 193, - TCOD_CHAR_TEES = 194, - TCOD_CHAR_CROSS = 197, - TCOD_CHAR_DHLINE = 205, - TCOD_CHAR_DVLINE = 186, - TCOD_CHAR_DNE = 187, - TCOD_CHAR_DNW = 201, - TCOD_CHAR_DSE = 188, - TCOD_CHAR_DSW = 200, - TCOD_CHAR_DTEEW = 185, - TCOD_CHAR_DTEEE = 204, - TCOD_CHAR_DTEEN = 202, - TCOD_CHAR_DTEES = 203, - TCOD_CHAR_DCROSS = 206, - TCOD_CHAR_BLOCK1 = 176, - TCOD_CHAR_BLOCK2 = 177, - TCOD_CHAR_BLOCK3 = 178, - TCOD_CHAR_ARROW_N = 24, - TCOD_CHAR_ARROW_S = 25, - TCOD_CHAR_ARROW_E = 26, - TCOD_CHAR_ARROW_W = 27, - TCOD_CHAR_ARROW2_N = 30, - TCOD_CHAR_ARROW2_S = 31, - TCOD_CHAR_ARROW2_E = 16, - TCOD_CHAR_ARROW2_W = 17, - TCOD_CHAR_DARROW_H = 29, - TCOD_CHAR_DARROW_V = 18, - TCOD_CHAR_CHECKBOX_UNSET = 224, - TCOD_CHAR_CHECKBOX_SET = 225, - TCOD_CHAR_RADIO_UNSET = 9, - TCOD_CHAR_RADIO_SET = 10, - TCOD_CHAR_SUBP_NW = 226, - TCOD_CHAR_SUBP_NE = 227, - TCOD_CHAR_SUBP_N = 228, - TCOD_CHAR_SUBP_SE = 229, - TCOD_CHAR_SUBP_DIAG = 230, - TCOD_CHAR_SUBP_E = 231, - TCOD_CHAR_SUBP_SW = 232, - TCOD_CHAR_SMILIE = 1, - TCOD_CHAR_SMILIE_INV = 2, - TCOD_CHAR_HEART = 3, - TCOD_CHAR_DIAMOND = 4, - TCOD_CHAR_CLUB = 5, - TCOD_CHAR_SPADE = 6, - TCOD_CHAR_BULLET = 7, - TCOD_CHAR_BULLET_INV = 8, - TCOD_CHAR_MALE = 11, - TCOD_CHAR_FEMALE = 12, - TCOD_CHAR_NOTE = 13, - TCOD_CHAR_NOTE_DOUBLE = 14, - TCOD_CHAR_LIGHT = 15, - TCOD_CHAR_EXCLAM_DOUBLE = 19, - TCOD_CHAR_PILCROW = 20, - TCOD_CHAR_SECTION = 21, - TCOD_CHAR_POUND = 156, - TCOD_CHAR_MULTIPLICATION = 158, - TCOD_CHAR_FUNCTION = 159, - TCOD_CHAR_RESERVED = 169, - TCOD_CHAR_HALF = 171, - TCOD_CHAR_ONE_QUARTER = 172, - TCOD_CHAR_COPYRIGHT = 184, - TCOD_CHAR_CENT = 189, - TCOD_CHAR_YEN = 190, - TCOD_CHAR_CURRENCY = 207, - TCOD_CHAR_THREE_QUARTERS = 243, - TCOD_CHAR_DIVISION = 246, - TCOD_CHAR_GRADE = 248, - TCOD_CHAR_UMLAUT = 249, - TCOD_CHAR_POW1 = 251, - TCOD_CHAR_POW3 = 252, - TCOD_CHAR_POW2 = 253, - TCOD_CHAR_BULLET_SQUARE = 254, -} -impl TCOD_colctrl_t { - pub const TCOD_COLCTRL_NUMBER: TCOD_colctrl_t = TCOD_colctrl_t::TCOD_COLCTRL_5; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_colctrl_t { - TCOD_COLCTRL_1 = 1, - TCOD_COLCTRL_2 = 2, - TCOD_COLCTRL_3 = 3, - TCOD_COLCTRL_4 = 4, - TCOD_COLCTRL_5 = 5, - TCOD_COLCTRL_FORE_RGB = 6, - TCOD_COLCTRL_BACK_RGB = 7, - TCOD_COLCTRL_STOP = 8, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_bkgnd_flag_t { - TCOD_BKGND_NONE = 0, - TCOD_BKGND_SET = 1, - TCOD_BKGND_MULTIPLY = 2, - TCOD_BKGND_LIGHTEN = 3, - TCOD_BKGND_DARKEN = 4, - TCOD_BKGND_SCREEN = 5, - TCOD_BKGND_COLOR_DODGE = 6, - TCOD_BKGND_COLOR_BURN = 7, - TCOD_BKGND_ADD = 8, - TCOD_BKGND_ADDA = 9, - TCOD_BKGND_BURN = 10, - TCOD_BKGND_OVERLAY = 11, - TCOD_BKGND_ALPH = 12, - TCOD_BKGND_DEFAULT = 13, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_key_status_t { - TCOD_KEY_PRESSED = 1, - TCOD_KEY_RELEASED = 2, -} -impl TCOD_font_flags_t { - #[doc = " Tiles are arranged in column-major order."] - #[doc = ""] - #[doc = " 0 3 6"] - #[doc = " 1 4 7"] - #[doc = " 2 5 8"] - pub const TCOD_FONT_LAYOUT_ASCII_INCOL: TCOD_font_flags_t = TCOD_font_flags_t(1); -} -impl TCOD_font_flags_t { - #[doc = " Tiles are arranged in row-major order."] - #[doc = ""] - #[doc = " 0 1 2"] - #[doc = " 3 4 5"] - #[doc = " 6 7 8"] - pub const TCOD_FONT_LAYOUT_ASCII_INROW: TCOD_font_flags_t = TCOD_font_flags_t(2); -} -impl TCOD_font_flags_t { - #[doc = " Converts all tiles into a monochrome gradient."] - pub const TCOD_FONT_TYPE_GREYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); -} -impl TCOD_font_flags_t { - #[doc = " Converts all tiles into a monochrome gradient."] - pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); -} -impl TCOD_font_flags_t { - #[doc = " A unique layout used by some of libtcod's fonts."] - pub const TCOD_FONT_LAYOUT_TCOD: TCOD_font_flags_t = TCOD_font_flags_t(8); -} -impl ::std::ops::BitOr for TCOD_font_flags_t { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - TCOD_font_flags_t(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for TCOD_font_flags_t { - #[inline] - fn bitor_assign(&mut self, rhs: TCOD_font_flags_t) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for TCOD_font_flags_t { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - TCOD_font_flags_t(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for TCOD_font_flags_t { - #[inline] - fn bitand_assign(&mut self, rhs: TCOD_font_flags_t) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[doc = " These font flags can be OR'd together into a bit-field and passed to"] -#[doc = " TCOD_console_set_custom_font"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub struct TCOD_font_flags_t(pub u32); -#[repr(u32)] -#[doc = " The available renderers."] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_renderer_t { - #[doc = " An OpenGL implementation using a shader."] - TCOD_RENDERER_GLSL = 0, - #[doc = " An OpenGL implementation without a shader."] - #[doc = ""] - #[doc = " Performs worse than TCOD_RENDERER_GLSL without many benefits."] - TCOD_RENDERER_OPENGL = 1, - #[doc = " A software based renderer."] - #[doc = ""] - #[doc = " The font file is loaded into RAM instead of VRAM in this implementation."] - TCOD_RENDERER_SDL = 2, - #[doc = " A software based renderer."] - #[doc = ""] - #[doc = " The font file is loaded into RAM instead of VRAM in this implementation."] - TCOD_NB_RENDERERS = 3, -} -#[repr(u32)] -#[doc = " \\enum TCOD_alignment_t"] -#[doc = ""] -#[doc = " Print justification options."] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_alignment_t { - TCOD_LEFT = 0, - TCOD_RIGHT = 1, - TCOD_CENTER = 2, + ); } -pub type TCOD_image_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_image_new( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> TCOD_image_t; +impl Default for TCOD_Noise { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } +pub type TCOD_noise_t = *mut TCOD_Noise; extern "C" { - pub fn TCOD_image_from_console(console: TCOD_console_t) -> TCOD_image_t; + pub fn TCOD_noise_new( + dimensions: ::std::os::raw::c_int, + hurst: f32, + lacunarity: f32, + random: TCOD_random_t, + ) -> TCOD_noise_t; } extern "C" { - pub fn TCOD_image_refresh_console(image: TCOD_image_t, console: TCOD_console_t); + pub fn TCOD_noise_set_type(noise: TCOD_noise_t, type_: TCOD_noise_type_t); } extern "C" { - pub fn TCOD_image_load(filename: *const ::std::os::raw::c_char) -> TCOD_image_t; + pub fn TCOD_noise_get_ex(noise: TCOD_noise_t, f: *mut f32, type_: TCOD_noise_type_t) -> f32; } extern "C" { - pub fn TCOD_image_clear(image: TCOD_image_t, color: TCOD_color_t); + pub fn TCOD_noise_get_fbm_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; } extern "C" { - pub fn TCOD_image_invert(image: TCOD_image_t); + pub fn TCOD_noise_get_turbulence_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; } extern "C" { - pub fn TCOD_image_hflip(image: TCOD_image_t); + pub fn TCOD_noise_get(noise: TCOD_noise_t, f: *mut f32) -> f32; } extern "C" { - pub fn TCOD_image_rotate90(image: TCOD_image_t, numRotations: ::std::os::raw::c_int); + pub fn TCOD_noise_get_fbm(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; } extern "C" { - pub fn TCOD_image_vflip(image: TCOD_image_t); + pub fn TCOD_noise_get_turbulence(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; } extern "C" { - pub fn TCOD_image_scale( - image: TCOD_image_t, - neww: ::std::os::raw::c_int, - newh: ::std::os::raw::c_int, - ); + pub fn TCOD_noise_delete(noise: TCOD_noise_t); } -extern "C" { - pub fn TCOD_image_save(image: TCOD_image_t, filename: *const ::std::os::raw::c_char); +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_heightmap_t { + pub w: ::std::os::raw::c_int, + pub h: ::std::os::raw::c_int, + pub values: *mut f32, } -extern "C" { - pub fn TCOD_image_get_size( - image: TCOD_image_t, - w: *mut ::std::os::raw::c_int, - h: *mut ::std::os::raw::c_int, +#[test] +fn bindgen_test_layout_TCOD_heightmap_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).values as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(values) + ) ); } -extern "C" { - pub fn TCOD_image_get_pixel( - image: TCOD_image_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> TCOD_color_t; +impl Default for TCOD_heightmap_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn TCOD_image_get_alpha( - image: TCOD_image_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub fn TCOD_heightmap_new( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_heightmap_t; } extern "C" { - pub fn TCOD_image_get_mipmap_pixel( - image: TCOD_image_t, - x0: f32, - y0: f32, - x1: f32, - y1: f32, - ) -> TCOD_color_t; + pub fn TCOD_heightmap_delete(hm: *mut TCOD_heightmap_t); } extern "C" { - pub fn TCOD_image_put_pixel( - image: TCOD_image_t, + pub fn TCOD_heightmap_get_value( + hm: *const TCOD_heightmap_t, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int, - col: TCOD_color_t, - ); + ) -> f32; } extern "C" { - pub fn TCOD_image_blit( - image: TCOD_image_t, - console: TCOD_console_t, + pub fn TCOD_heightmap_get_interpolated_value( + hm: *const TCOD_heightmap_t, x: f32, y: f32, - bkgnd_flag: TCOD_bkgnd_flag_t, - scalex: f32, - scaley: f32, - angle: f32, - ); + ) -> f32; } extern "C" { - pub fn TCOD_image_blit_rect( - image: TCOD_image_t, - console: TCOD_console_t, + pub fn TCOD_heightmap_set_value( + hm: *mut TCOD_heightmap_t, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - bkgnd_flag: TCOD_bkgnd_flag_t, - ); -} -extern "C" { - pub fn TCOD_image_blit_2x( - image: TCOD_image_t, - dest: TCOD_console_t, - dx: ::std::os::raw::c_int, - dy: ::std::os::raw::c_int, - sx: ::std::os::raw::c_int, - sy: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, + value: f32, ); } extern "C" { - pub fn TCOD_image_delete(image: TCOD_image_t); -} -extern "C" { - pub fn TCOD_image_set_key_color(image: TCOD_image_t, key_color: TCOD_color_t); -} -extern "C" { - pub fn TCOD_image_is_pixel_transparent( - image: TCOD_image_t, + pub fn TCOD_heightmap_get_slope( + hm: *const TCOD_heightmap_t, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int, - ) -> bool; -} -pub type TCOD_list_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_list_new() -> TCOD_list_t; -} -extern "C" { - pub fn TCOD_list_allocate(nb_elements: ::std::os::raw::c_int) -> TCOD_list_t; -} -extern "C" { - pub fn TCOD_list_duplicate(l: TCOD_list_t) -> TCOD_list_t; -} -extern "C" { - pub fn TCOD_list_delete(l: TCOD_list_t); -} -extern "C" { - pub fn TCOD_list_push(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); -} -extern "C" { - pub fn TCOD_list_pop(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_peek(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_add_all(l: TCOD_list_t, l2: TCOD_list_t); -} -extern "C" { - pub fn TCOD_list_get(l: TCOD_list_t, idx: ::std::os::raw::c_int) - -> *mut ::std::os::raw::c_void; + ) -> f32; } extern "C" { - pub fn TCOD_list_set( - l: TCOD_list_t, - elt: *const ::std::os::raw::c_void, - idx: ::std::os::raw::c_int, + pub fn TCOD_heightmap_get_normal( + hm: *const TCOD_heightmap_t, + x: f32, + y: f32, + n: *mut f32, + waterLevel: f32, ); } extern "C" { - pub fn TCOD_list_begin(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_end(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_reverse(l: TCOD_list_t); -} -extern "C" { - pub fn TCOD_list_remove_iterator( - l: TCOD_list_t, - elt: *mut *mut ::std::os::raw::c_void, - ) -> *mut *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn TCOD_list_remove(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); + pub fn TCOD_heightmap_count_cells( + hm: *const TCOD_heightmap_t, + min: f32, + max: f32, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_list_remove_iterator_fast( - l: TCOD_list_t, - elt: *mut *mut ::std::os::raw::c_void, - ) -> *mut *mut ::std::os::raw::c_void; + pub fn TCOD_heightmap_has_land_on_border(hm: *const TCOD_heightmap_t, waterLevel: f32) -> bool; } extern "C" { - pub fn TCOD_list_remove_fast(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); + pub fn TCOD_heightmap_get_minmax(hm: *const TCOD_heightmap_t, min: *mut f32, max: *mut f32); } extern "C" { - pub fn TCOD_list_contains(l: TCOD_list_t, elt: *const ::std::os::raw::c_void) -> bool; + pub fn TCOD_heightmap_copy(hm_source: *const TCOD_heightmap_t, hm_dest: *mut TCOD_heightmap_t); } extern "C" { - pub fn TCOD_list_clear(l: TCOD_list_t); + pub fn TCOD_heightmap_add(hm: *mut TCOD_heightmap_t, value: f32); } extern "C" { - pub fn TCOD_list_clear_and_delete(l: TCOD_list_t); + pub fn TCOD_heightmap_scale(hm: *mut TCOD_heightmap_t, value: f32); } extern "C" { - pub fn TCOD_list_size(l: TCOD_list_t) -> ::std::os::raw::c_int; + pub fn TCOD_heightmap_clamp(hm: *mut TCOD_heightmap_t, min: f32, max: f32); } extern "C" { - pub fn TCOD_list_insert_before( - l: TCOD_list_t, - elt: *const ::std::os::raw::c_void, - before: ::std::os::raw::c_int, - ) -> *mut *mut ::std::os::raw::c_void; + pub fn TCOD_heightmap_normalize(hm: *mut TCOD_heightmap_t, min: f32, max: f32); } extern "C" { - pub fn TCOD_list_is_empty(l: TCOD_list_t) -> bool; + pub fn TCOD_heightmap_clear(hm: *mut TCOD_heightmap_t); } extern "C" { - pub fn TCOD_console_init_root( - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - title: *const ::std::os::raw::c_char, - fullscreen: bool, - renderer: TCOD_renderer_t, + pub fn TCOD_heightmap_lerp_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + coef: f32, ); } extern "C" { - pub fn TCOD_console_set_window_title(title: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn TCOD_console_set_fullscreen(fullscreen: bool); + pub fn TCOD_heightmap_add_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); } extern "C" { - pub fn TCOD_console_is_fullscreen() -> bool; + pub fn TCOD_heightmap_multiply_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); } extern "C" { - pub fn TCOD_console_is_window_closed() -> bool; + pub fn TCOD_heightmap_add_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); } extern "C" { - pub fn TCOD_console_has_mouse_focus() -> bool; + pub fn TCOD_heightmap_dig_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); } extern "C" { - pub fn TCOD_console_is_active() -> bool; + pub fn TCOD_heightmap_dig_bezier( + hm: *mut TCOD_heightmap_t, + px: *mut ::std::os::raw::c_int, + py: *mut ::std::os::raw::c_int, + startRadius: f32, + startDepth: f32, + endRadius: f32, + endDepth: f32, + ); } extern "C" { - pub fn TCOD_console_set_custom_font( - fontFile: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, - nb_char_horiz: ::std::os::raw::c_int, - nb_char_vertic: ::std::os::raw::c_int, + pub fn TCOD_heightmap_rain_erosion( + hm: *mut TCOD_heightmap_t, + nbDrops: ::std::os::raw::c_int, + erosionCoef: f32, + sedimentationCoef: f32, + rnd: TCOD_random_t, ); } extern "C" { - pub fn TCOD_console_map_ascii_code_to_font( - asciiCode: ::std::os::raw::c_int, - fontCharX: ::std::os::raw::c_int, - fontCharY: ::std::os::raw::c_int, + pub fn TCOD_heightmap_kernel_transform( + hm: *mut TCOD_heightmap_t, + kernelsize: ::std::os::raw::c_int, + dx: *const ::std::os::raw::c_int, + dy: *const ::std::os::raw::c_int, + weight: *const f32, + minLevel: f32, + maxLevel: f32, ); } extern "C" { - pub fn TCOD_console_map_ascii_codes_to_font( - asciiCode: ::std::os::raw::c_int, - nbCodes: ::std::os::raw::c_int, - fontCharX: ::std::os::raw::c_int, - fontCharY: ::std::os::raw::c_int, + pub fn TCOD_heightmap_add_voronoi( + hm: *mut TCOD_heightmap_t, + nbPoints: ::std::os::raw::c_int, + nbCoef: ::std::os::raw::c_int, + coef: *const f32, + rnd: TCOD_random_t, ); } extern "C" { - pub fn TCOD_console_map_string_to_font( - s: *const ::std::os::raw::c_char, - fontCharX: ::std::os::raw::c_int, - fontCharY: ::std::os::raw::c_int, + pub fn TCOD_heightmap_mid_point_displacement( + hm: *mut TCOD_heightmap_t, + rnd: TCOD_random_t, + roughness: f32, ); } extern "C" { - pub fn TCOD_console_set_dirty( - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, + pub fn TCOD_heightmap_add_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, ); } extern "C" { - pub fn TCOD_console_set_default_background(con: TCOD_console_t, col: TCOD_color_t); + pub fn TCOD_heightmap_scale_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, + ); } extern "C" { - pub fn TCOD_console_set_default_foreground(con: TCOD_console_t, col: TCOD_color_t); + pub fn TCOD_heightmap_islandify(hm: *mut TCOD_heightmap_t, seaLevel: f32, rnd: TCOD_random_t); } -extern "C" { - pub fn TCOD_console_clear(con: TCOD_console_t); +#[repr(C)] +#[derive(Copy, Clone)] +pub struct TCOD_lex_t { + pub file_line: ::std::os::raw::c_int, + pub token_type: ::std::os::raw::c_int, + pub token_int_val: ::std::os::raw::c_int, + pub token_idx: ::std::os::raw::c_int, + pub token_float_val: f32, + pub tok: *mut ::std::os::raw::c_char, + pub toklen: ::std::os::raw::c_int, + pub lastStringDelim: ::std::os::raw::c_char, + pub pos: *mut ::std::os::raw::c_char, + pub buf: *mut ::std::os::raw::c_char, + pub filename: *mut ::std::os::raw::c_char, + pub last_javadoc_comment: *mut ::std::os::raw::c_char, + pub nb_symbols: ::std::os::raw::c_int, + pub nb_keywords: ::std::os::raw::c_int, + pub flags: ::std::os::raw::c_int, + pub symbols: [[::std::os::raw::c_char; 5usize]; 100usize], + pub keywords: [[::std::os::raw::c_char; 20usize]; 100usize], + pub simpleCmt: *const ::std::os::raw::c_char, + pub cmtStart: *const ::std::os::raw::c_char, + pub cmtStop: *const ::std::os::raw::c_char, + pub javadocCmtStart: *const ::std::os::raw::c_char, + pub stringDelim: *const ::std::os::raw::c_char, + pub javadoc_read: bool, + pub allocBuf: bool, + pub savept: bool, } -extern "C" { - pub fn TCOD_console_set_char_background( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - col: TCOD_color_t, - flag: TCOD_bkgnd_flag_t, +#[test] +fn bindgen_test_layout_TCOD_lex_t() { + assert_eq!( + ::std::mem::size_of::(), + 2632usize, + concat!("Size of: ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).file_line as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(file_line) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_type as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_type) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_int_val as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_int_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_idx as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_idx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_float_val as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_float_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tok as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(tok) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).toklen as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(toklen) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lastStringDelim as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(lastStringDelim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pos as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(pos) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).filename as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(filename) + ) ); -} -extern "C" { - pub fn TCOD_console_set_char_foreground( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - col: TCOD_color_t, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_javadoc_comment as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(last_javadoc_comment) + ) ); -} -extern "C" { - pub fn TCOD_console_set_char( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - c: ::std::os::raw::c_int, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_symbols as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_symbols) + ) ); -} -extern "C" { - pub fn TCOD_console_put_char( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - c: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_keywords as *const _ as usize }, + 76usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_keywords) + ) ); -} -extern "C" { - pub fn TCOD_console_put_char_ex( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - c: ::std::os::raw::c_int, - fore: TCOD_color_t, - back: TCOD_color_t, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(flags) + ) ); -} -extern "C" { - pub fn TCOD_console_set_background_flag(con: TCOD_console_t, flag: TCOD_bkgnd_flag_t); -} -extern "C" { - pub fn TCOD_console_get_background_flag(con: TCOD_console_t) -> TCOD_bkgnd_flag_t; -} -extern "C" { - pub fn TCOD_console_set_alignment(con: TCOD_console_t, alignment: TCOD_alignment_t); -} -extern "C" { - pub fn TCOD_console_get_alignment(con: TCOD_console_t) -> TCOD_alignment_t; -} -extern "C" { - pub fn TCOD_console_print( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - fmt: *const ::std::os::raw::c_char, - ... + assert_eq!( + unsafe { &(*(::std::ptr::null::())).symbols as *const _ as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(symbols) + ) ); -} -extern "C" { - pub fn TCOD_console_print_ex( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - alignment: TCOD_alignment_t, - fmt: *const ::std::os::raw::c_char, - ... + assert_eq!( + unsafe { &(*(::std::ptr::null::())).keywords as *const _ as usize }, + 584usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(keywords) + ) ); -} -extern "C" { - pub fn TCOD_console_print_rect( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_print_rect_ex( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - alignment: TCOD_alignment_t, - fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_get_height_rect( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_rect( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - clear: bool, - flag: TCOD_bkgnd_flag_t, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).simpleCmt as *const _ as usize }, + 2584usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(simpleCmt) + ) ); -} -extern "C" { - pub fn TCOD_console_hline( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - l: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStart as *const _ as usize }, + 2592usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStart) + ) ); -} -extern "C" { - pub fn TCOD_console_vline( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - l: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStop as *const _ as usize }, + 2600usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStop) + ) ); -} -extern "C" { - pub fn TCOD_console_print_frame( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - empty: bool, - flag: TCOD_bkgnd_flag_t, - fmt: *const ::std::os::raw::c_char, - ... + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadocCmtStart as *const _ as usize }, + 2608usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadocCmtStart) + ) ); -} -extern "C" { - pub fn TCOD_console_map_string_to_font_utf( - s: *const wchar_t, - fontCharX: ::std::os::raw::c_int, - fontCharY: ::std::os::raw::c_int, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stringDelim as *const _ as usize }, + 2616usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(stringDelim) + ) ); -} -extern "C" { - pub fn TCOD_console_print_utf( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - fmt: *const wchar_t, - ... + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadoc_read as *const _ as usize }, + 2624usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadoc_read) + ) ); -} -extern "C" { - pub fn TCOD_console_print_ex_utf( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - alignment: TCOD_alignment_t, - fmt: *const wchar_t, - ... + assert_eq!( + unsafe { &(*(::std::ptr::null::())).allocBuf as *const _ as usize }, + 2625usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(allocBuf) + ) ); -} -extern "C" { - pub fn TCOD_console_print_rect_utf( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - fmt: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_print_rect_ex_utf( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - flag: TCOD_bkgnd_flag_t, - alignment: TCOD_alignment_t, - fmt: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_get_height_rect_utf( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - fmt: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_get_default_background(con: TCOD_console_t) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_console_get_default_foreground(con: TCOD_console_t) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_console_get_char_background( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_console_get_char_foreground( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_console_get_char( - con: TCOD_console_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_get_background_color_image(con: TCOD_console_t) -> TCOD_image_t; -} -extern "C" { - pub fn TCOD_console_get_foreground_color_image(con: TCOD_console_t) -> TCOD_image_t; -} -extern "C" { - pub fn TCOD_console_set_fade(val: u8, fade: TCOD_color_t); -} -extern "C" { - pub fn TCOD_console_get_fade() -> u8; -} -extern "C" { - pub fn TCOD_console_get_fading_color() -> TCOD_color_t; -} -extern "C" { - pub fn TCOD_console_flush(); -} -extern "C" { - pub fn TCOD_console_set_color_control( - con: TCOD_colctrl_t, - fore: TCOD_color_t, - back: TCOD_color_t, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).savept as *const _ as usize }, + 2626usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(savept) + ) ); } -extern "C" { - pub fn TCOD_console_check_for_keypress(flags: ::std::os::raw::c_int) -> TCOD_key_t; -} -extern "C" { - pub fn TCOD_console_wait_for_keypress(flush: bool) -> TCOD_key_t; -} -extern "C" { - pub fn TCOD_console_is_key_pressed(key: TCOD_keycode_t) -> bool; +impl Default for TCOD_lex_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn TCOD_console_from_file(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; + pub fn TCOD_lex_new_intern() -> *mut TCOD_lex_t; } extern "C" { - pub fn TCOD_console_load_asc( - con: TCOD_console_t, - filename: *const ::std::os::raw::c_char, - ) -> bool; + pub fn TCOD_lex_new( + symbols: *mut *const ::std::os::raw::c_char, + keywords: *mut *const ::std::os::raw::c_char, + simpleComment: *const ::std::os::raw::c_char, + commentStart: *const ::std::os::raw::c_char, + commentStop: *const ::std::os::raw::c_char, + javadocCommentStart: *const ::std::os::raw::c_char, + stringDelim: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + ) -> *mut TCOD_lex_t; } extern "C" { - pub fn TCOD_console_load_apf( - con: TCOD_console_t, - filename: *const ::std::os::raw::c_char, - ) -> bool; + pub fn TCOD_lex_delete(lex: *mut TCOD_lex_t); } extern "C" { - pub fn TCOD_console_save_asc( - con: TCOD_console_t, - filename: *const ::std::os::raw::c_char, - ) -> bool; + pub fn TCOD_lex_set_data_buffer(lex: *mut TCOD_lex_t, dat: *mut ::std::os::raw::c_char); } extern "C" { - pub fn TCOD_console_save_apf( - con: TCOD_console_t, + pub fn TCOD_lex_set_data_file( + lex: *mut TCOD_lex_t, filename: *const ::std::os::raw::c_char, ) -> bool; } extern "C" { - pub fn TCOD_console_new(w: ::std::os::raw::c_int, h: ::std::os::raw::c_int) -> TCOD_console_t; -} -extern "C" { - pub fn TCOD_console_get_width(con: TCOD_console_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_get_height(con: TCOD_console_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_console_set_key_color(con: TCOD_console_t, col: TCOD_color_t); -} -extern "C" { - pub fn TCOD_console_blit( - src: TCOD_console_t, - xSrc: ::std::os::raw::c_int, - ySrc: ::std::os::raw::c_int, - wSrc: ::std::os::raw::c_int, - hSrc: ::std::os::raw::c_int, - dst: TCOD_console_t, - xDst: ::std::os::raw::c_int, - yDst: ::std::os::raw::c_int, - foreground_alpha: f32, - background_alpha: f32, - ); -} -extern "C" { - pub fn TCOD_console_delete(console: TCOD_console_t); -} -extern "C" { - pub fn TCOD_console_credits(); -} -extern "C" { - pub fn TCOD_console_credits_reset(); -} -extern "C" { - pub fn TCOD_console_credits_render( - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - alpha: bool, - ) -> bool; + pub fn TCOD_lex_parse(lex: *mut TCOD_lex_t) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_console_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; + pub fn TCOD_lex_parse_until_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_console_load_xp( - con: TCOD_console_t, - filename: *const ::std::os::raw::c_char, - ) -> bool; + pub fn TCOD_lex_parse_until_token_value( + lex: *mut TCOD_lex_t, + token_value: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_console_save_xp( - con: TCOD_console_t, - filename: *const ::std::os::raw::c_char, - compress_level: ::std::os::raw::c_int, + pub fn TCOD_lex_expect_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, ) -> bool; } extern "C" { - pub fn TCOD_console_list_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_list_t; -} -extern "C" { - pub fn TCOD_console_list_save_xp( - console_list: TCOD_list_t, - filename: *const ::std::os::raw::c_char, - compress_level: ::std::os::raw::c_int, + pub fn TCOD_lex_expect_token_value( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + token_value: *const ::std::os::raw::c_char, ) -> bool; } -pub type TCOD_map_t = *mut ::std::os::raw::c_void; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_fov_algorithm_t { - FOV_BASIC = 0, - FOV_DIAMOND = 1, - FOV_SHADOW = 2, - FOV_PERMISSIVE_0 = 3, - FOV_PERMISSIVE_1 = 4, - FOV_PERMISSIVE_2 = 5, - FOV_PERMISSIVE_3 = 6, - FOV_PERMISSIVE_4 = 7, - FOV_PERMISSIVE_5 = 8, - FOV_PERMISSIVE_6 = 9, - FOV_PERMISSIVE_7 = 10, - FOV_PERMISSIVE_8 = 11, - FOV_RESTRICTIVE = 12, - NB_FOV_ALGORITHMS = 13, -} -extern "C" { - pub fn TCOD_map_new(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int) -> TCOD_map_t; -} extern "C" { - pub fn TCOD_map_clear(map: TCOD_map_t, transparent: bool, walkable: bool); + pub fn TCOD_lex_savepoint(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); } extern "C" { - pub fn TCOD_map_copy(source: TCOD_map_t, dest: TCOD_map_t); + pub fn TCOD_lex_restore(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); } extern "C" { - pub fn TCOD_map_set_properties( - map: TCOD_map_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - is_transparent: bool, - is_walkable: bool, - ); + pub fn TCOD_lex_get_last_javadoc(lex: *mut TCOD_lex_t) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn TCOD_map_delete(map: TCOD_map_t); + pub fn TCOD_lex_get_token_name( + token_type: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn TCOD_map_compute_fov( - map: TCOD_map_t, - player_x: ::std::os::raw::c_int, - player_y: ::std::os::raw::c_int, - max_radius: ::std::os::raw::c_int, - light_walls: bool, - algo: TCOD_fov_algorithm_t, - ); + pub fn TCOD_lex_get_last_error() -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn TCOD_map_is_in_fov( - map: TCOD_map_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; + pub fn TCOD_lex_hextoint(c: ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_map_set_in_fov( - map: TCOD_map_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - fov: bool, - ); + pub fn TCOD_random_get_instance() -> TCOD_random_t; } extern "C" { - pub fn TCOD_map_is_transparent( - map: TCOD_map_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; + pub fn TCOD_random_new(algo: TCOD_random_algo_t) -> TCOD_random_t; } extern "C" { - pub fn TCOD_map_is_walkable( - map: TCOD_map_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; + pub fn TCOD_random_save(mersenne: TCOD_random_t) -> TCOD_random_t; } extern "C" { - pub fn TCOD_map_get_width(map: TCOD_map_t) -> ::std::os::raw::c_int; + pub fn TCOD_random_restore(mersenne: TCOD_random_t, backup: TCOD_random_t); } extern "C" { - pub fn TCOD_map_get_height(map: TCOD_map_t) -> ::std::os::raw::c_int; + pub fn TCOD_random_new_from_seed(algo: TCOD_random_algo_t, seed: u32) -> TCOD_random_t; } extern "C" { - pub fn TCOD_map_get_nb_cells(map: TCOD_map_t) -> ::std::os::raw::c_int; + pub fn TCOD_random_delete(mersenne: TCOD_random_t); } -pub type TCOD_noise_t = *mut ::std::os::raw::c_void; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_noise_type_t { - TCOD_NOISE_PERLIN = 1, - TCOD_NOISE_SIMPLEX = 2, - TCOD_NOISE_WAVELET = 4, - TCOD_NOISE_DEFAULT = 0, +extern "C" { + pub fn TCOD_random_set_distribution(mersenne: TCOD_random_t, distribution: TCOD_distribution_t); } extern "C" { - pub fn TCOD_noise_new( - dimensions: ::std::os::raw::c_int, - hurst: f32, - lacunarity: f32, - random: TCOD_random_t, - ) -> TCOD_noise_t; + pub fn TCOD_random_get_int( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_noise_set_type(noise: TCOD_noise_t, type_: TCOD_noise_type_t); + pub fn TCOD_random_get_float(mersenne: TCOD_random_t, min: f32, max: f32) -> f32; } extern "C" { - pub fn TCOD_noise_get_ex(noise: TCOD_noise_t, f: *mut f32, type_: TCOD_noise_type_t) -> f32; + pub fn TCOD_random_get_double(mersenne: TCOD_random_t, min: f64, max: f64) -> f64; } extern "C" { - pub fn TCOD_noise_get_fbm_ex( - noise: TCOD_noise_t, - f: *mut f32, - octaves: f32, - type_: TCOD_noise_type_t, - ) -> f32; + pub fn TCOD_random_get_int_mean( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + mean: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_noise_get_turbulence_ex( - noise: TCOD_noise_t, - f: *mut f32, - octaves: f32, - type_: TCOD_noise_type_t, + pub fn TCOD_random_get_float_mean( + mersenne: TCOD_random_t, + min: f32, + max: f32, + mean: f32, ) -> f32; } extern "C" { - pub fn TCOD_noise_get(noise: TCOD_noise_t, f: *mut f32) -> f32; + pub fn TCOD_random_get_double_mean( + mersenne: TCOD_random_t, + min: f64, + max: f64, + mean: f64, + ) -> f64; } extern "C" { - pub fn TCOD_noise_get_fbm(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; + pub fn TCOD_random_dice_new(s: *const ::std::os::raw::c_char) -> TCOD_dice_t; } extern "C" { - pub fn TCOD_noise_get_turbulence(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; + pub fn TCOD_random_dice_roll( + mersenne: TCOD_random_t, + dice: TCOD_dice_t, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_noise_delete(noise: TCOD_noise_t); + pub fn TCOD_random_dice_roll_s( + mersenne: TCOD_random_t, + s: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TCOD_heightmap_t { - pub w: ::std::os::raw::c_int, - pub h: ::std::os::raw::c_int, - pub values: *mut f32, +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_mouse_t { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub dx: ::std::os::raw::c_int, + pub dy: ::std::os::raw::c_int, + pub cx: ::std::os::raw::c_int, + pub cy: ::std::os::raw::c_int, + pub dcx: ::std::os::raw::c_int, + pub dcy: ::std::os::raw::c_int, + pub lbutton: bool, + pub rbutton: bool, + pub mbutton: bool, + pub lbutton_pressed: bool, + pub rbutton_pressed: bool, + pub mbutton_pressed: bool, + pub wheel_up: bool, + pub wheel_down: bool, } #[test] -fn bindgen_test_layout_TCOD_heightmap_t() { +fn bindgen_test_layout_TCOD_mouse_t() { assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(TCOD_heightmap_t)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_mouse_t)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(TCOD_heightmap_t)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_mouse_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_heightmap_t), + stringify!(TCOD_mouse_t), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dx as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dy as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cx as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cy as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcx as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcy as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton as *const _ as usize }, + 33usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton as *const _ as usize }, + 34usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(mbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton_pressed as *const _ as usize }, + 35usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton_pressed as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton_pressed as *const _ as usize }, + 37usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), "::", - stringify!(w) + stringify!(mbutton_pressed) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).wheel_up as *const _ as usize }, + 38usize, concat!( "Offset of field: ", - stringify!(TCOD_heightmap_t), + stringify!(TCOD_mouse_t), "::", - stringify!(h) + stringify!(wheel_up) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).values as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).wheel_down as *const _ as usize }, + 39usize, concat!( "Offset of field: ", - stringify!(TCOD_heightmap_t), + stringify!(TCOD_mouse_t), "::", - stringify!(values) + stringify!(wheel_down) ) ); } -impl Default for TCOD_heightmap_t { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } +extern "C" { + pub fn TCOD_mouse_show_cursor(visible: bool); } extern "C" { - pub fn TCOD_heightmap_new( - w: ::std::os::raw::c_int, - h: ::std::os::raw::c_int, - ) -> *mut TCOD_heightmap_t; + pub fn TCOD_mouse_get_status() -> TCOD_mouse_t; } extern "C" { - pub fn TCOD_heightmap_delete(hm: *mut TCOD_heightmap_t); + pub fn TCOD_mouse_is_cursor_visible() -> bool; } extern "C" { - pub fn TCOD_heightmap_get_value( - hm: *const TCOD_heightmap_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> f32; + pub fn TCOD_mouse_move(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); } extern "C" { - pub fn TCOD_heightmap_get_interpolated_value( - hm: *const TCOD_heightmap_t, - x: f32, - y: f32, - ) -> f32; + pub fn TCOD_mouse_includes_touch(enable: bool); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_NameGen { + _unused: [u8; 0], } +pub type TCOD_namegen_t = *mut TCOD_NameGen; extern "C" { - pub fn TCOD_heightmap_set_value( - hm: *mut TCOD_heightmap_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - value: f32, - ); + pub fn TCOD_namegen_parse(filename: *const ::std::os::raw::c_char, random: TCOD_random_t); } extern "C" { - pub fn TCOD_heightmap_get_slope( - hm: *const TCOD_heightmap_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> f32; + pub fn TCOD_namegen_generate( + name: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn TCOD_heightmap_get_normal( - hm: *const TCOD_heightmap_t, - x: f32, - y: f32, - n: *mut f32, - waterLevel: f32, - ); + pub fn TCOD_namegen_generate_custom( + name: *mut ::std::os::raw::c_char, + rule: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn TCOD_heightmap_count_cells( - hm: *const TCOD_heightmap_t, - min: f32, - max: f32, - ) -> ::std::os::raw::c_int; + pub fn TCOD_namegen_get_sets() -> TCOD_list_t; } extern "C" { - pub fn TCOD_heightmap_has_land_on_border(hm: *const TCOD_heightmap_t, waterLevel: f32) -> bool; + pub fn TCOD_namegen_destroy(); +} +pub type TCOD_path_func_t = ::std::option::Option< + unsafe extern "C" fn( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + user_data: *mut ::std::os::raw::c_void, + ) -> f32, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Path { + _unused: [u8; 0], } +pub type TCOD_path_t = *mut TCOD_Path; extern "C" { - pub fn TCOD_heightmap_get_minmax(hm: *const TCOD_heightmap_t, min: *mut f32, max: *mut f32); + pub fn TCOD_path_new_using_map(map: TCOD_map_t, diagonalCost: f32) -> TCOD_path_t; } extern "C" { - pub fn TCOD_heightmap_copy(hm_source: *const TCOD_heightmap_t, hm_dest: *mut TCOD_heightmap_t); + pub fn TCOD_path_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_path_t; } extern "C" { - pub fn TCOD_heightmap_add(hm: *mut TCOD_heightmap_t, value: f32); + pub fn TCOD_path_compute( + path: TCOD_path_t, + ox: ::std::os::raw::c_int, + oy: ::std::os::raw::c_int, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + ) -> bool; } extern "C" { - pub fn TCOD_heightmap_scale(hm: *mut TCOD_heightmap_t, value: f32); + pub fn TCOD_path_walk( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + recalculate_when_needed: bool, + ) -> bool; } extern "C" { - pub fn TCOD_heightmap_clamp(hm: *mut TCOD_heightmap_t, min: f32, max: f32); + pub fn TCOD_path_is_empty(path: TCOD_path_t) -> bool; } extern "C" { - pub fn TCOD_heightmap_normalize(hm: *mut TCOD_heightmap_t, min: f32, max: f32); + pub fn TCOD_path_size(path: TCOD_path_t) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_heightmap_clear(hm: *mut TCOD_heightmap_t); + pub fn TCOD_path_reverse(path: TCOD_path_t); } extern "C" { - pub fn TCOD_heightmap_lerp_hm( - hm1: *const TCOD_heightmap_t, - hm2: *const TCOD_heightmap_t, - hmres: *mut TCOD_heightmap_t, - coef: f32, + pub fn TCOD_path_get( + path: TCOD_path_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, ); } extern "C" { - pub fn TCOD_heightmap_add_hm( - hm1: *const TCOD_heightmap_t, - hm2: *const TCOD_heightmap_t, - hmres: *mut TCOD_heightmap_t, + pub fn TCOD_path_get_origin( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, ); } extern "C" { - pub fn TCOD_heightmap_multiply_hm( - hm1: *const TCOD_heightmap_t, - hm2: *const TCOD_heightmap_t, - hmres: *mut TCOD_heightmap_t, + pub fn TCOD_path_get_destination( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, ); } extern "C" { - pub fn TCOD_heightmap_add_hill( - hm: *mut TCOD_heightmap_t, - hx: f32, - hy: f32, - hradius: f32, - hheight: f32, + pub fn TCOD_path_delete(path: TCOD_path_t); +} +#[doc = " Dijkstra data structure"] +#[doc = ""] +#[doc = " All attributes are considered private."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Dijkstra { + pub diagonal_cost: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub nodes_max: ::std::os::raw::c_int, + pub map: TCOD_map_t, + pub func: TCOD_path_func_t, + pub user_data: *mut ::std::os::raw::c_void, + pub distances: *mut ::std::os::raw::c_uint, + pub nodes: *mut ::std::os::raw::c_uint, + pub path: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_Dijkstra() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(TCOD_Dijkstra)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Dijkstra)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).diagonal_cost as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(diagonal_cost) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nodes_max as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(nodes_max) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).map as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(map) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).func as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(func) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).user_data as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(user_data) + ) ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).distances as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(distances) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nodes as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(nodes) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).path as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(path) + ) + ); +} +impl Default for TCOD_Dijkstra { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_dijkstra_t = *mut TCOD_Dijkstra; +extern "C" { + pub fn TCOD_dijkstra_new(map: TCOD_map_t, diagonalCost: f32) -> TCOD_dijkstra_t; +} +extern "C" { + pub fn TCOD_dijkstra_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_dijkstra_t; } extern "C" { - pub fn TCOD_heightmap_dig_hill( - hm: *mut TCOD_heightmap_t, - hx: f32, - hy: f32, - hradius: f32, - hheight: f32, + pub fn TCOD_dijkstra_compute( + dijkstra: TCOD_dijkstra_t, + root_x: ::std::os::raw::c_int, + root_y: ::std::os::raw::c_int, ); } extern "C" { - pub fn TCOD_heightmap_dig_bezier( - hm: *mut TCOD_heightmap_t, - px: *mut ::std::os::raw::c_int, - py: *mut ::std::os::raw::c_int, - startRadius: f32, - startDepth: f32, - endRadius: f32, - endDepth: f32, - ); + pub fn TCOD_dijkstra_get_distance( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; } extern "C" { - pub fn TCOD_heightmap_rain_erosion( - hm: *mut TCOD_heightmap_t, - nbDrops: ::std::os::raw::c_int, - erosionCoef: f32, - sedimentationCoef: f32, - rnd: TCOD_random_t, - ); + pub fn TCOD_dijkstra_path_set( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; } extern "C" { - pub fn TCOD_heightmap_kernel_transform( - hm: *mut TCOD_heightmap_t, - kernelsize: ::std::os::raw::c_int, - dx: *const ::std::os::raw::c_int, - dy: *const ::std::os::raw::c_int, - weight: *const f32, - minLevel: f32, - maxLevel: f32, - ); + pub fn TCOD_dijkstra_is_empty(path: TCOD_dijkstra_t) -> bool; } extern "C" { - pub fn TCOD_heightmap_add_voronoi( - hm: *mut TCOD_heightmap_t, - nbPoints: ::std::os::raw::c_int, - nbCoef: ::std::os::raw::c_int, - coef: *const f32, - rnd: TCOD_random_t, - ); + pub fn TCOD_dijkstra_size(path: TCOD_dijkstra_t) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_heightmap_mid_point_displacement( - hm: *mut TCOD_heightmap_t, - rnd: TCOD_random_t, - roughness: f32, - ); + pub fn TCOD_dijkstra_reverse(path: TCOD_dijkstra_t); } extern "C" { - pub fn TCOD_heightmap_add_fbm( - hm: *mut TCOD_heightmap_t, - noise: TCOD_noise_t, - mulx: f32, - muly: f32, - addx: f32, - addy: f32, - octaves: f32, - delta: f32, - scale: f32, + pub fn TCOD_dijkstra_get( + path: TCOD_dijkstra_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, ); } extern "C" { - pub fn TCOD_heightmap_scale_fbm( - hm: *mut TCOD_heightmap_t, - noise: TCOD_noise_t, - mulx: f32, - muly: f32, - addx: f32, - addy: f32, - octaves: f32, - delta: f32, - scale: f32, - ); + pub fn TCOD_dijkstra_path_walk( + dijkstra: TCOD_dijkstra_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ) -> bool; } extern "C" { - pub fn TCOD_heightmap_islandify(hm: *mut TCOD_heightmap_t, seaLevel: f32, rnd: TCOD_random_t); + pub fn TCOD_dijkstra_delete(dijkstra: TCOD_dijkstra_t); } #[repr(C)] -#[derive(Copy, Clone)] -pub struct TCOD_lex_t { - pub file_line: ::std::os::raw::c_int, - pub token_type: ::std::os::raw::c_int, - pub token_int_val: ::std::os::raw::c_int, - pub token_idx: ::std::os::raw::c_int, - pub token_float_val: f32, - pub tok: *mut ::std::os::raw::c_char, - pub toklen: ::std::os::raw::c_int, - pub lastStringDelim: ::std::os::raw::c_char, - pub pos: *mut ::std::os::raw::c_char, - pub buf: *mut ::std::os::raw::c_char, - pub filename: *mut ::std::os::raw::c_char, - pub last_javadoc_comment: *mut ::std::os::raw::c_char, - pub nb_symbols: ::std::os::raw::c_int, - pub nb_keywords: ::std::os::raw::c_int, - pub flags: ::std::os::raw::c_int, - pub symbols: [[::std::os::raw::c_char; 5usize]; 100usize], - pub keywords: [[::std::os::raw::c_char; 20usize]; 100usize], - pub simpleCmt: *const ::std::os::raw::c_char, - pub cmtStart: *const ::std::os::raw::c_char, - pub cmtStop: *const ::std::os::raw::c_char, - pub javadocCmtStart: *const ::std::os::raw::c_char, - pub stringDelim: *const ::std::os::raw::c_char, - pub javadoc_read: bool, - pub allocBuf: bool, - pub savept: bool, +#[repr(align(16))] +#[derive(Debug, Default, Copy, Clone)] +pub struct max_align_t { + pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, + pub __bindgen_padding_0: u64, + pub __clang_max_align_nonce2: u128, } #[test] -fn bindgen_test_layout_TCOD_lex_t() { +fn bindgen_test_layout_max_align_t() { assert_eq!( - ::std::mem::size_of::(), - 2632usize, - concat!("Size of: ", stringify!(TCOD_lex_t)) + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(max_align_t)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(TCOD_lex_t)) + ::std::mem::align_of::(), + 16usize, + concat!("Alignment of ", stringify!(max_align_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).file_line as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::())).__clang_max_align_nonce1 as *const _ as usize + }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(max_align_t), "::", - stringify!(file_line) + stringify!(__clang_max_align_nonce1) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).token_type as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::())).__clang_max_align_nonce2 as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(max_align_t), + "::", + stringify!(__clang_max_align_nonce2) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default)] +pub struct TCOD_HeapNode { + pub priority: ::std::os::raw::c_int, + pub data: __IncompleteArrayField<::std::os::raw::c_uchar>, +} +#[test] +fn bindgen_test_layout_TCOD_HeapNode() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(TCOD_HeapNode)) + ); + assert_eq!( + ::std::mem::align_of::(), 4usize, + concat!("Alignment of ", stringify!(TCOD_HeapNode)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).priority as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_HeapNode), "::", - stringify!(token_type) + stringify!(priority) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).token_int_val as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_HeapNode), "::", - stringify!(token_int_val) + stringify!(data) ) ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Heap { + pub heap: *mut TCOD_HeapNode, + pub size: ::std::os::raw::c_int, + pub capacity: ::std::os::raw::c_int, + pub node_size: size_t, + pub data_size: size_t, +} +#[test] +fn bindgen_test_layout_TCOD_Heap() { assert_eq!( - unsafe { &(*(::std::ptr::null::())).token_idx as *const _ as usize }, - 12usize, + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(TCOD_Heap)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Heap)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Heap), "::", - stringify!(token_idx) + stringify!(heap) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).token_float_val as *const _ as usize }, - 16usize, + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Heap), "::", - stringify!(token_float_val) + stringify!(size) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).tok as *const _ as usize }, - 24usize, + unsafe { &(*(::std::ptr::null::())).capacity as *const _ as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Heap), "::", - stringify!(tok) + stringify!(capacity) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).toklen as *const _ as usize }, - 32usize, + unsafe { &(*(::std::ptr::null::())).node_size as *const _ as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Heap), "::", - stringify!(toklen) + stringify!(node_size) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lastStringDelim as *const _ as usize }, - 36usize, + unsafe { &(*(::std::ptr::null::())).data_size as *const _ as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Heap), "::", - stringify!(lastStringDelim) + stringify!(data_size) ) ); +} +impl Default for TCOD_Heap { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_heap_init(heap: *mut TCOD_Heap, data_size: size_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_heap_uninit(heap: *mut TCOD_Heap); +} +extern "C" { + pub fn TCOD_heap_clear(heap: *mut TCOD_Heap); +} +extern "C" { + pub fn TCOD_minheap_push( + minheap: *mut TCOD_Heap, + priority: ::std::os::raw::c_int, + data: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_minheap_pop(minheap: *mut TCOD_Heap, out: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_minheap_heapify(minheap: *mut TCOD_Heap); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_ArrayData { + pub ndim: i8, + pub int_type: ::std::os::raw::c_int, + pub shape: [size_t; 5usize], + pub strides: [size_t; 5usize], + pub data: *mut ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_TCOD_ArrayData() { + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(TCOD_ArrayData)) + ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pos as *const _ as usize }, - 40usize, + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_ArrayData)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_ArrayData), "::", - stringify!(pos) + stringify!(ndim) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, - 48usize, + unsafe { &(*(::std::ptr::null::())).int_type as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_ArrayData), "::", - stringify!(buf) + stringify!(int_type) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).filename as *const _ as usize }, - 56usize, + unsafe { &(*(::std::ptr::null::())).shape as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_ArrayData), "::", - stringify!(filename) + stringify!(shape) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).last_javadoc_comment as *const _ as usize }, - 64usize, + unsafe { &(*(::std::ptr::null::())).strides as *const _ as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_ArrayData), "::", - stringify!(last_javadoc_comment) + stringify!(strides) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).nb_symbols as *const _ as usize }, - 72usize, + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 88usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_ArrayData), "::", - stringify!(nb_symbols) + stringify!(data) ) ); +} +impl Default for TCOD_ArrayData { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_BasicGraph2D { + pub cost: TCOD_ArrayData, + pub cardinal: ::std::os::raw::c_int, + pub diagonal: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_BasicGraph2D() { + assert_eq!( + ::std::mem::size_of::(), + 104usize, + concat!("Size of: ", stringify!(TCOD_BasicGraph2D)) + ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).nb_keywords as *const _ as usize }, - 76usize, + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_BasicGraph2D)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cost as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_BasicGraph2D), "::", - stringify!(nb_keywords) + stringify!(cost) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 80usize, + unsafe { &(*(::std::ptr::null::())).cardinal as *const _ as usize }, + 96usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_BasicGraph2D), "::", - stringify!(flags) + stringify!(cardinal) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).symbols as *const _ as usize }, - 84usize, + unsafe { &(*(::std::ptr::null::())).diagonal as *const _ as usize }, + 100usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_BasicGraph2D), "::", - stringify!(symbols) + stringify!(diagonal) ) ); +} +impl Default for TCOD_BasicGraph2D { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Pathfinder { + pub ndim: i8, + pub shape: [size_t; 4usize], + pub owns_distance: bool, + pub owns_graph: bool, + pub owns_traversal: bool, + pub distance: TCOD_ArrayData, + pub graph: TCOD_BasicGraph2D, + pub traversal: TCOD_ArrayData, + pub heap: TCOD_Heap, +} +#[test] +fn bindgen_test_layout_TCOD_Pathfinder() { + assert_eq!( + ::std::mem::size_of::(), + 376usize, + concat!("Size of: ", stringify!(TCOD_Pathfinder)) + ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).keywords as *const _ as usize }, - 584usize, + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Pathfinder)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(keywords) + stringify!(ndim) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).simpleCmt as *const _ as usize }, - 2584usize, + unsafe { &(*(::std::ptr::null::())).shape as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(simpleCmt) + stringify!(shape) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cmtStart as *const _ as usize }, - 2592usize, + unsafe { &(*(::std::ptr::null::())).owns_distance as *const _ as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(cmtStart) + stringify!(owns_distance) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cmtStop as *const _ as usize }, - 2600usize, + unsafe { &(*(::std::ptr::null::())).owns_graph as *const _ as usize }, + 41usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(cmtStop) + stringify!(owns_graph) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).javadocCmtStart as *const _ as usize }, - 2608usize, + unsafe { &(*(::std::ptr::null::())).owns_traversal as *const _ as usize }, + 42usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(javadocCmtStart) + stringify!(owns_traversal) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).stringDelim as *const _ as usize }, - 2616usize, + unsafe { &(*(::std::ptr::null::())).distance as *const _ as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(stringDelim) + stringify!(distance) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).javadoc_read as *const _ as usize }, - 2624usize, + unsafe { &(*(::std::ptr::null::())).graph as *const _ as usize }, + 144usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(javadoc_read) + stringify!(graph) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).allocBuf as *const _ as usize }, - 2625usize, + unsafe { &(*(::std::ptr::null::())).traversal as *const _ as usize }, + 248usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(allocBuf) + stringify!(traversal) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).savept as *const _ as usize }, - 2626usize, + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 344usize, concat!( "Offset of field: ", - stringify!(TCOD_lex_t), + stringify!(TCOD_Pathfinder), "::", - stringify!(savept) + stringify!(heap) ) ); } -impl Default for TCOD_lex_t { +impl Default for TCOD_Pathfinder { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } extern "C" { - pub fn TCOD_lex_new_intern() -> *mut TCOD_lex_t; -} -extern "C" { - pub fn TCOD_lex_new( - symbols: *mut *const ::std::os::raw::c_char, - keywords: *mut *const ::std::os::raw::c_char, - simpleComment: *const ::std::os::raw::c_char, - commentStart: *const ::std::os::raw::c_char, - commentStop: *const ::std::os::raw::c_char, - javadocCommentStart: *const ::std::os::raw::c_char, - stringDelim: *const ::std::os::raw::c_char, - flags: ::std::os::raw::c_int, - ) -> *mut TCOD_lex_t; -} -extern "C" { - pub fn TCOD_lex_delete(lex: *mut TCOD_lex_t); -} -extern "C" { - pub fn TCOD_lex_set_data_buffer(lex: *mut TCOD_lex_t, dat: *mut ::std::os::raw::c_char); -} -extern "C" { - pub fn TCOD_lex_set_data_file( - lex: *mut TCOD_lex_t, - filename: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn TCOD_lex_parse(lex: *mut TCOD_lex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_lex_parse_until_token_type( - lex: *mut TCOD_lex_t, - token_type: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_lex_parse_until_token_value( - lex: *mut TCOD_lex_t, - token_value: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_lex_expect_token_type( - lex: *mut TCOD_lex_t, - token_type: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn TCOD_lex_expect_token_value( - lex: *mut TCOD_lex_t, - token_type: ::std::os::raw::c_int, - token_value: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn TCOD_lex_savepoint(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); -} -extern "C" { - pub fn TCOD_lex_restore(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); -} -extern "C" { - pub fn TCOD_lex_get_last_javadoc(lex: *mut TCOD_lex_t) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_lex_get_token_name( - token_type: ::std::os::raw::c_int, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_lex_get_last_error() -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_lex_hextoint(c: ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_random_get_instance() -> TCOD_random_t; + pub fn TCOD_pf_new(ndim: ::std::os::raw::c_int, shape: *const size_t) -> *mut TCOD_Pathfinder; } extern "C" { - pub fn TCOD_random_new(algo: TCOD_random_algo_t) -> TCOD_random_t; -} -extern "C" { - pub fn TCOD_random_save(mersenne: TCOD_random_t) -> TCOD_random_t; + pub fn TCOD_pf_delete(path: *mut TCOD_Pathfinder); } extern "C" { - pub fn TCOD_random_restore(mersenne: TCOD_random_t, backup: TCOD_random_t); + pub fn TCOD_pf_set_distance_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + ); } extern "C" { - pub fn TCOD_random_new_from_seed(algo: TCOD_random_algo_t, seed: u32) -> TCOD_random_t; + pub fn TCOD_pf_set_graph2d_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + cardinal: ::std::os::raw::c_int, + diagonal: ::std::os::raw::c_int, + ); } extern "C" { - pub fn TCOD_random_delete(mersenne: TCOD_random_t); + pub fn TCOD_pf_set_traversal_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + ); } extern "C" { - pub fn TCOD_random_set_distribution(mersenne: TCOD_random_t, distribution: TCOD_distribution_t); + pub fn TCOD_pf_recompile(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_random_get_int( - mersenne: TCOD_random_t, - min: ::std::os::raw::c_int, - max: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub fn TCOD_pf_compute(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_random_get_float(mersenne: TCOD_random_t, min: f32, max: f32) -> f32; + pub fn TCOD_pf_compute_step(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; } -extern "C" { - pub fn TCOD_random_get_double(mersenne: TCOD_random_t, min: f64, max: f64) -> f64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Frontier { + pub ndim: i8, + pub active_dist: ::std::os::raw::c_int, + pub active_index: [::std::os::raw::c_int; 4usize], + pub heap: TCOD_Heap, } -extern "C" { - pub fn TCOD_random_get_int_mean( - mersenne: TCOD_random_t, - min: ::std::os::raw::c_int, - max: ::std::os::raw::c_int, - mean: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; +#[test] +fn bindgen_test_layout_TCOD_Frontier() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(TCOD_Frontier)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Frontier)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).active_dist as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(active_dist) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).active_index as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(active_index) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(heap) + ) + ); } -extern "C" { - pub fn TCOD_random_get_float_mean( - mersenne: TCOD_random_t, - min: f32, - max: f32, - mean: f32, - ) -> f32; +impl Default for TCOD_Frontier { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn TCOD_random_get_double_mean( - mersenne: TCOD_random_t, - min: f64, - max: f64, - mean: f64, - ) -> f64; + #[doc = "Create a new pathfinder frontier."] + #[doc = ""] + #[doc = "`ndim` is the number of dimensions. Must be in the range `1 <= n <= 4`."] + pub fn TCOD_frontier_new(ndim: ::std::os::raw::c_int) -> *mut TCOD_Frontier; } extern "C" { - pub fn TCOD_random_dice_new(s: *const ::std::os::raw::c_char) -> TCOD_dice_t; + #[doc = "Delete a pathfinder frontier."] + pub fn TCOD_frontier_delete(frontier: *mut TCOD_Frontier); } extern "C" { - pub fn TCOD_random_dice_roll( - mersenne: TCOD_random_t, - dice: TCOD_dice_t, - ) -> ::std::os::raw::c_int; + #[doc = "Pop the next node from this frontier."] + #[doc = ""] + #[doc = "The popped node variables will placed in the `active_dist` and"] + #[doc = "`active_index` attributes."] + pub fn TCOD_frontier_pop(frontier: *mut TCOD_Frontier) -> TCOD_Error; } extern "C" { - pub fn TCOD_random_dice_roll_s( - mersenne: TCOD_random_t, - s: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; + #[doc = "Add a node to this frontier."] + #[doc = ""] + #[doc = "`index[frontier->ndim]` is the position of the node to add to the frontier."] + #[doc = ""] + #[doc = "`dist` is the total distance of the node. This should be a low number"] + #[doc = "like 0, but can also be a negative number such as `INT_MIN`."] + #[doc = "When adding a node as an edge then `dist` is `frontier->active_dist` plus"] + #[doc = "the cost of the edge."] + #[doc = ""] + #[doc = "`heuristic` is the true priority of the node, used to affect node order."] + #[doc = "For Dijkstra-like algorithms this should be the same as `dist`."] + #[doc = "For A* this should be `dist` plus the maximum possible distance to the"] + #[doc = "goal."] + pub fn TCOD_frontier_push( + frontier: *mut TCOD_Frontier, + index: *const ::std::os::raw::c_int, + dist: ::std::os::raw::c_int, + heuristic: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return the current number of nodes in this frontier."] + pub fn TCOD_frontier_size(frontier: *const TCOD_Frontier) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Remove all nodes from this frontier."] + pub fn TCOD_frontier_clear(frontier: *mut TCOD_Frontier) -> TCOD_Error; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_value_type_t { + TCOD_TYPE_NONE = 0, + TCOD_TYPE_BOOL = 1, + TCOD_TYPE_CHAR = 2, + TCOD_TYPE_INT = 3, + TCOD_TYPE_FLOAT = 4, + TCOD_TYPE_STRING = 5, + TCOD_TYPE_COLOR = 6, + TCOD_TYPE_DICE = 7, + TCOD_TYPE_VALUELIST00 = 8, + TCOD_TYPE_VALUELIST01 = 9, + TCOD_TYPE_VALUELIST02 = 10, + TCOD_TYPE_VALUELIST03 = 11, + TCOD_TYPE_VALUELIST04 = 12, + TCOD_TYPE_VALUELIST05 = 13, + TCOD_TYPE_VALUELIST06 = 14, + TCOD_TYPE_VALUELIST07 = 15, + TCOD_TYPE_VALUELIST08 = 16, + TCOD_TYPE_VALUELIST09 = 17, + TCOD_TYPE_VALUELIST10 = 18, + TCOD_TYPE_VALUELIST11 = 19, + TCOD_TYPE_VALUELIST12 = 20, + TCOD_TYPE_VALUELIST13 = 21, + TCOD_TYPE_VALUELIST14 = 22, + TCOD_TYPE_VALUELIST15 = 23, + TCOD_TYPE_CUSTOM00 = 24, + TCOD_TYPE_CUSTOM01 = 25, + TCOD_TYPE_CUSTOM02 = 26, + TCOD_TYPE_CUSTOM03 = 27, + TCOD_TYPE_CUSTOM04 = 28, + TCOD_TYPE_CUSTOM05 = 29, + TCOD_TYPE_CUSTOM06 = 30, + TCOD_TYPE_CUSTOM07 = 31, + TCOD_TYPE_CUSTOM08 = 32, + TCOD_TYPE_CUSTOM09 = 33, + TCOD_TYPE_CUSTOM10 = 34, + TCOD_TYPE_CUSTOM11 = 35, + TCOD_TYPE_CUSTOM12 = 36, + TCOD_TYPE_CUSTOM13 = 37, + TCOD_TYPE_CUSTOM14 = 38, + TCOD_TYPE_CUSTOM15 = 39, + TCOD_TYPE_LIST = 1024, } #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct TCOD_mouse_t { - pub x: ::std::os::raw::c_int, - pub y: ::std::os::raw::c_int, - pub dx: ::std::os::raw::c_int, - pub dy: ::std::os::raw::c_int, - pub cx: ::std::os::raw::c_int, - pub cy: ::std::os::raw::c_int, - pub dcx: ::std::os::raw::c_int, - pub dcy: ::std::os::raw::c_int, - pub lbutton: bool, - pub rbutton: bool, - pub mbutton: bool, - pub lbutton_pressed: bool, - pub rbutton_pressed: bool, - pub mbutton_pressed: bool, - pub wheel_up: bool, - pub wheel_down: bool, +#[derive(Copy, Clone)] +pub union TCOD_value_t { + pub b: bool, + pub c: ::std::os::raw::c_char, + pub i: i32, + pub f: f32, + pub s: *mut ::std::os::raw::c_char, + pub col: TCOD_color_t, + pub dice: TCOD_dice_t, + pub list: TCOD_list_t, + pub custom: *mut ::std::os::raw::c_void, + _bindgen_union_align: [u64; 2usize], } #[test] -fn bindgen_test_layout_TCOD_mouse_t() { +fn bindgen_test_layout_TCOD_value_t() { assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(TCOD_mouse_t)) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_value_t)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(TCOD_mouse_t)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_value_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(x) + stringify!(b) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(y) + stringify!(c) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dx as *const _ as usize }, - 8usize, + unsafe { &(*(::std::ptr::null::())).i as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(dx) + stringify!(i) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dy as *const _ as usize }, - 12usize, + unsafe { &(*(::std::ptr::null::())).f as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(dy) + stringify!(f) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cx as *const _ as usize }, - 16usize, + unsafe { &(*(::std::ptr::null::())).s as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(cx) + stringify!(s) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cy as *const _ as usize }, - 20usize, + unsafe { &(*(::std::ptr::null::())).col as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(cy) + stringify!(col) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dcx as *const _ as usize }, - 24usize, + unsafe { &(*(::std::ptr::null::())).dice as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(dcx) + stringify!(dice) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dcy as *const _ as usize }, - 28usize, + unsafe { &(*(::std::ptr::null::())).list as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(dcy) + stringify!(list) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lbutton as *const _ as usize }, - 32usize, + unsafe { &(*(::std::ptr::null::())).custom as *const _ as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_value_t), "::", - stringify!(lbutton) + stringify!(custom) ) ); +} +impl Default for TCOD_value_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_parser_struct_t = *mut TCOD_ParserStruct; +extern "C" { + pub fn TCOD_struct_get_name(def: TCOD_parser_struct_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_struct_add_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_list_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list_sized( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + size: ::std::os::raw::c_int, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_flag(def: TCOD_parser_struct_t, propname: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_struct_add_structure( + def: TCOD_parser_struct_t, + sub_structure: TCOD_parser_struct_t, + ); +} +extern "C" { + pub fn TCOD_struct_is_mandatory( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_struct_get_type( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> TCOD_value_type_t; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_parser_listener_t { + pub new_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub new_flag: + ::std::option::Option bool>, + pub new_property: ::std::option::Option< + unsafe extern "C" fn( + propname: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + value: TCOD_value_t, + ) -> bool, + >, + pub end_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub error: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_TCOD_parser_listener_t() { assert_eq!( - unsafe { &(*(::std::ptr::null::())).rbutton as *const _ as usize }, - 33usize, - concat!( - "Offset of field: ", - stringify!(TCOD_mouse_t), - "::", - stringify!(rbutton) - ) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_parser_listener_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mbutton as *const _ as usize }, - 34usize, - concat!( - "Offset of field: ", - stringify!(TCOD_mouse_t), - "::", - stringify!(mbutton) - ) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_parser_listener_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lbutton_pressed as *const _ as usize }, - 35usize, + unsafe { + &(*(::std::ptr::null::())).new_struct as *const _ as usize + }, + 0usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_parser_listener_t), "::", - stringify!(lbutton_pressed) + stringify!(new_struct) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).rbutton_pressed as *const _ as usize }, - 36usize, + unsafe { &(*(::std::ptr::null::())).new_flag as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_parser_listener_t), "::", - stringify!(rbutton_pressed) + stringify!(new_flag) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mbutton_pressed as *const _ as usize }, - 37usize, + unsafe { + &(*(::std::ptr::null::())).new_property as *const _ as usize + }, + 16usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_parser_listener_t), "::", - stringify!(mbutton_pressed) + stringify!(new_property) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).wheel_up as *const _ as usize }, - 38usize, + unsafe { + &(*(::std::ptr::null::())).end_struct as *const _ as usize + }, + 24usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_parser_listener_t), "::", - stringify!(wheel_up) + stringify!(end_struct) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).wheel_down as *const _ as usize }, - 39usize, + unsafe { &(*(::std::ptr::null::())).error as *const _ as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(TCOD_mouse_t), + stringify!(TCOD_parser_listener_t), "::", - stringify!(wheel_down) + stringify!(error) ) ); } +pub type TCOD_parser_custom_t = ::std::option::Option< + unsafe extern "C" fn( + lex: *mut TCOD_lex_t, + listener: *mut TCOD_parser_listener_t, + str: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + ) -> TCOD_value_t, +>; +pub type TCOD_parser_t = *mut TCOD_Parser; extern "C" { - pub fn TCOD_mouse_show_cursor(visible: bool); + pub fn TCOD_parser_new() -> TCOD_parser_t; } extern "C" { - pub fn TCOD_mouse_get_status() -> TCOD_mouse_t; + pub fn TCOD_parser_new_struct( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_parser_struct_t; } extern "C" { - pub fn TCOD_mouse_is_cursor_visible() -> bool; + pub fn TCOD_parser_new_custom_type( + parser: TCOD_parser_t, + custom_type_parser: TCOD_parser_custom_t, + ) -> TCOD_value_type_t; } extern "C" { - pub fn TCOD_mouse_move(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); + pub fn TCOD_parser_run( + parser: TCOD_parser_t, + filename: *const ::std::os::raw::c_char, + listener: *mut TCOD_parser_listener_t, + ); } extern "C" { - pub fn TCOD_mouse_includes_touch(enable: bool); + pub fn TCOD_parser_delete(parser: TCOD_parser_t); } -pub type TCOD_namegen_t = *mut ::std::os::raw::c_void; extern "C" { - pub fn TCOD_namegen_parse(filename: *const ::std::os::raw::c_char, random: TCOD_random_t); + pub fn TCOD_parser_error(msg: *const ::std::os::raw::c_char, ...); } extern "C" { - pub fn TCOD_namegen_generate( - name: *mut ::std::os::raw::c_char, - allocate: bool, - ) -> *mut ::std::os::raw::c_char; + pub fn TCOD_parser_has_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; } extern "C" { - pub fn TCOD_namegen_generate_custom( - name: *mut ::std::os::raw::c_char, - rule: *mut ::std::os::raw::c_char, - allocate: bool, - ) -> *mut ::std::os::raw::c_char; + pub fn TCOD_parser_get_bool_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; } extern "C" { - pub fn TCOD_namegen_get_sets() -> TCOD_list_t; + pub fn TCOD_parser_get_char_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn TCOD_namegen_destroy(); + pub fn TCOD_parser_get_int_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } -pub type TCOD_path_func_t = ::std::option::Option< - unsafe extern "C" fn( - xFrom: ::std::os::raw::c_int, - yFrom: ::std::os::raw::c_int, - xTo: ::std::os::raw::c_int, - yTo: ::std::os::raw::c_int, - user_data: *mut ::std::os::raw::c_void, - ) -> f32, ->; -pub type TCOD_path_t = *mut ::std::os::raw::c_void; extern "C" { - pub fn TCOD_path_new_using_map(map: TCOD_map_t, diagonalCost: f32) -> TCOD_path_t; + pub fn TCOD_parser_get_float_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> f32; } extern "C" { - pub fn TCOD_path_new_using_function( - map_width: ::std::os::raw::c_int, - map_height: ::std::os::raw::c_int, - func: TCOD_path_func_t, - user_data: *mut ::std::os::raw::c_void, - diagonalCost: f32, - ) -> TCOD_path_t; + pub fn TCOD_parser_get_string_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn TCOD_path_compute( - path: TCOD_path_t, - ox: ::std::os::raw::c_int, - oy: ::std::os::raw::c_int, - dx: ::std::os::raw::c_int, - dy: ::std::os::raw::c_int, - ) -> bool; + pub fn TCOD_parser_get_color_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_color_t; } extern "C" { - pub fn TCOD_path_walk( - path: TCOD_path_t, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int, - recalculate_when_needed: bool, - ) -> bool; + pub fn TCOD_parser_get_dice_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_dice_t; } extern "C" { - pub fn TCOD_path_is_empty(path: TCOD_path_t) -> bool; + pub fn TCOD_parser_get_dice_property_py( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + dice: *mut TCOD_dice_t, + ); +} +extern "C" { + pub fn TCOD_parser_get_custom_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_parser_get_list_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + ) -> TCOD_list_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_ParserStruct { + pub name: *mut ::std::os::raw::c_char, + pub flags: TCOD_list_t, + pub props: TCOD_list_t, + pub lists: TCOD_list_t, + pub structs: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_ParserStruct() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_ParserStruct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_ParserStruct)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(props) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lists as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(lists) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(structs) + ) + ); } -extern "C" { - pub fn TCOD_path_size(path: TCOD_path_t) -> ::std::os::raw::c_int; +impl Default for TCOD_ParserStruct { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } -extern "C" { - pub fn TCOD_path_reverse(path: TCOD_path_t); +pub type TCOD_struct_int_t = TCOD_ParserStruct; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Parser { + pub structs: TCOD_list_t, + pub customs: [TCOD_parser_custom_t; 16usize], + pub fatal: bool, + pub props: TCOD_list_t, } -extern "C" { - pub fn TCOD_path_get( - path: TCOD_path_t, - index: ::std::os::raw::c_int, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int, +#[test] +fn bindgen_test_layout_TCOD_Parser() { + assert_eq!( + ::std::mem::size_of::(), + 152usize, + concat!("Size of: ", stringify!(TCOD_Parser)) ); -} -extern "C" { - pub fn TCOD_path_get_origin( - path: TCOD_path_t, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int, + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Parser)) ); -} -extern "C" { - pub fn TCOD_path_get_destination( - path: TCOD_path_t, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int, + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(structs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).customs as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(customs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fatal as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(fatal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(props) + ) ); } -extern "C" { - pub fn TCOD_path_delete(path: TCOD_path_t); +impl Default for TCOD_Parser { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } -pub type TCOD_dijkstra_t = *mut ::std::os::raw::c_void; +pub type TCOD_parser_int_t = TCOD_Parser; extern "C" { - pub fn TCOD_dijkstra_new(map: TCOD_map_t, diagonalCost: f32) -> TCOD_dijkstra_t; + pub fn TCOD_parse_bool_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_new_using_function( - map_width: ::std::os::raw::c_int, - map_height: ::std::os::raw::c_int, - func: TCOD_path_func_t, - user_data: *mut ::std::os::raw::c_void, - diagonalCost: f32, - ) -> TCOD_dijkstra_t; + pub fn TCOD_parse_char_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_compute( - dijkstra: TCOD_dijkstra_t, - root_x: ::std::os::raw::c_int, - root_y: ::std::os::raw::c_int, - ); + pub fn TCOD_parse_integer_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_get_distance( - dijkstra: TCOD_dijkstra_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> f32; + pub fn TCOD_parse_float_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_path_set( - dijkstra: TCOD_dijkstra_t, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; + pub fn TCOD_parse_string_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_is_empty(path: TCOD_dijkstra_t) -> bool; + pub fn TCOD_parse_color_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_size(path: TCOD_dijkstra_t) -> ::std::os::raw::c_int; + pub fn TCOD_parse_dice_value() -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_reverse(path: TCOD_dijkstra_t); + pub fn TCOD_parse_value_list_value( + def: *mut TCOD_struct_int_t, + listnum: ::std::os::raw::c_int, + ) -> TCOD_value_t; } extern "C" { - pub fn TCOD_dijkstra_get( - path: TCOD_dijkstra_t, - index: ::std::os::raw::c_int, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int, - ); + pub fn TCOD_parse_property_value( + parser: *mut TCOD_parser_int_t, + def: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + list: bool, + ) -> TCOD_value_t; } -extern "C" { - pub fn TCOD_dijkstra_path_walk( - dijkstra: TCOD_dijkstra_t, - x: *mut ::std::os::raw::c_int, - y: *mut ::std::os::raw::c_int, - ) -> bool; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetAtlasOpenGL { + pub tileset: *mut TCOD_Tileset, + pub observer: *mut TCOD_TilesetObserver, + pub texture: u32, + pub texture_size: ::std::os::raw::c_int, + pub texture_columns: ::std::os::raw::c_int, + pub texture_rows: ::std::os::raw::c_int, } -extern "C" { - pub fn TCOD_dijkstra_delete(dijkstra: TCOD_dijkstra_t); +#[test] +fn bindgen_test_layout_TCOD_TilesetAtlasOpenGL() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(TCOD_TilesetAtlasOpenGL)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_TilesetAtlasOpenGL)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(tileset) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).observer as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(observer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_size as *const _ as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_columns as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_columns) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_rows as *const _ as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_rows) + ) + ); } -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TCOD_value_type_t { - TCOD_TYPE_NONE = 0, - TCOD_TYPE_BOOL = 1, - TCOD_TYPE_CHAR = 2, - TCOD_TYPE_INT = 3, - TCOD_TYPE_FLOAT = 4, - TCOD_TYPE_STRING = 5, - TCOD_TYPE_COLOR = 6, - TCOD_TYPE_DICE = 7, - TCOD_TYPE_VALUELIST00 = 8, - TCOD_TYPE_VALUELIST01 = 9, - TCOD_TYPE_VALUELIST02 = 10, - TCOD_TYPE_VALUELIST03 = 11, - TCOD_TYPE_VALUELIST04 = 12, - TCOD_TYPE_VALUELIST05 = 13, - TCOD_TYPE_VALUELIST06 = 14, - TCOD_TYPE_VALUELIST07 = 15, - TCOD_TYPE_VALUELIST08 = 16, - TCOD_TYPE_VALUELIST09 = 17, - TCOD_TYPE_VALUELIST10 = 18, - TCOD_TYPE_VALUELIST11 = 19, - TCOD_TYPE_VALUELIST12 = 20, - TCOD_TYPE_VALUELIST13 = 21, - TCOD_TYPE_VALUELIST14 = 22, - TCOD_TYPE_VALUELIST15 = 23, - TCOD_TYPE_CUSTOM00 = 24, - TCOD_TYPE_CUSTOM01 = 25, - TCOD_TYPE_CUSTOM02 = 26, - TCOD_TYPE_CUSTOM03 = 27, - TCOD_TYPE_CUSTOM04 = 28, - TCOD_TYPE_CUSTOM05 = 29, - TCOD_TYPE_CUSTOM06 = 30, - TCOD_TYPE_CUSTOM07 = 31, - TCOD_TYPE_CUSTOM08 = 32, - TCOD_TYPE_CUSTOM09 = 33, - TCOD_TYPE_CUSTOM10 = 34, - TCOD_TYPE_CUSTOM11 = 35, - TCOD_TYPE_CUSTOM12 = 36, - TCOD_TYPE_CUSTOM13 = 37, - TCOD_TYPE_CUSTOM14 = 38, - TCOD_TYPE_CUSTOM15 = 39, - TCOD_TYPE_LIST = 1024, +impl Default for TCOD_TilesetAtlasOpenGL { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } -#[repr(C)] -#[derive(Copy, Clone)] -pub union TCOD_value_t { - pub b: bool, - pub c: ::std::os::raw::c_char, - pub i: i32, - pub f: f32, - pub s: *mut ::std::os::raw::c_char, - pub col: TCOD_color_t, - pub dice: TCOD_dice_t, - pub list: TCOD_list_t, - pub custom: *mut ::std::os::raw::c_void, - _bindgen_union_align: [u64; 2usize], +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGLCommon { + pub window: *mut SDL_Window, + pub glcontext: *mut ::std::os::raw::c_void, + pub atlas: *mut TCOD_TilesetAtlasOpenGL, + pub sdl_subsystems: u32, + pub last_offset_x: f64, + pub last_offset_y: f64, + pub last_scale_x: f64, + pub last_scale_y: f64, } #[test] -fn bindgen_test_layout_TCOD_value_t() { +fn bindgen_test_layout_TCOD_RendererGLCommon() { assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(TCOD_value_t)) + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(TCOD_RendererGLCommon)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TCOD_value_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(TCOD_value_t), - "::", - stringify!(b) - ) + concat!("Alignment of ", stringify!(TCOD_RendererGLCommon)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(c) + stringify!(window) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).i as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).glcontext as *const _ as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(i) + stringify!(glcontext) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).f as *const _ as usize }, - 0usize, + unsafe { &(*(::std::ptr::null::())).atlas as *const _ as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(f) + stringify!(atlas) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).s as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).sdl_subsystems as *const _ as usize + }, + 24usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(s) + stringify!(sdl_subsystems) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).col as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).last_offset_x as *const _ as usize + }, + 32usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(col) + stringify!(last_offset_x) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).dice as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).last_offset_y as *const _ as usize + }, + 40usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(dice) + stringify!(last_offset_y) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).list as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).last_scale_x as *const _ as usize + }, + 48usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(list) + stringify!(last_scale_x) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).custom as *const _ as usize }, - 0usize, + unsafe { + &(*(::std::ptr::null::())).last_scale_y as *const _ as usize + }, + 56usize, concat!( "Offset of field: ", - stringify!(TCOD_value_t), + stringify!(TCOD_RendererGLCommon), "::", - stringify!(custom) + stringify!(last_scale_y) ) ); } -impl Default for TCOD_value_t { +impl Default for TCOD_RendererGLCommon { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } -pub type TCOD_parser_struct_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_struct_get_name(def: TCOD_parser_struct_t) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TCOD_struct_add_property( - def: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - type_: TCOD_value_type_t, - mandatory: bool, - ); -} -extern "C" { - pub fn TCOD_struct_add_list_property( - def: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - type_: TCOD_value_type_t, - mandatory: bool, - ); -} -extern "C" { - pub fn TCOD_struct_add_value_list( - def: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - value_list: *mut *const ::std::os::raw::c_char, - mandatory: bool, - ); -} -extern "C" { - pub fn TCOD_struct_add_value_list_sized( - def: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - value_list: *mut *const ::std::os::raw::c_char, - size: ::std::os::raw::c_int, - mandatory: bool, - ); -} -extern "C" { - pub fn TCOD_struct_add_flag(def: TCOD_parser_struct_t, propname: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn TCOD_struct_add_structure( - def: TCOD_parser_struct_t, - sub_structure: TCOD_parser_struct_t, - ); -} extern "C" { - pub fn TCOD_struct_is_mandatory( - def: TCOD_parser_struct_t, - propname: *const ::std::os::raw::c_char, - ) -> bool; + pub fn TCOD_gl_atlas_new(tileset: *mut TCOD_Tileset) -> *mut TCOD_TilesetAtlasOpenGL; } extern "C" { - pub fn TCOD_struct_get_type( - def: TCOD_parser_struct_t, - propname: *const ::std::os::raw::c_char, - ) -> TCOD_value_type_t; + pub fn TCOD_gl_atlas_delete(atlas: *mut TCOD_TilesetAtlasOpenGL); } #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct TCOD_parser_listener_t { - pub new_struct: ::std::option::Option< - unsafe extern "C" fn( - str: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - ) -> bool, - >, - pub new_flag: - ::std::option::Option bool>, - pub new_property: ::std::option::Option< - unsafe extern "C" fn( - propname: *const ::std::os::raw::c_char, - type_: TCOD_value_type_t, - value: TCOD_value_t, - ) -> bool, - >, - pub end_struct: ::std::option::Option< - unsafe extern "C" fn( - str: TCOD_parser_struct_t, - name: *const ::std::os::raw::c_char, - ) -> bool, - >, - pub error: ::std::option::Option, +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGL1 { + pub common: TCOD_RendererGLCommon, + pub background_texture: u32, + pub background_width: ::std::os::raw::c_int, + pub background_height: ::std::os::raw::c_int, } #[test] -fn bindgen_test_layout_TCOD_parser_listener_t() { +fn bindgen_test_layout_TCOD_RendererGL1() { assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(TCOD_parser_listener_t)) + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(TCOD_RendererGL1)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TCOD_parser_listener_t)) + concat!("Alignment of ", stringify!(TCOD_RendererGL1)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).new_struct as *const _ as usize - }, + unsafe { &(*(::std::ptr::null::())).common as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_listener_t), - "::", - stringify!(new_struct) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).new_flag as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(TCOD_parser_listener_t), + stringify!(TCOD_RendererGL1), "::", - stringify!(new_flag) + stringify!(common) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).new_property as *const _ as usize + &(*(::std::ptr::null::())).background_texture as *const _ as usize }, - 16usize, + 64usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_listener_t), + stringify!(TCOD_RendererGL1), "::", - stringify!(new_property) + stringify!(background_texture) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).end_struct as *const _ as usize + &(*(::std::ptr::null::())).background_width as *const _ as usize }, - 24usize, + 68usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_listener_t), + stringify!(TCOD_RendererGL1), "::", - stringify!(end_struct) + stringify!(background_width) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).error as *const _ as usize }, - 32usize, + unsafe { + &(*(::std::ptr::null::())).background_height as *const _ as usize + }, + 72usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_listener_t), + stringify!(TCOD_RendererGL1), "::", - stringify!(error) + stringify!(background_height) ) ); } -pub type TCOD_parser_custom_t = ::std::option::Option< - unsafe extern "C" fn( - lex: *mut TCOD_lex_t, - listener: *mut TCOD_parser_listener_t, - str: TCOD_parser_struct_t, - propname: *mut ::std::os::raw::c_char, - ) -> TCOD_value_t, ->; -pub type TCOD_parser_t = *mut ::std::os::raw::c_void; -extern "C" { - pub fn TCOD_parser_new() -> TCOD_parser_t; -} -extern "C" { - pub fn TCOD_parser_new_struct( - parser: TCOD_parser_t, - name: *mut ::std::os::raw::c_char, - ) -> TCOD_parser_struct_t; -} -extern "C" { - pub fn TCOD_parser_new_custom_type( - parser: TCOD_parser_t, - custom_type_parser: TCOD_parser_custom_t, - ) -> TCOD_value_type_t; -} -extern "C" { - pub fn TCOD_parser_run( - parser: TCOD_parser_t, - filename: *const ::std::os::raw::c_char, - listener: *mut TCOD_parser_listener_t, - ); -} -extern "C" { - pub fn TCOD_parser_delete(parser: TCOD_parser_t); -} -extern "C" { - pub fn TCOD_parser_error(msg: *const ::std::os::raw::c_char, ...); -} -extern "C" { - pub fn TCOD_parser_has_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn TCOD_parser_get_bool_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn TCOD_parser_get_char_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_parser_get_int_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TCOD_parser_get_float_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> f32; -} -extern "C" { - pub fn TCOD_parser_get_string_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; +impl Default for TCOD_RendererGL1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn TCOD_parser_get_color_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> TCOD_color_t; + pub fn TCOD_renderer_init_gl1( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + vsync: bool, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; } -extern "C" { - pub fn TCOD_parser_get_dice_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> TCOD_dice_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGL2 { + pub common: TCOD_RendererGLCommon, + pub program: u32, + pub console_textures: [u32; 3usize], + pub console_width: ::std::os::raw::c_int, + pub console_height: ::std::os::raw::c_int, + pub vertex_buffer: u32, } -extern "C" { - pub fn TCOD_parser_get_dice_property_py( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - dice: *mut TCOD_dice_t, +#[test] +fn bindgen_test_layout_TCOD_RendererGL2() { + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(TCOD_RendererGL2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererGL2)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).common as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(common) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).program as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(program) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).console_textures as *const _ as usize + }, + 68usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_textures) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).console_width as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).console_height as *const _ as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vertex_buffer as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(vertex_buffer) + ) ); } -extern "C" { - pub fn TCOD_parser_get_custom_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_void; +impl Default for TCOD_RendererGL2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } extern "C" { - pub fn TCOD_parser_get_list_property( - parser: TCOD_parser_t, - name: *const ::std::os::raw::c_char, - type_: TCOD_value_type_t, - ) -> TCOD_list_t; + pub fn TCOD_renderer_new_gl2( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + vsync: bool, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct TCOD_struct_int_t { - pub name: *mut ::std::os::raw::c_char, - pub flags: TCOD_list_t, - pub props: TCOD_list_t, - pub lists: TCOD_list_t, - pub structs: TCOD_list_t, +pub struct SDL_Texture { + _unused: [u8; 0], +} +#[doc = "An SDL2 tileset atlas. This prepares a tileset for use with SDL2."] +#[doc = "\\rst"] +#[doc = ".. versionadded:: 1.16"] +#[doc = "\\endrst"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetAtlasSDL2 { + #[doc = " The renderer used to create this atlas."] + pub renderer: *mut SDL_Renderer, + #[doc = " The atlas texture."] + pub texture: *mut SDL_Texture, + #[doc = " The tileset used to create this atlas. Internal use only."] + pub tileset: *mut TCOD_Tileset, + #[doc = " Internal use only."] + pub observer: *mut TCOD_TilesetObserver, + #[doc = " Internal use only."] + pub texture_columns: ::std::os::raw::c_int, } #[test] -fn bindgen_test_layout_TCOD_struct_int_t() { +fn bindgen_test_layout_TCOD_TilesetAtlasSDL2() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 40usize, - concat!("Size of: ", stringify!(TCOD_struct_int_t)) + concat!("Size of: ", stringify!(TCOD_TilesetAtlasSDL2)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TCOD_struct_int_t)) + concat!("Alignment of ", stringify!(TCOD_TilesetAtlasSDL2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).renderer as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_struct_int_t), + stringify!(TCOD_TilesetAtlasSDL2), "::", - stringify!(name) + stringify!(renderer) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, 8usize, concat!( "Offset of field: ", - stringify!(TCOD_struct_int_t), + stringify!(TCOD_TilesetAtlasSDL2), "::", - stringify!(flags) + stringify!(texture) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, 16usize, concat!( "Offset of field: ", - stringify!(TCOD_struct_int_t), + stringify!(TCOD_TilesetAtlasSDL2), "::", - stringify!(props) + stringify!(tileset) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).lists as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).observer as *const _ as usize }, 24usize, concat!( "Offset of field: ", - stringify!(TCOD_struct_int_t), + stringify!(TCOD_TilesetAtlasSDL2), "::", - stringify!(lists) + stringify!(observer) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::())).texture_columns as *const _ as usize + }, 32usize, concat!( "Offset of field: ", - stringify!(TCOD_struct_int_t), + stringify!(TCOD_TilesetAtlasSDL2), "::", - stringify!(structs) + stringify!(texture_columns) ) ); } -impl Default for TCOD_struct_int_t { +impl Default for TCOD_TilesetAtlasSDL2 { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } +#[doc = "The renderer data for an SDL2 rendering context."] +#[doc = "Internal use only."] #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct TCOD_parser_int_t { - pub structs: TCOD_list_t, - pub customs: [TCOD_parser_custom_t; 16usize], - pub fatal: bool, - pub props: TCOD_list_t, +pub struct TCOD_RendererSDL2 { + pub window: *mut SDL_Window, + pub renderer: *mut SDL_Renderer, + pub atlas: *mut TCOD_TilesetAtlasSDL2, + pub cache_console: *mut TCOD_Console, + pub cache_texture: *mut SDL_Texture, + pub sdl_subsystems: u32, + pub last_offset_x: f64, + pub last_offset_y: f64, + pub last_scale_x: f64, + pub last_scale_y: f64, } #[test] -fn bindgen_test_layout_TCOD_parser_int_t() { +fn bindgen_test_layout_TCOD_RendererSDL2() { assert_eq!( - ::std::mem::size_of::(), - 152usize, - concat!("Size of: ", stringify!(TCOD_parser_int_t)) + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(TCOD_RendererSDL2)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TCOD_parser_int_t)) + concat!("Alignment of ", stringify!(TCOD_RendererSDL2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_int_t), + stringify!(TCOD_RendererSDL2), "::", - stringify!(structs) + stringify!(window) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).customs as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).renderer as *const _ as usize }, 8usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_int_t), + stringify!(TCOD_RendererSDL2), "::", - stringify!(customs) + stringify!(renderer) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).fatal as *const _ as usize }, - 136usize, + unsafe { &(*(::std::ptr::null::())).atlas as *const _ as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_int_t), + stringify!(TCOD_RendererSDL2), "::", - stringify!(fatal) + stringify!(atlas) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, - 144usize, + unsafe { &(*(::std::ptr::null::())).cache_console as *const _ as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(TCOD_parser_int_t), + stringify!(TCOD_RendererSDL2), "::", - stringify!(props) + stringify!(cache_console) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cache_texture as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(cache_texture) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).sdl_subsystems as *const _ as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(sdl_subsystems) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_offset_x as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_offset_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_offset_y as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_offset_y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_scale_x as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_scale_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_scale_y as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_scale_y) ) ); } -impl Default for TCOD_parser_int_t { +impl Default for TCOD_RendererSDL2 { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } extern "C" { - pub fn TCOD_parse_bool_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_char_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_integer_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_float_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_string_value() -> TCOD_value_t; -} -extern "C" { - pub fn TCOD_parse_color_value() -> TCOD_value_t; + #[doc = "Return a libtcod rendering context using an SDL2 renderer."] + pub fn TCOD_renderer_init_sdl2( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + renderer_flags: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; } extern "C" { - pub fn TCOD_parse_dice_value() -> TCOD_value_t; + #[doc = "Return a new SDL2 atlas created from a tileset for an SDL2 renderer."] + #[doc = ""] + #[doc = "You may delete the tileset if you no longer have use for it."] + #[doc = ""] + #[doc = "Will return NULL on an error, you can check the error with"] + #[doc = "`TCOD_get_error`."] + pub fn TCOD_sdl2_atlas_new( + renderer: *mut SDL_Renderer, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_TilesetAtlasSDL2; } extern "C" { - pub fn TCOD_parse_value_list_value( - def: *mut TCOD_struct_int_t, - listnum: ::std::os::raw::c_int, - ) -> TCOD_value_t; + #[doc = "Delete an SDL2 tileset atlas."] + pub fn TCOD_sdl2_atlas_delete(atlas: *mut TCOD_TilesetAtlasSDL2); } extern "C" { - pub fn TCOD_parse_property_value( - parser: *mut TCOD_parser_int_t, - def: TCOD_parser_struct_t, - propname: *mut ::std::os::raw::c_char, - list: bool, - ) -> TCOD_value_t; + #[doc = "Render a console onto a managed target texture."] + #[doc = ""] + #[doc = "`atlas` is an SDL2 atlas created with `TCOD_sdl2_atlas_new`."] + #[doc = "The renderer used to make this `atlas` must support"] + #[doc = "`SDL_RENDERER_TARGETTEXTURE`, unless `target` is NULL."] + #[doc = ""] + #[doc = "`console` is a non-NULL pointer to the libtcod console you want to render."] + #[doc = ""] + #[doc = "`cache` can be NULL, or be pointer to a console pointer."] + #[doc = "If `*cache` is NULL then a console will be created."] + #[doc = "If `*cache` isn't NULL then the console pointed to might be deleted or"] + #[doc = "recreated, especially if it does not match the size of `console`."] + #[doc = ""] + #[doc = "`target` can be NULL, or be pointer to where you want the output texture"] + #[doc = "to be placed."] + #[doc = "The texture at `*target` may be deleted or recreated. When this function"] + #[doc = "is successful then the texture at `*target` will be non-NULL and will be"] + #[doc = "exactly fitted to the size of `console` and the tile size of `atlas`."] + #[doc = ""] + #[doc = "If `target` is NULL when the current render target is used instead, the"] + #[doc = "drawn area will not be scaled to fit the render target."] + #[doc = ""] + #[doc = "If SDL2 ever provides a `SDL_RENDER_TARGETS_RESET` event then the console"] + #[doc = "at `*cache` must be deleted and set to NULL, or else the next render will"] + #[doc = "only partially update the texture at `*target`."] + #[doc = ""] + #[doc = "Returns a negative value on an error, check `TCOD_get_error`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_sdl2_render_texture( + atlas: *const TCOD_TilesetAtlasSDL2, + console: *const TCOD_Console, + cache: *mut *mut TCOD_Console, + target: *mut *mut SDL_Texture, + ) -> TCOD_Error; } extern "C" { pub fn TCOD_sys_startup(); @@ -9517,7 +9046,7 @@ extern "C" { ); } extern "C" { - pub fn TCOD_sys_set_renderer(renderer: TCOD_renderer_t); + pub fn TCOD_sys_set_renderer(renderer: TCOD_renderer_t) -> ::std::os::raw::c_int; } extern "C" { pub fn TCOD_sys_get_renderer() -> TCOD_renderer_t; @@ -9538,6 +9067,15 @@ extern "C" { pub fn TCOD_sys_get_char_size(w: *mut ::std::os::raw::c_int, h: *mut ::std::os::raw::c_int); } extern "C" { + #[doc = " Upload a tile to the active tileset."] + #[doc = ""] + #[doc = " `asciiCode` is the Unicode codepoint for this tile."] + #[doc = ""] + #[doc = " `fontx` and `fonty` are the tile-coordinates on the active tilemap."] + #[doc = ""] + #[doc = " `img` is the tile to upload."] + #[doc = ""] + #[doc = " `x` and `y` are the upper-left pixel-coordinates of the tile on the `img`."] pub fn TCOD_sys_update_char( asciiCode: ::std::os::raw::c_int, fontx: ::std::os::raw::c_int, @@ -9548,10 +9086,10 @@ extern "C" { ); } extern "C" { - pub fn TCOD_sys_get_SDL_window() -> *mut ::std::os::raw::c_void; + pub fn TCOD_sys_get_SDL_window() -> *mut SDL_Window; } extern "C" { - pub fn TCOD_sys_get_SDL_renderer() -> *mut ::std::os::raw::c_void; + pub fn TCOD_sys_get_SDL_renderer() -> *mut SDL_Renderer; } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -9699,12 +9237,102 @@ extern "C" { extern "C" { pub fn TCOD_close_library(arg1: TCOD_library_t); } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Surface { + _unused: [u8; 0], +} pub type SDL_renderer_t = - ::std::option::Option; + ::std::option::Option; extern "C" { pub fn TCOD_sys_register_SDL_renderer(renderer: SDL_renderer_t); } -pub type TCOD_text_t = *mut ::std::os::raw::c_void; +extern "C" { + #[doc = "Load a BDF font from a file path."] + #[doc = ""] + #[doc = "For the best results, you should use a BDF font with a cell-based"] + #[doc = "monospace alignment."] + #[doc = ""] + #[doc = "May return NULL on failure. See `TCOD_get_error` for the error message."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_load_bdf(path: *const ::std::os::raw::c_char) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Load a BDF font from memory."] + #[doc = ""] + #[doc = "`size` is the byte length of `buffer`. `buffer` is the BDF data to load."] + #[doc = ""] + #[doc = "May return NULL on failure. See `TCOD_get_error` for the error message."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_load_bdf_memory( + size: ::std::os::raw::c_int, + buffer: *const ::std::os::raw::c_uchar, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Try to return a fall-back Tileset, may return NULL."] + #[doc = ""] + #[doc = " Used when one is needed, but was not provided by the user."] + pub fn TCOD_tileset_load_fallback_font_( + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Render a console to a SDL_Surface with a software renderer."] + #[doc = ""] + #[doc = "`tileset` is the tiles to render with, must not be NULL."] + #[doc = ""] + #[doc = "`console` is the console to render, must not be NULL."] + #[doc = ""] + #[doc = "`cache` is an optional pointer to a consoled used as a cache. The console"] + #[doc = "at `*cache` will be created or modified. The `cache` will be used to skip"] + #[doc = "drawing already drawn tiles on any subsequent calls."] + #[doc = ""] + #[doc = "`surface_out` is a pointer to where to put the surface will be managed."] + #[doc = "The surface at `*surface_out` will be created or modified and will change"] + #[doc = "to match the size of `console` and `tileset`. The pixel format will be"] + #[doc = "SDL_PIXELFORMAT_RGBA32."] + #[doc = ""] + #[doc = "Returns a negative value on error, see `TCOD_get_error`."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_tileset_render_to_surface( + tileset: *const TCOD_Tileset, + console: *const TCOD_Console, + cache: *mut *mut TCOD_Console, + surface_out: *mut *mut SDL_Surface, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Return a tileset from a TrueType font file."] + pub fn TCOD_load_truetype_font_( + path: *const ::std::os::raw::c_char, + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Set the global tileset from a TrueType font file."] + pub fn TCOD_tileset_load_truetype_( + path: *const ::std::os::raw::c_char, + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Text { + _unused: [u8; 0], +} +pub type TCOD_text_t = *mut TCOD_Text; extern "C" { pub fn TCOD_text_init( x: ::std::os::raw::c_int, @@ -9756,7 +9384,12 @@ extern "C" { extern "C" { pub fn TCOD_text_delete(txt: TCOD_text_t); } -pub type TCOD_zip_t = *mut ::std::os::raw::c_void; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Zip { + _unused: [u8; 0], +} +pub type TCOD_zip_t = *mut TCOD_Zip; extern "C" { pub fn TCOD_zip_new() -> TCOD_zip_t; } @@ -9782,7 +9415,14 @@ extern "C" { pub fn TCOD_zip_put_image(zip: TCOD_zip_t, val: TCOD_image_t); } extern "C" { - pub fn TCOD_zip_put_console(zip: TCOD_zip_t, val: TCOD_console_t); + pub fn TCOD_zip_put_console(zip: TCOD_zip_t, val: *const TCOD_Console); +} +extern "C" { + #[doc = "Write a TCOD_Random* object."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_zip_put_random(zip: TCOD_zip_t, val: *const TCOD_Random); } extern "C" { pub fn TCOD_zip_put_data( @@ -9827,6 +9467,13 @@ extern "C" { extern "C" { pub fn TCOD_zip_get_console(zip: TCOD_zip_t) -> TCOD_console_t; } +extern "C" { + #[doc = "Read a TCOD_Random* object."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_zip_get_random(zip: TCOD_zip_t) -> TCOD_random_t; +} extern "C" { pub fn TCOD_zip_get_data( zip: TCOD_zip_t, @@ -9840,6 +9487,32 @@ extern "C" { extern "C" { pub fn TCOD_zip_skip_bytes(zip: TCOD_zip_t, nbBytes: u32); } +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SDL_Event { + _unused: [u8; 0], +} +extern "C" { + #[doc = " Parse an SDL_Event into a key event and return the relevant TCOD_event_t."] + #[doc = ""] + #[doc = " Returns TCOD_EVENT_NONE if the event wasn't keyboard related."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_process_key_event(in_: *const SDL_Event, out: *mut TCOD_key_t) -> TCOD_event_t; +} +extern "C" { + #[doc = " Parse an SDL_Event into a mouse event and return the relevant TCOD_event_t."] + #[doc = ""] + #[doc = " Returns TCOD_EVENT_NONE if the event wasn't mouse related."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_process_mouse_event( + in_: *const SDL_Event, + out: *mut TCOD_mouse_t, + ) -> TCOD_event_t; +} pub type __builtin_va_list = [__va_list_tag; 1usize]; #[repr(C)] #[derive(Debug, Copy, Clone)] From 026ce3dd4ac57077f1d4e541524185a3a7104084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Sun, 28 Jun 2020 08:59:18 +0200 Subject: [PATCH 15/27] Add error handling where appropriate That is, wherever `TCOD_Error` is returned --- examples/blit.rs | 9 ++- examples/chars.rs | 9 ++- examples/colors.rs | 9 ++- examples/custom_character_mapping.rs | 9 ++- examples/fov.rs | 9 ++- examples/keyboard.rs | 9 ++- examples/minimal.rs | 9 ++- examples/mouse.rs | 9 ++- examples/print_macros.rs | 9 ++- examples/samples.rs | 8 ++- examples/shapes.rs | 9 ++- examples/text.rs | 9 ++- src/console.rs | 84 ++++++++++++++++++++-------- src/error.rs | 50 +++++++++++++++++ src/lib.rs | 1 + tcod_sys/lib.rs | 1 + 16 files changed, 183 insertions(+), 60 deletions(-) create mode 100644 src/error.rs diff --git a/examples/blit.rs b/examples/blit.rs index 01876f827..c178f140e 100644 --- a/examples/blit.rs +++ b/examples/blit.rs @@ -1,13 +1,14 @@ extern crate tcod; use tcod::console; +use tcod::error::Result; use tcod::{Color, Console, OffscreenConsole, RootConsole}; -fn main() { +fn main() -> Result<()> { let mut root = RootConsole::initializer() .size(80, 50) .title("Using blit with libtcod") - .init(); + .init()?; let mut direct: OffscreenConsole = OffscreenConsole::new(20, 20); let mut boxed_direct: Box = Box::new(OffscreenConsole::new(20, 20)); @@ -57,6 +58,8 @@ fn main() { 1.0, ); - root.flush(); + root.flush()?; root.wait_for_keypress(true); + + Ok(()) } diff --git a/examples/chars.rs b/examples/chars.rs index 8aa09887b..9083df3d9 100644 --- a/examples/chars.rs +++ b/examples/chars.rs @@ -1,13 +1,14 @@ extern crate tcod; use tcod::chars; +use tcod::error::Result; use tcod::{Console, RootConsole}; -fn main() { +fn main() -> Result<()> { let mut root = RootConsole::initializer() .size(80, 50) .title("Example of libtcod's special chars") - .init(); + .init()?; root.clear(); @@ -26,6 +27,8 @@ fn main() { root.set_char(39, 26, chars::VLINE); root.set_char(39, 25, chars::NW); - root.flush(); + root.flush()?; root.wait_for_keypress(true); + + Ok(()) } diff --git a/examples/colors.rs b/examples/colors.rs index 563f3e38c..0777d7350 100644 --- a/examples/colors.rs +++ b/examples/colors.rs @@ -1,13 +1,14 @@ extern crate tcod; use tcod::colors; +use tcod::error::Result; use tcod::{BackgroundFlag, Color, Console, RootConsole}; -fn main() { +fn main() -> Result<()> { let mut con = RootConsole::initializer() .size(80, 50) .title("Using colours with libtcod") - .init(); + .init()?; con.set_default_background(Color::DARKEST_GREEN); con.set_default_foreground(Color::LIGHTER_AZURE); @@ -40,8 +41,10 @@ fn main() { let (h, s, v) = red.hsv(); println!("Red colour's hue: {}, saturation: {}, value: {}", h, s, v); - con.flush(); + con.flush()?; // Press any key to exit: con.wait_for_keypress(true); + + Ok(()) } diff --git a/examples/custom_character_mapping.rs b/examples/custom_character_mapping.rs index 5faa615ec..8dba740c0 100644 --- a/examples/custom_character_mapping.rs +++ b/examples/custom_character_mapping.rs @@ -1,5 +1,6 @@ extern crate tcod; +use tcod::error::Result; use tcod::{Console, FontLayout, FontType, RootConsole}; const FLOOR_TILE: char = 1 as char; @@ -15,7 +16,7 @@ const MAP_HEIGHT: i32 = 50; const ROOM_WIDTH: i32 = 20; const ROOM_HEIGHT: i32 = 15; -fn main() { +fn main() -> Result<()> { let mut root = RootConsole::initializer() .font("angband16x16.png", FontLayout::TCOD) .font_type(FontType::GREYSCALE) @@ -23,7 +24,7 @@ fn main() { // characters .size(MAP_WIDTH, MAP_HEIGHT) .title("Using custom character mapping with libtcod") - .init(); + .init()?; // map ASCII_CODE to character in font at position X, Y root.map_ascii_code_to_font(FLOOR_TILE as i32, 4, 0); @@ -64,6 +65,8 @@ fn main() { root.set_char(middle_x + 2, middle_y - 5, ENEMY_2_TILE); root.set_char(middle_x, middle_y - 7, CHEST_TILE); - root.flush(); + root.flush()?; root.wait_for_keypress(true); + + Ok(()) } diff --git a/examples/fov.rs b/examples/fov.rs index 949e4a532..30605f9f4 100644 --- a/examples/fov.rs +++ b/examples/fov.rs @@ -1,6 +1,7 @@ extern crate rand; extern crate tcod; +use tcod::error::Result; use tcod::map::FovAlgorithm; use tcod::{BackgroundFlag, Console, Map, RootConsole}; @@ -12,11 +13,11 @@ pub struct Tile { y: i32, } -fn main() { +fn main() -> Result<()> { let mut root = RootConsole::initializer() .size(40, 40) .title("FOV example") - .init(); + .init()?; let mut map = Map::new(40, 40); let mut tiles = Vec::new(); @@ -59,7 +60,9 @@ fn main() { root.put_char(20, 20, '@', BackgroundFlag::Set); - root.flush(); + root.flush()?; //Press any key to exit. root.wait_for_keypress(true); + + Ok(()) } diff --git a/examples/keyboard.rs b/examples/keyboard.rs index 34e7edb14..6a53a738c 100644 --- a/examples/keyboard.rs +++ b/examples/keyboard.rs @@ -1,21 +1,22 @@ extern crate tcod; +use tcod::error::Result; use tcod::input::Key; use tcod::input::KeyCode::{Down, Escape, Left, Right, Up}; use tcod::{BackgroundFlag, Console, RootConsole}; -fn main() { +fn main() -> Result<()> { let mut con = RootConsole::initializer() .size(80, 50) .title("libtcod Rust tutorial") - .init(); + .init()?; let mut x = 40; let mut y = 25; while !con.window_closed() { con.clear(); con.put_char(x, y, '@', BackgroundFlag::Set); - con.flush(); + con.flush()?; let keypress = con.wait_for_keypress(true); // libtcod 1.5.1 has a bug where `wait_for_keypress` emits two events: // one for key down and one for key up. So we ignore the "key up" ones. @@ -30,4 +31,6 @@ fn main() { } } } + + Ok(()) } diff --git a/examples/minimal.rs b/examples/minimal.rs index 544244f88..b454695f4 100644 --- a/examples/minimal.rs +++ b/examples/minimal.rs @@ -1,16 +1,19 @@ extern crate tcod; +use tcod::error::Result; use tcod::RootConsole; -fn main() { +fn main() -> Result<()> { let mut root = RootConsole::initializer() .size(80, 50) .title("Minimal libtcod loop") - .init(); + .init()?; while !root.window_closed() { - root.flush(); + root.flush()?; let key = root.wait_for_keypress(true); println!("Pressed key: {:?}", key); } + + Ok(()) } diff --git a/examples/mouse.rs b/examples/mouse.rs index db78eaea5..1f3552f08 100644 --- a/examples/mouse.rs +++ b/examples/mouse.rs @@ -1,13 +1,14 @@ extern crate tcod; +use tcod::error::Result; use tcod::input; use tcod::{BackgroundFlag, Console, RootConsole}; -fn main() { +fn main() -> Result<()> { let mut con = RootConsole::initializer() .size(80, 50) .title("Move the cursor inside the window") - .init(); + .init()?; let mut x = 40; let mut y = 25; @@ -33,6 +34,8 @@ fn main() { con.clear(); con.put_char(x, y, '@', BackgroundFlag::Set); - con.flush(); + con.flush()?; } + + Ok(()) } diff --git a/examples/print_macros.rs b/examples/print_macros.rs index 3e4d9212b..a17d9244e 100644 --- a/examples/print_macros.rs +++ b/examples/print_macros.rs @@ -1,13 +1,14 @@ #[macro_use] extern crate tcod; +use tcod::error::Result; use tcod::{BackgroundFlag, Console, RootConsole, TextAlignment}; -fn main() { +fn main() -> Result<()> { let mut root = RootConsole::initializer() .size(80, 50) .title("Displaying text") - .init(); + .init()?; // No optional parameters tcod_print!( @@ -55,6 +56,8 @@ fn main() { 1 ); - root.flush(); + root.flush()?; root.wait_for_keypress(true); + + Ok(()) } diff --git a/examples/samples.rs b/examples/samples.rs index 2fad7568a..2a0ba8a64 100644 --- a/examples/samples.rs +++ b/examples/samples.rs @@ -12,6 +12,7 @@ use tcod::chars; use tcod::colors; use tcod::colors::Color; use tcod::console::*; +use tcod::error::Result; use tcod::image; use tcod::image::{blit_2x, Image}; use tcod::input::*; @@ -1876,7 +1877,7 @@ impl Options { } } -fn main() { +fn main() -> Result<()> { let mut colors = ColorsSample::new(); let mut offscreen = OffscreenSample::new(); let mut mouse = MouseSample::new(); @@ -1918,7 +1919,7 @@ fn main() { .font(options.font, options.font_layout) .font_type(options.font_type) .font_dimensions(options.nb_char_horiz, options.nb_char_vertic) - .init(); + .init()?; let mut credits_end = false; while !root.window_closed() { @@ -1945,7 +1946,7 @@ fn main() { // erase the renderer in debug mode (needed because the root // console is not cleared each frame) root.print(1, 1, " "); - root.flush(); + root.flush()?; if let Some((_, Event::Key(key))) = event { match key.code { @@ -1973,6 +1974,7 @@ fn main() { } } } + Ok(()) } fn print_samples(root: &mut Root, cur_sample: usize, samples: &[MenuItem]) { diff --git a/examples/shapes.rs b/examples/shapes.rs index 308a18c9d..6e53c5e86 100644 --- a/examples/shapes.rs +++ b/examples/shapes.rs @@ -1,12 +1,13 @@ extern crate tcod; +use tcod::error::Result; use tcod::{BackgroundFlag, Color, Console, RootConsole}; -fn main() { +fn main() -> Result<()> { let mut root = RootConsole::initializer() .size(80, 50) .title("Example of libtcod's special chars") - .init(); + .init()?; while !root.window_closed() { root.set_default_background(Color::BLACK); @@ -36,7 +37,9 @@ fn main() { Some("Hello World!"), ); - root.flush(); + root.flush()?; root.wait_for_keypress(true); } + + Ok(()) } diff --git a/examples/text.rs b/examples/text.rs index 8a2472dd5..eddc5fff8 100644 --- a/examples/text.rs +++ b/examples/text.rs @@ -1,12 +1,13 @@ extern crate tcod; +use tcod::error::Result; use tcod::{BackgroundFlag, Console, RootConsole, TextAlignment}; -fn main() { +fn main() -> Result<()> { let mut root = RootConsole::initializer() .size(80, 50) .title("Displaying text") - .init(); + .init()?; root.print_ex( 1, @@ -46,6 +47,8 @@ fn main() { 10, wrapped_text.replace("X", &lines.to_string()), ); - root.flush(); + root.flush()?; root.wait_for_keypress(true); + + Ok(()) } diff --git a/src/console.rs b/src/console.rs index e3dcfa5f5..6ced7f41a 100644 --- a/src/console.rs +++ b/src/console.rs @@ -12,25 +12,32 @@ //! //! ```no_run //! use tcod::console::{Root, Offscreen}; +//! # use tcod::error::Result; //! -//! let mut root = Root::initializer().init(); +//! # fn main() -> Result<()> { +//! let mut root = Root::initializer().init()?; //! let (width, height) = (80, 30); //! let mut offscreen = Offscreen::new(width, height); +//! # Ok(()) +//! # } //! ``` //! //! A typical `tcod-rs` program's basic structure would look something like this: //! //! ```no_run //! use tcod::console::Root; +//! use tcod::error::Result; //! -//! fn main() { -//! let mut root = Root::initializer().init(); // Replace with custom initialization code +//! fn main() -> Result<()> { +//! let mut root = Root::initializer().init()?; // Replace with custom initialization code //! //! while !root.window_closed() { //! // Handling user input //! // Updating the gamestate //! // Rendering the results //! } +//! +//! Ok(()) //! } //! ``` //! @@ -64,6 +71,7 @@ use bindings::ffi::{self, TCOD_alignment_t, TCOD_bkgnd_flag_t, TCOD_renderer_t}; use bindings::{AsNative, CString, FromNative}; use colors::Color; +use error::{Error, Result}; use input::{Key, KeyPressFlags}; /// A type representing secondary consoles @@ -93,12 +101,15 @@ use input::{Key, KeyPressFlags}; /// ```no_run /// use tcod::console as console; /// use tcod::console::{Root, Offscreen}; +/// use tcod::error::Result; /// -/// fn main() { -/// let mut root = Root::initializer().init(); +/// fn main() -> Result<()> { +/// let mut root = Root::initializer().init()?; /// /// let mut direct = Offscreen::new(20, 20); /// console::blit(&direct, (0, 0), (20, 20), &mut root, (0, 0), 1.0, 1.0); +/// +/// Ok(()) /// } /// /// ``` @@ -148,9 +159,10 @@ unsafe impl Send for Offscreen {} /// use tcod::console::Root; /// use tcod::input::Key; /// use tcod::input::KeyCode::{Up, Down, Left, Right}; +/// use tcod::error::Result; /// -/// fn main() { -/// let mut root = Root::initializer().init(); +/// fn main() -> Result<()> { +/// let mut root = Root::initializer().init()?; /// /// let keypress = root.wait_for_keypress(true); /// match keypress.code { @@ -160,6 +172,8 @@ unsafe impl Send for Offscreen {} /// Right => {}, /// _ => {} /// } +/// +/// Ok(()) /// } /// ``` /// @@ -175,14 +189,17 @@ unsafe impl Send for Offscreen {} /// /// ```no_run /// use tcod::console::{Console, Root}; +/// use tcod::error::Result; /// -/// fn main() { -/// let mut root = Root::initializer().init(); +/// fn main() -> Result<()> { +/// let mut root = Root::initializer().init()?; /// /// root.clear(); /// // Output style manipulation /// // Calling the output functions -/// root.flush(); +/// root.flush()?; +/// +/// Ok(()) /// } /// ``` @@ -290,9 +307,12 @@ impl Root { } /// Flushes the contents of the `Root` console onto the screen. - pub fn flush(&mut self) { - unsafe { - ffi::TCOD_console_flush(); + pub fn flush(&mut self) -> Result<()> { + let result = unsafe { ffi::TCOD_console_flush() }; + if Error::is_error(result) { + Err(Error::from(result)) + } else { + Ok(()) } } @@ -380,8 +400,8 @@ impl Root { font_type: FontType, nb_char_horizontal: i32, nb_char_vertical: i32, - ) { - unsafe { + ) -> Result<()> { + let result = unsafe { let filename = font_path.to_str().expect("Invalid font path"); let path = CString::new(filename).ok().expect( "Font path could not be converted \ @@ -392,7 +412,13 @@ impl Root { (font_layout.bits() | font_type.bits()) as i32, nb_char_horizontal, nb_char_vertical, - ); + ) + }; + + if Error::is_error(result) { + Err(Error::from(result)) + } else { + Ok(()) } } } @@ -512,7 +538,7 @@ impl<'a> RootInitializer<'a> { self } - pub fn init(&self) -> Root { + pub fn init(&self) -> Result { assert!(self.width > 0 && self.height > 0); match self.font_dimensions { @@ -522,22 +548,25 @@ impl<'a> RootInitializer<'a> { self.font_type, horizontal, vertical, - ), + )?, } unsafe { let c_title = CString::new((*self.title).as_ref().as_bytes()).unwrap(); - ffi::TCOD_console_init_root( + let result = ffi::TCOD_console_init_root( self.width, self.height, c_title.as_ptr(), self.is_fullscreen, self.console_renderer.into(), ); + if Error::is_error(result) { + return Err(Error::from(result)); + } } - Root { + Ok(Root { _blocker: PhantomData, - } + }) } } @@ -636,8 +665,10 @@ fn to_wstring(text: &[u8]) -> Vec { /// /// ```no_run /// use tcod::console::{Console, Root, BackgroundFlag, TextAlignment}; +/// # use tcod::error::Result; /// -/// let mut root = Root::initializer().size(80, 50).init(); +/// # fn main() -> Result<()> { +/// let mut root = Root::initializer().size(80, 50).init()?; /// /// root.print_ex(1, 1, BackgroundFlag::None, TextAlignment::Left, /// "Text aligned to left."); @@ -650,6 +681,8 @@ fn to_wstring(text: &[u8]) -> Vec { /// /// root.print_ex(40, 19, BackgroundFlag::None, TextAlignment::Center, /// "Press any key to quit."); +/// # Ok(()) +/// # } /// ``` pub trait Console: AsNative { /// Returns the default text alignment for the `Console` instance. For all the possible @@ -1158,9 +1191,10 @@ pub trait Console: AsNative { /// ```no_run /// use tcod::console as console; /// use tcod::console::{Console, Root, Offscreen}; +/// use tcod::error::Result; /// -/// fn main() { -/// let mut root = Root::initializer().init(); +/// fn main() -> Result<()> { +/// let mut root = Root::initializer().init()?; /// /// let mut direct = Offscreen::new(20, 20); /// let mut boxed_direct = Box::new(Offscreen::new(20, 20)); @@ -1171,6 +1205,8 @@ pub trait Console: AsNative { /// console::blit(&boxed_direct, (0, 0), (20, 20), &mut root, (20, 0), 1.0, 1.0); /// console::blit(&trait_object, (0, 0), (20, 20), &mut root, (0, 20), 1.0, 1.0); /// console::blit(&boxed_trait, (0, 0), (20, 20), &mut root, (20, 20), 1.0, 1.0); +/// +/// Ok(()) /// } /// /// ``` diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 000000000..cfa8f3c64 --- /dev/null +++ b/src/error.rs @@ -0,0 +1,50 @@ +use bindings::ffi; +use std::ffi::CStr; +use std::fmt; + +#[derive(Debug)] +pub struct Error { + tcod_error: ffi::TCOD_Error, + tcod_error_message: String, +} + +impl Error { + #[inline] + pub fn is_warning(tcod_error: ffi::TCOD_Error) -> bool { + matches!(tcod_error, ffi::TCOD_Error::TCOD_E_WARN) + } + + #[inline] + pub fn is_ok(tcod_error: ffi::TCOD_Error) -> bool { + matches!(tcod_error, ffi::TCOD_Error::TCOD_E_OK) + } + + #[inline] + pub fn is_error(tcod_error: ffi::TCOD_Error) -> bool { + !Self::is_warning(tcod_error) && !Self::is_ok(tcod_error) + } +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.tcod_error_message) + } +} + +impl std::error::Error for Error {} + +impl From for Error { + fn from(e: ffi::TCOD_Error) -> Self { + assert!(Self::is_error(e)); + let error_message = unsafe { ffi::TCOD_get_error() }; + assert!(!error_message.is_null()); + let error_message = unsafe { CStr::from_ptr(error_message) }; + + Self { + tcod_error: e, + tcod_error_message: error_message.to_string_lossy().into_owned(), + } + } +} + +pub type Result = std::result::Result; diff --git a/src/lib.rs b/src/lib.rs index d07d6c5a2..1ff607a58 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -69,6 +69,7 @@ pub mod bsp; pub mod chars; pub mod colors; pub mod console; +pub mod error; pub mod heightmap; pub mod image; pub mod input; diff --git a/tcod_sys/lib.rs b/tcod_sys/lib.rs index ba20119ef..3adf19e3e 100644 --- a/tcod_sys/lib.rs +++ b/tcod_sys/lib.rs @@ -1,3 +1,4 @@ #![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)] +#![allow(clippy::missing_safety_doc, clippy::redundant_static_lifetimes)] include!(concat!("./", env!("BINDINGS_TARGET"), "_bindings.rs")); From 2de9421c5b1dad7325e6fef02a093b2de6ce39f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Mon, 29 Jun 2020 07:07:56 +0200 Subject: [PATCH 16/27] Attempt to get builds working And also to write out their bindings so they can be included in the repo --- .travis.yml | 7 ++++++- appveyor.yml | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b7cadae83..300c0ef15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,13 @@ matrix: before_install: - '[ "$TRAVIS_OS_NAME" = linux ] && sudo apt-get update -qq || brew update' install: -- '[ "$TRAVIS_OS_NAME" = linux ] && sudo apt-get install -y libsdl2-dev libegl1-mesa-dev libgles2-mesa-dev || brew install sdl2' +- '[ "$TRAVIS_OS_NAME" = linux ] && sudo apt-get install -y libsdl2-dev libegl1-mesa-dev libgles2-mesa-dev llvm-dev libclang-dev clang || brew install sdl2 llvm' script: +- '[ "$TRAVIS_OS_NAME" = osx ] && export PATH="/usr/local/opt/llvm/bin:$PATH" && export LIBCLANG_PATH="/usr/local/opt/llvm/bin"' +- 'if [[ "$TRAVIS_OS_NAME" == linux ]]; then wget -O - https://www.libsdl.org/release/SDL2-2.0.12.tar.gz | tar xz; fi' +- 'if [[ "$TRAVIS_OS_NAME" == linux ]]; then (cd SDL2-* && ./configure --prefix=$HOME/.local && make -j 3 install); fi' +- 'if [[ "$TRAVIS_OS_NAME" == linux ]]; then export PATH=~/.local/bin:$PATH; export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOME/.local/lib/pkgconfig"; fi' +- pushd tcod_sys; cargo build --features generate_bindings; cat $TARGET_bindings.rs; popd - cargo build --verbose - cargo test --verbose - cargo test --features "rustc-serialize serde" --verbose diff --git a/appveyor.yml b/appveyor.yml index 1ecdd77c9..ec28dbc33 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,9 +19,20 @@ install: - set RUST_BACKTRACE=1 - rustc -V - cargo -V + - ps: $env:BITS=$(if ($env:ARCH -eq "amd64") { 64 } else { 32 }) + - ps: $env:PROGRAM_FILES=$(if ($env:ARCH -eq "amd64") { "C:\Program Files" } else { ${env:ProgramFiles(x86)} }) + - ps: Start-FileDownload "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win${env:BITS}.exe" + - LLVM-10.0.0-win%BITS%.exe /S /D=%PROGRAM_FILES%\LLVM + - set LIBCLANG_PATH=%PROGRAM_FILES%\LLVM\bin build: false +build_script: + - cd tcod_sys && cargo build --features generate_bindings && cd .. + test_script: - cargo test - cargo test --release + +artifacts: + - path: tcod_sys\$(TARGET)_bindings.rs From bcc093cd113c7e0691a7218217086439599ae429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Tue, 30 Jun 2020 13:04:45 +0200 Subject: [PATCH 17/27] Remove silly TCOD_font_flags_t_type kludge (Just use c_int always, like the function that accepts it expects) --- src/console.rs | 12 +- tcod_sys/build.rs | 140 +++++++++--------- tcod_sys/x86_64-pc-windows-msvc_bindings.rs | 2 - tcod_sys/x86_64-unknown-linux-gnu_bindings.rs | 2 - 4 files changed, 79 insertions(+), 77 deletions(-) diff --git a/src/console.rs b/src/console.rs index 6ced7f41a..8f89a58b3 100644 --- a/src/console.rs +++ b/src/console.rs @@ -1313,17 +1313,17 @@ native_enum_convert!(Renderer, TCOD_renderer_t); bitflags! { /// All the possible font layouts that can be used for custom bitmap fonts - pub struct FontLayout: ffi::TCOD_font_flags_t_type { - const ASCII_INCOL = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_ASCII_INCOL.0; - const ASCII_INROW = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_ASCII_INROW.0; - const TCOD = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_TCOD.0; + pub struct FontLayout: std::os::raw::c_int { + const ASCII_INCOL = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_ASCII_INCOL.0 as std::os::raw::c_int; + const ASCII_INROW = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_ASCII_INROW.0 as std::os::raw::c_int; + const TCOD = ffi::TCOD_font_flags_t::TCOD_FONT_LAYOUT_TCOD.0 as std::os::raw::c_int; } } bitflags! { - pub struct FontType: ffi::TCOD_font_flags_t_type { + pub struct FontType: std::os::raw::c_int { const DEFAULT = 0; - const GREYSCALE = ffi::TCOD_font_flags_t::TCOD_FONT_TYPE_GREYSCALE.0; + const GREYSCALE = ffi::TCOD_font_flags_t::TCOD_FONT_TYPE_GREYSCALE.0 as std::os::raw::c_int; } } diff --git a/tcod_sys/build.rs b/tcod_sys/build.rs index 241e7d82c..72e740377 100644 --- a/tcod_sys/build.rs +++ b/tcod_sys/build.rs @@ -5,7 +5,6 @@ use std::env; use std::fs; use std::path::{Path, PathBuf}; - fn build_libz(libz_sources: &[&str]) { let mut config = cc::Build::new(); for c_file in libz_sources { @@ -26,7 +25,6 @@ fn build_libtcod_objects(mut config: cc::Build, sources: &[&str]) { config.compile("libtcod.a"); } - fn compile_config(config: cc::Build) { let mut cmd = config.get_compiler().to_command(); println!("Compiling: {:?}", cmd); @@ -44,10 +42,9 @@ fn compile_config(config: cc::Build) { } } - /// Build static libtcod for Linux #[cfg(not(feature = "dynlib"))] -fn build_linux_static(_dst: &Path, libtcod_sources: &[& 'static str]) { +fn build_linux_static(_dst: &Path, libtcod_sources: &[&'static str]) { // Tell rust to link the produced library // It is important to specify this first, so that the library will be linked // before SDL2, as the link order matters for static libraries @@ -65,10 +62,9 @@ fn build_linux_static(_dst: &Path, libtcod_sources: &[& 'static str]) { build_libtcod_objects(config, libtcod_sources); } - /// Build dynamic libtcod for Linux #[cfg(feature = "dynlib")] -fn build_linux_dynamic(dst: &Path, libtcod_sources: &[& 'static str]) { +fn build_linux_dynamic(dst: &Path, libtcod_sources: &[&'static str]) { // Build the *.o files: { let mut config = cc::Build::new(); @@ -113,20 +109,14 @@ fn generate_bindings>(dst_dir: P) { // Tell cargo to invalidate the built crate whenever the wrapper changes println!("cargo:rerun-if-changed=bindgen.h"); - let font_flags_t_type = format!("pub type TCOD_font_flags_t_type = {};", - match target.as_ref() { - "x86_64-pc-windows-msvc" => String::from("i32"), - "x86_64-unknown-linux-gnu" => String::from("u32"), - t => format!("", t) - }); - let bindings = bindgen::Builder::default() .header("bindgen.h") .emit_builtins() - .default_enum_style(bindgen::EnumVariation::Rust{non_exhaustive:false}) + .default_enum_style(bindgen::EnumVariation::Rust { + non_exhaustive: false, + }) .derive_default(true) .bitfield_enum("TCOD_font_flags_t") - .raw_line(font_flags_t_type) // Tell cargo to invalidate the built crate whenever any of the // included header files changed. .parse_callbacks(Box::new(bindgen::CargoCallbacks)) @@ -180,32 +170,41 @@ fn main() { let src = Path::new(&src_dir); let dst = Path::new(&dst_dir); - let sdl_lib_dir = src.join("libtcod").join("dependencies").join("SDL2-2.0.7").join("lib").join(&target); - let sdl_include_dir = src.join("libtcod").join("dependencies").join("SDL2-2.0.7").join("include"); + let sdl_lib_dir = src + .join("libtcod") + .join("dependencies") + .join("SDL2-2.0.7") + .join("lib") + .join(&target); + let sdl_include_dir = src + .join("libtcod") + .join("dependencies") + .join("SDL2-2.0.7") + .join("include"); let libz_sources = &[ "libtcod/src/vendor/zlib/adler32.c", - "libtcod/src/vendor/zlib/crc32.c", - "libtcod/src/vendor/zlib/deflate.c", - "libtcod/src/vendor/zlib/infback.c", - "libtcod/src/vendor/zlib/inffast.c", - "libtcod/src/vendor/zlib/inflate.c", - "libtcod/src/vendor/zlib/inftrees.c", - "libtcod/src/vendor/zlib/trees.c", - "libtcod/src/vendor/zlib/zutil.c", - "libtcod/src/vendor/zlib/compress.c", - "libtcod/src/vendor/zlib/uncompr.c", - "libtcod/src/vendor/zlib/gzclose.c", - "libtcod/src/vendor/zlib/gzlib.c", - "libtcod/src/vendor/zlib/gzread.c", - "libtcod/src/vendor/zlib/gzwrite.c", + "libtcod/src/vendor/zlib/crc32.c", + "libtcod/src/vendor/zlib/deflate.c", + "libtcod/src/vendor/zlib/infback.c", + "libtcod/src/vendor/zlib/inffast.c", + "libtcod/src/vendor/zlib/inflate.c", + "libtcod/src/vendor/zlib/inftrees.c", + "libtcod/src/vendor/zlib/trees.c", + "libtcod/src/vendor/zlib/zutil.c", + "libtcod/src/vendor/zlib/compress.c", + "libtcod/src/vendor/zlib/uncompr.c", + "libtcod/src/vendor/zlib/gzclose.c", + "libtcod/src/vendor/zlib/gzlib.c", + "libtcod/src/vendor/zlib/gzread.c", + "libtcod/src/vendor/zlib/gzwrite.c", ]; let libtcod_sources = [ - "libtcod/src/libtcod/bresenham_c.c", - "libtcod/src/libtcod/bsp_c.c", - "libtcod/src/libtcod/color.c", - "libtcod/src/libtcod/console.c", + "libtcod/src/libtcod/bresenham_c.c", + "libtcod/src/libtcod/bsp_c.c", + "libtcod/src/libtcod/color.c", + "libtcod/src/libtcod/console.c", "libtcod/src/libtcod/console_drawing.c", "libtcod/src/libtcod/console_etc.c", "libtcod/src/libtcod/console_init.c", @@ -215,44 +214,44 @@ fn main() { "libtcod/src/libtcod/context_init.c", "libtcod/src/libtcod/context_viewport.c", "libtcod/src/libtcod/error.c", - "libtcod/src/libtcod/fov_c.c", - "libtcod/src/libtcod/fov_circular_raycasting.c", - "libtcod/src/libtcod/fov_diamond_raycasting.c", - "libtcod/src/libtcod/fov_permissive2.c", - "libtcod/src/libtcod/fov_recursive_shadowcasting.c", - "libtcod/src/libtcod/fov_restrictive.c", + "libtcod/src/libtcod/fov_c.c", + "libtcod/src/libtcod/fov_circular_raycasting.c", + "libtcod/src/libtcod/fov_diamond_raycasting.c", + "libtcod/src/libtcod/fov_permissive2.c", + "libtcod/src/libtcod/fov_recursive_shadowcasting.c", + "libtcod/src/libtcod/fov_restrictive.c", "libtcod/src/libtcod/globals.c", "libtcod/src/libtcod/heapq.c", - "libtcod/src/libtcod/heightmap_c.c", - "libtcod/src/libtcod/image_c.c", - "libtcod/src/libtcod/lex_c.c", - "libtcod/src/libtcod/list_c.c", - "libtcod/src/libtcod/mersenne_c.c", - "libtcod/src/libtcod/namegen_c.c", - "libtcod/src/libtcod/noise_c.c", - "libtcod/src/libtcod/parser_c.c", - "libtcod/src/libtcod/path_c.c", + "libtcod/src/libtcod/heightmap_c.c", + "libtcod/src/libtcod/image_c.c", + "libtcod/src/libtcod/lex_c.c", + "libtcod/src/libtcod/list_c.c", + "libtcod/src/libtcod/mersenne_c.c", + "libtcod/src/libtcod/namegen_c.c", + "libtcod/src/libtcod/noise_c.c", + "libtcod/src/libtcod/parser_c.c", + "libtcod/src/libtcod/path_c.c", "libtcod/src/libtcod/pathfinder.c", "libtcod/src/libtcod/pathfinder_frontier.c", "libtcod/src/libtcod/renderer_gl.c", "libtcod/src/libtcod/renderer_gl1.c", "libtcod/src/libtcod/renderer_gl2.c", "libtcod/src/libtcod/renderer_sdl2.c", - "libtcod/src/libtcod/sys_c.c", - "libtcod/src/libtcod/sys_sdl_c.c", - "libtcod/src/libtcod/sys_sdl_img_bmp.c", - "libtcod/src/libtcod/sys_sdl_img_png.c", + "libtcod/src/libtcod/sys_c.c", + "libtcod/src/libtcod/sys_sdl_c.c", + "libtcod/src/libtcod/sys_sdl_img_bmp.c", + "libtcod/src/libtcod/sys_sdl_img_png.c", "libtcod/src/libtcod/tileset.c", "libtcod/src/libtcod/tileset_bdf.c", "libtcod/src/libtcod/tileset_fallback.c", "libtcod/src/libtcod/tileset_render.c", "libtcod/src/libtcod/tileset_truetype.c", - "libtcod/src/libtcod/tree_c.c", - "libtcod/src/libtcod/txtfield_c.c", - "libtcod/src/libtcod/wrappers.c", - "libtcod/src/libtcod/zip_c.c", + "libtcod/src/libtcod/tree_c.c", + "libtcod/src/libtcod/txtfield_c.c", + "libtcod/src/libtcod/wrappers.c", + "libtcod/src/libtcod/zip_c.c", "libtcod/src/vendor/glad.c", - "libtcod/src/vendor/lodepng.c", + "libtcod/src/vendor/lodepng.c", "libtcod/src/vendor/stb.c", "libtcod/src/vendor/utf8proc/utf8proc.c", ]; @@ -264,7 +263,6 @@ fn main() { build_linux_static(&dst, &libtcod_sources[..]); #[cfg(feature = "dynlib")] build_linux_dynamic(&dst, libtcod_sources); - } else if target.contains("darwin") { build_libz(libz_sources); @@ -304,14 +302,16 @@ fn main() { assert!(dst.join("libtcod.dylib").is_file()); println!("cargo:rustc-link-lib=framework=Cocoa"); - } else if target.contains("windows-gnu") { assert!(sdl_lib_dir.is_dir()); assert!(sdl_include_dir.is_dir()); fs::copy(&sdl_lib_dir.join("SDL2.dll"), &dst.join("SDL2.dll")).unwrap(); fs::copy(&sdl_lib_dir.join("libSDL2.a"), &dst.join("libSDL2.a")).unwrap(); - fs::copy(&sdl_lib_dir.join("libSDL2main.a"), &dst.join("libSDL2main.a")).unwrap(); - + fs::copy( + &sdl_lib_dir.join("libSDL2main.a"), + &dst.join("libSDL2main.a"), + ) + .unwrap(); // Build the DLL let mut config = cc::Build::new(); @@ -324,11 +324,16 @@ fn main() { config.flag(dst.join("libtcod.dll").to_str().unwrap()); config.flag("-shared"); fs::create_dir(dst.join("lib")).unwrap(); - config.flag(&format!("-Wl,--out-implib,{}", dst.join("lib/libtcod.a").display())); + config.flag(&format!( + "-Wl,--out-implib,{}", + dst.join("lib/libtcod.a").display() + )); config.include(Path::new("libtcod").join("src").join("vendor").join("zlib")); config.include(Path::new("libtcod").join("src")); for c_file in libz_sources.iter().chain(libtcod_sources.iter()) { - let path = c_file.split('/').fold(PathBuf::new(), |path, segment| path.join(segment)); + let path = c_file + .split('/') + .fold(PathBuf::new(), |path, segment| path.join(segment)); config.flag(src.join(path).to_str().unwrap()); } config.flag("-mwindows"); @@ -346,7 +351,6 @@ fn main() { println!("cargo:rustc-link-lib=dylib=SDL2"); println!("cargo:rustc-link-search=native={}", sdl_lib_dir.display()); println!("cargo:rustc-link-search=native={}", dst.display()); - } else if target.contains("windows-msvc") { assert!(sdl_lib_dir.is_dir()); assert!(sdl_include_dir.is_dir()); @@ -367,7 +371,9 @@ fn main() { // Make sure the path is in the Windows format. This // shouldn't matter but it's distracting when debugging // build script issues. - let path = c_file.split('/').fold(PathBuf::new(), |path, segment| path.join(segment)); + let path = c_file + .split('/') + .fold(PathBuf::new(), |path, segment| path.join(segment)); config.flag(src.join(path).to_str().unwrap()); } config.flag("User32.lib"); diff --git a/tcod_sys/x86_64-pc-windows-msvc_bindings.rs b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs index adb609095..661b04a0a 100644 --- a/tcod_sys/x86_64-pc-windows-msvc_bindings.rs +++ b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs @@ -1,7 +1,5 @@ /* automatically generated by rust-bindgen */ -pub type TCOD_font_flags_t_type = i32; - #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); diff --git a/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs b/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs index 6ab22b037..e5e8e9ddb 100644 --- a/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs +++ b/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs @@ -1,7 +1,5 @@ /* automatically generated by rust-bindgen */ -pub type TCOD_font_flags_t_type = u32; - #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); From 9fbd18421d6dda3ef9dbe35abc7369d2b6e9df2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Tue, 30 Jun 2020 13:55:02 +0200 Subject: [PATCH 18/27] Clean up travis file somewhat; upload bindings generated to file.io --- .travis.yml | 15 ++++++++------- .travis/linux_before_install.sh | 3 +++ .travis/linux_install.sh | 3 +++ .travis/linux_script.sh | 6 ++++++ .travis/osx_before_install.sh | 3 +++ .travis/osx_install.sh | 3 +++ .travis/osx_script.sh | 4 ++++ 7 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 .travis/linux_before_install.sh create mode 100644 .travis/linux_install.sh create mode 100644 .travis/linux_script.sh create mode 100644 .travis/osx_before_install.sh create mode 100644 .travis/osx_install.sh create mode 100644 .travis/osx_script.sh diff --git a/.travis.yml b/.travis.yml index 300c0ef15..e1bb06ee1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,15 +12,16 @@ matrix: - os: osx rust: nightly before_install: -- '[ "$TRAVIS_OS_NAME" = linux ] && sudo apt-get update -qq || brew update' +- chmod +x .travis/*.sh +- 'if [[ -f ".travis/${TRAVIS_OS_NAME}_before_install.sh" ]]; then .travis/${TRAVIS_OS_NAME}_before_install.sh; fi' install: -- '[ "$TRAVIS_OS_NAME" = linux ] && sudo apt-get install -y libsdl2-dev libegl1-mesa-dev libgles2-mesa-dev llvm-dev libclang-dev clang || brew install sdl2 llvm' +- 'if [[ -f ".travis/${TRAVIS_OS_NAME}_install.sh" ]]; then .travis/${TRAVIS_OS_NAME}_install.sh; fi' script: -- '[ "$TRAVIS_OS_NAME" = osx ] && export PATH="/usr/local/opt/llvm/bin:$PATH" && export LIBCLANG_PATH="/usr/local/opt/llvm/bin"' -- 'if [[ "$TRAVIS_OS_NAME" == linux ]]; then wget -O - https://www.libsdl.org/release/SDL2-2.0.12.tar.gz | tar xz; fi' -- 'if [[ "$TRAVIS_OS_NAME" == linux ]]; then (cd SDL2-* && ./configure --prefix=$HOME/.local && make -j 3 install); fi' -- 'if [[ "$TRAVIS_OS_NAME" == linux ]]; then export PATH=~/.local/bin:$PATH; export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOME/.local/lib/pkgconfig"; fi' -- pushd tcod_sys; cargo build --features generate_bindings; cat $TARGET_bindings.rs; popd +- 'if [[ -f ".travis/${TRAVIS_OS_NAME}_script.sh" ]]; then .travis/${TRAVIS_OS_NAME}_script.sh; fi' +- export DEFAULT_TARGET=$(rustup show | grep default | grep -Po "^[^-]+-\K\S+") +- pushd tcod_sys; cargo build --features generate_bindings; popd +- 'export BINDINGS_FILE=${DEFAULT_TARGET}_bindings.rs; echo "$BINDINGS_FILE download:"' +- curl -F "file=@./tcod_sys/${BINDINGS_FILE}" https://file.io/ | grep -Po '"link":"\K[^"]+' - cargo build --verbose - cargo test --verbose - cargo test --features "rustc-serialize serde" --verbose diff --git a/.travis/linux_before_install.sh b/.travis/linux_before_install.sh new file mode 100644 index 000000000..34889bed3 --- /dev/null +++ b/.travis/linux_before_install.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +sudo apt-get update -qq \ No newline at end of file diff --git a/.travis/linux_install.sh b/.travis/linux_install.sh new file mode 100644 index 000000000..57d5a8433 --- /dev/null +++ b/.travis/linux_install.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +sudo apt-get install -y libsdl2-dev libegl1-mesa-dev libgles2-mesa-dev llvm-dev libclang-dev clang diff --git a/.travis/linux_script.sh b/.travis/linux_script.sh new file mode 100644 index 000000000..3920f95fa --- /dev/null +++ b/.travis/linux_script.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +wget -O - https://www.libsdl.org/release/SDL2-2.0.12.tar.gz | tar xz +(cd SDL2-* && ./configure --prefix="$HOME/.local" && make -j 3 install) +export PATH=~/.local/bin:$PATH +export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOME/.local/lib/pkgconfig" diff --git a/.travis/osx_before_install.sh b/.travis/osx_before_install.sh new file mode 100644 index 000000000..da51996b3 --- /dev/null +++ b/.travis/osx_before_install.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +brew update \ No newline at end of file diff --git a/.travis/osx_install.sh b/.travis/osx_install.sh new file mode 100644 index 000000000..8882b8822 --- /dev/null +++ b/.travis/osx_install.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +brew install sdl2 llvm diff --git a/.travis/osx_script.sh b/.travis/osx_script.sh new file mode 100644 index 000000000..6e4b441f8 --- /dev/null +++ b/.travis/osx_script.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export PATH="/usr/local/opt/llvm/bin:$PATH" +export LIBCLANG_PATH="/usr/local/opt/llvm/bin" From 329d0dc0175f01cc468d1c9b83c9eacbf1269179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Tue, 30 Jun 2020 14:13:24 +0200 Subject: [PATCH 19/27] Fix windows-gnu builds? --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ec28dbc33..f66c2db1a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,8 +19,8 @@ install: - set RUST_BACKTRACE=1 - rustc -V - cargo -V - - ps: $env:BITS=$(if ($env:ARCH -eq "amd64") { 64 } else { 32 }) - - ps: $env:PROGRAM_FILES=$(if ($env:ARCH -eq "amd64") { "C:\Program Files" } else { ${env:ProgramFiles(x86)} }) + - ps: $env:BITS=$(if ($env:ARCH -eq "amd64" -or $env:MSYS_BITS -eq "64") { 64 } else { 32 }) + - ps: $env:PROGRAM_FILES=$(if ($env:ARCH -eq "amd64" -or $env:MSYS_BITS -eq "64") { "C:\Program Files" } else { ${env:ProgramFiles(x86)} }) - ps: Start-FileDownload "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win${env:BITS}.exe" - LLVM-10.0.0-win%BITS%.exe /S /D=%PROGRAM_FILES%\LLVM - set LIBCLANG_PATH=%PROGRAM_FILES%\LLVM\bin From 1f3fe39c741b593c0c5218eda4298fea24a4b91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Tue, 30 Jun 2020 14:13:46 +0200 Subject: [PATCH 20/27] Run Travis scripts in current shell (i.e. source them) --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e1bb06ee1..612fdf915 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,11 +13,11 @@ matrix: rust: nightly before_install: - chmod +x .travis/*.sh -- 'if [[ -f ".travis/${TRAVIS_OS_NAME}_before_install.sh" ]]; then .travis/${TRAVIS_OS_NAME}_before_install.sh; fi' +- 'if [[ -f ".travis/${TRAVIS_OS_NAME}_before_install.sh" ]]; then . .travis/${TRAVIS_OS_NAME}_before_install.sh; fi' install: -- 'if [[ -f ".travis/${TRAVIS_OS_NAME}_install.sh" ]]; then .travis/${TRAVIS_OS_NAME}_install.sh; fi' +- 'if [[ -f ".travis/${TRAVIS_OS_NAME}_install.sh" ]]; then . .travis/${TRAVIS_OS_NAME}_install.sh; fi' script: -- 'if [[ -f ".travis/${TRAVIS_OS_NAME}_script.sh" ]]; then .travis/${TRAVIS_OS_NAME}_script.sh; fi' +- 'if [[ -f ".travis/${TRAVIS_OS_NAME}_script.sh" ]]; then . .travis/${TRAVIS_OS_NAME}_script.sh; fi' - export DEFAULT_TARGET=$(rustup show | grep default | grep -Po "^[^-]+-\K\S+") - pushd tcod_sys; cargo build --features generate_bindings; popd - 'export BINDINGS_FILE=${DEFAULT_TARGET}_bindings.rs; echo "$BINDINGS_FILE download:"' From f32be1ecd74b42798a67dc9fe560cfd9862414e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Tue, 30 Jun 2020 15:01:20 +0200 Subject: [PATCH 21/27] Set target/sysroot manually on windows-gnu targets --- tcod_sys/build.rs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/tcod_sys/build.rs b/tcod_sys/build.rs index 72e740377..fcd8d7bac 100644 --- a/tcod_sys/build.rs +++ b/tcod_sys/build.rs @@ -109,7 +109,7 @@ fn generate_bindings>(dst_dir: P) { // Tell cargo to invalidate the built crate whenever the wrapper changes println!("cargo:rerun-if-changed=bindgen.h"); - let bindings = bindgen::Builder::default() + let bindgen_builder = bindgen::Builder::default() .header("bindgen.h") .emit_builtins() .default_enum_style(bindgen::EnumVariation::Rust { @@ -119,9 +119,22 @@ fn generate_bindings>(dst_dir: P) { .bitfield_enum("TCOD_font_flags_t") // Tell cargo to invalidate the built crate whenever any of the // included header files changed. - .parse_callbacks(Box::new(bindgen::CargoCallbacks)) - .generate() - .expect("Unable to generate bindings"); + .parse_callbacks(Box::new(bindgen::CargoCallbacks)); + let bindings = if target.contains("windows-gnu") { + let bits = env::var("BITS").unwrap(); + // We need to override the target and sysroot for CLang on Windows GNU; + // see https://github.com/rust-lang/rust-bindgen/issues/1760 + let target_arg = format!("--target={}", target); + let sysroot_arg = format!(r#"--sysroot=C:\msys64\mingw{}\"#, bits); + bindgen_builder + .clang_args(&[&target_arg, &sysroot_arg]) + .generate() + .expect("Unable to generate bindings") + } else { + bindgen_builder + .generate() + .expect("Unable to generate bindings") + }; // Write the bindings to the $OUT_DIR/bindings.rs file. let bindings_file = dst_dir.as_ref().join("bindings.rs"); From 8cc0a6ac985bd929e700f692c04b474d0e42a041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Tue, 30 Jun 2020 15:01:51 +0200 Subject: [PATCH 22/27] Try fixing LLVM issues on OSX (Also, get a decent grep) --- .travis.yml | 5 +++-- .travis/osx_script.sh | 5 +++-- tcod_sys/lib.rs | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 612fdf915..da467d66b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,10 +18,11 @@ install: - 'if [[ -f ".travis/${TRAVIS_OS_NAME}_install.sh" ]]; then . .travis/${TRAVIS_OS_NAME}_install.sh; fi' script: - 'if [[ -f ".travis/${TRAVIS_OS_NAME}_script.sh" ]]; then . .travis/${TRAVIS_OS_NAME}_script.sh; fi' -- export DEFAULT_TARGET=$(rustup show | grep default | grep -Po "^[^-]+-\K\S+") +- 'if [[ "$TRAVIS_OS_NAME" == linux ]]; then export GREP=grep; else export GREP=ggrep; fi' +- export DEFAULT_TARGET=$(rustup show | grep default | $GREP -Po "^[^-]+-\K\S+") - pushd tcod_sys; cargo build --features generate_bindings; popd - 'export BINDINGS_FILE=${DEFAULT_TARGET}_bindings.rs; echo "$BINDINGS_FILE download:"' -- curl -F "file=@./tcod_sys/${BINDINGS_FILE}" https://file.io/ | grep -Po '"link":"\K[^"]+' +- curl -F "file=@./tcod_sys/${BINDINGS_FILE}" https://file.io/ | $GREP -Po '"link":"\K[^"]+' - cargo build --verbose - cargo test --verbose - cargo test --features "rustc-serialize serde" --verbose diff --git a/.travis/osx_script.sh b/.travis/osx_script.sh index 6e4b441f8..640af7448 100644 --- a/.travis/osx_script.sh +++ b/.travis/osx_script.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash -export PATH="/usr/local/opt/llvm/bin:$PATH" -export LIBCLANG_PATH="/usr/local/opt/llvm/bin" +export PATH="$(brew --prefix llvm)/bin:$PATH" +export LIBCLANG_PATH="$(brew --prefix llvm)/lib" + diff --git a/tcod_sys/lib.rs b/tcod_sys/lib.rs index 3adf19e3e..3a67723bf 100644 --- a/tcod_sys/lib.rs +++ b/tcod_sys/lib.rs @@ -1,4 +1,5 @@ #![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)] #![allow(clippy::missing_safety_doc, clippy::redundant_static_lifetimes)] +#![allow(improper_ctypes)] include!(concat!("./", env!("BINDINGS_TARGET"), "_bindings.rs")); From e7faf9b33267942a11fd971d475d46b6d98e5774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Tue, 30 Jun 2020 20:08:28 +0200 Subject: [PATCH 23/27] Try explicitly installing grep --- .travis/osx_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/osx_install.sh b/.travis/osx_install.sh index 8882b8822..d7af79a4d 100644 --- a/.travis/osx_install.sh +++ b/.travis/osx_install.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -brew install sdl2 llvm +brew install sdl2 llvm grep From 86b5d80f26918619f27b38a6e7fbfc2312f1caac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Tue, 30 Jun 2020 21:22:14 +0200 Subject: [PATCH 24/27] Add bindings from CI builds --- tcod_sys/i686-pc-windows-msvc_bindings.rs | 11732 +++++++++++++++ tcod_sys/x86_64-apple-darwin_bindings.rs | 11384 ++++++++++++++ tcod_sys/x86_64-pc-windows-gnu_bindings.rs | 12541 ++++++++++++++++ tcod_sys/x86_64-pc-windows-msvc_bindings.rs | 5 +- tcod_sys/x86_64-unknown-linux-gnu_bindings.rs | 323 +- 5 files changed, 35744 insertions(+), 241 deletions(-) create mode 100644 tcod_sys/i686-pc-windows-msvc_bindings.rs create mode 100644 tcod_sys/x86_64-apple-darwin_bindings.rs create mode 100644 tcod_sys/x86_64-pc-windows-gnu_bindings.rs diff --git a/tcod_sys/i686-pc-windows-msvc_bindings.rs b/tcod_sys/i686-pc-windows-msvc_bindings.rs new file mode 100644 index 000000000..e1b11d673 --- /dev/null +++ b/tcod_sys/i686-pc-windows-msvc_bindings.rs @@ -0,0 +1,11732 @@ +/* automatically generated by rust-bindgen */ + +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub const fn new() -> Self { + __IncompleteArrayField(::std::marker::PhantomData, []) + } + #[inline] + pub fn as_ptr(&self) -> *const T { + self as *const _ as *const T + } + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut T { + self as *mut _ as *mut T + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::std::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::std::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} +pub const __llvm__: u32 = 1; +pub const __clang__: u32 = 1; +pub const __clang_major__: u32 = 10; +pub const __clang_minor__: u32 = 0; +pub const __clang_patchlevel__: u32 = 0; +pub const __clang_version__: &'static [u8; 8usize] = b"10.0.0 \0"; +pub const __ATOMIC_RELAXED: u32 = 0; +pub const __ATOMIC_CONSUME: u32 = 1; +pub const __ATOMIC_ACQUIRE: u32 = 2; +pub const __ATOMIC_RELEASE: u32 = 3; +pub const __ATOMIC_ACQ_REL: u32 = 4; +pub const __ATOMIC_SEQ_CST: u32 = 5; +pub const __OPENCL_MEMORY_SCOPE_WORK_ITEM: u32 = 0; +pub const __OPENCL_MEMORY_SCOPE_WORK_GROUP: u32 = 1; +pub const __OPENCL_MEMORY_SCOPE_DEVICE: u32 = 2; +pub const __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES: u32 = 3; +pub const __OPENCL_MEMORY_SCOPE_SUB_GROUP: u32 = 4; +pub const __PRAGMA_REDEFINE_EXTNAME: u32 = 1; +pub const __VERSION__: &'static [u8; 14usize] = b"Clang 10.0.0 \0"; +pub const __OBJC_BOOL_IS_BOOL: u32 = 0; +pub const __CONSTANT_CFSTRINGS__: u32 = 1; +pub const __ORDER_LITTLE_ENDIAN__: u32 = 1234; +pub const __ORDER_BIG_ENDIAN__: u32 = 4321; +pub const __ORDER_PDP_ENDIAN__: u32 = 3412; +pub const __BYTE_ORDER__: u32 = 1234; +pub const __LITTLE_ENDIAN__: u32 = 1; +pub const _ILP32: u32 = 1; +pub const __ILP32__: u32 = 1; +pub const __CHAR_BIT__: u32 = 8; +pub const __SCHAR_MAX__: u32 = 127; +pub const __SHRT_MAX__: u32 = 32767; +pub const __INT_MAX__: u32 = 2147483647; +pub const __LONG_MAX__: u32 = 2147483647; +pub const __LONG_LONG_MAX__: u64 = 9223372036854775807; +pub const __WCHAR_MAX__: u32 = 65535; +pub const __WINT_MAX__: u32 = 65535; +pub const __INTMAX_MAX__: u64 = 9223372036854775807; +pub const __SIZE_MAX__: u32 = 4294967295; +pub const __UINTMAX_MAX__: i32 = -1; +pub const __PTRDIFF_MAX__: u32 = 2147483647; +pub const __INTPTR_MAX__: u32 = 2147483647; +pub const __UINTPTR_MAX__: u32 = 4294967295; +pub const __SIZEOF_DOUBLE__: u32 = 8; +pub const __SIZEOF_FLOAT__: u32 = 4; +pub const __SIZEOF_INT__: u32 = 4; +pub const __SIZEOF_LONG__: u32 = 4; +pub const __SIZEOF_LONG_DOUBLE__: u32 = 8; +pub const __SIZEOF_LONG_LONG__: u32 = 8; +pub const __SIZEOF_POINTER__: u32 = 4; +pub const __SIZEOF_SHORT__: u32 = 2; +pub const __SIZEOF_PTRDIFF_T__: u32 = 4; +pub const __SIZEOF_SIZE_T__: u32 = 4; +pub const __SIZEOF_WCHAR_T__: u32 = 2; +pub const __SIZEOF_WINT_T__: u32 = 2; +pub const __INTMAX_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INTMAX_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINTMAX_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINTMAX_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINTMAX_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINTMAX_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __INTMAX_WIDTH__: u32 = 64; +pub const __PTRDIFF_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __PTRDIFF_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __PTRDIFF_WIDTH__: u32 = 32; +pub const __INTPTR_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INTPTR_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __INTPTR_WIDTH__: u32 = 32; +pub const __SIZE_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __SIZE_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __SIZE_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __SIZE_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __SIZE_WIDTH__: u32 = 32; +pub const __WCHAR_WIDTH__: u32 = 16; +pub const __WINT_WIDTH__: u32 = 16; +pub const __SIG_ATOMIC_WIDTH__: u32 = 32; +pub const __SIG_ATOMIC_MAX__: u32 = 2147483647; +pub const __UINTMAX_WIDTH__: u32 = 64; +pub const __UINTPTR_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINTPTR_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINTPTR_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINTPTR_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __UINTPTR_WIDTH__: u32 = 32; +pub const __FLT_HAS_DENORM__: u32 = 1; +pub const __FLT_DIG__: u32 = 6; +pub const __FLT_DECIMAL_DIG__: u32 = 9; +pub const __FLT_HAS_INFINITY__: u32 = 1; +pub const __FLT_HAS_QUIET_NAN__: u32 = 1; +pub const __FLT_MANT_DIG__: u32 = 24; +pub const __FLT_MAX_10_EXP__: u32 = 38; +pub const __FLT_MAX_EXP__: u32 = 128; +pub const __FLT_MIN_10_EXP__: i32 = -37; +pub const __FLT_MIN_EXP__: i32 = -125; +pub const __DBL_HAS_DENORM__: u32 = 1; +pub const __DBL_DIG__: u32 = 15; +pub const __DBL_DECIMAL_DIG__: u32 = 17; +pub const __DBL_HAS_INFINITY__: u32 = 1; +pub const __DBL_HAS_QUIET_NAN__: u32 = 1; +pub const __DBL_MANT_DIG__: u32 = 53; +pub const __DBL_MAX_10_EXP__: u32 = 308; +pub const __DBL_MAX_EXP__: u32 = 1024; +pub const __DBL_MIN_10_EXP__: i32 = -307; +pub const __DBL_MIN_EXP__: i32 = -1021; +pub const __LDBL_HAS_DENORM__: u32 = 1; +pub const __LDBL_DIG__: u32 = 15; +pub const __LDBL_DECIMAL_DIG__: u32 = 17; +pub const __LDBL_HAS_INFINITY__: u32 = 1; +pub const __LDBL_HAS_QUIET_NAN__: u32 = 1; +pub const __LDBL_MANT_DIG__: u32 = 53; +pub const __LDBL_MAX_10_EXP__: u32 = 308; +pub const __LDBL_MAX_EXP__: u32 = 1024; +pub const __LDBL_MIN_10_EXP__: i32 = -307; +pub const __LDBL_MIN_EXP__: i32 = -1021; +pub const __POINTER_WIDTH__: u32 = 32; +pub const __BIGGEST_ALIGNMENT__: u32 = 16; +pub const __WCHAR_UNSIGNED__: u32 = 1; +pub const __WINT_UNSIGNED__: u32 = 1; +pub const __INT8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __INT16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __INT32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __INT64_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INT64_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINT8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __UINT8_MAX__: u32 = 255; +pub const __INT8_MAX__: u32 = 127; +pub const __UINT16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __UINT16_MAX__: u32 = 65535; +pub const __INT16_MAX__: u32 = 32767; +pub const __UINT32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __UINT32_MAX__: u32 = 4294967295; +pub const __INT32_MAX__: u32 = 2147483647; +pub const __UINT64_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINT64_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINT64_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINT64_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __UINT64_MAX__: i32 = -1; +pub const __INT64_MAX__: u64 = 9223372036854775807; +pub const __INT_LEAST8_MAX__: u32 = 127; +pub const __INT_LEAST8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT_LEAST8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __UINT_LEAST8_MAX__: u32 = 255; +pub const __UINT_LEAST8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT_LEAST8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT_LEAST8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT_LEAST8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __INT_LEAST16_MAX__: u32 = 32767; +pub const __INT_LEAST16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT_LEAST16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __UINT_LEAST16_MAX__: u32 = 65535; +pub const __UINT_LEAST16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT_LEAST16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT_LEAST16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT_LEAST16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __INT_LEAST32_MAX__: u32 = 2147483647; +pub const __INT_LEAST32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT_LEAST32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __UINT_LEAST32_MAX__: u32 = 4294967295; +pub const __UINT_LEAST32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT_LEAST32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT_LEAST32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT_LEAST32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __INT_LEAST64_MAX__: u64 = 9223372036854775807; +pub const __INT_LEAST64_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INT_LEAST64_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINT_LEAST64_MAX__: i32 = -1; +pub const __UINT_LEAST64_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINT_LEAST64_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINT_LEAST64_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINT_LEAST64_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __INT_FAST8_MAX__: u32 = 127; +pub const __INT_FAST8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT_FAST8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __UINT_FAST8_MAX__: u32 = 255; +pub const __UINT_FAST8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT_FAST8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT_FAST8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT_FAST8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __INT_FAST16_MAX__: u32 = 32767; +pub const __INT_FAST16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT_FAST16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __UINT_FAST16_MAX__: u32 = 65535; +pub const __UINT_FAST16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT_FAST16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT_FAST16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT_FAST16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __INT_FAST32_MAX__: u32 = 2147483647; +pub const __INT_FAST32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT_FAST32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __UINT_FAST32_MAX__: u32 = 4294967295; +pub const __UINT_FAST32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT_FAST32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT_FAST32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT_FAST32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __INT_FAST64_MAX__: u64 = 9223372036854775807; +pub const __INT_FAST64_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INT_FAST64_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINT_FAST64_MAX__: i32 = -1; +pub const __UINT_FAST64_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINT_FAST64_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINT_FAST64_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINT_FAST64_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __FINITE_MATH_ONLY__: u32 = 0; +pub const __CLANG_ATOMIC_BOOL_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR16_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR32_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_WCHAR_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_SHORT_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_INT_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_LONG_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_LLONG_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_POINTER_LOCK_FREE: u32 = 2; +pub const __NO_INLINE__: u32 = 1; +pub const __FLT_EVAL_METHOD__: u32 = 0; +pub const __FLT_RADIX__: u32 = 2; +pub const __DECIMAL_DIG__: u32 = 17; +pub const __GCC_ASM_FLAG_OUTPUTS__: u32 = 1; +pub const __code_model_small_: u32 = 1; +pub const i386: u32 = 1; +pub const __i386: u32 = 1; +pub const __i386__: u32 = 1; +pub const __SEG_GS: u32 = 1; +pub const __SEG_FS: u32 = 1; +pub const __pentium4: u32 = 1; +pub const __pentium4__: u32 = 1; +pub const __tune_pentium4__: u32 = 1; +pub const __NO_MATH_INLINES: u32 = 1; +pub const __FXSR__: u32 = 1; +pub const __SSE2__: u32 = 1; +pub const __SSE2_MATH__: u32 = 1; +pub const __SSE__: u32 = 1; +pub const __SSE_MATH__: u32 = 1; +pub const _M_IX86_FP: u32 = 2; +pub const __MMX__: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8: u32 = 1; +pub const _WIN32: u32 = 1; +pub const _MSC_VER: u32 = 1900; +pub const _MSC_FULL_VER: u32 = 190024241; +pub const _MSC_BUILD: u32 = 1; +pub const _MSC_EXTENSIONS: u32 = 1; +pub const _INTEGRAL_MAX_BITS: u32 = 64; +pub const _M_IX86: u32 = 600; +pub const __STDC_HOSTED__: u32 = 1; +pub const __STDC_VERSION__: u32 = 201112; +pub const __STDC_UTF_16__: u32 = 1; +pub const __STDC_UTF_32__: u32 = 1; +pub const _SAL_VERSION: u32 = 20; +pub const __SAL_H_VERSION: u32 = 180000000; +pub const _USE_DECLSPECS_FOR_SAL: u32 = 0; +pub const _USE_ATTRIBUTES_FOR_SAL: u32 = 0; +pub const _CRT_PACKING: u32 = 8; +pub const _HAS_EXCEPTIONS: u32 = 1; +pub const _ARGMAX: u32 = 100; +pub const _CRT_INT_MAX: u32 = 2147483647; +pub const _CRT_FUNCTIONS_REQUIRED: u32 = 1; +pub const _CRT_HAS_CXX17: u32 = 0; +pub const _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE: u32 = 1; +pub const _CRT_BUILD_DESKTOP_APP: u32 = 1; +pub const _CRT_INTERNAL_NONSTDC_NAMES: u32 = 1; +pub const __STDC_SECURE_LIB__: u32 = 200411; +pub const __GOT_SECURE_LIB__: u32 = 200411; +pub const __STDC_WANT_SECURE_LIB__: u32 = 1; +pub const _SECURECRT_FILL_BUFFER_PATTERN: u32 = 254; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES: u32 = 1; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY: u32 = 0; +pub const EPERM: u32 = 1; +pub const ENOENT: u32 = 2; +pub const ESRCH: u32 = 3; +pub const EINTR: u32 = 4; +pub const EIO: u32 = 5; +pub const ENXIO: u32 = 6; +pub const E2BIG: u32 = 7; +pub const ENOEXEC: u32 = 8; +pub const EBADF: u32 = 9; +pub const ECHILD: u32 = 10; +pub const EAGAIN: u32 = 11; +pub const ENOMEM: u32 = 12; +pub const EACCES: u32 = 13; +pub const EFAULT: u32 = 14; +pub const EBUSY: u32 = 16; +pub const EEXIST: u32 = 17; +pub const EXDEV: u32 = 18; +pub const ENODEV: u32 = 19; +pub const ENOTDIR: u32 = 20; +pub const EISDIR: u32 = 21; +pub const ENFILE: u32 = 23; +pub const EMFILE: u32 = 24; +pub const ENOTTY: u32 = 25; +pub const EFBIG: u32 = 27; +pub const ENOSPC: u32 = 28; +pub const ESPIPE: u32 = 29; +pub const EROFS: u32 = 30; +pub const EMLINK: u32 = 31; +pub const EPIPE: u32 = 32; +pub const EDOM: u32 = 33; +pub const EDEADLK: u32 = 36; +pub const ENAMETOOLONG: u32 = 38; +pub const ENOLCK: u32 = 39; +pub const ENOSYS: u32 = 40; +pub const ENOTEMPTY: u32 = 41; +pub const EINVAL: u32 = 22; +pub const ERANGE: u32 = 34; +pub const EILSEQ: u32 = 42; +pub const STRUNCATE: u32 = 80; +pub const EDEADLOCK: u32 = 36; +pub const EADDRINUSE: u32 = 100; +pub const EADDRNOTAVAIL: u32 = 101; +pub const EAFNOSUPPORT: u32 = 102; +pub const EALREADY: u32 = 103; +pub const EBADMSG: u32 = 104; +pub const ECANCELED: u32 = 105; +pub const ECONNABORTED: u32 = 106; +pub const ECONNREFUSED: u32 = 107; +pub const ECONNRESET: u32 = 108; +pub const EDESTADDRREQ: u32 = 109; +pub const EHOSTUNREACH: u32 = 110; +pub const EIDRM: u32 = 111; +pub const EINPROGRESS: u32 = 112; +pub const EISCONN: u32 = 113; +pub const ELOOP: u32 = 114; +pub const EMSGSIZE: u32 = 115; +pub const ENETDOWN: u32 = 116; +pub const ENETRESET: u32 = 117; +pub const ENETUNREACH: u32 = 118; +pub const ENOBUFS: u32 = 119; +pub const ENODATA: u32 = 120; +pub const ENOLINK: u32 = 121; +pub const ENOMSG: u32 = 122; +pub const ENOPROTOOPT: u32 = 123; +pub const ENOSR: u32 = 124; +pub const ENOSTR: u32 = 125; +pub const ENOTCONN: u32 = 126; +pub const ENOTRECOVERABLE: u32 = 127; +pub const ENOTSOCK: u32 = 128; +pub const ENOTSUP: u32 = 129; +pub const EOPNOTSUPP: u32 = 130; +pub const EOTHER: u32 = 131; +pub const EOVERFLOW: u32 = 132; +pub const EOWNERDEAD: u32 = 133; +pub const EPROTO: u32 = 134; +pub const EPROTONOSUPPORT: u32 = 135; +pub const EPROTOTYPE: u32 = 136; +pub const ETIME: u32 = 137; +pub const ETIMEDOUT: u32 = 138; +pub const ETXTBSY: u32 = 139; +pub const EWOULDBLOCK: u32 = 140; +pub const _CRT_INTERNAL_STDIO_SYMBOL_PREFIX: &'static [u8; 2usize] = b"_\0"; +pub const _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION: u32 = 1; +pub const _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR: u32 = 2; +pub const _CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS: u32 = 4; +pub const _CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY: u32 = 8; +pub const _CRT_INTERNAL_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS: u32 = 16; +pub const _CRT_INTERNAL_SCANF_SECURECRT: u32 = 1; +pub const _CRT_INTERNAL_SCANF_LEGACY_WIDE_SPECIFIERS: u32 = 2; +pub const _CRT_INTERNAL_SCANF_LEGACY_MSVCRT_COMPATIBILITY: u32 = 4; +pub const _UPPER: u32 = 1; +pub const _LOWER: u32 = 2; +pub const _DIGIT: u32 = 4; +pub const _SPACE: u32 = 8; +pub const _PUNCT: u32 = 16; +pub const _CONTROL: u32 = 32; +pub const _BLANK: u32 = 64; +pub const _HEX: u32 = 128; +pub const _LEADBYTE: u32 = 32768; +pub const _ALPHA: u32 = 259; +pub const _SH_DENYRW: u32 = 16; +pub const _SH_DENYWR: u32 = 32; +pub const _SH_DENYRD: u32 = 48; +pub const _SH_DENYNO: u32 = 64; +pub const _SH_SECURE: u32 = 128; +pub const SH_DENYRW: u32 = 16; +pub const SH_DENYWR: u32 = 32; +pub const SH_DENYRD: u32 = 48; +pub const SH_DENYNO: u32 = 64; +pub const _MAX_ITOSTR_BASE16_COUNT: u32 = 9; +pub const _MAX_ITOSTR_BASE10_COUNT: u32 = 12; +pub const _MAX_ITOSTR_BASE8_COUNT: u32 = 12; +pub const _MAX_ITOSTR_BASE2_COUNT: u32 = 33; +pub const _MAX_LTOSTR_BASE16_COUNT: u32 = 9; +pub const _MAX_LTOSTR_BASE10_COUNT: u32 = 12; +pub const _MAX_LTOSTR_BASE8_COUNT: u32 = 12; +pub const _MAX_LTOSTR_BASE2_COUNT: u32 = 33; +pub const _MAX_ULTOSTR_BASE16_COUNT: u32 = 9; +pub const _MAX_ULTOSTR_BASE10_COUNT: u32 = 11; +pub const _MAX_ULTOSTR_BASE8_COUNT: u32 = 12; +pub const _MAX_ULTOSTR_BASE2_COUNT: u32 = 33; +pub const _MAX_I64TOSTR_BASE16_COUNT: u32 = 17; +pub const _MAX_I64TOSTR_BASE10_COUNT: u32 = 21; +pub const _MAX_I64TOSTR_BASE8_COUNT: u32 = 23; +pub const _MAX_I64TOSTR_BASE2_COUNT: u32 = 65; +pub const _MAX_U64TOSTR_BASE16_COUNT: u32 = 17; +pub const _MAX_U64TOSTR_BASE10_COUNT: u32 = 21; +pub const _MAX_U64TOSTR_BASE8_COUNT: u32 = 23; +pub const _MAX_U64TOSTR_BASE2_COUNT: u32 = 65; +pub const _S_IFMT: u32 = 61440; +pub const _S_IFDIR: u32 = 16384; +pub const _S_IFCHR: u32 = 8192; +pub const _S_IFIFO: u32 = 4096; +pub const _S_IFREG: u32 = 32768; +pub const _S_IREAD: u32 = 256; +pub const _S_IWRITE: u32 = 128; +pub const _S_IEXEC: u32 = 64; +pub const S_IFMT: u32 = 61440; +pub const S_IFDIR: u32 = 16384; +pub const S_IFCHR: u32 = 8192; +pub const S_IFREG: u32 = 32768; +pub const S_IREAD: u32 = 256; +pub const S_IWRITE: u32 = 128; +pub const S_IEXEC: u32 = 64; +pub const WCHAR_MIN: u32 = 0; +pub const WCHAR_MAX: u32 = 65535; +pub const WINT_MIN: u32 = 0; +pub const WINT_MAX: u32 = 65535; +pub const __bool_true_false_are_defined: u32 = 1; +pub const false_: u32 = 0; +pub const true_: u32 = 1; +pub const TCOD_MAJOR_VERSION: u32 = 1; +pub const TCOD_MINOR_VERSION: u32 = 16; +pub const TCOD_PATCHLEVEL: u32 = 0; +pub const TCOD_STRVERSION: &'static [u8; 16usize] = b"1.16.0-alpha.12\0"; +pub const TCOD_HEXVERSION: u32 = 69632; +pub const TCOD_TECHVERSION: u32 = 17825792; +pub const TCOD_STRVERSIONNAME: &'static [u8; 24usize] = b"libtcod 1.16.0-alpha.12\0"; +pub const TCOD_KEY_TEXT_SIZE: u32 = 32; +pub const TCOD_NOISE_MAX_OCTAVES: u32 = 128; +pub const TCOD_NOISE_MAX_DIMENSIONS: u32 = 4; +pub const TCOD_NOISE_DEFAULT_HURST: f64 = 0.5; +pub const TCOD_NOISE_DEFAULT_LACUNARITY: f64 = 2.0; +pub const TCOD_LEX_FLAG_NOCASE: u32 = 1; +pub const TCOD_LEX_FLAG_NESTING_COMMENT: u32 = 2; +pub const TCOD_LEX_FLAG_TOKENIZE_COMMENTS: u32 = 4; +pub const TCOD_LEX_ERROR: i32 = -1; +pub const TCOD_LEX_UNKNOWN: u32 = 0; +pub const TCOD_LEX_SYMBOL: u32 = 1; +pub const TCOD_LEX_KEYWORD: u32 = 2; +pub const TCOD_LEX_IDEN: u32 = 3; +pub const TCOD_LEX_STRING: u32 = 4; +pub const TCOD_LEX_INTEGER: u32 = 5; +pub const TCOD_LEX_FLOAT: u32 = 6; +pub const TCOD_LEX_CHAR: u32 = 7; +pub const TCOD_LEX_EOF: u32 = 8; +pub const TCOD_LEX_COMMENT: u32 = 9; +pub const TCOD_LEX_MAX_SYMBOLS: u32 = 100; +pub const TCOD_LEX_SYMBOL_SIZE: u32 = 5; +pub const TCOD_LEX_MAX_KEYWORDS: u32 = 100; +pub const TCOD_LEX_KEYWORD_SIZE: u32 = 20; +pub const TCOD_HEAP_DEFAULT_CAPACITY: u32 = 256; +pub const TCOD_HEAP_MAX_NODE_SIZE: u32 = 256; +pub const TCOD_PATHFINDER_MAX_DIMENSIONS: u32 = 4; +pub type va_list = *mut ::std::os::raw::c_char; +pub type size_t = ::std::os::raw::c_uint; +pub type __vcrt_bool = bool; +pub type wchar_t = ::std::os::raw::c_ushort; +extern "C" { + pub fn __security_init_cookie(); +} +extern "fastcall" { + pub fn __security_check_cookie(_StackCookie: usize); +} +extern "C" { + pub fn __report_gsfailure(); +} +extern "C" { + pub static mut __security_cookie: usize; +} +pub type __crt_bool = bool; +extern "C" { + pub fn _invalid_parameter_noinfo(); +} +extern "C" { + pub fn _invalid_parameter_noinfo_noreturn(); +} +extern "C" { + pub fn _invoke_watson( + _Expression: *const wchar_t, + _FunctionName: *const wchar_t, + _FileName: *const wchar_t, + _LineNo: ::std::os::raw::c_uint, + _Reserved: usize, + ); +} +pub type errno_t = ::std::os::raw::c_int; +pub type wint_t = ::std::os::raw::c_ushort; +pub type wctype_t = ::std::os::raw::c_ushort; +pub type __time32_t = ::std::os::raw::c_long; +pub type __time64_t = ::std::os::raw::c_longlong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __crt_locale_data_public { + pub _locale_pctype: *const ::std::os::raw::c_ushort, + pub _locale_mb_cur_max: ::std::os::raw::c_int, + pub _locale_lc_codepage: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout___crt_locale_data_public() { + assert_eq!( + ::std::mem::size_of::<__crt_locale_data_public>(), + 12usize, + concat!("Size of: ", stringify!(__crt_locale_data_public)) + ); + assert_eq!( + ::std::mem::align_of::<__crt_locale_data_public>(), + 4usize, + concat!("Alignment of ", stringify!(__crt_locale_data_public)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__crt_locale_data_public>()))._locale_pctype as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_data_public), + "::", + stringify!(_locale_pctype) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__crt_locale_data_public>()))._locale_mb_cur_max as *const _ + as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_data_public), + "::", + stringify!(_locale_mb_cur_max) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__crt_locale_data_public>()))._locale_lc_codepage as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_data_public), + "::", + stringify!(_locale_lc_codepage) + ) + ); +} +impl Default for __crt_locale_data_public { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __crt_locale_pointers { + pub locinfo: *mut __crt_locale_data, + pub mbcinfo: *mut __crt_multibyte_data, +} +#[test] +fn bindgen_test_layout___crt_locale_pointers() { + assert_eq!( + ::std::mem::size_of::<__crt_locale_pointers>(), + 8usize, + concat!("Size of: ", stringify!(__crt_locale_pointers)) + ); + assert_eq!( + ::std::mem::align_of::<__crt_locale_pointers>(), + 4usize, + concat!("Alignment of ", stringify!(__crt_locale_pointers)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__crt_locale_pointers>())).locinfo as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_pointers), + "::", + stringify!(locinfo) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__crt_locale_pointers>())).mbcinfo as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_pointers), + "::", + stringify!(mbcinfo) + ) + ); +} +impl Default for __crt_locale_pointers { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type _locale_t = *mut __crt_locale_pointers; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _Mbstatet { + pub _Wchar: ::std::os::raw::c_ulong, + pub _Byte: ::std::os::raw::c_ushort, + pub _State: ::std::os::raw::c_ushort, +} +#[test] +fn bindgen_test_layout__Mbstatet() { + assert_eq!( + ::std::mem::size_of::<_Mbstatet>(), + 8usize, + concat!("Size of: ", stringify!(_Mbstatet)) + ); + assert_eq!( + ::std::mem::align_of::<_Mbstatet>(), + 4usize, + concat!("Alignment of ", stringify!(_Mbstatet)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_Mbstatet>()))._Wchar as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_Mbstatet), + "::", + stringify!(_Wchar) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_Mbstatet>()))._Byte as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_Mbstatet), + "::", + stringify!(_Byte) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_Mbstatet>()))._State as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_Mbstatet), + "::", + stringify!(_State) + ) + ); +} +pub type mbstate_t = _Mbstatet; +pub type time_t = __time64_t; +pub type rsize_t = size_t; +extern "C" { + pub fn _errno() -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn _set_errno(_Value: ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn _get_errno(_Value: *mut ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn __doserrno() -> *mut ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _set_doserrno(_Value: ::std::os::raw::c_ulong) -> errno_t; +} +extern "C" { + pub fn _get_doserrno(_Value: *mut ::std::os::raw::c_ulong) -> errno_t; +} +extern "C" { + pub fn memchr( + _Buf: *const ::std::os::raw::c_void, + _Val: ::std::os::raw::c_int, + _MaxCount: ::std::os::raw::c_uint, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memcmp( + _Buf1: *const ::std::os::raw::c_void, + _Buf2: *const ::std::os::raw::c_void, + _Size: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn memcpy( + _Dst: *mut ::std::os::raw::c_void, + _Src: *const ::std::os::raw::c_void, + _Size: ::std::os::raw::c_uint, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memmove( + _Dst: *mut ::std::os::raw::c_void, + _Src: *const ::std::os::raw::c_void, + _Size: ::std::os::raw::c_uint, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memset( + _Dst: *mut ::std::os::raw::c_void, + _Val: ::std::os::raw::c_int, + _Size: ::std::os::raw::c_uint, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn strchr( + _Str: *const ::std::os::raw::c_char, + _Val: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strrchr( + _Str: *const ::std::os::raw::c_char, + _Ch: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strstr( + _Str: *const ::std::os::raw::c_char, + _SubStr: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn wcschr( + _Str: *const ::std::os::raw::c_ushort, + _Ch: ::std::os::raw::c_ushort, + ) -> *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub fn wcsrchr(_Str: *const wchar_t, _Ch: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsstr(_Str: *const wchar_t, _SubStr: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _cgetws_s( + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _SizeRead: *mut size_t, + ) -> errno_t; +} +extern "C" { + pub fn _cputws(_Buffer: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _getwch() -> wint_t; +} +extern "C" { + pub fn _getwche() -> wint_t; +} +extern "C" { + pub fn _putwch(_Character: wchar_t) -> wint_t; +} +extern "C" { + pub fn _ungetwch(_Character: wint_t) -> wint_t; +} +extern "C" { + pub fn _getwch_nolock() -> wint_t; +} +extern "C" { + pub fn _getwche_nolock() -> wint_t; +} +extern "C" { + pub fn _putwch_nolock(_Character: wchar_t) -> wint_t; +} +extern "C" { + pub fn _ungetwch_nolock(_Character: wint_t) -> wint_t; +} +extern "C" { + pub fn __conio_common_vcwprintf( + _Options: ::std::os::raw::c_ulonglong, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __conio_common_vcwprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __conio_common_vcwprintf_p( + _Options: ::std::os::raw::c_ulonglong, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __conio_common_vcwscanf( + _Options: ::std::os::raw::c_ulonglong, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __pctype_func() -> *const ::std::os::raw::c_ushort; +} +extern "C" { + pub fn __pwctype_func() -> *const wctype_t; +} +extern "C" { + pub fn iswalnum(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswalpha(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswascii(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswblank(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswcntrl(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswdigit(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswgraph(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswlower(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswprint(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswpunct(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswspace(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswupper(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswxdigit(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __iswcsymf(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __iswcsym(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswalnum_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswalpha_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswblank_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswcntrl_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswdigit_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswgraph_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswlower_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswprint_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswpunct_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswspace_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswupper_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswxdigit_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswcsymf_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswcsym_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn towupper(_C: wint_t) -> wint_t; +} +extern "C" { + pub fn towlower(_C: wint_t) -> wint_t; +} +extern "C" { + pub fn iswctype(_C: wint_t, _Type: wctype_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _towupper_l(_C: wint_t, _Locale: _locale_t) -> wint_t; +} +extern "C" { + pub fn _towlower_l(_C: wint_t, _Locale: _locale_t) -> wint_t; +} +extern "C" { + pub fn _iswctype_l(_C: wint_t, _Type: wctype_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn isleadbyte(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _isleadbyte_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn is_wctype(_C: wint_t, _Type: wctype_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wgetcwd(_DstBuf: *mut wchar_t, _SizeInWords: ::std::os::raw::c_int) -> *mut wchar_t; +} +extern "C" { + pub fn _wgetdcwd( + _Drive: ::std::os::raw::c_int, + _DstBuf: *mut wchar_t, + _SizeInWords: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wchdir(_Path: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wmkdir(_Path: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wrmdir(_Path: *const wchar_t) -> ::std::os::raw::c_int; +} +pub type _fsize_t = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _wfinddata32_t { + pub attrib: ::std::os::raw::c_uint, + pub time_create: __time32_t, + pub time_access: __time32_t, + pub time_write: __time32_t, + pub size: _fsize_t, + pub name: [wchar_t; 260usize], +} +#[test] +fn bindgen_test_layout__wfinddata32_t() { + assert_eq!( + ::std::mem::size_of::<_wfinddata32_t>(), + 540usize, + concat!("Size of: ", stringify!(_wfinddata32_t)) + ); + assert_eq!( + ::std::mem::align_of::<_wfinddata32_t>(), + 4usize, + concat!("Alignment of ", stringify!(_wfinddata32_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).attrib as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(attrib) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).time_create as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(time_create) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).time_access as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(time_access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).time_write as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(time_write) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).size as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).name as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(name) + ) + ); +} +impl Default for _wfinddata32_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _wfinddata32i64_t { + pub attrib: ::std::os::raw::c_uint, + pub time_create: __time32_t, + pub time_access: __time32_t, + pub time_write: __time32_t, + pub size: ::std::os::raw::c_longlong, + pub name: [wchar_t; 260usize], +} +#[test] +fn bindgen_test_layout__wfinddata32i64_t() { + assert_eq!( + ::std::mem::size_of::<_wfinddata32i64_t>(), + 544usize, + concat!("Size of: ", stringify!(_wfinddata32i64_t)) + ); + assert_eq!( + ::std::mem::align_of::<_wfinddata32i64_t>(), + 8usize, + concat!("Alignment of ", stringify!(_wfinddata32i64_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).attrib as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(attrib) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).time_create as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(time_create) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).time_access as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(time_access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).time_write as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(time_write) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).size as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).name as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(name) + ) + ); +} +impl Default for _wfinddata32i64_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _wfinddata64i32_t { + pub attrib: ::std::os::raw::c_uint, + pub time_create: __time64_t, + pub time_access: __time64_t, + pub time_write: __time64_t, + pub size: _fsize_t, + pub name: [wchar_t; 260usize], +} +#[test] +fn bindgen_test_layout__wfinddata64i32_t() { + assert_eq!( + ::std::mem::size_of::<_wfinddata64i32_t>(), + 560usize, + concat!("Size of: ", stringify!(_wfinddata64i32_t)) + ); + assert_eq!( + ::std::mem::align_of::<_wfinddata64i32_t>(), + 8usize, + concat!("Alignment of ", stringify!(_wfinddata64i32_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).attrib as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(attrib) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).time_create as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(time_create) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).time_access as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(time_access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).time_write as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(time_write) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).size as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).name as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(name) + ) + ); +} +impl Default for _wfinddata64i32_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _wfinddata64_t { + pub attrib: ::std::os::raw::c_uint, + pub time_create: __time64_t, + pub time_access: __time64_t, + pub time_write: __time64_t, + pub size: ::std::os::raw::c_longlong, + pub name: [wchar_t; 260usize], +} +#[test] +fn bindgen_test_layout__wfinddata64_t() { + assert_eq!( + ::std::mem::size_of::<_wfinddata64_t>(), + 560usize, + concat!("Size of: ", stringify!(_wfinddata64_t)) + ); + assert_eq!( + ::std::mem::align_of::<_wfinddata64_t>(), + 8usize, + concat!("Alignment of ", stringify!(_wfinddata64_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).attrib as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(attrib) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).time_create as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(time_create) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).time_access as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(time_access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).time_write as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(time_write) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).size as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).name as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(name) + ) + ); +} +impl Default for _wfinddata64_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn _waccess( + _FileName: *const wchar_t, + _AccessMode: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _waccess_s(_FileName: *const wchar_t, _AccessMode: ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn _wchmod( + _FileName: *const wchar_t, + _Mode: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcreat( + _FileName: *const wchar_t, + _PermissionMode: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfindfirst32(_FileName: *const wchar_t, _FindData: *mut _wfinddata32_t) -> isize; +} +extern "C" { + pub fn _wfindnext32( + _FindHandle: isize, + _FindData: *mut _wfinddata32_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wunlink(_FileName: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wrename( + _OldFileName: *const wchar_t, + _NewFileName: *const wchar_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wmktemp_s(_TemplateName: *mut wchar_t, _SizeInWords: size_t) -> errno_t; +} +extern "C" { + pub fn _wmktemp(_TemplateName: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wfindfirst32i64(_FileName: *const wchar_t, _FindData: *mut _wfinddata32i64_t) -> isize; +} +extern "C" { + pub fn _wfindfirst64i32(_FileName: *const wchar_t, _FindData: *mut _wfinddata64i32_t) -> isize; +} +extern "C" { + pub fn _wfindfirst64(_FileName: *const wchar_t, _FindData: *mut _wfinddata64_t) -> isize; +} +extern "C" { + pub fn _wfindnext32i64( + _FindHandle: isize, + _FindData: *mut _wfinddata32i64_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfindnext64i32( + _FindHandle: isize, + _FindData: *mut _wfinddata64i32_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfindnext64( + _FindHandle: isize, + _FindData: *mut _wfinddata64_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wsopen_s( + _FileHandle: *mut ::std::os::raw::c_int, + _FileName: *const wchar_t, + _OpenFlag: ::std::os::raw::c_int, + _ShareFlag: ::std::os::raw::c_int, + _PermissionFlag: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _wsopen_dispatch( + _FileName: *const wchar_t, + _OFlag: ::std::os::raw::c_int, + _ShFlag: ::std::os::raw::c_int, + _PMode: ::std::os::raw::c_int, + _PFileHandle: *mut ::std::os::raw::c_int, + _BSecure: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _wopen( + _FileName: *const wchar_t, + _OpenFlag: ::std::os::raw::c_int, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wsopen( + _FileName: *const wchar_t, + _OpenFlag: ::std::os::raw::c_int, + _ShareFlag: ::std::os::raw::c_int, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wexecl(_FileName: *const wchar_t, _ArgList: *const wchar_t, ...) -> isize; +} +extern "C" { + pub fn _wexecle(_FileName: *const wchar_t, _ArgList: *const wchar_t, ...) -> isize; +} +extern "C" { + pub fn _wexeclp(_FileName: *const wchar_t, _ArgList: *const wchar_t, ...) -> isize; +} +extern "C" { + pub fn _wexeclpe(_FileName: *const wchar_t, _ArgList: *const wchar_t, ...) -> isize; +} +extern "C" { + pub fn _wexecv(_FileName: *const wchar_t, _ArgList: *const *const wchar_t) -> isize; +} +extern "C" { + pub fn _wexecve( + _FileName: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wexecvp(_FileName: *const wchar_t, _ArgList: *const *const wchar_t) -> isize; +} +extern "C" { + pub fn _wexecvpe( + _FileName: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnl( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnle( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnlp( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnlpe( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnv( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnve( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnvp( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnvpe( + _Mode: ::std::os::raw::c_int, + _FileName: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wsystem(_Command: *const wchar_t) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _iobuf { + pub _Placeholder: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout__iobuf() { + assert_eq!( + ::std::mem::size_of::<_iobuf>(), + 4usize, + concat!("Size of: ", stringify!(_iobuf)) + ); + assert_eq!( + ::std::mem::align_of::<_iobuf>(), + 4usize, + concat!("Alignment of ", stringify!(_iobuf)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iobuf>()))._Placeholder as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_iobuf), + "::", + stringify!(_Placeholder) + ) + ); +} +impl Default for _iobuf { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type FILE = _iobuf; +extern "C" { + pub fn __acrt_iob_func(_Ix: ::std::os::raw::c_uint) -> *mut FILE; +} +extern "C" { + pub fn fgetwc(_Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fgetwchar() -> wint_t; +} +extern "C" { + pub fn fputwc(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fputwchar(_Character: wchar_t) -> wint_t; +} +extern "C" { + pub fn getwc(_Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn getwchar() -> wint_t; +} +extern "C" { + pub fn fgetws( + _Buffer: *mut wchar_t, + _BufferCount: ::std::os::raw::c_int, + _Stream: *mut FILE, + ) -> *mut wchar_t; +} +extern "C" { + pub fn fputws(_Buffer: *const wchar_t, _Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _getws_s(_Buffer: *mut wchar_t, _BufferCount: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn putwc(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn putwchar(_Character: wchar_t) -> wint_t; +} +extern "C" { + pub fn _putws(_Buffer: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ungetwc(_Character: wint_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _wfdopen(_FileHandle: ::std::os::raw::c_int, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wfopen(_FileName: *const wchar_t, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wfopen_s( + _Stream: *mut *mut FILE, + _FileName: *const wchar_t, + _Mode: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wfreopen( + _FileName: *const wchar_t, + _Mode: *const wchar_t, + _OldStream: *mut FILE, + ) -> *mut FILE; +} +extern "C" { + pub fn _wfreopen_s( + _Stream: *mut *mut FILE, + _FileName: *const wchar_t, + _Mode: *const wchar_t, + _OldStream: *mut FILE, + ) -> errno_t; +} +extern "C" { + pub fn _wfsopen( + _FileName: *const wchar_t, + _Mode: *const wchar_t, + _ShFlag: ::std::os::raw::c_int, + ) -> *mut FILE; +} +extern "C" { + pub fn _wperror(_ErrorMessage: *const wchar_t); +} +extern "C" { + pub fn _wpopen(_Command: *const wchar_t, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wremove(_FileName: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtempnam(_Directory: *const wchar_t, _FilePrefix: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wtmpnam_s(_Buffer: *mut wchar_t, _BufferCount: size_t) -> errno_t; +} +extern "C" { + pub fn _wtmpnam(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _fgetwc_nolock(_Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fputwc_nolock(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _getwc_nolock(_Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _putwc_nolock(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _ungetwc_nolock(_Character: wint_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn __stdio_common_vfwprintf( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vfwprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vfwprintf_p( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vfwscanf( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vswprintf( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vswprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vsnwprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vswprintf_p( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vswscanf( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *const wchar_t, + _BufferCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _itow_s( + _Value: ::std::os::raw::c_int, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _itow( + _Value: ::std::os::raw::c_int, + _Buffer: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _ltow_s( + _Value: ::std::os::raw::c_long, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ltow( + _Value: ::std::os::raw::c_long, + _Buffer: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _ultow_s( + _Value: ::std::os::raw::c_ulong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ultow( + _Value: ::std::os::raw::c_ulong, + _Buffer: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn wcstod(_String: *const wchar_t, _EndPtr: *mut *mut wchar_t) -> f64; +} +extern "C" { + pub fn _wcstod_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Locale: _locale_t, + ) -> f64; +} +extern "C" { + pub fn wcstol( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _wcstol_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn wcstoll( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoll_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn wcstoul( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _wcstoul_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn wcstoull( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _wcstoull_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn wcstold(_String: *const wchar_t, _EndPtr: *mut *mut wchar_t) -> f64; +} +extern "C" { + pub fn _wcstold_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Locale: _locale_t, + ) -> f64; +} +extern "C" { + pub fn wcstof(_String: *const wchar_t, _EndPtr: *mut *mut wchar_t) -> f32; +} +extern "C" { + pub fn _wcstof_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Locale: _locale_t, + ) -> f32; +} +extern "C" { + pub fn _wtof(_String: *const wchar_t) -> f64; +} +extern "C" { + pub fn _wtof_l(_String: *const wchar_t, _Locale: _locale_t) -> f64; +} +extern "C" { + pub fn _wtoi(_String: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtoi_l(_String: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtol(_String: *const wchar_t) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _wtol_l(_String: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _wtoll(_String: *const wchar_t) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wtoll_l(_String: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _i64tow_s( + _Value: ::std::os::raw::c_longlong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _i64tow( + _Value: ::std::os::raw::c_longlong, + _Buffer: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _ui64tow_s( + _Value: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ui64tow( + _Value: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wtoi64(_String: *const wchar_t) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wtoi64_l(_String: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoi64( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoi64_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoui64( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _wcstoui64_l( + _String: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _wfullpath( + _Buffer: *mut wchar_t, + _Path: *const wchar_t, + _BufferCount: size_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wmakepath_s( + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _Drive: *const wchar_t, + _Dir: *const wchar_t, + _Filename: *const wchar_t, + _Ext: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wmakepath( + _Buffer: *mut wchar_t, + _Drive: *const wchar_t, + _Dir: *const wchar_t, + _Filename: *const wchar_t, + _Ext: *const wchar_t, + ); +} +extern "C" { + pub fn _wsplitpath( + _FullPath: *const wchar_t, + _Drive: *mut wchar_t, + _Dir: *mut wchar_t, + _Filename: *mut wchar_t, + _Ext: *mut wchar_t, + ); +} +extern "C" { + pub fn _wsplitpath_s( + _FullPath: *const wchar_t, + _Drive: *mut wchar_t, + _DriveCount: size_t, + _Dir: *mut wchar_t, + _DirCount: size_t, + _Filename: *mut wchar_t, + _FilenameCount: size_t, + _Ext: *mut wchar_t, + _ExtCount: size_t, + ) -> errno_t; +} +extern "C" { + pub fn _wdupenv_s( + _Buffer: *mut *mut wchar_t, + _BufferCount: *mut size_t, + _VarName: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wgetenv(_VarName: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wgetenv_s( + _RequiredCount: *mut size_t, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + _VarName: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wputenv(_EnvString: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wputenv_s(_Name: *const wchar_t, _Value: *const wchar_t) -> errno_t; +} +extern "C" { + pub fn _wsearchenv_s( + _Filename: *const wchar_t, + _VarName: *const wchar_t, + _Buffer: *mut wchar_t, + _BufferCount: size_t, + ) -> errno_t; +} +extern "C" { + pub fn _wsearchenv( + _Filename: *const wchar_t, + _VarName: *const wchar_t, + _ResultPath: *mut wchar_t, + ); +} +extern "C" { + pub fn wcscat_s( + _Destination: *mut wchar_t, + _SizeInWords: rsize_t, + _Source: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn wcscpy_s( + _Destination: *mut wchar_t, + _SizeInWords: rsize_t, + _Source: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn wcsncat_s( + _Destination: *mut wchar_t, + _SizeInWords: rsize_t, + _Source: *const wchar_t, + _MaxCount: rsize_t, + ) -> errno_t; +} +extern "C" { + pub fn wcsncpy_s( + _Destination: *mut wchar_t, + _SizeInWords: rsize_t, + _Source: *const wchar_t, + _MaxCount: rsize_t, + ) -> errno_t; +} +extern "C" { + pub fn wcstok_s( + _String: *mut wchar_t, + _Delimiter: *const wchar_t, + _Context: *mut *mut wchar_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsdup(_String: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscat(_Destination: *mut wchar_t, _Source: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscmp( + _String1: *const ::std::os::raw::c_ushort, + _String2: *const ::std::os::raw::c_ushort, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcscpy(_Destination: *mut wchar_t, _Source: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscspn(_String: *const wchar_t, _Control: *const wchar_t) -> size_t; +} +extern "C" { + pub fn wcslen(_String: *const ::std::os::raw::c_ushort) -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn wcsnlen(_Source: *const wchar_t, _MaxCount: size_t) -> size_t; +} +extern "C" { + pub fn wcsncat( + _Destination: *mut wchar_t, + _Source: *const wchar_t, + _Count: size_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn wcsncmp( + _String1: *const ::std::os::raw::c_ushort, + _String2: *const ::std::os::raw::c_ushort, + _MaxCount: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsncpy( + _Destination: *mut wchar_t, + _Source: *const wchar_t, + _Count: size_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn wcspbrk(_String: *const wchar_t, _Control: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsspn(_String: *const wchar_t, _Control: *const wchar_t) -> size_t; +} +extern "C" { + pub fn wcstok( + _String: *mut wchar_t, + _Delimiter: *const wchar_t, + _Context: *mut *mut wchar_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wcserror(_ErrorNumber: ::std::os::raw::c_int) -> *mut wchar_t; +} +extern "C" { + pub fn _wcserror_s( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _ErrorNumber: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn __wcserror(_String: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn __wcserror_s( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _ErrorMessage: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wcsicmp(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsicmp_l( + _String1: *const wchar_t, + _String2: *const wchar_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicmp( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicmp_l( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnset_s( + _Destination: *mut wchar_t, + _SizeInWords: size_t, + _Value: wchar_t, + _MaxCount: size_t, + ) -> errno_t; +} +extern "C" { + pub fn _wcsnset(_String: *mut wchar_t, _Value: wchar_t, _MaxCount: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsrev(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsset_s(_Destination: *mut wchar_t, _SizeInWords: size_t, _Value: wchar_t) -> errno_t; +} +extern "C" { + pub fn _wcsset(_String: *mut wchar_t, _Value: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcslwr_s(_String: *mut wchar_t, _SizeInWords: size_t) -> errno_t; +} +extern "C" { + pub fn _wcslwr(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcslwr_s_l(_String: *mut wchar_t, _SizeInWords: size_t, _Locale: _locale_t) -> errno_t; +} +extern "C" { + pub fn _wcslwr_l(_String: *mut wchar_t, _Locale: _locale_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsupr_s(_String: *mut wchar_t, _Size: size_t) -> errno_t; +} +extern "C" { + pub fn _wcsupr(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsupr_s_l(_String: *mut wchar_t, _Size: size_t, _Locale: _locale_t) -> errno_t; +} +extern "C" { + pub fn _wcsupr_l(_String: *mut wchar_t, _Locale: _locale_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsxfrm( + _Destination: *mut wchar_t, + _Source: *const wchar_t, + _MaxCount: size_t, + ) -> size_t; +} +extern "C" { + pub fn _wcsxfrm_l( + _Destination: *mut wchar_t, + _Source: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> size_t; +} +extern "C" { + pub fn wcscoll(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcscoll_l( + _String1: *const wchar_t, + _String2: *const wchar_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsicoll(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsicoll_l( + _String1: *const wchar_t, + _String2: *const wchar_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsncoll( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsncoll_l( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicoll( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicoll_l( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsdup(_String: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsicmp(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsnicmp( + _String1: *const wchar_t, + _String2: *const wchar_t, + _MaxCount: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsnset(_String: *mut wchar_t, _Value: wchar_t, _MaxCount: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsrev(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsset(_String: *mut wchar_t, _Value: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcslwr(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsupr(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsicoll(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct tm { + pub tm_sec: ::std::os::raw::c_int, + pub tm_min: ::std::os::raw::c_int, + pub tm_hour: ::std::os::raw::c_int, + pub tm_mday: ::std::os::raw::c_int, + pub tm_mon: ::std::os::raw::c_int, + pub tm_year: ::std::os::raw::c_int, + pub tm_wday: ::std::os::raw::c_int, + pub tm_yday: ::std::os::raw::c_int, + pub tm_isdst: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_tm() { + assert_eq!( + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(tm)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(tm)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_sec as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_sec) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_min as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_min) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_hour as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_hour) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_mday as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mday) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_mon as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mon) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_year as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_year) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_wday as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_wday) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_yday as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_yday) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_isdst as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_isdst) + ) + ); +} +extern "C" { + pub fn _wasctime(_Tm: *const tm) -> *mut wchar_t; +} +extern "C" { + pub fn _wasctime_s(_Buffer: *mut wchar_t, _SizeInWords: size_t, _Tm: *const tm) -> errno_t; +} +extern "C" { + pub fn wcsftime( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _Format: *const wchar_t, + _Tm: *const tm, + ) -> size_t; +} +extern "C" { + pub fn _wcsftime_l( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _Format: *const wchar_t, + _Tm: *const tm, + _Locale: _locale_t, + ) -> size_t; +} +extern "C" { + pub fn _wctime32(_Time: *const __time32_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wctime32_s( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _Time: *const __time32_t, + ) -> errno_t; +} +extern "C" { + pub fn _wctime64(_Time: *const __time64_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wctime64_s( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _Time: *const __time64_t, + ) -> errno_t; +} +extern "C" { + pub fn _wstrdate_s(_Buffer: *mut wchar_t, _SizeInWords: size_t) -> errno_t; +} +extern "C" { + pub fn _wstrdate(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wstrtime_s(_Buffer: *mut wchar_t, _SizeInWords: size_t) -> errno_t; +} +extern "C" { + pub fn _wstrtime(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +pub type _ino_t = ::std::os::raw::c_ushort; +pub type ino_t = _ino_t; +pub type _dev_t = ::std::os::raw::c_uint; +pub type dev_t = _dev_t; +pub type _off_t = ::std::os::raw::c_long; +pub type off_t = _off_t; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _stat32 { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: _off_t, + pub st_atime: __time32_t, + pub st_mtime: __time32_t, + pub st_ctime: __time32_t, +} +#[test] +fn bindgen_test_layout__stat32() { + assert_eq!( + ::std::mem::size_of::<_stat32>(), + 36usize, + concat!("Size of: ", stringify!(_stat32)) + ); + assert_eq!( + ::std::mem::align_of::<_stat32>(), + 4usize, + concat!("Alignment of ", stringify!(_stat32)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_size as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_atime as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_mtime as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_ctime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_ctime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _stat32i64 { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: ::std::os::raw::c_longlong, + pub st_atime: __time32_t, + pub st_mtime: __time32_t, + pub st_ctime: __time32_t, +} +#[test] +fn bindgen_test_layout__stat32i64() { + assert_eq!( + ::std::mem::size_of::<_stat32i64>(), + 48usize, + concat!("Size of: ", stringify!(_stat32i64)) + ); + assert_eq!( + ::std::mem::align_of::<_stat32i64>(), + 8usize, + concat!("Alignment of ", stringify!(_stat32i64)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_size as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_atime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_mtime as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_ctime as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_ctime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _stat64i32 { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: _off_t, + pub st_atime: __time64_t, + pub st_mtime: __time64_t, + pub st_ctime: __time64_t, +} +#[test] +fn bindgen_test_layout__stat64i32() { + assert_eq!( + ::std::mem::size_of::<_stat64i32>(), + 48usize, + concat!("Size of: ", stringify!(_stat64i32)) + ); + assert_eq!( + ::std::mem::align_of::<_stat64i32>(), + 8usize, + concat!("Alignment of ", stringify!(_stat64i32)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_size as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_atime as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_mtime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_ctime as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_ctime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _stat64 { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: ::std::os::raw::c_longlong, + pub st_atime: __time64_t, + pub st_mtime: __time64_t, + pub st_ctime: __time64_t, +} +#[test] +fn bindgen_test_layout__stat64() { + assert_eq!( + ::std::mem::size_of::<_stat64>(), + 56usize, + concat!("Size of: ", stringify!(_stat64)) + ); + assert_eq!( + ::std::mem::align_of::<_stat64>(), + 8usize, + concat!("Alignment of ", stringify!(_stat64)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_size as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_atime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_mtime as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_ctime as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_ctime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct stat { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: _off_t, + pub st_atime: time_t, + pub st_mtime: time_t, + pub st_ctime: time_t, +} +#[test] +fn bindgen_test_layout_stat() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(stat)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(stat)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_size as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_atime as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_mtime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_ctime as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_ctime) + ) + ); +} +extern "C" { + pub fn _fstat32( + _FileHandle: ::std::os::raw::c_int, + _Stat: *mut _stat32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fstat32i64( + _FileHandle: ::std::os::raw::c_int, + _Stat: *mut _stat32i64, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fstat64i32( + _FileHandle: ::std::os::raw::c_int, + _Stat: *mut _stat64i32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fstat64( + _FileHandle: ::std::os::raw::c_int, + _Stat: *mut _stat64, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _stat32( + _FileName: *const ::std::os::raw::c_char, + _Stat: *mut _stat32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _stat32i64( + _FileName: *const ::std::os::raw::c_char, + _Stat: *mut _stat32i64, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _stat64i32( + _FileName: *const ::std::os::raw::c_char, + _Stat: *mut _stat64i32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _stat64( + _FileName: *const ::std::os::raw::c_char, + _Stat: *mut _stat64, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wstat32(_FileName: *const wchar_t, _Stat: *mut _stat32) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wstat32i64(_FileName: *const wchar_t, _Stat: *mut _stat32i64) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wstat64i32(_FileName: *const wchar_t, _Stat: *mut _stat64i32) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wstat64(_FileName: *const wchar_t, _Stat: *mut _stat64) -> ::std::os::raw::c_int; +} +pub type _Wint_t = wchar_t; +extern "C" { + pub fn _wsetlocale(_Category: ::std::os::raw::c_int, _Locale: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcreate_locale(_Category: ::std::os::raw::c_int, _Locale: *const wchar_t) -> _locale_t; +} +extern "C" { + pub fn btowc(_Ch: ::std::os::raw::c_int) -> wint_t; +} +extern "C" { + pub fn mbrlen( + _Ch: *const ::std::os::raw::c_char, + _SizeInBytes: size_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn mbrtowc( + _DstCh: *mut wchar_t, + _SrcCh: *const ::std::os::raw::c_char, + _SizeInBytes: size_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn mbsrtowcs_s( + _Retval: *mut size_t, + _Dst: *mut wchar_t, + _Size: size_t, + _PSrc: *mut *const ::std::os::raw::c_char, + _N: size_t, + _State: *mut mbstate_t, + ) -> errno_t; +} +extern "C" { + pub fn mbsrtowcs( + _Dest: *mut wchar_t, + _PSrc: *mut *const ::std::os::raw::c_char, + _Count: size_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wcrtomb_s( + _Retval: *mut size_t, + _Dst: *mut ::std::os::raw::c_char, + _SizeInBytes: size_t, + _Ch: wchar_t, + _State: *mut mbstate_t, + ) -> errno_t; +} +extern "C" { + pub fn wcrtomb( + _Dest: *mut ::std::os::raw::c_char, + _Source: wchar_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wcsrtombs_s( + _Retval: *mut size_t, + _Dst: *mut ::std::os::raw::c_char, + _SizeInBytes: size_t, + _Src: *mut *const wchar_t, + _Size: size_t, + _State: *mut mbstate_t, + ) -> errno_t; +} +extern "C" { + pub fn wcsrtombs( + _Dest: *mut ::std::os::raw::c_char, + _PSource: *mut *const wchar_t, + _Count: size_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wctob(_WCh: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wmemcpy_s(_S1: *mut wchar_t, _N1: rsize_t, _S2: *const wchar_t, _N: rsize_t) -> errno_t; +} +extern "C" { + pub fn wmemmove_s(_S1: *mut wchar_t, _N1: rsize_t, _S2: *const wchar_t, _N: rsize_t) + -> errno_t; +} +pub type int_least8_t = ::std::os::raw::c_schar; +pub type int_least16_t = ::std::os::raw::c_short; +pub type int_least32_t = ::std::os::raw::c_int; +pub type int_least64_t = ::std::os::raw::c_longlong; +pub type uint_least8_t = ::std::os::raw::c_uchar; +pub type uint_least16_t = ::std::os::raw::c_ushort; +pub type uint_least32_t = ::std::os::raw::c_uint; +pub type uint_least64_t = ::std::os::raw::c_ulonglong; +pub type int_fast8_t = ::std::os::raw::c_schar; +pub type int_fast16_t = ::std::os::raw::c_int; +pub type int_fast32_t = ::std::os::raw::c_int; +pub type int_fast64_t = ::std::os::raw::c_longlong; +pub type uint_fast8_t = ::std::os::raw::c_uchar; +pub type uint_fast16_t = ::std::os::raw::c_uint; +pub type uint_fast32_t = ::std::os::raw::c_uint; +pub type uint_fast64_t = ::std::os::raw::c_ulonglong; +pub type intmax_t = ::std::os::raw::c_longlong; +pub type uintmax_t = ::std::os::raw::c_ulonglong; +extern "C" { + pub fn TCOD_strdup(s: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_strcasecmp( + s1: *const ::std::os::raw::c_char, + s2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_strncasecmp( + s1: *const ::std::os::raw::c_char, + s2: *const ::std::os::raw::c_char, + n: size_t, + ) -> ::std::os::raw::c_int; +} +#[doc = " \\brief A callback to be passed to TCOD_line"] +#[doc = ""] +#[doc = " The points given to the callback include both the starting and ending"] +#[doc = " positions."] +#[doc = ""] +#[doc = " \\param x"] +#[doc = " \\param y"] +#[doc = " \\return As long as this callback returns true it will be called with the"] +#[doc = " next x,y point on the line."] +pub type TCOD_line_listener_t = ::std::option::Option< + unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> bool, +>; +extern "C" { + pub fn TCOD_line_init( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_line_step( + xCur: *mut ::std::os::raw::c_int, + yCur: *mut ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_line( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + listener: TCOD_line_listener_t, + ) -> bool; +} +#[doc = " \\brief A struct used for computing a bresenham line."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_bresenham_data_t { + pub stepx: ::std::os::raw::c_int, + pub stepy: ::std::os::raw::c_int, + pub e: ::std::os::raw::c_int, + pub deltax: ::std::os::raw::c_int, + pub deltay: ::std::os::raw::c_int, + pub origx: ::std::os::raw::c_int, + pub origy: ::std::os::raw::c_int, + pub destx: ::std::os::raw::c_int, + pub desty: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_bresenham_data_t() { + assert_eq!( + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(TCOD_bresenham_data_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_bresenham_data_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stepx as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(stepx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stepy as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(stepy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).e as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(e) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).deltax as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(deltax) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).deltay as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(deltay) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).origx as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(origx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).origy as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(origy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).destx as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(destx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).desty as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(desty) + ) + ); +} +extern "C" { + pub fn TCOD_line_init_mt( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + data: *mut TCOD_bresenham_data_t, + ); +} +extern "C" { + pub fn TCOD_line_step_mt( + xCur: *mut ::std::os::raw::c_int, + yCur: *mut ::std::os::raw::c_int, + data: *mut TCOD_bresenham_data_t, + ) -> bool; +} +extern "C" { + pub fn TCOD_line_mt( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + listener: TCOD_line_listener_t, + data: *mut TCOD_bresenham_data_t, + ) -> bool; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Random { + _unused: [u8; 0], +} +pub type TCOD_random_t = *mut TCOD_Random; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_dice_t { + pub nb_rolls: ::std::os::raw::c_int, + pub nb_faces: ::std::os::raw::c_int, + pub multiplier: f32, + pub addsub: f32, +} +#[test] +fn bindgen_test_layout_TCOD_dice_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_dice_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_dice_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_rolls as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(nb_rolls) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_faces as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(nb_faces) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).multiplier as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(multiplier) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).addsub as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(addsub) + ) + ); +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_random_algo_t { + TCOD_RNG_MT = 0, + TCOD_RNG_CMWC = 1, +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_distribution_t { + TCOD_DISTRIBUTION_LINEAR = 0, + TCOD_DISTRIBUTION_GAUSSIAN = 1, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE = 2, + TCOD_DISTRIBUTION_GAUSSIAN_INVERSE = 3, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE = 4, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TCOD_tree_t { + pub next: *mut _TCOD_tree_t, + pub father: *mut _TCOD_tree_t, + pub sons: *mut _TCOD_tree_t, +} +#[test] +fn bindgen_test_layout__TCOD_tree_t() { + assert_eq!( + ::std::mem::size_of::<_TCOD_tree_t>(), + 12usize, + concat!("Size of: ", stringify!(_TCOD_tree_t)) + ); + assert_eq!( + ::std::mem::align_of::<_TCOD_tree_t>(), + 4usize, + concat!("Alignment of ", stringify!(_TCOD_tree_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).next as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).father as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(father) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).sons as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(sons) + ) + ); +} +impl Default for _TCOD_tree_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_tree_t = _TCOD_tree_t; +extern "C" { + pub fn TCOD_tree_new() -> *mut TCOD_tree_t; +} +extern "C" { + pub fn TCOD_tree_add_son(node: *mut TCOD_tree_t, son: *mut TCOD_tree_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_bsp_t { + pub tree: TCOD_tree_t, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub w: ::std::os::raw::c_int, + pub h: ::std::os::raw::c_int, + pub position: ::std::os::raw::c_int, + pub level: u8, + pub horizontal: bool, +} +#[test] +fn bindgen_test_layout_TCOD_bsp_t() { + assert_eq!( + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(TCOD_bsp_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_bsp_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tree as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(tree) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(position) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).level as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(level) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).horizontal as *const _ as usize }, + 33usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(horizontal) + ) + ); +} +impl Default for TCOD_bsp_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_bsp_callback_t = ::std::option::Option< + unsafe extern "C" fn(node: *mut TCOD_bsp_t, userData: *mut ::std::os::raw::c_void) -> bool, +>; +extern "C" { + pub fn TCOD_bsp_new() -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_new_with_size( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_delete(node: *mut TCOD_bsp_t); +} +extern "C" { + pub fn TCOD_bsp_left(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_right(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_father(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_is_leaf(node: *mut TCOD_bsp_t) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_pre_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_in_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_post_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_level_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_inverted_level_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_contains( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_find_node( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_resize( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_bsp_split_once( + node: *mut TCOD_bsp_t, + horizontal: bool, + position: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_bsp_split_recursive( + node: *mut TCOD_bsp_t, + randomizer: TCOD_random_t, + nb: ::std::os::raw::c_int, + minHSize: ::std::os::raw::c_int, + minVSize: ::std::os::raw::c_int, + maxHRatio: f32, + maxVRatio: f32, + ); +} +extern "C" { + pub fn TCOD_bsp_remove_sons(node: *mut TCOD_bsp_t); +} +#[doc = " A three channel color struct."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ColorRGB { + pub r: u8, + pub g: u8, + pub b: u8, +} +#[test] +fn bindgen_test_layout_TCOD_ColorRGB() { + assert_eq!( + ::std::mem::size_of::(), + 3usize, + concat!("Size of: ", stringify!(TCOD_ColorRGB)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_ColorRGB)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGB), + "::", + stringify!(r) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGB), + "::", + stringify!(g) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGB), + "::", + stringify!(b) + ) + ); +} +pub type TCOD_color_t = TCOD_ColorRGB; +#[doc = " A four channel color struct."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ColorRGBA { + pub r: u8, + pub g: u8, + pub b: u8, + pub a: u8, +} +#[test] +fn bindgen_test_layout_TCOD_ColorRGBA() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(TCOD_ColorRGBA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_ColorRGBA)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGBA), + "::", + stringify!(r) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGBA), + "::", + stringify!(g) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGBA), + "::", + stringify!(b) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGBA), + "::", + stringify!(a) + ) + ); +} +extern "C" { + pub fn TCOD_color_RGB(r: u8, g: u8, b: u8) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_HSV(hue: f32, saturation: f32, value: f32) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_equals(c1: TCOD_color_t, c2: TCOD_color_t) -> bool; +} +extern "C" { + pub fn TCOD_color_add(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_subtract(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_multiply(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_multiply_scalar(c1: TCOD_color_t, value: f32) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_lerp(c1: TCOD_color_t, c2: TCOD_color_t, coef: f32) -> TCOD_color_t; +} +extern "C" { + #[doc = " Blend `src` into `dst` as an alpha blending operation."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_color_alpha_blend(dst: *mut TCOD_ColorRGBA, src: *const TCOD_ColorRGBA); +} +extern "C" { + pub fn TCOD_color_set_HSV(color: *mut TCOD_color_t, hue: f32, saturation: f32, value: f32); +} +extern "C" { + pub fn TCOD_color_get_HSV( + color: TCOD_color_t, + hue: *mut f32, + saturation: *mut f32, + value: *mut f32, + ); +} +extern "C" { + pub fn TCOD_color_get_hue(color: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_hue(color: *mut TCOD_color_t, hue: f32); +} +extern "C" { + pub fn TCOD_color_get_saturation(color: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_saturation(color: *mut TCOD_color_t, saturation: f32); +} +extern "C" { + pub fn TCOD_color_get_value(color: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_value(color: *mut TCOD_color_t, value: f32); +} +extern "C" { + pub fn TCOD_color_shift_hue(color: *mut TCOD_color_t, hshift: f32); +} +extern "C" { + pub fn TCOD_color_scale_HSV(color: *mut TCOD_color_t, saturation_coef: f32, value_coef: f32); +} +extern "C" { + pub fn TCOD_color_gen_map( + map: *mut TCOD_color_t, + nb_key: ::std::os::raw::c_int, + key_color: *const TCOD_color_t, + key_index: *const ::std::os::raw::c_int, + ); +} +pub const TCOD_COLOR_RED: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_RED; +pub const TCOD_COLOR_FLAME: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_FLAME; +pub const TCOD_COLOR_ORANGE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_ORANGE; +pub const TCOD_COLOR_AMBER: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_AMBER; +pub const TCOD_COLOR_YELLOW: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_YELLOW; +pub const TCOD_COLOR_LIME: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_LIME; +pub const TCOD_COLOR_CHARTREUSE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CHARTREUSE; +pub const TCOD_COLOR_GREEN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_GREEN; +pub const TCOD_COLOR_SEA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_SEA; +pub const TCOD_COLOR_TURQUOISE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_TURQUOISE; +pub const TCOD_COLOR_CYAN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CYAN; +pub const TCOD_COLOR_SKY: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_SKY; +pub const TCOD_COLOR_AZURE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_AZURE; +pub const TCOD_COLOR_BLUE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_BLUE; +pub const TCOD_COLOR_HAN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_HAN; +pub const TCOD_COLOR_VIOLET: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_VIOLET; +pub const TCOD_COLOR_PURPLE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_PURPLE; +pub const TCOD_COLOR_FUCHSIA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_FUCHSIA; +pub const TCOD_COLOR_MAGENTA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_MAGENTA; +pub const TCOD_COLOR_PINK: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_PINK; +pub const TCOD_COLOR_CRIMSON: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CRIMSON; +pub const TCOD_COLOR_NB: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_NB; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_1 { + TCOD_COLOR_RED = 0, + TCOD_COLOR_FLAME = 1, + TCOD_COLOR_ORANGE = 2, + TCOD_COLOR_AMBER = 3, + TCOD_COLOR_YELLOW = 4, + TCOD_COLOR_LIME = 5, + TCOD_COLOR_CHARTREUSE = 6, + TCOD_COLOR_GREEN = 7, + TCOD_COLOR_SEA = 8, + TCOD_COLOR_TURQUOISE = 9, + TCOD_COLOR_CYAN = 10, + TCOD_COLOR_SKY = 11, + TCOD_COLOR_AZURE = 12, + TCOD_COLOR_BLUE = 13, + TCOD_COLOR_HAN = 14, + TCOD_COLOR_VIOLET = 15, + TCOD_COLOR_PURPLE = 16, + TCOD_COLOR_FUCHSIA = 17, + TCOD_COLOR_MAGENTA = 18, + TCOD_COLOR_PINK = 19, + TCOD_COLOR_CRIMSON = 20, + TCOD_COLOR_NB = 21, +} +pub const TCOD_COLOR_DESATURATED: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DESATURATED; +pub const TCOD_COLOR_LIGHTEST: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHTEST; +pub const TCOD_COLOR_LIGHTER: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHTER; +pub const TCOD_COLOR_LIGHT: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHT; +pub const TCOD_COLOR_NORMAL: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_NORMAL; +pub const TCOD_COLOR_DARK: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARK; +pub const TCOD_COLOR_DARKER: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARKER; +pub const TCOD_COLOR_DARKEST: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARKEST; +pub const TCOD_COLOR_LEVELS: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LEVELS; +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_2 { + TCOD_COLOR_DESATURATED = 0, + TCOD_COLOR_LIGHTEST = 1, + TCOD_COLOR_LIGHTER = 2, + TCOD_COLOR_LIGHT = 3, + TCOD_COLOR_NORMAL = 4, + TCOD_COLOR_DARK = 5, + TCOD_COLOR_DARKER = 6, + TCOD_COLOR_DARKEST = 7, + TCOD_COLOR_LEVELS = 8, +} +extern "C" { + pub static mut TCOD_colors: [[TCOD_color_t; 8usize]; 21usize]; +} +extern "C" { + pub static TCOD_black: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_white: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_brass: TCOD_color_t; +} +extern "C" { + pub static TCOD_copper: TCOD_color_t; +} +extern "C" { + pub static TCOD_gold: TCOD_color_t; +} +extern "C" { + pub static TCOD_silver: TCOD_color_t; +} +extern "C" { + pub static TCOD_celadon: TCOD_color_t; +} +extern "C" { + pub static TCOD_peach: TCOD_color_t; +} +#[repr(i32)] +#[doc = " An enum of libtcod error codes."] +#[doc = ""] +#[doc = " On values other than `TCOD_E_OK` you can use `TCOD_get_error()` to learn"] +#[doc = " more information."] +#[doc = " \\rst"] +#[doc = " .. versionadded:: 1.16"] +#[doc = " \\endrst"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_Error { + #[doc = " The function completed successfully without issues."] + #[doc = ""] + #[doc = " A function is successful when `(err >= 0)`. Positive values may be used"] + #[doc = " for warnings, or for other outputs."] + TCOD_E_OK = 0, + #[doc = " The error code for generic runtime errors."] + #[doc = ""] + #[doc = " The returned code my be changed in the future to something more specific."] + #[doc = " Use `(err < 0)` to check if the value is an error."] + TCOD_E_ERROR = -1, + #[doc = " The function failed because a given input argument was invalid."] + TCOD_E_INVALID_ARGUMENT = -2, + #[doc = " The function failed because it was unable to allocate enough memory."] + TCOD_E_OUT_OF_MEMORY = -3, + #[doc = " The function completed, but a minor issue was detected."] + TCOD_E_WARN = 1, +} +extern "C" { + #[doc = " Return the last error message. If there is no error then the string will"] + #[doc = " have a length of zero."] + #[doc = ""] + #[doc = " The error state is thread specific."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.12"] + #[doc = " \\endrst"] + pub fn TCOD_get_error() -> *const ::std::os::raw::c_char; +} +extern "C" { + #[doc = " Set an error message and return TCOD_E_ERROR."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.12"] + #[doc = " \\endrst"] + pub fn TCOD_set_error(msg: *const ::std::os::raw::c_char) -> TCOD_Error; +} +extern "C" { + #[doc = " Set an error message and return TCOD_E_ERROR."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_set_errorf(fmt: *const ::std::os::raw::c_char, ...) -> TCOD_Error; +} +extern "C" { + #[doc = " Clear a current existing error message."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_clear_error(); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetObserver { + pub tileset: *mut TCOD_Tileset, + pub next: *mut TCOD_TilesetObserver, + pub userdata: *mut ::std::os::raw::c_void, + pub on_observer_delete: + ::std::option::Option, + pub on_tile_changed: ::std::option::Option< + unsafe extern "C" fn( + observer: *mut TCOD_TilesetObserver, + tile_id: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, +} +#[test] +fn bindgen_test_layout_TCOD_TilesetObserver() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(TCOD_TilesetObserver)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_TilesetObserver)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(tileset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).userdata as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(userdata) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).on_observer_delete as *const _ as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(on_observer_delete) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).on_tile_changed as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(on_tile_changed) + ) + ); +} +impl Default for TCOD_TilesetObserver { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Tileset { + pub tile_width: ::std::os::raw::c_int, + pub tile_height: ::std::os::raw::c_int, + pub tile_length: ::std::os::raw::c_int, + pub tiles_capacity: ::std::os::raw::c_int, + pub tiles_count: ::std::os::raw::c_int, + pub pixels: *mut TCOD_ColorRGBA, + pub character_map_length: ::std::os::raw::c_int, + pub character_map: *mut ::std::os::raw::c_int, + pub observer_list: *mut TCOD_TilesetObserver, + pub virtual_columns: ::std::os::raw::c_int, + pub ref_count: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_Tileset() { + assert_eq!( + ::std::mem::size_of::(), + 44usize, + concat!("Size of: ", stringify!(TCOD_Tileset)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_Tileset)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tile_width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tile_width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tile_height as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tile_height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tile_length as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tile_length) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tiles_capacity as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tiles_capacity) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tiles_count as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tiles_count) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pixels as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(pixels) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).character_map_length as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(character_map_length) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).character_map as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(character_map) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).observer_list as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(observer_list) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).virtual_columns as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(virtual_columns) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ref_count as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(ref_count) + ) + ); +} +impl Default for TCOD_Tileset { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + #[doc = " Create a new tile-set with the given tile size."] + pub fn TCOD_tileset_new( + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Delete a tile-set."] + pub fn TCOD_tileset_delete(tileset: *mut TCOD_Tileset); +} +extern "C" { + #[doc = " Return the pixel width of tiles in this tileset."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_width_(tileset: *const TCOD_Tileset) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return the pixel height of tiles in this tileset."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_height_(tileset: *const TCOD_Tileset) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Fetch a tile, outputting its data to a pixel buffer."] + #[doc = ""] + #[doc = " `codepoint` is the index for the tile. Unicode is recommend."] + #[doc = ""] + #[doc = " `buffer` is a pointer to a contiguous row-major array of pixels. The tile"] + #[doc = " data will be outputted here. This pointer can be NULL if you only want to"] + #[doc = " know if the tileset has a specific tile."] + #[doc = ""] + #[doc = " Returns 0 if the tile exists. Returns a negative value on an error or if"] + #[doc = " the tileset does not have a tile for this codepoint."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_( + tileset: *const TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + buffer: *mut TCOD_ColorRGBA, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Upload a tile from a pixel buffer into this tileset."] + #[doc = ""] + #[doc = " `codepoint` is the index for the tile. Unicode is recommend."] + #[doc = ""] + #[doc = " `buffer` is a pointer to a contiguous row-major array of pixels."] + #[doc = " This can not be NULL."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_set_tile_( + tileset: *mut TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + buffer: *const TCOD_ColorRGBA, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Load a font from a tilesheet."] + pub fn TCOD_tileset_load( + filename: *const ::std::os::raw::c_char, + columns: ::std::os::raw::c_int, + rows: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + charmap: *mut ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Assign a codepoint to an existing tile based on its tile ID."] + #[doc = ""] + #[doc = " Returns the tile ID on success."] + #[doc = ""] + #[doc = " Returns a negative value on error."] + pub fn TCOD_tileset_assign_tile( + tileset: *mut TCOD_Tileset, + tile_id: ::std::os::raw::c_int, + codepoint: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return a pointer to the tile for `codepoint`."] + #[doc = ""] + #[doc = " Returns NULL if no tile exists for codepoint."] + pub fn TCOD_tileset_get_tile( + tileset: *const TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + ) -> *const TCOD_ColorRGBA; +} +extern "C" { + #[doc = " Return a new observer to this tileset."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_observer_new(tileset: *mut TCOD_Tileset) -> *mut TCOD_TilesetObserver; +} +extern "C" { + #[doc = " Delete an existing observer."] + #[doc = ""] + #[doc = " Will call this observers on_observer_delete callback."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_observer_delete(observer: *mut TCOD_TilesetObserver); +} +extern "C" { + #[doc = " Called to notify any observers that a tile has been changed. This may"] + #[doc = " cause running atlases to update or mark cache consoles as dirty."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_notify_tile_changed( + tileset: *mut TCOD_Tileset, + tile_id: ::std::os::raw::c_int, + ); +} +extern "C" { + #[doc = " Reserve memory for a specific amount of tiles."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_reserve( + tileset: *mut TCOD_Tileset, + desired: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +#[repr(i32)] +#[doc = " \\enum TCOD_bkgnd_flag_t"] +#[doc = ""] +#[doc = " Background color blend modes."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_bkgnd_flag_t { + TCOD_BKGND_NONE = 0, + TCOD_BKGND_SET = 1, + TCOD_BKGND_MULTIPLY = 2, + TCOD_BKGND_LIGHTEN = 3, + TCOD_BKGND_DARKEN = 4, + TCOD_BKGND_SCREEN = 5, + TCOD_BKGND_COLOR_DODGE = 6, + TCOD_BKGND_COLOR_BURN = 7, + TCOD_BKGND_ADD = 8, + TCOD_BKGND_ADDA = 9, + TCOD_BKGND_BURN = 10, + TCOD_BKGND_OVERLAY = 11, + TCOD_BKGND_ALPH = 12, + TCOD_BKGND_DEFAULT = 13, +} +#[repr(i32)] +#[doc = " \\enum TCOD_alignment_t"] +#[doc = ""] +#[doc = " Print justification options."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_alignment_t { + TCOD_LEFT = 0, + TCOD_RIGHT = 1, + TCOD_CENTER = 2, +} +#[doc = " A console tile."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ConsoleTile { + #[doc = " The Unicode codepoint for this tile."] + pub ch: ::std::os::raw::c_int, + #[doc = " The tile glyph color, rendered on top of the background."] + pub fg: TCOD_ColorRGBA, + #[doc = " The tile background color, rendered behind the glyph."] + pub bg: TCOD_ColorRGBA, +} +#[test] +fn bindgen_test_layout_TCOD_ConsoleTile() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(TCOD_ConsoleTile)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_ConsoleTile)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ch as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ConsoleTile), + "::", + stringify!(ch) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fg as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ConsoleTile), + "::", + stringify!(fg) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bg as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ConsoleTile), + "::", + stringify!(bg) + ) + ); +} +#[doc = " The libtcod console struct."] +#[doc = ""] +#[doc = " All attributes should be considered private."] +#[doc = ""] +#[doc = " All C++ methods should be considered provisional, and are subject to"] +#[doc = " change."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Console { + #[doc = " Console width and height (in characters, not pixels.)"] + pub w: ::std::os::raw::c_int, + #[doc = " Console width and height (in characters, not pixels.)"] + pub h: ::std::os::raw::c_int, + #[doc = " A contiguous array of console tiles."] + pub tiles: *mut TCOD_ConsoleTile, + #[doc = " Default background operator for print & print_rect functions."] + pub bkgnd_flag: TCOD_bkgnd_flag_t, + #[doc = " Default alignment for print & print_rect functions."] + pub alignment: TCOD_alignment_t, + #[doc = " Foreground (text) and background colors."] + pub fore: TCOD_color_t, + #[doc = " Foreground (text) and background colors."] + pub back: TCOD_color_t, + #[doc = " True if a key color is being used."] + pub has_key_color: bool, + #[doc = " The current key color for this console."] + pub key_color: TCOD_color_t, + #[doc = "The total length of the tiles array. Same as `w * h`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub elements: ::std::os::raw::c_int, + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub userdata: *mut ::std::os::raw::c_void, + #[doc = " Internal use."] + pub on_delete: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_TCOD_Console() { + assert_eq!( + ::std::mem::size_of::(), + 44usize, + concat!("Size of: ", stringify!(TCOD_Console)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_Console)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tiles as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(tiles) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bkgnd_flag as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(bkgnd_flag) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).alignment as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(alignment) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fore as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(fore) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).back as *const _ as usize }, + 23usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(back) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).has_key_color as *const _ as usize }, + 26usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(has_key_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).key_color as *const _ as usize }, + 27usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(key_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).elements as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(elements) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).userdata as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(userdata) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).on_delete as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(on_delete) + ) + ); +} +impl Default for TCOD_Console { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_console_t = *mut TCOD_Console; +extern "C" { + #[doc = " Return a new console with a specific number of columns and rows."] + #[doc = ""] + #[doc = " \\param w Number of columns."] + #[doc = " \\param h Number of columns."] + #[doc = " \\return A pointer to the new console, or NULL on error."] + pub fn TCOD_console_new( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_Console; +} +extern "C" { + #[doc = " Return the width of a console."] + pub fn TCOD_console_get_width(con: *const TCOD_Console) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return the height of a console."] + pub fn TCOD_console_get_height(con: *const TCOD_Console) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_set_key_color(con: *mut TCOD_Console, col: TCOD_color_t); +} +extern "C" { + #[doc = " Blit from one console to another."] + #[doc = ""] + #[doc = " \\param srcCon Pointer to the source console."] + #[doc = " \\param xSrc The left region of the source console to blit from."] + #[doc = " \\param ySrc The top region of the source console to blit from."] + #[doc = " \\param wSrc The width of the region to blit from."] + #[doc = " If 0 then it will fill to the maximum width."] + #[doc = " \\param hSrc The height of the region to blit from."] + #[doc = " If 0 then it will fill to the maximum height."] + #[doc = " \\param dstCon Pointer to the destination console."] + #[doc = " \\param xDst The left corner to blit onto the destination console."] + #[doc = " \\param yDst The top corner to blit onto the destination console."] + #[doc = " \\param foreground_alpha Foreground blending alpha."] + #[doc = " \\param background_alpha Background blending alpha."] + #[doc = ""] + #[doc = " If the source console has a key color, this function will use it."] + #[doc = " \\rst"] + #[doc = " .. versionchanged:: 1.16"] + #[doc = " Blits can now handle per-cell alpha transparency."] + #[doc = " \\endrst"] + pub fn TCOD_console_blit( + src: *const TCOD_Console, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + dst: *mut TCOD_Console, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + foreground_alpha: f32, + background_alpha: f32, + ); +} +extern "C" { + pub fn TCOD_console_blit_key_color( + src: *const TCOD_Console, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + dst: *mut TCOD_Console, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + foreground_alpha: f32, + background_alpha: f32, + key_color: *const TCOD_color_t, + ); +} +extern "C" { + #[doc = " Delete a console."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = ""] + #[doc = " If the console being deleted is the root console, then the display will be"] + #[doc = " uninitialized."] + pub fn TCOD_console_delete(console: *mut TCOD_Console); +} +extern "C" { + pub fn TCOD_console_set_default_background(con: *mut TCOD_Console, col: TCOD_color_t); +} +extern "C" { + pub fn TCOD_console_set_default_foreground(con: *mut TCOD_Console, col: TCOD_color_t); +} +extern "C" { + #[doc = " Clear a console to its default colors and the space character code."] + pub fn TCOD_console_clear(con: *mut TCOD_Console); +} +extern "C" { + #[doc = " Blend a background color onto a console tile."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param col The background color to blend."] + #[doc = " \\param flag The blend mode to use."] + pub fn TCOD_console_set_char_background( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Change the foreground color of a console tile."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param col The foreground color to set."] + pub fn TCOD_console_set_char_foreground( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); +} +extern "C" { + #[doc = " Change a character on a console tile, without changing its colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to set."] + pub fn TCOD_console_set_char( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + ); +} +extern "C" { + #[doc = " Draw a character on a console using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to place."] + #[doc = " \\param flag A TCOD_bkgnd_flag_t flag."] + pub fn TCOD_console_put_char( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a character on the console with the given colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to place."] + #[doc = " \\param fore The foreground color."] + #[doc = " \\param back The background color. This color will not be blended."] + pub fn TCOD_console_put_char_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + fore: TCOD_color_t, + back: TCOD_color_t, + ); +} +extern "C" { + #[doc = " Set a consoles default background flag."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param flag One of `TCOD_bkgnd_flag_t`."] + pub fn TCOD_console_set_background_flag(con: *mut TCOD_Console, flag: TCOD_bkgnd_flag_t); +} +extern "C" { + #[doc = " Return a consoles default background flag."] + pub fn TCOD_console_get_background_flag(con: *mut TCOD_Console) -> TCOD_bkgnd_flag_t; +} +extern "C" { + #[doc = " Set a consoles default alignment."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param alignment One of TCOD_alignment_t"] + pub fn TCOD_console_set_alignment(con: *mut TCOD_Console, alignment: TCOD_alignment_t); +} +extern "C" { + #[doc = " Return a consoles default alignment."] + pub fn TCOD_console_get_alignment(con: *mut TCOD_Console) -> TCOD_alignment_t; +} +extern "C" { + pub fn TCOD_console_get_default_background(con: *mut TCOD_Console) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_get_default_foreground(con: *mut TCOD_Console) -> TCOD_color_t; +} +extern "C" { + #[doc = " Return the background color of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return A TCOD_color_t struct with a copy of the background color."] + pub fn TCOD_console_get_char_background( + con: *const TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + #[doc = " Return the foreground color of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return A TCOD_color_t struct with a copy of the foreground color."] + pub fn TCOD_console_get_char_foreground( + con: *const TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + #[doc = " Return a character code of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return The character code."] + pub fn TCOD_console_get_char( + con: *const TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Fade the color of the display."] + #[doc = ""] + #[doc = " \\param val Where at 255 colors are normal and at 0 colors are completely"] + #[doc = " faded."] + #[doc = " \\param fadecol Color to fade towards."] + pub fn TCOD_console_set_fade(val: u8, fade: TCOD_color_t); +} +extern "C" { + #[doc = " Return the fade value."] + #[doc = ""] + #[doc = " \\return At 255 colors are normal and at 0 colors are completely faded."] + pub fn TCOD_console_get_fade() -> u8; +} +extern "C" { + #[doc = " Return the fade color."] + #[doc = ""] + #[doc = " \\return The current fading color."] + pub fn TCOD_console_get_fading_color() -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_resize_( + console: *mut TCOD_Console, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ); +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_keycode_t { + TCODK_NONE = 0, + TCODK_ESCAPE = 1, + TCODK_BACKSPACE = 2, + TCODK_TAB = 3, + TCODK_ENTER = 4, + TCODK_SHIFT = 5, + TCODK_CONTROL = 6, + TCODK_ALT = 7, + TCODK_PAUSE = 8, + TCODK_CAPSLOCK = 9, + TCODK_PAGEUP = 10, + TCODK_PAGEDOWN = 11, + TCODK_END = 12, + TCODK_HOME = 13, + TCODK_UP = 14, + TCODK_LEFT = 15, + TCODK_RIGHT = 16, + TCODK_DOWN = 17, + TCODK_PRINTSCREEN = 18, + TCODK_INSERT = 19, + TCODK_DELETE = 20, + TCODK_LWIN = 21, + TCODK_RWIN = 22, + TCODK_APPS = 23, + TCODK_0 = 24, + TCODK_1 = 25, + TCODK_2 = 26, + TCODK_3 = 27, + TCODK_4 = 28, + TCODK_5 = 29, + TCODK_6 = 30, + TCODK_7 = 31, + TCODK_8 = 32, + TCODK_9 = 33, + TCODK_KP0 = 34, + TCODK_KP1 = 35, + TCODK_KP2 = 36, + TCODK_KP3 = 37, + TCODK_KP4 = 38, + TCODK_KP5 = 39, + TCODK_KP6 = 40, + TCODK_KP7 = 41, + TCODK_KP8 = 42, + TCODK_KP9 = 43, + TCODK_KPADD = 44, + TCODK_KPSUB = 45, + TCODK_KPDIV = 46, + TCODK_KPMUL = 47, + TCODK_KPDEC = 48, + TCODK_KPENTER = 49, + TCODK_F1 = 50, + TCODK_F2 = 51, + TCODK_F3 = 52, + TCODK_F4 = 53, + TCODK_F5 = 54, + TCODK_F6 = 55, + TCODK_F7 = 56, + TCODK_F8 = 57, + TCODK_F9 = 58, + TCODK_F10 = 59, + TCODK_F11 = 60, + TCODK_F12 = 61, + TCODK_NUMLOCK = 62, + TCODK_SCROLLLOCK = 63, + TCODK_SPACE = 64, + TCODK_CHAR = 65, + TCODK_TEXT = 66, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_key_t { + pub vk: TCOD_keycode_t, + pub c: ::std::os::raw::c_char, + pub text: [::std::os::raw::c_char; 32usize], + pub pressed: bool, + pub lalt: bool, + pub lctrl: bool, + pub lmeta: bool, + pub ralt: bool, + pub rctrl: bool, + pub rmeta: bool, + pub shift: bool, +} +#[test] +fn bindgen_test_layout_TCOD_key_t() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(TCOD_key_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_key_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vk as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(vk) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(c) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).text as *const _ as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(text) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pressed as *const _ as usize }, + 37usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lalt as *const _ as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lalt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lctrl as *const _ as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lctrl) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lmeta as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lmeta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ralt as *const _ as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(ralt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rctrl as *const _ as usize }, + 42usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(rctrl) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rmeta as *const _ as usize }, + 43usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(rmeta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).shift as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(shift) + ) + ); +} +impl Default for TCOD_key_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_chars_t { + TCOD_CHAR_HLINE = 196, + TCOD_CHAR_VLINE = 179, + TCOD_CHAR_NE = 191, + TCOD_CHAR_NW = 218, + TCOD_CHAR_SE = 217, + TCOD_CHAR_SW = 192, + TCOD_CHAR_TEEW = 180, + TCOD_CHAR_TEEE = 195, + TCOD_CHAR_TEEN = 193, + TCOD_CHAR_TEES = 194, + TCOD_CHAR_CROSS = 197, + TCOD_CHAR_DHLINE = 205, + TCOD_CHAR_DVLINE = 186, + TCOD_CHAR_DNE = 187, + TCOD_CHAR_DNW = 201, + TCOD_CHAR_DSE = 188, + TCOD_CHAR_DSW = 200, + TCOD_CHAR_DTEEW = 185, + TCOD_CHAR_DTEEE = 204, + TCOD_CHAR_DTEEN = 202, + TCOD_CHAR_DTEES = 203, + TCOD_CHAR_DCROSS = 206, + TCOD_CHAR_BLOCK1 = 176, + TCOD_CHAR_BLOCK2 = 177, + TCOD_CHAR_BLOCK3 = 178, + TCOD_CHAR_ARROW_N = 24, + TCOD_CHAR_ARROW_S = 25, + TCOD_CHAR_ARROW_E = 26, + TCOD_CHAR_ARROW_W = 27, + TCOD_CHAR_ARROW2_N = 30, + TCOD_CHAR_ARROW2_S = 31, + TCOD_CHAR_ARROW2_E = 16, + TCOD_CHAR_ARROW2_W = 17, + TCOD_CHAR_DARROW_H = 29, + TCOD_CHAR_DARROW_V = 18, + TCOD_CHAR_CHECKBOX_UNSET = 224, + TCOD_CHAR_CHECKBOX_SET = 225, + TCOD_CHAR_RADIO_UNSET = 9, + TCOD_CHAR_RADIO_SET = 10, + TCOD_CHAR_SUBP_NW = 226, + TCOD_CHAR_SUBP_NE = 227, + TCOD_CHAR_SUBP_N = 228, + TCOD_CHAR_SUBP_SE = 229, + TCOD_CHAR_SUBP_DIAG = 230, + TCOD_CHAR_SUBP_E = 231, + TCOD_CHAR_SUBP_SW = 232, + TCOD_CHAR_SMILIE = 1, + TCOD_CHAR_SMILIE_INV = 2, + TCOD_CHAR_HEART = 3, + TCOD_CHAR_DIAMOND = 4, + TCOD_CHAR_CLUB = 5, + TCOD_CHAR_SPADE = 6, + TCOD_CHAR_BULLET = 7, + TCOD_CHAR_BULLET_INV = 8, + TCOD_CHAR_MALE = 11, + TCOD_CHAR_FEMALE = 12, + TCOD_CHAR_NOTE = 13, + TCOD_CHAR_NOTE_DOUBLE = 14, + TCOD_CHAR_LIGHT = 15, + TCOD_CHAR_EXCLAM_DOUBLE = 19, + TCOD_CHAR_PILCROW = 20, + TCOD_CHAR_SECTION = 21, + TCOD_CHAR_POUND = 156, + TCOD_CHAR_MULTIPLICATION = 158, + TCOD_CHAR_FUNCTION = 159, + TCOD_CHAR_RESERVED = 169, + TCOD_CHAR_HALF = 171, + TCOD_CHAR_ONE_QUARTER = 172, + TCOD_CHAR_COPYRIGHT = 184, + TCOD_CHAR_CENT = 189, + TCOD_CHAR_YEN = 190, + TCOD_CHAR_CURRENCY = 207, + TCOD_CHAR_THREE_QUARTERS = 243, + TCOD_CHAR_DIVISION = 246, + TCOD_CHAR_GRADE = 248, + TCOD_CHAR_UMLAUT = 249, + TCOD_CHAR_POW1 = 251, + TCOD_CHAR_POW3 = 252, + TCOD_CHAR_POW2 = 253, + TCOD_CHAR_BULLET_SQUARE = 254, +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_key_status_t { + TCOD_KEY_PRESSED = 1, + TCOD_KEY_RELEASED = 2, +} +impl TCOD_font_flags_t { + #[doc = " Tiles are arranged in column-major order."] + #[doc = ""] + #[doc = " 0 3 6"] + #[doc = " 1 4 7"] + #[doc = " 2 5 8"] + pub const TCOD_FONT_LAYOUT_ASCII_INCOL: TCOD_font_flags_t = TCOD_font_flags_t(1); +} +impl TCOD_font_flags_t { + #[doc = " Tiles are arranged in row-major order."] + #[doc = ""] + #[doc = " 0 1 2"] + #[doc = " 3 4 5"] + #[doc = " 6 7 8"] + pub const TCOD_FONT_LAYOUT_ASCII_INROW: TCOD_font_flags_t = TCOD_font_flags_t(2); +} +impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] + pub const TCOD_FONT_TYPE_GREYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); +} +impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] + pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); +} +impl TCOD_font_flags_t { + #[doc = " A unique layout used by some of libtcod's fonts."] + pub const TCOD_FONT_LAYOUT_TCOD: TCOD_font_flags_t = TCOD_font_flags_t(8); +} +impl TCOD_font_flags_t { + #[doc = " Decode a code page 437 tileset into Unicode code-points."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.10"] + #[doc = " \\endrst"] + pub const TCOD_FONT_LAYOUT_CP437: TCOD_font_flags_t = TCOD_font_flags_t(16); +} +impl ::std::ops::BitOr for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for TCOD_font_flags_t { + #[inline] + fn bitor_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for TCOD_font_flags_t { + #[inline] + fn bitand_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[doc = " These font flags can be OR'd together into a bit-field and passed to"] +#[doc = " TCOD_console_set_custom_font"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct TCOD_font_flags_t(pub i32); +#[repr(i32)] +#[doc = " The available renderers."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_renderer_t { + #[doc = " Alias for TCOD_RENDERER_OPENGL2."] + TCOD_RENDERER_GLSL = 0, + #[doc = " An OpenGL 1.1 implementation."] + #[doc = ""] + #[doc = " Performs worse than TCOD_RENDERER_GLSL without many benefits."] + TCOD_RENDERER_OPENGL = 1, + #[doc = " A software based renderer."] + #[doc = ""] + #[doc = " The font file is loaded into RAM instead of VRAM in this implementation."] + TCOD_RENDERER_SDL = 2, + #[doc = " A new SDL2 renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.8"] + #[doc = " \\endrst"] + TCOD_RENDERER_SDL2 = 3, + #[doc = " A new OpenGL 2.0 core renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.9"] + #[doc = ""] + #[doc = " .. versionchanged:: 1.11.0"] + #[doc = " This renderer now uses OpenGL 2.0 instead of 2.1."] + #[doc = " \\endrst"] + TCOD_RENDERER_OPENGL2 = 4, + #[doc = " A new OpenGL 2.0 core renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.9"] + #[doc = ""] + #[doc = " .. versionchanged:: 1.11.0"] + #[doc = " This renderer now uses OpenGL 2.0 instead of 2.1."] + #[doc = " \\endrst"] + TCOD_NB_RENDERERS = 5, +} +extern "C" { + #[doc = " Draw a rectangle onto a console."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting region, the left-most position being 0."] + #[doc = " \\param y The starting region, the top-most position being 0."] + #[doc = " \\param rw The width of the rectangle."] + #[doc = " \\param rh The height of the rectangle."] + #[doc = " \\param clear If true the drawing region will be filled with spaces."] + #[doc = " \\param flag The blending flag to use."] + pub fn TCOD_console_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + clear: bool, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a horizontal line using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting X coordinate, the left-most position being 0."] + #[doc = " \\param y The starting Y coordinate, the top-most position being 0."] + #[doc = " \\param l The width of the line."] + #[doc = " \\param flag The blending flag."] + #[doc = ""] + #[doc = " This function makes assumptions about the fonts character encoding."] + #[doc = " It will fail if the font encoding is not `cp437`."] + pub fn TCOD_console_hline( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a vertical line using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting X coordinate, the left-most position being 0."] + #[doc = " \\param y The starting Y coordinate, the top-most position being 0."] + #[doc = " \\param l The height of the line."] + #[doc = " \\param flag The blending flag."] + #[doc = ""] + #[doc = " This function makes assumptions about the fonts character encoding."] + #[doc = " It will fail if the font encoding is not `cp437`."] + pub fn TCOD_console_vline( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Place a single tile on a `console` at `x`,`y`."] + #[doc = ""] + #[doc = " If `ch` is 0 then the character code will not be updated."] + #[doc = ""] + #[doc = " If `fg`,`bg` is NULL then their respective colors will not be updated."] + pub fn TCOD_console_put_rgb( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ch: ::std::os::raw::c_int, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a rectangle on a `console` with a shape of `x`,`y`,`width`,`height`."] + #[doc = ""] + #[doc = " If `ch` is 0 then the character code will not be updated."] + #[doc = ""] + #[doc = " If `fg`,`bg` is NULL then their respective colors will not be updated."] + pub fn TCOD_console_draw_rect_rgb( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ch: ::std::os::raw::c_int, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +#[doc = "Viewport options for the rendering context."] +#[doc = "\\rst"] +#[doc = ".. versionadded:: 1.16"] +#[doc = "\\endrst"] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ViewportOptions { + #[doc = "If true then the aspect ratio will be kept square when the console is"] + #[doc = "scaled. The view will be letter-boxed."] + #[doc = ""] + #[doc = "If false the console will be stretched to fill the screen."] + #[doc = ""] + #[doc = "Set this is true if your tileset is deigned for square pixels."] + pub keep_aspect: bool, + #[doc = "If true then console scaling will be fixed to integer increments."] + #[doc = ""] + #[doc = "Has no effect if the console must be scaled down."] + pub integer_scaling: bool, + #[doc = "Not used."] + pub reserved_: bool, + #[doc = "The color to clear the screen with before rendering the console."] + pub clear_color: TCOD_ColorRGBA, + #[doc = "Alignment of the console when it is letter-boxed: 0.0f renders the"] + #[doc = "console in the upper-left corner, and 1.0f in the lower-right."] + #[doc = ""] + #[doc = "Values of 0.5f will center the console."] + #[doc = "Values outside of the range 0.0f to 1.0f are clamped."] + pub align_x: f32, + pub align_y: f32, +} +#[test] +fn bindgen_test_layout_TCOD_ViewportOptions() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_ViewportOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_ViewportOptions)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).keep_aspect as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(keep_aspect) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).integer_scaling as *const _ as usize + }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(integer_scaling) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved_ as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(reserved_) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).clear_color as *const _ as usize + }, + 3usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(clear_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).align_x as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(align_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).align_y as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(align_y) + ) + ); +} +extern "C" { + pub static TCOD_VIEWPORT_DEFAULT_: TCOD_ViewportOptions; +} +extern "C" { + #[doc = "Allocate a new viewport options struct."] + #[doc = ""] + #[doc = "You should not allocate this struct manually since the size of it may change"] + #[doc = "between versions."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_viewport_new() -> *mut TCOD_ViewportOptions; +} +extern "C" { + #[doc = "Delete a viewport."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_viewport_delete(viewport: *mut TCOD_ViewportOptions); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Window { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Renderer { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Rect { + _unused: [u8; 0], +} +#[doc = " A rendering context for libtcod."] +#[doc = " \\rst"] +#[doc = " .. versionadded:: 1.16"] +#[doc = " \\endrst"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Context { + pub type_: ::std::os::raw::c_int, + pub contextdata: *mut ::std::os::raw::c_void, + pub destructor_: ::std::option::Option, + pub present_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error, + >, + pub pixel_to_tile_: ::std::option::Option< + unsafe extern "C" fn(self_: *mut TCOD_Context, x: *mut f64, y: *mut f64), + >, + pub save_screenshot_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + filename: *const ::std::os::raw::c_char, + ) -> TCOD_Error, + >, + pub get_sdl_window_: + ::std::option::Option *mut SDL_Window>, + pub get_sdl_renderer_: + ::std::option::Option *mut SDL_Renderer>, + pub accumulate_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error, + >, + #[doc = "Change the tileset used by this context."] + pub set_tileset: ::std::option::Option< + unsafe extern "C" fn(self_: *mut TCOD_Context, tileset: *mut TCOD_Tileset) -> TCOD_Error, + >, + #[doc = "Output the recommended console size to `columns` and `rows`."] + pub cb_recommended_console_size_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + columns: *mut ::std::os::raw::c_int, + rows: *mut ::std::os::raw::c_int, + ) -> TCOD_Error, + >, +} +#[test] +fn bindgen_test_layout_TCOD_Context() { + assert_eq!( + ::std::mem::size_of::(), + 44usize, + concat!("Size of: ", stringify!(TCOD_Context)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_Context)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).contextdata as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(contextdata) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).destructor_ as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(destructor_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).present_ as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(present_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pixel_to_tile_ as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(pixel_to_tile_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).save_screenshot_ as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(save_screenshot_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).get_sdl_window_ as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(get_sdl_window_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).get_sdl_renderer_ as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(get_sdl_renderer_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).accumulate_ as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(accumulate_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).set_tileset as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(set_tileset) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).cb_recommended_console_size_ as *const _ + as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(cb_recommended_console_size_) + ) + ); +} +impl Default for TCOD_Context { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + #[doc = " Delete a rendering context."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_context_delete(renderer: *mut TCOD_Context); +} +extern "C" { + #[doc = " Create an uninitialized rendering context."] + #[doc = ""] + #[doc = " Used internally."] + pub fn TCOD_context_new_() -> *mut TCOD_Context; +} +extern "C" { + #[doc = "Present a console to the screen, using a rendering context."] + #[doc = ""] + #[doc = "`console` is the console to present, the console can be any size."] + #[doc = ""] + #[doc = "`viewport` is the optional viewport options to use."] + #[doc = "This will affect the scaling of the console with the current context."] + #[doc = "This can be NULL to use the default options, which are to stretch the"] + #[doc = "console to fit the screen."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_present( + context: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Convert the screen coordinates to tile coordinates for this context."] + #[doc = ""] + #[doc = "`x` and `y` are the pointers to the screen coordinates, these will be"] + #[doc = "converted to tile coordinates after the call to this function."] + #[doc = ""] + #[doc = "The parameters given to the last call to `TCOD_context_present` will"] + #[doc = "determine where the tiles are for this call."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_screen_pixel_to_tile_d( + context: *mut TCOD_Context, + x: *mut f64, + y: *mut f64, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Convert the screen coordinates to integer tile coordinates for this context."] + #[doc = ""] + #[doc = "Save as `TCOD_context_screen_pixel_to_tile` but the inputs and results are"] + #[doc = "integers. This is useful if you don't need sub-tile coordinates."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_screen_pixel_to_tile_i( + context: *mut TCOD_Context, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Save the last presented console to a PNG file."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_save_screenshot( + context: *mut TCOD_Context, + filename: *const ::std::os::raw::c_char, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return a pointer the SDL_Window for this context if it uses one."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_sdl_window(context: *mut TCOD_Context) -> *mut SDL_Window; +} +extern "C" { + #[doc = "Return a pointer the SDL_Renderer for this context if it uses one."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_sdl_renderer(context: *mut TCOD_Context) -> *mut SDL_Renderer; +} +extern "C" { + #[doc = "Change the active tileset for this context."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_change_tileset( + self_: *mut TCOD_Context, + tileset: *mut TCOD_Tileset, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return the `TCOD_renderer_t` renderer type for this context."] + #[doc = ""] + #[doc = "Returns a negative number on error, such as `context` being NULL."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_renderer_type(context: *mut TCOD_Context) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Set `columns` and `rows` to the recommended console size for this context."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_recommended_console_size( + context: *mut TCOD_Context, + columns: *mut ::std::os::raw::c_int, + rows: *mut ::std::os::raw::c_int, + ) -> TCOD_Error; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_mipmap_ { + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub fwidth: f32, + pub fheight: f32, + pub buf: *mut TCOD_ColorRGB, + pub dirty: bool, +} +#[test] +fn bindgen_test_layout_TCOD_mipmap_() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(TCOD_mipmap_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_mipmap_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fwidth as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(fwidth) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fheight as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(fheight) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dirty as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(dirty) + ) + ); +} +impl Default for TCOD_mipmap_ { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Image { + pub nb_mipmaps: ::std::os::raw::c_int, + pub mipmaps: *mut TCOD_mipmap_, + pub key_color: TCOD_ColorRGB, + pub has_key_color: bool, +} +#[test] +fn bindgen_test_layout_TCOD_Image() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(TCOD_Image)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_Image)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_mipmaps as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(nb_mipmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mipmaps as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(mipmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).key_color as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(key_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).has_key_color as *const _ as usize }, + 11usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(has_key_color) + ) + ); +} +impl Default for TCOD_Image { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_image_t = *mut TCOD_Image; +extern "C" { + pub fn TCOD_image_new( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> *mut TCOD_Image; +} +extern "C" { + #[doc = " Return a new image rendered from a console."] + #[doc = ""] + #[doc = " This effectively returns a screenshot of the console."] + pub fn TCOD_image_from_console(console: *const TCOD_Console) -> *mut TCOD_Image; +} +extern "C" { + #[doc = " Same as TCOD_image_from_console, but with an existing image."] + pub fn TCOD_image_refresh_console(image: *mut TCOD_Image, console: *const TCOD_Console); +} +extern "C" { + pub fn TCOD_image_load(filename: *const ::std::os::raw::c_char) -> *mut TCOD_Image; +} +extern "C" { + pub fn TCOD_image_clear(image: *mut TCOD_Image, color: TCOD_color_t); +} +extern "C" { + pub fn TCOD_image_invert(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_hflip(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_rotate90(image: *mut TCOD_Image, numRotations: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_image_vflip(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_scale( + image: *mut TCOD_Image, + neww: ::std::os::raw::c_int, + newh: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_save(image: *const TCOD_Image, filename: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_image_get_size( + image: *const TCOD_Image, + w: *mut ::std::os::raw::c_int, + h: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_get_pixel( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_image_get_alpha( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return a mipmapped pixel of image."] + #[doc = ""] + #[doc = " Mipmaps are updated when you call this, so it can't be called from multiple"] + #[doc = " threads."] + pub fn TCOD_image_get_mipmap_pixel( + image: *mut TCOD_Image, + x0: f32, + y0: f32, + x1: f32, + y1: f32, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_image_put_pixel( + image: *mut TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); +} +extern "C" { + pub fn TCOD_image_blit( + image: *mut TCOD_Image, + console: TCOD_console_t, + x: f32, + y: f32, + bkgnd_flag: TCOD_bkgnd_flag_t, + scalex: f32, + scaley: f32, + angle: f32, + ); +} +extern "C" { + pub fn TCOD_image_blit_rect( + image: *mut TCOD_Image, + console: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + bkgnd_flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_image_blit_2x( + image: *const TCOD_Image, + dest: TCOD_console_t, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + sx: ::std::os::raw::c_int, + sy: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_delete(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_set_key_color(image: *mut TCOD_Image, key_color: TCOD_color_t); +} +extern "C" { + pub fn TCOD_image_is_pixel_transparent( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_List { + _unused: [u8; 0], +} +pub type TCOD_list_t = *mut TCOD_List; +extern "C" { + pub fn TCOD_list_new() -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_allocate(nb_elements: ::std::os::raw::c_int) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_duplicate(l: TCOD_list_t) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_delete(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_push(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_pop(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_peek(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_add_all(l: TCOD_list_t, l2: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_get(l: TCOD_list_t, idx: ::std::os::raw::c_int) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_set( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + idx: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_list_begin(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_end(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_reverse(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_remove_iterator( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_remove(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_remove_iterator_fast( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_remove_fast(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_contains(l: TCOD_list_t, elt: *const ::std::os::raw::c_void) -> bool; +} +extern "C" { + pub fn TCOD_list_clear(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_clear_and_delete(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_size(l: TCOD_list_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_list_insert_before( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + before: ::std::os::raw::c_int, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_is_empty(l: TCOD_list_t) -> bool; +} +extern "C" { + pub fn TCOD_console_set_custom_font( + fontFile: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + nb_char_horiz: ::std::os::raw::c_int, + nb_char_vertic: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_map_ascii_code_to_font( + asciiCode: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_ascii_codes_to_font( + asciiCode: ::std::os::raw::c_int, + nbCodes: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_string_to_font( + s: *const ::std::os::raw::c_char, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_string_to_font_utf( + s: *const wchar_t, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_set_dirty( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + #[doc = "Render and present a console with optional viewport options."] + #[doc = ""] + #[doc = "`console` is the console to render."] + #[doc = ""] + #[doc = "`viewport` is optional."] + #[doc = ""] + #[doc = "Returns a negative values on error. See `TCOD_get_error`."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_console_flush_ex( + console: *mut TCOD_Console, + viewport: *mut TCOD_ViewportOptions, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Render and present the root console to the active display."] + pub fn TCOD_console_flush() -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_check_for_keypress(flags: ::std::os::raw::c_int) -> TCOD_key_t; +} +extern "C" { + pub fn TCOD_console_wait_for_keypress(flush: bool) -> TCOD_key_t; +} +extern "C" { + pub fn TCOD_console_is_key_pressed(key: TCOD_keycode_t) -> bool; +} +extern "C" { + pub fn TCOD_console_from_file(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_load_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_load_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_credits(); +} +extern "C" { + pub fn TCOD_console_credits_reset(); +} +extern "C" { + pub fn TCOD_console_credits_render( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + alpha: bool, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_set_keyboard_repeat( + initial_delay: ::std::os::raw::c_int, + interval: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_disable_keyboard_repeat(); +} +extern "C" { + #[doc = " \\brief Initialize the libtcod graphical engine."] + #[doc = ""] + #[doc = " \\param w The width in tiles."] + #[doc = " \\param h The height in tiles."] + #[doc = " \\param title The title for the window."] + #[doc = " \\param fullscreen Fullscreen option."] + #[doc = " \\param renderer Which renderer to use when rendering the console."] + #[doc = ""] + #[doc = " You may want to call TCOD_console_set_custom_font BEFORE calling this"] + #[doc = " function. By default this function loads libtcod's `terminal.png` image"] + #[doc = " from the working directory."] + #[doc = ""] + #[doc = " Afterwards TCOD_quit must be called before the program exits."] + #[doc = ""] + #[doc = " Returns 0 on success, or -1 on an error, you can check the error with"] + #[doc = " TCOD_sys_get_error()"] + #[doc = ""] + #[doc = " `renderer` and vsync settings can be overridden by the `TCOD_RENDERER` or"] + #[doc = " `TCOD_VSYNC` environment variables."] + #[doc = ""] + #[doc = " Valid case-sensitive options for `TCOD_RENDERER` are:"] + #[doc = " - sdl"] + #[doc = " - opengl"] + #[doc = " - glsl"] + #[doc = " - sdl2"] + #[doc = " - opengl2"] + #[doc = ""] + #[doc = " Valid options for `TCOD_VSYNC` are `0` or `1`."] + #[doc = ""] + #[doc = " \\rst"] + #[doc = " .. versionchanged:: 1.12"] + #[doc = " Now returns -1 on error instead of crashing."] + #[doc = ""] + #[doc = " .. versionchanged:: 1.13"] + #[doc = " Added the `TCOD_RENDERER` and `TCOD_VSYNC` overrides."] + #[doc = " \\endrst"] + pub fn TCOD_console_init_root( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fullscreen: bool, + renderer: TCOD_renderer_t, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_init_root_( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fullscreen: bool, + renderer: TCOD_renderer_t, + vsync: bool, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Shutdown libtcod. This must be called before your program exits."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.8"] + #[doc = " \\endrst"] + pub fn TCOD_quit(); +} +extern "C" { + #[doc = " Change the title string of the active window."] + #[doc = ""] + #[doc = " \\param title A utf8 string."] + pub fn TCOD_console_set_window_title(title: *const ::std::os::raw::c_char); +} +extern "C" { + #[doc = " Set the display to be full-screen or windowed."] + #[doc = ""] + #[doc = " \\param fullscreen If true the display will go full-screen."] + pub fn TCOD_console_set_fullscreen(fullscreen: bool); +} +extern "C" { + #[doc = " Return true if the display is full-screen."] + pub fn TCOD_console_is_fullscreen() -> bool; +} +extern "C" { + #[doc = " Return true if the window has mouse focus."] + pub fn TCOD_console_has_mouse_focus() -> bool; +} +extern "C" { + #[doc = " Return true if the window has keyboard focus."] + #[doc = ""] + #[doc = " \\verbatim embed:rst:leading-asterisk"] + #[doc = " .. versionchanged: 1.7"] + #[doc = " This function was previously broken. It now keeps track of keyboard"] + #[doc = " focus."] + #[doc = " \\endverbatim"] + pub fn TCOD_console_is_active() -> bool; +} +extern "C" { + #[doc = " Return true if the window is closing."] + pub fn TCOD_console_is_window_closed() -> bool; +} +extern "C" { + #[doc = " Return an SDL_Window pointer if one is in use, returns NULL otherwise."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_get_sdl_window() -> *mut SDL_Window; +} +extern "C" { + #[doc = " Return an SDL_Renderer pointer if one is in use, returns NULL otherwise."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_get_sdl_renderer() -> *mut SDL_Renderer; +} +extern "C" { + #[doc = " Render a console over the display."] + #[doc = " \\rst"] + #[doc = " `console` can be any size, the active render will try to scale it to fit"] + #[doc = " the screen."] + #[doc = ""] + #[doc = " The function will only work for the SDL2/OPENGL2 renderers."] + #[doc = ""] + #[doc = " Unlike :any:`TCOD_console_flush` this will not present the display."] + #[doc = " You will need to do that manually, likely with the SDL API."] + #[doc = ""] + #[doc = " Returns 0 on success, or a negative number on a failure such as the"] + #[doc = " incorrect renderer being active."] + #[doc = ""] + #[doc = " .. versionadded:: 1.11"] + #[doc = ""] + #[doc = " .. seealso::"] + #[doc = " :any:`TCOD_sys_get_sdl_window` :any:`TCOD_sys_get_sdl_renderer`"] + #[doc = " \\endrst"] + pub fn TCOD_sys_accumulate_console(console: *const TCOD_Console) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_sys_accumulate_console_( + console: *const TCOD_Console, + viewport: *const SDL_Rect, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_rect_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_frame( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + empty: bool, + flag: TCOD_bkgnd_flag_t, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_get_height_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_ex_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_rect_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_rect_ex_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +impl TCOD_colctrl_t { + pub const TCOD_COLCTRL_NUMBER: TCOD_colctrl_t = TCOD_colctrl_t::TCOD_COLCTRL_5; +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_colctrl_t { + TCOD_COLCTRL_1 = 1, + TCOD_COLCTRL_2 = 2, + TCOD_COLCTRL_3 = 3, + TCOD_COLCTRL_4 = 4, + TCOD_COLCTRL_5 = 5, + TCOD_COLCTRL_FORE_RGB = 6, + TCOD_COLCTRL_BACK_RGB = 7, + TCOD_COLCTRL_STOP = 8, +} +extern "C" { + pub fn TCOD_console_set_color_control( + con: TCOD_colctrl_t, + fore: TCOD_color_t, + back: TCOD_color_t, + ); +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_rect_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Print a framed and optionally titled region to a console, using default"] + #[doc = "colors and alignment."] + #[doc = ""] + #[doc = "This function uses Unicode box-drawing characters and a UTF-8 formatted"] + #[doc = "string."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_frame( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + empty: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return the number of lines that would be printed by this formatted string."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_get_height_rect_fmt( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_printn( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_printn_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_n( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_wn( + width: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_printn_frame( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + empty: bool, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_load_xp( + con: *mut TCOD_Console, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_xp( + con: *const TCOD_Console, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_list_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_console_list_save_xp( + console_list: TCOD_list_t, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + #[doc = "Create a new context with the given console size."] + #[doc = ""] + #[doc = ""] + #[doc = "Same as `TCOD_context_new_window`, but the following parameters have"] + #[doc = "different effects:"] + #[doc = ""] + #[doc = "`columns` and `rows` is the desired size of the terminal window."] + #[doc = "The actual size of the window will be derived from this and the given"] + #[doc = "`tileset`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_new_terminal( + columns: ::std::os::raw::c_int, + rows: ::std::os::raw::c_int, + renderer_type: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + vsync: bool, + sdl_window_flags: ::std::os::raw::c_int, + window_title: *const ::std::os::raw::c_char, + out: *mut *mut TCOD_Context, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Create a new context with a window of the given size."] + #[doc = ""] + #[doc = "Same as `TCOD_context_new_terminal`, but the following parameters have"] + #[doc = "different effects:"] + #[doc = ""] + #[doc = "`pixel_width` and `pixel_height` are the desired size of the window in"] + #[doc = "pixels."] + #[doc = ""] + #[doc = "`renderer_type` is a `TCOD_renderer_t` type."] + #[doc = ""] + #[doc = "`tileset` is an optional pointer to a tileset object."] + #[doc = ""] + #[doc = "If `vsync` is True, then vertical sync will be enabled whenever possible."] + #[doc = "A value of true is recommended."] + #[doc = ""] + #[doc = "`sdl_window_flags` is a bitfield of SDL_WindowFlags flags."] + #[doc = "For a window, a value of ``SDL_WINDOW_RESIZABLE`` is recommended."] + #[doc = "For fullscreen, a value of"] + #[doc = "``SDL_WINDOW_RESIZABLE | SDL_WINDOW_FULLSCREEN_DESKTOP`` is recommended."] + #[doc = "You should avoid the ``SDL_WINDOW_FULLSCREEN`` flag whenever possible."] + #[doc = ""] + #[doc = "`window_title` is the title of the opened window."] + #[doc = ""] + #[doc = "`out` is the output for the `TCOD_Context`, must not be NULL."] + #[doc = ""] + #[doc = "Returns a negative error code on failure, `out` will unlikely be set in this"] + #[doc = "case."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_new_window( + pixel_width: ::std::os::raw::c_int, + pixel_height: ::std::os::raw::c_int, + renderer_type: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + vsync: bool, + sdl_window_flags: ::std::os::raw::c_int, + window_title: *const ::std::os::raw::c_char, + out: *mut *mut TCOD_Context, + ) -> TCOD_Error; +} +#[doc = " Private map cell struct."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_MapCell { + pub transparent: bool, + pub walkable: bool, + pub fov: bool, +} +#[test] +fn bindgen_test_layout_TCOD_MapCell() { + assert_eq!( + ::std::mem::size_of::(), + 3usize, + concat!("Size of: ", stringify!(TCOD_MapCell)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_MapCell)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).transparent as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(transparent) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).walkable as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(walkable) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fov as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(fov) + ) + ); +} +#[doc = " Private map struct."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Map { + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub nbcells: ::std::os::raw::c_int, + pub cells: *mut TCOD_MapCell, +} +#[test] +fn bindgen_test_layout_TCOD_Map() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_Map)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_Map)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nbcells as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(nbcells) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cells as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(cells) + ) + ); +} +impl Default for TCOD_Map { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_map_t = *mut TCOD_Map; +#[repr(i32)] +#[doc = " Field-of-view options."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_fov_algorithm_t { + #[doc = " Basic: http://roguebasin.roguelikedevelopment.org/index.php?title=Ray_casting"] + FOV_BASIC = 0, + #[doc = " Diamond: http://www.geocities.com/temerra/los_rays.html"] + FOV_DIAMOND = 1, + #[doc = " Shadow casting: http://roguebasin.roguelikedevelopment.org/index.php?title=FOV_using_recursive_shadowcasting"] + FOV_SHADOW = 2, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_0 = 3, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_1 = 4, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_2 = 5, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_3 = 6, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_4 = 7, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_5 = 8, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_6 = 9, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_7 = 10, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_8 = 11, + #[doc = " Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos)"] + FOV_RESTRICTIVE = 12, + #[doc = " Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos)"] + NB_FOV_ALGORITHMS = 13, +} +extern "C" { + pub fn TCOD_map_new( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> *mut TCOD_Map; +} +extern "C" { + pub fn TCOD_map_clear(map: *mut TCOD_Map, transparent: bool, walkable: bool); +} +extern "C" { + pub fn TCOD_map_copy(source: *const TCOD_Map, dest: *mut TCOD_Map); +} +extern "C" { + pub fn TCOD_map_set_properties( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + is_transparent: bool, + is_walkable: bool, + ); +} +extern "C" { + pub fn TCOD_map_delete(map: *mut TCOD_Map); +} +extern "C" { + pub fn TCOD_map_compute_fov( + map: *mut TCOD_Map, + player_x: ::std::os::raw::c_int, + player_y: ::std::os::raw::c_int, + max_radius: ::std::os::raw::c_int, + light_walls: bool, + algo: TCOD_fov_algorithm_t, + ); +} +extern "C" { + pub fn TCOD_map_is_in_fov( + map: *const TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_set_in_fov( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fov: bool, + ); +} +extern "C" { + pub fn TCOD_map_is_transparent( + map: *const TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_is_walkable( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_get_width(map: *const TCOD_Map) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_map_get_height(map: *const TCOD_Map) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_map_get_nb_cells(map: *const TCOD_Map) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Return the default tileset, may be NULL."] + #[doc = ""] + #[doc = "A non-NULL return value is a new reference to the global tileset."] + #[doc = "When you are done you will need to call `TCOD_tileset_delete` on this"] + #[doc = "pointer."] + #[doc = ""] + #[doc = "This function is provisional, the API may change in the future."] + pub fn TCOD_get_default_tileset() -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Set the default tileset and update the default display to use it."] + #[doc = ""] + #[doc = "This will keep alive a reference to the given tileset. If you no longer"] + #[doc = "need the pointer then you should call `TCOD_tileset_delete` on it after"] + #[doc = "this function."] + #[doc = ""] + #[doc = "This function is provisional, the API may change in the future."] + pub fn TCOD_set_default_tileset(tileset: *mut TCOD_Tileset); +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_noise_type_t { + TCOD_NOISE_PERLIN = 1, + TCOD_NOISE_SIMPLEX = 2, + TCOD_NOISE_WAVELET = 4, + TCOD_NOISE_DEFAULT = 0, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct TCOD_Noise { + pub ndim: ::std::os::raw::c_int, + #[doc = " Randomized map of indexes into buffer"] + pub map: [::std::os::raw::c_uchar; 256usize], + #[doc = " Random 256 x ndim buffer"] + pub buffer: [[f32; 4usize]; 256usize], + pub H: f32, + pub lacunarity: f32, + pub exponent: [f32; 128usize], + pub waveletTileData: *mut f32, + pub rand: TCOD_random_t, + pub noise_type: TCOD_noise_type_t, +} +#[test] +fn bindgen_test_layout_TCOD_Noise() { + assert_eq!( + ::std::mem::size_of::(), + 4888usize, + concat!("Size of: ", stringify!(TCOD_Noise)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_Noise)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).map as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(map) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buffer as *const _ as usize }, + 260usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(buffer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).H as *const _ as usize }, + 4356usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(H) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lacunarity as *const _ as usize }, + 4360usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(lacunarity) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).exponent as *const _ as usize }, + 4364usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(exponent) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).waveletTileData as *const _ as usize }, + 4876usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(waveletTileData) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rand as *const _ as usize }, + 4880usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(rand) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).noise_type as *const _ as usize }, + 4884usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(noise_type) + ) + ); +} +impl Default for TCOD_Noise { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_noise_t = *mut TCOD_Noise; +extern "C" { + pub fn TCOD_noise_new( + dimensions: ::std::os::raw::c_int, + hurst: f32, + lacunarity: f32, + random: TCOD_random_t, + ) -> TCOD_noise_t; +} +extern "C" { + pub fn TCOD_noise_set_type(noise: TCOD_noise_t, type_: TCOD_noise_type_t); +} +extern "C" { + pub fn TCOD_noise_get_ex(noise: TCOD_noise_t, f: *mut f32, type_: TCOD_noise_type_t) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_fbm_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_turbulence_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; +} +extern "C" { + pub fn TCOD_noise_get(noise: TCOD_noise_t, f: *mut f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_fbm(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_turbulence(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_delete(noise: TCOD_noise_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_heightmap_t { + pub w: ::std::os::raw::c_int, + pub h: ::std::os::raw::c_int, + pub values: *mut f32, +} +#[test] +fn bindgen_test_layout_TCOD_heightmap_t() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).values as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(values) + ) + ); +} +impl Default for TCOD_heightmap_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_heightmap_new( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_heightmap_t; +} +extern "C" { + pub fn TCOD_heightmap_delete(hm: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_get_value( + hm: *const TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_get_interpolated_value( + hm: *const TCOD_heightmap_t, + x: f32, + y: f32, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_set_value( + hm: *mut TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + value: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_get_slope( + hm: *const TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_get_normal( + hm: *const TCOD_heightmap_t, + x: f32, + y: f32, + n: *mut f32, + waterLevel: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_count_cells( + hm: *const TCOD_heightmap_t, + min: f32, + max: f32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_heightmap_has_land_on_border(hm: *const TCOD_heightmap_t, waterLevel: f32) -> bool; +} +extern "C" { + pub fn TCOD_heightmap_get_minmax(hm: *const TCOD_heightmap_t, min: *mut f32, max: *mut f32); +} +extern "C" { + pub fn TCOD_heightmap_copy(hm_source: *const TCOD_heightmap_t, hm_dest: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_add(hm: *mut TCOD_heightmap_t, value: f32); +} +extern "C" { + pub fn TCOD_heightmap_scale(hm: *mut TCOD_heightmap_t, value: f32); +} +extern "C" { + pub fn TCOD_heightmap_clamp(hm: *mut TCOD_heightmap_t, min: f32, max: f32); +} +extern "C" { + pub fn TCOD_heightmap_normalize(hm: *mut TCOD_heightmap_t, min: f32, max: f32); +} +extern "C" { + pub fn TCOD_heightmap_clear(hm: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_lerp_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + coef: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_multiply_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_dig_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_dig_bezier( + hm: *mut TCOD_heightmap_t, + px: *mut ::std::os::raw::c_int, + py: *mut ::std::os::raw::c_int, + startRadius: f32, + startDepth: f32, + endRadius: f32, + endDepth: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_rain_erosion( + hm: *mut TCOD_heightmap_t, + nbDrops: ::std::os::raw::c_int, + erosionCoef: f32, + sedimentationCoef: f32, + rnd: TCOD_random_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_kernel_transform( + hm: *mut TCOD_heightmap_t, + kernelsize: ::std::os::raw::c_int, + dx: *const ::std::os::raw::c_int, + dy: *const ::std::os::raw::c_int, + weight: *const f32, + minLevel: f32, + maxLevel: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_voronoi( + hm: *mut TCOD_heightmap_t, + nbPoints: ::std::os::raw::c_int, + nbCoef: ::std::os::raw::c_int, + coef: *const f32, + rnd: TCOD_random_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_mid_point_displacement( + hm: *mut TCOD_heightmap_t, + rnd: TCOD_random_t, + roughness: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_scale_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_islandify(hm: *mut TCOD_heightmap_t, seaLevel: f32, rnd: TCOD_random_t); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct TCOD_lex_t { + pub file_line: ::std::os::raw::c_int, + pub token_type: ::std::os::raw::c_int, + pub token_int_val: ::std::os::raw::c_int, + pub token_idx: ::std::os::raw::c_int, + pub token_float_val: f32, + pub tok: *mut ::std::os::raw::c_char, + pub toklen: ::std::os::raw::c_int, + pub lastStringDelim: ::std::os::raw::c_char, + pub pos: *mut ::std::os::raw::c_char, + pub buf: *mut ::std::os::raw::c_char, + pub filename: *mut ::std::os::raw::c_char, + pub last_javadoc_comment: *mut ::std::os::raw::c_char, + pub nb_symbols: ::std::os::raw::c_int, + pub nb_keywords: ::std::os::raw::c_int, + pub flags: ::std::os::raw::c_int, + pub symbols: [[::std::os::raw::c_char; 5usize]; 100usize], + pub keywords: [[::std::os::raw::c_char; 20usize]; 100usize], + pub simpleCmt: *const ::std::os::raw::c_char, + pub cmtStart: *const ::std::os::raw::c_char, + pub cmtStop: *const ::std::os::raw::c_char, + pub javadocCmtStart: *const ::std::os::raw::c_char, + pub stringDelim: *const ::std::os::raw::c_char, + pub javadoc_read: bool, + pub allocBuf: bool, + pub savept: bool, +} +#[test] +fn bindgen_test_layout_TCOD_lex_t() { + assert_eq!( + ::std::mem::size_of::(), + 2584usize, + concat!("Size of: ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).file_line as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(file_line) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_type as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_type) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_int_val as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_int_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_idx as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_idx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_float_val as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_float_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tok as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(tok) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).toklen as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(toklen) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lastStringDelim as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(lastStringDelim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pos as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(pos) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).filename as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(filename) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_javadoc_comment as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(last_javadoc_comment) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_symbols as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_symbols) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_keywords as *const _ as usize }, + 52usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_keywords) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).symbols as *const _ as usize }, + 60usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(symbols) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).keywords as *const _ as usize }, + 560usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(keywords) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).simpleCmt as *const _ as usize }, + 2560usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(simpleCmt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStart as *const _ as usize }, + 2564usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStop as *const _ as usize }, + 2568usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStop) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadocCmtStart as *const _ as usize }, + 2572usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadocCmtStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stringDelim as *const _ as usize }, + 2576usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(stringDelim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadoc_read as *const _ as usize }, + 2580usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadoc_read) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).allocBuf as *const _ as usize }, + 2581usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(allocBuf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).savept as *const _ as usize }, + 2582usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(savept) + ) + ); +} +impl Default for TCOD_lex_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_lex_new_intern() -> *mut TCOD_lex_t; +} +extern "C" { + pub fn TCOD_lex_new( + symbols: *mut *const ::std::os::raw::c_char, + keywords: *mut *const ::std::os::raw::c_char, + simpleComment: *const ::std::os::raw::c_char, + commentStart: *const ::std::os::raw::c_char, + commentStop: *const ::std::os::raw::c_char, + javadocCommentStart: *const ::std::os::raw::c_char, + stringDelim: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + ) -> *mut TCOD_lex_t; +} +extern "C" { + pub fn TCOD_lex_delete(lex: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_set_data_buffer(lex: *mut TCOD_lex_t, dat: *mut ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_lex_set_data_file( + lex: *mut TCOD_lex_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_parse(lex: *mut TCOD_lex_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_parse_until_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_parse_until_token_value( + lex: *mut TCOD_lex_t, + token_value: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_expect_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_expect_token_value( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + token_value: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_savepoint(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_restore(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_get_last_javadoc(lex: *mut TCOD_lex_t) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_get_token_name( + token_type: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_get_last_error() -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_hextoint(c: ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_instance() -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_new(algo: TCOD_random_algo_t) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_save(mersenne: TCOD_random_t) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_restore(mersenne: TCOD_random_t, backup: TCOD_random_t); +} +extern "C" { + pub fn TCOD_random_new_from_seed(algo: TCOD_random_algo_t, seed: u32) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_delete(mersenne: TCOD_random_t); +} +extern "C" { + pub fn TCOD_random_set_distribution(mersenne: TCOD_random_t, distribution: TCOD_distribution_t); +} +extern "C" { + pub fn TCOD_random_get_int( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_float(mersenne: TCOD_random_t, min: f32, max: f32) -> f32; +} +extern "C" { + pub fn TCOD_random_get_double(mersenne: TCOD_random_t, min: f64, max: f64) -> f64; +} +extern "C" { + pub fn TCOD_random_get_int_mean( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + mean: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_float_mean( + mersenne: TCOD_random_t, + min: f32, + max: f32, + mean: f32, + ) -> f32; +} +extern "C" { + pub fn TCOD_random_get_double_mean( + mersenne: TCOD_random_t, + min: f64, + max: f64, + mean: f64, + ) -> f64; +} +extern "C" { + pub fn TCOD_random_dice_new(s: *const ::std::os::raw::c_char) -> TCOD_dice_t; +} +extern "C" { + pub fn TCOD_random_dice_roll( + mersenne: TCOD_random_t, + dice: TCOD_dice_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_dice_roll_s( + mersenne: TCOD_random_t, + s: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_mouse_t { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub dx: ::std::os::raw::c_int, + pub dy: ::std::os::raw::c_int, + pub cx: ::std::os::raw::c_int, + pub cy: ::std::os::raw::c_int, + pub dcx: ::std::os::raw::c_int, + pub dcy: ::std::os::raw::c_int, + pub lbutton: bool, + pub rbutton: bool, + pub mbutton: bool, + pub lbutton_pressed: bool, + pub rbutton_pressed: bool, + pub mbutton_pressed: bool, + pub wheel_up: bool, + pub wheel_down: bool, +} +#[test] +fn bindgen_test_layout_TCOD_mouse_t() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_mouse_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_mouse_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dx as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dy as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cx as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cy as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcx as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcy as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton as *const _ as usize }, + 33usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton as *const _ as usize }, + 34usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(mbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton_pressed as *const _ as usize }, + 35usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton_pressed as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton_pressed as *const _ as usize }, + 37usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(mbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wheel_up as *const _ as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(wheel_up) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wheel_down as *const _ as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(wheel_down) + ) + ); +} +extern "C" { + pub fn TCOD_mouse_show_cursor(visible: bool); +} +extern "C" { + pub fn TCOD_mouse_get_status() -> TCOD_mouse_t; +} +extern "C" { + pub fn TCOD_mouse_is_cursor_visible() -> bool; +} +extern "C" { + pub fn TCOD_mouse_move(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_mouse_includes_touch(enable: bool); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_NameGen { + _unused: [u8; 0], +} +pub type TCOD_namegen_t = *mut TCOD_NameGen; +extern "C" { + pub fn TCOD_namegen_parse(filename: *const ::std::os::raw::c_char, random: TCOD_random_t); +} +extern "C" { + pub fn TCOD_namegen_generate( + name: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_namegen_generate_custom( + name: *mut ::std::os::raw::c_char, + rule: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_namegen_get_sets() -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_namegen_destroy(); +} +pub type TCOD_path_func_t = ::std::option::Option< + unsafe extern "C" fn( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + user_data: *mut ::std::os::raw::c_void, + ) -> f32, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Path { + _unused: [u8; 0], +} +pub type TCOD_path_t = *mut TCOD_Path; +extern "C" { + pub fn TCOD_path_new_using_map(map: TCOD_map_t, diagonalCost: f32) -> TCOD_path_t; +} +extern "C" { + pub fn TCOD_path_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_path_t; +} +extern "C" { + pub fn TCOD_path_compute( + path: TCOD_path_t, + ox: ::std::os::raw::c_int, + oy: ::std::os::raw::c_int, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_path_walk( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + recalculate_when_needed: bool, + ) -> bool; +} +extern "C" { + pub fn TCOD_path_is_empty(path: TCOD_path_t) -> bool; +} +extern "C" { + pub fn TCOD_path_size(path: TCOD_path_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_path_reverse(path: TCOD_path_t); +} +extern "C" { + pub fn TCOD_path_get( + path: TCOD_path_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_get_origin( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_get_destination( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_delete(path: TCOD_path_t); +} +#[doc = " Dijkstra data structure"] +#[doc = ""] +#[doc = " All attributes are considered private."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Dijkstra { + pub diagonal_cost: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub nodes_max: ::std::os::raw::c_int, + pub map: TCOD_map_t, + pub func: TCOD_path_func_t, + pub user_data: *mut ::std::os::raw::c_void, + pub distances: *mut ::std::os::raw::c_uint, + pub nodes: *mut ::std::os::raw::c_uint, + pub path: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_Dijkstra() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_Dijkstra)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_Dijkstra)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).diagonal_cost as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(diagonal_cost) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nodes_max as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(nodes_max) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).map as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(map) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).func as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(func) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).user_data as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(user_data) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).distances as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(distances) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nodes as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(nodes) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).path as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(path) + ) + ); +} +impl Default for TCOD_Dijkstra { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_dijkstra_t = *mut TCOD_Dijkstra; +extern "C" { + pub fn TCOD_dijkstra_new(map: TCOD_map_t, diagonalCost: f32) -> TCOD_dijkstra_t; +} +extern "C" { + pub fn TCOD_dijkstra_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_dijkstra_t; +} +extern "C" { + pub fn TCOD_dijkstra_compute( + dijkstra: TCOD_dijkstra_t, + root_x: ::std::os::raw::c_int, + root_y: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_dijkstra_get_distance( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_dijkstra_path_set( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_is_empty(path: TCOD_dijkstra_t) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_size(path: TCOD_dijkstra_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_dijkstra_reverse(path: TCOD_dijkstra_t); +} +extern "C" { + pub fn TCOD_dijkstra_get( + path: TCOD_dijkstra_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_dijkstra_path_walk( + dijkstra: TCOD_dijkstra_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_delete(dijkstra: TCOD_dijkstra_t); +} +extern "C" { + pub fn __threadid() -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn __threadhandle() -> usize; +} +#[repr(C)] +#[derive(Debug, Default)] +pub struct TCOD_HeapNode { + pub priority: ::std::os::raw::c_int, + pub data: __IncompleteArrayField<::std::os::raw::c_uchar>, +} +#[test] +fn bindgen_test_layout_TCOD_HeapNode() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(TCOD_HeapNode)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_HeapNode)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).priority as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_HeapNode), + "::", + stringify!(priority) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_HeapNode), + "::", + stringify!(data) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Heap { + pub heap: *mut TCOD_HeapNode, + pub size: ::std::os::raw::c_int, + pub capacity: ::std::os::raw::c_int, + pub node_size: size_t, + pub data_size: size_t, +} +#[test] +fn bindgen_test_layout_TCOD_Heap() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(TCOD_Heap)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_Heap)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(heap) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).capacity as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(capacity) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).node_size as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(node_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data_size as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(data_size) + ) + ); +} +impl Default for TCOD_Heap { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_heap_init(heap: *mut TCOD_Heap, data_size: size_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_heap_uninit(heap: *mut TCOD_Heap); +} +extern "C" { + pub fn TCOD_heap_clear(heap: *mut TCOD_Heap); +} +extern "C" { + pub fn TCOD_minheap_push( + minheap: *mut TCOD_Heap, + priority: ::std::os::raw::c_int, + data: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_minheap_pop(minheap: *mut TCOD_Heap, out: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_minheap_heapify(minheap: *mut TCOD_Heap); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_ArrayData { + pub ndim: i8, + pub int_type: ::std::os::raw::c_int, + pub shape: [size_t; 5usize], + pub strides: [size_t; 5usize], + pub data: *mut ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_TCOD_ArrayData() { + assert_eq!( + ::std::mem::size_of::(), + 52usize, + concat!("Size of: ", stringify!(TCOD_ArrayData)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_ArrayData)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).int_type as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(int_type) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).shape as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(shape) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).strides as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(strides) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(data) + ) + ); +} +impl Default for TCOD_ArrayData { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_BasicGraph2D { + pub cost: TCOD_ArrayData, + pub cardinal: ::std::os::raw::c_int, + pub diagonal: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_BasicGraph2D() { + assert_eq!( + ::std::mem::size_of::(), + 60usize, + concat!("Size of: ", stringify!(TCOD_BasicGraph2D)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_BasicGraph2D)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cost as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_BasicGraph2D), + "::", + stringify!(cost) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cardinal as *const _ as usize }, + 52usize, + concat!( + "Offset of field: ", + stringify!(TCOD_BasicGraph2D), + "::", + stringify!(cardinal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).diagonal as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_BasicGraph2D), + "::", + stringify!(diagonal) + ) + ); +} +impl Default for TCOD_BasicGraph2D { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Pathfinder { + pub ndim: i8, + pub shape: [size_t; 4usize], + pub owns_distance: bool, + pub owns_graph: bool, + pub owns_traversal: bool, + pub distance: TCOD_ArrayData, + pub graph: TCOD_BasicGraph2D, + pub traversal: TCOD_ArrayData, + pub heap: TCOD_Heap, +} +#[test] +fn bindgen_test_layout_TCOD_Pathfinder() { + assert_eq!( + ::std::mem::size_of::(), + 208usize, + concat!("Size of: ", stringify!(TCOD_Pathfinder)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_Pathfinder)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).shape as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(shape) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).owns_distance as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(owns_distance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).owns_graph as *const _ as usize }, + 21usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(owns_graph) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).owns_traversal as *const _ as usize }, + 22usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(owns_traversal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).distance as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(distance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).graph as *const _ as usize }, + 76usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(graph) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).traversal as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(traversal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 188usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(heap) + ) + ); +} +impl Default for TCOD_Pathfinder { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_pf_new(ndim: ::std::os::raw::c_int, shape: *const size_t) -> *mut TCOD_Pathfinder; +} +extern "C" { + pub fn TCOD_pf_delete(path: *mut TCOD_Pathfinder); +} +extern "C" { + pub fn TCOD_pf_set_distance_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + ); +} +extern "C" { + pub fn TCOD_pf_set_graph2d_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + cardinal: ::std::os::raw::c_int, + diagonal: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_pf_set_traversal_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + ); +} +extern "C" { + pub fn TCOD_pf_recompile(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_pf_compute(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_pf_compute_step(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Frontier { + pub ndim: i8, + pub active_dist: ::std::os::raw::c_int, + pub active_index: [::std::os::raw::c_int; 4usize], + pub heap: TCOD_Heap, +} +#[test] +fn bindgen_test_layout_TCOD_Frontier() { + assert_eq!( + ::std::mem::size_of::(), + 44usize, + concat!("Size of: ", stringify!(TCOD_Frontier)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_Frontier)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).active_dist as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(active_dist) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).active_index as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(active_index) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(heap) + ) + ); +} +impl Default for TCOD_Frontier { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + #[doc = "Create a new pathfinder frontier."] + #[doc = ""] + #[doc = "`ndim` is the number of dimensions. Must be in the range `1 <= n <= 4`."] + pub fn TCOD_frontier_new(ndim: ::std::os::raw::c_int) -> *mut TCOD_Frontier; +} +extern "C" { + #[doc = "Delete a pathfinder frontier."] + pub fn TCOD_frontier_delete(frontier: *mut TCOD_Frontier); +} +extern "C" { + #[doc = "Pop the next node from this frontier."] + #[doc = ""] + #[doc = "The popped node variables will placed in the `active_dist` and"] + #[doc = "`active_index` attributes."] + pub fn TCOD_frontier_pop(frontier: *mut TCOD_Frontier) -> TCOD_Error; +} +extern "C" { + #[doc = "Add a node to this frontier."] + #[doc = ""] + #[doc = "`index[frontier->ndim]` is the position of the node to add to the frontier."] + #[doc = ""] + #[doc = "`dist` is the total distance of the node. This should be a low number"] + #[doc = "like 0, but can also be a negative number such as `INT_MIN`."] + #[doc = "When adding a node as an edge then `dist` is `frontier->active_dist` plus"] + #[doc = "the cost of the edge."] + #[doc = ""] + #[doc = "`heuristic` is the true priority of the node, used to affect node order."] + #[doc = "For Dijkstra-like algorithms this should be the same as `dist`."] + #[doc = "For A* this should be `dist` plus the maximum possible distance to the"] + #[doc = "goal."] + pub fn TCOD_frontier_push( + frontier: *mut TCOD_Frontier, + index: *const ::std::os::raw::c_int, + dist: ::std::os::raw::c_int, + heuristic: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return the current number of nodes in this frontier."] + pub fn TCOD_frontier_size(frontier: *const TCOD_Frontier) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Remove all nodes from this frontier."] + pub fn TCOD_frontier_clear(frontier: *mut TCOD_Frontier) -> TCOD_Error; +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_value_type_t { + TCOD_TYPE_NONE = 0, + TCOD_TYPE_BOOL = 1, + TCOD_TYPE_CHAR = 2, + TCOD_TYPE_INT = 3, + TCOD_TYPE_FLOAT = 4, + TCOD_TYPE_STRING = 5, + TCOD_TYPE_COLOR = 6, + TCOD_TYPE_DICE = 7, + TCOD_TYPE_VALUELIST00 = 8, + TCOD_TYPE_VALUELIST01 = 9, + TCOD_TYPE_VALUELIST02 = 10, + TCOD_TYPE_VALUELIST03 = 11, + TCOD_TYPE_VALUELIST04 = 12, + TCOD_TYPE_VALUELIST05 = 13, + TCOD_TYPE_VALUELIST06 = 14, + TCOD_TYPE_VALUELIST07 = 15, + TCOD_TYPE_VALUELIST08 = 16, + TCOD_TYPE_VALUELIST09 = 17, + TCOD_TYPE_VALUELIST10 = 18, + TCOD_TYPE_VALUELIST11 = 19, + TCOD_TYPE_VALUELIST12 = 20, + TCOD_TYPE_VALUELIST13 = 21, + TCOD_TYPE_VALUELIST14 = 22, + TCOD_TYPE_VALUELIST15 = 23, + TCOD_TYPE_CUSTOM00 = 24, + TCOD_TYPE_CUSTOM01 = 25, + TCOD_TYPE_CUSTOM02 = 26, + TCOD_TYPE_CUSTOM03 = 27, + TCOD_TYPE_CUSTOM04 = 28, + TCOD_TYPE_CUSTOM05 = 29, + TCOD_TYPE_CUSTOM06 = 30, + TCOD_TYPE_CUSTOM07 = 31, + TCOD_TYPE_CUSTOM08 = 32, + TCOD_TYPE_CUSTOM09 = 33, + TCOD_TYPE_CUSTOM10 = 34, + TCOD_TYPE_CUSTOM11 = 35, + TCOD_TYPE_CUSTOM12 = 36, + TCOD_TYPE_CUSTOM13 = 37, + TCOD_TYPE_CUSTOM14 = 38, + TCOD_TYPE_CUSTOM15 = 39, + TCOD_TYPE_LIST = 1024, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union TCOD_value_t { + pub b: bool, + pub c: ::std::os::raw::c_char, + pub i: i32, + pub f: f32, + pub s: *mut ::std::os::raw::c_char, + pub col: TCOD_color_t, + pub dice: TCOD_dice_t, + pub list: TCOD_list_t, + pub custom: *mut ::std::os::raw::c_void, + _bindgen_union_align: [u32; 4usize], +} +#[test] +fn bindgen_test_layout_TCOD_value_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_value_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_value_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(b) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(c) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).i as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(i) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).f as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(f) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).s as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(s) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).col as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(col) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dice as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(dice) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).list as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(list) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).custom as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(custom) + ) + ); +} +impl Default for TCOD_value_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_parser_struct_t = *mut TCOD_ParserStruct; +extern "C" { + pub fn TCOD_struct_get_name(def: TCOD_parser_struct_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_struct_add_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_list_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list_sized( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + size: ::std::os::raw::c_int, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_flag(def: TCOD_parser_struct_t, propname: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_struct_add_structure( + def: TCOD_parser_struct_t, + sub_structure: TCOD_parser_struct_t, + ); +} +extern "C" { + pub fn TCOD_struct_is_mandatory( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_struct_get_type( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> TCOD_value_type_t; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_parser_listener_t { + pub new_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub new_flag: + ::std::option::Option bool>, + pub new_property: ::std::option::Option< + unsafe extern "C" fn( + propname: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + value: TCOD_value_t, + ) -> bool, + >, + pub end_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub error: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_TCOD_parser_listener_t() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(TCOD_parser_listener_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_parser_listener_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).new_struct as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_struct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).new_flag as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_flag) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).new_property as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_property) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).end_struct as *const _ as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(end_struct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).error as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(error) + ) + ); +} +pub type TCOD_parser_custom_t = ::std::option::Option< + unsafe extern "C" fn( + lex: *mut TCOD_lex_t, + listener: *mut TCOD_parser_listener_t, + str: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + ) -> TCOD_value_t, +>; +pub type TCOD_parser_t = *mut TCOD_Parser; +extern "C" { + pub fn TCOD_parser_new() -> TCOD_parser_t; +} +extern "C" { + pub fn TCOD_parser_new_struct( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_parser_struct_t; +} +extern "C" { + pub fn TCOD_parser_new_custom_type( + parser: TCOD_parser_t, + custom_type_parser: TCOD_parser_custom_t, + ) -> TCOD_value_type_t; +} +extern "C" { + pub fn TCOD_parser_run( + parser: TCOD_parser_t, + filename: *const ::std::os::raw::c_char, + listener: *mut TCOD_parser_listener_t, + ); +} +extern "C" { + pub fn TCOD_parser_delete(parser: TCOD_parser_t); +} +extern "C" { + pub fn TCOD_parser_error(msg: *const ::std::os::raw::c_char, ...); +} +extern "C" { + pub fn TCOD_parser_has_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_parser_get_bool_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_parser_get_char_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_parser_get_int_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_parser_get_float_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> f32; +} +extern "C" { + pub fn TCOD_parser_get_string_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_parser_get_color_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_parser_get_dice_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_dice_t; +} +extern "C" { + pub fn TCOD_parser_get_dice_property_py( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + dice: *mut TCOD_dice_t, + ); +} +extern "C" { + pub fn TCOD_parser_get_custom_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_parser_get_list_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + ) -> TCOD_list_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_ParserStruct { + pub name: *mut ::std::os::raw::c_char, + pub flags: TCOD_list_t, + pub props: TCOD_list_t, + pub lists: TCOD_list_t, + pub structs: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_ParserStruct() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(TCOD_ParserStruct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_ParserStruct)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(props) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lists as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(lists) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(structs) + ) + ); +} +impl Default for TCOD_ParserStruct { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_struct_int_t = TCOD_ParserStruct; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Parser { + pub structs: TCOD_list_t, + pub customs: [TCOD_parser_custom_t; 16usize], + pub fatal: bool, + pub props: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_Parser() { + assert_eq!( + ::std::mem::size_of::(), + 76usize, + concat!("Size of: ", stringify!(TCOD_Parser)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_Parser)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(structs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).customs as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(customs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fatal as *const _ as usize }, + 68usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(fatal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(props) + ) + ); +} +impl Default for TCOD_Parser { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_parser_int_t = TCOD_Parser; +extern "C" { + pub fn TCOD_parse_bool_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_char_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_integer_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_float_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_string_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_color_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_dice_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_value_list_value( + def: *mut TCOD_struct_int_t, + listnum: ::std::os::raw::c_int, + ) -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_property_value( + parser: *mut TCOD_parser_int_t, + def: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + list: bool, + ) -> TCOD_value_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetAtlasOpenGL { + pub tileset: *mut TCOD_Tileset, + pub observer: *mut TCOD_TilesetObserver, + pub texture: u32, + pub texture_size: ::std::os::raw::c_int, + pub texture_columns: ::std::os::raw::c_int, + pub texture_rows: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_TilesetAtlasOpenGL() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(TCOD_TilesetAtlasOpenGL)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_TilesetAtlasOpenGL)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(tileset) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).observer as *const _ as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(observer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_size as *const _ as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_columns as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_columns) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_rows as *const _ as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_rows) + ) + ); +} +impl Default for TCOD_TilesetAtlasOpenGL { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGLCommon { + pub window: *mut SDL_Window, + pub glcontext: *mut ::std::os::raw::c_void, + pub atlas: *mut TCOD_TilesetAtlasOpenGL, + pub sdl_subsystems: u32, + pub last_offset_x: f64, + pub last_offset_y: f64, + pub last_scale_x: f64, + pub last_scale_y: f64, +} +#[test] +fn bindgen_test_layout_TCOD_RendererGLCommon() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(TCOD_RendererGLCommon)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererGLCommon)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(window) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).glcontext as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(glcontext) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).atlas as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(atlas) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).sdl_subsystems as *const _ as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(sdl_subsystems) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).last_offset_x as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(last_offset_x) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).last_offset_y as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(last_offset_y) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).last_scale_x as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(last_scale_x) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).last_scale_y as *const _ as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(last_scale_y) + ) + ); +} +impl Default for TCOD_RendererGLCommon { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_gl_atlas_new(tileset: *mut TCOD_Tileset) -> *mut TCOD_TilesetAtlasOpenGL; +} +extern "C" { + pub fn TCOD_gl_atlas_delete(atlas: *mut TCOD_TilesetAtlasOpenGL); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGL1 { + pub common: TCOD_RendererGLCommon, + pub background_texture: u32, + pub background_width: ::std::os::raw::c_int, + pub background_height: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_RendererGL1() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(TCOD_RendererGL1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererGL1)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).common as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL1), + "::", + stringify!(common) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).background_texture as *const _ as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL1), + "::", + stringify!(background_texture) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).background_width as *const _ as usize + }, + 52usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL1), + "::", + stringify!(background_width) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).background_height as *const _ as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL1), + "::", + stringify!(background_height) + ) + ); +} +impl Default for TCOD_RendererGL1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_renderer_init_gl1( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + vsync: bool, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGL2 { + pub common: TCOD_RendererGLCommon, + pub program: u32, + pub console_textures: [u32; 3usize], + pub console_width: ::std::os::raw::c_int, + pub console_height: ::std::os::raw::c_int, + pub vertex_buffer: u32, +} +#[test] +fn bindgen_test_layout_TCOD_RendererGL2() { + assert_eq!( + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(TCOD_RendererGL2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererGL2)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).common as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(common) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).program as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(program) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).console_textures as *const _ as usize + }, + 52usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_textures) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).console_width as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).console_height as *const _ as usize }, + 68usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vertex_buffer as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(vertex_buffer) + ) + ); +} +impl Default for TCOD_RendererGL2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_renderer_new_gl2( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + vsync: bool, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Texture { + _unused: [u8; 0], +} +#[doc = "An SDL2 tileset atlas. This prepares a tileset for use with SDL2."] +#[doc = "\\rst"] +#[doc = ".. versionadded:: 1.16"] +#[doc = "\\endrst"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetAtlasSDL2 { + #[doc = " The renderer used to create this atlas."] + pub renderer: *mut SDL_Renderer, + #[doc = " The atlas texture."] + pub texture: *mut SDL_Texture, + #[doc = " The tileset used to create this atlas. Internal use only."] + pub tileset: *mut TCOD_Tileset, + #[doc = " Internal use only."] + pub observer: *mut TCOD_TilesetObserver, + #[doc = " Internal use only."] + pub texture_columns: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_TilesetAtlasSDL2() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(TCOD_TilesetAtlasSDL2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_TilesetAtlasSDL2)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).renderer as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(renderer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(texture) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(tileset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).observer as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(observer) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_columns as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(texture_columns) + ) + ); +} +impl Default for TCOD_TilesetAtlasSDL2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[doc = "The renderer data for an SDL2 rendering context."] +#[doc = "Internal use only."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererSDL2 { + pub window: *mut SDL_Window, + pub renderer: *mut SDL_Renderer, + pub atlas: *mut TCOD_TilesetAtlasSDL2, + pub cache_console: *mut TCOD_Console, + pub cache_texture: *mut SDL_Texture, + pub sdl_subsystems: u32, + pub last_offset_x: f64, + pub last_offset_y: f64, + pub last_scale_x: f64, + pub last_scale_y: f64, +} +#[test] +fn bindgen_test_layout_TCOD_RendererSDL2() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(TCOD_RendererSDL2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererSDL2)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(window) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).renderer as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(renderer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).atlas as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(atlas) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cache_console as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(cache_console) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cache_texture as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(cache_texture) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).sdl_subsystems as *const _ as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(sdl_subsystems) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_offset_x as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_offset_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_offset_y as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_offset_y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_scale_x as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_scale_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_scale_y as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_scale_y) + ) + ); +} +impl Default for TCOD_RendererSDL2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + #[doc = "Return a libtcod rendering context using an SDL2 renderer."] + pub fn TCOD_renderer_init_sdl2( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + renderer_flags: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; +} +extern "C" { + #[doc = "Return a new SDL2 atlas created from a tileset for an SDL2 renderer."] + #[doc = ""] + #[doc = "You may delete the tileset if you no longer have use for it."] + #[doc = ""] + #[doc = "Will return NULL on an error, you can check the error with"] + #[doc = "`TCOD_get_error`."] + pub fn TCOD_sdl2_atlas_new( + renderer: *mut SDL_Renderer, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_TilesetAtlasSDL2; +} +extern "C" { + #[doc = "Delete an SDL2 tileset atlas."] + pub fn TCOD_sdl2_atlas_delete(atlas: *mut TCOD_TilesetAtlasSDL2); +} +extern "C" { + #[doc = "Render a console onto a managed target texture."] + #[doc = ""] + #[doc = "`atlas` is an SDL2 atlas created with `TCOD_sdl2_atlas_new`."] + #[doc = "The renderer used to make this `atlas` must support"] + #[doc = "`SDL_RENDERER_TARGETTEXTURE`, unless `target` is NULL."] + #[doc = ""] + #[doc = "`console` is a non-NULL pointer to the libtcod console you want to render."] + #[doc = ""] + #[doc = "`cache` can be NULL, or be pointer to a console pointer."] + #[doc = "If `*cache` is NULL then a console will be created."] + #[doc = "If `*cache` isn't NULL then the console pointed to might be deleted or"] + #[doc = "recreated, especially if it does not match the size of `console`."] + #[doc = ""] + #[doc = "`target` can be NULL, or be pointer to where you want the output texture"] + #[doc = "to be placed."] + #[doc = "The texture at `*target` may be deleted or recreated. When this function"] + #[doc = "is successful then the texture at `*target` will be non-NULL and will be"] + #[doc = "exactly fitted to the size of `console` and the tile size of `atlas`."] + #[doc = ""] + #[doc = "If `target` is NULL when the current render target is used instead, the"] + #[doc = "drawn area will not be scaled to fit the render target."] + #[doc = ""] + #[doc = "If SDL2 ever provides a `SDL_RENDER_TARGETS_RESET` event then the console"] + #[doc = "at `*cache` must be deleted and set to NULL, or else the next render will"] + #[doc = "only partially update the texture at `*target`."] + #[doc = ""] + #[doc = "Returns a negative value on an error, check `TCOD_get_error`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_sdl2_render_texture( + atlas: *const TCOD_TilesetAtlasSDL2, + console: *const TCOD_Console, + cache: *mut *mut TCOD_Console, + target: *mut *mut SDL_Texture, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_sys_startup(); +} +extern "C" { + pub fn TCOD_sys_shutdown(); +} +extern "C" { + pub fn TCOD_sys_elapsed_milli() -> u32; +} +extern "C" { + pub fn TCOD_sys_elapsed_seconds() -> f32; +} +extern "C" { + pub fn TCOD_sys_sleep_milli(val: u32); +} +extern "C" { + pub fn TCOD_sys_set_fps(val: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_sys_get_fps() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_sys_get_last_frame_length() -> f32; +} +extern "C" { + pub fn TCOD_sys_save_screenshot(filename: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_sys_force_fullscreen_resolution( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_set_renderer(renderer: TCOD_renderer_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_sys_get_renderer() -> TCOD_renderer_t; +} +extern "C" { + pub fn TCOD_sys_get_current_resolution( + w: *mut ::std::os::raw::c_int, + h: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_fullscreen_offsets( + offx: *mut ::std::os::raw::c_int, + offy: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_char_size(w: *mut ::std::os::raw::c_int, h: *mut ::std::os::raw::c_int); +} +extern "C" { + #[doc = " Upload a tile to the active tileset."] + #[doc = ""] + #[doc = " `asciiCode` is the Unicode codepoint for this tile."] + #[doc = ""] + #[doc = " `fontx` and `fonty` are the tile-coordinates on the active tilemap."] + #[doc = ""] + #[doc = " `img` is the tile to upload."] + #[doc = ""] + #[doc = " `x` and `y` are the upper-left pixel-coordinates of the tile on the `img`."] + pub fn TCOD_sys_update_char( + asciiCode: ::std::os::raw::c_int, + fontx: ::std::os::raw::c_int, + fonty: ::std::os::raw::c_int, + img: TCOD_image_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_SDL_window() -> *mut SDL_Window; +} +extern "C" { + pub fn TCOD_sys_get_SDL_renderer() -> *mut SDL_Renderer; +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_event_t { + TCOD_EVENT_NONE = 0, + TCOD_EVENT_KEY_PRESS = 1, + TCOD_EVENT_KEY_RELEASE = 2, + TCOD_EVENT_KEY = 3, + TCOD_EVENT_MOUSE_MOVE = 4, + TCOD_EVENT_MOUSE_PRESS = 8, + TCOD_EVENT_MOUSE_RELEASE = 16, + TCOD_EVENT_MOUSE = 28, + TCOD_EVENT_FINGER_MOVE = 32, + TCOD_EVENT_FINGER_PRESS = 64, + TCOD_EVENT_FINGER_RELEASE = 128, + TCOD_EVENT_FINGER = 224, + TCOD_EVENT_ANY = 255, +} +extern "C" { + pub fn TCOD_sys_wait_for_event( + eventMask: ::std::os::raw::c_int, + key: *mut TCOD_key_t, + mouse: *mut TCOD_mouse_t, + flush: bool, + ) -> TCOD_event_t; +} +extern "C" { + pub fn TCOD_sys_check_for_event( + eventMask: ::std::os::raw::c_int, + key: *mut TCOD_key_t, + mouse: *mut TCOD_mouse_t, + ) -> TCOD_event_t; +} +extern "C" { + pub fn TCOD_sys_create_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_delete_file(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_delete_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_is_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_get_directory_content( + path: *const ::std::os::raw::c_char, + pattern: *const ::std::os::raw::c_char, + ) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_sys_file_exists(filename: *const ::std::os::raw::c_char, ...) -> bool; +} +extern "C" { + pub fn TCOD_sys_read_file( + filename: *const ::std::os::raw::c_char, + buf: *mut *mut ::std::os::raw::c_uchar, + size: *mut size_t, + ) -> bool; +} +extern "C" { + pub fn TCOD_sys_write_file( + filename: *const ::std::os::raw::c_char, + buf: *mut ::std::os::raw::c_uchar, + size: u32, + ) -> bool; +} +extern "C" { + pub fn TCOD_sys_clipboard_set(value: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_clipboard_get() -> *mut ::std::os::raw::c_char; +} +pub type TCOD_thread_t = *mut ::std::os::raw::c_void; +pub type TCOD_semaphore_t = *mut ::std::os::raw::c_void; +pub type TCOD_mutex_t = *mut ::std::os::raw::c_void; +pub type TCOD_cond_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_thread_new( + func: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, + >, + data: *mut ::std::os::raw::c_void, + ) -> TCOD_thread_t; +} +extern "C" { + pub fn TCOD_thread_delete(th: TCOD_thread_t); +} +extern "C" { + pub fn TCOD_sys_get_num_cores() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_thread_wait(th: TCOD_thread_t); +} +extern "C" { + pub fn TCOD_mutex_new() -> TCOD_mutex_t; +} +extern "C" { + pub fn TCOD_mutex_in(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_mutex_out(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_mutex_delete(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_semaphore_new(initVal: ::std::os::raw::c_int) -> TCOD_semaphore_t; +} +extern "C" { + pub fn TCOD_semaphore_lock(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_semaphore_unlock(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_semaphore_delete(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_condition_new() -> TCOD_cond_t; +} +extern "C" { + pub fn TCOD_condition_signal(sem: TCOD_cond_t); +} +extern "C" { + pub fn TCOD_condition_broadcast(sem: TCOD_cond_t); +} +extern "C" { + pub fn TCOD_condition_wait(sem: TCOD_cond_t, mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_condition_delete(sem: TCOD_cond_t); +} +pub type TCOD_library_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_load_library(path: *const ::std::os::raw::c_char) -> TCOD_library_t; +} +extern "C" { + pub fn TCOD_get_function_address( + library: TCOD_library_t, + function_name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_close_library(arg1: TCOD_library_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Surface { + _unused: [u8; 0], +} +pub type SDL_renderer_t = + ::std::option::Option; +extern "C" { + pub fn TCOD_sys_register_SDL_renderer(renderer: SDL_renderer_t); +} +extern "C" { + #[doc = "Load a BDF font from a file path."] + #[doc = ""] + #[doc = "For the best results, you should use a BDF font with a cell-based"] + #[doc = "monospace alignment."] + #[doc = ""] + #[doc = "May return NULL on failure. See `TCOD_get_error` for the error message."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_load_bdf(path: *const ::std::os::raw::c_char) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Load a BDF font from memory."] + #[doc = ""] + #[doc = "`size` is the byte length of `buffer`. `buffer` is the BDF data to load."] + #[doc = ""] + #[doc = "May return NULL on failure. See `TCOD_get_error` for the error message."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_load_bdf_memory( + size: ::std::os::raw::c_int, + buffer: *const ::std::os::raw::c_uchar, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Try to return a fall-back Tileset, may return NULL."] + #[doc = ""] + #[doc = " Used when one is needed, but was not provided by the user."] + pub fn TCOD_tileset_load_fallback_font_( + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Render a console to a SDL_Surface with a software renderer."] + #[doc = ""] + #[doc = "`tileset` is the tiles to render with, must not be NULL."] + #[doc = ""] + #[doc = "`console` is the console to render, must not be NULL."] + #[doc = ""] + #[doc = "`cache` is an optional pointer to a consoled used as a cache. The console"] + #[doc = "at `*cache` will be created or modified. The `cache` will be used to skip"] + #[doc = "drawing already drawn tiles on any subsequent calls."] + #[doc = ""] + #[doc = "`surface_out` is a pointer to where to put the surface will be managed."] + #[doc = "The surface at `*surface_out` will be created or modified and will change"] + #[doc = "to match the size of `console` and `tileset`. The pixel format will be"] + #[doc = "SDL_PIXELFORMAT_RGBA32."] + #[doc = ""] + #[doc = "Returns a negative value on error, see `TCOD_get_error`."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_tileset_render_to_surface( + tileset: *const TCOD_Tileset, + console: *const TCOD_Console, + cache: *mut *mut TCOD_Console, + surface_out: *mut *mut SDL_Surface, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Return a tileset from a TrueType font file."] + pub fn TCOD_load_truetype_font_( + path: *const ::std::os::raw::c_char, + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Set the global tileset from a TrueType font file."] + pub fn TCOD_tileset_load_truetype_( + path: *const ::std::os::raw::c_char, + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Text { + _unused: [u8; 0], +} +pub type TCOD_text_t = *mut TCOD_Text; +extern "C" { + pub fn TCOD_text_init( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + max_chars: ::std::os::raw::c_int, + ) -> TCOD_text_t; +} +extern "C" { + pub fn TCOD_text_init2( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + max_chars: ::std::os::raw::c_int, + ) -> TCOD_text_t; +} +extern "C" { + pub fn TCOD_text_set_pos(txt: TCOD_text_t, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_text_set_properties( + txt: TCOD_text_t, + cursor_char: ::std::os::raw::c_int, + blink_interval: ::std::os::raw::c_int, + prompt: *const ::std::os::raw::c_char, + tab_size: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_text_set_colors( + txt: TCOD_text_t, + fore: TCOD_color_t, + back: TCOD_color_t, + back_transparency: f32, + ); +} +extern "C" { + pub fn TCOD_text_update(txt: TCOD_text_t, key: TCOD_key_t) -> bool; +} +extern "C" { + pub fn TCOD_text_render(txt: TCOD_text_t, con: TCOD_console_t); +} +extern "C" { + pub fn TCOD_text_get(txt: TCOD_text_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_text_reset(txt: TCOD_text_t); +} +extern "C" { + pub fn TCOD_text_delete(txt: TCOD_text_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Zip { + _unused: [u8; 0], +} +pub type TCOD_zip_t = *mut TCOD_Zip; +extern "C" { + pub fn TCOD_zip_new() -> TCOD_zip_t; +} +extern "C" { + pub fn TCOD_zip_delete(zip: TCOD_zip_t); +} +extern "C" { + pub fn TCOD_zip_put_char(zip: TCOD_zip_t, val: ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_zip_put_int(zip: TCOD_zip_t, val: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_zip_put_float(zip: TCOD_zip_t, val: f32); +} +extern "C" { + pub fn TCOD_zip_put_string(zip: TCOD_zip_t, val: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_zip_put_color(zip: TCOD_zip_t, val: TCOD_color_t); +} +extern "C" { + pub fn TCOD_zip_put_image(zip: TCOD_zip_t, val: TCOD_image_t); +} +extern "C" { + pub fn TCOD_zip_put_console(zip: TCOD_zip_t, val: *const TCOD_Console); +} +extern "C" { + #[doc = "Write a TCOD_Random* object."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_zip_put_random(zip: TCOD_zip_t, val: *const TCOD_Random); +} +extern "C" { + pub fn TCOD_zip_put_data( + zip: TCOD_zip_t, + nbBytes: ::std::os::raw::c_int, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn TCOD_zip_get_current_bytes(zip: TCOD_zip_t) -> u32; +} +extern "C" { + pub fn TCOD_zip_save_to_file( + zip: TCOD_zip_t, + filename: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_load_from_file( + zip: TCOD_zip_t, + filename: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_char(zip: TCOD_zip_t) -> ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_zip_get_int(zip: TCOD_zip_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_float(zip: TCOD_zip_t) -> f32; +} +extern "C" { + pub fn TCOD_zip_get_string(zip: TCOD_zip_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_zip_get_color(zip: TCOD_zip_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_zip_get_image(zip: TCOD_zip_t) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_zip_get_console(zip: TCOD_zip_t) -> TCOD_console_t; +} +extern "C" { + #[doc = "Read a TCOD_Random* object."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_zip_get_random(zip: TCOD_zip_t) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_zip_get_data( + zip: TCOD_zip_t, + nbBytes: ::std::os::raw::c_int, + data: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_remaining_bytes(zip: TCOD_zip_t) -> u32; +} +extern "C" { + pub fn TCOD_zip_skip_bytes(zip: TCOD_zip_t, nbBytes: u32); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SDL_Event { + _unused: [u8; 0], +} +extern "C" { + #[doc = " Parse an SDL_Event into a key event and return the relevant TCOD_event_t."] + #[doc = ""] + #[doc = " Returns TCOD_EVENT_NONE if the event wasn't keyboard related."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_process_key_event(in_: *const SDL_Event, out: *mut TCOD_key_t) -> TCOD_event_t; +} +extern "C" { + #[doc = " Parse an SDL_Event into a mouse event and return the relevant TCOD_event_t."] + #[doc = ""] + #[doc = " Returns TCOD_EVENT_NONE if the event wasn't mouse related."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_process_mouse_event( + in_: *const SDL_Event, + out: *mut TCOD_mouse_t, + ) -> TCOD_event_t; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __crt_locale_data { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __crt_multibyte_data { + pub _address: u8, +} diff --git a/tcod_sys/x86_64-apple-darwin_bindings.rs b/tcod_sys/x86_64-apple-darwin_bindings.rs new file mode 100644 index 000000000..b7379cc8f --- /dev/null +++ b/tcod_sys/x86_64-apple-darwin_bindings.rs @@ -0,0 +1,11384 @@ +/* automatically generated by rust-bindgen */ + +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub const fn new() -> Self { + __IncompleteArrayField(::std::marker::PhantomData, []) + } + #[inline] + pub fn as_ptr(&self) -> *const T { + self as *const _ as *const T + } + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut T { + self as *mut _ as *mut T + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::std::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::std::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} +pub const __llvm__: u32 = 1; +pub const __clang__: u32 = 1; +pub const __clang_major__: u32 = 10; +pub const __clang_minor__: u32 = 0; +pub const __clang_patchlevel__: u32 = 0; +pub const __clang_version__: &'static [u8; 8usize] = b"10.0.0 \0"; +pub const __GNUC__: u32 = 4; +pub const __GNUC_MINOR__: u32 = 2; +pub const __GNUC_PATCHLEVEL__: u32 = 1; +pub const __GXX_ABI_VERSION: u32 = 1002; +pub const __ATOMIC_RELAXED: u32 = 0; +pub const __ATOMIC_CONSUME: u32 = 1; +pub const __ATOMIC_ACQUIRE: u32 = 2; +pub const __ATOMIC_RELEASE: u32 = 3; +pub const __ATOMIC_ACQ_REL: u32 = 4; +pub const __ATOMIC_SEQ_CST: u32 = 5; +pub const __OPENCL_MEMORY_SCOPE_WORK_ITEM: u32 = 0; +pub const __OPENCL_MEMORY_SCOPE_WORK_GROUP: u32 = 1; +pub const __OPENCL_MEMORY_SCOPE_DEVICE: u32 = 2; +pub const __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES: u32 = 3; +pub const __OPENCL_MEMORY_SCOPE_SUB_GROUP: u32 = 4; +pub const __PRAGMA_REDEFINE_EXTNAME: u32 = 1; +pub const __VERSION__: &'static [u8; 14usize] = b"Clang 10.0.0 \0"; +pub const __OBJC_BOOL_IS_BOOL: u32 = 0; +pub const __CONSTANT_CFSTRINGS__: u32 = 1; +pub const __BLOCKS__: u32 = 1; +pub const __ORDER_LITTLE_ENDIAN__: u32 = 1234; +pub const __ORDER_BIG_ENDIAN__: u32 = 4321; +pub const __ORDER_PDP_ENDIAN__: u32 = 3412; +pub const __BYTE_ORDER__: u32 = 1234; +pub const __LITTLE_ENDIAN__: u32 = 1; +pub const _LP64: u32 = 1; +pub const __LP64__: u32 = 1; +pub const __CHAR_BIT__: u32 = 8; +pub const __SCHAR_MAX__: u32 = 127; +pub const __SHRT_MAX__: u32 = 32767; +pub const __INT_MAX__: u32 = 2147483647; +pub const __LONG_MAX__: u64 = 9223372036854775807; +pub const __LONG_LONG_MAX__: u64 = 9223372036854775807; +pub const __WCHAR_MAX__: u32 = 2147483647; +pub const __WINT_MAX__: u32 = 2147483647; +pub const __INTMAX_MAX__: u64 = 9223372036854775807; +pub const __SIZE_MAX__: i32 = -1; +pub const __UINTMAX_MAX__: i32 = -1; +pub const __PTRDIFF_MAX__: u64 = 9223372036854775807; +pub const __INTPTR_MAX__: u64 = 9223372036854775807; +pub const __UINTPTR_MAX__: i32 = -1; +pub const __SIZEOF_DOUBLE__: u32 = 8; +pub const __SIZEOF_FLOAT__: u32 = 4; +pub const __SIZEOF_INT__: u32 = 4; +pub const __SIZEOF_LONG__: u32 = 8; +pub const __SIZEOF_LONG_DOUBLE__: u32 = 16; +pub const __SIZEOF_LONG_LONG__: u32 = 8; +pub const __SIZEOF_POINTER__: u32 = 8; +pub const __SIZEOF_SHORT__: u32 = 2; +pub const __SIZEOF_PTRDIFF_T__: u32 = 8; +pub const __SIZEOF_SIZE_T__: u32 = 8; +pub const __SIZEOF_WCHAR_T__: u32 = 4; +pub const __SIZEOF_WINT_T__: u32 = 4; +pub const __SIZEOF_INT128__: u32 = 16; +pub const __INTMAX_FMTd__: &'static [u8; 3usize] = b"ld\0"; +pub const __INTMAX_FMTi__: &'static [u8; 3usize] = b"li\0"; +pub const __UINTMAX_FMTo__: &'static [u8; 3usize] = b"lo\0"; +pub const __UINTMAX_FMTu__: &'static [u8; 3usize] = b"lu\0"; +pub const __UINTMAX_FMTx__: &'static [u8; 3usize] = b"lx\0"; +pub const __UINTMAX_FMTX__: &'static [u8; 3usize] = b"lX\0"; +pub const __INTMAX_WIDTH__: u32 = 64; +pub const __PTRDIFF_FMTd__: &'static [u8; 3usize] = b"ld\0"; +pub const __PTRDIFF_FMTi__: &'static [u8; 3usize] = b"li\0"; +pub const __PTRDIFF_WIDTH__: u32 = 64; +pub const __INTPTR_FMTd__: &'static [u8; 3usize] = b"ld\0"; +pub const __INTPTR_FMTi__: &'static [u8; 3usize] = b"li\0"; +pub const __INTPTR_WIDTH__: u32 = 64; +pub const __SIZE_FMTo__: &'static [u8; 3usize] = b"lo\0"; +pub const __SIZE_FMTu__: &'static [u8; 3usize] = b"lu\0"; +pub const __SIZE_FMTx__: &'static [u8; 3usize] = b"lx\0"; +pub const __SIZE_FMTX__: &'static [u8; 3usize] = b"lX\0"; +pub const __SIZE_WIDTH__: u32 = 64; +pub const __WCHAR_WIDTH__: u32 = 32; +pub const __WINT_WIDTH__: u32 = 32; +pub const __SIG_ATOMIC_WIDTH__: u32 = 32; +pub const __SIG_ATOMIC_MAX__: u32 = 2147483647; +pub const __UINTMAX_WIDTH__: u32 = 64; +pub const __UINTPTR_FMTo__: &'static [u8; 3usize] = b"lo\0"; +pub const __UINTPTR_FMTu__: &'static [u8; 3usize] = b"lu\0"; +pub const __UINTPTR_FMTx__: &'static [u8; 3usize] = b"lx\0"; +pub const __UINTPTR_FMTX__: &'static [u8; 3usize] = b"lX\0"; +pub const __UINTPTR_WIDTH__: u32 = 64; +pub const __FLT_HAS_DENORM__: u32 = 1; +pub const __FLT_DIG__: u32 = 6; +pub const __FLT_DECIMAL_DIG__: u32 = 9; +pub const __FLT_HAS_INFINITY__: u32 = 1; +pub const __FLT_HAS_QUIET_NAN__: u32 = 1; +pub const __FLT_MANT_DIG__: u32 = 24; +pub const __FLT_MAX_10_EXP__: u32 = 38; +pub const __FLT_MAX_EXP__: u32 = 128; +pub const __FLT_MIN_10_EXP__: i32 = -37; +pub const __FLT_MIN_EXP__: i32 = -125; +pub const __DBL_HAS_DENORM__: u32 = 1; +pub const __DBL_DIG__: u32 = 15; +pub const __DBL_DECIMAL_DIG__: u32 = 17; +pub const __DBL_HAS_INFINITY__: u32 = 1; +pub const __DBL_HAS_QUIET_NAN__: u32 = 1; +pub const __DBL_MANT_DIG__: u32 = 53; +pub const __DBL_MAX_10_EXP__: u32 = 308; +pub const __DBL_MAX_EXP__: u32 = 1024; +pub const __DBL_MIN_10_EXP__: i32 = -307; +pub const __DBL_MIN_EXP__: i32 = -1021; +pub const __LDBL_HAS_DENORM__: u32 = 1; +pub const __LDBL_DIG__: u32 = 18; +pub const __LDBL_DECIMAL_DIG__: u32 = 21; +pub const __LDBL_HAS_INFINITY__: u32 = 1; +pub const __LDBL_HAS_QUIET_NAN__: u32 = 1; +pub const __LDBL_MANT_DIG__: u32 = 64; +pub const __LDBL_MAX_10_EXP__: u32 = 4932; +pub const __LDBL_MAX_EXP__: u32 = 16384; +pub const __LDBL_MIN_10_EXP__: i32 = -4931; +pub const __LDBL_MIN_EXP__: i32 = -16381; +pub const __POINTER_WIDTH__: u32 = 64; +pub const __BIGGEST_ALIGNMENT__: u32 = 16; +pub const __INT8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __INT16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __INT32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __INT64_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INT64_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINT8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __UINT8_MAX__: u32 = 255; +pub const __INT8_MAX__: u32 = 127; +pub const __UINT16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __UINT16_MAX__: u32 = 65535; +pub const __INT16_MAX__: u32 = 32767; +pub const __UINT32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __UINT32_MAX__: u32 = 4294967295; +pub const __INT32_MAX__: u32 = 2147483647; +pub const __UINT64_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINT64_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINT64_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINT64_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __UINT64_MAX__: i32 = -1; +pub const __INT64_MAX__: u64 = 9223372036854775807; +pub const __INT_LEAST8_MAX__: u32 = 127; +pub const __INT_LEAST8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT_LEAST8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __UINT_LEAST8_MAX__: u32 = 255; +pub const __UINT_LEAST8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT_LEAST8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT_LEAST8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT_LEAST8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __INT_LEAST16_MAX__: u32 = 32767; +pub const __INT_LEAST16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT_LEAST16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __UINT_LEAST16_MAX__: u32 = 65535; +pub const __UINT_LEAST16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT_LEAST16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT_LEAST16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT_LEAST16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __INT_LEAST32_MAX__: u32 = 2147483647; +pub const __INT_LEAST32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT_LEAST32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __UINT_LEAST32_MAX__: u32 = 4294967295; +pub const __UINT_LEAST32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT_LEAST32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT_LEAST32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT_LEAST32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __INT_LEAST64_MAX__: u64 = 9223372036854775807; +pub const __INT_LEAST64_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INT_LEAST64_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINT_LEAST64_MAX__: i32 = -1; +pub const __UINT_LEAST64_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINT_LEAST64_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINT_LEAST64_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINT_LEAST64_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __INT_FAST8_MAX__: u32 = 127; +pub const __INT_FAST8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT_FAST8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __UINT_FAST8_MAX__: u32 = 255; +pub const __UINT_FAST8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT_FAST8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT_FAST8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT_FAST8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __INT_FAST16_MAX__: u32 = 32767; +pub const __INT_FAST16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT_FAST16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __UINT_FAST16_MAX__: u32 = 65535; +pub const __UINT_FAST16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT_FAST16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT_FAST16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT_FAST16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __INT_FAST32_MAX__: u32 = 2147483647; +pub const __INT_FAST32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT_FAST32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __UINT_FAST32_MAX__: u32 = 4294967295; +pub const __UINT_FAST32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT_FAST32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT_FAST32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT_FAST32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __INT_FAST64_MAX__: u64 = 9223372036854775807; +pub const __INT_FAST64_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INT_FAST64_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINT_FAST64_MAX__: i32 = -1; +pub const __UINT_FAST64_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINT_FAST64_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINT_FAST64_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINT_FAST64_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __FINITE_MATH_ONLY__: u32 = 0; +pub const __GNUC_STDC_INLINE__: u32 = 1; +pub const __GCC_ATOMIC_TEST_AND_SET_TRUEVAL: u32 = 1; +pub const __CLANG_ATOMIC_BOOL_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR16_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR32_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_WCHAR_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_SHORT_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_INT_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_LONG_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_LLONG_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_POINTER_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_BOOL_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_CHAR_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_CHAR16_T_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_CHAR32_T_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_WCHAR_T_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_SHORT_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_INT_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_LONG_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_LLONG_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_POINTER_LOCK_FREE: u32 = 2; +pub const __NO_INLINE__: u32 = 1; +pub const __PIC__: u32 = 2; +pub const __pic__: u32 = 2; +pub const __FLT_EVAL_METHOD__: u32 = 0; +pub const __FLT_RADIX__: u32 = 2; +pub const __DECIMAL_DIG__: u32 = 21; +pub const __SSP__: u32 = 1; +pub const __GCC_ASM_FLAG_OUTPUTS__: u32 = 1; +pub const __code_model_small_: u32 = 1; +pub const __amd64__: u32 = 1; +pub const __amd64: u32 = 1; +pub const __x86_64: u32 = 1; +pub const __x86_64__: u32 = 1; +pub const __SEG_GS: u32 = 1; +pub const __SEG_FS: u32 = 1; +pub const __core2: u32 = 1; +pub const __core2__: u32 = 1; +pub const __tune_core2__: u32 = 1; +pub const __NO_MATH_INLINES: u32 = 1; +pub const __FXSR__: u32 = 1; +pub const __SSE4_1__: u32 = 1; +pub const __SSSE3__: u32 = 1; +pub const __SSE3__: u32 = 1; +pub const __SSE2__: u32 = 1; +pub const __SSE2_MATH__: u32 = 1; +pub const __SSE__: u32 = 1; +pub const __SSE_MATH__: u32 = 1; +pub const __MMX__: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16: u32 = 1; +pub const __APPLE_CC__: u32 = 6000; +pub const __APPLE__: u32 = 1; +pub const __STDC_NO_THREADS__: u32 = 1; +pub const OBJC_NEW_PROPERTIES: u32 = 1; +pub const __DYNAMIC__: u32 = 1; +pub const __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__: u32 = 101300; +pub const __MACH__: u32 = 1; +pub const __STDC__: u32 = 1; +pub const __STDC_HOSTED__: u32 = 1; +pub const __STDC_VERSION__: u32 = 201112; +pub const __STDC_UTF_16__: u32 = 1; +pub const __STDC_UTF_32__: u32 = 1; +pub const __DARWIN_ONLY_64_BIT_INO_T: u32 = 0; +pub const __DARWIN_ONLY_VERS_1050: u32 = 0; +pub const __DARWIN_ONLY_UNIX_CONFORMANCE: u32 = 1; +pub const __DARWIN_UNIX03: u32 = 1; +pub const __DARWIN_64_BIT_INO_T: u32 = 1; +pub const __DARWIN_VERS_1050: u32 = 1; +pub const __DARWIN_NON_CANCELABLE: u32 = 0; +pub const __DARWIN_SUF_64_BIT_INO_T: &'static [u8; 9usize] = b"$INODE64\0"; +pub const __DARWIN_SUF_1050: &'static [u8; 6usize] = b"$1050\0"; +pub const __DARWIN_SUF_EXTSN: &'static [u8; 14usize] = b"$DARWIN_EXTSN\0"; +pub const __DARWIN_C_ANSI: u32 = 4096; +pub const __DARWIN_C_FULL: u32 = 900000; +pub const __DARWIN_C_LEVEL: u32 = 900000; +pub const __STDC_WANT_LIB_EXT1__: u32 = 1; +pub const __DARWIN_NO_LONG_LONG: u32 = 0; +pub const _DARWIN_FEATURE_64_BIT_INODE: u32 = 1; +pub const _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE: u32 = 1; +pub const _DARWIN_FEATURE_UNIX_CONFORMANCE: u32 = 3; +pub const __PTHREAD_SIZE__: u32 = 8176; +pub const __PTHREAD_ATTR_SIZE__: u32 = 56; +pub const __PTHREAD_MUTEXATTR_SIZE__: u32 = 8; +pub const __PTHREAD_MUTEX_SIZE__: u32 = 56; +pub const __PTHREAD_CONDATTR_SIZE__: u32 = 8; +pub const __PTHREAD_COND_SIZE__: u32 = 40; +pub const __PTHREAD_ONCE_SIZE__: u32 = 8; +pub const __PTHREAD_RWLOCK_SIZE__: u32 = 192; +pub const __PTHREAD_RWLOCKATTR_SIZE__: u32 = 16; +pub const __DARWIN_WCHAR_MAX: u32 = 2147483647; +pub const __DARWIN_WCHAR_MIN: i32 = -2147483648; +pub const _FORTIFY_SOURCE: u32 = 2; +pub const __MAC_10_0: u32 = 1000; +pub const __MAC_10_1: u32 = 1010; +pub const __MAC_10_2: u32 = 1020; +pub const __MAC_10_3: u32 = 1030; +pub const __MAC_10_4: u32 = 1040; +pub const __MAC_10_5: u32 = 1050; +pub const __MAC_10_6: u32 = 1060; +pub const __MAC_10_7: u32 = 1070; +pub const __MAC_10_8: u32 = 1080; +pub const __MAC_10_9: u32 = 1090; +pub const __MAC_10_10: u32 = 101000; +pub const __MAC_10_10_2: u32 = 101002; +pub const __MAC_10_10_3: u32 = 101003; +pub const __MAC_10_11: u32 = 101100; +pub const __MAC_10_11_2: u32 = 101102; +pub const __MAC_10_11_3: u32 = 101103; +pub const __MAC_10_11_4: u32 = 101104; +pub const __MAC_10_12: u32 = 101200; +pub const __MAC_10_12_1: u32 = 101201; +pub const __MAC_10_12_2: u32 = 101202; +pub const __MAC_10_12_4: u32 = 101204; +pub const __MAC_10_13: u32 = 101300; +pub const __MAC_10_13_1: u32 = 101301; +pub const __MAC_10_13_2: u32 = 101302; +pub const __MAC_10_13_4: u32 = 101304; +pub const __IPHONE_2_0: u32 = 20000; +pub const __IPHONE_2_1: u32 = 20100; +pub const __IPHONE_2_2: u32 = 20200; +pub const __IPHONE_3_0: u32 = 30000; +pub const __IPHONE_3_1: u32 = 30100; +pub const __IPHONE_3_2: u32 = 30200; +pub const __IPHONE_4_0: u32 = 40000; +pub const __IPHONE_4_1: u32 = 40100; +pub const __IPHONE_4_2: u32 = 40200; +pub const __IPHONE_4_3: u32 = 40300; +pub const __IPHONE_5_0: u32 = 50000; +pub const __IPHONE_5_1: u32 = 50100; +pub const __IPHONE_6_0: u32 = 60000; +pub const __IPHONE_6_1: u32 = 60100; +pub const __IPHONE_7_0: u32 = 70000; +pub const __IPHONE_7_1: u32 = 70100; +pub const __IPHONE_8_0: u32 = 80000; +pub const __IPHONE_8_1: u32 = 80100; +pub const __IPHONE_8_2: u32 = 80200; +pub const __IPHONE_8_3: u32 = 80300; +pub const __IPHONE_8_4: u32 = 80400; +pub const __IPHONE_9_0: u32 = 90000; +pub const __IPHONE_9_1: u32 = 90100; +pub const __IPHONE_9_2: u32 = 90200; +pub const __IPHONE_9_3: u32 = 90300; +pub const __IPHONE_10_0: u32 = 100000; +pub const __IPHONE_10_1: u32 = 100100; +pub const __IPHONE_10_2: u32 = 100200; +pub const __IPHONE_10_3: u32 = 100300; +pub const __IPHONE_11_0: u32 = 110000; +pub const __IPHONE_11_1: u32 = 110100; +pub const __IPHONE_11_2: u32 = 110200; +pub const __IPHONE_11_3: u32 = 110300; +pub const __TVOS_9_0: u32 = 90000; +pub const __TVOS_9_1: u32 = 90100; +pub const __TVOS_9_2: u32 = 90200; +pub const __TVOS_10_0: u32 = 100000; +pub const __TVOS_10_0_1: u32 = 100001; +pub const __TVOS_10_1: u32 = 100100; +pub const __TVOS_10_2: u32 = 100200; +pub const __TVOS_11_0: u32 = 110000; +pub const __TVOS_11_1: u32 = 110100; +pub const __TVOS_11_2: u32 = 110200; +pub const __TVOS_11_3: u32 = 110300; +pub const __WATCHOS_1_0: u32 = 10000; +pub const __WATCHOS_2_0: u32 = 20000; +pub const __WATCHOS_2_1: u32 = 20100; +pub const __WATCHOS_2_2: u32 = 20200; +pub const __WATCHOS_3_0: u32 = 30000; +pub const __WATCHOS_3_1: u32 = 30100; +pub const __WATCHOS_3_1_1: u32 = 30101; +pub const __WATCHOS_3_2: u32 = 30200; +pub const __WATCHOS_4_0: u32 = 40000; +pub const __WATCHOS_4_1: u32 = 40100; +pub const __WATCHOS_4_2: u32 = 40200; +pub const __WATCHOS_4_3: u32 = 40300; +pub const __MAC_OS_X_VERSION_MIN_REQUIRED: u32 = 101300; +pub const __MAC_OS_X_VERSION_MAX_ALLOWED: u32 = 101304; +pub const WCHAR_MIN: i32 = -2147483648; +pub const WCHAR_MAX: u32 = 2147483647; +pub const __GNUC_VA_LIST: u32 = 1; +pub const RENAME_SECLUDE: u32 = 1; +pub const RENAME_SWAP: u32 = 2; +pub const RENAME_EXCL: u32 = 4; +pub const __SLBF: u32 = 1; +pub const __SNBF: u32 = 2; +pub const __SRD: u32 = 4; +pub const __SWR: u32 = 8; +pub const __SRW: u32 = 16; +pub const __SEOF: u32 = 32; +pub const __SERR: u32 = 64; +pub const __SMBF: u32 = 128; +pub const __SAPP: u32 = 256; +pub const __SSTR: u32 = 512; +pub const __SOPT: u32 = 1024; +pub const __SNPT: u32 = 2048; +pub const __SOFF: u32 = 4096; +pub const __SMOD: u32 = 8192; +pub const __SALC: u32 = 16384; +pub const __SIGN: u32 = 32768; +pub const _IOFBF: u32 = 0; +pub const _IOLBF: u32 = 1; +pub const _IONBF: u32 = 2; +pub const BUFSIZ: u32 = 1024; +pub const EOF: i32 = -1; +pub const FOPEN_MAX: u32 = 20; +pub const FILENAME_MAX: u32 = 1024; +pub const P_tmpdir: &'static [u8; 10usize] = b"/var/tmp/\0"; +pub const L_tmpnam: u32 = 1024; +pub const TMP_MAX: u32 = 308915776; +pub const SEEK_SET: u32 = 0; +pub const SEEK_CUR: u32 = 1; +pub const SEEK_END: u32 = 2; +pub const L_ctermid: u32 = 1024; +pub const __CTERMID_DEFINED: u32 = 1; +pub const _USE_FORTIFY_LEVEL: u32 = 2; +pub const CLOCKS_PER_SEC: u32 = 1000000; +pub const _CACHED_RUNES: u32 = 256; +pub const _CRMASK: i32 = -256; +pub const _RUNE_MAGIC_A: &'static [u8; 9usize] = b"RuneMagA\0"; +pub const _CTYPE_A: u32 = 256; +pub const _CTYPE_C: u32 = 512; +pub const _CTYPE_D: u32 = 1024; +pub const _CTYPE_G: u32 = 2048; +pub const _CTYPE_L: u32 = 4096; +pub const _CTYPE_P: u32 = 8192; +pub const _CTYPE_S: u32 = 16384; +pub const _CTYPE_U: u32 = 32768; +pub const _CTYPE_X: u32 = 65536; +pub const _CTYPE_B: u32 = 131072; +pub const _CTYPE_R: u32 = 262144; +pub const _CTYPE_I: u32 = 524288; +pub const _CTYPE_T: u32 = 1048576; +pub const _CTYPE_Q: u32 = 2097152; +pub const _CTYPE_SW0: u32 = 536870912; +pub const _CTYPE_SW1: u32 = 1073741824; +pub const _CTYPE_SW2: u32 = 2147483648; +pub const _CTYPE_SW3: u32 = 3221225472; +pub const _CTYPE_SWM: u32 = 3758096384; +pub const _CTYPE_SWS: u32 = 30; +pub const __WORDSIZE: u32 = 64; +pub const INT8_MAX: u32 = 127; +pub const INT16_MAX: u32 = 32767; +pub const INT32_MAX: u32 = 2147483647; +pub const INT64_MAX: u64 = 9223372036854775807; +pub const INT8_MIN: i32 = -128; +pub const INT16_MIN: i32 = -32768; +pub const INT32_MIN: i32 = -2147483648; +pub const INT64_MIN: i64 = -9223372036854775808; +pub const UINT8_MAX: u32 = 255; +pub const UINT16_MAX: u32 = 65535; +pub const UINT32_MAX: u32 = 4294967295; +pub const UINT64_MAX: i32 = -1; +pub const INT_LEAST8_MIN: i32 = -128; +pub const INT_LEAST16_MIN: i32 = -32768; +pub const INT_LEAST32_MIN: i32 = -2147483648; +pub const INT_LEAST64_MIN: i64 = -9223372036854775808; +pub const INT_LEAST8_MAX: u32 = 127; +pub const INT_LEAST16_MAX: u32 = 32767; +pub const INT_LEAST32_MAX: u32 = 2147483647; +pub const INT_LEAST64_MAX: u64 = 9223372036854775807; +pub const UINT_LEAST8_MAX: u32 = 255; +pub const UINT_LEAST16_MAX: u32 = 65535; +pub const UINT_LEAST32_MAX: u32 = 4294967295; +pub const UINT_LEAST64_MAX: i32 = -1; +pub const INT_FAST8_MIN: i32 = -128; +pub const INT_FAST16_MIN: i32 = -32768; +pub const INT_FAST32_MIN: i32 = -2147483648; +pub const INT_FAST64_MIN: i64 = -9223372036854775808; +pub const INT_FAST8_MAX: u32 = 127; +pub const INT_FAST16_MAX: u32 = 32767; +pub const INT_FAST32_MAX: u32 = 2147483647; +pub const INT_FAST64_MAX: u64 = 9223372036854775807; +pub const UINT_FAST8_MAX: u32 = 255; +pub const UINT_FAST16_MAX: u32 = 65535; +pub const UINT_FAST32_MAX: u32 = 4294967295; +pub const UINT_FAST64_MAX: i32 = -1; +pub const INTPTR_MAX: u64 = 9223372036854775807; +pub const INTPTR_MIN: i64 = -9223372036854775808; +pub const UINTPTR_MAX: i32 = -1; +pub const INTMAX_MIN: i64 = -9223372036854775808; +pub const INTMAX_MAX: u64 = 9223372036854775807; +pub const UINTMAX_MAX: i32 = -1; +pub const PTRDIFF_MIN: i64 = -9223372036854775808; +pub const PTRDIFF_MAX: u64 = 9223372036854775807; +pub const SIZE_MAX: i32 = -1; +pub const RSIZE_MAX: i32 = -1; +pub const WINT_MIN: i32 = -2147483648; +pub const WINT_MAX: u32 = 2147483647; +pub const SIG_ATOMIC_MIN: i32 = -2147483648; +pub const SIG_ATOMIC_MAX: u32 = 2147483647; +pub const true_: u32 = 1; +pub const false_: u32 = 0; +pub const __bool_true_false_are_defined: u32 = 1; +pub const TCOD_MAJOR_VERSION: u32 = 1; +pub const TCOD_MINOR_VERSION: u32 = 16; +pub const TCOD_PATCHLEVEL: u32 = 0; +pub const TCOD_STRVERSION: &'static [u8; 16usize] = b"1.16.0-alpha.12\0"; +pub const TCOD_HEXVERSION: u32 = 69632; +pub const TCOD_TECHVERSION: u32 = 17825792; +pub const TCOD_STRVERSIONNAME: &'static [u8; 24usize] = b"libtcod 1.16.0-alpha.12\0"; +pub const TCOD_KEY_TEXT_SIZE: u32 = 32; +pub const TCOD_NOISE_MAX_OCTAVES: u32 = 128; +pub const TCOD_NOISE_MAX_DIMENSIONS: u32 = 4; +pub const TCOD_NOISE_DEFAULT_HURST: f64 = 0.5; +pub const TCOD_NOISE_DEFAULT_LACUNARITY: f64 = 2.0; +pub const TCOD_LEX_FLAG_NOCASE: u32 = 1; +pub const TCOD_LEX_FLAG_NESTING_COMMENT: u32 = 2; +pub const TCOD_LEX_FLAG_TOKENIZE_COMMENTS: u32 = 4; +pub const TCOD_LEX_ERROR: i32 = -1; +pub const TCOD_LEX_UNKNOWN: u32 = 0; +pub const TCOD_LEX_SYMBOL: u32 = 1; +pub const TCOD_LEX_KEYWORD: u32 = 2; +pub const TCOD_LEX_IDEN: u32 = 3; +pub const TCOD_LEX_STRING: u32 = 4; +pub const TCOD_LEX_INTEGER: u32 = 5; +pub const TCOD_LEX_FLOAT: u32 = 6; +pub const TCOD_LEX_CHAR: u32 = 7; +pub const TCOD_LEX_EOF: u32 = 8; +pub const TCOD_LEX_COMMENT: u32 = 9; +pub const TCOD_LEX_MAX_SYMBOLS: u32 = 100; +pub const TCOD_LEX_SYMBOL_SIZE: u32 = 5; +pub const TCOD_LEX_MAX_KEYWORDS: u32 = 100; +pub const TCOD_LEX_KEYWORD_SIZE: u32 = 20; +pub const TCOD_HEAP_DEFAULT_CAPACITY: u32 = 256; +pub const TCOD_HEAP_MAX_NODE_SIZE: u32 = 256; +pub const TCOD_PATHFINDER_MAX_DIMENSIONS: u32 = 4; +pub type __int8_t = ::std::os::raw::c_schar; +pub type __uint8_t = ::std::os::raw::c_uchar; +pub type __int16_t = ::std::os::raw::c_short; +pub type __uint16_t = ::std::os::raw::c_ushort; +pub type __int32_t = ::std::os::raw::c_int; +pub type __uint32_t = ::std::os::raw::c_uint; +pub type __int64_t = ::std::os::raw::c_longlong; +pub type __uint64_t = ::std::os::raw::c_ulonglong; +pub type __darwin_intptr_t = ::std::os::raw::c_long; +pub type __darwin_natural_t = ::std::os::raw::c_uint; +pub type __darwin_ct_rune_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub union __mbstate_t { + pub __mbstate8: [::std::os::raw::c_char; 128usize], + pub _mbstateL: ::std::os::raw::c_longlong, + _bindgen_union_align: [u64; 16usize], +} +#[test] +fn bindgen_test_layout___mbstate_t() { + assert_eq!( + ::std::mem::size_of::<__mbstate_t>(), + 128usize, + concat!("Size of: ", stringify!(__mbstate_t)) + ); + assert_eq!( + ::std::mem::align_of::<__mbstate_t>(), + 8usize, + concat!("Alignment of ", stringify!(__mbstate_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__mbstate_t>())).__mbstate8 as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__mbstate_t), + "::", + stringify!(__mbstate8) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__mbstate_t>()))._mbstateL as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__mbstate_t), + "::", + stringify!(_mbstateL) + ) + ); +} +impl Default for __mbstate_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type __darwin_mbstate_t = __mbstate_t; +pub type __darwin_ptrdiff_t = ::std::os::raw::c_long; +pub type __darwin_size_t = ::std::os::raw::c_ulong; +pub type __darwin_va_list = __builtin_va_list; +pub type __darwin_wchar_t = ::std::os::raw::c_int; +pub type __darwin_rune_t = __darwin_wchar_t; +pub type __darwin_wint_t = ::std::os::raw::c_int; +pub type __darwin_clock_t = ::std::os::raw::c_ulong; +pub type __darwin_socklen_t = __uint32_t; +pub type __darwin_ssize_t = ::std::os::raw::c_long; +pub type __darwin_time_t = ::std::os::raw::c_long; +pub type __darwin_blkcnt_t = __int64_t; +pub type __darwin_blksize_t = __int32_t; +pub type __darwin_dev_t = __int32_t; +pub type __darwin_fsblkcnt_t = ::std::os::raw::c_uint; +pub type __darwin_fsfilcnt_t = ::std::os::raw::c_uint; +pub type __darwin_gid_t = __uint32_t; +pub type __darwin_id_t = __uint32_t; +pub type __darwin_ino64_t = __uint64_t; +pub type __darwin_ino_t = __darwin_ino64_t; +pub type __darwin_mach_port_name_t = __darwin_natural_t; +pub type __darwin_mach_port_t = __darwin_mach_port_name_t; +pub type __darwin_mode_t = __uint16_t; +pub type __darwin_off_t = __int64_t; +pub type __darwin_pid_t = __int32_t; +pub type __darwin_sigset_t = __uint32_t; +pub type __darwin_suseconds_t = __int32_t; +pub type __darwin_uid_t = __uint32_t; +pub type __darwin_useconds_t = __uint32_t; +pub type __darwin_uuid_t = [::std::os::raw::c_uchar; 16usize]; +pub type __darwin_uuid_string_t = [::std::os::raw::c_char; 37usize]; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_pthread_handler_rec { + pub __routine: ::std::option::Option, + pub __arg: *mut ::std::os::raw::c_void, + pub __next: *mut __darwin_pthread_handler_rec, +} +#[test] +fn bindgen_test_layout___darwin_pthread_handler_rec() { + assert_eq!( + ::std::mem::size_of::<__darwin_pthread_handler_rec>(), + 24usize, + concat!("Size of: ", stringify!(__darwin_pthread_handler_rec)) + ); + assert_eq!( + ::std::mem::align_of::<__darwin_pthread_handler_rec>(), + 8usize, + concat!("Alignment of ", stringify!(__darwin_pthread_handler_rec)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__darwin_pthread_handler_rec>())).__routine as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__darwin_pthread_handler_rec), + "::", + stringify!(__routine) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__darwin_pthread_handler_rec>())).__arg as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__darwin_pthread_handler_rec), + "::", + stringify!(__arg) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<__darwin_pthread_handler_rec>())).__next as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(__darwin_pthread_handler_rec), + "::", + stringify!(__next) + ) + ); +} +impl Default for __darwin_pthread_handler_rec { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _opaque_pthread_attr_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 56usize], +} +#[test] +fn bindgen_test_layout__opaque_pthread_attr_t() { + assert_eq!( + ::std::mem::size_of::<_opaque_pthread_attr_t>(), + 64usize, + concat!("Size of: ", stringify!(_opaque_pthread_attr_t)) + ); + assert_eq!( + ::std::mem::align_of::<_opaque_pthread_attr_t>(), + 8usize, + concat!("Alignment of ", stringify!(_opaque_pthread_attr_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_opaque_pthread_attr_t>())).__sig as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_attr_t), + "::", + stringify!(__sig) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_opaque_pthread_attr_t>())).__opaque as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_attr_t), + "::", + stringify!(__opaque) + ) + ); +} +impl Default for _opaque_pthread_attr_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _opaque_pthread_cond_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 40usize], +} +#[test] +fn bindgen_test_layout__opaque_pthread_cond_t() { + assert_eq!( + ::std::mem::size_of::<_opaque_pthread_cond_t>(), + 48usize, + concat!("Size of: ", stringify!(_opaque_pthread_cond_t)) + ); + assert_eq!( + ::std::mem::align_of::<_opaque_pthread_cond_t>(), + 8usize, + concat!("Alignment of ", stringify!(_opaque_pthread_cond_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_opaque_pthread_cond_t>())).__sig as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_cond_t), + "::", + stringify!(__sig) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_opaque_pthread_cond_t>())).__opaque as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_cond_t), + "::", + stringify!(__opaque) + ) + ); +} +impl Default for _opaque_pthread_cond_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _opaque_pthread_condattr_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 8usize], +} +#[test] +fn bindgen_test_layout__opaque_pthread_condattr_t() { + assert_eq!( + ::std::mem::size_of::<_opaque_pthread_condattr_t>(), + 16usize, + concat!("Size of: ", stringify!(_opaque_pthread_condattr_t)) + ); + assert_eq!( + ::std::mem::align_of::<_opaque_pthread_condattr_t>(), + 8usize, + concat!("Alignment of ", stringify!(_opaque_pthread_condattr_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_opaque_pthread_condattr_t>())).__sig as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_condattr_t), + "::", + stringify!(__sig) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_opaque_pthread_condattr_t>())).__opaque as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_condattr_t), + "::", + stringify!(__opaque) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _opaque_pthread_mutex_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 56usize], +} +#[test] +fn bindgen_test_layout__opaque_pthread_mutex_t() { + assert_eq!( + ::std::mem::size_of::<_opaque_pthread_mutex_t>(), + 64usize, + concat!("Size of: ", stringify!(_opaque_pthread_mutex_t)) + ); + assert_eq!( + ::std::mem::align_of::<_opaque_pthread_mutex_t>(), + 8usize, + concat!("Alignment of ", stringify!(_opaque_pthread_mutex_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_opaque_pthread_mutex_t>())).__sig as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_mutex_t), + "::", + stringify!(__sig) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_opaque_pthread_mutex_t>())).__opaque as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_mutex_t), + "::", + stringify!(__opaque) + ) + ); +} +impl Default for _opaque_pthread_mutex_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _opaque_pthread_mutexattr_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 8usize], +} +#[test] +fn bindgen_test_layout__opaque_pthread_mutexattr_t() { + assert_eq!( + ::std::mem::size_of::<_opaque_pthread_mutexattr_t>(), + 16usize, + concat!("Size of: ", stringify!(_opaque_pthread_mutexattr_t)) + ); + assert_eq!( + ::std::mem::align_of::<_opaque_pthread_mutexattr_t>(), + 8usize, + concat!("Alignment of ", stringify!(_opaque_pthread_mutexattr_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_opaque_pthread_mutexattr_t>())).__sig as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_mutexattr_t), + "::", + stringify!(__sig) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_opaque_pthread_mutexattr_t>())).__opaque as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_mutexattr_t), + "::", + stringify!(__opaque) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _opaque_pthread_once_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 8usize], +} +#[test] +fn bindgen_test_layout__opaque_pthread_once_t() { + assert_eq!( + ::std::mem::size_of::<_opaque_pthread_once_t>(), + 16usize, + concat!("Size of: ", stringify!(_opaque_pthread_once_t)) + ); + assert_eq!( + ::std::mem::align_of::<_opaque_pthread_once_t>(), + 8usize, + concat!("Alignment of ", stringify!(_opaque_pthread_once_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_opaque_pthread_once_t>())).__sig as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_once_t), + "::", + stringify!(__sig) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_opaque_pthread_once_t>())).__opaque as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_once_t), + "::", + stringify!(__opaque) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _opaque_pthread_rwlock_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 192usize], +} +#[test] +fn bindgen_test_layout__opaque_pthread_rwlock_t() { + assert_eq!( + ::std::mem::size_of::<_opaque_pthread_rwlock_t>(), + 200usize, + concat!("Size of: ", stringify!(_opaque_pthread_rwlock_t)) + ); + assert_eq!( + ::std::mem::align_of::<_opaque_pthread_rwlock_t>(), + 8usize, + concat!("Alignment of ", stringify!(_opaque_pthread_rwlock_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_opaque_pthread_rwlock_t>())).__sig as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_rwlock_t), + "::", + stringify!(__sig) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_opaque_pthread_rwlock_t>())).__opaque as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_rwlock_t), + "::", + stringify!(__opaque) + ) + ); +} +impl Default for _opaque_pthread_rwlock_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _opaque_pthread_rwlockattr_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 16usize], +} +#[test] +fn bindgen_test_layout__opaque_pthread_rwlockattr_t() { + assert_eq!( + ::std::mem::size_of::<_opaque_pthread_rwlockattr_t>(), + 24usize, + concat!("Size of: ", stringify!(_opaque_pthread_rwlockattr_t)) + ); + assert_eq!( + ::std::mem::align_of::<_opaque_pthread_rwlockattr_t>(), + 8usize, + concat!("Alignment of ", stringify!(_opaque_pthread_rwlockattr_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_opaque_pthread_rwlockattr_t>())).__sig as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_rwlockattr_t), + "::", + stringify!(__sig) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_opaque_pthread_rwlockattr_t>())).__opaque as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_rwlockattr_t), + "::", + stringify!(__opaque) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _opaque_pthread_t { + pub __sig: ::std::os::raw::c_long, + pub __cleanup_stack: *mut __darwin_pthread_handler_rec, + pub __opaque: [::std::os::raw::c_char; 8176usize], +} +#[test] +fn bindgen_test_layout__opaque_pthread_t() { + assert_eq!( + ::std::mem::size_of::<_opaque_pthread_t>(), + 8192usize, + concat!("Size of: ", stringify!(_opaque_pthread_t)) + ); + assert_eq!( + ::std::mem::align_of::<_opaque_pthread_t>(), + 8usize, + concat!("Alignment of ", stringify!(_opaque_pthread_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_opaque_pthread_t>())).__sig as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_t), + "::", + stringify!(__sig) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_opaque_pthread_t>())).__cleanup_stack as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_t), + "::", + stringify!(__cleanup_stack) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_opaque_pthread_t>())).__opaque as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_opaque_pthread_t), + "::", + stringify!(__opaque) + ) + ); +} +impl Default for _opaque_pthread_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type __darwin_pthread_attr_t = _opaque_pthread_attr_t; +pub type __darwin_pthread_cond_t = _opaque_pthread_cond_t; +pub type __darwin_pthread_condattr_t = _opaque_pthread_condattr_t; +pub type __darwin_pthread_key_t = ::std::os::raw::c_ulong; +pub type __darwin_pthread_mutex_t = _opaque_pthread_mutex_t; +pub type __darwin_pthread_mutexattr_t = _opaque_pthread_mutexattr_t; +pub type __darwin_pthread_once_t = _opaque_pthread_once_t; +pub type __darwin_pthread_rwlock_t = _opaque_pthread_rwlock_t; +pub type __darwin_pthread_rwlockattr_t = _opaque_pthread_rwlockattr_t; +pub type __darwin_pthread_t = *mut _opaque_pthread_t; +pub type __darwin_nl_item = ::std::os::raw::c_int; +pub type __darwin_wctrans_t = ::std::os::raw::c_int; +pub type __darwin_wctype_t = __uint32_t; +pub type size_t = __darwin_size_t; +pub type u_int8_t = ::std::os::raw::c_uchar; +pub type u_int16_t = ::std::os::raw::c_ushort; +pub type u_int32_t = ::std::os::raw::c_uint; +pub type u_int64_t = ::std::os::raw::c_ulonglong; +pub type register_t = i64; +pub type user_addr_t = u_int64_t; +pub type user_size_t = u_int64_t; +pub type user_ssize_t = i64; +pub type user_long_t = i64; +pub type user_ulong_t = u_int64_t; +pub type user_time_t = i64; +pub type user_off_t = i64; +pub type syscall_arg_t = u_int64_t; +pub type mbstate_t = __darwin_mbstate_t; +pub type ct_rune_t = __darwin_ct_rune_t; +pub type rune_t = __darwin_rune_t; +pub type wchar_t = __darwin_wchar_t; +pub type va_list = __builtin_va_list; +pub type __gnuc_va_list = __builtin_va_list; +extern "C" { + pub fn renameat( + arg1: ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn renamex_np( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn renameatx_np( + arg1: ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: *const ::std::os::raw::c_char, + arg5: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +pub type fpos_t = __darwin_off_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __sbuf { + pub _base: *mut ::std::os::raw::c_uchar, + pub _size: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout___sbuf() { + assert_eq!( + ::std::mem::size_of::<__sbuf>(), + 16usize, + concat!("Size of: ", stringify!(__sbuf)) + ); + assert_eq!( + ::std::mem::align_of::<__sbuf>(), + 8usize, + concat!("Alignment of ", stringify!(__sbuf)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sbuf>()))._base as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__sbuf), + "::", + stringify!(_base) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sbuf>()))._size as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__sbuf), + "::", + stringify!(_size) + ) + ); +} +impl Default for __sbuf { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __sFILEX { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __sFILE { + pub _p: *mut ::std::os::raw::c_uchar, + pub _r: ::std::os::raw::c_int, + pub _w: ::std::os::raw::c_int, + pub _flags: ::std::os::raw::c_short, + pub _file: ::std::os::raw::c_short, + pub _bf: __sbuf, + pub _lbfsize: ::std::os::raw::c_int, + pub _cookie: *mut ::std::os::raw::c_void, + pub _close: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, + >, + pub _read: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, + pub _seek: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: fpos_t, + arg3: ::std::os::raw::c_int, + ) -> fpos_t, + >, + pub _write: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, + pub _ub: __sbuf, + pub _extra: *mut __sFILEX, + pub _ur: ::std::os::raw::c_int, + pub _ubuf: [::std::os::raw::c_uchar; 3usize], + pub _nbuf: [::std::os::raw::c_uchar; 1usize], + pub _lb: __sbuf, + pub _blksize: ::std::os::raw::c_int, + pub _offset: fpos_t, +} +#[test] +fn bindgen_test_layout___sFILE() { + assert_eq!( + ::std::mem::size_of::<__sFILE>(), + 152usize, + concat!("Size of: ", stringify!(__sFILE)) + ); + assert_eq!( + ::std::mem::align_of::<__sFILE>(), + 8usize, + concat!("Alignment of ", stringify!(__sFILE)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._p as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_p) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._r as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_r) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._w as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._flags as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._file as *const _ as usize }, + 18usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_file) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._bf as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_bf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._lbfsize as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_lbfsize) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._cookie as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_cookie) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._close as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_close) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._read as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_read) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._seek as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_seek) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._write as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_write) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._ub as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_ub) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._extra as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_extra) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._ur as *const _ as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_ur) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._ubuf as *const _ as usize }, + 116usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_ubuf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._nbuf as *const _ as usize }, + 119usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_nbuf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._lb as *const _ as usize }, + 120usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_lb) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._blksize as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_blksize) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__sFILE>()))._offset as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(__sFILE), + "::", + stringify!(_offset) + ) + ); +} +impl Default for __sFILE { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type FILE = __sFILE; +extern "C" { + pub static mut __stdinp: *mut FILE; +} +extern "C" { + pub static mut __stdoutp: *mut FILE; +} +extern "C" { + pub static mut __stderrp: *mut FILE; +} +extern "C" { + pub fn clearerr(arg1: *mut FILE); +} +extern "C" { + pub fn fclose(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn feof(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ferror(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fflush(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgetc(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgetpos(arg1: *mut FILE, arg2: *mut fpos_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgets( + arg1: *mut ::std::os::raw::c_char, + arg2: ::std::os::raw::c_int, + arg3: *mut FILE, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn fopen( + __filename: *const ::std::os::raw::c_char, + __mode: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn fprintf( + arg1: *mut FILE, + arg2: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fputc(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fputs(arg1: *const ::std::os::raw::c_char, arg2: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fread( + __ptr: *mut ::std::os::raw::c_void, + __size: ::std::os::raw::c_ulong, + __nitems: ::std::os::raw::c_ulong, + __stream: *mut FILE, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn freopen( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: *mut FILE, + ) -> *mut FILE; +} +extern "C" { + pub fn fscanf( + arg1: *mut FILE, + arg2: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fseek( + arg1: *mut FILE, + arg2: ::std::os::raw::c_long, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fsetpos(arg1: *mut FILE, arg2: *const fpos_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ftell(arg1: *mut FILE) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn fwrite( + __ptr: *const ::std::os::raw::c_void, + __size: ::std::os::raw::c_ulong, + __nitems: ::std::os::raw::c_ulong, + __stream: *mut FILE, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn getc(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getchar() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn gets(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn perror(arg1: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn printf(arg1: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putc(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putchar(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn puts(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn remove(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rename( + __old: *const ::std::os::raw::c_char, + __new: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rewind(arg1: *mut FILE); +} +extern "C" { + pub fn scanf(arg1: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setbuf(arg1: *mut FILE, arg2: *mut ::std::os::raw::c_char); +} +extern "C" { + pub fn setvbuf( + arg1: *mut FILE, + arg2: *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sprintf( + arg1: *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sscanf( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn tmpfile() -> *mut FILE; +} +extern "C" { + pub fn tmpnam(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn ungetc(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vfprintf( + arg1: *mut FILE, + arg2: *const ::std::os::raw::c_char, + arg3: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vprintf( + arg1: *const ::std::os::raw::c_char, + arg2: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vsprintf( + arg1: *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ctermid(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn fdopen(arg1: ::std::os::raw::c_int, arg2: *const ::std::os::raw::c_char) -> *mut FILE; +} +extern "C" { + pub fn fileno(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn pclose(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn popen( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn __srget(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __svfscanf( + arg1: *mut FILE, + arg2: *const ::std::os::raw::c_char, + arg3: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __swbuf(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn flockfile(arg1: *mut FILE); +} +extern "C" { + pub fn ftrylockfile(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn funlockfile(arg1: *mut FILE); +} +extern "C" { + pub fn getc_unlocked(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getchar_unlocked() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putc_unlocked(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putchar_unlocked(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getw(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putw(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn tempnam( + __dir: *const ::std::os::raw::c_char, + __prefix: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +pub type off_t = __darwin_off_t; +extern "C" { + pub fn fseeko( + __stream: *mut FILE, + __offset: off_t, + __whence: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ftello(__stream: *mut FILE) -> off_t; +} +extern "C" { + pub fn snprintf( + __str: *mut ::std::os::raw::c_char, + __size: ::std::os::raw::c_ulong, + __format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vfscanf( + __stream: *mut FILE, + __format: *const ::std::os::raw::c_char, + arg1: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vscanf( + __format: *const ::std::os::raw::c_char, + arg1: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vsnprintf( + __str: *mut ::std::os::raw::c_char, + __size: ::std::os::raw::c_ulong, + __format: *const ::std::os::raw::c_char, + arg1: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vsscanf( + __str: *const ::std::os::raw::c_char, + __format: *const ::std::os::raw::c_char, + arg1: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +pub type ssize_t = __darwin_ssize_t; +extern "C" { + pub fn dprintf( + arg1: ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vdprintf( + arg1: ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_char, + arg3: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getdelim( + __linep: *mut *mut ::std::os::raw::c_char, + __linecapp: *mut size_t, + __delimiter: ::std::os::raw::c_int, + __stream: *mut FILE, + ) -> ssize_t; +} +extern "C" { + pub fn getline( + __linep: *mut *mut ::std::os::raw::c_char, + __linecapp: *mut size_t, + __stream: *mut FILE, + ) -> ssize_t; +} +extern "C" { + pub fn fmemopen( + __buf: *mut ::std::os::raw::c_void, + __size: size_t, + __mode: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn open_memstream( + __bufp: *mut *mut ::std::os::raw::c_char, + __sizep: *mut size_t, + ) -> *mut FILE; +} +extern "C" { + pub static sys_nerr: ::std::os::raw::c_int; +} +extern "C" { + pub static mut sys_errlist: [*const ::std::os::raw::c_char; 0usize]; +} +extern "C" { + pub fn asprintf( + arg1: *mut *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ctermid_r(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn fgetln(arg1: *mut FILE, arg2: *mut size_t) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn fmtcheck( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn fpurge(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setbuffer( + arg1: *mut FILE, + arg2: *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn setlinebuf(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vasprintf( + arg1: *mut *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn zopen( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> *mut FILE; +} +extern "C" { + pub fn funopen( + arg1: *const ::std::os::raw::c_void, + arg2: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, + arg3: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, + arg4: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: fpos_t, + arg3: ::std::os::raw::c_int, + ) -> fpos_t, + >, + arg5: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, + >, + ) -> *mut FILE; +} +extern "C" { + pub fn __sprintf_chk( + arg1: *mut ::std::os::raw::c_char, + arg2: ::std::os::raw::c_int, + arg3: size_t, + arg4: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __snprintf_chk( + arg1: *mut ::std::os::raw::c_char, + arg2: size_t, + arg3: ::std::os::raw::c_int, + arg4: size_t, + arg5: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __vsprintf_chk( + arg1: *mut ::std::os::raw::c_char, + arg2: ::std::os::raw::c_int, + arg3: size_t, + arg4: *const ::std::os::raw::c_char, + arg5: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __vsnprintf_chk( + arg1: *mut ::std::os::raw::c_char, + arg2: size_t, + arg3: ::std::os::raw::c_int, + arg4: size_t, + arg5: *const ::std::os::raw::c_char, + arg6: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +pub type clock_t = __darwin_clock_t; +pub type time_t = __darwin_time_t; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct timespec { + pub tv_sec: __darwin_time_t, + pub tv_nsec: ::std::os::raw::c_long, +} +#[test] +fn bindgen_test_layout_timespec() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(timespec)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(timespec)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timespec), + "::", + stringify!(tv_sec) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tv_nsec as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(timespec), + "::", + stringify!(tv_nsec) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tm { + pub tm_sec: ::std::os::raw::c_int, + pub tm_min: ::std::os::raw::c_int, + pub tm_hour: ::std::os::raw::c_int, + pub tm_mday: ::std::os::raw::c_int, + pub tm_mon: ::std::os::raw::c_int, + pub tm_year: ::std::os::raw::c_int, + pub tm_wday: ::std::os::raw::c_int, + pub tm_yday: ::std::os::raw::c_int, + pub tm_isdst: ::std::os::raw::c_int, + pub tm_gmtoff: ::std::os::raw::c_long, + pub tm_zone: *mut ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout_tm() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(tm)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(tm)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_sec as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_sec) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_min as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_min) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_hour as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_hour) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_mday as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mday) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_mon as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mon) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_year as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_year) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_wday as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_wday) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_yday as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_yday) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_isdst as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_isdst) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_gmtoff as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_gmtoff) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_zone as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_zone) + ) + ); +} +impl Default for tm { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub static mut tzname: [*mut ::std::os::raw::c_char; 0usize]; +} +extern "C" { + pub static mut getdate_err: ::std::os::raw::c_int; +} +extern "C" { + pub static mut timezone: ::std::os::raw::c_long; +} +extern "C" { + pub static mut daylight: ::std::os::raw::c_int; +} +extern "C" { + pub fn asctime(arg1: *const tm) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn clock() -> clock_t; +} +extern "C" { + pub fn ctime(arg1: *const time_t) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn difftime(arg1: time_t, arg2: time_t) -> f64; +} +extern "C" { + pub fn getdate(arg1: *const ::std::os::raw::c_char) -> *mut tm; +} +extern "C" { + pub fn gmtime(arg1: *const time_t) -> *mut tm; +} +extern "C" { + pub fn localtime(arg1: *const time_t) -> *mut tm; +} +extern "C" { + pub fn mktime(arg1: *mut tm) -> time_t; +} +extern "C" { + pub fn strftime( + arg1: *mut ::std::os::raw::c_char, + arg2: size_t, + arg3: *const ::std::os::raw::c_char, + arg4: *const tm, + ) -> size_t; +} +extern "C" { + pub fn strptime( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: *mut tm, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn time(arg1: *mut time_t) -> time_t; +} +extern "C" { + pub fn tzset(); +} +extern "C" { + pub fn asctime_r( + arg1: *const tm, + arg2: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn ctime_r( + arg1: *const time_t, + arg2: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn gmtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm; +} +extern "C" { + pub fn localtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm; +} +extern "C" { + pub fn posix2time(arg1: time_t) -> time_t; +} +extern "C" { + pub fn tzsetwall(); +} +extern "C" { + pub fn time2posix(arg1: time_t) -> time_t; +} +extern "C" { + pub fn timelocal(arg1: *mut tm) -> time_t; +} +extern "C" { + pub fn timegm(arg1: *mut tm) -> time_t; +} +extern "C" { + pub fn nanosleep(__rqtp: *const timespec, __rmtp: *mut timespec) -> ::std::os::raw::c_int; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum clockid_t { + _CLOCK_REALTIME = 0, + _CLOCK_MONOTONIC = 6, + _CLOCK_MONOTONIC_RAW = 4, + _CLOCK_MONOTONIC_RAW_APPROX = 5, + _CLOCK_UPTIME_RAW = 8, + _CLOCK_UPTIME_RAW_APPROX = 9, + _CLOCK_PROCESS_CPUTIME_ID = 12, + _CLOCK_THREAD_CPUTIME_ID = 16, +} +extern "C" { + pub fn clock_getres(__clock_id: clockid_t, __res: *mut timespec) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn clock_gettime(__clock_id: clockid_t, __tp: *mut timespec) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn clock_gettime_nsec_np(__clock_id: clockid_t) -> __uint64_t; +} +extern "C" { + pub fn clock_settime(__clock_id: clockid_t, __tp: *const timespec) -> ::std::os::raw::c_int; +} +pub type wint_t = __darwin_wint_t; +pub type wctype_t = __darwin_wctype_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RuneEntry { + pub __min: __darwin_rune_t, + pub __max: __darwin_rune_t, + pub __map: __darwin_rune_t, + pub __types: *mut __uint32_t, +} +#[test] +fn bindgen_test_layout__RuneEntry() { + assert_eq!( + ::std::mem::size_of::<_RuneEntry>(), + 24usize, + concat!("Size of: ", stringify!(_RuneEntry)) + ); + assert_eq!( + ::std::mem::align_of::<_RuneEntry>(), + 8usize, + concat!("Alignment of ", stringify!(_RuneEntry)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneEntry>())).__min as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_RuneEntry), + "::", + stringify!(__min) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneEntry>())).__max as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_RuneEntry), + "::", + stringify!(__max) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneEntry>())).__map as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_RuneEntry), + "::", + stringify!(__map) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneEntry>())).__types as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_RuneEntry), + "::", + stringify!(__types) + ) + ); +} +impl Default for _RuneEntry { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RuneRange { + pub __nranges: ::std::os::raw::c_int, + pub __ranges: *mut _RuneEntry, +} +#[test] +fn bindgen_test_layout__RuneRange() { + assert_eq!( + ::std::mem::size_of::<_RuneRange>(), + 16usize, + concat!("Size of: ", stringify!(_RuneRange)) + ); + assert_eq!( + ::std::mem::align_of::<_RuneRange>(), + 8usize, + concat!("Alignment of ", stringify!(_RuneRange)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneRange>())).__nranges as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_RuneRange), + "::", + stringify!(__nranges) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneRange>())).__ranges as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_RuneRange), + "::", + stringify!(__ranges) + ) + ); +} +impl Default for _RuneRange { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _RuneCharClass { + pub __name: [::std::os::raw::c_char; 14usize], + pub __mask: __uint32_t, +} +#[test] +fn bindgen_test_layout__RuneCharClass() { + assert_eq!( + ::std::mem::size_of::<_RuneCharClass>(), + 20usize, + concat!("Size of: ", stringify!(_RuneCharClass)) + ); + assert_eq!( + ::std::mem::align_of::<_RuneCharClass>(), + 4usize, + concat!("Alignment of ", stringify!(_RuneCharClass)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneCharClass>())).__name as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_RuneCharClass), + "::", + stringify!(__name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneCharClass>())).__mask as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_RuneCharClass), + "::", + stringify!(__mask) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _RuneLocale { + pub __magic: [::std::os::raw::c_char; 8usize], + pub __encoding: [::std::os::raw::c_char; 32usize], + pub __sgetrune: ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_char, + arg2: __darwin_size_t, + arg3: *mut *const ::std::os::raw::c_char, + ) -> __darwin_rune_t, + >, + pub __sputrune: ::std::option::Option< + unsafe extern "C" fn( + arg1: __darwin_rune_t, + arg2: *mut ::std::os::raw::c_char, + arg3: __darwin_size_t, + arg4: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int, + >, + pub __invalid_rune: __darwin_rune_t, + pub __runetype: [__uint32_t; 256usize], + pub __maplower: [__darwin_rune_t; 256usize], + pub __mapupper: [__darwin_rune_t; 256usize], + pub __runetype_ext: _RuneRange, + pub __maplower_ext: _RuneRange, + pub __mapupper_ext: _RuneRange, + pub __variable: *mut ::std::os::raw::c_void, + pub __variable_len: ::std::os::raw::c_int, + pub __ncharclasses: ::std::os::raw::c_int, + pub __charclasses: *mut _RuneCharClass, +} +#[test] +fn bindgen_test_layout__RuneLocale() { + assert_eq!( + ::std::mem::size_of::<_RuneLocale>(), + 3208usize, + concat!("Size of: ", stringify!(_RuneLocale)) + ); + assert_eq!( + ::std::mem::align_of::<_RuneLocale>(), + 8usize, + concat!("Alignment of ", stringify!(_RuneLocale)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__magic as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__magic) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__encoding as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__encoding) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__sgetrune as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__sgetrune) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__sputrune as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__sputrune) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__invalid_rune as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__invalid_rune) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__runetype as *const _ as usize }, + 60usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__runetype) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__maplower as *const _ as usize }, + 1084usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__maplower) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__mapupper as *const _ as usize }, + 2108usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__mapupper) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__runetype_ext as *const _ as usize }, + 3136usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__runetype_ext) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__maplower_ext as *const _ as usize }, + 3152usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__maplower_ext) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__mapupper_ext as *const _ as usize }, + 3168usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__mapupper_ext) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__variable as *const _ as usize }, + 3184usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__variable) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__variable_len as *const _ as usize }, + 3192usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__variable_len) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__ncharclasses as *const _ as usize }, + 3196usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__ncharclasses) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_RuneLocale>())).__charclasses as *const _ as usize }, + 3200usize, + concat!( + "Offset of field: ", + stringify!(_RuneLocale), + "::", + stringify!(__charclasses) + ) + ); +} +impl Default for _RuneLocale { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub static mut _DefaultRuneLocale: _RuneLocale; +} +extern "C" { + pub static mut _CurrentRuneLocale: *mut _RuneLocale; +} +extern "C" { + pub fn ___runetype(arg1: __darwin_ct_rune_t) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn ___tolower(arg1: __darwin_ct_rune_t) -> __darwin_ct_rune_t; +} +extern "C" { + pub fn ___toupper(arg1: __darwin_ct_rune_t) -> __darwin_ct_rune_t; +} +extern "C" { + pub fn __maskrune( + arg1: __darwin_ct_rune_t, + arg2: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __toupper(arg1: __darwin_ct_rune_t) -> __darwin_ct_rune_t; +} +extern "C" { + pub fn __tolower(arg1: __darwin_ct_rune_t) -> __darwin_ct_rune_t; +} +extern "C" { + pub fn wctype(arg1: *const ::std::os::raw::c_char) -> wctype_t; +} +extern "C" { + pub fn btowc(arg1: ::std::os::raw::c_int) -> wint_t; +} +extern "C" { + pub fn fgetwc(arg1: *mut FILE) -> wint_t; +} +extern "C" { + pub fn fgetws(arg1: *mut wchar_t, arg2: ::std::os::raw::c_int, arg3: *mut FILE) + -> *mut wchar_t; +} +extern "C" { + pub fn fputwc(arg1: wchar_t, arg2: *mut FILE) -> wint_t; +} +extern "C" { + pub fn fputws(arg1: *const wchar_t, arg2: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fwide(arg1: *mut FILE, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fwprintf(arg1: *mut FILE, arg2: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fwscanf(arg1: *mut FILE, arg2: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getwc(arg1: *mut FILE) -> wint_t; +} +extern "C" { + pub fn getwchar() -> wint_t; +} +extern "C" { + pub fn mbrlen( + arg1: *const ::std::os::raw::c_char, + arg2: size_t, + arg3: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn mbrtowc( + arg1: *mut wchar_t, + arg2: *const ::std::os::raw::c_char, + arg3: size_t, + arg4: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn mbsinit(arg1: *const mbstate_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mbsrtowcs( + arg1: *mut wchar_t, + arg2: *mut *const ::std::os::raw::c_char, + arg3: size_t, + arg4: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn putwc(arg1: wchar_t, arg2: *mut FILE) -> wint_t; +} +extern "C" { + pub fn putwchar(arg1: wchar_t) -> wint_t; +} +extern "C" { + pub fn swprintf( + arg1: *mut wchar_t, + arg2: size_t, + arg3: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn swscanf(arg1: *const wchar_t, arg2: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ungetwc(arg1: wint_t, arg2: *mut FILE) -> wint_t; +} +extern "C" { + pub fn vfwprintf( + arg1: *mut FILE, + arg2: *const wchar_t, + arg3: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vswprintf( + arg1: *mut wchar_t, + arg2: size_t, + arg3: *const wchar_t, + arg4: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vwprintf(arg1: *const wchar_t, arg2: *mut __va_list_tag) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcrtomb( + arg1: *mut ::std::os::raw::c_char, + arg2: wchar_t, + arg3: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wcscat(arg1: *mut wchar_t, arg2: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcschr( + arg1: *const ::std::os::raw::c_int, + arg2: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn wcscmp( + arg1: *const ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcscoll(arg1: *const wchar_t, arg2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcscpy(arg1: *mut wchar_t, arg2: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscspn(arg1: *const wchar_t, arg2: *const wchar_t) -> size_t; +} +extern "C" { + pub fn wcsftime( + arg1: *mut wchar_t, + arg2: size_t, + arg3: *const wchar_t, + arg4: *const tm, + ) -> size_t; +} +extern "C" { + pub fn wcslen(arg1: *const ::std::os::raw::c_int) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn wcsncat(arg1: *mut wchar_t, arg2: *const wchar_t, arg3: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsncmp( + arg1: *const ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_int, + arg3: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsncpy(arg1: *mut wchar_t, arg2: *const wchar_t, arg3: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcspbrk(arg1: *const wchar_t, arg2: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsrchr(arg1: *const wchar_t, arg2: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsrtombs( + arg1: *mut ::std::os::raw::c_char, + arg2: *mut *const wchar_t, + arg3: size_t, + arg4: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wcsspn(arg1: *const wchar_t, arg2: *const wchar_t) -> size_t; +} +extern "C" { + pub fn wcsstr(arg1: *const wchar_t, arg2: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsxfrm(arg1: *mut wchar_t, arg2: *const wchar_t, arg3: size_t) -> size_t; +} +extern "C" { + pub fn wctob(arg1: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcstod(arg1: *const wchar_t, arg2: *mut *mut wchar_t) -> f64; +} +extern "C" { + pub fn wcstok( + arg1: *mut wchar_t, + arg2: *const wchar_t, + arg3: *mut *mut wchar_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn wcstol( + arg1: *const wchar_t, + arg2: *mut *mut wchar_t, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn wcstoul( + arg1: *const wchar_t, + arg2: *mut *mut wchar_t, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn wmemchr( + arg1: *const ::std::os::raw::c_int, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn wmemcmp( + arg1: *const ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_int, + arg3: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wmemcpy( + arg1: *mut ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_int, + arg3: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn wmemmove( + arg1: *mut ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_int, + arg3: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn wmemset(arg1: *mut wchar_t, arg2: wchar_t, arg3: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wprintf(arg1: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wscanf(arg1: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcswidth(arg1: *const wchar_t, arg2: size_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcwidth(arg1: wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vfwscanf( + arg1: *mut FILE, + arg2: *const wchar_t, + arg3: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vswscanf( + arg1: *const wchar_t, + arg2: *const wchar_t, + arg3: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vwscanf(arg1: *const wchar_t, arg2: *mut __va_list_tag) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcstof(arg1: *const wchar_t, arg2: *mut *mut wchar_t) -> f32; +} +extern "C" { + pub fn wcstold(arg1: *const wchar_t, arg2: *mut *mut wchar_t) -> u128; +} +extern "C" { + pub fn wcstoll( + arg1: *const wchar_t, + arg2: *mut *mut wchar_t, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn wcstoull( + arg1: *const wchar_t, + arg2: *mut *mut wchar_t, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn mbsnrtowcs( + arg1: *mut wchar_t, + arg2: *mut *const ::std::os::raw::c_char, + arg3: size_t, + arg4: size_t, + arg5: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wcpcpy(arg1: *mut wchar_t, arg2: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcpncpy(arg1: *mut wchar_t, arg2: *const wchar_t, arg3: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsdup(arg1: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscasecmp(arg1: *const wchar_t, arg2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsncasecmp( + arg1: *const wchar_t, + arg2: *const wchar_t, + n: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsnlen(arg1: *const wchar_t, arg2: size_t) -> size_t; +} +extern "C" { + pub fn wcsnrtombs( + arg1: *mut ::std::os::raw::c_char, + arg2: *mut *const wchar_t, + arg3: size_t, + arg4: size_t, + arg5: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn open_wmemstream(__bufp: *mut *mut wchar_t, __sizep: *mut size_t) -> *mut FILE; +} +extern "C" { + pub fn fgetwln(arg1: *mut FILE, arg2: *mut size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcslcat(arg1: *mut wchar_t, arg2: *const wchar_t, arg3: size_t) -> size_t; +} +extern "C" { + pub fn wcslcpy(arg1: *mut wchar_t, arg2: *const wchar_t, arg3: size_t) -> size_t; +} +pub type int_least8_t = i8; +pub type int_least16_t = i16; +pub type int_least32_t = i32; +pub type int_least64_t = i64; +pub type uint_least8_t = u8; +pub type uint_least16_t = u16; +pub type uint_least32_t = u32; +pub type uint_least64_t = u64; +pub type int_fast8_t = i8; +pub type int_fast16_t = i16; +pub type int_fast32_t = i32; +pub type int_fast64_t = i64; +pub type uint_fast8_t = u8; +pub type uint_fast16_t = u16; +pub type uint_fast32_t = u32; +pub type uint_fast64_t = u64; +pub type intmax_t = ::std::os::raw::c_long; +pub type uintmax_t = ::std::os::raw::c_ulong; +extern "C" { + pub fn TCOD_strdup(s: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_strcasecmp( + s1: *const ::std::os::raw::c_char, + s2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_strncasecmp( + s1: *const ::std::os::raw::c_char, + s2: *const ::std::os::raw::c_char, + n: size_t, + ) -> ::std::os::raw::c_int; +} +#[doc = " \\brief A callback to be passed to TCOD_line"] +#[doc = ""] +#[doc = " The points given to the callback include both the starting and ending"] +#[doc = " positions."] +#[doc = ""] +#[doc = " \\param x"] +#[doc = " \\param y"] +#[doc = " \\return As long as this callback returns true it will be called with the"] +#[doc = " next x,y point on the line."] +pub type TCOD_line_listener_t = ::std::option::Option< + unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> bool, +>; +extern "C" { + pub fn TCOD_line_init( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_line_step( + xCur: *mut ::std::os::raw::c_int, + yCur: *mut ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_line( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + listener: TCOD_line_listener_t, + ) -> bool; +} +#[doc = " \\brief A struct used for computing a bresenham line."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_bresenham_data_t { + pub stepx: ::std::os::raw::c_int, + pub stepy: ::std::os::raw::c_int, + pub e: ::std::os::raw::c_int, + pub deltax: ::std::os::raw::c_int, + pub deltay: ::std::os::raw::c_int, + pub origx: ::std::os::raw::c_int, + pub origy: ::std::os::raw::c_int, + pub destx: ::std::os::raw::c_int, + pub desty: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_bresenham_data_t() { + assert_eq!( + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(TCOD_bresenham_data_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_bresenham_data_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stepx as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(stepx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stepy as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(stepy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).e as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(e) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).deltax as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(deltax) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).deltay as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(deltay) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).origx as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(origx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).origy as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(origy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).destx as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(destx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).desty as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(desty) + ) + ); +} +extern "C" { + pub fn TCOD_line_init_mt( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + data: *mut TCOD_bresenham_data_t, + ); +} +extern "C" { + pub fn TCOD_line_step_mt( + xCur: *mut ::std::os::raw::c_int, + yCur: *mut ::std::os::raw::c_int, + data: *mut TCOD_bresenham_data_t, + ) -> bool; +} +extern "C" { + pub fn TCOD_line_mt( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + listener: TCOD_line_listener_t, + data: *mut TCOD_bresenham_data_t, + ) -> bool; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Random { + _unused: [u8; 0], +} +pub type TCOD_random_t = *mut TCOD_Random; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_dice_t { + pub nb_rolls: ::std::os::raw::c_int, + pub nb_faces: ::std::os::raw::c_int, + pub multiplier: f32, + pub addsub: f32, +} +#[test] +fn bindgen_test_layout_TCOD_dice_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_dice_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_dice_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_rolls as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(nb_rolls) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_faces as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(nb_faces) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).multiplier as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(multiplier) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).addsub as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(addsub) + ) + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_random_algo_t { + TCOD_RNG_MT = 0, + TCOD_RNG_CMWC = 1, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_distribution_t { + TCOD_DISTRIBUTION_LINEAR = 0, + TCOD_DISTRIBUTION_GAUSSIAN = 1, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE = 2, + TCOD_DISTRIBUTION_GAUSSIAN_INVERSE = 3, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE = 4, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TCOD_tree_t { + pub next: *mut _TCOD_tree_t, + pub father: *mut _TCOD_tree_t, + pub sons: *mut _TCOD_tree_t, +} +#[test] +fn bindgen_test_layout__TCOD_tree_t() { + assert_eq!( + ::std::mem::size_of::<_TCOD_tree_t>(), + 24usize, + concat!("Size of: ", stringify!(_TCOD_tree_t)) + ); + assert_eq!( + ::std::mem::align_of::<_TCOD_tree_t>(), + 8usize, + concat!("Alignment of ", stringify!(_TCOD_tree_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).next as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).father as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(father) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).sons as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(sons) + ) + ); +} +impl Default for _TCOD_tree_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_tree_t = _TCOD_tree_t; +extern "C" { + pub fn TCOD_tree_new() -> *mut TCOD_tree_t; +} +extern "C" { + pub fn TCOD_tree_add_son(node: *mut TCOD_tree_t, son: *mut TCOD_tree_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_bsp_t { + pub tree: TCOD_tree_t, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub w: ::std::os::raw::c_int, + pub h: ::std::os::raw::c_int, + pub position: ::std::os::raw::c_int, + pub level: u8, + pub horizontal: bool, +} +#[test] +fn bindgen_test_layout_TCOD_bsp_t() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(TCOD_bsp_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_bsp_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tree as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(tree) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(position) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).level as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(level) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).horizontal as *const _ as usize }, + 45usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(horizontal) + ) + ); +} +impl Default for TCOD_bsp_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_bsp_callback_t = ::std::option::Option< + unsafe extern "C" fn(node: *mut TCOD_bsp_t, userData: *mut ::std::os::raw::c_void) -> bool, +>; +extern "C" { + pub fn TCOD_bsp_new() -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_new_with_size( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_delete(node: *mut TCOD_bsp_t); +} +extern "C" { + pub fn TCOD_bsp_left(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_right(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_father(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_is_leaf(node: *mut TCOD_bsp_t) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_pre_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_in_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_post_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_level_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_inverted_level_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_contains( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_find_node( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_resize( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_bsp_split_once( + node: *mut TCOD_bsp_t, + horizontal: bool, + position: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_bsp_split_recursive( + node: *mut TCOD_bsp_t, + randomizer: TCOD_random_t, + nb: ::std::os::raw::c_int, + minHSize: ::std::os::raw::c_int, + minVSize: ::std::os::raw::c_int, + maxHRatio: f32, + maxVRatio: f32, + ); +} +extern "C" { + pub fn TCOD_bsp_remove_sons(node: *mut TCOD_bsp_t); +} +#[doc = " A three channel color struct."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ColorRGB { + pub r: u8, + pub g: u8, + pub b: u8, +} +#[test] +fn bindgen_test_layout_TCOD_ColorRGB() { + assert_eq!( + ::std::mem::size_of::(), + 3usize, + concat!("Size of: ", stringify!(TCOD_ColorRGB)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_ColorRGB)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGB), + "::", + stringify!(r) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGB), + "::", + stringify!(g) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGB), + "::", + stringify!(b) + ) + ); +} +pub type TCOD_color_t = TCOD_ColorRGB; +#[doc = " A four channel color struct."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ColorRGBA { + pub r: u8, + pub g: u8, + pub b: u8, + pub a: u8, +} +#[test] +fn bindgen_test_layout_TCOD_ColorRGBA() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(TCOD_ColorRGBA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_ColorRGBA)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGBA), + "::", + stringify!(r) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGBA), + "::", + stringify!(g) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGBA), + "::", + stringify!(b) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGBA), + "::", + stringify!(a) + ) + ); +} +extern "C" { + pub fn TCOD_color_RGB(r: u8, g: u8, b: u8) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_HSV(hue: f32, saturation: f32, value: f32) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_equals(c1: TCOD_color_t, c2: TCOD_color_t) -> bool; +} +extern "C" { + pub fn TCOD_color_add(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_subtract(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_multiply(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_multiply_scalar(c1: TCOD_color_t, value: f32) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_lerp(c1: TCOD_color_t, c2: TCOD_color_t, coef: f32) -> TCOD_color_t; +} +extern "C" { + #[doc = " Blend `src` into `dst` as an alpha blending operation."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_color_alpha_blend(dst: *mut TCOD_ColorRGBA, src: *const TCOD_ColorRGBA); +} +extern "C" { + pub fn TCOD_color_set_HSV(color: *mut TCOD_color_t, hue: f32, saturation: f32, value: f32); +} +extern "C" { + pub fn TCOD_color_get_HSV( + color: TCOD_color_t, + hue: *mut f32, + saturation: *mut f32, + value: *mut f32, + ); +} +extern "C" { + pub fn TCOD_color_get_hue(color: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_hue(color: *mut TCOD_color_t, hue: f32); +} +extern "C" { + pub fn TCOD_color_get_saturation(color: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_saturation(color: *mut TCOD_color_t, saturation: f32); +} +extern "C" { + pub fn TCOD_color_get_value(color: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_value(color: *mut TCOD_color_t, value: f32); +} +extern "C" { + pub fn TCOD_color_shift_hue(color: *mut TCOD_color_t, hshift: f32); +} +extern "C" { + pub fn TCOD_color_scale_HSV(color: *mut TCOD_color_t, saturation_coef: f32, value_coef: f32); +} +extern "C" { + pub fn TCOD_color_gen_map( + map: *mut TCOD_color_t, + nb_key: ::std::os::raw::c_int, + key_color: *const TCOD_color_t, + key_index: *const ::std::os::raw::c_int, + ); +} +pub const TCOD_COLOR_RED: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_RED; +pub const TCOD_COLOR_FLAME: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_FLAME; +pub const TCOD_COLOR_ORANGE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_ORANGE; +pub const TCOD_COLOR_AMBER: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_AMBER; +pub const TCOD_COLOR_YELLOW: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_YELLOW; +pub const TCOD_COLOR_LIME: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_LIME; +pub const TCOD_COLOR_CHARTREUSE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CHARTREUSE; +pub const TCOD_COLOR_GREEN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_GREEN; +pub const TCOD_COLOR_SEA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_SEA; +pub const TCOD_COLOR_TURQUOISE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_TURQUOISE; +pub const TCOD_COLOR_CYAN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CYAN; +pub const TCOD_COLOR_SKY: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_SKY; +pub const TCOD_COLOR_AZURE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_AZURE; +pub const TCOD_COLOR_BLUE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_BLUE; +pub const TCOD_COLOR_HAN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_HAN; +pub const TCOD_COLOR_VIOLET: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_VIOLET; +pub const TCOD_COLOR_PURPLE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_PURPLE; +pub const TCOD_COLOR_FUCHSIA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_FUCHSIA; +pub const TCOD_COLOR_MAGENTA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_MAGENTA; +pub const TCOD_COLOR_PINK: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_PINK; +pub const TCOD_COLOR_CRIMSON: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CRIMSON; +pub const TCOD_COLOR_NB: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_NB; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_1 { + TCOD_COLOR_RED = 0, + TCOD_COLOR_FLAME = 1, + TCOD_COLOR_ORANGE = 2, + TCOD_COLOR_AMBER = 3, + TCOD_COLOR_YELLOW = 4, + TCOD_COLOR_LIME = 5, + TCOD_COLOR_CHARTREUSE = 6, + TCOD_COLOR_GREEN = 7, + TCOD_COLOR_SEA = 8, + TCOD_COLOR_TURQUOISE = 9, + TCOD_COLOR_CYAN = 10, + TCOD_COLOR_SKY = 11, + TCOD_COLOR_AZURE = 12, + TCOD_COLOR_BLUE = 13, + TCOD_COLOR_HAN = 14, + TCOD_COLOR_VIOLET = 15, + TCOD_COLOR_PURPLE = 16, + TCOD_COLOR_FUCHSIA = 17, + TCOD_COLOR_MAGENTA = 18, + TCOD_COLOR_PINK = 19, + TCOD_COLOR_CRIMSON = 20, + TCOD_COLOR_NB = 21, +} +pub const TCOD_COLOR_DESATURATED: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DESATURATED; +pub const TCOD_COLOR_LIGHTEST: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHTEST; +pub const TCOD_COLOR_LIGHTER: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHTER; +pub const TCOD_COLOR_LIGHT: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHT; +pub const TCOD_COLOR_NORMAL: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_NORMAL; +pub const TCOD_COLOR_DARK: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARK; +pub const TCOD_COLOR_DARKER: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARKER; +pub const TCOD_COLOR_DARKEST: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARKEST; +pub const TCOD_COLOR_LEVELS: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LEVELS; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_2 { + TCOD_COLOR_DESATURATED = 0, + TCOD_COLOR_LIGHTEST = 1, + TCOD_COLOR_LIGHTER = 2, + TCOD_COLOR_LIGHT = 3, + TCOD_COLOR_NORMAL = 4, + TCOD_COLOR_DARK = 5, + TCOD_COLOR_DARKER = 6, + TCOD_COLOR_DARKEST = 7, + TCOD_COLOR_LEVELS = 8, +} +extern "C" { + pub static mut TCOD_colors: [[TCOD_color_t; 8usize]; 21usize]; +} +extern "C" { + pub static TCOD_black: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_white: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_brass: TCOD_color_t; +} +extern "C" { + pub static TCOD_copper: TCOD_color_t; +} +extern "C" { + pub static TCOD_gold: TCOD_color_t; +} +extern "C" { + pub static TCOD_silver: TCOD_color_t; +} +extern "C" { + pub static TCOD_celadon: TCOD_color_t; +} +extern "C" { + pub static TCOD_peach: TCOD_color_t; +} +#[repr(i32)] +#[doc = " An enum of libtcod error codes."] +#[doc = ""] +#[doc = " On values other than `TCOD_E_OK` you can use `TCOD_get_error()` to learn"] +#[doc = " more information."] +#[doc = " \\rst"] +#[doc = " .. versionadded:: 1.16"] +#[doc = " \\endrst"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_Error { + #[doc = " The function completed successfully without issues."] + #[doc = ""] + #[doc = " A function is successful when `(err >= 0)`. Positive values may be used"] + #[doc = " for warnings, or for other outputs."] + TCOD_E_OK = 0, + #[doc = " The error code for generic runtime errors."] + #[doc = ""] + #[doc = " The returned code my be changed in the future to something more specific."] + #[doc = " Use `(err < 0)` to check if the value is an error."] + TCOD_E_ERROR = -1, + #[doc = " The function failed because a given input argument was invalid."] + TCOD_E_INVALID_ARGUMENT = -2, + #[doc = " The function failed because it was unable to allocate enough memory."] + TCOD_E_OUT_OF_MEMORY = -3, + #[doc = " The function completed, but a minor issue was detected."] + TCOD_E_WARN = 1, +} +extern "C" { + #[doc = " Return the last error message. If there is no error then the string will"] + #[doc = " have a length of zero."] + #[doc = ""] + #[doc = " The error state is thread specific."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.12"] + #[doc = " \\endrst"] + pub fn TCOD_get_error() -> *const ::std::os::raw::c_char; +} +extern "C" { + #[doc = " Set an error message and return TCOD_E_ERROR."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.12"] + #[doc = " \\endrst"] + pub fn TCOD_set_error(msg: *const ::std::os::raw::c_char) -> TCOD_Error; +} +extern "C" { + #[doc = " Set an error message and return TCOD_E_ERROR."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_set_errorf(fmt: *const ::std::os::raw::c_char, ...) -> TCOD_Error; +} +extern "C" { + #[doc = " Clear a current existing error message."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_clear_error(); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetObserver { + pub tileset: *mut TCOD_Tileset, + pub next: *mut TCOD_TilesetObserver, + pub userdata: *mut ::std::os::raw::c_void, + pub on_observer_delete: + ::std::option::Option, + pub on_tile_changed: ::std::option::Option< + unsafe extern "C" fn( + observer: *mut TCOD_TilesetObserver, + tile_id: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, +} +#[test] +fn bindgen_test_layout_TCOD_TilesetObserver() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_TilesetObserver)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_TilesetObserver)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(tileset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).userdata as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(userdata) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).on_observer_delete as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(on_observer_delete) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).on_tile_changed as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(on_tile_changed) + ) + ); +} +impl Default for TCOD_TilesetObserver { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Tileset { + pub tile_width: ::std::os::raw::c_int, + pub tile_height: ::std::os::raw::c_int, + pub tile_length: ::std::os::raw::c_int, + pub tiles_capacity: ::std::os::raw::c_int, + pub tiles_count: ::std::os::raw::c_int, + pub pixels: *mut TCOD_ColorRGBA, + pub character_map_length: ::std::os::raw::c_int, + pub character_map: *mut ::std::os::raw::c_int, + pub observer_list: *mut TCOD_TilesetObserver, + pub virtual_columns: ::std::os::raw::c_int, + pub ref_count: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_Tileset() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(TCOD_Tileset)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Tileset)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tile_width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tile_width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tile_height as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tile_height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tile_length as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tile_length) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tiles_capacity as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tiles_capacity) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tiles_count as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tiles_count) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pixels as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(pixels) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).character_map_length as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(character_map_length) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).character_map as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(character_map) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).observer_list as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(observer_list) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).virtual_columns as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(virtual_columns) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ref_count as *const _ as usize }, + 60usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(ref_count) + ) + ); +} +impl Default for TCOD_Tileset { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + #[doc = " Create a new tile-set with the given tile size."] + pub fn TCOD_tileset_new( + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Delete a tile-set."] + pub fn TCOD_tileset_delete(tileset: *mut TCOD_Tileset); +} +extern "C" { + #[doc = " Return the pixel width of tiles in this tileset."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_width_(tileset: *const TCOD_Tileset) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return the pixel height of tiles in this tileset."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_height_(tileset: *const TCOD_Tileset) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Fetch a tile, outputting its data to a pixel buffer."] + #[doc = ""] + #[doc = " `codepoint` is the index for the tile. Unicode is recommend."] + #[doc = ""] + #[doc = " `buffer` is a pointer to a contiguous row-major array of pixels. The tile"] + #[doc = " data will be outputted here. This pointer can be NULL if you only want to"] + #[doc = " know if the tileset has a specific tile."] + #[doc = ""] + #[doc = " Returns 0 if the tile exists. Returns a negative value on an error or if"] + #[doc = " the tileset does not have a tile for this codepoint."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_( + tileset: *const TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + buffer: *mut TCOD_ColorRGBA, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Upload a tile from a pixel buffer into this tileset."] + #[doc = ""] + #[doc = " `codepoint` is the index for the tile. Unicode is recommend."] + #[doc = ""] + #[doc = " `buffer` is a pointer to a contiguous row-major array of pixels."] + #[doc = " This can not be NULL."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_set_tile_( + tileset: *mut TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + buffer: *const TCOD_ColorRGBA, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Load a font from a tilesheet."] + pub fn TCOD_tileset_load( + filename: *const ::std::os::raw::c_char, + columns: ::std::os::raw::c_int, + rows: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + charmap: *mut ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Assign a codepoint to an existing tile based on its tile ID."] + #[doc = ""] + #[doc = " Returns the tile ID on success."] + #[doc = ""] + #[doc = " Returns a negative value on error."] + pub fn TCOD_tileset_assign_tile( + tileset: *mut TCOD_Tileset, + tile_id: ::std::os::raw::c_int, + codepoint: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return a pointer to the tile for `codepoint`."] + #[doc = ""] + #[doc = " Returns NULL if no tile exists for codepoint."] + pub fn TCOD_tileset_get_tile( + tileset: *const TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + ) -> *const TCOD_ColorRGBA; +} +extern "C" { + #[doc = " Return a new observer to this tileset."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_observer_new(tileset: *mut TCOD_Tileset) -> *mut TCOD_TilesetObserver; +} +extern "C" { + #[doc = " Delete an existing observer."] + #[doc = ""] + #[doc = " Will call this observers on_observer_delete callback."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_observer_delete(observer: *mut TCOD_TilesetObserver); +} +extern "C" { + #[doc = " Called to notify any observers that a tile has been changed. This may"] + #[doc = " cause running atlases to update or mark cache consoles as dirty."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_notify_tile_changed( + tileset: *mut TCOD_Tileset, + tile_id: ::std::os::raw::c_int, + ); +} +extern "C" { + #[doc = " Reserve memory for a specific amount of tiles."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_reserve( + tileset: *mut TCOD_Tileset, + desired: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +#[repr(u32)] +#[doc = " \\enum TCOD_bkgnd_flag_t"] +#[doc = ""] +#[doc = " Background color blend modes."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_bkgnd_flag_t { + TCOD_BKGND_NONE = 0, + TCOD_BKGND_SET = 1, + TCOD_BKGND_MULTIPLY = 2, + TCOD_BKGND_LIGHTEN = 3, + TCOD_BKGND_DARKEN = 4, + TCOD_BKGND_SCREEN = 5, + TCOD_BKGND_COLOR_DODGE = 6, + TCOD_BKGND_COLOR_BURN = 7, + TCOD_BKGND_ADD = 8, + TCOD_BKGND_ADDA = 9, + TCOD_BKGND_BURN = 10, + TCOD_BKGND_OVERLAY = 11, + TCOD_BKGND_ALPH = 12, + TCOD_BKGND_DEFAULT = 13, +} +#[repr(u32)] +#[doc = " \\enum TCOD_alignment_t"] +#[doc = ""] +#[doc = " Print justification options."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_alignment_t { + TCOD_LEFT = 0, + TCOD_RIGHT = 1, + TCOD_CENTER = 2, +} +#[doc = " A console tile."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ConsoleTile { + #[doc = " The Unicode codepoint for this tile."] + pub ch: ::std::os::raw::c_int, + #[doc = " The tile glyph color, rendered on top of the background."] + pub fg: TCOD_ColorRGBA, + #[doc = " The tile background color, rendered behind the glyph."] + pub bg: TCOD_ColorRGBA, +} +#[test] +fn bindgen_test_layout_TCOD_ConsoleTile() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(TCOD_ConsoleTile)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_ConsoleTile)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ch as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ConsoleTile), + "::", + stringify!(ch) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fg as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ConsoleTile), + "::", + stringify!(fg) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bg as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ConsoleTile), + "::", + stringify!(bg) + ) + ); +} +#[doc = " The libtcod console struct."] +#[doc = ""] +#[doc = " All attributes should be considered private."] +#[doc = ""] +#[doc = " All C++ methods should be considered provisional, and are subject to"] +#[doc = " change."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Console { + #[doc = " Console width and height (in characters, not pixels.)"] + pub w: ::std::os::raw::c_int, + #[doc = " Console width and height (in characters, not pixels.)"] + pub h: ::std::os::raw::c_int, + #[doc = " A contiguous array of console tiles."] + pub tiles: *mut TCOD_ConsoleTile, + #[doc = " Default background operator for print & print_rect functions."] + pub bkgnd_flag: TCOD_bkgnd_flag_t, + #[doc = " Default alignment for print & print_rect functions."] + pub alignment: TCOD_alignment_t, + #[doc = " Foreground (text) and background colors."] + pub fore: TCOD_color_t, + #[doc = " Foreground (text) and background colors."] + pub back: TCOD_color_t, + #[doc = " True if a key color is being used."] + pub has_key_color: bool, + #[doc = " The current key color for this console."] + pub key_color: TCOD_color_t, + #[doc = "The total length of the tiles array. Same as `w * h`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub elements: ::std::os::raw::c_int, + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub userdata: *mut ::std::os::raw::c_void, + #[doc = " Internal use."] + pub on_delete: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_TCOD_Console() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(TCOD_Console)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Console)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tiles as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(tiles) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bkgnd_flag as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(bkgnd_flag) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).alignment as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(alignment) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fore as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(fore) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).back as *const _ as usize }, + 27usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(back) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).has_key_color as *const _ as usize }, + 30usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(has_key_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).key_color as *const _ as usize }, + 31usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(key_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).elements as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(elements) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).userdata as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(userdata) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).on_delete as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(on_delete) + ) + ); +} +impl Default for TCOD_Console { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_console_t = *mut TCOD_Console; +extern "C" { + #[doc = " Return a new console with a specific number of columns and rows."] + #[doc = ""] + #[doc = " \\param w Number of columns."] + #[doc = " \\param h Number of columns."] + #[doc = " \\return A pointer to the new console, or NULL on error."] + pub fn TCOD_console_new( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_Console; +} +extern "C" { + #[doc = " Return the width of a console."] + pub fn TCOD_console_get_width(con: *const TCOD_Console) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return the height of a console."] + pub fn TCOD_console_get_height(con: *const TCOD_Console) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_set_key_color(con: *mut TCOD_Console, col: TCOD_color_t); +} +extern "C" { + #[doc = " Blit from one console to another."] + #[doc = ""] + #[doc = " \\param srcCon Pointer to the source console."] + #[doc = " \\param xSrc The left region of the source console to blit from."] + #[doc = " \\param ySrc The top region of the source console to blit from."] + #[doc = " \\param wSrc The width of the region to blit from."] + #[doc = " If 0 then it will fill to the maximum width."] + #[doc = " \\param hSrc The height of the region to blit from."] + #[doc = " If 0 then it will fill to the maximum height."] + #[doc = " \\param dstCon Pointer to the destination console."] + #[doc = " \\param xDst The left corner to blit onto the destination console."] + #[doc = " \\param yDst The top corner to blit onto the destination console."] + #[doc = " \\param foreground_alpha Foreground blending alpha."] + #[doc = " \\param background_alpha Background blending alpha."] + #[doc = ""] + #[doc = " If the source console has a key color, this function will use it."] + #[doc = " \\rst"] + #[doc = " .. versionchanged:: 1.16"] + #[doc = " Blits can now handle per-cell alpha transparency."] + #[doc = " \\endrst"] + pub fn TCOD_console_blit( + src: *const TCOD_Console, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + dst: *mut TCOD_Console, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + foreground_alpha: f32, + background_alpha: f32, + ); +} +extern "C" { + pub fn TCOD_console_blit_key_color( + src: *const TCOD_Console, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + dst: *mut TCOD_Console, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + foreground_alpha: f32, + background_alpha: f32, + key_color: *const TCOD_color_t, + ); +} +extern "C" { + #[doc = " Delete a console."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = ""] + #[doc = " If the console being deleted is the root console, then the display will be"] + #[doc = " uninitialized."] + pub fn TCOD_console_delete(console: *mut TCOD_Console); +} +extern "C" { + pub fn TCOD_console_set_default_background(con: *mut TCOD_Console, col: TCOD_color_t); +} +extern "C" { + pub fn TCOD_console_set_default_foreground(con: *mut TCOD_Console, col: TCOD_color_t); +} +extern "C" { + #[doc = " Clear a console to its default colors and the space character code."] + pub fn TCOD_console_clear(con: *mut TCOD_Console); +} +extern "C" { + #[doc = " Blend a background color onto a console tile."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param col The background color to blend."] + #[doc = " \\param flag The blend mode to use."] + pub fn TCOD_console_set_char_background( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Change the foreground color of a console tile."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param col The foreground color to set."] + pub fn TCOD_console_set_char_foreground( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); +} +extern "C" { + #[doc = " Change a character on a console tile, without changing its colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to set."] + pub fn TCOD_console_set_char( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + ); +} +extern "C" { + #[doc = " Draw a character on a console using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to place."] + #[doc = " \\param flag A TCOD_bkgnd_flag_t flag."] + pub fn TCOD_console_put_char( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a character on the console with the given colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to place."] + #[doc = " \\param fore The foreground color."] + #[doc = " \\param back The background color. This color will not be blended."] + pub fn TCOD_console_put_char_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + fore: TCOD_color_t, + back: TCOD_color_t, + ); +} +extern "C" { + #[doc = " Set a consoles default background flag."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param flag One of `TCOD_bkgnd_flag_t`."] + pub fn TCOD_console_set_background_flag(con: *mut TCOD_Console, flag: TCOD_bkgnd_flag_t); +} +extern "C" { + #[doc = " Return a consoles default background flag."] + pub fn TCOD_console_get_background_flag(con: *mut TCOD_Console) -> TCOD_bkgnd_flag_t; +} +extern "C" { + #[doc = " Set a consoles default alignment."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param alignment One of TCOD_alignment_t"] + pub fn TCOD_console_set_alignment(con: *mut TCOD_Console, alignment: TCOD_alignment_t); +} +extern "C" { + #[doc = " Return a consoles default alignment."] + pub fn TCOD_console_get_alignment(con: *mut TCOD_Console) -> TCOD_alignment_t; +} +extern "C" { + pub fn TCOD_console_get_default_background(con: *mut TCOD_Console) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_get_default_foreground(con: *mut TCOD_Console) -> TCOD_color_t; +} +extern "C" { + #[doc = " Return the background color of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return A TCOD_color_t struct with a copy of the background color."] + pub fn TCOD_console_get_char_background( + con: *const TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + #[doc = " Return the foreground color of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return A TCOD_color_t struct with a copy of the foreground color."] + pub fn TCOD_console_get_char_foreground( + con: *const TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + #[doc = " Return a character code of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return The character code."] + pub fn TCOD_console_get_char( + con: *const TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Fade the color of the display."] + #[doc = ""] + #[doc = " \\param val Where at 255 colors are normal and at 0 colors are completely"] + #[doc = " faded."] + #[doc = " \\param fadecol Color to fade towards."] + pub fn TCOD_console_set_fade(val: u8, fade: TCOD_color_t); +} +extern "C" { + #[doc = " Return the fade value."] + #[doc = ""] + #[doc = " \\return At 255 colors are normal and at 0 colors are completely faded."] + pub fn TCOD_console_get_fade() -> u8; +} +extern "C" { + #[doc = " Return the fade color."] + #[doc = ""] + #[doc = " \\return The current fading color."] + pub fn TCOD_console_get_fading_color() -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_resize_( + console: *mut TCOD_Console, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_keycode_t { + TCODK_NONE = 0, + TCODK_ESCAPE = 1, + TCODK_BACKSPACE = 2, + TCODK_TAB = 3, + TCODK_ENTER = 4, + TCODK_SHIFT = 5, + TCODK_CONTROL = 6, + TCODK_ALT = 7, + TCODK_PAUSE = 8, + TCODK_CAPSLOCK = 9, + TCODK_PAGEUP = 10, + TCODK_PAGEDOWN = 11, + TCODK_END = 12, + TCODK_HOME = 13, + TCODK_UP = 14, + TCODK_LEFT = 15, + TCODK_RIGHT = 16, + TCODK_DOWN = 17, + TCODK_PRINTSCREEN = 18, + TCODK_INSERT = 19, + TCODK_DELETE = 20, + TCODK_LWIN = 21, + TCODK_RWIN = 22, + TCODK_APPS = 23, + TCODK_0 = 24, + TCODK_1 = 25, + TCODK_2 = 26, + TCODK_3 = 27, + TCODK_4 = 28, + TCODK_5 = 29, + TCODK_6 = 30, + TCODK_7 = 31, + TCODK_8 = 32, + TCODK_9 = 33, + TCODK_KP0 = 34, + TCODK_KP1 = 35, + TCODK_KP2 = 36, + TCODK_KP3 = 37, + TCODK_KP4 = 38, + TCODK_KP5 = 39, + TCODK_KP6 = 40, + TCODK_KP7 = 41, + TCODK_KP8 = 42, + TCODK_KP9 = 43, + TCODK_KPADD = 44, + TCODK_KPSUB = 45, + TCODK_KPDIV = 46, + TCODK_KPMUL = 47, + TCODK_KPDEC = 48, + TCODK_KPENTER = 49, + TCODK_F1 = 50, + TCODK_F2 = 51, + TCODK_F3 = 52, + TCODK_F4 = 53, + TCODK_F5 = 54, + TCODK_F6 = 55, + TCODK_F7 = 56, + TCODK_F8 = 57, + TCODK_F9 = 58, + TCODK_F10 = 59, + TCODK_F11 = 60, + TCODK_F12 = 61, + TCODK_NUMLOCK = 62, + TCODK_SCROLLLOCK = 63, + TCODK_SPACE = 64, + TCODK_CHAR = 65, + TCODK_TEXT = 66, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_key_t { + pub vk: TCOD_keycode_t, + pub c: ::std::os::raw::c_char, + pub text: [::std::os::raw::c_char; 32usize], + pub pressed: bool, + pub lalt: bool, + pub lctrl: bool, + pub lmeta: bool, + pub ralt: bool, + pub rctrl: bool, + pub rmeta: bool, + pub shift: bool, +} +#[test] +fn bindgen_test_layout_TCOD_key_t() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(TCOD_key_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_key_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vk as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(vk) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(c) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).text as *const _ as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(text) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pressed as *const _ as usize }, + 37usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lalt as *const _ as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lalt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lctrl as *const _ as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lctrl) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lmeta as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lmeta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ralt as *const _ as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(ralt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rctrl as *const _ as usize }, + 42usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(rctrl) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rmeta as *const _ as usize }, + 43usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(rmeta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).shift as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(shift) + ) + ); +} +impl Default for TCOD_key_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_chars_t { + TCOD_CHAR_HLINE = 196, + TCOD_CHAR_VLINE = 179, + TCOD_CHAR_NE = 191, + TCOD_CHAR_NW = 218, + TCOD_CHAR_SE = 217, + TCOD_CHAR_SW = 192, + TCOD_CHAR_TEEW = 180, + TCOD_CHAR_TEEE = 195, + TCOD_CHAR_TEEN = 193, + TCOD_CHAR_TEES = 194, + TCOD_CHAR_CROSS = 197, + TCOD_CHAR_DHLINE = 205, + TCOD_CHAR_DVLINE = 186, + TCOD_CHAR_DNE = 187, + TCOD_CHAR_DNW = 201, + TCOD_CHAR_DSE = 188, + TCOD_CHAR_DSW = 200, + TCOD_CHAR_DTEEW = 185, + TCOD_CHAR_DTEEE = 204, + TCOD_CHAR_DTEEN = 202, + TCOD_CHAR_DTEES = 203, + TCOD_CHAR_DCROSS = 206, + TCOD_CHAR_BLOCK1 = 176, + TCOD_CHAR_BLOCK2 = 177, + TCOD_CHAR_BLOCK3 = 178, + TCOD_CHAR_ARROW_N = 24, + TCOD_CHAR_ARROW_S = 25, + TCOD_CHAR_ARROW_E = 26, + TCOD_CHAR_ARROW_W = 27, + TCOD_CHAR_ARROW2_N = 30, + TCOD_CHAR_ARROW2_S = 31, + TCOD_CHAR_ARROW2_E = 16, + TCOD_CHAR_ARROW2_W = 17, + TCOD_CHAR_DARROW_H = 29, + TCOD_CHAR_DARROW_V = 18, + TCOD_CHAR_CHECKBOX_UNSET = 224, + TCOD_CHAR_CHECKBOX_SET = 225, + TCOD_CHAR_RADIO_UNSET = 9, + TCOD_CHAR_RADIO_SET = 10, + TCOD_CHAR_SUBP_NW = 226, + TCOD_CHAR_SUBP_NE = 227, + TCOD_CHAR_SUBP_N = 228, + TCOD_CHAR_SUBP_SE = 229, + TCOD_CHAR_SUBP_DIAG = 230, + TCOD_CHAR_SUBP_E = 231, + TCOD_CHAR_SUBP_SW = 232, + TCOD_CHAR_SMILIE = 1, + TCOD_CHAR_SMILIE_INV = 2, + TCOD_CHAR_HEART = 3, + TCOD_CHAR_DIAMOND = 4, + TCOD_CHAR_CLUB = 5, + TCOD_CHAR_SPADE = 6, + TCOD_CHAR_BULLET = 7, + TCOD_CHAR_BULLET_INV = 8, + TCOD_CHAR_MALE = 11, + TCOD_CHAR_FEMALE = 12, + TCOD_CHAR_NOTE = 13, + TCOD_CHAR_NOTE_DOUBLE = 14, + TCOD_CHAR_LIGHT = 15, + TCOD_CHAR_EXCLAM_DOUBLE = 19, + TCOD_CHAR_PILCROW = 20, + TCOD_CHAR_SECTION = 21, + TCOD_CHAR_POUND = 156, + TCOD_CHAR_MULTIPLICATION = 158, + TCOD_CHAR_FUNCTION = 159, + TCOD_CHAR_RESERVED = 169, + TCOD_CHAR_HALF = 171, + TCOD_CHAR_ONE_QUARTER = 172, + TCOD_CHAR_COPYRIGHT = 184, + TCOD_CHAR_CENT = 189, + TCOD_CHAR_YEN = 190, + TCOD_CHAR_CURRENCY = 207, + TCOD_CHAR_THREE_QUARTERS = 243, + TCOD_CHAR_DIVISION = 246, + TCOD_CHAR_GRADE = 248, + TCOD_CHAR_UMLAUT = 249, + TCOD_CHAR_POW1 = 251, + TCOD_CHAR_POW3 = 252, + TCOD_CHAR_POW2 = 253, + TCOD_CHAR_BULLET_SQUARE = 254, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_key_status_t { + TCOD_KEY_PRESSED = 1, + TCOD_KEY_RELEASED = 2, +} +impl TCOD_font_flags_t { + #[doc = " Tiles are arranged in column-major order."] + #[doc = ""] + #[doc = " 0 3 6"] + #[doc = " 1 4 7"] + #[doc = " 2 5 8"] + pub const TCOD_FONT_LAYOUT_ASCII_INCOL: TCOD_font_flags_t = TCOD_font_flags_t(1); +} +impl TCOD_font_flags_t { + #[doc = " Tiles are arranged in row-major order."] + #[doc = ""] + #[doc = " 0 1 2"] + #[doc = " 3 4 5"] + #[doc = " 6 7 8"] + pub const TCOD_FONT_LAYOUT_ASCII_INROW: TCOD_font_flags_t = TCOD_font_flags_t(2); +} +impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] + pub const TCOD_FONT_TYPE_GREYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); +} +impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] + pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); +} +impl TCOD_font_flags_t { + #[doc = " A unique layout used by some of libtcod's fonts."] + pub const TCOD_FONT_LAYOUT_TCOD: TCOD_font_flags_t = TCOD_font_flags_t(8); +} +impl TCOD_font_flags_t { + #[doc = " Decode a code page 437 tileset into Unicode code-points."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.10"] + #[doc = " \\endrst"] + pub const TCOD_FONT_LAYOUT_CP437: TCOD_font_flags_t = TCOD_font_flags_t(16); +} +impl ::std::ops::BitOr for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for TCOD_font_flags_t { + #[inline] + fn bitor_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for TCOD_font_flags_t { + #[inline] + fn bitand_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[doc = " These font flags can be OR'd together into a bit-field and passed to"] +#[doc = " TCOD_console_set_custom_font"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct TCOD_font_flags_t(pub u32); +#[repr(u32)] +#[doc = " The available renderers."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_renderer_t { + #[doc = " Alias for TCOD_RENDERER_OPENGL2."] + TCOD_RENDERER_GLSL = 0, + #[doc = " An OpenGL 1.1 implementation."] + #[doc = ""] + #[doc = " Performs worse than TCOD_RENDERER_GLSL without many benefits."] + TCOD_RENDERER_OPENGL = 1, + #[doc = " A software based renderer."] + #[doc = ""] + #[doc = " The font file is loaded into RAM instead of VRAM in this implementation."] + TCOD_RENDERER_SDL = 2, + #[doc = " A new SDL2 renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.8"] + #[doc = " \\endrst"] + TCOD_RENDERER_SDL2 = 3, + #[doc = " A new OpenGL 2.0 core renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.9"] + #[doc = ""] + #[doc = " .. versionchanged:: 1.11.0"] + #[doc = " This renderer now uses OpenGL 2.0 instead of 2.1."] + #[doc = " \\endrst"] + TCOD_RENDERER_OPENGL2 = 4, + #[doc = " A new OpenGL 2.0 core renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.9"] + #[doc = ""] + #[doc = " .. versionchanged:: 1.11.0"] + #[doc = " This renderer now uses OpenGL 2.0 instead of 2.1."] + #[doc = " \\endrst"] + TCOD_NB_RENDERERS = 5, +} +extern "C" { + #[doc = " Draw a rectangle onto a console."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting region, the left-most position being 0."] + #[doc = " \\param y The starting region, the top-most position being 0."] + #[doc = " \\param rw The width of the rectangle."] + #[doc = " \\param rh The height of the rectangle."] + #[doc = " \\param clear If true the drawing region will be filled with spaces."] + #[doc = " \\param flag The blending flag to use."] + pub fn TCOD_console_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + clear: bool, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a horizontal line using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting X coordinate, the left-most position being 0."] + #[doc = " \\param y The starting Y coordinate, the top-most position being 0."] + #[doc = " \\param l The width of the line."] + #[doc = " \\param flag The blending flag."] + #[doc = ""] + #[doc = " This function makes assumptions about the fonts character encoding."] + #[doc = " It will fail if the font encoding is not `cp437`."] + pub fn TCOD_console_hline( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a vertical line using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting X coordinate, the left-most position being 0."] + #[doc = " \\param y The starting Y coordinate, the top-most position being 0."] + #[doc = " \\param l The height of the line."] + #[doc = " \\param flag The blending flag."] + #[doc = ""] + #[doc = " This function makes assumptions about the fonts character encoding."] + #[doc = " It will fail if the font encoding is not `cp437`."] + pub fn TCOD_console_vline( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Place a single tile on a `console` at `x`,`y`."] + #[doc = ""] + #[doc = " If `ch` is 0 then the character code will not be updated."] + #[doc = ""] + #[doc = " If `fg`,`bg` is NULL then their respective colors will not be updated."] + pub fn TCOD_console_put_rgb( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ch: ::std::os::raw::c_int, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a rectangle on a `console` with a shape of `x`,`y`,`width`,`height`."] + #[doc = ""] + #[doc = " If `ch` is 0 then the character code will not be updated."] + #[doc = ""] + #[doc = " If `fg`,`bg` is NULL then their respective colors will not be updated."] + pub fn TCOD_console_draw_rect_rgb( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ch: ::std::os::raw::c_int, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +#[doc = "Viewport options for the rendering context."] +#[doc = "\\rst"] +#[doc = ".. versionadded:: 1.16"] +#[doc = "\\endrst"] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ViewportOptions { + #[doc = "If true then the aspect ratio will be kept square when the console is"] + #[doc = "scaled. The view will be letter-boxed."] + #[doc = ""] + #[doc = "If false the console will be stretched to fill the screen."] + #[doc = ""] + #[doc = "Set this is true if your tileset is deigned for square pixels."] + pub keep_aspect: bool, + #[doc = "If true then console scaling will be fixed to integer increments."] + #[doc = ""] + #[doc = "Has no effect if the console must be scaled down."] + pub integer_scaling: bool, + #[doc = "Not used."] + pub reserved_: bool, + #[doc = "The color to clear the screen with before rendering the console."] + pub clear_color: TCOD_ColorRGBA, + #[doc = "Alignment of the console when it is letter-boxed: 0.0f renders the"] + #[doc = "console in the upper-left corner, and 1.0f in the lower-right."] + #[doc = ""] + #[doc = "Values of 0.5f will center the console."] + #[doc = "Values outside of the range 0.0f to 1.0f are clamped."] + pub align_x: f32, + pub align_y: f32, +} +#[test] +fn bindgen_test_layout_TCOD_ViewportOptions() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_ViewportOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_ViewportOptions)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).keep_aspect as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(keep_aspect) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).integer_scaling as *const _ as usize + }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(integer_scaling) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved_ as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(reserved_) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).clear_color as *const _ as usize + }, + 3usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(clear_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).align_x as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(align_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).align_y as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(align_y) + ) + ); +} +extern "C" { + pub static TCOD_VIEWPORT_DEFAULT_: TCOD_ViewportOptions; +} +extern "C" { + #[doc = "Allocate a new viewport options struct."] + #[doc = ""] + #[doc = "You should not allocate this struct manually since the size of it may change"] + #[doc = "between versions."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_viewport_new() -> *mut TCOD_ViewportOptions; +} +extern "C" { + #[doc = "Delete a viewport."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_viewport_delete(viewport: *mut TCOD_ViewportOptions); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Window { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Renderer { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Rect { + _unused: [u8; 0], +} +#[doc = " A rendering context for libtcod."] +#[doc = " \\rst"] +#[doc = " .. versionadded:: 1.16"] +#[doc = " \\endrst"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Context { + pub type_: ::std::os::raw::c_int, + pub contextdata: *mut ::std::os::raw::c_void, + pub destructor_: ::std::option::Option, + pub present_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error, + >, + pub pixel_to_tile_: ::std::option::Option< + unsafe extern "C" fn(self_: *mut TCOD_Context, x: *mut f64, y: *mut f64), + >, + pub save_screenshot_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + filename: *const ::std::os::raw::c_char, + ) -> TCOD_Error, + >, + pub get_sdl_window_: + ::std::option::Option *mut SDL_Window>, + pub get_sdl_renderer_: + ::std::option::Option *mut SDL_Renderer>, + pub accumulate_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error, + >, + #[doc = "Change the tileset used by this context."] + pub set_tileset: ::std::option::Option< + unsafe extern "C" fn(self_: *mut TCOD_Context, tileset: *mut TCOD_Tileset) -> TCOD_Error, + >, + #[doc = "Output the recommended console size to `columns` and `rows`."] + pub cb_recommended_console_size_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + columns: *mut ::std::os::raw::c_int, + rows: *mut ::std::os::raw::c_int, + ) -> TCOD_Error, + >, +} +#[test] +fn bindgen_test_layout_TCOD_Context() { + assert_eq!( + ::std::mem::size_of::(), + 88usize, + concat!("Size of: ", stringify!(TCOD_Context)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Context)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).contextdata as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(contextdata) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).destructor_ as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(destructor_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).present_ as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(present_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pixel_to_tile_ as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(pixel_to_tile_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).save_screenshot_ as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(save_screenshot_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).get_sdl_window_ as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(get_sdl_window_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).get_sdl_renderer_ as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(get_sdl_renderer_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).accumulate_ as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(accumulate_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).set_tileset as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(set_tileset) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).cb_recommended_console_size_ as *const _ + as usize + }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(cb_recommended_console_size_) + ) + ); +} +impl Default for TCOD_Context { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + #[doc = " Delete a rendering context."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_context_delete(renderer: *mut TCOD_Context); +} +extern "C" { + #[doc = " Create an uninitialized rendering context."] + #[doc = ""] + #[doc = " Used internally."] + pub fn TCOD_context_new_() -> *mut TCOD_Context; +} +extern "C" { + #[doc = "Present a console to the screen, using a rendering context."] + #[doc = ""] + #[doc = "`console` is the console to present, the console can be any size."] + #[doc = ""] + #[doc = "`viewport` is the optional viewport options to use."] + #[doc = "This will affect the scaling of the console with the current context."] + #[doc = "This can be NULL to use the default options, which are to stretch the"] + #[doc = "console to fit the screen."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_present( + context: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Convert the screen coordinates to tile coordinates for this context."] + #[doc = ""] + #[doc = "`x` and `y` are the pointers to the screen coordinates, these will be"] + #[doc = "converted to tile coordinates after the call to this function."] + #[doc = ""] + #[doc = "The parameters given to the last call to `TCOD_context_present` will"] + #[doc = "determine where the tiles are for this call."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_screen_pixel_to_tile_d( + context: *mut TCOD_Context, + x: *mut f64, + y: *mut f64, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Convert the screen coordinates to integer tile coordinates for this context."] + #[doc = ""] + #[doc = "Save as `TCOD_context_screen_pixel_to_tile` but the inputs and results are"] + #[doc = "integers. This is useful if you don't need sub-tile coordinates."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_screen_pixel_to_tile_i( + context: *mut TCOD_Context, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Save the last presented console to a PNG file."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_save_screenshot( + context: *mut TCOD_Context, + filename: *const ::std::os::raw::c_char, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return a pointer the SDL_Window for this context if it uses one."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_sdl_window(context: *mut TCOD_Context) -> *mut SDL_Window; +} +extern "C" { + #[doc = "Return a pointer the SDL_Renderer for this context if it uses one."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_sdl_renderer(context: *mut TCOD_Context) -> *mut SDL_Renderer; +} +extern "C" { + #[doc = "Change the active tileset for this context."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_change_tileset( + self_: *mut TCOD_Context, + tileset: *mut TCOD_Tileset, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return the `TCOD_renderer_t` renderer type for this context."] + #[doc = ""] + #[doc = "Returns a negative number on error, such as `context` being NULL."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_renderer_type(context: *mut TCOD_Context) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Set `columns` and `rows` to the recommended console size for this context."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_recommended_console_size( + context: *mut TCOD_Context, + columns: *mut ::std::os::raw::c_int, + rows: *mut ::std::os::raw::c_int, + ) -> TCOD_Error; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_mipmap_ { + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub fwidth: f32, + pub fheight: f32, + pub buf: *mut TCOD_ColorRGB, + pub dirty: bool, +} +#[test] +fn bindgen_test_layout_TCOD_mipmap_() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(TCOD_mipmap_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_mipmap_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fwidth as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(fwidth) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fheight as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(fheight) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dirty as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(dirty) + ) + ); +} +impl Default for TCOD_mipmap_ { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Image { + pub nb_mipmaps: ::std::os::raw::c_int, + pub mipmaps: *mut TCOD_mipmap_, + pub key_color: TCOD_ColorRGB, + pub has_key_color: bool, +} +#[test] +fn bindgen_test_layout_TCOD_Image() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(TCOD_Image)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Image)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_mipmaps as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(nb_mipmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mipmaps as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(mipmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).key_color as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(key_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).has_key_color as *const _ as usize }, + 19usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(has_key_color) + ) + ); +} +impl Default for TCOD_Image { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_image_t = *mut TCOD_Image; +extern "C" { + pub fn TCOD_image_new( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> *mut TCOD_Image; +} +extern "C" { + #[doc = " Return a new image rendered from a console."] + #[doc = ""] + #[doc = " This effectively returns a screenshot of the console."] + pub fn TCOD_image_from_console(console: *const TCOD_Console) -> *mut TCOD_Image; +} +extern "C" { + #[doc = " Same as TCOD_image_from_console, but with an existing image."] + pub fn TCOD_image_refresh_console(image: *mut TCOD_Image, console: *const TCOD_Console); +} +extern "C" { + pub fn TCOD_image_load(filename: *const ::std::os::raw::c_char) -> *mut TCOD_Image; +} +extern "C" { + pub fn TCOD_image_clear(image: *mut TCOD_Image, color: TCOD_color_t); +} +extern "C" { + pub fn TCOD_image_invert(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_hflip(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_rotate90(image: *mut TCOD_Image, numRotations: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_image_vflip(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_scale( + image: *mut TCOD_Image, + neww: ::std::os::raw::c_int, + newh: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_save(image: *const TCOD_Image, filename: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_image_get_size( + image: *const TCOD_Image, + w: *mut ::std::os::raw::c_int, + h: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_get_pixel( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_image_get_alpha( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return a mipmapped pixel of image."] + #[doc = ""] + #[doc = " Mipmaps are updated when you call this, so it can't be called from multiple"] + #[doc = " threads."] + pub fn TCOD_image_get_mipmap_pixel( + image: *mut TCOD_Image, + x0: f32, + y0: f32, + x1: f32, + y1: f32, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_image_put_pixel( + image: *mut TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); +} +extern "C" { + pub fn TCOD_image_blit( + image: *mut TCOD_Image, + console: TCOD_console_t, + x: f32, + y: f32, + bkgnd_flag: TCOD_bkgnd_flag_t, + scalex: f32, + scaley: f32, + angle: f32, + ); +} +extern "C" { + pub fn TCOD_image_blit_rect( + image: *mut TCOD_Image, + console: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + bkgnd_flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_image_blit_2x( + image: *const TCOD_Image, + dest: TCOD_console_t, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + sx: ::std::os::raw::c_int, + sy: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_delete(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_set_key_color(image: *mut TCOD_Image, key_color: TCOD_color_t); +} +extern "C" { + pub fn TCOD_image_is_pixel_transparent( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_List { + _unused: [u8; 0], +} +pub type TCOD_list_t = *mut TCOD_List; +extern "C" { + pub fn TCOD_list_new() -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_allocate(nb_elements: ::std::os::raw::c_int) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_duplicate(l: TCOD_list_t) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_delete(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_push(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_pop(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_peek(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_add_all(l: TCOD_list_t, l2: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_get(l: TCOD_list_t, idx: ::std::os::raw::c_int) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_set( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + idx: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_list_begin(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_end(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_reverse(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_remove_iterator( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_remove(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_remove_iterator_fast( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_remove_fast(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_contains(l: TCOD_list_t, elt: *const ::std::os::raw::c_void) -> bool; +} +extern "C" { + pub fn TCOD_list_clear(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_clear_and_delete(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_size(l: TCOD_list_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_list_insert_before( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + before: ::std::os::raw::c_int, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_is_empty(l: TCOD_list_t) -> bool; +} +extern "C" { + pub fn TCOD_console_set_custom_font( + fontFile: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + nb_char_horiz: ::std::os::raw::c_int, + nb_char_vertic: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_map_ascii_code_to_font( + asciiCode: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_ascii_codes_to_font( + asciiCode: ::std::os::raw::c_int, + nbCodes: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_string_to_font( + s: *const ::std::os::raw::c_char, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_string_to_font_utf( + s: *const wchar_t, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_set_dirty( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + #[doc = "Render and present a console with optional viewport options."] + #[doc = ""] + #[doc = "`console` is the console to render."] + #[doc = ""] + #[doc = "`viewport` is optional."] + #[doc = ""] + #[doc = "Returns a negative values on error. See `TCOD_get_error`."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_console_flush_ex( + console: *mut TCOD_Console, + viewport: *mut TCOD_ViewportOptions, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Render and present the root console to the active display."] + pub fn TCOD_console_flush() -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_check_for_keypress(flags: ::std::os::raw::c_int) -> TCOD_key_t; +} +extern "C" { + pub fn TCOD_console_wait_for_keypress(flush: bool) -> TCOD_key_t; +} +extern "C" { + pub fn TCOD_console_is_key_pressed(key: TCOD_keycode_t) -> bool; +} +extern "C" { + pub fn TCOD_console_from_file(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_load_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_load_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_credits(); +} +extern "C" { + pub fn TCOD_console_credits_reset(); +} +extern "C" { + pub fn TCOD_console_credits_render( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + alpha: bool, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_set_keyboard_repeat( + initial_delay: ::std::os::raw::c_int, + interval: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_disable_keyboard_repeat(); +} +extern "C" { + #[doc = " \\brief Initialize the libtcod graphical engine."] + #[doc = ""] + #[doc = " \\param w The width in tiles."] + #[doc = " \\param h The height in tiles."] + #[doc = " \\param title The title for the window."] + #[doc = " \\param fullscreen Fullscreen option."] + #[doc = " \\param renderer Which renderer to use when rendering the console."] + #[doc = ""] + #[doc = " You may want to call TCOD_console_set_custom_font BEFORE calling this"] + #[doc = " function. By default this function loads libtcod's `terminal.png` image"] + #[doc = " from the working directory."] + #[doc = ""] + #[doc = " Afterwards TCOD_quit must be called before the program exits."] + #[doc = ""] + #[doc = " Returns 0 on success, or -1 on an error, you can check the error with"] + #[doc = " TCOD_sys_get_error()"] + #[doc = ""] + #[doc = " `renderer` and vsync settings can be overridden by the `TCOD_RENDERER` or"] + #[doc = " `TCOD_VSYNC` environment variables."] + #[doc = ""] + #[doc = " Valid case-sensitive options for `TCOD_RENDERER` are:"] + #[doc = " - sdl"] + #[doc = " - opengl"] + #[doc = " - glsl"] + #[doc = " - sdl2"] + #[doc = " - opengl2"] + #[doc = ""] + #[doc = " Valid options for `TCOD_VSYNC` are `0` or `1`."] + #[doc = ""] + #[doc = " \\rst"] + #[doc = " .. versionchanged:: 1.12"] + #[doc = " Now returns -1 on error instead of crashing."] + #[doc = ""] + #[doc = " .. versionchanged:: 1.13"] + #[doc = " Added the `TCOD_RENDERER` and `TCOD_VSYNC` overrides."] + #[doc = " \\endrst"] + pub fn TCOD_console_init_root( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fullscreen: bool, + renderer: TCOD_renderer_t, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_init_root_( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fullscreen: bool, + renderer: TCOD_renderer_t, + vsync: bool, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Shutdown libtcod. This must be called before your program exits."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.8"] + #[doc = " \\endrst"] + pub fn TCOD_quit(); +} +extern "C" { + #[doc = " Change the title string of the active window."] + #[doc = ""] + #[doc = " \\param title A utf8 string."] + pub fn TCOD_console_set_window_title(title: *const ::std::os::raw::c_char); +} +extern "C" { + #[doc = " Set the display to be full-screen or windowed."] + #[doc = ""] + #[doc = " \\param fullscreen If true the display will go full-screen."] + pub fn TCOD_console_set_fullscreen(fullscreen: bool); +} +extern "C" { + #[doc = " Return true if the display is full-screen."] + pub fn TCOD_console_is_fullscreen() -> bool; +} +extern "C" { + #[doc = " Return true if the window has mouse focus."] + pub fn TCOD_console_has_mouse_focus() -> bool; +} +extern "C" { + #[doc = " Return true if the window has keyboard focus."] + #[doc = ""] + #[doc = " \\verbatim embed:rst:leading-asterisk"] + #[doc = " .. versionchanged: 1.7"] + #[doc = " This function was previously broken. It now keeps track of keyboard"] + #[doc = " focus."] + #[doc = " \\endverbatim"] + pub fn TCOD_console_is_active() -> bool; +} +extern "C" { + #[doc = " Return true if the window is closing."] + pub fn TCOD_console_is_window_closed() -> bool; +} +extern "C" { + #[doc = " Return an SDL_Window pointer if one is in use, returns NULL otherwise."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_get_sdl_window() -> *mut SDL_Window; +} +extern "C" { + #[doc = " Return an SDL_Renderer pointer if one is in use, returns NULL otherwise."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_get_sdl_renderer() -> *mut SDL_Renderer; +} +extern "C" { + #[doc = " Render a console over the display."] + #[doc = " \\rst"] + #[doc = " `console` can be any size, the active render will try to scale it to fit"] + #[doc = " the screen."] + #[doc = ""] + #[doc = " The function will only work for the SDL2/OPENGL2 renderers."] + #[doc = ""] + #[doc = " Unlike :any:`TCOD_console_flush` this will not present the display."] + #[doc = " You will need to do that manually, likely with the SDL API."] + #[doc = ""] + #[doc = " Returns 0 on success, or a negative number on a failure such as the"] + #[doc = " incorrect renderer being active."] + #[doc = ""] + #[doc = " .. versionadded:: 1.11"] + #[doc = ""] + #[doc = " .. seealso::"] + #[doc = " :any:`TCOD_sys_get_sdl_window` :any:`TCOD_sys_get_sdl_renderer`"] + #[doc = " \\endrst"] + pub fn TCOD_sys_accumulate_console(console: *const TCOD_Console) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_sys_accumulate_console_( + console: *const TCOD_Console, + viewport: *const SDL_Rect, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_rect_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_frame( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + empty: bool, + flag: TCOD_bkgnd_flag_t, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_get_height_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_ex_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_rect_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_rect_ex_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +impl TCOD_colctrl_t { + pub const TCOD_COLCTRL_NUMBER: TCOD_colctrl_t = TCOD_colctrl_t::TCOD_COLCTRL_5; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_colctrl_t { + TCOD_COLCTRL_1 = 1, + TCOD_COLCTRL_2 = 2, + TCOD_COLCTRL_3 = 3, + TCOD_COLCTRL_4 = 4, + TCOD_COLCTRL_5 = 5, + TCOD_COLCTRL_FORE_RGB = 6, + TCOD_COLCTRL_BACK_RGB = 7, + TCOD_COLCTRL_STOP = 8, +} +extern "C" { + pub fn TCOD_console_set_color_control( + con: TCOD_colctrl_t, + fore: TCOD_color_t, + back: TCOD_color_t, + ); +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_rect_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Print a framed and optionally titled region to a console, using default"] + #[doc = "colors and alignment."] + #[doc = ""] + #[doc = "This function uses Unicode box-drawing characters and a UTF-8 formatted"] + #[doc = "string."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_frame( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + empty: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return the number of lines that would be printed by this formatted string."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_get_height_rect_fmt( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_printn( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_printn_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_n( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_wn( + width: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_printn_frame( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + empty: bool, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_load_xp( + con: *mut TCOD_Console, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_xp( + con: *const TCOD_Console, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_list_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_console_list_save_xp( + console_list: TCOD_list_t, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + #[doc = "Create a new context with the given console size."] + #[doc = ""] + #[doc = ""] + #[doc = "Same as `TCOD_context_new_window`, but the following parameters have"] + #[doc = "different effects:"] + #[doc = ""] + #[doc = "`columns` and `rows` is the desired size of the terminal window."] + #[doc = "The actual size of the window will be derived from this and the given"] + #[doc = "`tileset`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_new_terminal( + columns: ::std::os::raw::c_int, + rows: ::std::os::raw::c_int, + renderer_type: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + vsync: bool, + sdl_window_flags: ::std::os::raw::c_int, + window_title: *const ::std::os::raw::c_char, + out: *mut *mut TCOD_Context, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Create a new context with a window of the given size."] + #[doc = ""] + #[doc = "Same as `TCOD_context_new_terminal`, but the following parameters have"] + #[doc = "different effects:"] + #[doc = ""] + #[doc = "`pixel_width` and `pixel_height` are the desired size of the window in"] + #[doc = "pixels."] + #[doc = ""] + #[doc = "`renderer_type` is a `TCOD_renderer_t` type."] + #[doc = ""] + #[doc = "`tileset` is an optional pointer to a tileset object."] + #[doc = ""] + #[doc = "If `vsync` is True, then vertical sync will be enabled whenever possible."] + #[doc = "A value of true is recommended."] + #[doc = ""] + #[doc = "`sdl_window_flags` is a bitfield of SDL_WindowFlags flags."] + #[doc = "For a window, a value of ``SDL_WINDOW_RESIZABLE`` is recommended."] + #[doc = "For fullscreen, a value of"] + #[doc = "``SDL_WINDOW_RESIZABLE | SDL_WINDOW_FULLSCREEN_DESKTOP`` is recommended."] + #[doc = "You should avoid the ``SDL_WINDOW_FULLSCREEN`` flag whenever possible."] + #[doc = ""] + #[doc = "`window_title` is the title of the opened window."] + #[doc = ""] + #[doc = "`out` is the output for the `TCOD_Context`, must not be NULL."] + #[doc = ""] + #[doc = "Returns a negative error code on failure, `out` will unlikely be set in this"] + #[doc = "case."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_new_window( + pixel_width: ::std::os::raw::c_int, + pixel_height: ::std::os::raw::c_int, + renderer_type: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + vsync: bool, + sdl_window_flags: ::std::os::raw::c_int, + window_title: *const ::std::os::raw::c_char, + out: *mut *mut TCOD_Context, + ) -> TCOD_Error; +} +#[doc = " Private map cell struct."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_MapCell { + pub transparent: bool, + pub walkable: bool, + pub fov: bool, +} +#[test] +fn bindgen_test_layout_TCOD_MapCell() { + assert_eq!( + ::std::mem::size_of::(), + 3usize, + concat!("Size of: ", stringify!(TCOD_MapCell)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_MapCell)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).transparent as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(transparent) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).walkable as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(walkable) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fov as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(fov) + ) + ); +} +#[doc = " Private map struct."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Map { + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub nbcells: ::std::os::raw::c_int, + pub cells: *mut TCOD_MapCell, +} +#[test] +fn bindgen_test_layout_TCOD_Map() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(TCOD_Map)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Map)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nbcells as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(nbcells) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cells as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(cells) + ) + ); +} +impl Default for TCOD_Map { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_map_t = *mut TCOD_Map; +#[repr(u32)] +#[doc = " Field-of-view options."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_fov_algorithm_t { + #[doc = " Basic: http://roguebasin.roguelikedevelopment.org/index.php?title=Ray_casting"] + FOV_BASIC = 0, + #[doc = " Diamond: http://www.geocities.com/temerra/los_rays.html"] + FOV_DIAMOND = 1, + #[doc = " Shadow casting: http://roguebasin.roguelikedevelopment.org/index.php?title=FOV_using_recursive_shadowcasting"] + FOV_SHADOW = 2, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_0 = 3, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_1 = 4, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_2 = 5, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_3 = 6, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_4 = 7, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_5 = 8, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_6 = 9, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_7 = 10, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_8 = 11, + #[doc = " Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos)"] + FOV_RESTRICTIVE = 12, + #[doc = " Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos)"] + NB_FOV_ALGORITHMS = 13, +} +extern "C" { + pub fn TCOD_map_new( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> *mut TCOD_Map; +} +extern "C" { + pub fn TCOD_map_clear(map: *mut TCOD_Map, transparent: bool, walkable: bool); +} +extern "C" { + pub fn TCOD_map_copy(source: *const TCOD_Map, dest: *mut TCOD_Map); +} +extern "C" { + pub fn TCOD_map_set_properties( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + is_transparent: bool, + is_walkable: bool, + ); +} +extern "C" { + pub fn TCOD_map_delete(map: *mut TCOD_Map); +} +extern "C" { + pub fn TCOD_map_compute_fov( + map: *mut TCOD_Map, + player_x: ::std::os::raw::c_int, + player_y: ::std::os::raw::c_int, + max_radius: ::std::os::raw::c_int, + light_walls: bool, + algo: TCOD_fov_algorithm_t, + ); +} +extern "C" { + pub fn TCOD_map_is_in_fov( + map: *const TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_set_in_fov( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fov: bool, + ); +} +extern "C" { + pub fn TCOD_map_is_transparent( + map: *const TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_is_walkable( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_get_width(map: *const TCOD_Map) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_map_get_height(map: *const TCOD_Map) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_map_get_nb_cells(map: *const TCOD_Map) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Return the default tileset, may be NULL."] + #[doc = ""] + #[doc = "A non-NULL return value is a new reference to the global tileset."] + #[doc = "When you are done you will need to call `TCOD_tileset_delete` on this"] + #[doc = "pointer."] + #[doc = ""] + #[doc = "This function is provisional, the API may change in the future."] + pub fn TCOD_get_default_tileset() -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Set the default tileset and update the default display to use it."] + #[doc = ""] + #[doc = "This will keep alive a reference to the given tileset. If you no longer"] + #[doc = "need the pointer then you should call `TCOD_tileset_delete` on it after"] + #[doc = "this function."] + #[doc = ""] + #[doc = "This function is provisional, the API may change in the future."] + pub fn TCOD_set_default_tileset(tileset: *mut TCOD_Tileset); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_noise_type_t { + TCOD_NOISE_PERLIN = 1, + TCOD_NOISE_SIMPLEX = 2, + TCOD_NOISE_WAVELET = 4, + TCOD_NOISE_DEFAULT = 0, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct TCOD_Noise { + pub ndim: ::std::os::raw::c_int, + #[doc = " Randomized map of indexes into buffer"] + pub map: [::std::os::raw::c_uchar; 256usize], + #[doc = " Random 256 x ndim buffer"] + pub buffer: [[f32; 4usize]; 256usize], + pub H: f32, + pub lacunarity: f32, + pub exponent: [f32; 128usize], + pub waveletTileData: *mut f32, + pub rand: TCOD_random_t, + pub noise_type: TCOD_noise_type_t, +} +#[test] +fn bindgen_test_layout_TCOD_Noise() { + assert_eq!( + ::std::mem::size_of::(), + 4904usize, + concat!("Size of: ", stringify!(TCOD_Noise)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Noise)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).map as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(map) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buffer as *const _ as usize }, + 260usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(buffer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).H as *const _ as usize }, + 4356usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(H) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lacunarity as *const _ as usize }, + 4360usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(lacunarity) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).exponent as *const _ as usize }, + 4364usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(exponent) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).waveletTileData as *const _ as usize }, + 4880usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(waveletTileData) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rand as *const _ as usize }, + 4888usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(rand) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).noise_type as *const _ as usize }, + 4896usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(noise_type) + ) + ); +} +impl Default for TCOD_Noise { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_noise_t = *mut TCOD_Noise; +extern "C" { + pub fn TCOD_noise_new( + dimensions: ::std::os::raw::c_int, + hurst: f32, + lacunarity: f32, + random: TCOD_random_t, + ) -> TCOD_noise_t; +} +extern "C" { + pub fn TCOD_noise_set_type(noise: TCOD_noise_t, type_: TCOD_noise_type_t); +} +extern "C" { + pub fn TCOD_noise_get_ex(noise: TCOD_noise_t, f: *mut f32, type_: TCOD_noise_type_t) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_fbm_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_turbulence_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; +} +extern "C" { + pub fn TCOD_noise_get(noise: TCOD_noise_t, f: *mut f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_fbm(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_turbulence(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_delete(noise: TCOD_noise_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_heightmap_t { + pub w: ::std::os::raw::c_int, + pub h: ::std::os::raw::c_int, + pub values: *mut f32, +} +#[test] +fn bindgen_test_layout_TCOD_heightmap_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).values as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(values) + ) + ); +} +impl Default for TCOD_heightmap_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_heightmap_new( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_heightmap_t; +} +extern "C" { + pub fn TCOD_heightmap_delete(hm: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_get_value( + hm: *const TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_get_interpolated_value( + hm: *const TCOD_heightmap_t, + x: f32, + y: f32, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_set_value( + hm: *mut TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + value: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_get_slope( + hm: *const TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_get_normal( + hm: *const TCOD_heightmap_t, + x: f32, + y: f32, + n: *mut f32, + waterLevel: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_count_cells( + hm: *const TCOD_heightmap_t, + min: f32, + max: f32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_heightmap_has_land_on_border(hm: *const TCOD_heightmap_t, waterLevel: f32) -> bool; +} +extern "C" { + pub fn TCOD_heightmap_get_minmax(hm: *const TCOD_heightmap_t, min: *mut f32, max: *mut f32); +} +extern "C" { + pub fn TCOD_heightmap_copy(hm_source: *const TCOD_heightmap_t, hm_dest: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_add(hm: *mut TCOD_heightmap_t, value: f32); +} +extern "C" { + pub fn TCOD_heightmap_scale(hm: *mut TCOD_heightmap_t, value: f32); +} +extern "C" { + pub fn TCOD_heightmap_clamp(hm: *mut TCOD_heightmap_t, min: f32, max: f32); +} +extern "C" { + pub fn TCOD_heightmap_normalize(hm: *mut TCOD_heightmap_t, min: f32, max: f32); +} +extern "C" { + pub fn TCOD_heightmap_clear(hm: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_lerp_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + coef: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_multiply_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_dig_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_dig_bezier( + hm: *mut TCOD_heightmap_t, + px: *mut ::std::os::raw::c_int, + py: *mut ::std::os::raw::c_int, + startRadius: f32, + startDepth: f32, + endRadius: f32, + endDepth: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_rain_erosion( + hm: *mut TCOD_heightmap_t, + nbDrops: ::std::os::raw::c_int, + erosionCoef: f32, + sedimentationCoef: f32, + rnd: TCOD_random_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_kernel_transform( + hm: *mut TCOD_heightmap_t, + kernelsize: ::std::os::raw::c_int, + dx: *const ::std::os::raw::c_int, + dy: *const ::std::os::raw::c_int, + weight: *const f32, + minLevel: f32, + maxLevel: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_voronoi( + hm: *mut TCOD_heightmap_t, + nbPoints: ::std::os::raw::c_int, + nbCoef: ::std::os::raw::c_int, + coef: *const f32, + rnd: TCOD_random_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_mid_point_displacement( + hm: *mut TCOD_heightmap_t, + rnd: TCOD_random_t, + roughness: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_scale_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_islandify(hm: *mut TCOD_heightmap_t, seaLevel: f32, rnd: TCOD_random_t); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct TCOD_lex_t { + pub file_line: ::std::os::raw::c_int, + pub token_type: ::std::os::raw::c_int, + pub token_int_val: ::std::os::raw::c_int, + pub token_idx: ::std::os::raw::c_int, + pub token_float_val: f32, + pub tok: *mut ::std::os::raw::c_char, + pub toklen: ::std::os::raw::c_int, + pub lastStringDelim: ::std::os::raw::c_char, + pub pos: *mut ::std::os::raw::c_char, + pub buf: *mut ::std::os::raw::c_char, + pub filename: *mut ::std::os::raw::c_char, + pub last_javadoc_comment: *mut ::std::os::raw::c_char, + pub nb_symbols: ::std::os::raw::c_int, + pub nb_keywords: ::std::os::raw::c_int, + pub flags: ::std::os::raw::c_int, + pub symbols: [[::std::os::raw::c_char; 5usize]; 100usize], + pub keywords: [[::std::os::raw::c_char; 20usize]; 100usize], + pub simpleCmt: *const ::std::os::raw::c_char, + pub cmtStart: *const ::std::os::raw::c_char, + pub cmtStop: *const ::std::os::raw::c_char, + pub javadocCmtStart: *const ::std::os::raw::c_char, + pub stringDelim: *const ::std::os::raw::c_char, + pub javadoc_read: bool, + pub allocBuf: bool, + pub savept: bool, +} +#[test] +fn bindgen_test_layout_TCOD_lex_t() { + assert_eq!( + ::std::mem::size_of::(), + 2632usize, + concat!("Size of: ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).file_line as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(file_line) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_type as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_type) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_int_val as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_int_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_idx as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_idx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_float_val as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_float_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tok as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(tok) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).toklen as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(toklen) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lastStringDelim as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(lastStringDelim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pos as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(pos) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).filename as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(filename) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_javadoc_comment as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(last_javadoc_comment) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_symbols as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_symbols) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_keywords as *const _ as usize }, + 76usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_keywords) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).symbols as *const _ as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(symbols) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).keywords as *const _ as usize }, + 584usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(keywords) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).simpleCmt as *const _ as usize }, + 2584usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(simpleCmt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStart as *const _ as usize }, + 2592usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStop as *const _ as usize }, + 2600usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStop) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadocCmtStart as *const _ as usize }, + 2608usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadocCmtStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stringDelim as *const _ as usize }, + 2616usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(stringDelim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadoc_read as *const _ as usize }, + 2624usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadoc_read) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).allocBuf as *const _ as usize }, + 2625usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(allocBuf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).savept as *const _ as usize }, + 2626usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(savept) + ) + ); +} +impl Default for TCOD_lex_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_lex_new_intern() -> *mut TCOD_lex_t; +} +extern "C" { + pub fn TCOD_lex_new( + symbols: *mut *const ::std::os::raw::c_char, + keywords: *mut *const ::std::os::raw::c_char, + simpleComment: *const ::std::os::raw::c_char, + commentStart: *const ::std::os::raw::c_char, + commentStop: *const ::std::os::raw::c_char, + javadocCommentStart: *const ::std::os::raw::c_char, + stringDelim: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + ) -> *mut TCOD_lex_t; +} +extern "C" { + pub fn TCOD_lex_delete(lex: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_set_data_buffer(lex: *mut TCOD_lex_t, dat: *mut ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_lex_set_data_file( + lex: *mut TCOD_lex_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_parse(lex: *mut TCOD_lex_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_parse_until_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_parse_until_token_value( + lex: *mut TCOD_lex_t, + token_value: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_expect_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_expect_token_value( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + token_value: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_savepoint(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_restore(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_get_last_javadoc(lex: *mut TCOD_lex_t) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_get_token_name( + token_type: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_get_last_error() -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_hextoint(c: ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_instance() -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_new(algo: TCOD_random_algo_t) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_save(mersenne: TCOD_random_t) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_restore(mersenne: TCOD_random_t, backup: TCOD_random_t); +} +extern "C" { + pub fn TCOD_random_new_from_seed(algo: TCOD_random_algo_t, seed: u32) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_delete(mersenne: TCOD_random_t); +} +extern "C" { + pub fn TCOD_random_set_distribution(mersenne: TCOD_random_t, distribution: TCOD_distribution_t); +} +extern "C" { + pub fn TCOD_random_get_int( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_float(mersenne: TCOD_random_t, min: f32, max: f32) -> f32; +} +extern "C" { + pub fn TCOD_random_get_double(mersenne: TCOD_random_t, min: f64, max: f64) -> f64; +} +extern "C" { + pub fn TCOD_random_get_int_mean( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + mean: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_float_mean( + mersenne: TCOD_random_t, + min: f32, + max: f32, + mean: f32, + ) -> f32; +} +extern "C" { + pub fn TCOD_random_get_double_mean( + mersenne: TCOD_random_t, + min: f64, + max: f64, + mean: f64, + ) -> f64; +} +extern "C" { + pub fn TCOD_random_dice_new(s: *const ::std::os::raw::c_char) -> TCOD_dice_t; +} +extern "C" { + pub fn TCOD_random_dice_roll( + mersenne: TCOD_random_t, + dice: TCOD_dice_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_dice_roll_s( + mersenne: TCOD_random_t, + s: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_mouse_t { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub dx: ::std::os::raw::c_int, + pub dy: ::std::os::raw::c_int, + pub cx: ::std::os::raw::c_int, + pub cy: ::std::os::raw::c_int, + pub dcx: ::std::os::raw::c_int, + pub dcy: ::std::os::raw::c_int, + pub lbutton: bool, + pub rbutton: bool, + pub mbutton: bool, + pub lbutton_pressed: bool, + pub rbutton_pressed: bool, + pub mbutton_pressed: bool, + pub wheel_up: bool, + pub wheel_down: bool, +} +#[test] +fn bindgen_test_layout_TCOD_mouse_t() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_mouse_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_mouse_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dx as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dy as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cx as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cy as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcx as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcy as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton as *const _ as usize }, + 33usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton as *const _ as usize }, + 34usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(mbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton_pressed as *const _ as usize }, + 35usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton_pressed as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton_pressed as *const _ as usize }, + 37usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(mbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wheel_up as *const _ as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(wheel_up) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wheel_down as *const _ as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(wheel_down) + ) + ); +} +extern "C" { + pub fn TCOD_mouse_show_cursor(visible: bool); +} +extern "C" { + pub fn TCOD_mouse_get_status() -> TCOD_mouse_t; +} +extern "C" { + pub fn TCOD_mouse_is_cursor_visible() -> bool; +} +extern "C" { + pub fn TCOD_mouse_move(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_mouse_includes_touch(enable: bool); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_NameGen { + _unused: [u8; 0], +} +pub type TCOD_namegen_t = *mut TCOD_NameGen; +extern "C" { + pub fn TCOD_namegen_parse(filename: *const ::std::os::raw::c_char, random: TCOD_random_t); +} +extern "C" { + pub fn TCOD_namegen_generate( + name: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_namegen_generate_custom( + name: *mut ::std::os::raw::c_char, + rule: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_namegen_get_sets() -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_namegen_destroy(); +} +pub type TCOD_path_func_t = ::std::option::Option< + unsafe extern "C" fn( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + user_data: *mut ::std::os::raw::c_void, + ) -> f32, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Path { + _unused: [u8; 0], +} +pub type TCOD_path_t = *mut TCOD_Path; +extern "C" { + pub fn TCOD_path_new_using_map(map: TCOD_map_t, diagonalCost: f32) -> TCOD_path_t; +} +extern "C" { + pub fn TCOD_path_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_path_t; +} +extern "C" { + pub fn TCOD_path_compute( + path: TCOD_path_t, + ox: ::std::os::raw::c_int, + oy: ::std::os::raw::c_int, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_path_walk( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + recalculate_when_needed: bool, + ) -> bool; +} +extern "C" { + pub fn TCOD_path_is_empty(path: TCOD_path_t) -> bool; +} +extern "C" { + pub fn TCOD_path_size(path: TCOD_path_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_path_reverse(path: TCOD_path_t); +} +extern "C" { + pub fn TCOD_path_get( + path: TCOD_path_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_get_origin( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_get_destination( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_delete(path: TCOD_path_t); +} +#[doc = " Dijkstra data structure"] +#[doc = ""] +#[doc = " All attributes are considered private."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Dijkstra { + pub diagonal_cost: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub nodes_max: ::std::os::raw::c_int, + pub map: TCOD_map_t, + pub func: TCOD_path_func_t, + pub user_data: *mut ::std::os::raw::c_void, + pub distances: *mut ::std::os::raw::c_uint, + pub nodes: *mut ::std::os::raw::c_uint, + pub path: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_Dijkstra() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(TCOD_Dijkstra)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Dijkstra)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).diagonal_cost as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(diagonal_cost) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nodes_max as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(nodes_max) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).map as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(map) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).func as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(func) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).user_data as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(user_data) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).distances as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(distances) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nodes as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(nodes) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).path as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(path) + ) + ); +} +impl Default for TCOD_Dijkstra { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_dijkstra_t = *mut TCOD_Dijkstra; +extern "C" { + pub fn TCOD_dijkstra_new(map: TCOD_map_t, diagonalCost: f32) -> TCOD_dijkstra_t; +} +extern "C" { + pub fn TCOD_dijkstra_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_dijkstra_t; +} +extern "C" { + pub fn TCOD_dijkstra_compute( + dijkstra: TCOD_dijkstra_t, + root_x: ::std::os::raw::c_int, + root_y: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_dijkstra_get_distance( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_dijkstra_path_set( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_is_empty(path: TCOD_dijkstra_t) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_size(path: TCOD_dijkstra_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_dijkstra_reverse(path: TCOD_dijkstra_t); +} +extern "C" { + pub fn TCOD_dijkstra_get( + path: TCOD_dijkstra_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_dijkstra_path_walk( + dijkstra: TCOD_dijkstra_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_delete(dijkstra: TCOD_dijkstra_t); +} +pub type rsize_t = ::std::os::raw::c_ulong; +pub type max_align_t = u128; +#[repr(C)] +#[derive(Debug, Default)] +pub struct TCOD_HeapNode { + pub priority: ::std::os::raw::c_int, + pub data: __IncompleteArrayField<::std::os::raw::c_uchar>, +} +#[test] +fn bindgen_test_layout_TCOD_HeapNode() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(TCOD_HeapNode)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_HeapNode)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).priority as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_HeapNode), + "::", + stringify!(priority) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_HeapNode), + "::", + stringify!(data) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Heap { + pub heap: *mut TCOD_HeapNode, + pub size: ::std::os::raw::c_int, + pub capacity: ::std::os::raw::c_int, + pub node_size: size_t, + pub data_size: size_t, +} +#[test] +fn bindgen_test_layout_TCOD_Heap() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(TCOD_Heap)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Heap)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(heap) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).capacity as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(capacity) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).node_size as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(node_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data_size as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(data_size) + ) + ); +} +impl Default for TCOD_Heap { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_heap_init(heap: *mut TCOD_Heap, data_size: size_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_heap_uninit(heap: *mut TCOD_Heap); +} +extern "C" { + pub fn TCOD_heap_clear(heap: *mut TCOD_Heap); +} +extern "C" { + pub fn TCOD_minheap_push( + minheap: *mut TCOD_Heap, + priority: ::std::os::raw::c_int, + data: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_minheap_pop(minheap: *mut TCOD_Heap, out: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_minheap_heapify(minheap: *mut TCOD_Heap); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_ArrayData { + pub ndim: i8, + pub int_type: ::std::os::raw::c_int, + pub shape: [size_t; 5usize], + pub strides: [size_t; 5usize], + pub data: *mut ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_TCOD_ArrayData() { + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(TCOD_ArrayData)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_ArrayData)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).int_type as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(int_type) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).shape as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(shape) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).strides as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(strides) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(data) + ) + ); +} +impl Default for TCOD_ArrayData { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_BasicGraph2D { + pub cost: TCOD_ArrayData, + pub cardinal: ::std::os::raw::c_int, + pub diagonal: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_BasicGraph2D() { + assert_eq!( + ::std::mem::size_of::(), + 104usize, + concat!("Size of: ", stringify!(TCOD_BasicGraph2D)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_BasicGraph2D)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cost as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_BasicGraph2D), + "::", + stringify!(cost) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cardinal as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(TCOD_BasicGraph2D), + "::", + stringify!(cardinal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).diagonal as *const _ as usize }, + 100usize, + concat!( + "Offset of field: ", + stringify!(TCOD_BasicGraph2D), + "::", + stringify!(diagonal) + ) + ); +} +impl Default for TCOD_BasicGraph2D { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Pathfinder { + pub ndim: i8, + pub shape: [size_t; 4usize], + pub owns_distance: bool, + pub owns_graph: bool, + pub owns_traversal: bool, + pub distance: TCOD_ArrayData, + pub graph: TCOD_BasicGraph2D, + pub traversal: TCOD_ArrayData, + pub heap: TCOD_Heap, +} +#[test] +fn bindgen_test_layout_TCOD_Pathfinder() { + assert_eq!( + ::std::mem::size_of::(), + 376usize, + concat!("Size of: ", stringify!(TCOD_Pathfinder)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Pathfinder)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).shape as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(shape) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).owns_distance as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(owns_distance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).owns_graph as *const _ as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(owns_graph) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).owns_traversal as *const _ as usize }, + 42usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(owns_traversal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).distance as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(distance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).graph as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(graph) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).traversal as *const _ as usize }, + 248usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(traversal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 344usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(heap) + ) + ); +} +impl Default for TCOD_Pathfinder { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_pf_new(ndim: ::std::os::raw::c_int, shape: *const size_t) -> *mut TCOD_Pathfinder; +} +extern "C" { + pub fn TCOD_pf_delete(path: *mut TCOD_Pathfinder); +} +extern "C" { + pub fn TCOD_pf_set_distance_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + ); +} +extern "C" { + pub fn TCOD_pf_set_graph2d_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + cardinal: ::std::os::raw::c_int, + diagonal: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_pf_set_traversal_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + ); +} +extern "C" { + pub fn TCOD_pf_recompile(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_pf_compute(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_pf_compute_step(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Frontier { + pub ndim: i8, + pub active_dist: ::std::os::raw::c_int, + pub active_index: [::std::os::raw::c_int; 4usize], + pub heap: TCOD_Heap, +} +#[test] +fn bindgen_test_layout_TCOD_Frontier() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(TCOD_Frontier)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Frontier)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).active_dist as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(active_dist) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).active_index as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(active_index) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(heap) + ) + ); +} +impl Default for TCOD_Frontier { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + #[doc = "Create a new pathfinder frontier."] + #[doc = ""] + #[doc = "`ndim` is the number of dimensions. Must be in the range `1 <= n <= 4`."] + pub fn TCOD_frontier_new(ndim: ::std::os::raw::c_int) -> *mut TCOD_Frontier; +} +extern "C" { + #[doc = "Delete a pathfinder frontier."] + pub fn TCOD_frontier_delete(frontier: *mut TCOD_Frontier); +} +extern "C" { + #[doc = "Pop the next node from this frontier."] + #[doc = ""] + #[doc = "The popped node variables will placed in the `active_dist` and"] + #[doc = "`active_index` attributes."] + pub fn TCOD_frontier_pop(frontier: *mut TCOD_Frontier) -> TCOD_Error; +} +extern "C" { + #[doc = "Add a node to this frontier."] + #[doc = ""] + #[doc = "`index[frontier->ndim]` is the position of the node to add to the frontier."] + #[doc = ""] + #[doc = "`dist` is the total distance of the node. This should be a low number"] + #[doc = "like 0, but can also be a negative number such as `INT_MIN`."] + #[doc = "When adding a node as an edge then `dist` is `frontier->active_dist` plus"] + #[doc = "the cost of the edge."] + #[doc = ""] + #[doc = "`heuristic` is the true priority of the node, used to affect node order."] + #[doc = "For Dijkstra-like algorithms this should be the same as `dist`."] + #[doc = "For A* this should be `dist` plus the maximum possible distance to the"] + #[doc = "goal."] + pub fn TCOD_frontier_push( + frontier: *mut TCOD_Frontier, + index: *const ::std::os::raw::c_int, + dist: ::std::os::raw::c_int, + heuristic: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return the current number of nodes in this frontier."] + pub fn TCOD_frontier_size(frontier: *const TCOD_Frontier) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Remove all nodes from this frontier."] + pub fn TCOD_frontier_clear(frontier: *mut TCOD_Frontier) -> TCOD_Error; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_value_type_t { + TCOD_TYPE_NONE = 0, + TCOD_TYPE_BOOL = 1, + TCOD_TYPE_CHAR = 2, + TCOD_TYPE_INT = 3, + TCOD_TYPE_FLOAT = 4, + TCOD_TYPE_STRING = 5, + TCOD_TYPE_COLOR = 6, + TCOD_TYPE_DICE = 7, + TCOD_TYPE_VALUELIST00 = 8, + TCOD_TYPE_VALUELIST01 = 9, + TCOD_TYPE_VALUELIST02 = 10, + TCOD_TYPE_VALUELIST03 = 11, + TCOD_TYPE_VALUELIST04 = 12, + TCOD_TYPE_VALUELIST05 = 13, + TCOD_TYPE_VALUELIST06 = 14, + TCOD_TYPE_VALUELIST07 = 15, + TCOD_TYPE_VALUELIST08 = 16, + TCOD_TYPE_VALUELIST09 = 17, + TCOD_TYPE_VALUELIST10 = 18, + TCOD_TYPE_VALUELIST11 = 19, + TCOD_TYPE_VALUELIST12 = 20, + TCOD_TYPE_VALUELIST13 = 21, + TCOD_TYPE_VALUELIST14 = 22, + TCOD_TYPE_VALUELIST15 = 23, + TCOD_TYPE_CUSTOM00 = 24, + TCOD_TYPE_CUSTOM01 = 25, + TCOD_TYPE_CUSTOM02 = 26, + TCOD_TYPE_CUSTOM03 = 27, + TCOD_TYPE_CUSTOM04 = 28, + TCOD_TYPE_CUSTOM05 = 29, + TCOD_TYPE_CUSTOM06 = 30, + TCOD_TYPE_CUSTOM07 = 31, + TCOD_TYPE_CUSTOM08 = 32, + TCOD_TYPE_CUSTOM09 = 33, + TCOD_TYPE_CUSTOM10 = 34, + TCOD_TYPE_CUSTOM11 = 35, + TCOD_TYPE_CUSTOM12 = 36, + TCOD_TYPE_CUSTOM13 = 37, + TCOD_TYPE_CUSTOM14 = 38, + TCOD_TYPE_CUSTOM15 = 39, + TCOD_TYPE_LIST = 1024, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union TCOD_value_t { + pub b: bool, + pub c: ::std::os::raw::c_char, + pub i: i32, + pub f: f32, + pub s: *mut ::std::os::raw::c_char, + pub col: TCOD_color_t, + pub dice: TCOD_dice_t, + pub list: TCOD_list_t, + pub custom: *mut ::std::os::raw::c_void, + _bindgen_union_align: [u64; 2usize], +} +#[test] +fn bindgen_test_layout_TCOD_value_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_value_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_value_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(b) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(c) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).i as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(i) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).f as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(f) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).s as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(s) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).col as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(col) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dice as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(dice) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).list as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(list) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).custom as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(custom) + ) + ); +} +impl Default for TCOD_value_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_parser_struct_t = *mut TCOD_ParserStruct; +extern "C" { + pub fn TCOD_struct_get_name(def: TCOD_parser_struct_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_struct_add_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_list_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list_sized( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + size: ::std::os::raw::c_int, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_flag(def: TCOD_parser_struct_t, propname: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_struct_add_structure( + def: TCOD_parser_struct_t, + sub_structure: TCOD_parser_struct_t, + ); +} +extern "C" { + pub fn TCOD_struct_is_mandatory( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_struct_get_type( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> TCOD_value_type_t; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_parser_listener_t { + pub new_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub new_flag: + ::std::option::Option bool>, + pub new_property: ::std::option::Option< + unsafe extern "C" fn( + propname: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + value: TCOD_value_t, + ) -> bool, + >, + pub end_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub error: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_TCOD_parser_listener_t() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_parser_listener_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_parser_listener_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).new_struct as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_struct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).new_flag as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_flag) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).new_property as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_property) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).end_struct as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(end_struct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).error as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(error) + ) + ); +} +pub type TCOD_parser_custom_t = ::std::option::Option< + unsafe extern "C" fn( + lex: *mut TCOD_lex_t, + listener: *mut TCOD_parser_listener_t, + str: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + ) -> TCOD_value_t, +>; +pub type TCOD_parser_t = *mut TCOD_Parser; +extern "C" { + pub fn TCOD_parser_new() -> TCOD_parser_t; +} +extern "C" { + pub fn TCOD_parser_new_struct( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_parser_struct_t; +} +extern "C" { + pub fn TCOD_parser_new_custom_type( + parser: TCOD_parser_t, + custom_type_parser: TCOD_parser_custom_t, + ) -> TCOD_value_type_t; +} +extern "C" { + pub fn TCOD_parser_run( + parser: TCOD_parser_t, + filename: *const ::std::os::raw::c_char, + listener: *mut TCOD_parser_listener_t, + ); +} +extern "C" { + pub fn TCOD_parser_delete(parser: TCOD_parser_t); +} +extern "C" { + pub fn TCOD_parser_error(msg: *const ::std::os::raw::c_char, ...); +} +extern "C" { + pub fn TCOD_parser_has_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_parser_get_bool_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_parser_get_char_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_parser_get_int_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_parser_get_float_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> f32; +} +extern "C" { + pub fn TCOD_parser_get_string_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_parser_get_color_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_parser_get_dice_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_dice_t; +} +extern "C" { + pub fn TCOD_parser_get_dice_property_py( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + dice: *mut TCOD_dice_t, + ); +} +extern "C" { + pub fn TCOD_parser_get_custom_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_parser_get_list_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + ) -> TCOD_list_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_ParserStruct { + pub name: *mut ::std::os::raw::c_char, + pub flags: TCOD_list_t, + pub props: TCOD_list_t, + pub lists: TCOD_list_t, + pub structs: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_ParserStruct() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_ParserStruct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_ParserStruct)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(props) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lists as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(lists) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(structs) + ) + ); +} +impl Default for TCOD_ParserStruct { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_struct_int_t = TCOD_ParserStruct; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Parser { + pub structs: TCOD_list_t, + pub customs: [TCOD_parser_custom_t; 16usize], + pub fatal: bool, + pub props: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_Parser() { + assert_eq!( + ::std::mem::size_of::(), + 152usize, + concat!("Size of: ", stringify!(TCOD_Parser)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Parser)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(structs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).customs as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(customs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fatal as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(fatal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(props) + ) + ); +} +impl Default for TCOD_Parser { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_parser_int_t = TCOD_Parser; +extern "C" { + pub fn TCOD_parse_bool_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_char_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_integer_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_float_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_string_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_color_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_dice_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_value_list_value( + def: *mut TCOD_struct_int_t, + listnum: ::std::os::raw::c_int, + ) -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_property_value( + parser: *mut TCOD_parser_int_t, + def: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + list: bool, + ) -> TCOD_value_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetAtlasOpenGL { + pub tileset: *mut TCOD_Tileset, + pub observer: *mut TCOD_TilesetObserver, + pub texture: u32, + pub texture_size: ::std::os::raw::c_int, + pub texture_columns: ::std::os::raw::c_int, + pub texture_rows: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_TilesetAtlasOpenGL() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(TCOD_TilesetAtlasOpenGL)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_TilesetAtlasOpenGL)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(tileset) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).observer as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(observer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_size as *const _ as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_columns as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_columns) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_rows as *const _ as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_rows) + ) + ); +} +impl Default for TCOD_TilesetAtlasOpenGL { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGLCommon { + pub window: *mut SDL_Window, + pub glcontext: *mut ::std::os::raw::c_void, + pub atlas: *mut TCOD_TilesetAtlasOpenGL, + pub sdl_subsystems: u32, + pub last_offset_x: f64, + pub last_offset_y: f64, + pub last_scale_x: f64, + pub last_scale_y: f64, +} +#[test] +fn bindgen_test_layout_TCOD_RendererGLCommon() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(TCOD_RendererGLCommon)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererGLCommon)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(window) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).glcontext as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(glcontext) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).atlas as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(atlas) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).sdl_subsystems as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(sdl_subsystems) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).last_offset_x as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(last_offset_x) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).last_offset_y as *const _ as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(last_offset_y) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).last_scale_x as *const _ as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(last_scale_x) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).last_scale_y as *const _ as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(last_scale_y) + ) + ); +} +impl Default for TCOD_RendererGLCommon { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_gl_atlas_new(tileset: *mut TCOD_Tileset) -> *mut TCOD_TilesetAtlasOpenGL; +} +extern "C" { + pub fn TCOD_gl_atlas_delete(atlas: *mut TCOD_TilesetAtlasOpenGL); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGL1 { + pub common: TCOD_RendererGLCommon, + pub background_texture: u32, + pub background_width: ::std::os::raw::c_int, + pub background_height: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_RendererGL1() { + assert_eq!( + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(TCOD_RendererGL1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererGL1)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).common as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL1), + "::", + stringify!(common) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).background_texture as *const _ as usize + }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL1), + "::", + stringify!(background_texture) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).background_width as *const _ as usize + }, + 68usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL1), + "::", + stringify!(background_width) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).background_height as *const _ as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL1), + "::", + stringify!(background_height) + ) + ); +} +impl Default for TCOD_RendererGL1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_renderer_init_gl1( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + vsync: bool, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGL2 { + pub common: TCOD_RendererGLCommon, + pub program: u32, + pub console_textures: [u32; 3usize], + pub console_width: ::std::os::raw::c_int, + pub console_height: ::std::os::raw::c_int, + pub vertex_buffer: u32, +} +#[test] +fn bindgen_test_layout_TCOD_RendererGL2() { + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(TCOD_RendererGL2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererGL2)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).common as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(common) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).program as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(program) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).console_textures as *const _ as usize + }, + 68usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_textures) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).console_width as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).console_height as *const _ as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vertex_buffer as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(vertex_buffer) + ) + ); +} +impl Default for TCOD_RendererGL2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_renderer_new_gl2( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + vsync: bool, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Texture { + _unused: [u8; 0], +} +#[doc = "An SDL2 tileset atlas. This prepares a tileset for use with SDL2."] +#[doc = "\\rst"] +#[doc = ".. versionadded:: 1.16"] +#[doc = "\\endrst"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetAtlasSDL2 { + #[doc = " The renderer used to create this atlas."] + pub renderer: *mut SDL_Renderer, + #[doc = " The atlas texture."] + pub texture: *mut SDL_Texture, + #[doc = " The tileset used to create this atlas. Internal use only."] + pub tileset: *mut TCOD_Tileset, + #[doc = " Internal use only."] + pub observer: *mut TCOD_TilesetObserver, + #[doc = " Internal use only."] + pub texture_columns: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_TilesetAtlasSDL2() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_TilesetAtlasSDL2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_TilesetAtlasSDL2)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).renderer as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(renderer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(texture) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(tileset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).observer as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(observer) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_columns as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(texture_columns) + ) + ); +} +impl Default for TCOD_TilesetAtlasSDL2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[doc = "The renderer data for an SDL2 rendering context."] +#[doc = "Internal use only."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererSDL2 { + pub window: *mut SDL_Window, + pub renderer: *mut SDL_Renderer, + pub atlas: *mut TCOD_TilesetAtlasSDL2, + pub cache_console: *mut TCOD_Console, + pub cache_texture: *mut SDL_Texture, + pub sdl_subsystems: u32, + pub last_offset_x: f64, + pub last_offset_y: f64, + pub last_scale_x: f64, + pub last_scale_y: f64, +} +#[test] +fn bindgen_test_layout_TCOD_RendererSDL2() { + assert_eq!( + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(TCOD_RendererSDL2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererSDL2)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(window) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).renderer as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(renderer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).atlas as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(atlas) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cache_console as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(cache_console) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cache_texture as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(cache_texture) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).sdl_subsystems as *const _ as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(sdl_subsystems) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_offset_x as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_offset_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_offset_y as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_offset_y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_scale_x as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_scale_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_scale_y as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_scale_y) + ) + ); +} +impl Default for TCOD_RendererSDL2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + #[doc = "Return a libtcod rendering context using an SDL2 renderer."] + pub fn TCOD_renderer_init_sdl2( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + renderer_flags: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; +} +extern "C" { + #[doc = "Return a new SDL2 atlas created from a tileset for an SDL2 renderer."] + #[doc = ""] + #[doc = "You may delete the tileset if you no longer have use for it."] + #[doc = ""] + #[doc = "Will return NULL on an error, you can check the error with"] + #[doc = "`TCOD_get_error`."] + pub fn TCOD_sdl2_atlas_new( + renderer: *mut SDL_Renderer, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_TilesetAtlasSDL2; +} +extern "C" { + #[doc = "Delete an SDL2 tileset atlas."] + pub fn TCOD_sdl2_atlas_delete(atlas: *mut TCOD_TilesetAtlasSDL2); +} +extern "C" { + #[doc = "Render a console onto a managed target texture."] + #[doc = ""] + #[doc = "`atlas` is an SDL2 atlas created with `TCOD_sdl2_atlas_new`."] + #[doc = "The renderer used to make this `atlas` must support"] + #[doc = "`SDL_RENDERER_TARGETTEXTURE`, unless `target` is NULL."] + #[doc = ""] + #[doc = "`console` is a non-NULL pointer to the libtcod console you want to render."] + #[doc = ""] + #[doc = "`cache` can be NULL, or be pointer to a console pointer."] + #[doc = "If `*cache` is NULL then a console will be created."] + #[doc = "If `*cache` isn't NULL then the console pointed to might be deleted or"] + #[doc = "recreated, especially if it does not match the size of `console`."] + #[doc = ""] + #[doc = "`target` can be NULL, or be pointer to where you want the output texture"] + #[doc = "to be placed."] + #[doc = "The texture at `*target` may be deleted or recreated. When this function"] + #[doc = "is successful then the texture at `*target` will be non-NULL and will be"] + #[doc = "exactly fitted to the size of `console` and the tile size of `atlas`."] + #[doc = ""] + #[doc = "If `target` is NULL when the current render target is used instead, the"] + #[doc = "drawn area will not be scaled to fit the render target."] + #[doc = ""] + #[doc = "If SDL2 ever provides a `SDL_RENDER_TARGETS_RESET` event then the console"] + #[doc = "at `*cache` must be deleted and set to NULL, or else the next render will"] + #[doc = "only partially update the texture at `*target`."] + #[doc = ""] + #[doc = "Returns a negative value on an error, check `TCOD_get_error`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_sdl2_render_texture( + atlas: *const TCOD_TilesetAtlasSDL2, + console: *const TCOD_Console, + cache: *mut *mut TCOD_Console, + target: *mut *mut SDL_Texture, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_sys_startup(); +} +extern "C" { + pub fn TCOD_sys_shutdown(); +} +extern "C" { + pub fn TCOD_sys_elapsed_milli() -> u32; +} +extern "C" { + pub fn TCOD_sys_elapsed_seconds() -> f32; +} +extern "C" { + pub fn TCOD_sys_sleep_milli(val: u32); +} +extern "C" { + pub fn TCOD_sys_set_fps(val: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_sys_get_fps() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_sys_get_last_frame_length() -> f32; +} +extern "C" { + pub fn TCOD_sys_save_screenshot(filename: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_sys_force_fullscreen_resolution( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_set_renderer(renderer: TCOD_renderer_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_sys_get_renderer() -> TCOD_renderer_t; +} +extern "C" { + pub fn TCOD_sys_get_current_resolution( + w: *mut ::std::os::raw::c_int, + h: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_fullscreen_offsets( + offx: *mut ::std::os::raw::c_int, + offy: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_char_size(w: *mut ::std::os::raw::c_int, h: *mut ::std::os::raw::c_int); +} +extern "C" { + #[doc = " Upload a tile to the active tileset."] + #[doc = ""] + #[doc = " `asciiCode` is the Unicode codepoint for this tile."] + #[doc = ""] + #[doc = " `fontx` and `fonty` are the tile-coordinates on the active tilemap."] + #[doc = ""] + #[doc = " `img` is the tile to upload."] + #[doc = ""] + #[doc = " `x` and `y` are the upper-left pixel-coordinates of the tile on the `img`."] + pub fn TCOD_sys_update_char( + asciiCode: ::std::os::raw::c_int, + fontx: ::std::os::raw::c_int, + fonty: ::std::os::raw::c_int, + img: TCOD_image_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_SDL_window() -> *mut SDL_Window; +} +extern "C" { + pub fn TCOD_sys_get_SDL_renderer() -> *mut SDL_Renderer; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_event_t { + TCOD_EVENT_NONE = 0, + TCOD_EVENT_KEY_PRESS = 1, + TCOD_EVENT_KEY_RELEASE = 2, + TCOD_EVENT_KEY = 3, + TCOD_EVENT_MOUSE_MOVE = 4, + TCOD_EVENT_MOUSE_PRESS = 8, + TCOD_EVENT_MOUSE_RELEASE = 16, + TCOD_EVENT_MOUSE = 28, + TCOD_EVENT_FINGER_MOVE = 32, + TCOD_EVENT_FINGER_PRESS = 64, + TCOD_EVENT_FINGER_RELEASE = 128, + TCOD_EVENT_FINGER = 224, + TCOD_EVENT_ANY = 255, +} +extern "C" { + pub fn TCOD_sys_wait_for_event( + eventMask: ::std::os::raw::c_int, + key: *mut TCOD_key_t, + mouse: *mut TCOD_mouse_t, + flush: bool, + ) -> TCOD_event_t; +} +extern "C" { + pub fn TCOD_sys_check_for_event( + eventMask: ::std::os::raw::c_int, + key: *mut TCOD_key_t, + mouse: *mut TCOD_mouse_t, + ) -> TCOD_event_t; +} +extern "C" { + pub fn TCOD_sys_create_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_delete_file(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_delete_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_is_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_get_directory_content( + path: *const ::std::os::raw::c_char, + pattern: *const ::std::os::raw::c_char, + ) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_sys_file_exists(filename: *const ::std::os::raw::c_char, ...) -> bool; +} +extern "C" { + pub fn TCOD_sys_read_file( + filename: *const ::std::os::raw::c_char, + buf: *mut *mut ::std::os::raw::c_uchar, + size: *mut size_t, + ) -> bool; +} +extern "C" { + pub fn TCOD_sys_write_file( + filename: *const ::std::os::raw::c_char, + buf: *mut ::std::os::raw::c_uchar, + size: u32, + ) -> bool; +} +extern "C" { + pub fn TCOD_sys_clipboard_set(value: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_clipboard_get() -> *mut ::std::os::raw::c_char; +} +pub type TCOD_thread_t = *mut ::std::os::raw::c_void; +pub type TCOD_semaphore_t = *mut ::std::os::raw::c_void; +pub type TCOD_mutex_t = *mut ::std::os::raw::c_void; +pub type TCOD_cond_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_thread_new( + func: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, + >, + data: *mut ::std::os::raw::c_void, + ) -> TCOD_thread_t; +} +extern "C" { + pub fn TCOD_thread_delete(th: TCOD_thread_t); +} +extern "C" { + pub fn TCOD_sys_get_num_cores() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_thread_wait(th: TCOD_thread_t); +} +extern "C" { + pub fn TCOD_mutex_new() -> TCOD_mutex_t; +} +extern "C" { + pub fn TCOD_mutex_in(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_mutex_out(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_mutex_delete(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_semaphore_new(initVal: ::std::os::raw::c_int) -> TCOD_semaphore_t; +} +extern "C" { + pub fn TCOD_semaphore_lock(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_semaphore_unlock(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_semaphore_delete(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_condition_new() -> TCOD_cond_t; +} +extern "C" { + pub fn TCOD_condition_signal(sem: TCOD_cond_t); +} +extern "C" { + pub fn TCOD_condition_broadcast(sem: TCOD_cond_t); +} +extern "C" { + pub fn TCOD_condition_wait(sem: TCOD_cond_t, mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_condition_delete(sem: TCOD_cond_t); +} +pub type TCOD_library_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_load_library(path: *const ::std::os::raw::c_char) -> TCOD_library_t; +} +extern "C" { + pub fn TCOD_get_function_address( + library: TCOD_library_t, + function_name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_close_library(arg1: TCOD_library_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Surface { + _unused: [u8; 0], +} +pub type SDL_renderer_t = + ::std::option::Option; +extern "C" { + pub fn TCOD_sys_register_SDL_renderer(renderer: SDL_renderer_t); +} +extern "C" { + #[doc = "Load a BDF font from a file path."] + #[doc = ""] + #[doc = "For the best results, you should use a BDF font with a cell-based"] + #[doc = "monospace alignment."] + #[doc = ""] + #[doc = "May return NULL on failure. See `TCOD_get_error` for the error message."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_load_bdf(path: *const ::std::os::raw::c_char) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Load a BDF font from memory."] + #[doc = ""] + #[doc = "`size` is the byte length of `buffer`. `buffer` is the BDF data to load."] + #[doc = ""] + #[doc = "May return NULL on failure. See `TCOD_get_error` for the error message."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_load_bdf_memory( + size: ::std::os::raw::c_int, + buffer: *const ::std::os::raw::c_uchar, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Try to return a fall-back Tileset, may return NULL."] + #[doc = ""] + #[doc = " Used when one is needed, but was not provided by the user."] + pub fn TCOD_tileset_load_fallback_font_( + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Render a console to a SDL_Surface with a software renderer."] + #[doc = ""] + #[doc = "`tileset` is the tiles to render with, must not be NULL."] + #[doc = ""] + #[doc = "`console` is the console to render, must not be NULL."] + #[doc = ""] + #[doc = "`cache` is an optional pointer to a consoled used as a cache. The console"] + #[doc = "at `*cache` will be created or modified. The `cache` will be used to skip"] + #[doc = "drawing already drawn tiles on any subsequent calls."] + #[doc = ""] + #[doc = "`surface_out` is a pointer to where to put the surface will be managed."] + #[doc = "The surface at `*surface_out` will be created or modified and will change"] + #[doc = "to match the size of `console` and `tileset`. The pixel format will be"] + #[doc = "SDL_PIXELFORMAT_RGBA32."] + #[doc = ""] + #[doc = "Returns a negative value on error, see `TCOD_get_error`."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_tileset_render_to_surface( + tileset: *const TCOD_Tileset, + console: *const TCOD_Console, + cache: *mut *mut TCOD_Console, + surface_out: *mut *mut SDL_Surface, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Return a tileset from a TrueType font file."] + pub fn TCOD_load_truetype_font_( + path: *const ::std::os::raw::c_char, + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Set the global tileset from a TrueType font file."] + pub fn TCOD_tileset_load_truetype_( + path: *const ::std::os::raw::c_char, + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Text { + _unused: [u8; 0], +} +pub type TCOD_text_t = *mut TCOD_Text; +extern "C" { + pub fn TCOD_text_init( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + max_chars: ::std::os::raw::c_int, + ) -> TCOD_text_t; +} +extern "C" { + pub fn TCOD_text_init2( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + max_chars: ::std::os::raw::c_int, + ) -> TCOD_text_t; +} +extern "C" { + pub fn TCOD_text_set_pos(txt: TCOD_text_t, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_text_set_properties( + txt: TCOD_text_t, + cursor_char: ::std::os::raw::c_int, + blink_interval: ::std::os::raw::c_int, + prompt: *const ::std::os::raw::c_char, + tab_size: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_text_set_colors( + txt: TCOD_text_t, + fore: TCOD_color_t, + back: TCOD_color_t, + back_transparency: f32, + ); +} +extern "C" { + pub fn TCOD_text_update(txt: TCOD_text_t, key: TCOD_key_t) -> bool; +} +extern "C" { + pub fn TCOD_text_render(txt: TCOD_text_t, con: TCOD_console_t); +} +extern "C" { + pub fn TCOD_text_get(txt: TCOD_text_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_text_reset(txt: TCOD_text_t); +} +extern "C" { + pub fn TCOD_text_delete(txt: TCOD_text_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Zip { + _unused: [u8; 0], +} +pub type TCOD_zip_t = *mut TCOD_Zip; +extern "C" { + pub fn TCOD_zip_new() -> TCOD_zip_t; +} +extern "C" { + pub fn TCOD_zip_delete(zip: TCOD_zip_t); +} +extern "C" { + pub fn TCOD_zip_put_char(zip: TCOD_zip_t, val: ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_zip_put_int(zip: TCOD_zip_t, val: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_zip_put_float(zip: TCOD_zip_t, val: f32); +} +extern "C" { + pub fn TCOD_zip_put_string(zip: TCOD_zip_t, val: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_zip_put_color(zip: TCOD_zip_t, val: TCOD_color_t); +} +extern "C" { + pub fn TCOD_zip_put_image(zip: TCOD_zip_t, val: TCOD_image_t); +} +extern "C" { + pub fn TCOD_zip_put_console(zip: TCOD_zip_t, val: *const TCOD_Console); +} +extern "C" { + #[doc = "Write a TCOD_Random* object."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_zip_put_random(zip: TCOD_zip_t, val: *const TCOD_Random); +} +extern "C" { + pub fn TCOD_zip_put_data( + zip: TCOD_zip_t, + nbBytes: ::std::os::raw::c_int, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn TCOD_zip_get_current_bytes(zip: TCOD_zip_t) -> u32; +} +extern "C" { + pub fn TCOD_zip_save_to_file( + zip: TCOD_zip_t, + filename: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_load_from_file( + zip: TCOD_zip_t, + filename: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_char(zip: TCOD_zip_t) -> ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_zip_get_int(zip: TCOD_zip_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_float(zip: TCOD_zip_t) -> f32; +} +extern "C" { + pub fn TCOD_zip_get_string(zip: TCOD_zip_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_zip_get_color(zip: TCOD_zip_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_zip_get_image(zip: TCOD_zip_t) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_zip_get_console(zip: TCOD_zip_t) -> TCOD_console_t; +} +extern "C" { + #[doc = "Read a TCOD_Random* object."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_zip_get_random(zip: TCOD_zip_t) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_zip_get_data( + zip: TCOD_zip_t, + nbBytes: ::std::os::raw::c_int, + data: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_remaining_bytes(zip: TCOD_zip_t) -> u32; +} +extern "C" { + pub fn TCOD_zip_skip_bytes(zip: TCOD_zip_t, nbBytes: u32); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SDL_Event { + _unused: [u8; 0], +} +extern "C" { + #[doc = " Parse an SDL_Event into a key event and return the relevant TCOD_event_t."] + #[doc = ""] + #[doc = " Returns TCOD_EVENT_NONE if the event wasn't keyboard related."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_process_key_event(in_: *const SDL_Event, out: *mut TCOD_key_t) -> TCOD_event_t; +} +extern "C" { + #[doc = " Parse an SDL_Event into a mouse event and return the relevant TCOD_event_t."] + #[doc = ""] + #[doc = " Returns TCOD_EVENT_NONE if the event wasn't mouse related."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_process_mouse_event( + in_: *const SDL_Event, + out: *mut TCOD_mouse_t, + ) -> TCOD_event_t; +} +pub type __builtin_va_list = [__va_list_tag; 1usize]; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __va_list_tag { + pub gp_offset: ::std::os::raw::c_uint, + pub fp_offset: ::std::os::raw::c_uint, + pub overflow_arg_area: *mut ::std::os::raw::c_void, + pub reg_save_area: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout___va_list_tag() { + assert_eq!( + ::std::mem::size_of::<__va_list_tag>(), + 24usize, + concat!("Size of: ", stringify!(__va_list_tag)) + ); + assert_eq!( + ::std::mem::align_of::<__va_list_tag>(), + 8usize, + concat!("Alignment of ", stringify!(__va_list_tag)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__va_list_tag>())).gp_offset as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(gp_offset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__va_list_tag>())).fp_offset as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(fp_offset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__va_list_tag>())).overflow_arg_area as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(overflow_arg_area) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<__va_list_tag>())).reg_save_area as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(reg_save_area) + ) + ); +} +impl Default for __va_list_tag { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} diff --git a/tcod_sys/x86_64-pc-windows-gnu_bindings.rs b/tcod_sys/x86_64-pc-windows-gnu_bindings.rs new file mode 100644 index 000000000..2a6a84b71 --- /dev/null +++ b/tcod_sys/x86_64-pc-windows-gnu_bindings.rs @@ -0,0 +1,12541 @@ +/* automatically generated by rust-bindgen */ + +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub const fn new() -> Self { + __IncompleteArrayField(::std::marker::PhantomData, []) + } + #[inline] + pub fn as_ptr(&self) -> *const T { + self as *const _ as *const T + } + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut T { + self as *mut _ as *mut T + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::std::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::std::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} +pub const __llvm__: u32 = 1; +pub const __clang__: u32 = 1; +pub const __clang_major__: u32 = 10; +pub const __clang_minor__: u32 = 0; +pub const __clang_patchlevel__: u32 = 0; +pub const __clang_version__: &'static [u8; 8usize] = b"10.0.0 \0"; +pub const __GNUC__: u32 = 4; +pub const __GNUC_MINOR__: u32 = 2; +pub const __GNUC_PATCHLEVEL__: u32 = 1; +pub const __GXX_ABI_VERSION: u32 = 1002; +pub const __ATOMIC_RELAXED: u32 = 0; +pub const __ATOMIC_CONSUME: u32 = 1; +pub const __ATOMIC_ACQUIRE: u32 = 2; +pub const __ATOMIC_RELEASE: u32 = 3; +pub const __ATOMIC_ACQ_REL: u32 = 4; +pub const __ATOMIC_SEQ_CST: u32 = 5; +pub const __OPENCL_MEMORY_SCOPE_WORK_ITEM: u32 = 0; +pub const __OPENCL_MEMORY_SCOPE_WORK_GROUP: u32 = 1; +pub const __OPENCL_MEMORY_SCOPE_DEVICE: u32 = 2; +pub const __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES: u32 = 3; +pub const __OPENCL_MEMORY_SCOPE_SUB_GROUP: u32 = 4; +pub const __PRAGMA_REDEFINE_EXTNAME: u32 = 1; +pub const __VERSION__: &'static [u8; 14usize] = b"Clang 10.0.0 \0"; +pub const __OBJC_BOOL_IS_BOOL: u32 = 0; +pub const __CONSTANT_CFSTRINGS__: u32 = 1; +pub const __SEH__: u32 = 1; +pub const __ORDER_LITTLE_ENDIAN__: u32 = 1234; +pub const __ORDER_BIG_ENDIAN__: u32 = 4321; +pub const __ORDER_PDP_ENDIAN__: u32 = 3412; +pub const __BYTE_ORDER__: u32 = 1234; +pub const __LITTLE_ENDIAN__: u32 = 1; +pub const __CHAR_BIT__: u32 = 8; +pub const __SCHAR_MAX__: u32 = 127; +pub const __SHRT_MAX__: u32 = 32767; +pub const __INT_MAX__: u32 = 2147483647; +pub const __LONG_MAX__: u32 = 2147483647; +pub const __LONG_LONG_MAX__: u64 = 9223372036854775807; +pub const __WCHAR_MAX__: u32 = 65535; +pub const __WINT_MAX__: u32 = 65535; +pub const __INTMAX_MAX__: u64 = 9223372036854775807; +pub const __SIZE_MAX__: i32 = -1; +pub const __UINTMAX_MAX__: i32 = -1; +pub const __PTRDIFF_MAX__: u64 = 9223372036854775807; +pub const __INTPTR_MAX__: u64 = 9223372036854775807; +pub const __UINTPTR_MAX__: i32 = -1; +pub const __SIZEOF_DOUBLE__: u32 = 8; +pub const __SIZEOF_FLOAT__: u32 = 4; +pub const __SIZEOF_INT__: u32 = 4; +pub const __SIZEOF_LONG__: u32 = 4; +pub const __SIZEOF_LONG_DOUBLE__: u32 = 16; +pub const __SIZEOF_LONG_LONG__: u32 = 8; +pub const __SIZEOF_POINTER__: u32 = 8; +pub const __SIZEOF_SHORT__: u32 = 2; +pub const __SIZEOF_PTRDIFF_T__: u32 = 8; +pub const __SIZEOF_SIZE_T__: u32 = 8; +pub const __SIZEOF_WCHAR_T__: u32 = 2; +pub const __SIZEOF_WINT_T__: u32 = 2; +pub const __SIZEOF_INT128__: u32 = 16; +pub const __INTMAX_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INTMAX_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINTMAX_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINTMAX_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINTMAX_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINTMAX_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __INTMAX_WIDTH__: u32 = 64; +pub const __PTRDIFF_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __PTRDIFF_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __PTRDIFF_WIDTH__: u32 = 64; +pub const __INTPTR_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INTPTR_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __INTPTR_WIDTH__: u32 = 64; +pub const __SIZE_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __SIZE_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __SIZE_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __SIZE_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __SIZE_WIDTH__: u32 = 64; +pub const __WCHAR_WIDTH__: u32 = 16; +pub const __WINT_WIDTH__: u32 = 16; +pub const __SIG_ATOMIC_WIDTH__: u32 = 32; +pub const __SIG_ATOMIC_MAX__: u32 = 2147483647; +pub const __UINTMAX_WIDTH__: u32 = 64; +pub const __UINTPTR_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINTPTR_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINTPTR_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINTPTR_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __UINTPTR_WIDTH__: u32 = 64; +pub const __FLT_HAS_DENORM__: u32 = 1; +pub const __FLT_DIG__: u32 = 6; +pub const __FLT_DECIMAL_DIG__: u32 = 9; +pub const __FLT_HAS_INFINITY__: u32 = 1; +pub const __FLT_HAS_QUIET_NAN__: u32 = 1; +pub const __FLT_MANT_DIG__: u32 = 24; +pub const __FLT_MAX_10_EXP__: u32 = 38; +pub const __FLT_MAX_EXP__: u32 = 128; +pub const __FLT_MIN_10_EXP__: i32 = -37; +pub const __FLT_MIN_EXP__: i32 = -125; +pub const __DBL_HAS_DENORM__: u32 = 1; +pub const __DBL_DIG__: u32 = 15; +pub const __DBL_DECIMAL_DIG__: u32 = 17; +pub const __DBL_HAS_INFINITY__: u32 = 1; +pub const __DBL_HAS_QUIET_NAN__: u32 = 1; +pub const __DBL_MANT_DIG__: u32 = 53; +pub const __DBL_MAX_10_EXP__: u32 = 308; +pub const __DBL_MAX_EXP__: u32 = 1024; +pub const __DBL_MIN_10_EXP__: i32 = -307; +pub const __DBL_MIN_EXP__: i32 = -1021; +pub const __LDBL_HAS_DENORM__: u32 = 1; +pub const __LDBL_DIG__: u32 = 18; +pub const __LDBL_DECIMAL_DIG__: u32 = 21; +pub const __LDBL_HAS_INFINITY__: u32 = 1; +pub const __LDBL_HAS_QUIET_NAN__: u32 = 1; +pub const __LDBL_MANT_DIG__: u32 = 64; +pub const __LDBL_MAX_10_EXP__: u32 = 4932; +pub const __LDBL_MAX_EXP__: u32 = 16384; +pub const __LDBL_MIN_10_EXP__: i32 = -4931; +pub const __LDBL_MIN_EXP__: i32 = -16381; +pub const __POINTER_WIDTH__: u32 = 64; +pub const __BIGGEST_ALIGNMENT__: u32 = 16; +pub const __WCHAR_UNSIGNED__: u32 = 1; +pub const __WINT_UNSIGNED__: u32 = 1; +pub const __INT8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __INT16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __INT32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __INT64_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INT64_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINT8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __UINT8_MAX__: u32 = 255; +pub const __INT8_MAX__: u32 = 127; +pub const __UINT16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __UINT16_MAX__: u32 = 65535; +pub const __INT16_MAX__: u32 = 32767; +pub const __UINT32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __UINT32_MAX__: u32 = 4294967295; +pub const __INT32_MAX__: u32 = 2147483647; +pub const __UINT64_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINT64_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINT64_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINT64_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __UINT64_MAX__: i32 = -1; +pub const __INT64_MAX__: u64 = 9223372036854775807; +pub const __INT_LEAST8_MAX__: u32 = 127; +pub const __INT_LEAST8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT_LEAST8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __UINT_LEAST8_MAX__: u32 = 255; +pub const __UINT_LEAST8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT_LEAST8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT_LEAST8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT_LEAST8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __INT_LEAST16_MAX__: u32 = 32767; +pub const __INT_LEAST16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT_LEAST16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __UINT_LEAST16_MAX__: u32 = 65535; +pub const __UINT_LEAST16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT_LEAST16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT_LEAST16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT_LEAST16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __INT_LEAST32_MAX__: u32 = 2147483647; +pub const __INT_LEAST32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT_LEAST32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __UINT_LEAST32_MAX__: u32 = 4294967295; +pub const __UINT_LEAST32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT_LEAST32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT_LEAST32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT_LEAST32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __INT_LEAST64_MAX__: u64 = 9223372036854775807; +pub const __INT_LEAST64_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INT_LEAST64_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINT_LEAST64_MAX__: i32 = -1; +pub const __UINT_LEAST64_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINT_LEAST64_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINT_LEAST64_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINT_LEAST64_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __INT_FAST8_MAX__: u32 = 127; +pub const __INT_FAST8_FMTd__: &'static [u8; 4usize] = b"hhd\0"; +pub const __INT_FAST8_FMTi__: &'static [u8; 4usize] = b"hhi\0"; +pub const __UINT_FAST8_MAX__: u32 = 255; +pub const __UINT_FAST8_FMTo__: &'static [u8; 4usize] = b"hho\0"; +pub const __UINT_FAST8_FMTu__: &'static [u8; 4usize] = b"hhu\0"; +pub const __UINT_FAST8_FMTx__: &'static [u8; 4usize] = b"hhx\0"; +pub const __UINT_FAST8_FMTX__: &'static [u8; 4usize] = b"hhX\0"; +pub const __INT_FAST16_MAX__: u32 = 32767; +pub const __INT_FAST16_FMTd__: &'static [u8; 3usize] = b"hd\0"; +pub const __INT_FAST16_FMTi__: &'static [u8; 3usize] = b"hi\0"; +pub const __UINT_FAST16_MAX__: u32 = 65535; +pub const __UINT_FAST16_FMTo__: &'static [u8; 3usize] = b"ho\0"; +pub const __UINT_FAST16_FMTu__: &'static [u8; 3usize] = b"hu\0"; +pub const __UINT_FAST16_FMTx__: &'static [u8; 3usize] = b"hx\0"; +pub const __UINT_FAST16_FMTX__: &'static [u8; 3usize] = b"hX\0"; +pub const __INT_FAST32_MAX__: u32 = 2147483647; +pub const __INT_FAST32_FMTd__: &'static [u8; 2usize] = b"d\0"; +pub const __INT_FAST32_FMTi__: &'static [u8; 2usize] = b"i\0"; +pub const __UINT_FAST32_MAX__: u32 = 4294967295; +pub const __UINT_FAST32_FMTo__: &'static [u8; 2usize] = b"o\0"; +pub const __UINT_FAST32_FMTu__: &'static [u8; 2usize] = b"u\0"; +pub const __UINT_FAST32_FMTx__: &'static [u8; 2usize] = b"x\0"; +pub const __UINT_FAST32_FMTX__: &'static [u8; 2usize] = b"X\0"; +pub const __INT_FAST64_MAX__: u64 = 9223372036854775807; +pub const __INT_FAST64_FMTd__: &'static [u8; 4usize] = b"lld\0"; +pub const __INT_FAST64_FMTi__: &'static [u8; 4usize] = b"lli\0"; +pub const __UINT_FAST64_MAX__: i32 = -1; +pub const __UINT_FAST64_FMTo__: &'static [u8; 4usize] = b"llo\0"; +pub const __UINT_FAST64_FMTu__: &'static [u8; 4usize] = b"llu\0"; +pub const __UINT_FAST64_FMTx__: &'static [u8; 4usize] = b"llx\0"; +pub const __UINT_FAST64_FMTX__: &'static [u8; 4usize] = b"llX\0"; +pub const __FINITE_MATH_ONLY__: u32 = 0; +pub const __GNUC_STDC_INLINE__: u32 = 1; +pub const __GCC_ATOMIC_TEST_AND_SET_TRUEVAL: u32 = 1; +pub const __CLANG_ATOMIC_BOOL_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR16_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_CHAR32_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_WCHAR_T_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_SHORT_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_INT_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_LONG_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_LLONG_LOCK_FREE: u32 = 2; +pub const __CLANG_ATOMIC_POINTER_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_BOOL_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_CHAR_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_CHAR16_T_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_CHAR32_T_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_WCHAR_T_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_SHORT_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_INT_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_LONG_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_LLONG_LOCK_FREE: u32 = 2; +pub const __GCC_ATOMIC_POINTER_LOCK_FREE: u32 = 2; +pub const __NO_INLINE__: u32 = 1; +pub const __PIC__: u32 = 2; +pub const __pic__: u32 = 2; +pub const __FLT_EVAL_METHOD__: u32 = 0; +pub const __FLT_RADIX__: u32 = 2; +pub const __DECIMAL_DIG__: u32 = 21; +pub const __GCC_ASM_FLAG_OUTPUTS__: u32 = 1; +pub const __code_model_small_: u32 = 1; +pub const __amd64__: u32 = 1; +pub const __amd64: u32 = 1; +pub const __x86_64: u32 = 1; +pub const __x86_64__: u32 = 1; +pub const __SEG_GS: u32 = 1; +pub const __SEG_FS: u32 = 1; +pub const __k8: u32 = 1; +pub const __k8__: u32 = 1; +pub const __tune_k8__: u32 = 1; +pub const __NO_MATH_INLINES: u32 = 1; +pub const __FXSR__: u32 = 1; +pub const __SSE2__: u32 = 1; +pub const __SSE2_MATH__: u32 = 1; +pub const __SSE__: u32 = 1; +pub const __SSE_MATH__: u32 = 1; +pub const __MMX__: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4: u32 = 1; +pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8: u32 = 1; +pub const __SIZEOF_FLOAT128__: u32 = 16; +pub const _WIN32: u32 = 1; +pub const _WIN64: u32 = 1; +pub const WIN32: u32 = 1; +pub const __WIN32: u32 = 1; +pub const __WIN32__: u32 = 1; +pub const WINNT: u32 = 1; +pub const __WINNT: u32 = 1; +pub const __WINNT__: u32 = 1; +pub const WIN64: u32 = 1; +pub const __WIN64: u32 = 1; +pub const __WIN64__: u32 = 1; +pub const __MINGW64__: u32 = 1; +pub const __MSVCRT__: u32 = 1; +pub const __MINGW32__: u32 = 1; +pub const __STDC__: u32 = 1; +pub const __STDC_HOSTED__: u32 = 1; +pub const __STDC_VERSION__: u32 = 201112; +pub const __STDC_UTF_16__: u32 = 1; +pub const __STDC_UTF_32__: u32 = 1; +pub const __MINGW64_VERSION_MAJOR: u32 = 7; +pub const __MINGW64_VERSION_MINOR: u32 = 0; +pub const __MINGW64_VERSION_BUGFIX: u32 = 0; +pub const __MINGW64_VERSION_RC: u32 = 0; +pub const __MINGW64_VERSION_STATE: &'static [u8; 6usize] = b"alpha\0"; +pub const __MINGW32_MAJOR_VERSION: u32 = 3; +pub const __MINGW32_MINOR_VERSION: u32 = 11; +pub const _M_AMD64: u32 = 100; +pub const _M_X64: u32 = 100; +pub const __: u32 = 1; +pub const __MINGW_USE_UNDERSCORE_PREFIX: u32 = 0; +pub const __MINGW_HAVE_ANSI_C99_PRINTF: u32 = 1; +pub const __MINGW_HAVE_WIDE_C99_PRINTF: u32 = 1; +pub const __MINGW_HAVE_ANSI_C99_SCANF: u32 = 1; +pub const __MINGW_HAVE_WIDE_C99_SCANF: u32 = 1; +pub const __MINGW_GCC_VERSION: u32 = 40201; +pub const __MINGW_SEC_WARN_STR : & 'static [ u8 ; 92usize ] = b"This function or variable may be unsafe, use _CRT_SECURE_NO_WARNINGS to disable deprecation\0" ; +pub const __MINGW_MSVC2005_DEPREC_STR : & 'static [ u8 ; 117usize ] = b"This POSIX function is deprecated beginning in Visual C++ 2005, use _CRT_NONSTDC_NO_DEPRECATE to disable deprecation\0" ; +pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY: u32 = 0; +pub const __USE_CRTIMP: u32 = 1; +pub const USE___UUIDOF: u32 = 0; +pub const __CRT__NO_INLINE: u32 = 1; +pub const __MSVCRT_VERSION__: u32 = 1792; +pub const _WIN32_WINNT: u32 = 1537; +pub const MINGW_HAS_SECURE_API: u32 = 1; +pub const __STDC_SECURE_LIB__: u32 = 200411; +pub const __GOT_SECURE_LIB__: u32 = 200411; +pub const __MINGW_HAS_DXSDK: u32 = 1; +pub const MINGW_HAS_DDRAW_H: u32 = 1; +pub const MINGW_DDRAW_VERSION: u32 = 7; +pub const MINGW_HAS_DDK_H: u32 = 1; +pub const _CRT_PACKING: u32 = 8; +pub const _SECURECRT_FILL_BUFFER_PATTERN: u32 = 253; +pub const _ARGMAX: u32 = 100; +pub const __USE_MINGW_ANSI_STDIO: u32 = 0; +pub const WCHAR_MIN: u32 = 0; +pub const WCHAR_MAX: u32 = 65535; +pub const _UPPER: u32 = 1; +pub const _LOWER: u32 = 2; +pub const _DIGIT: u32 = 4; +pub const _SPACE: u32 = 8; +pub const _PUNCT: u32 = 16; +pub const _CONTROL: u32 = 32; +pub const _BLANK: u32 = 64; +pub const _HEX: u32 = 128; +pub const _LEADBYTE: u32 = 32768; +pub const _ALPHA: u32 = 259; +pub const INT8_MIN: i32 = -128; +pub const INT16_MIN: i32 = -32768; +pub const INT32_MIN: i32 = -2147483648; +pub const INT64_MIN: i64 = -9223372036854775808; +pub const INT8_MAX: u32 = 127; +pub const INT16_MAX: u32 = 32767; +pub const INT32_MAX: u32 = 2147483647; +pub const INT64_MAX: u64 = 9223372036854775807; +pub const UINT8_MAX: u32 = 255; +pub const UINT16_MAX: u32 = 65535; +pub const UINT32_MAX: u32 = 4294967295; +pub const UINT64_MAX: i32 = -1; +pub const INT_LEAST8_MIN: i32 = -128; +pub const INT_LEAST16_MIN: i32 = -32768; +pub const INT_LEAST32_MIN: i32 = -2147483648; +pub const INT_LEAST64_MIN: i64 = -9223372036854775808; +pub const INT_LEAST8_MAX: u32 = 127; +pub const INT_LEAST16_MAX: u32 = 32767; +pub const INT_LEAST32_MAX: u32 = 2147483647; +pub const INT_LEAST64_MAX: u64 = 9223372036854775807; +pub const UINT_LEAST8_MAX: u32 = 255; +pub const UINT_LEAST16_MAX: u32 = 65535; +pub const UINT_LEAST32_MAX: u32 = 4294967295; +pub const UINT_LEAST64_MAX: i32 = -1; +pub const INT_FAST8_MIN: i32 = -128; +pub const INT_FAST16_MIN: i32 = -32768; +pub const INT_FAST32_MIN: i32 = -2147483648; +pub const INT_FAST64_MIN: i64 = -9223372036854775808; +pub const INT_FAST8_MAX: u32 = 127; +pub const INT_FAST16_MAX: u32 = 32767; +pub const INT_FAST32_MAX: u32 = 2147483647; +pub const INT_FAST64_MAX: u64 = 9223372036854775807; +pub const UINT_FAST8_MAX: u32 = 255; +pub const UINT_FAST16_MAX: u32 = 65535; +pub const UINT_FAST32_MAX: u32 = 4294967295; +pub const UINT_FAST64_MAX: i32 = -1; +pub const INTPTR_MIN: i64 = -9223372036854775808; +pub const INTPTR_MAX: u64 = 9223372036854775807; +pub const UINTPTR_MAX: i32 = -1; +pub const INTMAX_MIN: i64 = -9223372036854775808; +pub const INTMAX_MAX: u64 = 9223372036854775807; +pub const UINTMAX_MAX: i32 = -1; +pub const PTRDIFF_MIN: i64 = -9223372036854775808; +pub const PTRDIFF_MAX: u64 = 9223372036854775807; +pub const SIG_ATOMIC_MIN: i32 = -2147483648; +pub const SIG_ATOMIC_MAX: u32 = 2147483647; +pub const SIZE_MAX: i32 = -1; +pub const WINT_MIN: u32 = 0; +pub const WINT_MAX: u32 = 65535; +pub const true_: u32 = 1; +pub const false_: u32 = 0; +pub const __bool_true_false_are_defined: u32 = 1; +pub const TCOD_MAJOR_VERSION: u32 = 1; +pub const TCOD_MINOR_VERSION: u32 = 16; +pub const TCOD_PATCHLEVEL: u32 = 0; +pub const TCOD_STRVERSION: &'static [u8; 16usize] = b"1.16.0-alpha.12\0"; +pub const TCOD_HEXVERSION: u32 = 69632; +pub const TCOD_TECHVERSION: u32 = 17825792; +pub const TCOD_STRVERSIONNAME: &'static [u8; 24usize] = b"libtcod 1.16.0-alpha.12\0"; +pub const TCOD_KEY_TEXT_SIZE: u32 = 32; +pub const TCOD_NOISE_MAX_OCTAVES: u32 = 128; +pub const TCOD_NOISE_MAX_DIMENSIONS: u32 = 4; +pub const TCOD_NOISE_DEFAULT_HURST: f64 = 0.5; +pub const TCOD_NOISE_DEFAULT_LACUNARITY: f64 = 2.0; +pub const TCOD_LEX_FLAG_NOCASE: u32 = 1; +pub const TCOD_LEX_FLAG_NESTING_COMMENT: u32 = 2; +pub const TCOD_LEX_FLAG_TOKENIZE_COMMENTS: u32 = 4; +pub const TCOD_LEX_ERROR: i32 = -1; +pub const TCOD_LEX_UNKNOWN: u32 = 0; +pub const TCOD_LEX_SYMBOL: u32 = 1; +pub const TCOD_LEX_KEYWORD: u32 = 2; +pub const TCOD_LEX_IDEN: u32 = 3; +pub const TCOD_LEX_STRING: u32 = 4; +pub const TCOD_LEX_INTEGER: u32 = 5; +pub const TCOD_LEX_FLOAT: u32 = 6; +pub const TCOD_LEX_CHAR: u32 = 7; +pub const TCOD_LEX_EOF: u32 = 8; +pub const TCOD_LEX_COMMENT: u32 = 9; +pub const TCOD_LEX_MAX_SYMBOLS: u32 = 100; +pub const TCOD_LEX_SYMBOL_SIZE: u32 = 5; +pub const TCOD_LEX_MAX_KEYWORDS: u32 = 100; +pub const TCOD_LEX_KEYWORD_SIZE: u32 = 20; +pub const TCOD_HEAP_DEFAULT_CAPACITY: u32 = 256; +pub const TCOD_HEAP_MAX_NODE_SIZE: u32 = 256; +pub const TCOD_PATHFINDER_MAX_DIMENSIONS: u32 = 4; +pub type __gnuc_va_list = __builtin_va_list; +pub type va_list = __gnuc_va_list; +extern "C" { + pub fn __debugbreak(); +} +extern "C" { + pub fn __mingw_get_crt_info() -> *const ::std::os::raw::c_char; +} +pub type size_t = ::std::os::raw::c_ulonglong; +pub type ssize_t = ::std::os::raw::c_longlong; +pub type rsize_t = size_t; +pub type wchar_t = ::std::os::raw::c_ushort; +pub type wint_t = ::std::os::raw::c_ushort; +pub type wctype_t = ::std::os::raw::c_ushort; +pub type errno_t = ::std::os::raw::c_int; +pub type __time32_t = ::std::os::raw::c_long; +pub type __time64_t = ::std::os::raw::c_longlong; +pub type time_t = __time64_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct threadmbcinfostruct { + _unused: [u8; 0], +} +pub type pthreadlocinfo = *mut threadlocaleinfostruct; +pub type pthreadmbcinfo = *mut threadmbcinfostruct; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __lc_time_data { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct localeinfo_struct { + pub locinfo: pthreadlocinfo, + pub mbcinfo: pthreadmbcinfo, +} +#[test] +fn bindgen_test_layout_localeinfo_struct() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(localeinfo_struct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(localeinfo_struct)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).locinfo as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(localeinfo_struct), + "::", + stringify!(locinfo) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbcinfo as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(localeinfo_struct), + "::", + stringify!(mbcinfo) + ) + ); +} +impl Default for localeinfo_struct { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type _locale_tstruct = localeinfo_struct; +pub type _locale_t = *mut localeinfo_struct; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct tagLC_ID { + pub wLanguage: ::std::os::raw::c_ushort, + pub wCountry: ::std::os::raw::c_ushort, + pub wCodePage: ::std::os::raw::c_ushort, +} +#[test] +fn bindgen_test_layout_tagLC_ID() { + assert_eq!( + ::std::mem::size_of::(), + 6usize, + concat!("Size of: ", stringify!(tagLC_ID)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(tagLC_ID)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wLanguage as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tagLC_ID), + "::", + stringify!(wLanguage) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wCountry as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(tagLC_ID), + "::", + stringify!(wCountry) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wCodePage as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tagLC_ID), + "::", + stringify!(wCodePage) + ) + ); +} +pub type LC_ID = tagLC_ID; +pub type LPLC_ID = *mut tagLC_ID; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct threadlocaleinfostruct { + pub refcount: ::std::os::raw::c_int, + pub lc_codepage: ::std::os::raw::c_uint, + pub lc_collate_cp: ::std::os::raw::c_uint, + pub lc_handle: [::std::os::raw::c_ulong; 6usize], + pub lc_id: [LC_ID; 6usize], + pub lc_category: [threadlocaleinfostruct__bindgen_ty_1; 6usize], + pub lc_clike: ::std::os::raw::c_int, + pub mb_cur_max: ::std::os::raw::c_int, + pub lconv_intl_refcount: *mut ::std::os::raw::c_int, + pub lconv_num_refcount: *mut ::std::os::raw::c_int, + pub lconv_mon_refcount: *mut ::std::os::raw::c_int, + pub lconv: *mut lconv, + pub ctype1_refcount: *mut ::std::os::raw::c_int, + pub ctype1: *mut ::std::os::raw::c_ushort, + pub pctype: *const ::std::os::raw::c_ushort, + pub pclmap: *const ::std::os::raw::c_uchar, + pub pcumap: *const ::std::os::raw::c_uchar, + pub lc_time_curr: *mut __lc_time_data, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct threadlocaleinfostruct__bindgen_ty_1 { + pub locale: *mut ::std::os::raw::c_char, + pub wlocale: *mut wchar_t, + pub refcount: *mut ::std::os::raw::c_int, + pub wrefcount: *mut ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_threadlocaleinfostruct__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!( + "Size of: ", + stringify!(threadlocaleinfostruct__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(threadlocaleinfostruct__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).locale as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct__bindgen_ty_1), + "::", + stringify!(locale) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).wlocale as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct__bindgen_ty_1), + "::", + stringify!(wlocale) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).refcount as *const _ + as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct__bindgen_ty_1), + "::", + stringify!(refcount) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).wrefcount as *const _ + as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct__bindgen_ty_1), + "::", + stringify!(wrefcount) + ) + ); +} +impl Default for threadlocaleinfostruct__bindgen_ty_1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[test] +fn bindgen_test_layout_threadlocaleinfostruct() { + assert_eq!( + ::std::mem::size_of::(), + 352usize, + concat!("Size of: ", stringify!(threadlocaleinfostruct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(threadlocaleinfostruct)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).refcount as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(refcount) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).lc_codepage as *const _ as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(lc_codepage) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).lc_collate_cp as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(lc_collate_cp) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).lc_handle as *const _ as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(lc_handle) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lc_id as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(lc_id) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).lc_category as *const _ as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(lc_category) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lc_clike as *const _ as usize }, + 264usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(lc_clike) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).mb_cur_max as *const _ as usize + }, + 268usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(mb_cur_max) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).lconv_intl_refcount as *const _ + as usize + }, + 272usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(lconv_intl_refcount) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).lconv_num_refcount as *const _ + as usize + }, + 280usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(lconv_num_refcount) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).lconv_mon_refcount as *const _ + as usize + }, + 288usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(lconv_mon_refcount) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lconv as *const _ as usize }, + 296usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(lconv) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).ctype1_refcount as *const _ as usize + }, + 304usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(ctype1_refcount) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ctype1 as *const _ as usize }, + 312usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(ctype1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pctype as *const _ as usize }, + 320usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(pctype) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pclmap as *const _ as usize }, + 328usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(pclmap) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pcumap as *const _ as usize }, + 336usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(pcumap) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).lc_time_curr as *const _ as usize + }, + 344usize, + concat!( + "Offset of field: ", + stringify!(threadlocaleinfostruct), + "::", + stringify!(lc_time_curr) + ) + ); +} +impl Default for threadlocaleinfostruct { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type threadlocinfo = threadlocaleinfostruct; +extern "C" { + pub fn _itow_s( + _Val: ::std::os::raw::c_int, + _DstBuf: *mut wchar_t, + _SizeInWords: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ltow_s( + _Val: ::std::os::raw::c_long, + _DstBuf: *mut wchar_t, + _SizeInWords: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ultow_s( + _Val: ::std::os::raw::c_ulong, + _DstBuf: *mut wchar_t, + _SizeInWords: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _wgetenv_s( + _ReturnSize: *mut size_t, + _DstBuf: *mut wchar_t, + _DstSizeInWords: size_t, + _VarName: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wdupenv_s( + _Buffer: *mut *mut wchar_t, + _BufferSizeInWords: *mut size_t, + _VarName: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _i64tow_s( + _Val: ::std::os::raw::c_longlong, + _DstBuf: *mut wchar_t, + _SizeInWords: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ui64tow_s( + _Val: ::std::os::raw::c_ulonglong, + _DstBuf: *mut wchar_t, + _SizeInWords: size_t, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _wmakepath_s( + _PathResult: *mut wchar_t, + _SizeInWords: size_t, + _Drive: *const wchar_t, + _Dir: *const wchar_t, + _Filename: *const wchar_t, + _Ext: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wputenv_s(_Name: *const wchar_t, _Value: *const wchar_t) -> errno_t; +} +extern "C" { + pub fn _wsearchenv_s( + _Filename: *const wchar_t, + _EnvVar: *const wchar_t, + _ResultPath: *mut wchar_t, + _SizeInWords: size_t, + ) -> errno_t; +} +extern "C" { + pub fn _wsplitpath_s( + _FullPath: *const wchar_t, + _Drive: *mut wchar_t, + _DriveSizeInWords: size_t, + _Dir: *mut wchar_t, + _DirSizeInWords: size_t, + _Filename: *mut wchar_t, + _FilenameSizeInWords: size_t, + _Ext: *mut wchar_t, + _ExtSizeInWords: size_t, + ) -> errno_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _iobuf { + pub _ptr: *mut ::std::os::raw::c_char, + pub _cnt: ::std::os::raw::c_int, + pub _base: *mut ::std::os::raw::c_char, + pub _flag: ::std::os::raw::c_int, + pub _file: ::std::os::raw::c_int, + pub _charbuf: ::std::os::raw::c_int, + pub _bufsiz: ::std::os::raw::c_int, + pub _tmpfname: *mut ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout__iobuf() { + assert_eq!( + ::std::mem::size_of::<_iobuf>(), + 48usize, + concat!("Size of: ", stringify!(_iobuf)) + ); + assert_eq!( + ::std::mem::align_of::<_iobuf>(), + 8usize, + concat!("Alignment of ", stringify!(_iobuf)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iobuf>()))._ptr as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_iobuf), + "::", + stringify!(_ptr) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iobuf>()))._cnt as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_iobuf), + "::", + stringify!(_cnt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iobuf>()))._base as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_iobuf), + "::", + stringify!(_base) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iobuf>()))._flag as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_iobuf), + "::", + stringify!(_flag) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iobuf>()))._file as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(_iobuf), + "::", + stringify!(_file) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iobuf>()))._charbuf as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_iobuf), + "::", + stringify!(_charbuf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iobuf>()))._bufsiz as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(_iobuf), + "::", + stringify!(_bufsiz) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_iobuf>()))._tmpfname as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_iobuf), + "::", + stringify!(_tmpfname) + ) + ); +} +impl Default for _iobuf { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type FILE = _iobuf; +extern "C" { + pub fn __acrt_iob_func(index: ::std::os::raw::c_uint) -> *mut FILE; +} +extern "C" { + pub fn __iob_func() -> *mut FILE; +} +pub type _fsize_t = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _wfinddata32_t { + pub attrib: ::std::os::raw::c_uint, + pub time_create: __time32_t, + pub time_access: __time32_t, + pub time_write: __time32_t, + pub size: _fsize_t, + pub name: [wchar_t; 260usize], +} +#[test] +fn bindgen_test_layout__wfinddata32_t() { + assert_eq!( + ::std::mem::size_of::<_wfinddata32_t>(), + 540usize, + concat!("Size of: ", stringify!(_wfinddata32_t)) + ); + assert_eq!( + ::std::mem::align_of::<_wfinddata32_t>(), + 4usize, + concat!("Alignment of ", stringify!(_wfinddata32_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).attrib as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(attrib) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).time_create as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(time_create) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).time_access as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(time_access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).time_write as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(time_write) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).size as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32_t>())).name as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32_t), + "::", + stringify!(name) + ) + ); +} +impl Default for _wfinddata32_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _wfinddata32i64_t { + pub attrib: ::std::os::raw::c_uint, + pub time_create: __time32_t, + pub time_access: __time32_t, + pub time_write: __time32_t, + pub size: ::std::os::raw::c_longlong, + pub name: [wchar_t; 260usize], +} +#[test] +fn bindgen_test_layout__wfinddata32i64_t() { + assert_eq!( + ::std::mem::size_of::<_wfinddata32i64_t>(), + 544usize, + concat!("Size of: ", stringify!(_wfinddata32i64_t)) + ); + assert_eq!( + ::std::mem::align_of::<_wfinddata32i64_t>(), + 8usize, + concat!("Alignment of ", stringify!(_wfinddata32i64_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).attrib as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(attrib) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).time_create as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(time_create) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).time_access as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(time_access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).time_write as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(time_write) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).size as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata32i64_t>())).name as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata32i64_t), + "::", + stringify!(name) + ) + ); +} +impl Default for _wfinddata32i64_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _wfinddata64i32_t { + pub attrib: ::std::os::raw::c_uint, + pub time_create: __time64_t, + pub time_access: __time64_t, + pub time_write: __time64_t, + pub size: _fsize_t, + pub name: [wchar_t; 260usize], +} +#[test] +fn bindgen_test_layout__wfinddata64i32_t() { + assert_eq!( + ::std::mem::size_of::<_wfinddata64i32_t>(), + 560usize, + concat!("Size of: ", stringify!(_wfinddata64i32_t)) + ); + assert_eq!( + ::std::mem::align_of::<_wfinddata64i32_t>(), + 8usize, + concat!("Alignment of ", stringify!(_wfinddata64i32_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).attrib as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(attrib) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).time_create as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(time_create) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).time_access as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(time_access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).time_write as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(time_write) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).size as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64i32_t>())).name as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64i32_t), + "::", + stringify!(name) + ) + ); +} +impl Default for _wfinddata64i32_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _wfinddata64_t { + pub attrib: ::std::os::raw::c_uint, + pub time_create: __time64_t, + pub time_access: __time64_t, + pub time_write: __time64_t, + pub size: ::std::os::raw::c_longlong, + pub name: [wchar_t; 260usize], +} +#[test] +fn bindgen_test_layout__wfinddata64_t() { + assert_eq!( + ::std::mem::size_of::<_wfinddata64_t>(), + 560usize, + concat!("Size of: ", stringify!(_wfinddata64_t)) + ); + assert_eq!( + ::std::mem::align_of::<_wfinddata64_t>(), + 8usize, + concat!("Alignment of ", stringify!(_wfinddata64_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).attrib as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(attrib) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).time_create as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(time_create) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).time_access as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(time_access) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).time_write as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(time_write) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).size as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_wfinddata64_t>())).name as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_wfinddata64_t), + "::", + stringify!(name) + ) + ); +} +impl Default for _wfinddata64_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub static mut __imp__pctype: *mut *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub static mut __imp__wctype: *mut *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub static mut __imp__pwctype: *mut *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub fn iswalpha(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswalpha_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswupper(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswupper_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswlower(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswlower_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswdigit(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswdigit_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswxdigit(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswxdigit_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswspace(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswspace_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswpunct(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswpunct_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswalnum(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswalnum_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswprint(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswprint_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswgraph(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswgraph_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswcntrl(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswcntrl_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswascii(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn isleadbyte(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _isleadbyte_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn towupper(_C: wint_t) -> wint_t; +} +extern "C" { + pub fn _towupper_l(_C: wint_t, _Locale: _locale_t) -> wint_t; +} +extern "C" { + pub fn towlower(_C: wint_t) -> wint_t; +} +extern "C" { + pub fn _towlower_l(_C: wint_t, _Locale: _locale_t) -> wint_t; +} +extern "C" { + pub fn iswctype(_C: wint_t, _Type: wctype_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswctype_l(_C: wint_t, _Type: wctype_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __iswcsymf(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswcsymf_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __iswcsym(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswcsym_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn is_wctype(_C: wint_t, _Type: wctype_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswblank(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wgetcwd(_DstBuf: *mut wchar_t, _SizeInWords: ::std::os::raw::c_int) -> *mut wchar_t; +} +extern "C" { + pub fn _wgetdcwd( + _Drive: ::std::os::raw::c_int, + _DstBuf: *mut wchar_t, + _SizeInWords: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wgetdcwd_nolock( + _Drive: ::std::os::raw::c_int, + _DstBuf: *mut wchar_t, + _SizeInWords: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wchdir(_Path: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wmkdir(_Path: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wrmdir(_Path: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _waccess( + _Filename: *const wchar_t, + _AccessMode: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wchmod( + _Filename: *const wchar_t, + _Mode: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcreat( + _Filename: *const wchar_t, + _PermissionMode: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfindfirst32(_Filename: *const wchar_t, _FindData: *mut _wfinddata32_t) -> isize; +} +extern "C" { + pub fn _wfindnext32( + _FindHandle: isize, + _FindData: *mut _wfinddata32_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wunlink(_Filename: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wrename( + _OldFilename: *const wchar_t, + _NewFilename: *const wchar_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wmktemp(_TemplateName: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wfindfirst32i64(_Filename: *const wchar_t, _FindData: *mut _wfinddata32i64_t) -> isize; +} +extern "C" { + pub fn _wfindfirst64i32(_Filename: *const wchar_t, _FindData: *mut _wfinddata64i32_t) -> isize; +} +extern "C" { + pub fn _wfindfirst64(_Filename: *const wchar_t, _FindData: *mut _wfinddata64_t) -> isize; +} +extern "C" { + pub fn _wfindnext32i64( + _FindHandle: isize, + _FindData: *mut _wfinddata32i64_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfindnext64i32( + _FindHandle: isize, + _FindData: *mut _wfinddata64i32_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfindnext64( + _FindHandle: isize, + _FindData: *mut _wfinddata64_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wsopen_s( + _FileHandle: *mut ::std::os::raw::c_int, + _Filename: *const wchar_t, + _OpenFlag: ::std::os::raw::c_int, + _ShareFlag: ::std::os::raw::c_int, + _PermissionFlag: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _wopen( + _Filename: *const wchar_t, + _OpenFlag: ::std::os::raw::c_int, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wsopen( + _Filename: *const wchar_t, + _OpenFlag: ::std::os::raw::c_int, + _ShareFlag: ::std::os::raw::c_int, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wsetlocale(_Category: ::std::os::raw::c_int, _Locale: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wexecl(_Filename: *const wchar_t, _ArgList: *const wchar_t, ...) -> isize; +} +extern "C" { + pub fn _wexecle(_Filename: *const wchar_t, _ArgList: *const wchar_t, ...) -> isize; +} +extern "C" { + pub fn _wexeclp(_Filename: *const wchar_t, _ArgList: *const wchar_t, ...) -> isize; +} +extern "C" { + pub fn _wexeclpe(_Filename: *const wchar_t, _ArgList: *const wchar_t, ...) -> isize; +} +extern "C" { + pub fn _wexecv(_Filename: *const wchar_t, _ArgList: *const *const wchar_t) -> isize; +} +extern "C" { + pub fn _wexecve( + _Filename: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wexecvp(_Filename: *const wchar_t, _ArgList: *const *const wchar_t) -> isize; +} +extern "C" { + pub fn _wexecvpe( + _Filename: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnl( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnle( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnlp( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnlpe( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnv( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnve( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnvp( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnvpe( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wsystem(_Command: *const wchar_t) -> ::std::os::raw::c_int; +} +pub type _ino_t = ::std::os::raw::c_ushort; +pub type ino_t = ::std::os::raw::c_ushort; +pub type _dev_t = ::std::os::raw::c_uint; +pub type dev_t = ::std::os::raw::c_uint; +pub type _off_t = ::std::os::raw::c_long; +pub type off32_t = ::std::os::raw::c_long; +pub type _off64_t = ::std::os::raw::c_longlong; +pub type off64_t = ::std::os::raw::c_longlong; +pub type off_t = off32_t; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _stat32 { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: _off_t, + pub st_atime: __time32_t, + pub st_mtime: __time32_t, + pub st_ctime: __time32_t, +} +#[test] +fn bindgen_test_layout__stat32() { + assert_eq!( + ::std::mem::size_of::<_stat32>(), + 36usize, + concat!("Size of: ", stringify!(_stat32)) + ); + assert_eq!( + ::std::mem::align_of::<_stat32>(), + 4usize, + concat!("Alignment of ", stringify!(_stat32)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_size as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_atime as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_mtime as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32>())).st_ctime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_stat32), + "::", + stringify!(st_ctime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct stat { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: _off_t, + pub st_atime: time_t, + pub st_mtime: time_t, + pub st_ctime: time_t, +} +#[test] +fn bindgen_test_layout_stat() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(stat)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(stat)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_size as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_atime as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_mtime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).st_ctime as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(stat), + "::", + stringify!(st_ctime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _stat32i64 { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: ::std::os::raw::c_longlong, + pub st_atime: __time32_t, + pub st_mtime: __time32_t, + pub st_ctime: __time32_t, +} +#[test] +fn bindgen_test_layout__stat32i64() { + assert_eq!( + ::std::mem::size_of::<_stat32i64>(), + 48usize, + concat!("Size of: ", stringify!(_stat32i64)) + ); + assert_eq!( + ::std::mem::align_of::<_stat32i64>(), + 8usize, + concat!("Alignment of ", stringify!(_stat32i64)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_size as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_atime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_mtime as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat32i64>())).st_ctime as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_stat32i64), + "::", + stringify!(st_ctime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _stat64i32 { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: _off_t, + pub st_atime: __time64_t, + pub st_mtime: __time64_t, + pub st_ctime: __time64_t, +} +#[test] +fn bindgen_test_layout__stat64i32() { + assert_eq!( + ::std::mem::size_of::<_stat64i32>(), + 48usize, + concat!("Size of: ", stringify!(_stat64i32)) + ); + assert_eq!( + ::std::mem::align_of::<_stat64i32>(), + 8usize, + concat!("Alignment of ", stringify!(_stat64i32)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_size as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_atime as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_mtime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64i32>())).st_ctime as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_stat64i32), + "::", + stringify!(st_ctime) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct _stat64 { + pub st_dev: _dev_t, + pub st_ino: _ino_t, + pub st_mode: ::std::os::raw::c_ushort, + pub st_nlink: ::std::os::raw::c_short, + pub st_uid: ::std::os::raw::c_short, + pub st_gid: ::std::os::raw::c_short, + pub st_rdev: _dev_t, + pub st_size: ::std::os::raw::c_longlong, + pub st_atime: __time64_t, + pub st_mtime: __time64_t, + pub st_ctime: __time64_t, +} +#[test] +fn bindgen_test_layout__stat64() { + assert_eq!( + ::std::mem::size_of::<_stat64>(), + 56usize, + concat!("Size of: ", stringify!(_stat64)) + ); + assert_eq!( + ::std::mem::align_of::<_stat64>(), + 8usize, + concat!("Alignment of ", stringify!(_stat64)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_dev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_dev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_ino as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_ino) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_mode as *const _ as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_nlink as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_nlink) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_uid as *const _ as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_uid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_gid as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_gid) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_rdev as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_rdev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_size as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_atime as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_atime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_mtime as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_mtime) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_stat64>())).st_ctime as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_stat64), + "::", + stringify!(st_ctime) + ) + ); +} +extern "C" { + pub fn _wstat32(_Name: *const wchar_t, _Stat: *mut _stat32) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wstat32i64(_Name: *const wchar_t, _Stat: *mut _stat32i64) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wstat64i32(_Name: *const wchar_t, _Stat: *mut _stat64i32) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wstat64(_Name: *const wchar_t, _Stat: *mut _stat64) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _cgetws(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _getwch() -> wint_t; +} +extern "C" { + pub fn _getwche() -> wint_t; +} +extern "C" { + pub fn _putwch(_WCh: wchar_t) -> wint_t; +} +extern "C" { + pub fn _ungetwch(_WCh: wint_t) -> wint_t; +} +extern "C" { + pub fn _cputws(_String: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _cwprintf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _cwscanf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _cwscanf_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vcwprintf(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _cwprintf_p(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vcwprintf_p(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _cwprintf_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vcwprintf_l( + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _cwprintf_p_l(_Format: *const wchar_t, _Locale: _locale_t, ...) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vcwprintf_p_l( + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _putwch_nolock(_WCh: wchar_t) -> wint_t; +} +extern "C" { + pub fn _getwch_nolock() -> wint_t; +} +extern "C" { + pub fn _getwche_nolock() -> wint_t; +} +extern "C" { + pub fn _ungetwch_nolock(_WCh: wint_t) -> wint_t; +} +extern "C" { + pub fn __mingw_swscanf( + _Src: *const wchar_t, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vswscanf( + _Str: *const wchar_t, + Format: *const wchar_t, + argp: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_wscanf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vwscanf(Format: *const wchar_t, argp: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_fwscanf(_File: *mut FILE, _Format: *const wchar_t, ...) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vfwscanf( + fp: *mut FILE, + Format: *const wchar_t, + argp: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_fwprintf( + _File: *mut FILE, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_wprintf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vfwprintf( + _File: *mut FILE, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vwprintf(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_snwprintf( + s: *mut wchar_t, + n: size_t, + format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vsnwprintf( + arg1: *mut wchar_t, + arg2: size_t, + arg3: *const wchar_t, + arg4: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_swprintf(arg1: *mut wchar_t, arg2: *const wchar_t, ...) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vswprintf( + arg1: *mut wchar_t, + arg2: *const wchar_t, + arg3: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fwscanf(_File: *mut FILE, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn swscanf(_Src: *const wchar_t, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wscanf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_vwscanf(arg1: *const wchar_t, arg2: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_vfwscanf( + arg1: *mut FILE, + arg2: *const wchar_t, + arg3: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_vswscanf( + arg1: *const wchar_t, + arg2: *const wchar_t, + arg3: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fwprintf(_File: *mut FILE, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wprintf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vfwprintf( + _File: *mut FILE, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vwprintf(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfsopen( + _Filename: *const wchar_t, + _Mode: *const wchar_t, + _ShFlag: ::std::os::raw::c_int, + ) -> *mut FILE; +} +extern "C" { + pub fn fgetwc(_File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fgetwchar() -> wint_t; +} +extern "C" { + pub fn fputwc(_Ch: wchar_t, _File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fputwchar(_Ch: wchar_t) -> wint_t; +} +extern "C" { + pub fn getwc(_File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn getwchar() -> wint_t; +} +extern "C" { + pub fn putwc(_Ch: wchar_t, _File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn putwchar(_Ch: wchar_t) -> wint_t; +} +extern "C" { + pub fn ungetwc(_Ch: wint_t, _File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn fgetws( + _Dst: *mut wchar_t, + _SizeInWords: ::std::os::raw::c_int, + _File: *mut FILE, + ) -> *mut wchar_t; +} +extern "C" { + pub fn fputws(_Str: *const wchar_t, _File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _getws(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _putws(_Str: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scwprintf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swprintf_l( + arg1: *mut wchar_t, + _SizeInWords: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swprintf_c( + _DstBuf: *mut wchar_t, + _SizeInWords: size_t, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vswprintf_c( + _DstBuf: *mut wchar_t, + _SizeInWords: size_t, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwprintf( + _Dest: *mut wchar_t, + _Count: size_t, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnwprintf( + _Dest: *mut wchar_t, + _Count: size_t, + _Format: *const wchar_t, + _Args: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_snwprintf( + s: *mut wchar_t, + n: size_t, + format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_vsnwprintf( + arg1: *mut wchar_t, + arg2: size_t, + arg3: *const wchar_t, + arg4: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fwprintf_p(_File: *mut FILE, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wprintf_p(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vfwprintf_p( + _File: *mut FILE, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vwprintf_p(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swprintf_p( + _DstBuf: *mut wchar_t, + _MaxCount: size_t, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vswprintf_p( + _DstBuf: *mut wchar_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scwprintf_p(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vscwprintf_p(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wprintf_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wprintf_p_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vwprintf_l( + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vwprintf_p_l( + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fwprintf_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fwprintf_p_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vfwprintf_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vfwprintf_p_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swprintf_c_l( + _DstBuf: *mut wchar_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swprintf_p_l( + _DstBuf: *mut wchar_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vswprintf_c_l( + _DstBuf: *mut wchar_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vswprintf_p_l( + _DstBuf: *mut wchar_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scwprintf_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scwprintf_p_l( + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vscwprintf_p_l( + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwprintf_l( + _DstBuf: *mut wchar_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnwprintf_l( + _DstBuf: *mut wchar_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swprintf(_Dest: *mut wchar_t, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vswprintf( + _Dest: *mut wchar_t, + _Format: *const wchar_t, + _Args: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __swprintf_l( + _Dest: *mut wchar_t, + _Format: *const wchar_t, + _Plocinfo: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vswprintf_l( + _Dest: *mut wchar_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __vswprintf_l( + _Dest: *mut wchar_t, + _Format: *const wchar_t, + _Plocinfo: _locale_t, + _Args: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtempnam(_Directory: *const wchar_t, _FilePrefix: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _vscwprintf(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vscwprintf_l( + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fwscanf_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swscanf_l( + _Src: *const wchar_t, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwscanf( + _Src: *const wchar_t, + _MaxCount: size_t, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwscanf_l( + _Src: *const wchar_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wscanf_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfdopen(_FileHandle: ::std::os::raw::c_int, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wfopen(_Filename: *const wchar_t, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wfreopen( + _Filename: *const wchar_t, + _Mode: *const wchar_t, + _OldFile: *mut FILE, + ) -> *mut FILE; +} +extern "C" { + pub fn _wperror(_ErrMsg: *const wchar_t); +} +extern "C" { + pub fn _wpopen(_Command: *const wchar_t, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wremove(_Filename: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtmpnam(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _fgetwc_nolock(_File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fputwc_nolock(_Ch: wchar_t, _File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _ungetwc_nolock(_Ch: wint_t, _File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _itow( + _Value: ::std::os::raw::c_int, + _Dest: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _ltow( + _Value: ::std::os::raw::c_long, + _Dest: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _ultow( + _Value: ::std::os::raw::c_ulong, + _Dest: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wcstod_l(_Str: *const wchar_t, _EndPtr: *mut *mut wchar_t, _Locale: _locale_t) -> f64; +} +extern "C" { + pub fn __mingw_wcstod(_Str: *const wchar_t, _EndPtr: *mut *mut wchar_t) -> f64; +} +extern "C" { + pub fn __mingw_wcstof(nptr: *const wchar_t, endptr: *mut *mut wchar_t) -> f32; +} +extern "C" { + pub fn __mingw_wcstold(arg1: *const wchar_t, arg2: *mut *mut wchar_t) -> u128; +} +extern "C" { + pub fn wcstod(_Str: *const wchar_t, _EndPtr: *mut *mut wchar_t) -> f64; +} +extern "C" { + pub fn wcstof(nptr: *const wchar_t, endptr: *mut *mut wchar_t) -> f32; +} +extern "C" { + pub fn wcstold(arg1: *const wchar_t, arg2: *mut *mut wchar_t) -> u128; +} +extern "C" { + pub fn wcstol( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _wcstol_l( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn wcstoul( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _wcstoul_l( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _wgetenv(_VarName: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wtof(_Str: *const wchar_t) -> f64; +} +extern "C" { + pub fn _wtof_l(_Str: *const wchar_t, _Locale: _locale_t) -> f64; +} +extern "C" { + pub fn _wtoi(_Str: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtoi_l(_Str: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtol(_Str: *const wchar_t) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _wtol_l(_Str: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _i64tow( + _Val: ::std::os::raw::c_longlong, + _DstBuf: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _ui64tow( + _Val: ::std::os::raw::c_ulonglong, + _DstBuf: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wtoi64(_Str: *const wchar_t) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wtoi64_l(_Str: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoi64( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoi64_l( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoui64( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _wcstoui64_l( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _wfullpath( + _FullPath: *mut wchar_t, + _Path: *const wchar_t, + _SizeInWords: size_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wmakepath( + _ResultPath: *mut wchar_t, + _Drive: *const wchar_t, + _Dir: *const wchar_t, + _Filename: *const wchar_t, + _Ext: *const wchar_t, + ); +} +extern "C" { + pub fn _wputenv(_EnvString: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wsearchenv( + _Filename: *const wchar_t, + _EnvVar: *const wchar_t, + _ResultPath: *mut wchar_t, + ); +} +extern "C" { + pub fn _wsplitpath( + _FullPath: *const wchar_t, + _Drive: *mut wchar_t, + _Dir: *mut wchar_t, + _Filename: *mut wchar_t, + _Ext: *mut wchar_t, + ); +} +extern "C" { + pub fn _wcsdup(_Str: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscat(_Dest: *mut wchar_t, _Source: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcschr( + _Str: *const ::std::os::raw::c_ushort, + _Ch: ::std::os::raw::c_ushort, + ) -> *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub fn wcscmp( + _Str1: *const ::std::os::raw::c_ushort, + _Str2: *const ::std::os::raw::c_ushort, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcscpy(_Dest: *mut wchar_t, _Source: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscspn(_Str: *const wchar_t, _Control: *const wchar_t) -> size_t; +} +extern "C" { + pub fn wcslen(_Str: *const ::std::os::raw::c_ushort) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn wcsnlen(_Src: *const wchar_t, _MaxCount: size_t) -> size_t; +} +extern "C" { + pub fn wcsncat(_Dest: *mut wchar_t, _Source: *const wchar_t, _Count: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsncmp( + _Str1: *const ::std::os::raw::c_ushort, + _Str2: *const ::std::os::raw::c_ushort, + _MaxCount: ::std::os::raw::c_ulonglong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsncpy(_Dest: *mut wchar_t, _Source: *const wchar_t, _Count: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsncpy_l( + _Dest: *mut wchar_t, + _Source: *const wchar_t, + _Count: size_t, + _Locale: _locale_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn wcspbrk(_Str: *const wchar_t, _Control: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsrchr(_Str: *const wchar_t, _Ch: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsspn(_Str: *const wchar_t, _Control: *const wchar_t) -> size_t; +} +extern "C" { + pub fn wcsstr(_Str: *const wchar_t, _SubStr: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcstok(_Str: *mut wchar_t, _Delim: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcserror(_ErrNum: ::std::os::raw::c_int) -> *mut wchar_t; +} +extern "C" { + pub fn __wcserror(_Str: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsicmp(_Str1: *const wchar_t, _Str2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsicmp_l( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicmp( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicmp_l( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnset(_Str: *mut wchar_t, _Val: wchar_t, _MaxCount: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsrev(_Str: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsset(_Str: *mut wchar_t, _Val: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcslwr(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcslwr_l(_String: *mut wchar_t, _Locale: _locale_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsupr(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsupr_l(_String: *mut wchar_t, _Locale: _locale_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsxfrm(_Dst: *mut wchar_t, _Src: *const wchar_t, _MaxCount: size_t) -> size_t; +} +extern "C" { + pub fn _wcsxfrm_l( + _Dst: *mut wchar_t, + _Src: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> size_t; +} +extern "C" { + pub fn wcscoll(_Str1: *const wchar_t, _Str2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcscoll_l( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsicoll(_Str1: *const wchar_t, _Str2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsicoll_l( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsncoll( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsncoll_l( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicoll( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicoll_l( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsdup(_Str: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsicmp(_Str1: *const wchar_t, _Str2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsnicmp( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsnset(_Str: *mut wchar_t, _Val: wchar_t, _MaxCount: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsrev(_Str: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsset(_Str: *mut wchar_t, _Val: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcslwr(_Str: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsupr(_Str: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsicoll(_Str1: *const wchar_t, _Str2: *const wchar_t) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct tm { + pub tm_sec: ::std::os::raw::c_int, + pub tm_min: ::std::os::raw::c_int, + pub tm_hour: ::std::os::raw::c_int, + pub tm_mday: ::std::os::raw::c_int, + pub tm_mon: ::std::os::raw::c_int, + pub tm_year: ::std::os::raw::c_int, + pub tm_wday: ::std::os::raw::c_int, + pub tm_yday: ::std::os::raw::c_int, + pub tm_isdst: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_tm() { + assert_eq!( + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(tm)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(tm)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_sec as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_sec) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_min as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_min) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_hour as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_hour) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_mday as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mday) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_mon as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mon) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_year as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_year) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_wday as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_wday) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_yday as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_yday) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tm_isdst as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_isdst) + ) + ); +} +extern "C" { + pub fn _wasctime(_Tm: *const tm) -> *mut wchar_t; +} +extern "C" { + pub fn _wasctime_s(_Buf: *mut wchar_t, _SizeInWords: size_t, _Tm: *const tm) -> errno_t; +} +extern "C" { + pub fn _wctime32(_Time: *const __time32_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wctime32_s( + _Buf: *mut wchar_t, + _SizeInWords: size_t, + _Time: *const __time32_t, + ) -> errno_t; +} +extern "C" { + pub fn wcsftime( + _Buf: *mut wchar_t, + _SizeInWords: size_t, + _Format: *const wchar_t, + _Tm: *const tm, + ) -> size_t; +} +extern "C" { + pub fn _wcsftime_l( + _Buf: *mut wchar_t, + _SizeInWords: size_t, + _Format: *const wchar_t, + _Tm: *const tm, + _Locale: _locale_t, + ) -> size_t; +} +extern "C" { + pub fn _wstrdate(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wstrdate_s(_Buf: *mut wchar_t, _SizeInWords: size_t) -> errno_t; +} +extern "C" { + pub fn _wstrtime(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wstrtime_s(_Buf: *mut wchar_t, _SizeInWords: size_t) -> errno_t; +} +extern "C" { + pub fn _wctime64(_Time: *const __time64_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wctime64_s( + _Buf: *mut wchar_t, + _SizeInWords: size_t, + _Time: *const __time64_t, + ) -> errno_t; +} +extern "C" { + pub fn _wctime(_Time: *const time_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wctime_s(arg1: *mut wchar_t, arg2: size_t, arg3: *const time_t) -> errno_t; +} +pub type mbstate_t = ::std::os::raw::c_int; +pub type _Wint_t = wchar_t; +extern "C" { + pub fn btowc(arg1: ::std::os::raw::c_int) -> wint_t; +} +extern "C" { + pub fn mbrlen( + _Ch: *const ::std::os::raw::c_char, + _SizeInBytes: size_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn mbrtowc( + _DstCh: *mut wchar_t, + _SrcCh: *const ::std::os::raw::c_char, + _SizeInBytes: size_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn mbsrtowcs( + _Dest: *mut wchar_t, + _PSrc: *mut *const ::std::os::raw::c_char, + _Count: size_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wcrtomb( + _Dest: *mut ::std::os::raw::c_char, + _Source: wchar_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wcsrtombs( + _Dest: *mut ::std::os::raw::c_char, + _PSource: *mut *const wchar_t, + _Count: size_t, + _State: *mut mbstate_t, + ) -> size_t; +} +extern "C" { + pub fn wctob(_WCh: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wmemset(s: *mut wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wmemchr( + s: *const ::std::os::raw::c_ushort, + c: ::std::os::raw::c_ushort, + n: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub fn wmemcmp( + s1: *const ::std::os::raw::c_ushort, + s2: *const ::std::os::raw::c_ushort, + n: ::std::os::raw::c_ulonglong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wmemcpy( + s1: *mut ::std::os::raw::c_ushort, + s2: *const ::std::os::raw::c_ushort, + n: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub fn wmempcpy(_Dst: *mut wchar_t, _Src: *const wchar_t, _Size: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wmemmove( + s1: *mut ::std::os::raw::c_ushort, + s2: *const ::std::os::raw::c_ushort, + n: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub fn fwide(stream: *mut FILE, mode: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mbsinit(ps: *const mbstate_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcstoll( + nptr: *const wchar_t, + endptr: *mut *mut wchar_t, + base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn wcstoull( + nptr: *const wchar_t, + endptr: *mut *mut wchar_t, + base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn memmove( + _Dst: *mut ::std::os::raw::c_void, + _Src: *const ::std::os::raw::c_void, + _MaxCount: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memcpy( + _Dst: *mut ::std::os::raw::c_void, + _Src: *const ::std::os::raw::c_void, + _MaxCount: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn __mingw_str_wide_utf8( + wptr: *const wchar_t, + mbptr: *mut *mut ::std::os::raw::c_char, + buflen: *mut size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_str_utf8_wide( + mbptr: *const ::std::os::raw::c_char, + wptr: *mut *mut wchar_t, + buflen: *mut size_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_str_free(ptr: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn _waccess_s(_Filename: *const wchar_t, _AccessMode: ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn _wmktemp_s(_TemplateName: *mut wchar_t, _SizeInWords: size_t) -> errno_t; +} +extern "C" { + pub fn _cgetws_s( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _SizeRead: *mut size_t, + ) -> errno_t; +} +extern "C" { + pub fn _cwprintf_s(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _cwscanf_s(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _cwscanf_s_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vcwprintf_s(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _cwprintf_s_l(_Format: *const wchar_t, _Locale: _locale_t, ...) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vcwprintf_s_l( + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _getws_s(_Str: *mut wchar_t, _SizeInWords: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn fwprintf_s(_File: *mut FILE, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wprintf_s(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vfwprintf_s( + _File: *mut FILE, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vwprintf_s(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vswprintf_s( + _Dst: *mut wchar_t, + _SizeInWords: size_t, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn swprintf_s( + _Dst: *mut wchar_t, + _SizeInWords: size_t, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnwprintf_s( + _DstBuf: *mut wchar_t, + _DstSizeInWords: size_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwprintf_s( + _DstBuf: *mut wchar_t, + _DstSizeInWords: size_t, + _MaxCount: size_t, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wprintf_s_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vwprintf_s_l( + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fwprintf_s_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vfwprintf_s_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swprintf_s_l( + _DstBuf: *mut wchar_t, + _DstSize: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vswprintf_s_l( + _DstBuf: *mut wchar_t, + _DstSize: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwprintf_s_l( + _DstBuf: *mut wchar_t, + _DstSize: size_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnwprintf_s_l( + _DstBuf: *mut wchar_t, + _DstSize: size_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fwscanf_s_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swscanf_s_l( + _Src: *const wchar_t, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn swscanf_s(_Src: *const wchar_t, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwscanf_s( + _Src: *const wchar_t, + _MaxCount: size_t, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwscanf_s_l( + _Src: *const wchar_t, + _MaxCount: size_t, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wscanf_s_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfopen_s( + _File: *mut *mut FILE, + _Filename: *const wchar_t, + _Mode: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wfreopen_s( + _File: *mut *mut FILE, + _Filename: *const wchar_t, + _Mode: *const wchar_t, + _OldFile: *mut FILE, + ) -> errno_t; +} +extern "C" { + pub fn _wtmpnam_s(_DstBuf: *mut wchar_t, _SizeInWords: size_t) -> errno_t; +} +extern "C" { + pub fn wcstok_s( + _Str: *mut wchar_t, + _Delim: *const wchar_t, + _Context: *mut *mut wchar_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wcserror_s( + _Buf: *mut wchar_t, + _SizeInWords: size_t, + _ErrNum: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn __wcserror_s( + _Buffer: *mut wchar_t, + _SizeInWords: size_t, + _ErrMsg: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wcsnset_s( + _Dst: *mut wchar_t, + _DstSizeInWords: size_t, + _Val: wchar_t, + _MaxCount: size_t, + ) -> errno_t; +} +extern "C" { + pub fn _wcsset_s(_Str: *mut wchar_t, _SizeInWords: size_t, _Val: wchar_t) -> errno_t; +} +extern "C" { + pub fn _wcslwr_s(_Str: *mut wchar_t, _SizeInWords: size_t) -> errno_t; +} +extern "C" { + pub fn _wcslwr_s_l(_Str: *mut wchar_t, _SizeInWords: size_t, _Locale: _locale_t) -> errno_t; +} +extern "C" { + pub fn _wcsupr_s(_Str: *mut wchar_t, _Size: size_t) -> errno_t; +} +extern "C" { + pub fn _wcsupr_s_l(_Str: *mut wchar_t, _Size: size_t, _Locale: _locale_t) -> errno_t; +} +extern "C" { + pub fn wcscat_s(_Dst: *mut wchar_t, _DstSize: rsize_t, _Src: *const wchar_t) -> errno_t; +} +extern "C" { + pub fn wcscpy_s(_Dst: *mut wchar_t, _DstSize: rsize_t, _Src: *const wchar_t) -> errno_t; +} +extern "C" { + pub fn wcsncat_s( + _Dst: *mut wchar_t, + _DstSizeInChars: size_t, + _Src: *const wchar_t, + _MaxCount: size_t, + ) -> errno_t; +} +extern "C" { + pub fn _wcsncat_s_l( + _Dst: *mut wchar_t, + _DstSizeInChars: size_t, + _Src: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn wcsncpy_s( + _Dst: *mut wchar_t, + _DstSizeInChars: size_t, + _Src: *const wchar_t, + _MaxCount: size_t, + ) -> errno_t; +} +extern "C" { + pub fn _wcsncpy_s_l( + _Dst: *mut wchar_t, + _DstSizeInChars: size_t, + _Src: *const wchar_t, + _MaxCount: size_t, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn _wcstok_s_l( + _Str: *mut wchar_t, + _Delim: *const wchar_t, + _Context: *mut *mut wchar_t, + _Locale: _locale_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsset_s_l( + _Str: *mut wchar_t, + _SizeInChars: size_t, + _Val: ::std::os::raw::c_uint, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn _wcsnset_s_l( + _Str: *mut wchar_t, + _SizeInChars: size_t, + _Val: ::std::os::raw::c_uint, + _Count: size_t, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn mbsrtowcs_s( + _Retval: *mut size_t, + _Dst: *mut wchar_t, + _SizeInWords: size_t, + _PSrc: *mut *const ::std::os::raw::c_char, + _N: size_t, + _State: *mut mbstate_t, + ) -> errno_t; +} +extern "C" { + pub fn wcrtomb_s( + _Retval: *mut size_t, + _Dst: *mut ::std::os::raw::c_char, + _SizeInBytes: size_t, + _Ch: wchar_t, + _State: *mut mbstate_t, + ) -> errno_t; +} +extern "C" { + pub fn wcsrtombs_s( + _Retval: *mut size_t, + _Dst: *mut ::std::os::raw::c_char, + _SizeInBytes: size_t, + _Src: *mut *const wchar_t, + _Size: size_t, + _State: *mut mbstate_t, + ) -> errno_t; +} +extern "C" { + pub fn wmemcpy_s( + _dest: *mut wchar_t, + _numberOfElements: size_t, + _src: *const wchar_t, + _count: size_t, + ) -> errno_t; +} +extern "C" { + pub fn wmemmove_s( + _dest: *mut wchar_t, + _numberOfElements: size_t, + _src: *const wchar_t, + _count: size_t, + ) -> errno_t; +} +pub type int_least8_t = ::std::os::raw::c_schar; +pub type uint_least8_t = ::std::os::raw::c_uchar; +pub type int_least16_t = ::std::os::raw::c_short; +pub type uint_least16_t = ::std::os::raw::c_ushort; +pub type int_least32_t = ::std::os::raw::c_int; +pub type uint_least32_t = ::std::os::raw::c_uint; +pub type int_least64_t = ::std::os::raw::c_longlong; +pub type uint_least64_t = ::std::os::raw::c_ulonglong; +pub type int_fast8_t = ::std::os::raw::c_schar; +pub type uint_fast8_t = ::std::os::raw::c_uchar; +pub type int_fast16_t = ::std::os::raw::c_short; +pub type uint_fast16_t = ::std::os::raw::c_ushort; +pub type int_fast32_t = ::std::os::raw::c_int; +pub type uint_fast32_t = ::std::os::raw::c_uint; +pub type int_fast64_t = ::std::os::raw::c_longlong; +pub type uint_fast64_t = ::std::os::raw::c_ulonglong; +pub type intmax_t = ::std::os::raw::c_longlong; +pub type uintmax_t = ::std::os::raw::c_ulonglong; +extern "C" { + pub fn TCOD_strdup(s: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_strcasecmp( + s1: *const ::std::os::raw::c_char, + s2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_strncasecmp( + s1: *const ::std::os::raw::c_char, + s2: *const ::std::os::raw::c_char, + n: size_t, + ) -> ::std::os::raw::c_int; +} +#[doc = " \\brief A callback to be passed to TCOD_line"] +#[doc = ""] +#[doc = " The points given to the callback include both the starting and ending"] +#[doc = " positions."] +#[doc = ""] +#[doc = " \\param x"] +#[doc = " \\param y"] +#[doc = " \\return As long as this callback returns true it will be called with the"] +#[doc = " next x,y point on the line."] +pub type TCOD_line_listener_t = ::std::option::Option< + unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> bool, +>; +extern "C" { + pub fn TCOD_line_init( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_line_step( + xCur: *mut ::std::os::raw::c_int, + yCur: *mut ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_line( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + listener: TCOD_line_listener_t, + ) -> bool; +} +#[doc = " \\brief A struct used for computing a bresenham line."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_bresenham_data_t { + pub stepx: ::std::os::raw::c_int, + pub stepy: ::std::os::raw::c_int, + pub e: ::std::os::raw::c_int, + pub deltax: ::std::os::raw::c_int, + pub deltay: ::std::os::raw::c_int, + pub origx: ::std::os::raw::c_int, + pub origy: ::std::os::raw::c_int, + pub destx: ::std::os::raw::c_int, + pub desty: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_bresenham_data_t() { + assert_eq!( + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(TCOD_bresenham_data_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_bresenham_data_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stepx as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(stepx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stepy as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(stepy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).e as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(e) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).deltax as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(deltax) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).deltay as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(deltay) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).origx as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(origx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).origy as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(origy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).destx as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(destx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).desty as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bresenham_data_t), + "::", + stringify!(desty) + ) + ); +} +extern "C" { + pub fn TCOD_line_init_mt( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + data: *mut TCOD_bresenham_data_t, + ); +} +extern "C" { + pub fn TCOD_line_step_mt( + xCur: *mut ::std::os::raw::c_int, + yCur: *mut ::std::os::raw::c_int, + data: *mut TCOD_bresenham_data_t, + ) -> bool; +} +extern "C" { + pub fn TCOD_line_mt( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + listener: TCOD_line_listener_t, + data: *mut TCOD_bresenham_data_t, + ) -> bool; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Random { + _unused: [u8; 0], +} +pub type TCOD_random_t = *mut TCOD_Random; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_dice_t { + pub nb_rolls: ::std::os::raw::c_int, + pub nb_faces: ::std::os::raw::c_int, + pub multiplier: f32, + pub addsub: f32, +} +#[test] +fn bindgen_test_layout_TCOD_dice_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_dice_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_dice_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_rolls as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(nb_rolls) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_faces as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(nb_faces) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).multiplier as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(multiplier) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).addsub as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_dice_t), + "::", + stringify!(addsub) + ) + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_random_algo_t { + TCOD_RNG_MT = 0, + TCOD_RNG_CMWC = 1, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_distribution_t { + TCOD_DISTRIBUTION_LINEAR = 0, + TCOD_DISTRIBUTION_GAUSSIAN = 1, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE = 2, + TCOD_DISTRIBUTION_GAUSSIAN_INVERSE = 3, + TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE = 4, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TCOD_tree_t { + pub next: *mut _TCOD_tree_t, + pub father: *mut _TCOD_tree_t, + pub sons: *mut _TCOD_tree_t, +} +#[test] +fn bindgen_test_layout__TCOD_tree_t() { + assert_eq!( + ::std::mem::size_of::<_TCOD_tree_t>(), + 24usize, + concat!("Size of: ", stringify!(_TCOD_tree_t)) + ); + assert_eq!( + ::std::mem::align_of::<_TCOD_tree_t>(), + 8usize, + concat!("Alignment of ", stringify!(_TCOD_tree_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).next as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).father as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(father) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_TCOD_tree_t>())).sons as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_TCOD_tree_t), + "::", + stringify!(sons) + ) + ); +} +impl Default for _TCOD_tree_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_tree_t = _TCOD_tree_t; +extern "C" { + pub fn TCOD_tree_new() -> *mut TCOD_tree_t; +} +extern "C" { + pub fn TCOD_tree_add_son(node: *mut TCOD_tree_t, son: *mut TCOD_tree_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_bsp_t { + pub tree: TCOD_tree_t, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub w: ::std::os::raw::c_int, + pub h: ::std::os::raw::c_int, + pub position: ::std::os::raw::c_int, + pub level: u8, + pub horizontal: bool, +} +#[test] +fn bindgen_test_layout_TCOD_bsp_t() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(TCOD_bsp_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_bsp_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tree as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(tree) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(position) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).level as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(level) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).horizontal as *const _ as usize }, + 45usize, + concat!( + "Offset of field: ", + stringify!(TCOD_bsp_t), + "::", + stringify!(horizontal) + ) + ); +} +impl Default for TCOD_bsp_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_bsp_callback_t = ::std::option::Option< + unsafe extern "C" fn(node: *mut TCOD_bsp_t, userData: *mut ::std::os::raw::c_void) -> bool, +>; +extern "C" { + pub fn TCOD_bsp_new() -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_new_with_size( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_delete(node: *mut TCOD_bsp_t); +} +extern "C" { + pub fn TCOD_bsp_left(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_right(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_father(node: *mut TCOD_bsp_t) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_is_leaf(node: *mut TCOD_bsp_t) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_pre_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_in_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_post_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_level_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_traverse_inverted_level_order( + node: *mut TCOD_bsp_t, + listener: TCOD_bsp_callback_t, + userData: *mut ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_contains( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_bsp_find_node( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> *mut TCOD_bsp_t; +} +extern "C" { + pub fn TCOD_bsp_resize( + node: *mut TCOD_bsp_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_bsp_split_once( + node: *mut TCOD_bsp_t, + horizontal: bool, + position: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_bsp_split_recursive( + node: *mut TCOD_bsp_t, + randomizer: TCOD_random_t, + nb: ::std::os::raw::c_int, + minHSize: ::std::os::raw::c_int, + minVSize: ::std::os::raw::c_int, + maxHRatio: f32, + maxVRatio: f32, + ); +} +extern "C" { + pub fn TCOD_bsp_remove_sons(node: *mut TCOD_bsp_t); +} +#[doc = " A three channel color struct."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ColorRGB { + pub r: u8, + pub g: u8, + pub b: u8, +} +#[test] +fn bindgen_test_layout_TCOD_ColorRGB() { + assert_eq!( + ::std::mem::size_of::(), + 3usize, + concat!("Size of: ", stringify!(TCOD_ColorRGB)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_ColorRGB)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGB), + "::", + stringify!(r) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGB), + "::", + stringify!(g) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGB), + "::", + stringify!(b) + ) + ); +} +pub type TCOD_color_t = TCOD_ColorRGB; +#[doc = " A four channel color struct."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ColorRGBA { + pub r: u8, + pub g: u8, + pub b: u8, + pub a: u8, +} +#[test] +fn bindgen_test_layout_TCOD_ColorRGBA() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(TCOD_ColorRGBA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_ColorRGBA)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGBA), + "::", + stringify!(r) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGBA), + "::", + stringify!(g) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGBA), + "::", + stringify!(b) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ColorRGBA), + "::", + stringify!(a) + ) + ); +} +extern "C" { + pub fn TCOD_color_RGB(r: u8, g: u8, b: u8) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_HSV(hue: f32, saturation: f32, value: f32) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_equals(c1: TCOD_color_t, c2: TCOD_color_t) -> bool; +} +extern "C" { + pub fn TCOD_color_add(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_subtract(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_multiply(c1: TCOD_color_t, c2: TCOD_color_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_multiply_scalar(c1: TCOD_color_t, value: f32) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_color_lerp(c1: TCOD_color_t, c2: TCOD_color_t, coef: f32) -> TCOD_color_t; +} +extern "C" { + #[doc = " Blend `src` into `dst` as an alpha blending operation."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_color_alpha_blend(dst: *mut TCOD_ColorRGBA, src: *const TCOD_ColorRGBA); +} +extern "C" { + pub fn TCOD_color_set_HSV(color: *mut TCOD_color_t, hue: f32, saturation: f32, value: f32); +} +extern "C" { + pub fn TCOD_color_get_HSV( + color: TCOD_color_t, + hue: *mut f32, + saturation: *mut f32, + value: *mut f32, + ); +} +extern "C" { + pub fn TCOD_color_get_hue(color: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_hue(color: *mut TCOD_color_t, hue: f32); +} +extern "C" { + pub fn TCOD_color_get_saturation(color: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_saturation(color: *mut TCOD_color_t, saturation: f32); +} +extern "C" { + pub fn TCOD_color_get_value(color: TCOD_color_t) -> f32; +} +extern "C" { + pub fn TCOD_color_set_value(color: *mut TCOD_color_t, value: f32); +} +extern "C" { + pub fn TCOD_color_shift_hue(color: *mut TCOD_color_t, hshift: f32); +} +extern "C" { + pub fn TCOD_color_scale_HSV(color: *mut TCOD_color_t, saturation_coef: f32, value_coef: f32); +} +extern "C" { + pub fn TCOD_color_gen_map( + map: *mut TCOD_color_t, + nb_key: ::std::os::raw::c_int, + key_color: *const TCOD_color_t, + key_index: *const ::std::os::raw::c_int, + ); +} +pub const TCOD_COLOR_RED: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_RED; +pub const TCOD_COLOR_FLAME: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_FLAME; +pub const TCOD_COLOR_ORANGE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_ORANGE; +pub const TCOD_COLOR_AMBER: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_AMBER; +pub const TCOD_COLOR_YELLOW: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_YELLOW; +pub const TCOD_COLOR_LIME: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_LIME; +pub const TCOD_COLOR_CHARTREUSE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CHARTREUSE; +pub const TCOD_COLOR_GREEN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_GREEN; +pub const TCOD_COLOR_SEA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_SEA; +pub const TCOD_COLOR_TURQUOISE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_TURQUOISE; +pub const TCOD_COLOR_CYAN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CYAN; +pub const TCOD_COLOR_SKY: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_SKY; +pub const TCOD_COLOR_AZURE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_AZURE; +pub const TCOD_COLOR_BLUE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_BLUE; +pub const TCOD_COLOR_HAN: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_HAN; +pub const TCOD_COLOR_VIOLET: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_VIOLET; +pub const TCOD_COLOR_PURPLE: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_PURPLE; +pub const TCOD_COLOR_FUCHSIA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_FUCHSIA; +pub const TCOD_COLOR_MAGENTA: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_MAGENTA; +pub const TCOD_COLOR_PINK: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_PINK; +pub const TCOD_COLOR_CRIMSON: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_CRIMSON; +pub const TCOD_COLOR_NB: _bindgen_ty_1 = _bindgen_ty_1::TCOD_COLOR_NB; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_1 { + TCOD_COLOR_RED = 0, + TCOD_COLOR_FLAME = 1, + TCOD_COLOR_ORANGE = 2, + TCOD_COLOR_AMBER = 3, + TCOD_COLOR_YELLOW = 4, + TCOD_COLOR_LIME = 5, + TCOD_COLOR_CHARTREUSE = 6, + TCOD_COLOR_GREEN = 7, + TCOD_COLOR_SEA = 8, + TCOD_COLOR_TURQUOISE = 9, + TCOD_COLOR_CYAN = 10, + TCOD_COLOR_SKY = 11, + TCOD_COLOR_AZURE = 12, + TCOD_COLOR_BLUE = 13, + TCOD_COLOR_HAN = 14, + TCOD_COLOR_VIOLET = 15, + TCOD_COLOR_PURPLE = 16, + TCOD_COLOR_FUCHSIA = 17, + TCOD_COLOR_MAGENTA = 18, + TCOD_COLOR_PINK = 19, + TCOD_COLOR_CRIMSON = 20, + TCOD_COLOR_NB = 21, +} +pub const TCOD_COLOR_DESATURATED: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DESATURATED; +pub const TCOD_COLOR_LIGHTEST: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHTEST; +pub const TCOD_COLOR_LIGHTER: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHTER; +pub const TCOD_COLOR_LIGHT: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LIGHT; +pub const TCOD_COLOR_NORMAL: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_NORMAL; +pub const TCOD_COLOR_DARK: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARK; +pub const TCOD_COLOR_DARKER: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARKER; +pub const TCOD_COLOR_DARKEST: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_DARKEST; +pub const TCOD_COLOR_LEVELS: _bindgen_ty_2 = _bindgen_ty_2::TCOD_COLOR_LEVELS; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_2 { + TCOD_COLOR_DESATURATED = 0, + TCOD_COLOR_LIGHTEST = 1, + TCOD_COLOR_LIGHTER = 2, + TCOD_COLOR_LIGHT = 3, + TCOD_COLOR_NORMAL = 4, + TCOD_COLOR_DARK = 5, + TCOD_COLOR_DARKER = 6, + TCOD_COLOR_DARKEST = 7, + TCOD_COLOR_LEVELS = 8, +} +extern "C" { + pub static mut TCOD_colors: [[TCOD_color_t; 8usize]; 21usize]; +} +extern "C" { + pub static TCOD_black: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_grey: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_gray: TCOD_color_t; +} +extern "C" { + pub static TCOD_white: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sepia: TCOD_color_t; +} +extern "C" { + pub static TCOD_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_dark_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_darker_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_darkest_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_light_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_lighter_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_lightest_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_red: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_flame: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_orange: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_amber: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_yellow: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_lime: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_chartreuse: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_green: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_sea: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_turquoise: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_cyan: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_sky: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_azure: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_blue: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_han: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_violet: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_purple: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_fuchsia: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_magenta: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_pink: TCOD_color_t; +} +extern "C" { + pub static TCOD_desaturated_crimson: TCOD_color_t; +} +extern "C" { + pub static TCOD_brass: TCOD_color_t; +} +extern "C" { + pub static TCOD_copper: TCOD_color_t; +} +extern "C" { + pub static TCOD_gold: TCOD_color_t; +} +extern "C" { + pub static TCOD_silver: TCOD_color_t; +} +extern "C" { + pub static TCOD_celadon: TCOD_color_t; +} +extern "C" { + pub static TCOD_peach: TCOD_color_t; +} +#[repr(i32)] +#[doc = " An enum of libtcod error codes."] +#[doc = ""] +#[doc = " On values other than `TCOD_E_OK` you can use `TCOD_get_error()` to learn"] +#[doc = " more information."] +#[doc = " \\rst"] +#[doc = " .. versionadded:: 1.16"] +#[doc = " \\endrst"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_Error { + #[doc = " The function completed successfully without issues."] + #[doc = ""] + #[doc = " A function is successful when `(err >= 0)`. Positive values may be used"] + #[doc = " for warnings, or for other outputs."] + TCOD_E_OK = 0, + #[doc = " The error code for generic runtime errors."] + #[doc = ""] + #[doc = " The returned code my be changed in the future to something more specific."] + #[doc = " Use `(err < 0)` to check if the value is an error."] + TCOD_E_ERROR = -1, + #[doc = " The function failed because a given input argument was invalid."] + TCOD_E_INVALID_ARGUMENT = -2, + #[doc = " The function failed because it was unable to allocate enough memory."] + TCOD_E_OUT_OF_MEMORY = -3, + #[doc = " The function completed, but a minor issue was detected."] + TCOD_E_WARN = 1, +} +extern "C" { + #[doc = " Return the last error message. If there is no error then the string will"] + #[doc = " have a length of zero."] + #[doc = ""] + #[doc = " The error state is thread specific."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.12"] + #[doc = " \\endrst"] + pub fn TCOD_get_error() -> *const ::std::os::raw::c_char; +} +extern "C" { + #[doc = " Set an error message and return TCOD_E_ERROR."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.12"] + #[doc = " \\endrst"] + pub fn TCOD_set_error(msg: *const ::std::os::raw::c_char) -> TCOD_Error; +} +extern "C" { + #[doc = " Set an error message and return TCOD_E_ERROR."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_set_errorf(fmt: *const ::std::os::raw::c_char, ...) -> TCOD_Error; +} +extern "C" { + #[doc = " Clear a current existing error message."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_clear_error(); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetObserver { + pub tileset: *mut TCOD_Tileset, + pub next: *mut TCOD_TilesetObserver, + pub userdata: *mut ::std::os::raw::c_void, + pub on_observer_delete: + ::std::option::Option, + pub on_tile_changed: ::std::option::Option< + unsafe extern "C" fn( + observer: *mut TCOD_TilesetObserver, + tile_id: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, +} +#[test] +fn bindgen_test_layout_TCOD_TilesetObserver() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_TilesetObserver)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_TilesetObserver)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(tileset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).userdata as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(userdata) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).on_observer_delete as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(on_observer_delete) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).on_tile_changed as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetObserver), + "::", + stringify!(on_tile_changed) + ) + ); +} +impl Default for TCOD_TilesetObserver { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Tileset { + pub tile_width: ::std::os::raw::c_int, + pub tile_height: ::std::os::raw::c_int, + pub tile_length: ::std::os::raw::c_int, + pub tiles_capacity: ::std::os::raw::c_int, + pub tiles_count: ::std::os::raw::c_int, + pub pixels: *mut TCOD_ColorRGBA, + pub character_map_length: ::std::os::raw::c_int, + pub character_map: *mut ::std::os::raw::c_int, + pub observer_list: *mut TCOD_TilesetObserver, + pub virtual_columns: ::std::os::raw::c_int, + pub ref_count: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_Tileset() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(TCOD_Tileset)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Tileset)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tile_width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tile_width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tile_height as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tile_height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tile_length as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tile_length) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tiles_capacity as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tiles_capacity) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tiles_count as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(tiles_count) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pixels as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(pixels) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).character_map_length as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(character_map_length) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).character_map as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(character_map) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).observer_list as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(observer_list) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).virtual_columns as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(virtual_columns) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ref_count as *const _ as usize }, + 60usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Tileset), + "::", + stringify!(ref_count) + ) + ); +} +impl Default for TCOD_Tileset { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + #[doc = " Create a new tile-set with the given tile size."] + pub fn TCOD_tileset_new( + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Delete a tile-set."] + pub fn TCOD_tileset_delete(tileset: *mut TCOD_Tileset); +} +extern "C" { + #[doc = " Return the pixel width of tiles in this tileset."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_width_(tileset: *const TCOD_Tileset) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return the pixel height of tiles in this tileset."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_height_(tileset: *const TCOD_Tileset) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Fetch a tile, outputting its data to a pixel buffer."] + #[doc = ""] + #[doc = " `codepoint` is the index for the tile. Unicode is recommend."] + #[doc = ""] + #[doc = " `buffer` is a pointer to a contiguous row-major array of pixels. The tile"] + #[doc = " data will be outputted here. This pointer can be NULL if you only want to"] + #[doc = " know if the tileset has a specific tile."] + #[doc = ""] + #[doc = " Returns 0 if the tile exists. Returns a negative value on an error or if"] + #[doc = " the tileset does not have a tile for this codepoint."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_get_tile_( + tileset: *const TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + buffer: *mut TCOD_ColorRGBA, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Upload a tile from a pixel buffer into this tileset."] + #[doc = ""] + #[doc = " `codepoint` is the index for the tile. Unicode is recommend."] + #[doc = ""] + #[doc = " `buffer` is a pointer to a contiguous row-major array of pixels."] + #[doc = " This can not be NULL."] + #[doc = ""] + #[doc = " The tileset functions are provisional, the API may change in the future."] + pub fn TCOD_tileset_set_tile_( + tileset: *mut TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + buffer: *const TCOD_ColorRGBA, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Load a font from a tilesheet."] + pub fn TCOD_tileset_load( + filename: *const ::std::os::raw::c_char, + columns: ::std::os::raw::c_int, + rows: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + charmap: *mut ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Assign a codepoint to an existing tile based on its tile ID."] + #[doc = ""] + #[doc = " Returns the tile ID on success."] + #[doc = ""] + #[doc = " Returns a negative value on error."] + pub fn TCOD_tileset_assign_tile( + tileset: *mut TCOD_Tileset, + tile_id: ::std::os::raw::c_int, + codepoint: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return a pointer to the tile for `codepoint`."] + #[doc = ""] + #[doc = " Returns NULL if no tile exists for codepoint."] + pub fn TCOD_tileset_get_tile( + tileset: *const TCOD_Tileset, + codepoint: ::std::os::raw::c_int, + ) -> *const TCOD_ColorRGBA; +} +extern "C" { + #[doc = " Return a new observer to this tileset."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_observer_new(tileset: *mut TCOD_Tileset) -> *mut TCOD_TilesetObserver; +} +extern "C" { + #[doc = " Delete an existing observer."] + #[doc = ""] + #[doc = " Will call this observers on_observer_delete callback."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_observer_delete(observer: *mut TCOD_TilesetObserver); +} +extern "C" { + #[doc = " Called to notify any observers that a tile has been changed. This may"] + #[doc = " cause running atlases to update or mark cache consoles as dirty."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_notify_tile_changed( + tileset: *mut TCOD_Tileset, + tile_id: ::std::os::raw::c_int, + ); +} +extern "C" { + #[doc = " Reserve memory for a specific amount of tiles."] + #[doc = ""] + #[doc = " For internal use."] + pub fn TCOD_tileset_reserve( + tileset: *mut TCOD_Tileset, + desired: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +#[repr(u32)] +#[doc = " \\enum TCOD_bkgnd_flag_t"] +#[doc = ""] +#[doc = " Background color blend modes."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_bkgnd_flag_t { + TCOD_BKGND_NONE = 0, + TCOD_BKGND_SET = 1, + TCOD_BKGND_MULTIPLY = 2, + TCOD_BKGND_LIGHTEN = 3, + TCOD_BKGND_DARKEN = 4, + TCOD_BKGND_SCREEN = 5, + TCOD_BKGND_COLOR_DODGE = 6, + TCOD_BKGND_COLOR_BURN = 7, + TCOD_BKGND_ADD = 8, + TCOD_BKGND_ADDA = 9, + TCOD_BKGND_BURN = 10, + TCOD_BKGND_OVERLAY = 11, + TCOD_BKGND_ALPH = 12, + TCOD_BKGND_DEFAULT = 13, +} +#[repr(u32)] +#[doc = " \\enum TCOD_alignment_t"] +#[doc = ""] +#[doc = " Print justification options."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_alignment_t { + TCOD_LEFT = 0, + TCOD_RIGHT = 1, + TCOD_CENTER = 2, +} +#[doc = " A console tile."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ConsoleTile { + #[doc = " The Unicode codepoint for this tile."] + pub ch: ::std::os::raw::c_int, + #[doc = " The tile glyph color, rendered on top of the background."] + pub fg: TCOD_ColorRGBA, + #[doc = " The tile background color, rendered behind the glyph."] + pub bg: TCOD_ColorRGBA, +} +#[test] +fn bindgen_test_layout_TCOD_ConsoleTile() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(TCOD_ConsoleTile)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_ConsoleTile)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ch as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ConsoleTile), + "::", + stringify!(ch) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fg as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ConsoleTile), + "::", + stringify!(fg) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bg as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ConsoleTile), + "::", + stringify!(bg) + ) + ); +} +#[doc = " The libtcod console struct."] +#[doc = ""] +#[doc = " All attributes should be considered private."] +#[doc = ""] +#[doc = " All C++ methods should be considered provisional, and are subject to"] +#[doc = " change."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Console { + #[doc = " Console width and height (in characters, not pixels.)"] + pub w: ::std::os::raw::c_int, + #[doc = " Console width and height (in characters, not pixels.)"] + pub h: ::std::os::raw::c_int, + #[doc = " A contiguous array of console tiles."] + pub tiles: *mut TCOD_ConsoleTile, + #[doc = " Default background operator for print & print_rect functions."] + pub bkgnd_flag: TCOD_bkgnd_flag_t, + #[doc = " Default alignment for print & print_rect functions."] + pub alignment: TCOD_alignment_t, + #[doc = " Foreground (text) and background colors."] + pub fore: TCOD_color_t, + #[doc = " Foreground (text) and background colors."] + pub back: TCOD_color_t, + #[doc = " True if a key color is being used."] + pub has_key_color: bool, + #[doc = " The current key color for this console."] + pub key_color: TCOD_color_t, + #[doc = "The total length of the tiles array. Same as `w * h`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub elements: ::std::os::raw::c_int, + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub userdata: *mut ::std::os::raw::c_void, + #[doc = " Internal use."] + pub on_delete: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_TCOD_Console() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(TCOD_Console)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Console)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tiles as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(tiles) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bkgnd_flag as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(bkgnd_flag) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).alignment as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(alignment) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fore as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(fore) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).back as *const _ as usize }, + 27usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(back) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).has_key_color as *const _ as usize }, + 30usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(has_key_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).key_color as *const _ as usize }, + 31usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(key_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).elements as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(elements) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).userdata as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(userdata) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).on_delete as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Console), + "::", + stringify!(on_delete) + ) + ); +} +impl Default for TCOD_Console { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_console_t = *mut TCOD_Console; +extern "C" { + #[doc = " Return a new console with a specific number of columns and rows."] + #[doc = ""] + #[doc = " \\param w Number of columns."] + #[doc = " \\param h Number of columns."] + #[doc = " \\return A pointer to the new console, or NULL on error."] + pub fn TCOD_console_new( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_Console; +} +extern "C" { + #[doc = " Return the width of a console."] + pub fn TCOD_console_get_width(con: *const TCOD_Console) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return the height of a console."] + pub fn TCOD_console_get_height(con: *const TCOD_Console) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_set_key_color(con: *mut TCOD_Console, col: TCOD_color_t); +} +extern "C" { + #[doc = " Blit from one console to another."] + #[doc = ""] + #[doc = " \\param srcCon Pointer to the source console."] + #[doc = " \\param xSrc The left region of the source console to blit from."] + #[doc = " \\param ySrc The top region of the source console to blit from."] + #[doc = " \\param wSrc The width of the region to blit from."] + #[doc = " If 0 then it will fill to the maximum width."] + #[doc = " \\param hSrc The height of the region to blit from."] + #[doc = " If 0 then it will fill to the maximum height."] + #[doc = " \\param dstCon Pointer to the destination console."] + #[doc = " \\param xDst The left corner to blit onto the destination console."] + #[doc = " \\param yDst The top corner to blit onto the destination console."] + #[doc = " \\param foreground_alpha Foreground blending alpha."] + #[doc = " \\param background_alpha Background blending alpha."] + #[doc = ""] + #[doc = " If the source console has a key color, this function will use it."] + #[doc = " \\rst"] + #[doc = " .. versionchanged:: 1.16"] + #[doc = " Blits can now handle per-cell alpha transparency."] + #[doc = " \\endrst"] + pub fn TCOD_console_blit( + src: *const TCOD_Console, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + dst: *mut TCOD_Console, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + foreground_alpha: f32, + background_alpha: f32, + ); +} +extern "C" { + pub fn TCOD_console_blit_key_color( + src: *const TCOD_Console, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + dst: *mut TCOD_Console, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + foreground_alpha: f32, + background_alpha: f32, + key_color: *const TCOD_color_t, + ); +} +extern "C" { + #[doc = " Delete a console."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = ""] + #[doc = " If the console being deleted is the root console, then the display will be"] + #[doc = " uninitialized."] + pub fn TCOD_console_delete(console: *mut TCOD_Console); +} +extern "C" { + pub fn TCOD_console_set_default_background(con: *mut TCOD_Console, col: TCOD_color_t); +} +extern "C" { + pub fn TCOD_console_set_default_foreground(con: *mut TCOD_Console, col: TCOD_color_t); +} +extern "C" { + #[doc = " Clear a console to its default colors and the space character code."] + pub fn TCOD_console_clear(con: *mut TCOD_Console); +} +extern "C" { + #[doc = " Blend a background color onto a console tile."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param col The background color to blend."] + #[doc = " \\param flag The blend mode to use."] + pub fn TCOD_console_set_char_background( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Change the foreground color of a console tile."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param col The foreground color to set."] + pub fn TCOD_console_set_char_foreground( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); +} +extern "C" { + #[doc = " Change a character on a console tile, without changing its colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to set."] + pub fn TCOD_console_set_char( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + ); +} +extern "C" { + #[doc = " Draw a character on a console using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to place."] + #[doc = " \\param flag A TCOD_bkgnd_flag_t flag."] + pub fn TCOD_console_put_char( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a character on the console with the given colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\param c The character code to place."] + #[doc = " \\param fore The foreground color."] + #[doc = " \\param back The background color. This color will not be blended."] + pub fn TCOD_console_put_char_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + c: ::std::os::raw::c_int, + fore: TCOD_color_t, + back: TCOD_color_t, + ); +} +extern "C" { + #[doc = " Set a consoles default background flag."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param flag One of `TCOD_bkgnd_flag_t`."] + pub fn TCOD_console_set_background_flag(con: *mut TCOD_Console, flag: TCOD_bkgnd_flag_t); +} +extern "C" { + #[doc = " Return a consoles default background flag."] + pub fn TCOD_console_get_background_flag(con: *mut TCOD_Console) -> TCOD_bkgnd_flag_t; +} +extern "C" { + #[doc = " Set a consoles default alignment."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param alignment One of TCOD_alignment_t"] + pub fn TCOD_console_set_alignment(con: *mut TCOD_Console, alignment: TCOD_alignment_t); +} +extern "C" { + #[doc = " Return a consoles default alignment."] + pub fn TCOD_console_get_alignment(con: *mut TCOD_Console) -> TCOD_alignment_t; +} +extern "C" { + pub fn TCOD_console_get_default_background(con: *mut TCOD_Console) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_get_default_foreground(con: *mut TCOD_Console) -> TCOD_color_t; +} +extern "C" { + #[doc = " Return the background color of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return A TCOD_color_t struct with a copy of the background color."] + pub fn TCOD_console_get_char_background( + con: *const TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + #[doc = " Return the foreground color of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return A TCOD_color_t struct with a copy of the foreground color."] + pub fn TCOD_console_get_char_foreground( + con: *const TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + #[doc = " Return a character code of a console at x,y"] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The X coordinate, the left-most position being 0."] + #[doc = " \\param y The Y coordinate, the top-most position being 0."] + #[doc = " \\return The character code."] + pub fn TCOD_console_get_char( + con: *const TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Fade the color of the display."] + #[doc = ""] + #[doc = " \\param val Where at 255 colors are normal and at 0 colors are completely"] + #[doc = " faded."] + #[doc = " \\param fadecol Color to fade towards."] + pub fn TCOD_console_set_fade(val: u8, fade: TCOD_color_t); +} +extern "C" { + #[doc = " Return the fade value."] + #[doc = ""] + #[doc = " \\return At 255 colors are normal and at 0 colors are completely faded."] + pub fn TCOD_console_get_fade() -> u8; +} +extern "C" { + #[doc = " Return the fade color."] + #[doc = ""] + #[doc = " \\return The current fading color."] + pub fn TCOD_console_get_fading_color() -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_console_resize_( + console: *mut TCOD_Console, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_keycode_t { + TCODK_NONE = 0, + TCODK_ESCAPE = 1, + TCODK_BACKSPACE = 2, + TCODK_TAB = 3, + TCODK_ENTER = 4, + TCODK_SHIFT = 5, + TCODK_CONTROL = 6, + TCODK_ALT = 7, + TCODK_PAUSE = 8, + TCODK_CAPSLOCK = 9, + TCODK_PAGEUP = 10, + TCODK_PAGEDOWN = 11, + TCODK_END = 12, + TCODK_HOME = 13, + TCODK_UP = 14, + TCODK_LEFT = 15, + TCODK_RIGHT = 16, + TCODK_DOWN = 17, + TCODK_PRINTSCREEN = 18, + TCODK_INSERT = 19, + TCODK_DELETE = 20, + TCODK_LWIN = 21, + TCODK_RWIN = 22, + TCODK_APPS = 23, + TCODK_0 = 24, + TCODK_1 = 25, + TCODK_2 = 26, + TCODK_3 = 27, + TCODK_4 = 28, + TCODK_5 = 29, + TCODK_6 = 30, + TCODK_7 = 31, + TCODK_8 = 32, + TCODK_9 = 33, + TCODK_KP0 = 34, + TCODK_KP1 = 35, + TCODK_KP2 = 36, + TCODK_KP3 = 37, + TCODK_KP4 = 38, + TCODK_KP5 = 39, + TCODK_KP6 = 40, + TCODK_KP7 = 41, + TCODK_KP8 = 42, + TCODK_KP9 = 43, + TCODK_KPADD = 44, + TCODK_KPSUB = 45, + TCODK_KPDIV = 46, + TCODK_KPMUL = 47, + TCODK_KPDEC = 48, + TCODK_KPENTER = 49, + TCODK_F1 = 50, + TCODK_F2 = 51, + TCODK_F3 = 52, + TCODK_F4 = 53, + TCODK_F5 = 54, + TCODK_F6 = 55, + TCODK_F7 = 56, + TCODK_F8 = 57, + TCODK_F9 = 58, + TCODK_F10 = 59, + TCODK_F11 = 60, + TCODK_F12 = 61, + TCODK_NUMLOCK = 62, + TCODK_SCROLLLOCK = 63, + TCODK_SPACE = 64, + TCODK_CHAR = 65, + TCODK_TEXT = 66, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_key_t { + pub vk: TCOD_keycode_t, + pub c: ::std::os::raw::c_char, + pub text: [::std::os::raw::c_char; 32usize], + pub pressed: bool, + pub lalt: bool, + pub lctrl: bool, + pub lmeta: bool, + pub ralt: bool, + pub rctrl: bool, + pub rmeta: bool, + pub shift: bool, +} +#[test] +fn bindgen_test_layout_TCOD_key_t() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(TCOD_key_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_key_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vk as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(vk) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(c) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).text as *const _ as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(text) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pressed as *const _ as usize }, + 37usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lalt as *const _ as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lalt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lctrl as *const _ as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lctrl) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lmeta as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(lmeta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ralt as *const _ as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(ralt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rctrl as *const _ as usize }, + 42usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(rctrl) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rmeta as *const _ as usize }, + 43usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(rmeta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).shift as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(TCOD_key_t), + "::", + stringify!(shift) + ) + ); +} +impl Default for TCOD_key_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_chars_t { + TCOD_CHAR_HLINE = 196, + TCOD_CHAR_VLINE = 179, + TCOD_CHAR_NE = 191, + TCOD_CHAR_NW = 218, + TCOD_CHAR_SE = 217, + TCOD_CHAR_SW = 192, + TCOD_CHAR_TEEW = 180, + TCOD_CHAR_TEEE = 195, + TCOD_CHAR_TEEN = 193, + TCOD_CHAR_TEES = 194, + TCOD_CHAR_CROSS = 197, + TCOD_CHAR_DHLINE = 205, + TCOD_CHAR_DVLINE = 186, + TCOD_CHAR_DNE = 187, + TCOD_CHAR_DNW = 201, + TCOD_CHAR_DSE = 188, + TCOD_CHAR_DSW = 200, + TCOD_CHAR_DTEEW = 185, + TCOD_CHAR_DTEEE = 204, + TCOD_CHAR_DTEEN = 202, + TCOD_CHAR_DTEES = 203, + TCOD_CHAR_DCROSS = 206, + TCOD_CHAR_BLOCK1 = 176, + TCOD_CHAR_BLOCK2 = 177, + TCOD_CHAR_BLOCK3 = 178, + TCOD_CHAR_ARROW_N = 24, + TCOD_CHAR_ARROW_S = 25, + TCOD_CHAR_ARROW_E = 26, + TCOD_CHAR_ARROW_W = 27, + TCOD_CHAR_ARROW2_N = 30, + TCOD_CHAR_ARROW2_S = 31, + TCOD_CHAR_ARROW2_E = 16, + TCOD_CHAR_ARROW2_W = 17, + TCOD_CHAR_DARROW_H = 29, + TCOD_CHAR_DARROW_V = 18, + TCOD_CHAR_CHECKBOX_UNSET = 224, + TCOD_CHAR_CHECKBOX_SET = 225, + TCOD_CHAR_RADIO_UNSET = 9, + TCOD_CHAR_RADIO_SET = 10, + TCOD_CHAR_SUBP_NW = 226, + TCOD_CHAR_SUBP_NE = 227, + TCOD_CHAR_SUBP_N = 228, + TCOD_CHAR_SUBP_SE = 229, + TCOD_CHAR_SUBP_DIAG = 230, + TCOD_CHAR_SUBP_E = 231, + TCOD_CHAR_SUBP_SW = 232, + TCOD_CHAR_SMILIE = 1, + TCOD_CHAR_SMILIE_INV = 2, + TCOD_CHAR_HEART = 3, + TCOD_CHAR_DIAMOND = 4, + TCOD_CHAR_CLUB = 5, + TCOD_CHAR_SPADE = 6, + TCOD_CHAR_BULLET = 7, + TCOD_CHAR_BULLET_INV = 8, + TCOD_CHAR_MALE = 11, + TCOD_CHAR_FEMALE = 12, + TCOD_CHAR_NOTE = 13, + TCOD_CHAR_NOTE_DOUBLE = 14, + TCOD_CHAR_LIGHT = 15, + TCOD_CHAR_EXCLAM_DOUBLE = 19, + TCOD_CHAR_PILCROW = 20, + TCOD_CHAR_SECTION = 21, + TCOD_CHAR_POUND = 156, + TCOD_CHAR_MULTIPLICATION = 158, + TCOD_CHAR_FUNCTION = 159, + TCOD_CHAR_RESERVED = 169, + TCOD_CHAR_HALF = 171, + TCOD_CHAR_ONE_QUARTER = 172, + TCOD_CHAR_COPYRIGHT = 184, + TCOD_CHAR_CENT = 189, + TCOD_CHAR_YEN = 190, + TCOD_CHAR_CURRENCY = 207, + TCOD_CHAR_THREE_QUARTERS = 243, + TCOD_CHAR_DIVISION = 246, + TCOD_CHAR_GRADE = 248, + TCOD_CHAR_UMLAUT = 249, + TCOD_CHAR_POW1 = 251, + TCOD_CHAR_POW3 = 252, + TCOD_CHAR_POW2 = 253, + TCOD_CHAR_BULLET_SQUARE = 254, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_key_status_t { + TCOD_KEY_PRESSED = 1, + TCOD_KEY_RELEASED = 2, +} +impl TCOD_font_flags_t { + #[doc = " Tiles are arranged in column-major order."] + #[doc = ""] + #[doc = " 0 3 6"] + #[doc = " 1 4 7"] + #[doc = " 2 5 8"] + pub const TCOD_FONT_LAYOUT_ASCII_INCOL: TCOD_font_flags_t = TCOD_font_flags_t(1); +} +impl TCOD_font_flags_t { + #[doc = " Tiles are arranged in row-major order."] + #[doc = ""] + #[doc = " 0 1 2"] + #[doc = " 3 4 5"] + #[doc = " 6 7 8"] + pub const TCOD_FONT_LAYOUT_ASCII_INROW: TCOD_font_flags_t = TCOD_font_flags_t(2); +} +impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] + pub const TCOD_FONT_TYPE_GREYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); +} +impl TCOD_font_flags_t { + #[doc = " Converts all tiles into a monochrome gradient."] + pub const TCOD_FONT_TYPE_GRAYSCALE: TCOD_font_flags_t = TCOD_font_flags_t(4); +} +impl TCOD_font_flags_t { + #[doc = " A unique layout used by some of libtcod's fonts."] + pub const TCOD_FONT_LAYOUT_TCOD: TCOD_font_flags_t = TCOD_font_flags_t(8); +} +impl TCOD_font_flags_t { + #[doc = " Decode a code page 437 tileset into Unicode code-points."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.10"] + #[doc = " \\endrst"] + pub const TCOD_FONT_LAYOUT_CP437: TCOD_font_flags_t = TCOD_font_flags_t(16); +} +impl ::std::ops::BitOr for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for TCOD_font_flags_t { + #[inline] + fn bitor_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for TCOD_font_flags_t { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TCOD_font_flags_t(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for TCOD_font_flags_t { + #[inline] + fn bitand_assign(&mut self, rhs: TCOD_font_flags_t) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[doc = " These font flags can be OR'd together into a bit-field and passed to"] +#[doc = " TCOD_console_set_custom_font"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct TCOD_font_flags_t(pub u32); +#[repr(u32)] +#[doc = " The available renderers."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_renderer_t { + #[doc = " Alias for TCOD_RENDERER_OPENGL2."] + TCOD_RENDERER_GLSL = 0, + #[doc = " An OpenGL 1.1 implementation."] + #[doc = ""] + #[doc = " Performs worse than TCOD_RENDERER_GLSL without many benefits."] + TCOD_RENDERER_OPENGL = 1, + #[doc = " A software based renderer."] + #[doc = ""] + #[doc = " The font file is loaded into RAM instead of VRAM in this implementation."] + TCOD_RENDERER_SDL = 2, + #[doc = " A new SDL2 renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.8"] + #[doc = " \\endrst"] + TCOD_RENDERER_SDL2 = 3, + #[doc = " A new OpenGL 2.0 core renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.9"] + #[doc = ""] + #[doc = " .. versionchanged:: 1.11.0"] + #[doc = " This renderer now uses OpenGL 2.0 instead of 2.1."] + #[doc = " \\endrst"] + TCOD_RENDERER_OPENGL2 = 4, + #[doc = " A new OpenGL 2.0 core renderer. Allows the window to be resized."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.9"] + #[doc = ""] + #[doc = " .. versionchanged:: 1.11.0"] + #[doc = " This renderer now uses OpenGL 2.0 instead of 2.1."] + #[doc = " \\endrst"] + TCOD_NB_RENDERERS = 5, +} +extern "C" { + #[doc = " Draw a rectangle onto a console."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting region, the left-most position being 0."] + #[doc = " \\param y The starting region, the top-most position being 0."] + #[doc = " \\param rw The width of the rectangle."] + #[doc = " \\param rh The height of the rectangle."] + #[doc = " \\param clear If true the drawing region will be filled with spaces."] + #[doc = " \\param flag The blending flag to use."] + pub fn TCOD_console_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + clear: bool, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a horizontal line using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting X coordinate, the left-most position being 0."] + #[doc = " \\param y The starting Y coordinate, the top-most position being 0."] + #[doc = " \\param l The width of the line."] + #[doc = " \\param flag The blending flag."] + #[doc = ""] + #[doc = " This function makes assumptions about the fonts character encoding."] + #[doc = " It will fail if the font encoding is not `cp437`."] + pub fn TCOD_console_hline( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a vertical line using the default colors."] + #[doc = ""] + #[doc = " \\param con A console pointer."] + #[doc = " \\param x The starting X coordinate, the left-most position being 0."] + #[doc = " \\param y The starting Y coordinate, the top-most position being 0."] + #[doc = " \\param l The height of the line."] + #[doc = " \\param flag The blending flag."] + #[doc = ""] + #[doc = " This function makes assumptions about the fonts character encoding."] + #[doc = " It will fail if the font encoding is not `cp437`."] + pub fn TCOD_console_vline( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + l: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Place a single tile on a `console` at `x`,`y`."] + #[doc = ""] + #[doc = " If `ch` is 0 then the character code will not be updated."] + #[doc = ""] + #[doc = " If `fg`,`bg` is NULL then their respective colors will not be updated."] + pub fn TCOD_console_put_rgb( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ch: ::std::os::raw::c_int, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + #[doc = " Draw a rectangle on a `console` with a shape of `x`,`y`,`width`,`height`."] + #[doc = ""] + #[doc = " If `ch` is 0 then the character code will not be updated."] + #[doc = ""] + #[doc = " If `fg`,`bg` is NULL then their respective colors will not be updated."] + pub fn TCOD_console_draw_rect_rgb( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ch: ::std::os::raw::c_int, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + ); +} +#[doc = "Viewport options for the rendering context."] +#[doc = "\\rst"] +#[doc = ".. versionadded:: 1.16"] +#[doc = "\\endrst"] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_ViewportOptions { + #[doc = "If true then the aspect ratio will be kept square when the console is"] + #[doc = "scaled. The view will be letter-boxed."] + #[doc = ""] + #[doc = "If false the console will be stretched to fill the screen."] + #[doc = ""] + #[doc = "Set this is true if your tileset is deigned for square pixels."] + pub keep_aspect: bool, + #[doc = "If true then console scaling will be fixed to integer increments."] + #[doc = ""] + #[doc = "Has no effect if the console must be scaled down."] + pub integer_scaling: bool, + #[doc = "Not used."] + pub reserved_: bool, + #[doc = "The color to clear the screen with before rendering the console."] + pub clear_color: TCOD_ColorRGBA, + #[doc = "Alignment of the console when it is letter-boxed: 0.0f renders the"] + #[doc = "console in the upper-left corner, and 1.0f in the lower-right."] + #[doc = ""] + #[doc = "Values of 0.5f will center the console."] + #[doc = "Values outside of the range 0.0f to 1.0f are clamped."] + pub align_x: f32, + pub align_y: f32, +} +#[test] +fn bindgen_test_layout_TCOD_ViewportOptions() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_ViewportOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_ViewportOptions)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).keep_aspect as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(keep_aspect) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).integer_scaling as *const _ as usize + }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(integer_scaling) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved_ as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(reserved_) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).clear_color as *const _ as usize + }, + 3usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(clear_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).align_x as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(align_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).align_y as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ViewportOptions), + "::", + stringify!(align_y) + ) + ); +} +extern "C" { + pub static TCOD_VIEWPORT_DEFAULT_: TCOD_ViewportOptions; +} +extern "C" { + #[doc = "Allocate a new viewport options struct."] + #[doc = ""] + #[doc = "You should not allocate this struct manually since the size of it may change"] + #[doc = "between versions."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_viewport_new() -> *mut TCOD_ViewportOptions; +} +extern "C" { + #[doc = "Delete a viewport."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_viewport_delete(viewport: *mut TCOD_ViewportOptions); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Window { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Renderer { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Rect { + _unused: [u8; 0], +} +#[doc = " A rendering context for libtcod."] +#[doc = " \\rst"] +#[doc = " .. versionadded:: 1.16"] +#[doc = " \\endrst"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Context { + pub type_: ::std::os::raw::c_int, + pub contextdata: *mut ::std::os::raw::c_void, + pub destructor_: ::std::option::Option, + pub present_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error, + >, + pub pixel_to_tile_: ::std::option::Option< + unsafe extern "C" fn(self_: *mut TCOD_Context, x: *mut f64, y: *mut f64), + >, + pub save_screenshot_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + filename: *const ::std::os::raw::c_char, + ) -> TCOD_Error, + >, + pub get_sdl_window_: + ::std::option::Option *mut SDL_Window>, + pub get_sdl_renderer_: + ::std::option::Option *mut SDL_Renderer>, + pub accumulate_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error, + >, + #[doc = "Change the tileset used by this context."] + pub set_tileset: ::std::option::Option< + unsafe extern "C" fn(self_: *mut TCOD_Context, tileset: *mut TCOD_Tileset) -> TCOD_Error, + >, + #[doc = "Output the recommended console size to `columns` and `rows`."] + pub cb_recommended_console_size_: ::std::option::Option< + unsafe extern "C" fn( + self_: *mut TCOD_Context, + columns: *mut ::std::os::raw::c_int, + rows: *mut ::std::os::raw::c_int, + ) -> TCOD_Error, + >, +} +#[test] +fn bindgen_test_layout_TCOD_Context() { + assert_eq!( + ::std::mem::size_of::(), + 88usize, + concat!("Size of: ", stringify!(TCOD_Context)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Context)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).contextdata as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(contextdata) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).destructor_ as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(destructor_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).present_ as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(present_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pixel_to_tile_ as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(pixel_to_tile_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).save_screenshot_ as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(save_screenshot_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).get_sdl_window_ as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(get_sdl_window_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).get_sdl_renderer_ as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(get_sdl_renderer_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).accumulate_ as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(accumulate_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).set_tileset as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(set_tileset) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).cb_recommended_console_size_ as *const _ + as usize + }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Context), + "::", + stringify!(cb_recommended_console_size_) + ) + ); +} +impl Default for TCOD_Context { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + #[doc = " Delete a rendering context."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.16"] + #[doc = " \\endrst"] + pub fn TCOD_context_delete(renderer: *mut TCOD_Context); +} +extern "C" { + #[doc = " Create an uninitialized rendering context."] + #[doc = ""] + #[doc = " Used internally."] + pub fn TCOD_context_new_() -> *mut TCOD_Context; +} +extern "C" { + #[doc = "Present a console to the screen, using a rendering context."] + #[doc = ""] + #[doc = "`console` is the console to present, the console can be any size."] + #[doc = ""] + #[doc = "`viewport` is the optional viewport options to use."] + #[doc = "This will affect the scaling of the console with the current context."] + #[doc = "This can be NULL to use the default options, which are to stretch the"] + #[doc = "console to fit the screen."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_present( + context: *mut TCOD_Context, + console: *const TCOD_Console, + viewport: *const TCOD_ViewportOptions, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Convert the screen coordinates to tile coordinates for this context."] + #[doc = ""] + #[doc = "`x` and `y` are the pointers to the screen coordinates, these will be"] + #[doc = "converted to tile coordinates after the call to this function."] + #[doc = ""] + #[doc = "The parameters given to the last call to `TCOD_context_present` will"] + #[doc = "determine where the tiles are for this call."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_screen_pixel_to_tile_d( + context: *mut TCOD_Context, + x: *mut f64, + y: *mut f64, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Convert the screen coordinates to integer tile coordinates for this context."] + #[doc = ""] + #[doc = "Save as `TCOD_context_screen_pixel_to_tile` but the inputs and results are"] + #[doc = "integers. This is useful if you don't need sub-tile coordinates."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_screen_pixel_to_tile_i( + context: *mut TCOD_Context, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Save the last presented console to a PNG file."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_save_screenshot( + context: *mut TCOD_Context, + filename: *const ::std::os::raw::c_char, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return a pointer the SDL_Window for this context if it uses one."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_sdl_window(context: *mut TCOD_Context) -> *mut SDL_Window; +} +extern "C" { + #[doc = "Return a pointer the SDL_Renderer for this context if it uses one."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_sdl_renderer(context: *mut TCOD_Context) -> *mut SDL_Renderer; +} +extern "C" { + #[doc = "Change the active tileset for this context."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_change_tileset( + self_: *mut TCOD_Context, + tileset: *mut TCOD_Tileset, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return the `TCOD_renderer_t` renderer type for this context."] + #[doc = ""] + #[doc = "Returns a negative number on error, such as `context` being NULL."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_get_renderer_type(context: *mut TCOD_Context) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Set `columns` and `rows` to the recommended console size for this context."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_recommended_console_size( + context: *mut TCOD_Context, + columns: *mut ::std::os::raw::c_int, + rows: *mut ::std::os::raw::c_int, + ) -> TCOD_Error; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_mipmap_ { + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub fwidth: f32, + pub fheight: f32, + pub buf: *mut TCOD_ColorRGB, + pub dirty: bool, +} +#[test] +fn bindgen_test_layout_TCOD_mipmap_() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(TCOD_mipmap_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_mipmap_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fwidth as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(fwidth) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fheight as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(fheight) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dirty as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mipmap_), + "::", + stringify!(dirty) + ) + ); +} +impl Default for TCOD_mipmap_ { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Image { + pub nb_mipmaps: ::std::os::raw::c_int, + pub mipmaps: *mut TCOD_mipmap_, + pub key_color: TCOD_ColorRGB, + pub has_key_color: bool, +} +#[test] +fn bindgen_test_layout_TCOD_Image() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(TCOD_Image)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Image)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_mipmaps as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(nb_mipmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mipmaps as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(mipmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).key_color as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(key_color) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).has_key_color as *const _ as usize }, + 19usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Image), + "::", + stringify!(has_key_color) + ) + ); +} +impl Default for TCOD_Image { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_image_t = *mut TCOD_Image; +extern "C" { + pub fn TCOD_image_new( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> *mut TCOD_Image; +} +extern "C" { + #[doc = " Return a new image rendered from a console."] + #[doc = ""] + #[doc = " This effectively returns a screenshot of the console."] + pub fn TCOD_image_from_console(console: *const TCOD_Console) -> *mut TCOD_Image; +} +extern "C" { + #[doc = " Same as TCOD_image_from_console, but with an existing image."] + pub fn TCOD_image_refresh_console(image: *mut TCOD_Image, console: *const TCOD_Console); +} +extern "C" { + pub fn TCOD_image_load(filename: *const ::std::os::raw::c_char) -> *mut TCOD_Image; +} +extern "C" { + pub fn TCOD_image_clear(image: *mut TCOD_Image, color: TCOD_color_t); +} +extern "C" { + pub fn TCOD_image_invert(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_hflip(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_rotate90(image: *mut TCOD_Image, numRotations: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_image_vflip(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_scale( + image: *mut TCOD_Image, + neww: ::std::os::raw::c_int, + newh: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_save(image: *const TCOD_Image, filename: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_image_get_size( + image: *const TCOD_Image, + w: *mut ::std::os::raw::c_int, + h: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_get_pixel( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_image_get_alpha( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " Return a mipmapped pixel of image."] + #[doc = ""] + #[doc = " Mipmaps are updated when you call this, so it can't be called from multiple"] + #[doc = " threads."] + pub fn TCOD_image_get_mipmap_pixel( + image: *mut TCOD_Image, + x0: f32, + y0: f32, + x1: f32, + y1: f32, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_image_put_pixel( + image: *mut TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + col: TCOD_color_t, + ); +} +extern "C" { + pub fn TCOD_image_blit( + image: *mut TCOD_Image, + console: TCOD_console_t, + x: f32, + y: f32, + bkgnd_flag: TCOD_bkgnd_flag_t, + scalex: f32, + scaley: f32, + angle: f32, + ); +} +extern "C" { + pub fn TCOD_image_blit_rect( + image: *mut TCOD_Image, + console: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + bkgnd_flag: TCOD_bkgnd_flag_t, + ); +} +extern "C" { + pub fn TCOD_image_blit_2x( + image: *const TCOD_Image, + dest: TCOD_console_t, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + sx: ::std::os::raw::c_int, + sy: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_image_delete(image: *mut TCOD_Image); +} +extern "C" { + pub fn TCOD_image_set_key_color(image: *mut TCOD_Image, key_color: TCOD_color_t); +} +extern "C" { + pub fn TCOD_image_is_pixel_transparent( + image: *const TCOD_Image, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_List { + _unused: [u8; 0], +} +pub type TCOD_list_t = *mut TCOD_List; +extern "C" { + pub fn TCOD_list_new() -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_allocate(nb_elements: ::std::os::raw::c_int) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_duplicate(l: TCOD_list_t) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_list_delete(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_push(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_pop(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_peek(l: TCOD_list_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_add_all(l: TCOD_list_t, l2: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_get(l: TCOD_list_t, idx: ::std::os::raw::c_int) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_set( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + idx: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_list_begin(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_end(l: TCOD_list_t) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_reverse(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_remove_iterator( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_remove(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_remove_iterator_fast( + l: TCOD_list_t, + elt: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_remove_fast(l: TCOD_list_t, elt: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_list_contains(l: TCOD_list_t, elt: *const ::std::os::raw::c_void) -> bool; +} +extern "C" { + pub fn TCOD_list_clear(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_clear_and_delete(l: TCOD_list_t); +} +extern "C" { + pub fn TCOD_list_size(l: TCOD_list_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_list_insert_before( + l: TCOD_list_t, + elt: *const ::std::os::raw::c_void, + before: ::std::os::raw::c_int, + ) -> *mut *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_list_is_empty(l: TCOD_list_t) -> bool; +} +extern "C" { + pub fn TCOD_console_set_custom_font( + fontFile: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + nb_char_horiz: ::std::os::raw::c_int, + nb_char_vertic: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_map_ascii_code_to_font( + asciiCode: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_ascii_codes_to_font( + asciiCode: ::std::os::raw::c_int, + nbCodes: ::std::os::raw::c_int, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_string_to_font( + s: *const ::std::os::raw::c_char, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_map_string_to_font_utf( + s: *const wchar_t, + fontCharX: ::std::os::raw::c_int, + fontCharY: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_set_dirty( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ); +} +extern "C" { + #[doc = "Render and present a console with optional viewport options."] + #[doc = ""] + #[doc = "`console` is the console to render."] + #[doc = ""] + #[doc = "`viewport` is optional."] + #[doc = ""] + #[doc = "Returns a negative values on error. See `TCOD_get_error`."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_console_flush_ex( + console: *mut TCOD_Console, + viewport: *mut TCOD_ViewportOptions, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Render and present the root console to the active display."] + pub fn TCOD_console_flush() -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_check_for_keypress(flags: ::std::os::raw::c_int) -> TCOD_key_t; +} +extern "C" { + pub fn TCOD_console_wait_for_keypress(flush: bool) -> TCOD_key_t; +} +extern "C" { + pub fn TCOD_console_is_key_pressed(key: TCOD_keycode_t) -> bool; +} +extern "C" { + pub fn TCOD_console_from_file(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_load_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_load_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_asc( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_apf( + con: TCOD_console_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_credits(); +} +extern "C" { + pub fn TCOD_console_credits_reset(); +} +extern "C" { + pub fn TCOD_console_credits_render( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + alpha: bool, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_set_keyboard_repeat( + initial_delay: ::std::os::raw::c_int, + interval: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_console_disable_keyboard_repeat(); +} +extern "C" { + #[doc = " \\brief Initialize the libtcod graphical engine."] + #[doc = ""] + #[doc = " \\param w The width in tiles."] + #[doc = " \\param h The height in tiles."] + #[doc = " \\param title The title for the window."] + #[doc = " \\param fullscreen Fullscreen option."] + #[doc = " \\param renderer Which renderer to use when rendering the console."] + #[doc = ""] + #[doc = " You may want to call TCOD_console_set_custom_font BEFORE calling this"] + #[doc = " function. By default this function loads libtcod's `terminal.png` image"] + #[doc = " from the working directory."] + #[doc = ""] + #[doc = " Afterwards TCOD_quit must be called before the program exits."] + #[doc = ""] + #[doc = " Returns 0 on success, or -1 on an error, you can check the error with"] + #[doc = " TCOD_sys_get_error()"] + #[doc = ""] + #[doc = " `renderer` and vsync settings can be overridden by the `TCOD_RENDERER` or"] + #[doc = " `TCOD_VSYNC` environment variables."] + #[doc = ""] + #[doc = " Valid case-sensitive options for `TCOD_RENDERER` are:"] + #[doc = " - sdl"] + #[doc = " - opengl"] + #[doc = " - glsl"] + #[doc = " - sdl2"] + #[doc = " - opengl2"] + #[doc = ""] + #[doc = " Valid options for `TCOD_VSYNC` are `0` or `1`."] + #[doc = ""] + #[doc = " \\rst"] + #[doc = " .. versionchanged:: 1.12"] + #[doc = " Now returns -1 on error instead of crashing."] + #[doc = ""] + #[doc = " .. versionchanged:: 1.13"] + #[doc = " Added the `TCOD_RENDERER` and `TCOD_VSYNC` overrides."] + #[doc = " \\endrst"] + pub fn TCOD_console_init_root( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fullscreen: bool, + renderer: TCOD_renderer_t, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_init_root_( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fullscreen: bool, + renderer: TCOD_renderer_t, + vsync: bool, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Shutdown libtcod. This must be called before your program exits."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.8"] + #[doc = " \\endrst"] + pub fn TCOD_quit(); +} +extern "C" { + #[doc = " Change the title string of the active window."] + #[doc = ""] + #[doc = " \\param title A utf8 string."] + pub fn TCOD_console_set_window_title(title: *const ::std::os::raw::c_char); +} +extern "C" { + #[doc = " Set the display to be full-screen or windowed."] + #[doc = ""] + #[doc = " \\param fullscreen If true the display will go full-screen."] + pub fn TCOD_console_set_fullscreen(fullscreen: bool); +} +extern "C" { + #[doc = " Return true if the display is full-screen."] + pub fn TCOD_console_is_fullscreen() -> bool; +} +extern "C" { + #[doc = " Return true if the window has mouse focus."] + pub fn TCOD_console_has_mouse_focus() -> bool; +} +extern "C" { + #[doc = " Return true if the window has keyboard focus."] + #[doc = ""] + #[doc = " \\verbatim embed:rst:leading-asterisk"] + #[doc = " .. versionchanged: 1.7"] + #[doc = " This function was previously broken. It now keeps track of keyboard"] + #[doc = " focus."] + #[doc = " \\endverbatim"] + pub fn TCOD_console_is_active() -> bool; +} +extern "C" { + #[doc = " Return true if the window is closing."] + pub fn TCOD_console_is_window_closed() -> bool; +} +extern "C" { + #[doc = " Return an SDL_Window pointer if one is in use, returns NULL otherwise."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_get_sdl_window() -> *mut SDL_Window; +} +extern "C" { + #[doc = " Return an SDL_Renderer pointer if one is in use, returns NULL otherwise."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_get_sdl_renderer() -> *mut SDL_Renderer; +} +extern "C" { + #[doc = " Render a console over the display."] + #[doc = " \\rst"] + #[doc = " `console` can be any size, the active render will try to scale it to fit"] + #[doc = " the screen."] + #[doc = ""] + #[doc = " The function will only work for the SDL2/OPENGL2 renderers."] + #[doc = ""] + #[doc = " Unlike :any:`TCOD_console_flush` this will not present the display."] + #[doc = " You will need to do that manually, likely with the SDL API."] + #[doc = ""] + #[doc = " Returns 0 on success, or a negative number on a failure such as the"] + #[doc = " incorrect renderer being active."] + #[doc = ""] + #[doc = " .. versionadded:: 1.11"] + #[doc = ""] + #[doc = " .. seealso::"] + #[doc = " :any:`TCOD_sys_get_sdl_window` :any:`TCOD_sys_get_sdl_renderer`"] + #[doc = " \\endrst"] + pub fn TCOD_sys_accumulate_console(console: *const TCOD_Console) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_sys_accumulate_console_( + console: *const TCOD_Console, + viewport: *const SDL_Rect, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_rect_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_frame( + con: TCOD_console_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + empty: bool, + flag: TCOD_bkgnd_flag_t, + fmt: *const ::std::os::raw::c_char, + ... + ); +} +extern "C" { + pub fn TCOD_console_get_height_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_ex_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ); +} +extern "C" { + pub fn TCOD_console_print_rect_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_print_rect_ex_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_utf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +impl TCOD_colctrl_t { + pub const TCOD_COLCTRL_NUMBER: TCOD_colctrl_t = TCOD_colctrl_t::TCOD_COLCTRL_5; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_colctrl_t { + TCOD_COLCTRL_1 = 1, + TCOD_COLCTRL_2 = 2, + TCOD_COLCTRL_3 = 3, + TCOD_COLCTRL_4 = 4, + TCOD_COLCTRL_5 = 5, + TCOD_COLCTRL_FORE_RGB = 6, + TCOD_COLCTRL_BACK_RGB = 7, + TCOD_COLCTRL_STOP = 8, +} +extern "C" { + pub fn TCOD_console_set_color_control( + con: TCOD_colctrl_t, + fore: TCOD_color_t, + back: TCOD_color_t, + ); +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Format and print a UTF-8 string to a console."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_rect_ex( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Print a framed and optionally titled region to a console, using default"] + #[doc = "colors and alignment."] + #[doc = ""] + #[doc = "This function uses Unicode box-drawing characters and a UTF-8 formatted"] + #[doc = "string."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_printf_frame( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + empty: ::std::os::raw::c_int, + flag: TCOD_bkgnd_flag_t, + fmt: *const ::std::os::raw::c_char, + ... + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return the number of lines that would be printed by this formatted string."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.8"] + #[doc = ""] + #[doc = ".. versionchanged:: 1.16"] + #[doc = "Now returns a negative error code on failure."] + #[doc = "\\endrst"] + pub fn TCOD_console_get_height_rect_fmt( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_printn( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_printn_rect( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + alignment: TCOD_alignment_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_n( + console: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_get_height_rect_wn( + width: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + str: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_console_printn_frame( + con: *mut TCOD_Console, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + fg: *const TCOD_color_t, + bg: *const TCOD_color_t, + flag: TCOD_bkgnd_flag_t, + empty: bool, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_console_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_console_t; +} +extern "C" { + pub fn TCOD_console_load_xp( + con: *mut TCOD_Console, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_save_xp( + con: *const TCOD_Console, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_console_list_from_xp(filename: *const ::std::os::raw::c_char) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_console_list_save_xp( + console_list: TCOD_list_t, + filename: *const ::std::os::raw::c_char, + compress_level: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + #[doc = "Create a new context with the given console size."] + #[doc = ""] + #[doc = ""] + #[doc = "Same as `TCOD_context_new_window`, but the following parameters have"] + #[doc = "different effects:"] + #[doc = ""] + #[doc = "`columns` and `rows` is the desired size of the terminal window."] + #[doc = "The actual size of the window will be derived from this and the given"] + #[doc = "`tileset`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_new_terminal( + columns: ::std::os::raw::c_int, + rows: ::std::os::raw::c_int, + renderer_type: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + vsync: bool, + sdl_window_flags: ::std::os::raw::c_int, + window_title: *const ::std::os::raw::c_char, + out: *mut *mut TCOD_Context, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Create a new context with a window of the given size."] + #[doc = ""] + #[doc = "Same as `TCOD_context_new_terminal`, but the following parameters have"] + #[doc = "different effects:"] + #[doc = ""] + #[doc = "`pixel_width` and `pixel_height` are the desired size of the window in"] + #[doc = "pixels."] + #[doc = ""] + #[doc = "`renderer_type` is a `TCOD_renderer_t` type."] + #[doc = ""] + #[doc = "`tileset` is an optional pointer to a tileset object."] + #[doc = ""] + #[doc = "If `vsync` is True, then vertical sync will be enabled whenever possible."] + #[doc = "A value of true is recommended."] + #[doc = ""] + #[doc = "`sdl_window_flags` is a bitfield of SDL_WindowFlags flags."] + #[doc = "For a window, a value of ``SDL_WINDOW_RESIZABLE`` is recommended."] + #[doc = "For fullscreen, a value of"] + #[doc = "``SDL_WINDOW_RESIZABLE | SDL_WINDOW_FULLSCREEN_DESKTOP`` is recommended."] + #[doc = "You should avoid the ``SDL_WINDOW_FULLSCREEN`` flag whenever possible."] + #[doc = ""] + #[doc = "`window_title` is the title of the opened window."] + #[doc = ""] + #[doc = "`out` is the output for the `TCOD_Context`, must not be NULL."] + #[doc = ""] + #[doc = "Returns a negative error code on failure, `out` will unlikely be set in this"] + #[doc = "case."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_context_new_window( + pixel_width: ::std::os::raw::c_int, + pixel_height: ::std::os::raw::c_int, + renderer_type: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + vsync: bool, + sdl_window_flags: ::std::os::raw::c_int, + window_title: *const ::std::os::raw::c_char, + out: *mut *mut TCOD_Context, + ) -> TCOD_Error; +} +#[doc = " Private map cell struct."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_MapCell { + pub transparent: bool, + pub walkable: bool, + pub fov: bool, +} +#[test] +fn bindgen_test_layout_TCOD_MapCell() { + assert_eq!( + ::std::mem::size_of::(), + 3usize, + concat!("Size of: ", stringify!(TCOD_MapCell)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(TCOD_MapCell)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).transparent as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(transparent) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).walkable as *const _ as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(walkable) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fov as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(TCOD_MapCell), + "::", + stringify!(fov) + ) + ); +} +#[doc = " Private map struct."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Map { + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub nbcells: ::std::os::raw::c_int, + pub cells: *mut TCOD_MapCell, +} +#[test] +fn bindgen_test_layout_TCOD_Map() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(TCOD_Map)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Map)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nbcells as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(nbcells) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cells as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Map), + "::", + stringify!(cells) + ) + ); +} +impl Default for TCOD_Map { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_map_t = *mut TCOD_Map; +#[repr(u32)] +#[doc = " Field-of-view options."] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_fov_algorithm_t { + #[doc = " Basic: http://roguebasin.roguelikedevelopment.org/index.php?title=Ray_casting"] + FOV_BASIC = 0, + #[doc = " Diamond: http://www.geocities.com/temerra/los_rays.html"] + FOV_DIAMOND = 1, + #[doc = " Shadow casting: http://roguebasin.roguelikedevelopment.org/index.php?title=FOV_using_recursive_shadowcasting"] + FOV_SHADOW = 2, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_0 = 3, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_1 = 4, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_2 = 5, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_3 = 6, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_4 = 7, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_5 = 8, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_6 = 9, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_7 = 10, + #[doc = " Permissive: http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View"] + FOV_PERMISSIVE_8 = 11, + #[doc = " Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos)"] + FOV_RESTRICTIVE = 12, + #[doc = " Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos)"] + NB_FOV_ALGORITHMS = 13, +} +extern "C" { + pub fn TCOD_map_new( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> *mut TCOD_Map; +} +extern "C" { + pub fn TCOD_map_clear(map: *mut TCOD_Map, transparent: bool, walkable: bool); +} +extern "C" { + pub fn TCOD_map_copy(source: *const TCOD_Map, dest: *mut TCOD_Map); +} +extern "C" { + pub fn TCOD_map_set_properties( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + is_transparent: bool, + is_walkable: bool, + ); +} +extern "C" { + pub fn TCOD_map_delete(map: *mut TCOD_Map); +} +extern "C" { + pub fn TCOD_map_compute_fov( + map: *mut TCOD_Map, + player_x: ::std::os::raw::c_int, + player_y: ::std::os::raw::c_int, + max_radius: ::std::os::raw::c_int, + light_walls: bool, + algo: TCOD_fov_algorithm_t, + ); +} +extern "C" { + pub fn TCOD_map_is_in_fov( + map: *const TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_set_in_fov( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + fov: bool, + ); +} +extern "C" { + pub fn TCOD_map_is_transparent( + map: *const TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_is_walkable( + map: *mut TCOD_Map, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_map_get_width(map: *const TCOD_Map) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_map_get_height(map: *const TCOD_Map) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_map_get_nb_cells(map: *const TCOD_Map) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Return the default tileset, may be NULL."] + #[doc = ""] + #[doc = "A non-NULL return value is a new reference to the global tileset."] + #[doc = "When you are done you will need to call `TCOD_tileset_delete` on this"] + #[doc = "pointer."] + #[doc = ""] + #[doc = "This function is provisional, the API may change in the future."] + pub fn TCOD_get_default_tileset() -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Set the default tileset and update the default display to use it."] + #[doc = ""] + #[doc = "This will keep alive a reference to the given tileset. If you no longer"] + #[doc = "need the pointer then you should call `TCOD_tileset_delete` on it after"] + #[doc = "this function."] + #[doc = ""] + #[doc = "This function is provisional, the API may change in the future."] + pub fn TCOD_set_default_tileset(tileset: *mut TCOD_Tileset); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_noise_type_t { + TCOD_NOISE_PERLIN = 1, + TCOD_NOISE_SIMPLEX = 2, + TCOD_NOISE_WAVELET = 4, + TCOD_NOISE_DEFAULT = 0, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct TCOD_Noise { + pub ndim: ::std::os::raw::c_int, + #[doc = " Randomized map of indexes into buffer"] + pub map: [::std::os::raw::c_uchar; 256usize], + #[doc = " Random 256 x ndim buffer"] + pub buffer: [[f32; 4usize]; 256usize], + pub H: f32, + pub lacunarity: f32, + pub exponent: [f32; 128usize], + pub waveletTileData: *mut f32, + pub rand: TCOD_random_t, + pub noise_type: TCOD_noise_type_t, +} +#[test] +fn bindgen_test_layout_TCOD_Noise() { + assert_eq!( + ::std::mem::size_of::(), + 4904usize, + concat!("Size of: ", stringify!(TCOD_Noise)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Noise)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).map as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(map) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buffer as *const _ as usize }, + 260usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(buffer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).H as *const _ as usize }, + 4356usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(H) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lacunarity as *const _ as usize }, + 4360usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(lacunarity) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).exponent as *const _ as usize }, + 4364usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(exponent) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).waveletTileData as *const _ as usize }, + 4880usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(waveletTileData) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rand as *const _ as usize }, + 4888usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(rand) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).noise_type as *const _ as usize }, + 4896usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Noise), + "::", + stringify!(noise_type) + ) + ); +} +impl Default for TCOD_Noise { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_noise_t = *mut TCOD_Noise; +extern "C" { + pub fn TCOD_noise_new( + dimensions: ::std::os::raw::c_int, + hurst: f32, + lacunarity: f32, + random: TCOD_random_t, + ) -> TCOD_noise_t; +} +extern "C" { + pub fn TCOD_noise_set_type(noise: TCOD_noise_t, type_: TCOD_noise_type_t); +} +extern "C" { + pub fn TCOD_noise_get_ex(noise: TCOD_noise_t, f: *mut f32, type_: TCOD_noise_type_t) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_fbm_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_turbulence_ex( + noise: TCOD_noise_t, + f: *mut f32, + octaves: f32, + type_: TCOD_noise_type_t, + ) -> f32; +} +extern "C" { + pub fn TCOD_noise_get(noise: TCOD_noise_t, f: *mut f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_fbm(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_get_turbulence(noise: TCOD_noise_t, f: *mut f32, octaves: f32) -> f32; +} +extern "C" { + pub fn TCOD_noise_delete(noise: TCOD_noise_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_heightmap_t { + pub w: ::std::os::raw::c_int, + pub h: ::std::os::raw::c_int, + pub values: *mut f32, +} +#[test] +fn bindgen_test_layout_TCOD_heightmap_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_heightmap_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(w) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(h) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).values as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_heightmap_t), + "::", + stringify!(values) + ) + ); +} +impl Default for TCOD_heightmap_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_heightmap_new( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> *mut TCOD_heightmap_t; +} +extern "C" { + pub fn TCOD_heightmap_delete(hm: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_get_value( + hm: *const TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_get_interpolated_value( + hm: *const TCOD_heightmap_t, + x: f32, + y: f32, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_set_value( + hm: *mut TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + value: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_get_slope( + hm: *const TCOD_heightmap_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_heightmap_get_normal( + hm: *const TCOD_heightmap_t, + x: f32, + y: f32, + n: *mut f32, + waterLevel: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_count_cells( + hm: *const TCOD_heightmap_t, + min: f32, + max: f32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_heightmap_has_land_on_border(hm: *const TCOD_heightmap_t, waterLevel: f32) -> bool; +} +extern "C" { + pub fn TCOD_heightmap_get_minmax(hm: *const TCOD_heightmap_t, min: *mut f32, max: *mut f32); +} +extern "C" { + pub fn TCOD_heightmap_copy(hm_source: *const TCOD_heightmap_t, hm_dest: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_add(hm: *mut TCOD_heightmap_t, value: f32); +} +extern "C" { + pub fn TCOD_heightmap_scale(hm: *mut TCOD_heightmap_t, value: f32); +} +extern "C" { + pub fn TCOD_heightmap_clamp(hm: *mut TCOD_heightmap_t, min: f32, max: f32); +} +extern "C" { + pub fn TCOD_heightmap_normalize(hm: *mut TCOD_heightmap_t, min: f32, max: f32); +} +extern "C" { + pub fn TCOD_heightmap_clear(hm: *mut TCOD_heightmap_t); +} +extern "C" { + pub fn TCOD_heightmap_lerp_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + coef: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_multiply_hm( + hm1: *const TCOD_heightmap_t, + hm2: *const TCOD_heightmap_t, + hmres: *mut TCOD_heightmap_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_dig_hill( + hm: *mut TCOD_heightmap_t, + hx: f32, + hy: f32, + hradius: f32, + hheight: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_dig_bezier( + hm: *mut TCOD_heightmap_t, + px: *mut ::std::os::raw::c_int, + py: *mut ::std::os::raw::c_int, + startRadius: f32, + startDepth: f32, + endRadius: f32, + endDepth: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_rain_erosion( + hm: *mut TCOD_heightmap_t, + nbDrops: ::std::os::raw::c_int, + erosionCoef: f32, + sedimentationCoef: f32, + rnd: TCOD_random_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_kernel_transform( + hm: *mut TCOD_heightmap_t, + kernelsize: ::std::os::raw::c_int, + dx: *const ::std::os::raw::c_int, + dy: *const ::std::os::raw::c_int, + weight: *const f32, + minLevel: f32, + maxLevel: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_voronoi( + hm: *mut TCOD_heightmap_t, + nbPoints: ::std::os::raw::c_int, + nbCoef: ::std::os::raw::c_int, + coef: *const f32, + rnd: TCOD_random_t, + ); +} +extern "C" { + pub fn TCOD_heightmap_mid_point_displacement( + hm: *mut TCOD_heightmap_t, + rnd: TCOD_random_t, + roughness: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_add_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_scale_fbm( + hm: *mut TCOD_heightmap_t, + noise: TCOD_noise_t, + mulx: f32, + muly: f32, + addx: f32, + addy: f32, + octaves: f32, + delta: f32, + scale: f32, + ); +} +extern "C" { + pub fn TCOD_heightmap_islandify(hm: *mut TCOD_heightmap_t, seaLevel: f32, rnd: TCOD_random_t); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct TCOD_lex_t { + pub file_line: ::std::os::raw::c_int, + pub token_type: ::std::os::raw::c_int, + pub token_int_val: ::std::os::raw::c_int, + pub token_idx: ::std::os::raw::c_int, + pub token_float_val: f32, + pub tok: *mut ::std::os::raw::c_char, + pub toklen: ::std::os::raw::c_int, + pub lastStringDelim: ::std::os::raw::c_char, + pub pos: *mut ::std::os::raw::c_char, + pub buf: *mut ::std::os::raw::c_char, + pub filename: *mut ::std::os::raw::c_char, + pub last_javadoc_comment: *mut ::std::os::raw::c_char, + pub nb_symbols: ::std::os::raw::c_int, + pub nb_keywords: ::std::os::raw::c_int, + pub flags: ::std::os::raw::c_int, + pub symbols: [[::std::os::raw::c_char; 5usize]; 100usize], + pub keywords: [[::std::os::raw::c_char; 20usize]; 100usize], + pub simpleCmt: *const ::std::os::raw::c_char, + pub cmtStart: *const ::std::os::raw::c_char, + pub cmtStop: *const ::std::os::raw::c_char, + pub javadocCmtStart: *const ::std::os::raw::c_char, + pub stringDelim: *const ::std::os::raw::c_char, + pub javadoc_read: bool, + pub allocBuf: bool, + pub savept: bool, +} +#[test] +fn bindgen_test_layout_TCOD_lex_t() { + assert_eq!( + ::std::mem::size_of::(), + 2632usize, + concat!("Size of: ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_lex_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).file_line as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(file_line) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_type as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_type) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_int_val as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_int_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_idx as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_idx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).token_float_val as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(token_float_val) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tok as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(tok) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).toklen as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(toklen) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lastStringDelim as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(lastStringDelim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pos as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(pos) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).filename as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(filename) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_javadoc_comment as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(last_javadoc_comment) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_symbols as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_symbols) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nb_keywords as *const _ as usize }, + 76usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(nb_keywords) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).symbols as *const _ as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(symbols) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).keywords as *const _ as usize }, + 584usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(keywords) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).simpleCmt as *const _ as usize }, + 2584usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(simpleCmt) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStart as *const _ as usize }, + 2592usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cmtStop as *const _ as usize }, + 2600usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(cmtStop) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadocCmtStart as *const _ as usize }, + 2608usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadocCmtStart) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stringDelim as *const _ as usize }, + 2616usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(stringDelim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).javadoc_read as *const _ as usize }, + 2624usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(javadoc_read) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).allocBuf as *const _ as usize }, + 2625usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(allocBuf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).savept as *const _ as usize }, + 2626usize, + concat!( + "Offset of field: ", + stringify!(TCOD_lex_t), + "::", + stringify!(savept) + ) + ); +} +impl Default for TCOD_lex_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_lex_new_intern() -> *mut TCOD_lex_t; +} +extern "C" { + pub fn TCOD_lex_new( + symbols: *mut *const ::std::os::raw::c_char, + keywords: *mut *const ::std::os::raw::c_char, + simpleComment: *const ::std::os::raw::c_char, + commentStart: *const ::std::os::raw::c_char, + commentStop: *const ::std::os::raw::c_char, + javadocCommentStart: *const ::std::os::raw::c_char, + stringDelim: *const ::std::os::raw::c_char, + flags: ::std::os::raw::c_int, + ) -> *mut TCOD_lex_t; +} +extern "C" { + pub fn TCOD_lex_delete(lex: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_set_data_buffer(lex: *mut TCOD_lex_t, dat: *mut ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_lex_set_data_file( + lex: *mut TCOD_lex_t, + filename: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_parse(lex: *mut TCOD_lex_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_parse_until_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_parse_until_token_value( + lex: *mut TCOD_lex_t, + token_value: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_lex_expect_token_type( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_expect_token_value( + lex: *mut TCOD_lex_t, + token_type: ::std::os::raw::c_int, + token_value: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_lex_savepoint(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_restore(lex: *mut TCOD_lex_t, savept: *mut TCOD_lex_t); +} +extern "C" { + pub fn TCOD_lex_get_last_javadoc(lex: *mut TCOD_lex_t) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_get_token_name( + token_type: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_get_last_error() -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_lex_hextoint(c: ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_instance() -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_new(algo: TCOD_random_algo_t) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_save(mersenne: TCOD_random_t) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_restore(mersenne: TCOD_random_t, backup: TCOD_random_t); +} +extern "C" { + pub fn TCOD_random_new_from_seed(algo: TCOD_random_algo_t, seed: u32) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_random_delete(mersenne: TCOD_random_t); +} +extern "C" { + pub fn TCOD_random_set_distribution(mersenne: TCOD_random_t, distribution: TCOD_distribution_t); +} +extern "C" { + pub fn TCOD_random_get_int( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_float(mersenne: TCOD_random_t, min: f32, max: f32) -> f32; +} +extern "C" { + pub fn TCOD_random_get_double(mersenne: TCOD_random_t, min: f64, max: f64) -> f64; +} +extern "C" { + pub fn TCOD_random_get_int_mean( + mersenne: TCOD_random_t, + min: ::std::os::raw::c_int, + max: ::std::os::raw::c_int, + mean: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_get_float_mean( + mersenne: TCOD_random_t, + min: f32, + max: f32, + mean: f32, + ) -> f32; +} +extern "C" { + pub fn TCOD_random_get_double_mean( + mersenne: TCOD_random_t, + min: f64, + max: f64, + mean: f64, + ) -> f64; +} +extern "C" { + pub fn TCOD_random_dice_new(s: *const ::std::os::raw::c_char) -> TCOD_dice_t; +} +extern "C" { + pub fn TCOD_random_dice_roll( + mersenne: TCOD_random_t, + dice: TCOD_dice_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_random_dice_roll_s( + mersenne: TCOD_random_t, + s: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_mouse_t { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub dx: ::std::os::raw::c_int, + pub dy: ::std::os::raw::c_int, + pub cx: ::std::os::raw::c_int, + pub cy: ::std::os::raw::c_int, + pub dcx: ::std::os::raw::c_int, + pub dcy: ::std::os::raw::c_int, + pub lbutton: bool, + pub rbutton: bool, + pub mbutton: bool, + pub lbutton_pressed: bool, + pub rbutton_pressed: bool, + pub mbutton_pressed: bool, + pub wheel_up: bool, + pub wheel_down: bool, +} +#[test] +fn bindgen_test_layout_TCOD_mouse_t() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_mouse_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_mouse_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dx as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dy as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cx as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cy as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(cy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcx as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dcy as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(dcy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton as *const _ as usize }, + 33usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton as *const _ as usize }, + 34usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(mbutton) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lbutton_pressed as *const _ as usize }, + 35usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(lbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rbutton_pressed as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(rbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mbutton_pressed as *const _ as usize }, + 37usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(mbutton_pressed) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wheel_up as *const _ as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(wheel_up) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).wheel_down as *const _ as usize }, + 39usize, + concat!( + "Offset of field: ", + stringify!(TCOD_mouse_t), + "::", + stringify!(wheel_down) + ) + ); +} +extern "C" { + pub fn TCOD_mouse_show_cursor(visible: bool); +} +extern "C" { + pub fn TCOD_mouse_get_status() -> TCOD_mouse_t; +} +extern "C" { + pub fn TCOD_mouse_is_cursor_visible() -> bool; +} +extern "C" { + pub fn TCOD_mouse_move(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_mouse_includes_touch(enable: bool); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_NameGen { + _unused: [u8; 0], +} +pub type TCOD_namegen_t = *mut TCOD_NameGen; +extern "C" { + pub fn TCOD_namegen_parse(filename: *const ::std::os::raw::c_char, random: TCOD_random_t); +} +extern "C" { + pub fn TCOD_namegen_generate( + name: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_namegen_generate_custom( + name: *mut ::std::os::raw::c_char, + rule: *mut ::std::os::raw::c_char, + allocate: bool, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_namegen_get_sets() -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_namegen_destroy(); +} +pub type TCOD_path_func_t = ::std::option::Option< + unsafe extern "C" fn( + xFrom: ::std::os::raw::c_int, + yFrom: ::std::os::raw::c_int, + xTo: ::std::os::raw::c_int, + yTo: ::std::os::raw::c_int, + user_data: *mut ::std::os::raw::c_void, + ) -> f32, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Path { + _unused: [u8; 0], +} +pub type TCOD_path_t = *mut TCOD_Path; +extern "C" { + pub fn TCOD_path_new_using_map(map: TCOD_map_t, diagonalCost: f32) -> TCOD_path_t; +} +extern "C" { + pub fn TCOD_path_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_path_t; +} +extern "C" { + pub fn TCOD_path_compute( + path: TCOD_path_t, + ox: ::std::os::raw::c_int, + oy: ::std::os::raw::c_int, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_path_walk( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + recalculate_when_needed: bool, + ) -> bool; +} +extern "C" { + pub fn TCOD_path_is_empty(path: TCOD_path_t) -> bool; +} +extern "C" { + pub fn TCOD_path_size(path: TCOD_path_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_path_reverse(path: TCOD_path_t); +} +extern "C" { + pub fn TCOD_path_get( + path: TCOD_path_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_get_origin( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_get_destination( + path: TCOD_path_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_path_delete(path: TCOD_path_t); +} +#[doc = " Dijkstra data structure"] +#[doc = ""] +#[doc = " All attributes are considered private."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Dijkstra { + pub diagonal_cost: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub nodes_max: ::std::os::raw::c_int, + pub map: TCOD_map_t, + pub func: TCOD_path_func_t, + pub user_data: *mut ::std::os::raw::c_void, + pub distances: *mut ::std::os::raw::c_uint, + pub nodes: *mut ::std::os::raw::c_uint, + pub path: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_Dijkstra() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(TCOD_Dijkstra)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Dijkstra)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).diagonal_cost as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(diagonal_cost) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nodes_max as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(nodes_max) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).map as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(map) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).func as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(func) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).user_data as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(user_data) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).distances as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(distances) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).nodes as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(nodes) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).path as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Dijkstra), + "::", + stringify!(path) + ) + ); +} +impl Default for TCOD_Dijkstra { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_dijkstra_t = *mut TCOD_Dijkstra; +extern "C" { + pub fn TCOD_dijkstra_new(map: TCOD_map_t, diagonalCost: f32) -> TCOD_dijkstra_t; +} +extern "C" { + pub fn TCOD_dijkstra_new_using_function( + map_width: ::std::os::raw::c_int, + map_height: ::std::os::raw::c_int, + func: TCOD_path_func_t, + user_data: *mut ::std::os::raw::c_void, + diagonalCost: f32, + ) -> TCOD_dijkstra_t; +} +extern "C" { + pub fn TCOD_dijkstra_compute( + dijkstra: TCOD_dijkstra_t, + root_x: ::std::os::raw::c_int, + root_y: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_dijkstra_get_distance( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> f32; +} +extern "C" { + pub fn TCOD_dijkstra_path_set( + dijkstra: TCOD_dijkstra_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_is_empty(path: TCOD_dijkstra_t) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_size(path: TCOD_dijkstra_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_dijkstra_reverse(path: TCOD_dijkstra_t); +} +extern "C" { + pub fn TCOD_dijkstra_get( + path: TCOD_dijkstra_t, + index: ::std::os::raw::c_int, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_dijkstra_path_walk( + dijkstra: TCOD_dijkstra_t, + x: *mut ::std::os::raw::c_int, + y: *mut ::std::os::raw::c_int, + ) -> bool; +} +extern "C" { + pub fn TCOD_dijkstra_delete(dijkstra: TCOD_dijkstra_t); +} +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Default, Copy, Clone)] +pub struct max_align_t { + pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, + pub __bindgen_padding_0: u64, + pub __clang_max_align_nonce2: u128, +} +#[test] +fn bindgen_test_layout_max_align_t() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(max_align_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 16usize, + concat!("Alignment of ", stringify!(max_align_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).__clang_max_align_nonce1 as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(max_align_t), + "::", + stringify!(__clang_max_align_nonce1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).__clang_max_align_nonce2 as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(max_align_t), + "::", + stringify!(__clang_max_align_nonce2) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default)] +pub struct TCOD_HeapNode { + pub priority: ::std::os::raw::c_int, + pub data: __IncompleteArrayField<::std::os::raw::c_uchar>, +} +#[test] +fn bindgen_test_layout_TCOD_HeapNode() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(TCOD_HeapNode)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(TCOD_HeapNode)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).priority as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_HeapNode), + "::", + stringify!(priority) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_HeapNode), + "::", + stringify!(data) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Heap { + pub heap: *mut TCOD_HeapNode, + pub size: ::std::os::raw::c_int, + pub capacity: ::std::os::raw::c_int, + pub node_size: size_t, + pub data_size: size_t, +} +#[test] +fn bindgen_test_layout_TCOD_Heap() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(TCOD_Heap)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Heap)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(heap) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).capacity as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(capacity) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).node_size as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(node_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data_size as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Heap), + "::", + stringify!(data_size) + ) + ); +} +impl Default for TCOD_Heap { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_heap_init(heap: *mut TCOD_Heap, data_size: size_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_heap_uninit(heap: *mut TCOD_Heap); +} +extern "C" { + pub fn TCOD_heap_clear(heap: *mut TCOD_Heap); +} +extern "C" { + pub fn TCOD_minheap_push( + minheap: *mut TCOD_Heap, + priority: ::std::os::raw::c_int, + data: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_minheap_pop(minheap: *mut TCOD_Heap, out: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn TCOD_minheap_heapify(minheap: *mut TCOD_Heap); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_ArrayData { + pub ndim: i8, + pub int_type: ::std::os::raw::c_int, + pub shape: [size_t; 5usize], + pub strides: [size_t; 5usize], + pub data: *mut ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_TCOD_ArrayData() { + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(TCOD_ArrayData)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_ArrayData)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).int_type as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(int_type) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).shape as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(shape) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).strides as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(strides) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ArrayData), + "::", + stringify!(data) + ) + ); +} +impl Default for TCOD_ArrayData { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_BasicGraph2D { + pub cost: TCOD_ArrayData, + pub cardinal: ::std::os::raw::c_int, + pub diagonal: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_BasicGraph2D() { + assert_eq!( + ::std::mem::size_of::(), + 104usize, + concat!("Size of: ", stringify!(TCOD_BasicGraph2D)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_BasicGraph2D)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cost as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_BasicGraph2D), + "::", + stringify!(cost) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cardinal as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(TCOD_BasicGraph2D), + "::", + stringify!(cardinal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).diagonal as *const _ as usize }, + 100usize, + concat!( + "Offset of field: ", + stringify!(TCOD_BasicGraph2D), + "::", + stringify!(diagonal) + ) + ); +} +impl Default for TCOD_BasicGraph2D { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Pathfinder { + pub ndim: i8, + pub shape: [size_t; 4usize], + pub owns_distance: bool, + pub owns_graph: bool, + pub owns_traversal: bool, + pub distance: TCOD_ArrayData, + pub graph: TCOD_BasicGraph2D, + pub traversal: TCOD_ArrayData, + pub heap: TCOD_Heap, +} +#[test] +fn bindgen_test_layout_TCOD_Pathfinder() { + assert_eq!( + ::std::mem::size_of::(), + 376usize, + concat!("Size of: ", stringify!(TCOD_Pathfinder)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Pathfinder)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).shape as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(shape) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).owns_distance as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(owns_distance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).owns_graph as *const _ as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(owns_graph) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).owns_traversal as *const _ as usize }, + 42usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(owns_traversal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).distance as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(distance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).graph as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(graph) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).traversal as *const _ as usize }, + 248usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(traversal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 344usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Pathfinder), + "::", + stringify!(heap) + ) + ); +} +impl Default for TCOD_Pathfinder { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_pf_new(ndim: ::std::os::raw::c_int, shape: *const size_t) -> *mut TCOD_Pathfinder; +} +extern "C" { + pub fn TCOD_pf_delete(path: *mut TCOD_Pathfinder); +} +extern "C" { + pub fn TCOD_pf_set_distance_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + ); +} +extern "C" { + pub fn TCOD_pf_set_graph2d_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + cardinal: ::std::os::raw::c_int, + diagonal: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_pf_set_traversal_pointer( + path: *mut TCOD_Pathfinder, + data: *mut ::std::os::raw::c_void, + int_type: ::std::os::raw::c_int, + strides: *const size_t, + ); +} +extern "C" { + pub fn TCOD_pf_recompile(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_pf_compute(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_pf_compute_step(path: *mut TCOD_Pathfinder) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Frontier { + pub ndim: i8, + pub active_dist: ::std::os::raw::c_int, + pub active_index: [::std::os::raw::c_int; 4usize], + pub heap: TCOD_Heap, +} +#[test] +fn bindgen_test_layout_TCOD_Frontier() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(TCOD_Frontier)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Frontier)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ndim as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(ndim) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).active_dist as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(active_dist) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).active_index as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(active_index) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).heap as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Frontier), + "::", + stringify!(heap) + ) + ); +} +impl Default for TCOD_Frontier { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + #[doc = "Create a new pathfinder frontier."] + #[doc = ""] + #[doc = "`ndim` is the number of dimensions. Must be in the range `1 <= n <= 4`."] + pub fn TCOD_frontier_new(ndim: ::std::os::raw::c_int) -> *mut TCOD_Frontier; +} +extern "C" { + #[doc = "Delete a pathfinder frontier."] + pub fn TCOD_frontier_delete(frontier: *mut TCOD_Frontier); +} +extern "C" { + #[doc = "Pop the next node from this frontier."] + #[doc = ""] + #[doc = "The popped node variables will placed in the `active_dist` and"] + #[doc = "`active_index` attributes."] + pub fn TCOD_frontier_pop(frontier: *mut TCOD_Frontier) -> TCOD_Error; +} +extern "C" { + #[doc = "Add a node to this frontier."] + #[doc = ""] + #[doc = "`index[frontier->ndim]` is the position of the node to add to the frontier."] + #[doc = ""] + #[doc = "`dist` is the total distance of the node. This should be a low number"] + #[doc = "like 0, but can also be a negative number such as `INT_MIN`."] + #[doc = "When adding a node as an edge then `dist` is `frontier->active_dist` plus"] + #[doc = "the cost of the edge."] + #[doc = ""] + #[doc = "`heuristic` is the true priority of the node, used to affect node order."] + #[doc = "For Dijkstra-like algorithms this should be the same as `dist`."] + #[doc = "For A* this should be `dist` plus the maximum possible distance to the"] + #[doc = "goal."] + pub fn TCOD_frontier_push( + frontier: *mut TCOD_Frontier, + index: *const ::std::os::raw::c_int, + dist: ::std::os::raw::c_int, + heuristic: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +extern "C" { + #[doc = "Return the current number of nodes in this frontier."] + pub fn TCOD_frontier_size(frontier: *const TCOD_Frontier) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = "Remove all nodes from this frontier."] + pub fn TCOD_frontier_clear(frontier: *mut TCOD_Frontier) -> TCOD_Error; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_value_type_t { + TCOD_TYPE_NONE = 0, + TCOD_TYPE_BOOL = 1, + TCOD_TYPE_CHAR = 2, + TCOD_TYPE_INT = 3, + TCOD_TYPE_FLOAT = 4, + TCOD_TYPE_STRING = 5, + TCOD_TYPE_COLOR = 6, + TCOD_TYPE_DICE = 7, + TCOD_TYPE_VALUELIST00 = 8, + TCOD_TYPE_VALUELIST01 = 9, + TCOD_TYPE_VALUELIST02 = 10, + TCOD_TYPE_VALUELIST03 = 11, + TCOD_TYPE_VALUELIST04 = 12, + TCOD_TYPE_VALUELIST05 = 13, + TCOD_TYPE_VALUELIST06 = 14, + TCOD_TYPE_VALUELIST07 = 15, + TCOD_TYPE_VALUELIST08 = 16, + TCOD_TYPE_VALUELIST09 = 17, + TCOD_TYPE_VALUELIST10 = 18, + TCOD_TYPE_VALUELIST11 = 19, + TCOD_TYPE_VALUELIST12 = 20, + TCOD_TYPE_VALUELIST13 = 21, + TCOD_TYPE_VALUELIST14 = 22, + TCOD_TYPE_VALUELIST15 = 23, + TCOD_TYPE_CUSTOM00 = 24, + TCOD_TYPE_CUSTOM01 = 25, + TCOD_TYPE_CUSTOM02 = 26, + TCOD_TYPE_CUSTOM03 = 27, + TCOD_TYPE_CUSTOM04 = 28, + TCOD_TYPE_CUSTOM05 = 29, + TCOD_TYPE_CUSTOM06 = 30, + TCOD_TYPE_CUSTOM07 = 31, + TCOD_TYPE_CUSTOM08 = 32, + TCOD_TYPE_CUSTOM09 = 33, + TCOD_TYPE_CUSTOM10 = 34, + TCOD_TYPE_CUSTOM11 = 35, + TCOD_TYPE_CUSTOM12 = 36, + TCOD_TYPE_CUSTOM13 = 37, + TCOD_TYPE_CUSTOM14 = 38, + TCOD_TYPE_CUSTOM15 = 39, + TCOD_TYPE_LIST = 1024, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union TCOD_value_t { + pub b: bool, + pub c: ::std::os::raw::c_char, + pub i: i32, + pub f: f32, + pub s: *mut ::std::os::raw::c_char, + pub col: TCOD_color_t, + pub dice: TCOD_dice_t, + pub list: TCOD_list_t, + pub custom: *mut ::std::os::raw::c_void, + _bindgen_union_align: [u64; 2usize], +} +#[test] +fn bindgen_test_layout_TCOD_value_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(TCOD_value_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_value_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(b) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(c) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).i as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(i) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).f as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(f) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).s as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(s) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).col as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(col) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).dice as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(dice) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).list as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(list) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).custom as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_value_t), + "::", + stringify!(custom) + ) + ); +} +impl Default for TCOD_value_t { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_parser_struct_t = *mut TCOD_ParserStruct; +extern "C" { + pub fn TCOD_struct_get_name(def: TCOD_parser_struct_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_struct_add_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_list_property( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_value_list_sized( + def: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + value_list: *mut *const ::std::os::raw::c_char, + size: ::std::os::raw::c_int, + mandatory: bool, + ); +} +extern "C" { + pub fn TCOD_struct_add_flag(def: TCOD_parser_struct_t, propname: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_struct_add_structure( + def: TCOD_parser_struct_t, + sub_structure: TCOD_parser_struct_t, + ); +} +extern "C" { + pub fn TCOD_struct_is_mandatory( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_struct_get_type( + def: TCOD_parser_struct_t, + propname: *const ::std::os::raw::c_char, + ) -> TCOD_value_type_t; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TCOD_parser_listener_t { + pub new_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub new_flag: + ::std::option::Option bool>, + pub new_property: ::std::option::Option< + unsafe extern "C" fn( + propname: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + value: TCOD_value_t, + ) -> bool, + >, + pub end_struct: ::std::option::Option< + unsafe extern "C" fn( + str: TCOD_parser_struct_t, + name: *const ::std::os::raw::c_char, + ) -> bool, + >, + pub error: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_TCOD_parser_listener_t() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_parser_listener_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_parser_listener_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).new_struct as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_struct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).new_flag as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_flag) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).new_property as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(new_property) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).end_struct as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(end_struct) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).error as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_parser_listener_t), + "::", + stringify!(error) + ) + ); +} +pub type TCOD_parser_custom_t = ::std::option::Option< + unsafe extern "C" fn( + lex: *mut TCOD_lex_t, + listener: *mut TCOD_parser_listener_t, + str: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + ) -> TCOD_value_t, +>; +pub type TCOD_parser_t = *mut TCOD_Parser; +extern "C" { + pub fn TCOD_parser_new() -> TCOD_parser_t; +} +extern "C" { + pub fn TCOD_parser_new_struct( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_parser_struct_t; +} +extern "C" { + pub fn TCOD_parser_new_custom_type( + parser: TCOD_parser_t, + custom_type_parser: TCOD_parser_custom_t, + ) -> TCOD_value_type_t; +} +extern "C" { + pub fn TCOD_parser_run( + parser: TCOD_parser_t, + filename: *const ::std::os::raw::c_char, + listener: *mut TCOD_parser_listener_t, + ); +} +extern "C" { + pub fn TCOD_parser_delete(parser: TCOD_parser_t); +} +extern "C" { + pub fn TCOD_parser_error(msg: *const ::std::os::raw::c_char, ...); +} +extern "C" { + pub fn TCOD_parser_has_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_parser_get_bool_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> bool; +} +extern "C" { + pub fn TCOD_parser_get_char_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_parser_get_int_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_parser_get_float_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> f32; +} +extern "C" { + pub fn TCOD_parser_get_string_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_parser_get_color_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_parser_get_dice_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> TCOD_dice_t; +} +extern "C" { + pub fn TCOD_parser_get_dice_property_py( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + dice: *mut TCOD_dice_t, + ); +} +extern "C" { + pub fn TCOD_parser_get_custom_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_parser_get_list_property( + parser: TCOD_parser_t, + name: *const ::std::os::raw::c_char, + type_: TCOD_value_type_t, + ) -> TCOD_list_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_ParserStruct { + pub name: *mut ::std::os::raw::c_char, + pub flags: TCOD_list_t, + pub props: TCOD_list_t, + pub lists: TCOD_list_t, + pub structs: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_ParserStruct() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_ParserStruct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_ParserStruct)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(props) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lists as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(lists) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_ParserStruct), + "::", + stringify!(structs) + ) + ); +} +impl Default for TCOD_ParserStruct { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_struct_int_t = TCOD_ParserStruct; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Parser { + pub structs: TCOD_list_t, + pub customs: [TCOD_parser_custom_t; 16usize], + pub fatal: bool, + pub props: TCOD_list_t, +} +#[test] +fn bindgen_test_layout_TCOD_Parser() { + assert_eq!( + ::std::mem::size_of::(), + 152usize, + concat!("Size of: ", stringify!(TCOD_Parser)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_Parser)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).structs as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(structs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).customs as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(customs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).fatal as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(fatal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).props as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(TCOD_Parser), + "::", + stringify!(props) + ) + ); +} +impl Default for TCOD_Parser { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type TCOD_parser_int_t = TCOD_Parser; +extern "C" { + pub fn TCOD_parse_bool_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_char_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_integer_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_float_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_string_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_color_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_dice_value() -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_value_list_value( + def: *mut TCOD_struct_int_t, + listnum: ::std::os::raw::c_int, + ) -> TCOD_value_t; +} +extern "C" { + pub fn TCOD_parse_property_value( + parser: *mut TCOD_parser_int_t, + def: TCOD_parser_struct_t, + propname: *mut ::std::os::raw::c_char, + list: bool, + ) -> TCOD_value_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetAtlasOpenGL { + pub tileset: *mut TCOD_Tileset, + pub observer: *mut TCOD_TilesetObserver, + pub texture: u32, + pub texture_size: ::std::os::raw::c_int, + pub texture_columns: ::std::os::raw::c_int, + pub texture_rows: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_TilesetAtlasOpenGL() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(TCOD_TilesetAtlasOpenGL)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_TilesetAtlasOpenGL)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(tileset) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).observer as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(observer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_size as *const _ as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_size) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_columns as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_columns) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_rows as *const _ as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasOpenGL), + "::", + stringify!(texture_rows) + ) + ); +} +impl Default for TCOD_TilesetAtlasOpenGL { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGLCommon { + pub window: *mut SDL_Window, + pub glcontext: *mut ::std::os::raw::c_void, + pub atlas: *mut TCOD_TilesetAtlasOpenGL, + pub sdl_subsystems: u32, + pub last_offset_x: f64, + pub last_offset_y: f64, + pub last_scale_x: f64, + pub last_scale_y: f64, +} +#[test] +fn bindgen_test_layout_TCOD_RendererGLCommon() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(TCOD_RendererGLCommon)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererGLCommon)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(window) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).glcontext as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(glcontext) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).atlas as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(atlas) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).sdl_subsystems as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(sdl_subsystems) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).last_offset_x as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(last_offset_x) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).last_offset_y as *const _ as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(last_offset_y) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).last_scale_x as *const _ as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(last_scale_x) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).last_scale_y as *const _ as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGLCommon), + "::", + stringify!(last_scale_y) + ) + ); +} +impl Default for TCOD_RendererGLCommon { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_gl_atlas_new(tileset: *mut TCOD_Tileset) -> *mut TCOD_TilesetAtlasOpenGL; +} +extern "C" { + pub fn TCOD_gl_atlas_delete(atlas: *mut TCOD_TilesetAtlasOpenGL); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGL1 { + pub common: TCOD_RendererGLCommon, + pub background_texture: u32, + pub background_width: ::std::os::raw::c_int, + pub background_height: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_RendererGL1() { + assert_eq!( + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(TCOD_RendererGL1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererGL1)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).common as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL1), + "::", + stringify!(common) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).background_texture as *const _ as usize + }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL1), + "::", + stringify!(background_texture) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).background_width as *const _ as usize + }, + 68usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL1), + "::", + stringify!(background_width) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).background_height as *const _ as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL1), + "::", + stringify!(background_height) + ) + ); +} +impl Default for TCOD_RendererGL1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_renderer_init_gl1( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + vsync: bool, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererGL2 { + pub common: TCOD_RendererGLCommon, + pub program: u32, + pub console_textures: [u32; 3usize], + pub console_width: ::std::os::raw::c_int, + pub console_height: ::std::os::raw::c_int, + pub vertex_buffer: u32, +} +#[test] +fn bindgen_test_layout_TCOD_RendererGL2() { + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(TCOD_RendererGL2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererGL2)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).common as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(common) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).program as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(program) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).console_textures as *const _ as usize + }, + 68usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_textures) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).console_width as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).console_height as *const _ as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(console_height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vertex_buffer as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererGL2), + "::", + stringify!(vertex_buffer) + ) + ); +} +impl Default for TCOD_RendererGL2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + pub fn TCOD_renderer_new_gl2( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + vsync: bool, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Texture { + _unused: [u8; 0], +} +#[doc = "An SDL2 tileset atlas. This prepares a tileset for use with SDL2."] +#[doc = "\\rst"] +#[doc = ".. versionadded:: 1.16"] +#[doc = "\\endrst"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_TilesetAtlasSDL2 { + #[doc = " The renderer used to create this atlas."] + pub renderer: *mut SDL_Renderer, + #[doc = " The atlas texture."] + pub texture: *mut SDL_Texture, + #[doc = " The tileset used to create this atlas. Internal use only."] + pub tileset: *mut TCOD_Tileset, + #[doc = " Internal use only."] + pub observer: *mut TCOD_TilesetObserver, + #[doc = " Internal use only."] + pub texture_columns: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_TCOD_TilesetAtlasSDL2() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(TCOD_TilesetAtlasSDL2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_TilesetAtlasSDL2)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).renderer as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(renderer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(texture) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tileset as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(tileset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).observer as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(observer) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).texture_columns as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_TilesetAtlasSDL2), + "::", + stringify!(texture_columns) + ) + ); +} +impl Default for TCOD_TilesetAtlasSDL2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[doc = "The renderer data for an SDL2 rendering context."] +#[doc = "Internal use only."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_RendererSDL2 { + pub window: *mut SDL_Window, + pub renderer: *mut SDL_Renderer, + pub atlas: *mut TCOD_TilesetAtlasSDL2, + pub cache_console: *mut TCOD_Console, + pub cache_texture: *mut SDL_Texture, + pub sdl_subsystems: u32, + pub last_offset_x: f64, + pub last_offset_y: f64, + pub last_scale_x: f64, + pub last_scale_y: f64, +} +#[test] +fn bindgen_test_layout_TCOD_RendererSDL2() { + assert_eq!( + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(TCOD_RendererSDL2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(TCOD_RendererSDL2)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).window as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(window) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).renderer as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(renderer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).atlas as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(atlas) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cache_console as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(cache_console) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cache_texture as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(cache_texture) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).sdl_subsystems as *const _ as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(sdl_subsystems) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_offset_x as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_offset_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_offset_y as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_offset_y) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_scale_x as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_scale_x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).last_scale_y as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(TCOD_RendererSDL2), + "::", + stringify!(last_scale_y) + ) + ); +} +impl Default for TCOD_RendererSDL2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +extern "C" { + #[doc = "Return a libtcod rendering context using an SDL2 renderer."] + pub fn TCOD_renderer_init_sdl2( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + title: *const ::std::os::raw::c_char, + window_flags: ::std::os::raw::c_int, + renderer_flags: ::std::os::raw::c_int, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_Context; +} +extern "C" { + #[doc = "Return a new SDL2 atlas created from a tileset for an SDL2 renderer."] + #[doc = ""] + #[doc = "You may delete the tileset if you no longer have use for it."] + #[doc = ""] + #[doc = "Will return NULL on an error, you can check the error with"] + #[doc = "`TCOD_get_error`."] + pub fn TCOD_sdl2_atlas_new( + renderer: *mut SDL_Renderer, + tileset: *mut TCOD_Tileset, + ) -> *mut TCOD_TilesetAtlasSDL2; +} +extern "C" { + #[doc = "Delete an SDL2 tileset atlas."] + pub fn TCOD_sdl2_atlas_delete(atlas: *mut TCOD_TilesetAtlasSDL2); +} +extern "C" { + #[doc = "Render a console onto a managed target texture."] + #[doc = ""] + #[doc = "`atlas` is an SDL2 atlas created with `TCOD_sdl2_atlas_new`."] + #[doc = "The renderer used to make this `atlas` must support"] + #[doc = "`SDL_RENDERER_TARGETTEXTURE`, unless `target` is NULL."] + #[doc = ""] + #[doc = "`console` is a non-NULL pointer to the libtcod console you want to render."] + #[doc = ""] + #[doc = "`cache` can be NULL, or be pointer to a console pointer."] + #[doc = "If `*cache` is NULL then a console will be created."] + #[doc = "If `*cache` isn't NULL then the console pointed to might be deleted or"] + #[doc = "recreated, especially if it does not match the size of `console`."] + #[doc = ""] + #[doc = "`target` can be NULL, or be pointer to where you want the output texture"] + #[doc = "to be placed."] + #[doc = "The texture at `*target` may be deleted or recreated. When this function"] + #[doc = "is successful then the texture at `*target` will be non-NULL and will be"] + #[doc = "exactly fitted to the size of `console` and the tile size of `atlas`."] + #[doc = ""] + #[doc = "If `target` is NULL when the current render target is used instead, the"] + #[doc = "drawn area will not be scaled to fit the render target."] + #[doc = ""] + #[doc = "If SDL2 ever provides a `SDL_RENDER_TARGETS_RESET` event then the console"] + #[doc = "at `*cache` must be deleted and set to NULL, or else the next render will"] + #[doc = "only partially update the texture at `*target`."] + #[doc = ""] + #[doc = "Returns a negative value on an error, check `TCOD_get_error`."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_sdl2_render_texture( + atlas: *const TCOD_TilesetAtlasSDL2, + console: *const TCOD_Console, + cache: *mut *mut TCOD_Console, + target: *mut *mut SDL_Texture, + ) -> TCOD_Error; +} +extern "C" { + pub fn TCOD_sys_startup(); +} +extern "C" { + pub fn TCOD_sys_shutdown(); +} +extern "C" { + pub fn TCOD_sys_elapsed_milli() -> u32; +} +extern "C" { + pub fn TCOD_sys_elapsed_seconds() -> f32; +} +extern "C" { + pub fn TCOD_sys_sleep_milli(val: u32); +} +extern "C" { + pub fn TCOD_sys_set_fps(val: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_sys_get_fps() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_sys_get_last_frame_length() -> f32; +} +extern "C" { + pub fn TCOD_sys_save_screenshot(filename: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_sys_force_fullscreen_resolution( + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_set_renderer(renderer: TCOD_renderer_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_sys_get_renderer() -> TCOD_renderer_t; +} +extern "C" { + pub fn TCOD_sys_get_current_resolution( + w: *mut ::std::os::raw::c_int, + h: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_fullscreen_offsets( + offx: *mut ::std::os::raw::c_int, + offy: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_char_size(w: *mut ::std::os::raw::c_int, h: *mut ::std::os::raw::c_int); +} +extern "C" { + #[doc = " Upload a tile to the active tileset."] + #[doc = ""] + #[doc = " `asciiCode` is the Unicode codepoint for this tile."] + #[doc = ""] + #[doc = " `fontx` and `fonty` are the tile-coordinates on the active tilemap."] + #[doc = ""] + #[doc = " `img` is the tile to upload."] + #[doc = ""] + #[doc = " `x` and `y` are the upper-left pixel-coordinates of the tile on the `img`."] + pub fn TCOD_sys_update_char( + asciiCode: ::std::os::raw::c_int, + fontx: ::std::os::raw::c_int, + fonty: ::std::os::raw::c_int, + img: TCOD_image_t, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_sys_get_SDL_window() -> *mut SDL_Window; +} +extern "C" { + pub fn TCOD_sys_get_SDL_renderer() -> *mut SDL_Renderer; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum TCOD_event_t { + TCOD_EVENT_NONE = 0, + TCOD_EVENT_KEY_PRESS = 1, + TCOD_EVENT_KEY_RELEASE = 2, + TCOD_EVENT_KEY = 3, + TCOD_EVENT_MOUSE_MOVE = 4, + TCOD_EVENT_MOUSE_PRESS = 8, + TCOD_EVENT_MOUSE_RELEASE = 16, + TCOD_EVENT_MOUSE = 28, + TCOD_EVENT_FINGER_MOVE = 32, + TCOD_EVENT_FINGER_PRESS = 64, + TCOD_EVENT_FINGER_RELEASE = 128, + TCOD_EVENT_FINGER = 224, + TCOD_EVENT_ANY = 255, +} +extern "C" { + pub fn TCOD_sys_wait_for_event( + eventMask: ::std::os::raw::c_int, + key: *mut TCOD_key_t, + mouse: *mut TCOD_mouse_t, + flush: bool, + ) -> TCOD_event_t; +} +extern "C" { + pub fn TCOD_sys_check_for_event( + eventMask: ::std::os::raw::c_int, + key: *mut TCOD_key_t, + mouse: *mut TCOD_mouse_t, + ) -> TCOD_event_t; +} +extern "C" { + pub fn TCOD_sys_create_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_delete_file(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_delete_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_is_directory(path: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_get_directory_content( + path: *const ::std::os::raw::c_char, + pattern: *const ::std::os::raw::c_char, + ) -> TCOD_list_t; +} +extern "C" { + pub fn TCOD_sys_file_exists(filename: *const ::std::os::raw::c_char, ...) -> bool; +} +extern "C" { + pub fn TCOD_sys_read_file( + filename: *const ::std::os::raw::c_char, + buf: *mut *mut ::std::os::raw::c_uchar, + size: *mut size_t, + ) -> bool; +} +extern "C" { + pub fn TCOD_sys_write_file( + filename: *const ::std::os::raw::c_char, + buf: *mut ::std::os::raw::c_uchar, + size: u32, + ) -> bool; +} +extern "C" { + pub fn TCOD_sys_clipboard_set(value: *const ::std::os::raw::c_char) -> bool; +} +extern "C" { + pub fn TCOD_sys_clipboard_get() -> *mut ::std::os::raw::c_char; +} +pub type TCOD_thread_t = *mut ::std::os::raw::c_void; +pub type TCOD_semaphore_t = *mut ::std::os::raw::c_void; +pub type TCOD_mutex_t = *mut ::std::os::raw::c_void; +pub type TCOD_cond_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_thread_new( + func: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, + >, + data: *mut ::std::os::raw::c_void, + ) -> TCOD_thread_t; +} +extern "C" { + pub fn TCOD_thread_delete(th: TCOD_thread_t); +} +extern "C" { + pub fn TCOD_sys_get_num_cores() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_thread_wait(th: TCOD_thread_t); +} +extern "C" { + pub fn TCOD_mutex_new() -> TCOD_mutex_t; +} +extern "C" { + pub fn TCOD_mutex_in(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_mutex_out(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_mutex_delete(mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_semaphore_new(initVal: ::std::os::raw::c_int) -> TCOD_semaphore_t; +} +extern "C" { + pub fn TCOD_semaphore_lock(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_semaphore_unlock(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_semaphore_delete(sem: TCOD_semaphore_t); +} +extern "C" { + pub fn TCOD_condition_new() -> TCOD_cond_t; +} +extern "C" { + pub fn TCOD_condition_signal(sem: TCOD_cond_t); +} +extern "C" { + pub fn TCOD_condition_broadcast(sem: TCOD_cond_t); +} +extern "C" { + pub fn TCOD_condition_wait(sem: TCOD_cond_t, mut_: TCOD_mutex_t); +} +extern "C" { + pub fn TCOD_condition_delete(sem: TCOD_cond_t); +} +pub type TCOD_library_t = *mut ::std::os::raw::c_void; +extern "C" { + pub fn TCOD_load_library(path: *const ::std::os::raw::c_char) -> TCOD_library_t; +} +extern "C" { + pub fn TCOD_get_function_address( + library: TCOD_library_t, + function_name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn TCOD_close_library(arg1: TCOD_library_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SDL_Surface { + _unused: [u8; 0], +} +pub type SDL_renderer_t = + ::std::option::Option; +extern "C" { + pub fn TCOD_sys_register_SDL_renderer(renderer: SDL_renderer_t); +} +extern "C" { + #[doc = "Load a BDF font from a file path."] + #[doc = ""] + #[doc = "For the best results, you should use a BDF font with a cell-based"] + #[doc = "monospace alignment."] + #[doc = ""] + #[doc = "May return NULL on failure. See `TCOD_get_error` for the error message."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_load_bdf(path: *const ::std::os::raw::c_char) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Load a BDF font from memory."] + #[doc = ""] + #[doc = "`size` is the byte length of `buffer`. `buffer` is the BDF data to load."] + #[doc = ""] + #[doc = "May return NULL on failure. See `TCOD_get_error` for the error message."] + #[doc = ""] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_load_bdf_memory( + size: ::std::os::raw::c_int, + buffer: *const ::std::os::raw::c_uchar, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Try to return a fall-back Tileset, may return NULL."] + #[doc = ""] + #[doc = " Used when one is needed, but was not provided by the user."] + pub fn TCOD_tileset_load_fallback_font_( + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = "Render a console to a SDL_Surface with a software renderer."] + #[doc = ""] + #[doc = "`tileset` is the tiles to render with, must not be NULL."] + #[doc = ""] + #[doc = "`console` is the console to render, must not be NULL."] + #[doc = ""] + #[doc = "`cache` is an optional pointer to a consoled used as a cache. The console"] + #[doc = "at `*cache` will be created or modified. The `cache` will be used to skip"] + #[doc = "drawing already drawn tiles on any subsequent calls."] + #[doc = ""] + #[doc = "`surface_out` is a pointer to where to put the surface will be managed."] + #[doc = "The surface at `*surface_out` will be created or modified and will change"] + #[doc = "to match the size of `console` and `tileset`. The pixel format will be"] + #[doc = "SDL_PIXELFORMAT_RGBA32."] + #[doc = ""] + #[doc = "Returns a negative value on error, see `TCOD_get_error`."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_tileset_render_to_surface( + tileset: *const TCOD_Tileset, + console: *const TCOD_Console, + cache: *mut *mut TCOD_Console, + surface_out: *mut *mut SDL_Surface, + ) -> TCOD_Error; +} +extern "C" { + #[doc = " Return a tileset from a TrueType font file."] + pub fn TCOD_load_truetype_font_( + path: *const ::std::os::raw::c_char, + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> *mut TCOD_Tileset; +} +extern "C" { + #[doc = " Set the global tileset from a TrueType font file."] + pub fn TCOD_tileset_load_truetype_( + path: *const ::std::os::raw::c_char, + tile_width: ::std::os::raw::c_int, + tile_height: ::std::os::raw::c_int, + ) -> TCOD_Error; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Text { + _unused: [u8; 0], +} +pub type TCOD_text_t = *mut TCOD_Text; +extern "C" { + pub fn TCOD_text_init( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + max_chars: ::std::os::raw::c_int, + ) -> TCOD_text_t; +} +extern "C" { + pub fn TCOD_text_init2( + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + max_chars: ::std::os::raw::c_int, + ) -> TCOD_text_t; +} +extern "C" { + pub fn TCOD_text_set_pos(txt: TCOD_text_t, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_text_set_properties( + txt: TCOD_text_t, + cursor_char: ::std::os::raw::c_int, + blink_interval: ::std::os::raw::c_int, + prompt: *const ::std::os::raw::c_char, + tab_size: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn TCOD_text_set_colors( + txt: TCOD_text_t, + fore: TCOD_color_t, + back: TCOD_color_t, + back_transparency: f32, + ); +} +extern "C" { + pub fn TCOD_text_update(txt: TCOD_text_t, key: TCOD_key_t) -> bool; +} +extern "C" { + pub fn TCOD_text_render(txt: TCOD_text_t, con: TCOD_console_t); +} +extern "C" { + pub fn TCOD_text_get(txt: TCOD_text_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_text_reset(txt: TCOD_text_t); +} +extern "C" { + pub fn TCOD_text_delete(txt: TCOD_text_t); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCOD_Zip { + _unused: [u8; 0], +} +pub type TCOD_zip_t = *mut TCOD_Zip; +extern "C" { + pub fn TCOD_zip_new() -> TCOD_zip_t; +} +extern "C" { + pub fn TCOD_zip_delete(zip: TCOD_zip_t); +} +extern "C" { + pub fn TCOD_zip_put_char(zip: TCOD_zip_t, val: ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_zip_put_int(zip: TCOD_zip_t, val: ::std::os::raw::c_int); +} +extern "C" { + pub fn TCOD_zip_put_float(zip: TCOD_zip_t, val: f32); +} +extern "C" { + pub fn TCOD_zip_put_string(zip: TCOD_zip_t, val: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn TCOD_zip_put_color(zip: TCOD_zip_t, val: TCOD_color_t); +} +extern "C" { + pub fn TCOD_zip_put_image(zip: TCOD_zip_t, val: TCOD_image_t); +} +extern "C" { + pub fn TCOD_zip_put_console(zip: TCOD_zip_t, val: *const TCOD_Console); +} +extern "C" { + #[doc = "Write a TCOD_Random* object."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_zip_put_random(zip: TCOD_zip_t, val: *const TCOD_Random); +} +extern "C" { + pub fn TCOD_zip_put_data( + zip: TCOD_zip_t, + nbBytes: ::std::os::raw::c_int, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn TCOD_zip_get_current_bytes(zip: TCOD_zip_t) -> u32; +} +extern "C" { + pub fn TCOD_zip_save_to_file( + zip: TCOD_zip_t, + filename: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_load_from_file( + zip: TCOD_zip_t, + filename: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_char(zip: TCOD_zip_t) -> ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_zip_get_int(zip: TCOD_zip_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_float(zip: TCOD_zip_t) -> f32; +} +extern "C" { + pub fn TCOD_zip_get_string(zip: TCOD_zip_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn TCOD_zip_get_color(zip: TCOD_zip_t) -> TCOD_color_t; +} +extern "C" { + pub fn TCOD_zip_get_image(zip: TCOD_zip_t) -> TCOD_image_t; +} +extern "C" { + pub fn TCOD_zip_get_console(zip: TCOD_zip_t) -> TCOD_console_t; +} +extern "C" { + #[doc = "Read a TCOD_Random* object."] + #[doc = "\\rst"] + #[doc = ".. versionadded:: 1.16"] + #[doc = "\\endrst"] + pub fn TCOD_zip_get_random(zip: TCOD_zip_t) -> TCOD_random_t; +} +extern "C" { + pub fn TCOD_zip_get_data( + zip: TCOD_zip_t, + nbBytes: ::std::os::raw::c_int, + data: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TCOD_zip_get_remaining_bytes(zip: TCOD_zip_t) -> u32; +} +extern "C" { + pub fn TCOD_zip_skip_bytes(zip: TCOD_zip_t, nbBytes: u32); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SDL_Event { + _unused: [u8; 0], +} +extern "C" { + #[doc = " Parse an SDL_Event into a key event and return the relevant TCOD_event_t."] + #[doc = ""] + #[doc = " Returns TCOD_EVENT_NONE if the event wasn't keyboard related."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_process_key_event(in_: *const SDL_Event, out: *mut TCOD_key_t) -> TCOD_event_t; +} +extern "C" { + #[doc = " Parse an SDL_Event into a mouse event and return the relevant TCOD_event_t."] + #[doc = ""] + #[doc = " Returns TCOD_EVENT_NONE if the event wasn't mouse related."] + #[doc = " \\rst"] + #[doc = " .. versionadded:: 1.11"] + #[doc = " \\endrst"] + pub fn TCOD_sys_process_mouse_event( + in_: *const SDL_Event, + out: *mut TCOD_mouse_t, + ) -> TCOD_event_t; +} +pub type __builtin_va_list = *mut ::std::os::raw::c_char; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct lconv { + pub _address: u8, +} diff --git a/tcod_sys/x86_64-pc-windows-msvc_bindings.rs b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs index 661b04a0a..6941f17df 100644 --- a/tcod_sys/x86_64-pc-windows-msvc_bindings.rs +++ b/tcod_sys/x86_64-pc-windows-msvc_bindings.rs @@ -282,8 +282,8 @@ pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4: u32 = 1; pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8: u32 = 1; pub const _WIN32: u32 = 1; pub const _WIN64: u32 = 1; -pub const _MSC_VER: u32 = 1921; -pub const _MSC_FULL_VER: u32 = 192127702; +pub const _MSC_VER: u32 = 1900; +pub const _MSC_FULL_VER: u32 = 190024241; pub const _MSC_BUILD: u32 = 1; pub const _MSC_EXTENSIONS: u32 = 1; pub const _INTEGRAL_MAX_BITS: u32 = 64; @@ -305,6 +305,7 @@ pub const _CRT_FUNCTIONS_REQUIRED: u32 = 1; pub const _CRT_HAS_CXX17: u32 = 0; pub const _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE: u32 = 1; pub const _CRT_BUILD_DESKTOP_APP: u32 = 1; +pub const _CRT_INTERNAL_NONSTDC_NAMES: u32 = 1; pub const __STDC_SECURE_LIB__: u32 = 200411; pub const __GOT_SECURE_LIB__: u32 = 200411; pub const __STDC_WANT_SECURE_LIB__: u32 = 1; diff --git a/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs b/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs index e5e8e9ddb..693affc52 100644 --- a/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs +++ b/tcod_sys/x86_64-unknown-linux-gnu_bindings.rs @@ -32,13 +32,13 @@ impl ::std::fmt::Debug for __IncompleteArrayField { } pub const __llvm__: u32 = 1; pub const __clang__: u32 = 1; -pub const __clang_major__: u32 = 10; +pub const __clang_major__: u32 = 7; pub const __clang_minor__: u32 = 0; pub const __clang_patchlevel__: u32 = 0; -pub const __clang_version__: &'static [u8; 8usize] = b"10.0.0 \0"; -pub const __GNUC__: u32 = 4; +pub const __clang_version__: &'static [u8; 31usize] = b"7.0.0 (tags/RELEASE_700/final)\0"; pub const __GNUC_MINOR__: u32 = 2; pub const __GNUC_PATCHLEVEL__: u32 = 1; +pub const __GNUC__: u32 = 4; pub const __GXX_ABI_VERSION: u32 = 1002; pub const __ATOMIC_RELAXED: u32 = 0; pub const __ATOMIC_CONSUME: u32 = 1; @@ -52,7 +52,8 @@ pub const __OPENCL_MEMORY_SCOPE_DEVICE: u32 = 2; pub const __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES: u32 = 3; pub const __OPENCL_MEMORY_SCOPE_SUB_GROUP: u32 = 4; pub const __PRAGMA_REDEFINE_EXTNAME: u32 = 1; -pub const __VERSION__: &'static [u8; 14usize] = b"Clang 10.0.0 \0"; +pub const __VERSION__: &'static [u8; 54usize] = + b"4.2.1 Compatible Clang 7.0.0 (tags/RELEASE_700/final)\0"; pub const __OBJC_BOOL_IS_BOOL: u32 = 0; pub const __CONSTANT_CFSTRINGS__: u32 = 1; pub const __ORDER_LITTLE_ENDIAN__: u32 = 1234; @@ -117,6 +118,16 @@ pub const __UINTPTR_FMTu__: &'static [u8; 3usize] = b"lu\0"; pub const __UINTPTR_FMTx__: &'static [u8; 3usize] = b"lx\0"; pub const __UINTPTR_FMTX__: &'static [u8; 3usize] = b"lX\0"; pub const __UINTPTR_WIDTH__: u32 = 64; +pub const __FLT16_HAS_DENORM__: u32 = 1; +pub const __FLT16_DIG__: u32 = 3; +pub const __FLT16_DECIMAL_DIG__: u32 = 5; +pub const __FLT16_HAS_INFINITY__: u32 = 1; +pub const __FLT16_HAS_QUIET_NAN__: u32 = 1; +pub const __FLT16_MANT_DIG__: u32 = 11; +pub const __FLT16_MAX_10_EXP__: u32 = 4; +pub const __FLT16_MAX_EXP__: u32 = 15; +pub const __FLT16_MIN_10_EXP__: i32 = -13; +pub const __FLT16_MIN_EXP__: i32 = -14; pub const __FLT_HAS_DENORM__: u32 = 1; pub const __FLT_DIG__: u32 = 6; pub const __FLT_DECIMAL_DIG__: u32 = 9; @@ -273,14 +284,10 @@ pub const __NO_INLINE__: u32 = 1; pub const __FLT_EVAL_METHOD__: u32 = 0; pub const __FLT_RADIX__: u32 = 2; pub const __DECIMAL_DIG__: u32 = 21; -pub const __GCC_ASM_FLAG_OUTPUTS__: u32 = 1; -pub const __code_model_small_: u32 = 1; pub const __amd64__: u32 = 1; pub const __amd64: u32 = 1; pub const __x86_64: u32 = 1; pub const __x86_64__: u32 = 1; -pub const __SEG_GS: u32 = 1; -pub const __SEG_FS: u32 = 1; pub const __k8: u32 = 1; pub const __k8__: u32 = 1; pub const __tune_k8__: u32 = 1; @@ -302,8 +309,8 @@ pub const __unix__: u32 = 1; pub const linux: u32 = 1; pub const __linux: u32 = 1; pub const __linux__: u32 = 1; -pub const __ELF__: u32 = 1; pub const __gnu_linux__: u32 = 1; +pub const __ELF__: u32 = 1; pub const __FLOAT128__: u32 = 1; pub const __STDC__: u32 = 1; pub const __STDC_HOSTED__: u32 = 1; @@ -313,7 +320,6 @@ pub const __STDC_UTF_32__: u32 = 1; pub const _WCHAR_H: u32 = 1; pub const _FEATURES_H: u32 = 1; pub const _DEFAULT_SOURCE: u32 = 1; -pub const __GLIBC_USE_ISOC2X: u32 = 0; pub const __USE_ISOC11: u32 = 1; pub const __USE_ISOC99: u32 = 1; pub const __USE_ISOC95: u32 = 1; @@ -330,71 +336,31 @@ pub const _ATFILE_SOURCE: u32 = 1; pub const __USE_MISC: u32 = 1; pub const __USE_ATFILE: u32 = 1; pub const __USE_FORTIFY_LEVEL: u32 = 0; -pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; -pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; pub const _STDC_PREDEF_H: u32 = 1; pub const __STDC_IEC_559__: u32 = 1; pub const __STDC_IEC_559_COMPLEX__: u32 = 1; -pub const __STDC_ISO_10646__: u32 = 201706; +pub const __STDC_ISO_10646__: u32 = 201505; +pub const __STDC_NO_THREADS__: u32 = 1; pub const __GNU_LIBRARY__: u32 = 6; pub const __GLIBC__: u32 = 2; -pub const __GLIBC_MINOR__: u32 = 31; +pub const __GLIBC_MINOR__: u32 = 23; pub const _SYS_CDEFS_H: u32 = 1; -pub const __glibc_c99_flexarr_available: u32 = 1; pub const __WORDSIZE: u32 = 64; pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; pub const __SYSCALL_WORDSIZE: u32 = 64; -pub const __LONG_DOUBLE_USES_FLOAT128: u32 = 0; -pub const __HAVE_GENERIC_SELECTION: u32 = 1; -pub const __GLIBC_USE_LIB_EXT2: u32 = 0; -pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0; -pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; -pub const __HAVE_FLOAT128: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT128: u32 = 0; -pub const __HAVE_FLOAT64X: u32 = 1; -pub const __HAVE_FLOAT64X_LONG_DOUBLE: u32 = 1; -pub const __HAVE_FLOAT16: u32 = 0; -pub const __HAVE_FLOAT32: u32 = 1; -pub const __HAVE_FLOAT64: u32 = 1; -pub const __HAVE_FLOAT32X: u32 = 1; -pub const __HAVE_FLOAT128X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT16: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT32: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT64: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT32X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT64X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT128X: u32 = 0; -pub const __HAVE_FLOATN_NOT_TYPEDEF: u32 = 0; +pub const __FILE_defined: u32 = 1; +pub const ____FILE_defined: u32 = 1; pub const __GNUC_VA_LIST: u32 = 1; pub const _BITS_WCHAR_H: u32 = 1; pub const __WCHAR_MAX: u32 = 2147483647; pub const __WCHAR_MIN: i32 = -2147483648; -pub const __wint_t_defined: u32 = 1; -pub const _WINT_T: u32 = 1; -pub const __mbstate_t_defined: u32 = 1; pub const ____mbstate_t_defined: u32 = 1; -pub const ____FILE_defined: u32 = 1; -pub const __FILE_defined: u32 = 1; -pub const _BITS_TYPES_LOCALE_T_H: u32 = 1; -pub const _BITS_TYPES___LOCALE_T_H: u32 = 1; +pub const __mbstate_t_defined: u32 = 1; pub const WCHAR_MIN: i32 = -2147483648; pub const WCHAR_MAX: u32 = 2147483647; pub const WEOF: u32 = 4294967295; +pub const _XLOCALE_H: u32 = 1; pub const _STDINT_H: u32 = 1; -pub const _BITS_TYPES_H: u32 = 1; -pub const __TIMESIZE: u32 = 64; -pub const _BITS_TYPESIZES_H: u32 = 1; -pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; -pub const __INO_T_MATCHES_INO64_T: u32 = 1; -pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; -pub const __STATFS_MATCHES_STATFS64: u32 = 1; -pub const __FD_SETSIZE: u32 = 1024; -pub const _BITS_TIME64_H: u32 = 1; -pub const _BITS_STDINT_INTN_H: u32 = 1; -pub const _BITS_STDINT_UINTN_H: u32 = 1; pub const INT8_MIN: i32 = -128; pub const INT16_MIN: i32 = -32768; pub const INT32_MIN: i32 = -2147483648; @@ -468,14 +434,17 @@ pub const TCOD_LEX_KEYWORD_SIZE: u32 = 20; pub const TCOD_HEAP_DEFAULT_CAPACITY: u32 = 256; pub const TCOD_HEAP_MAX_NODE_SIZE: u32 = 256; pub const TCOD_PATHFINDER_MAX_DIMENSIONS: u32 = 4; -pub type _Float32 = f32; -pub type _Float64 = f64; -pub type _Float32x = f64; -pub type _Float64x = u128; -pub type size_t = ::std::os::raw::c_ulong; -pub type wchar_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IO_FILE { + _unused: [u8; 0], +} +pub type FILE = _IO_FILE; +pub type __FILE = _IO_FILE; pub type va_list = __builtin_va_list; pub type __gnuc_va_list = __builtin_va_list; +pub type size_t = ::std::os::raw::c_ulong; +pub type wchar_t = ::std::os::raw::c_int; pub type wint_t = ::std::os::raw::c_uint; #[repr(C)] #[derive(Copy, Clone)] @@ -571,11 +540,44 @@ impl Default for __mbstate_t { pub type mbstate_t = __mbstate_t; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _IO_FILE { +pub struct tm { _unused: [u8; 0], } -pub type __FILE = _IO_FILE; -pub type FILE = _IO_FILE; +extern "C" { + pub fn wcscpy(__dest: *mut wchar_t, __src: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsncpy(__dest: *mut wchar_t, __src: *const wchar_t, __n: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscat(__dest: *mut wchar_t, __src: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsncat(__dest: *mut wchar_t, __src: *const wchar_t, __n: size_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscmp( + __s1: *const ::std::os::raw::c_int, + __s2: *const ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsncmp( + __s1: *const ::std::os::raw::c_int, + __s2: *const ::std::os::raw::c_int, + __n: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcscasecmp(__s1: *const wchar_t, __s2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsncasecmp( + __s1: *const wchar_t, + __s2: *const wchar_t, + __n: size_t, + ) -> ::std::os::raw::c_int; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __locale_struct { @@ -655,51 +657,11 @@ impl Default for __locale_struct { } pub type __locale_t = *mut __locale_struct; pub type locale_t = __locale_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct tm { - _unused: [u8; 0], -} -extern "C" { - pub fn wcscpy(__dest: *mut wchar_t, __src: *const wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcsncpy(__dest: *mut wchar_t, __src: *const wchar_t, __n: size_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcscat(__dest: *mut wchar_t, __src: *const wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcsncat(__dest: *mut wchar_t, __src: *const wchar_t, __n: size_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcscmp( - __s1: *const ::std::os::raw::c_int, - __s2: *const ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcsncmp( - __s1: *const ::std::os::raw::c_int, - __s2: *const ::std::os::raw::c_int, - __n: ::std::os::raw::c_ulong, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcscasecmp(__s1: *const wchar_t, __s2: *const wchar_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcsncasecmp( - __s1: *const wchar_t, - __s2: *const wchar_t, - __n: size_t, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn wcscasecmp_l( __s1: *const wchar_t, __s2: *const wchar_t, - __loc: locale_t, + __loc: __locale_t, ) -> ::std::os::raw::c_int; } extern "C" { @@ -707,7 +669,7 @@ extern "C" { __s1: *const wchar_t, __s2: *const wchar_t, __n: size_t, - __loc: locale_t, + __loc: __locale_t, ) -> ::std::os::raw::c_int; } extern "C" { @@ -720,7 +682,7 @@ extern "C" { pub fn wcscoll_l( __s1: *const wchar_t, __s2: *const wchar_t, - __loc: locale_t, + __loc: __locale_t, ) -> ::std::os::raw::c_int; } extern "C" { @@ -728,7 +690,7 @@ extern "C" { __s1: *mut wchar_t, __s2: *const wchar_t, __n: size_t, - __loc: locale_t, + __loc: __locale_t, ) -> size_t; } extern "C" { @@ -783,18 +745,10 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - pub fn wmemcpy( - __s1: *mut ::std::os::raw::c_int, - __s2: *const ::std::os::raw::c_int, - __n: ::std::os::raw::c_ulong, - ) -> *mut ::std::os::raw::c_int; + pub fn wmemcpy(__s1: *mut wchar_t, __s2: *const wchar_t, __n: size_t) -> *mut wchar_t; } extern "C" { - pub fn wmemmove( - __s1: *mut ::std::os::raw::c_int, - __s2: *const ::std::os::raw::c_int, - __n: ::std::os::raw::c_ulong, - ) -> *mut ::std::os::raw::c_int; + pub fn wmemmove(__s1: *mut wchar_t, __s2: *const wchar_t, __n: size_t) -> *mut wchar_t; } extern "C" { pub fn wmemset(__s: *mut wchar_t, __c: wchar_t, __n: size_t) -> *mut wchar_t; @@ -1042,103 +996,14 @@ extern "C" { __tp: *const tm, ) -> size_t; } -pub type __u_char = ::std::os::raw::c_uchar; -pub type __u_short = ::std::os::raw::c_ushort; -pub type __u_int = ::std::os::raw::c_uint; -pub type __u_long = ::std::os::raw::c_ulong; -pub type __int8_t = ::std::os::raw::c_schar; -pub type __uint8_t = ::std::os::raw::c_uchar; -pub type __int16_t = ::std::os::raw::c_short; -pub type __uint16_t = ::std::os::raw::c_ushort; -pub type __int32_t = ::std::os::raw::c_int; -pub type __uint32_t = ::std::os::raw::c_uint; -pub type __int64_t = ::std::os::raw::c_long; -pub type __uint64_t = ::std::os::raw::c_ulong; -pub type __int_least8_t = __int8_t; -pub type __uint_least8_t = __uint8_t; -pub type __int_least16_t = __int16_t; -pub type __uint_least16_t = __uint16_t; -pub type __int_least32_t = __int32_t; -pub type __uint_least32_t = __uint32_t; -pub type __int_least64_t = __int64_t; -pub type __uint_least64_t = __uint64_t; -pub type __quad_t = ::std::os::raw::c_long; -pub type __u_quad_t = ::std::os::raw::c_ulong; -pub type __intmax_t = ::std::os::raw::c_long; -pub type __uintmax_t = ::std::os::raw::c_ulong; -pub type __dev_t = ::std::os::raw::c_ulong; -pub type __uid_t = ::std::os::raw::c_uint; -pub type __gid_t = ::std::os::raw::c_uint; -pub type __ino_t = ::std::os::raw::c_ulong; -pub type __ino64_t = ::std::os::raw::c_ulong; -pub type __mode_t = ::std::os::raw::c_uint; -pub type __nlink_t = ::std::os::raw::c_ulong; -pub type __off_t = ::std::os::raw::c_long; -pub type __off64_t = ::std::os::raw::c_long; -pub type __pid_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct __fsid_t { - pub __val: [::std::os::raw::c_int; 2usize], -} -#[test] -fn bindgen_test_layout___fsid_t() { - assert_eq!( - ::std::mem::size_of::<__fsid_t>(), - 8usize, - concat!("Size of: ", stringify!(__fsid_t)) - ); - assert_eq!( - ::std::mem::align_of::<__fsid_t>(), - 4usize, - concat!("Alignment of ", stringify!(__fsid_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__fsid_t>())).__val as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__fsid_t), - "::", - stringify!(__val) - ) - ); -} -pub type __clock_t = ::std::os::raw::c_long; -pub type __rlim_t = ::std::os::raw::c_ulong; -pub type __rlim64_t = ::std::os::raw::c_ulong; -pub type __id_t = ::std::os::raw::c_uint; -pub type __time_t = ::std::os::raw::c_long; -pub type __useconds_t = ::std::os::raw::c_uint; -pub type __suseconds_t = ::std::os::raw::c_long; -pub type __daddr_t = ::std::os::raw::c_int; -pub type __key_t = ::std::os::raw::c_int; -pub type __clockid_t = ::std::os::raw::c_int; -pub type __timer_t = *mut ::std::os::raw::c_void; -pub type __blksize_t = ::std::os::raw::c_long; -pub type __blkcnt_t = ::std::os::raw::c_long; -pub type __blkcnt64_t = ::std::os::raw::c_long; -pub type __fsblkcnt_t = ::std::os::raw::c_ulong; -pub type __fsblkcnt64_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt64_t = ::std::os::raw::c_ulong; -pub type __fsword_t = ::std::os::raw::c_long; -pub type __ssize_t = ::std::os::raw::c_long; -pub type __syscall_slong_t = ::std::os::raw::c_long; -pub type __syscall_ulong_t = ::std::os::raw::c_ulong; -pub type __loff_t = __off64_t; -pub type __caddr_t = *mut ::std::os::raw::c_char; -pub type __intptr_t = ::std::os::raw::c_long; -pub type __socklen_t = ::std::os::raw::c_uint; -pub type __sig_atomic_t = ::std::os::raw::c_int; -pub type int_least8_t = __int_least8_t; -pub type int_least16_t = __int_least16_t; -pub type int_least32_t = __int_least32_t; -pub type int_least64_t = __int_least64_t; -pub type uint_least8_t = __uint_least8_t; -pub type uint_least16_t = __uint_least16_t; -pub type uint_least32_t = __uint_least32_t; -pub type uint_least64_t = __uint_least64_t; +pub type int_least8_t = ::std::os::raw::c_schar; +pub type int_least16_t = ::std::os::raw::c_short; +pub type int_least32_t = ::std::os::raw::c_int; +pub type int_least64_t = ::std::os::raw::c_long; +pub type uint_least8_t = ::std::os::raw::c_uchar; +pub type uint_least16_t = ::std::os::raw::c_ushort; +pub type uint_least32_t = ::std::os::raw::c_uint; +pub type uint_least64_t = ::std::os::raw::c_ulong; pub type int_fast8_t = ::std::os::raw::c_schar; pub type int_fast16_t = ::std::os::raw::c_long; pub type int_fast32_t = ::std::os::raw::c_long; @@ -1147,8 +1012,8 @@ pub type uint_fast8_t = ::std::os::raw::c_uchar; pub type uint_fast16_t = ::std::os::raw::c_ulong; pub type uint_fast32_t = ::std::os::raw::c_ulong; pub type uint_fast64_t = ::std::os::raw::c_ulong; -pub type intmax_t = __intmax_t; -pub type uintmax_t = __uintmax_t; +pub type intmax_t = ::std::os::raw::c_long; +pub type uintmax_t = ::std::os::raw::c_ulong; extern "C" { pub fn TCOD_strdup(s: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } @@ -7180,26 +7045,6 @@ fn bindgen_test_layout_TCOD_HeapNode() { 4usize, concat!("Alignment of ", stringify!(TCOD_HeapNode)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).priority as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(TCOD_HeapNode), - "::", - stringify!(priority) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(TCOD_HeapNode), - "::", - stringify!(data) - ) - ); } #[repr(C)] #[derive(Debug, Copy, Clone)] From 77f3779319674d460403423f23ec6c528242f95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Wed, 1 Jul 2020 14:14:01 +0200 Subject: [PATCH 25/27] Disable i686-pc-windows-gnu for now --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f66c2db1a..a85ca9a26 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,8 +8,8 @@ environment: VS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat - TARGET: x86_64-pc-windows-gnu MSYS_BITS: 64 - - TARGET: i686-pc-windows-gnu - MSYS_BITS: 32 +# - TARGET: i686-pc-windows-gnu +# MSYS_BITS: 32 install: - ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe" - rust-nightly-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust" From a04e1336bfef4eee809fc272fd0ed2f8cee673b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Wed, 1 Jul 2020 18:59:45 +0200 Subject: [PATCH 26/27] Add myself to lists of contributors --- Cargo.toml | 1 + README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 409cbabca..f36446436 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ readme = "README.md" keywords = ["gamedev", "roguelike", "libtcod"] license = "WTFPL" authors = ["Tomas Sedovic ", + "Alexander Krivács Schrøder ", "Bastien Léonard ", "Darren Kaste ", "Edu Garcia ", diff --git a/README.md b/README.md index 2ef306b1c..2c3919d8f 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,7 @@ URL of your feature branch works). ### Contributors +* Alexander Krivács Schrøder * Bastien Léonard, @bastienleonard, * Darren Kaste, @dkaste, * Edu Garcia, @Arcnor, From 03a35b3977744069759a6e5c8521ebe471fe5f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kriv=C3=A1cs=20Schr=C3=B8der?= Date: Mon, 6 Jul 2020 20:33:13 +0200 Subject: [PATCH 27/27] Update README and crate version --- Cargo.toml | 2 +- README.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f36446436..2915af59f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tcod" description = "The Rust bindings for the Doryen library (a.k.a. libtcod)." -version = "0.15.0" +version = "0.16.0" homepage = "https://github.com/tomassedovic/tcod-rs" repository = "https://github.com/tomassedovic/tcod-rs" documentation = "http://tomassedovic.github.io/tcod-rs/tcod/index.html" diff --git a/README.md b/README.md index 2c3919d8f..c004e735a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ useful functionality such as: This project provides [Rust](http://www.rust-lang.org/) bindings for libtcod -v1.6.3. +v1.16.0-alpha.12. This project follows [Semantic Versioning](http://semver.org/). Since we're under `1.0.0` anything goes. The API can change at any time. @@ -40,7 +40,7 @@ https://libtcod.readthedocs.io/en/stable/ Current status -------------- -All raw tcod bindings are available via the `tcod-sys` crate. In addition we +All raw tcod bindings are available via the `tcod-sys` crate. In addition, we want to provide safe (and more in line with the Rust style) wrappers -- if you can segfault outside of `unsafe` blocks, that's a bug. The safe bindings are not yet complete, however. @@ -74,7 +74,7 @@ How to use this --------------- `tcod-rs` depends on `libtcod` so you need to build or download the official -version. The `libtcod` version known to work is bundled with `tcod-sys` and +version. The `libtcod` version known to work comes bundled with `tcod-sys` and Cargo will build it for you, but you need the build dependencies installed. Alternatively, you can provide the precompiled libtcod library to override the @@ -84,7 +84,7 @@ To use `tcod-rs`, add this to your game's `Cargo.toml`: ```toml [dependencies] -tcod = "0.15" +tcod = "0.16" ``` ### Building on Linux